Imported Upstream version 1.43 upstream/1.43
authorDariusz Michaluk <d.michaluk@samsung.com>
Fri, 3 Dec 2021 10:45:01 +0000 (11:45 +0100)
committerDariusz Michaluk <d.michaluk@samsung.com>
Fri, 3 Dec 2021 10:45:01 +0000 (11:45 +0100)
166 files changed:
AUTHORS
ChangeLog
Makefile.am
Makefile.in
NEWS
README
VERSION
aclocal.m4
autogen.rc
autogen.sh
build-aux/config.guess
build-aux/config.sub
config.h.in
configure
configure.ac
doc/HACKING
doc/Makefile.am
doc/Makefile.in
doc/errorref.txt
doc/gpgrt.info
doc/gpgrt.texi
doc/stamp-vti
doc/version.texi
doc/yat2m.c
lang/Makefile.in
lang/cl/Makefile.in
lang/cl/gpg-error.asd
lang/cl/mkerrcodes.awk
libgpg-error.spec
m4/Makefile.am
m4/Makefile.in
m4/ac_prog_cc_for_build.m4 [deleted file]
m4/ax_cc_for_build.m4 [new file with mode: 0644]
m4/estream.m4
m4/gnupg-misc.m4 [new file with mode: 0644]
m4/iconv.m4
m4/libtool.m4
m4/readline.m4 [new file with mode: 0644]
m4/threadlib.m4
po/LINGUAS
po/POTFILES.in
po/cs.gmo
po/cs.po
po/da.gmo
po/da.po
po/de.gmo
po/de.po
po/eo.gmo
po/eo.po
po/es.gmo [new file with mode: 0644]
po/es.po [new file with mode: 0644]
po/fr.gmo
po/fr.po
po/hu.gmo
po/hu.po
po/it.gmo
po/it.po
po/ja.gmo
po/ja.po
po/libgpg-error.pot
po/nl.gmo
po/nl.po
po/pl.gmo
po/pl.po
po/pt.gmo
po/pt.po
po/ro.gmo
po/ro.po
po/ru.gmo
po/ru.po
po/sr.gmo
po/sr.po
po/sv.gmo
po/sv.po
po/uk.gmo
po/uk.po
po/vi.gmo
po/vi.po
po/zh_CN.gmo
po/zh_CN.po
po/zh_TW.gmo
po/zh_TW.po
src/Makefile.am
src/Makefile.in
src/argparse.c [new file with mode: 0644]
src/b64dec.c
src/b64enc.c [new file with mode: 0644]
src/err-codes.h
src/err-codes.h.in
src/err-sources.h
src/err-sources.h.in
src/estream-printf.c
src/estream-printf.h
src/estream.c
src/gen-lock-obj.sh [new file with mode: 0755]
src/gpg-error-config-test.sh [new file with mode: 0755]
src/gpg-error-config-test.sh.in [new file with mode: 0644]
src/gpg-error-config.in
src/gpg-error.c
src/gpg-error.def.in
src/gpg-error.h.in
src/gpg-error.m4
src/gpg-error.pc.in [new file with mode: 0644]
src/gpg-error.vers
src/gpgrt-config [new file with mode: 0755]
src/gpgrt-config.in [new file with mode: 0644]
src/gpgrt-int.h
src/gpgrt.m4 [new file with mode: 0644]
src/init.c
src/lock.h
src/logging.c [new file with mode: 0644]
src/mkerrcodes.awk
src/mkerrcodes1.awk
src/mkerrcodes2.awk
src/mkerrnos.awk
src/mkheader.c
src/mkstrtable.awk
src/posix-lock.c
src/posix-thread.c
src/protos.h [new file with mode: 0644]
src/spawn-posix.c [new file with mode: 0644]
src/spawn-w32.c [new file with mode: 0644]
src/strerror.c
src/stringutils.c [new file with mode: 0644]
src/syscall-clamp.c [new file with mode: 0644]
src/syscfg/lock-obj-pub.aarch64-unknown-linux-gnu_ilp32.h [new file with mode: 0644]
src/syscfg/lock-obj-pub.i686-unknown-gnu.h [moved from src/syscfg/lock-obj-pub.i686-pc-gnu.h with 100% similarity]
src/syscfg/lock-obj-pub.i686-unknown-kfreebsd-gnu.h [moved from src/syscfg/lock-obj-pub.i686-pc-kfreebsd-gnu.h with 100% similarity]
src/syscfg/lock-obj-pub.i686-unknown-linux-gnu.h [moved from src/syscfg/lock-obj-pub.i686-pc-linux-gnu.h with 100% similarity]
src/syscfg/lock-obj-pub.ia64-unknown-linux-gnu.h [new file with mode: 0644]
src/syscfg/lock-obj-pub.mips64-unknown-linux-gnuabi64.h [new file with mode: 0644]
src/syscfg/lock-obj-pub.riscv32-unknown-linux-gnu.h [new file with mode: 0644]
src/syscfg/lock-obj-pub.riscv64-unknown-linux-gnu.h [new file with mode: 0644]
src/syscfg/lock-obj-pub.s390x-unknown-linux-gnu.h [moved from src/syscfg/lock-obj-pub.s390x-ibm-linux-gnu.h with 100% similarity]
src/syscfg/lock-obj-pub.x86_64-unknown-kfreebsd-gnu.h [moved from src/syscfg/lock-obj-pub.x86_64-pc-kfreebsd-gnu.h with 100% similarity]
src/syscfg/lock-obj-pub.x86_64-unknown-linux-gnu.h [moved from src/syscfg/lock-obj-pub.x86_64-pc-linux-gnu.h with 100% similarity]
src/syscfg/lock-obj-pub.x86_64-unknown-linux-gnux32.h [moved from src/syscfg/lock-obj-pub.x86_64-pc-linux-gnux32.h with 100% similarity]
src/syscfg/lock-obj-pub.x86_64-unknown-linux-musl.h [moved from src/syscfg/lock-obj-pub.x86_64-pc-linux-musl.h with 100% similarity]
src/sysutils.c [new file with mode: 0644]
src/thread.h
src/version.c
src/versioninfo.rc.in
src/visibility.c
src/visibility.h
src/w32-add.h
src/w32-estream.c
src/w32-gettext.c
src/w32-iconv.c
src/w32-lock.c
src/w32-reg.c [new file with mode: 0644]
src/w32-thread.c
tests/Makefile.am
tests/Makefile.in
tests/etc/t-argparse.conf [new file with mode: 0644]
tests/t-argparse.c [new file with mode: 0644]
tests/t-argparse.conf [new file with mode: 0644]
tests/t-b64.c [new file with mode: 0644]
tests/t-b64dec.c [deleted file]
tests/t-common.h
tests/t-lock-single-posix.c [new file with mode: 0644]
tests/t-logging.c [new file with mode: 0644]
tests/t-malloc.c [new file with mode: 0644]
tests/t-printf.c
tests/t-stringutils.c [new file with mode: 0644]
tests/t-syserror.c
tests/t-version.c

diff --git a/AUTHORS b/AUTHORS
index a8e8abe..71dd5d3 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -13,6 +13,15 @@ range, inclusive, is a copyrightable year that would otherwise be
 listed individually.
 
 
+List of Copyright holders
+=========================
+
+  Copyright (C) 2001-2020 g10 Code GmbH
+  Copyright (C) 1995-2017 Free Software Foundation, Inc.
+  Copyright (C) 1998-2006, 2008-2017  Werner Koch
+  Copyright (C) 2014 Jedi Lin
+
+
 Authors with a DCO
 ==================
 
index 8898bc7..782dd6a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2021-11-03  Werner Koch  <wk@gnupg.org>
+
+       Release 1.43.
+       + commit d7fb04832a71a2c1509d45027798f184ca274f8d
+
+
+2021-11-03  Ineiev  <ineiev@gnu.org>
+
+       po: Update Russian translation.
+       + commit 983a1b491ea6dfa7bb1868a6ac41fb9222bbe301
+
+
+2021-11-03  Werner Koch  <wk@gnupg.org>
+
+       argparse: Add more system variables.
+       + commit 62755bcd302eca755d52b80b62dc17ae0e683b75
+       * src/argparse.c (get_var): Fix "_windows", add "_gpgrtversion" and
+       "strusageN".
+       (handle_meta_if): Avoid evaluating inactive branches.
+       * tests/t-argparse.conf: Add a few other outputs.
+
+2021-10-31  Werner Koch  <wk@gnupg.org>
+
+       argparse: Add support to read values from the Windows Registry.
+       + commit b1790f4cc71f14422255bbfba78e91f037e035dd
+       * src/argparse.c (struct variable_s): New.
+       (struct _gpgrt_argparse_internal_s): New fields expand, if_cond,
+       if_active and vartbl.
+       (deinitialize): Free vartbl.
+       (initialize): Clear new vars.
+       (get_var): New.
+       (substitute_vars): New.
+       (set_variable): New.
+       (handle_meta_if): New.
+       (handle_meta_let): New.
+       (handle_meta_getenv): New.
+       (handle_meta_echo): Re-implement in terms of variabale substitution.
+       (handle_meta_expand): New.
+       (handle_metacmd): Add new meta commands.
+       (_gpgrt_argparse): Expand values if enabled.
+       (_gpgrt_argparse): Take care of conditions.
+       (_gpgrt_argparser): Reset some state at the end of a file.
+
+       * tests/etc/t-argparse.conf: Adjust for changed system variables.
+       * tests/t-argparse.c (my_strusage): Add a value for a version test.
+       (main): Add new option "street".
+       * tests/t-argparse.conf: A couple if additions for the new conditions.
+
+2021-10-22  Werner Koch  <wk@gnupg.org>
+
+       core: new internal function _gpgrt_w32_reg_get_string.
+       + commit 2a32501a561a5d70069bcb6e7e87fb949370520e
+       * src/w32-reg.c (_gpgrt_w32_reg_query_string): Allow abbreviated root
+       names.
+       (_gpgrt_w32_reg_get_string): New.
+
+2021-09-27  NIIBE Yutaka  <gniibe@fsij.org>
+
+       libtool: Link without -flat_namespace for macOS.
+       + commit a3987e44970505a5540f9702c1e41292c22b69cf
+       * m4/libtool.m4: Not setting 10.0 to MACOSX_DEPLOYMENT_TARGET when not
+       defined.  Only specify -flat_namespace to linker for specific
+       (older) versions and hosts.
+
+2021-09-10  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpgrt-config: Fix behavior when PKG_CONFIG_LIBDIR="".
+       + commit 6b08dd09864e7fbb424296ad490f9fe65c9bc247
+       * src/gpgrt-config.in: Correctly detect the case.
+
+2021-08-26  NIIBE Yutaka  <gniibe@fsij.org>
+
+       tests: Add a test for locking when single thread.
+       + commit 2b476b3ebc1d13d681594c15505844766c0fbc4b
+       * tests/Makefile.am (TESTS): Add t-lock-single-posix.
+       * tests/t-lock-single-posix.c: New.
+
+2021-08-06  NIIBE Yutaka  <gniibe@fsij.org>
+
+       posix-lock: Support GNU C library 2.34 or later.
+       + commit 67595e8244ed67910f7372873cdbf674c2e85403
+       * configure.ac: Add check for sys/single_threaded.h.
+       * src/posix-lock.c [USE_POSIX_THREADS_FROM_LIBC]: Use
+       __libc_single_threaded to detect if it's single threaded.
+
+       m4: Merge our local change for threadlib.m4.
+       + commit 8538a83fd1b5e54d7dbe6dc9042cc74942e38e51
+       * m4/threadlib.m4: Add THREADLIB_CPPFLAGS support.
+
+       m4: Update m4/threadlib.m4 from gnulib.
+       + commit 7ad1ff9673e4589880170b9f84df93510b044814
+       * m4/threadlib.m4: Update.
+
+2021-08-05  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Simplify checking headers.
+       + commit f8fe24a792321483baa7415e06640fb5077fcb13
+       * configure.ac (AC_HEADER_STDC): Remove stdlib.h.
+
+       core: Minor clean up.
+       + commit b82b0d7a8d8f69aec928a2c604c1260b34a08449
+       * src/stringutils.c: Remove inclusion of pwd.h.
+
+2021-06-21  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Fix --disable-threads.
+       + commit 220a427b4f997ef6af1b2d4e82ef1dc96e0cd6ff
+       * src/gen-lock-obj.sh: Fix generating '}}}'.
+
+2021-06-08  NIIBE Yutaka  <gniibe@fsij.org>
+
+       core: Avoid truncation of error message in the middle of a character.
+       + commit 6d19a40a8a23d9aa5d61ace247a5fea1bd103995
+       * configure.ac (AM_LANGINFO_CODESET): Add.
+       * src/strerror.c (_gpg_strerror_r): Check the boundary of character.
+
+2021-05-21  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: _DARWIN_C_SOURCE should be 1.
+       + commit f9b50dafc5d3cc9d463be17b1d9e66817d4cb41c
+       * configure.ac (*-apple-darwin*): Set _DARWIN_C_SOURCE 1.
+
+2021-05-20  Werner Koch  <wk@gnupg.org>
+
+       core: Make gpgrt_free robust against legacy free implementations.
+       + commit 448bf7b01cade87f45fb39f455f37a6aadeeceda
+       * src/init.c (_gpgrt_free): Shortcut NULL and save ERRNO.
+
+2021-04-12  Jakub Jelen  <jjelen@redhat.com>
+
+       build,tests: Fix leaks of memory or file pointer.
+       + commit ad062b0a5b7d598081405ecfb71b51540281a1b7
+       * src/mkheader.c (parse_config_h): Close FP.
+       * tests/t-b64.c (test_b64enc_string): Free STATE.
+       (test_b64dec_string): Free BUFFER.
+       * tests/t-syserror.c (main): Close FP.
+
+2021-04-08  NIIBE Yutaka  <gniibe@fsij.org>
+
+       core: Fix gpgrt_wait_processes, by skipping invalid PID.
+       + commit 956c40f106ead6d0191bc183805021e70c15e760
+       * src/spawn-posix.c (_gpgrt_wait_processes): Skip invalid PID.
+
+2021-04-07  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Fix gpgrt-config for handling 'Requires' field.
+       + commit 89a353f418f5e879ab5564ec0767a6cbdb19d51c
+       * src/gpgrt-config.in (get_attr_l): Fix thinko for word split.
+
+2021-03-31  NIIBE Yutaka  <gniibe@fsij.org>
+
+       m4: Fix previous commit.
+       + commit 8536f82194ec21635cd017d7e0bd382106e196c6
+
+
+       m4: Support cross-compiling better.
+       + commit 9b9c5dfa1020ce5a5a5e4954c58112d2707ec578
+       * src/gpg-error.m4 (GPGRT_CONFIG): Prefer the one under $prefix.
+       (sed expression): Better compatibility to POSIX sed.
+
+2021-03-26  David Michael  <fedora.dm0@gmail.com>
+
+       build: Fix generation of lock-obj-pub.native.h for cross build.
+       + commit 33593864cd54143db594c4237bba41e14179061c
+       * src/gen-lock-obj.sh: Capture echo output with quotes.
+
+2021-03-22  Werner Koch  <wk@gnupg.org>
+
+       Release 1.42.
+       + commit 303062bf9a383de67227ff942c5482f3a87c71ed
+
+
+       core: Add GPG_ERR_SOURCE_TPM2D.
+       + commit 200bf2ed9d610219cc0b12a91dedb3bfd52d36b7
+       * src/err-sources.h.in (GPG_ERR_SOURCE_TPM2D): New.
+
+2021-03-05  Werner Koch  <wk@gnupg.org>
+
+       w32: Allow Unicode paths for the gettext domain.
+       + commit 618ce381f9d70f3a94e87f58f667a6138411018e
+       * src/w32-gettext.c: Remove remaining WindowsCE support
+       (load_domain): Use CreateFileW.
+
+2021-03-04  Werner Koch  <wk@gnupg.org>
+
+       w32: Minor cleanup of w32-gettext.
+       + commit 3bf1de7b72be8e1d9fa78eb94730772d9cf61c44
+       * src/w32-gettext.c: Include gpgrt.h instead gpg-error.h.
+       (utf8_to_wchar): Use underscored function.
+       (_gpg_w32_textdomain): Ditto.
+
+2021-02-18  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Support --disable-threads by gen-lock-obj.sh.
+       + commit 1fb90a7da186ee2ee098a666f6f3a35bb1720e59
+       * configure.ac: Supply --disable-threads to gen-lock-obj.sh.
+       Tighten the condition of using gen-lock-obj.sh for GNU/Linux.
+       * src/gen-lock-obj.sh: Support --disable-threads.
+
+2021-02-16  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Fix gpgrt-config.
+       + commit ed3cd20de8d3eab92dd8fff02bcc214c55d08398
+       * src/gpgrt-config.in: Remove delimiter variable.
+
+       build: More fix for determining libdir for gpgrt-config.
+       + commit 28a21addc2e30b0756cdc6774c79f69070df8829
+       * src/gpg-error.m4: Use CC -print-search-dirs for better support of
+       GNU style cross prefix.
+
+2021-02-15  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Fix the previous change.
+       + commit d7fd25bbfb83cd445bc81aa695b2c6127c22fa59
+       * src/gpg-error.m4: Fix test condition for GPGRT_CONFIG.
+       Fix behaviour when there is no GPG_ERROR_CONFIG.
+
+2021-02-12  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Improve how to determine $libdir for gpgrt-config.
+       + commit 3cabbad4eec0e5bc6bdaa9f8626578934138adee
+       * src/gpg-error.m4: Fix $gpgrt_libdir handling.
+
+2021-02-09  NIIBE Yutaka  <gniibe@fsij.org>
+
+       Support cross-compiling on more platforms.
+       + commit 99ae862a96a569724f49a604ebb7d3f6d2c2d374
+       * src/gen-lock-obj.sh (ECHO_C, ECHO_N): Portability fix.
+
+2020-12-21  Werner Koch  <wk@gnupg.org>
+
+       Release 1.41.
+       + commit 98032624ae89a67ee6fe3b1db5d95032e681d163
+
+
+       core: Yet another fix to the ignore meta command.
+       + commit 7021b58b0f2d95b94a2bac43e15ec97d89706b7f
+       * src/argparse.c (_gpgrt_argparse): Entirely skip ignored sysconf
+       commands.  Fix state transitions in the ignore case.
+
+       Release 1.40.
+       + commit c1f4ed561e9d214be9fdc3005134b9d0ed87554f
+       * configure.ac: Bump LT version to C31/A31/R0.
+
+       w32: Allow Unicode for internal getusername function.
+       + commit 007cfe8a0ca4c03412f031878d6ce232612a90d8
+       * src/sysutils.c (_gpgrt_getusername) [W32]: Use GetUserNameW.
+
+2020-12-18  Werner Koch  <wk@gnupg.org>
+
+       core: Fix the "ignore" meta command of the argparser.
+       + commit 4b09c8c2023d52b97be6069c20897ebfb25f9bca
+       * src/argparse.c (_gpgrt_argparse): Factor some code out to ...
+       (prepare_arg_return): new.
+       (_gpgrt_argparse): No missing arg error in ignore sections.
+
+2020-12-07  NIIBE Yutaka  <gniibe@fsij.org>
+           John Ericson
+
+       build: Use AC_CHECK_TOOL to detect objdump for cross build.
+       + commit 9ee011259f819a3cf50fe7019fa4366dbc437e0e
+       * configure.ac (CROSS_HOST_OBJDUMP): Remove, but use AC_CHECK_TOOL.
+
+2020-11-17  NIIBE Yutaka  <gniibe@fsij.org>
+
+       m4: Update with newer autoconf constructs.
+       + commit 8047ca99858a7ee812ef11ed3bd2868e920ac1b7
+       * src/gpg-error.m4: Replace AC_HELP_STRING to AS_HELP_STRING.
+
+       build: Update to new autoconf constructs.
+       + commit 41d753e21eaae3e4332e841de2f40e7055f2a68c
+       * configure.ac Replace AC_GNU_SOURCE to Use AC_USE_SYSTEM_EXTENSIONS.
+       Replace AC_HELP_STRING to AS_HELP_STRING.
+       * m4/estream.m4: Replace AC_TRY_LINK to AC_LINK_IFELSE.
+       * m4/gnupg-misc.m4: Replace AC_TRY_COMPILE to AC_COMPILE_IFELSE.
+       * m4/libtool.m4: Use AC_LANG_PUSH/AC_LANG_POP instead of
+       AC_LANG_SAVE/AC_LANG_RESTORE.
+       * m4/readline.m4: Replace AC_HELP_STRING to AS_HELP_STRING.
+       Fix quote for _combo.
+       * m4/threadlib.m4: Replace AC_HELP_STRING to AS_HELP_STRING.
+
+2020-10-19  Werner Koch  <wk@gnupg.org>
+
+       New public function gpgrt_access.
+       + commit 4764c5a3a4d704b3b42bafc5eba3996579030703
+       * src/gpg-error.h.in (gpgrt_access): New.
+       * src/gpg-error.vers. src/gpg-error.def.in: Add new function.
+       * src/sysutils.c (any8bitchar): New.
+       (_gpgrt_access): New.
+       * src/visibility.c (gpgrt_access): New.
+
+       * src/spawn-w32.c (_gpgrt_spawn_process_detached): Use it.
+       * src/argparse.c (try_versioned_conffile): Use it.
+       * tests/t-stringutils.c (check_access): New simple test.
+
+2020-10-09  Werner Koch  <wk@gnupg.org>
+
+       w32: Support utf8 also for getcwd.
+       + commit dbedf190969de1a796560cfa15fb4ea986bc79dc
+       * src/sysutils.c (_gpgrt_getcwd) [W32]: Implement utf-8 support.
+       * src/w32-gettext.c (wchar_to_native): Factor some code out to ..
+       (wchar_to_cp): new.
+       (_gpgrt_wchar_to_utf8): New.
+       * tests/t-stringutils.c: Include windows.h.
+       (utf8_to_wchar): New.
+       (wchar_to_utf8): New.
+       (mygetcwd): Use wchar version for Windows.
+       (main): New option --pwd.
+
+2020-08-24  Werner Koch  <wk@gnupg.org>
+
+       Release 1.39.
+       + commit 59d9f8106db3a23cb5d51d01dc6b719413d3f760
+
+
+2020-08-21  Werner Koch  <wk@gnupg.org>
+
+       core,w32: Add UTF-8 support to gpgrt_fopen, gpgrt_mkdir and gpgrt_chdir.
+       + commit a68c1975bda47b0698b48761a62e95b371095e9a
+       * src/protos.h: New.
+       * src/Makefile.am (libgpg_error_la_SOURCES): Add file.
+       * src/gpgrt-int.h: Include protos.h.
+       * src/sysutils.c (_gpgrt_mkdir) [W32]: Make UTF-8 aware.
+       (_gpgrt_chdir) [W32]: Ditto.
+       * src/w32-gettext.c: Include protos.h.
+       (utf8_to_wchar): Allow for strings.
+       (_gpgrt_utf8_to_wchar): New.
+       (_gpgrt_free_wchar): New.
+       * src/estream.c (map_w32_to_errno): Add more error codes.
+       (_gpgrt_w32_set_errno): New.
+       (any8bitchar) [W32]: New helper.
+       (func_file_create) [W32]: Convert file name and use _wopen.
+
+2020-08-21  NIIBE Yutaka  <gniibe@fsij.org>
+
+       argparse: Handle a corner case of wrong ARGC.
+       + commit 87a6b28c0f3b6c5b38e0f8a8533df39d3f0c0f03
+       * src/argparse.c (arg_parse): Avoid null dereference when ARGC is wrong.
+
+2020-08-17  Werner Koch  <wk@gnupg.org>
+
+       Fix a current gcc's -fsanitize warning.
+       + commit c5fcdd9a58a2508a20327226c52d155c29ddd5f3
+       * src/argparse.c (ARGPARSE_FLAG__INITIALIZED): Make sure it is an
+       unsigned int.
+
+2020-08-11  Werner Koch  <wk@gnupg.org>
+
+       core,w32: Use timeout in es_poll even if there are no FDs.
+       + commit fd1340085bc6879436dd2882dc5178c133434675
+       * src/w32-estream.c (_gpgrt_w32_poll): Sleep if there are no handles
+       to wait for.
+
+2020-08-05  Werner Koch  <wk@gnupg.org>
+
+       Make --lib-version work again.
+       + commit e0dab4843ded8af172c2566b4d7313a1a13e7e26
+       * src/gpg-error.c (main): Add printing code.
+
+2020-08-03  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpgrt-config: Fix handling 'Requires' field.
+       + commit 4192cbc3c58589055de1fb5ccbe42f3d33adb0af
+       * src/gpgrt-config.in (get_attr_l): New.
+       (all_required_config_files): Use get_attr_l.
+
+2020-07-15  NIIBE Yutaka  <gniibe@fsij.org>
+
+       w32: Add gpgrt_fcancel to the definition.
+       + commit c564d8c5a0e7c1aba9103cb4b6561b61074c60f1
+       * src/gpg-error.def.in (gpgrt_fcancel): Add.
+
+2020-06-26  Werner Koch  <wk@gnupg.org>
+
+       estream: Add gpgrt_fcancel.
+       + commit 3413489d25577e3fe7f529b8e610a45d2bd1857c
+       * src/estream.c (do_close): Add arg 'cancel_mode' and chnage all
+       callers.
+       (_gpgrt_fcancel): New.
+       * src/gpg-error.def.in, src/gpg-error.vers: Add function.
+       * src/visibility.c (gpgrt_fcancel): New.
+       * src/gpg-error.h.in (gpgrt_fcancel): New.
+
+2020-06-15  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Fix the gpg-error-config test for cross build.
+       + commit 1a4c1f37a1c95a4cfcaab6df3364ee3515a1ea1b
+       * src/gpg-error-config-test.sh.in: Clear PKG_CONFIG_SYSROOT_DIR.
+
+2020-06-12  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Fix command-line to make 'src 'dir.
+       + commit 159e394920f6be822d771fe003498de4d93b07c3
+       * configure.ac: Mistake, then, fix it.
+
+2020-06-11  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: On cross build, detect host's objdump.
+       + commit ce97528fa3dcc58d86e18d4d8820f210a624f63d
+       * configure.ac [*-*-linux*] (CROSS_HOST_OBJDUMP): New.
+
+2020-06-03  David Michael  <fedora.dm0@gmail.com>
+
+       build: Fix cross-compiling into a separate build dir.
+       + commit 013720333c6ec1d38791689bc49ba039d98e16b3
+       * configure.ac: Create the src directory before writing into it.
+       * src/Makefile.am (EXTRA_DIST): Add gen-lock-obj.sh.
+
+2020-05-29  Werner Koch  <wk@gnupg.org>
+
+       Release 1.38.
+       + commit 71d278824c5fe61865f7927a2ed1aa3115f9e439
+
+
+2020-05-29  Yuri Chornoivan  <yurchor@ukr.net>
+
+       po: Update Ukrainian translation.
+       + commit 1143b2d3619939a60f47af75be2123f3b225b32b
+
+
+2020-05-29  Ineiev  <ineiev@gnu.org>
+
+       po: Update and proofread Russian translation.
+       + commit a6104a9ab717499d405ff2af61a928a08774466a
+
+
+2020-05-19  Daniel Kahn Gillmor  <dkg@fifthhorseman.net>
+
+       syscfg: add 64-bit big-endian MIPS architecture.
+       + commit 0db8c768843db3e85935b972f1ed9d1b98159c46
+       * src/syscfg/lock-obj-pub.mips64-unknown-linux-gnuabi64.h: new.
+       * src/Makefile.am (lock_obj_pub): Add it.
+
+2020-04-09  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Use gen-lock-obj.sh script when possible.
+       + commit 988211d3d4c1f3d5cfa6b460210f65ab636763b5
+       * configure.ac (HAVE_GENERATED_LOCK_OBJ_H): New.
+       * src/Makefile.am: Support HAVE_GENERATED_LOCK_OBJ_H.
+
+       build: Add a shell script to generate lock-obj-pub.h.
+       + commit 50e62b36ea01ed25d12c443088b85d4f41a2b3e1
+       * src/gen-lock-obj.sh: New.
+
+2020-04-03  Werner Koch  <wk@gnupg.org>
+
+       core: Improve the echo and info meta commands of the arg parser.
+       + commit 98d11eff669c042d381ee4f18a42d32bcab256ef
+       * src/argparse.c (handle_meta_echo): Substitue some vars.
+       (handle_meta_user): Factor some code out to ...
+       (assure_username): new.
+
+       core: Implement meta command [user] also for Windows.
+       + commit ef07aedc70992742fcef92811345670777a3047b
+       * src/argparse.c (initialize): Clear username.
+       * src/sysutils.c (_gpgrt_getusername): Implement for Windows.
+
+       core: Implement meta command [user] for the arg parser.
+       + commit d843d260f5502ba90a2a35dfe202439f32b0e9aa
+       * src/sysutils.c (_gpgrt_getusername): New.
+       * src/argparse.c (struct _gpgrt_argparse_internal_s): New flags user_*
+       and store the current user.
+       (initialize): Free new malloced field.  Clear new flags.
+       (handle_meta_user): Implement.
+       (handle_metacmd): Implement user sections.  Remove "group" meta
+       command.
+       (_gpgrt_argparse): Implement user sections.
+       (finish_read_sys): Reset new vars.
+
+2020-03-06  Werner Koch  <wk@gnupg.org>
+
+       core: Tweak the printing of headers in the --help output.
+       + commit 85b5006d01fc64763a6e1f0d6cbda91c5cb709c1
+       * src/argparse.c (show_help): Do not print empty sections between
+       headers.
+
+       core: Add features for pretty printing the help.
+       + commit c59bf5824aafe938d5ab0d69079b9d93debc19fe
+       * src/gpg-error.h.in (ARGPARSE_OPT_HEADER): New.
+       (ARGPARSE_OPT_VERBATIM): New.
+       (ARGPARSE_verbatim): New.
+       (ARGPARSE_header): New.
+       * src/argparse.c (show_help): Implement them.
+
+2020-03-03  Werner Koch  <wk@gnupg.org>
+
+       core: New function gpgrt_reallocarray.
+       + commit 969abd302211262562df93ae5412ee319aae69e6
+       * src/init.c (_gpgrt_reallocarray): New.
+       * src/visibility.c (gpgrt_reallocarray): New.
+       * src/gpg-error.vers, src/gpg-error.def.in: Add new function.
+       * src/gpg-error.h.in: Add new interface.
+       * tests/t-malloc.c: New.
+       * tests/Makefile.am (TESTS): Add new test.
+
+       core: Fix allocation bug introduced with last commit.
+       + commit 72a15bad8f27303475498ce44e34d29b4c2c4593
+       * src/argparse.c (initialize): Increase number of extra slots.
+
+2020-03-02  Werner Koch  <wk@gnupg.org>
+
+       core: New internal option --dump-option-table for argparser.
+       + commit db95feab16e32309a4bfb382827c495c2c49920c
+       * src/argparse.c (initialize): Add new internal option.
+       (arg_parse): Implement that option.
+       (dump_option_table): New.
+       (show_help): Remove exit and let the caller call my_exit.
+
+       core: Replace fputs by es_fputs in argparser.
+       + commit f816797c87340a6130dea1e4f8f0e130511dfe3f
+       * src/argparse.c (writestrings): Use that function to match what we
+       are doing in flushstrings.
+
+       core: Allow returning of attributes from gpgrt_argparser.
+       + commit d3661d81e9aafae75680164ede7322cf3d7b6804
+       * src/gpg-error.h.in (ARGPARSE_FLAG_WITHATTR): New.
+       (ARGPARSE_ATTR_FORCE): New.
+       (ARGPARSE_ATTR_IGNORE): New.
+       (ARGPARSE_TYPE_MASK): Moved from argparse.c to here.
+       * src/argparse.c: Always use macros for constants.
+       (_gpgrt_argparse): Handle ARGPARSE_FLAG_WITHATTR.
+       (arg_parse): Ditto.
+       * tests/t-argparse.c (main): Add commented test case.
+
+2020-02-27  Werner Koch  <wk@gnupg.org>
+
+       core: Implement meta commands for the argparser.
+       + commit 2d1969ab465bad62f73a7c24ddc8bb490ff9fd40
+       * src/argparse.c (opttable_t): Add new flags forced, ignore, and
+       explicit_ignore.
+       (struct _gpgrt_argparse_internal_s): Change flags to bitflags.  Add
+       several flags to support meta commands.
+       (initialize): Clear them.
+       (handle_meta_user): Use the new verbose flag.
+       (handle_meta_force): Implement.
+       (handle_meta_ignore): Implement.
+       (handle_meta_echo): Support "-echo".
+       (handle_meta_verbose): New.
+       (handle_metacmd): New meta command verbose.  Add always flag and move
+       the detection of unexpected meta commands to here.
+       (_gpgrt_argparse): Make use of the ignore and forced meta commands.
+       (finish_read_sys): New.
+       (_gpgrt_argparser): Support the verbose flag.  Call finish_read_sys.
+       (arg_parse): Ignore non-explicit ignored and all forced options.
+
+       * tests/t-argparse.c (main): Fix printing of the ARGPARSE_CONFFILE
+       case.  New option 'M'.
+       * tests/t-argparse.conf, tests/etc/t-argparse.conf: Various changes to
+       test the new meta commands.
+
+       indent: Fix indentation in an argparse.c function.
+       + commit ffa21bf5b7066f7fa437119ce6b508b324ea2611
+       * src/argparse.c (arg_parse): Fix it here.
+
+2020-02-26  Werner Koch  <wk@gnupg.org>
+
+       core: Add meta command handler stubs to argparse.c.
+       + commit 2f169b341e410924c5d7ee7d76ac67f85f26ed6a
+       * src/argparse.c (handle_meta_user): New stub.
+       (handle_meta_force): New stub.
+       (handle_meta_ignore): New stub.
+       (handle_meta_echo): New.
+       (handle_metacmd): New.
+       (_gpgrt_argparse): Call meta command handler.
+
+       core: Prepare argparse.c to track additional info for options.
+       + commit 9d268891dae6093e5346710a38ba8cd978f24f09
+       * src/argparse.c (opttable_t): New.
+       (struct _gpgrt_argparse_internal_s): Use this instead of a ppointer to
+       gpgrt_opt_t.
+       (initialize): Copy options to the new tableand keep an original ordinal.
+       (_gpgrt_argparse): Adjust for changes.
+       (any_opt_conffile): Ditto.
+       (find_long_option): Ditto.
+       (arg_parse): Ditto.
+       (long_opt_strlen): Adjust args.
+       (cmp_ordtbl): New.
+       (show_help): Print using the ordinal numbers.
+
+2020-02-25  Werner Koch  <wk@gnupg.org>
+
+       core: Add parser for meta commands to gpgrt_argparser.
+       + commit 6fc2d7cb8ce9e08cb189608466803ee7c8eb6930
+       * src/gpg-error.h.in (ARGPARSE_INVALID_META): New
+       (ARGPARSE_UNKNOWN_META, ARGPARSE_UNEXPECTED_META): New.
+       * src/argparse.c (struct _gpgrt_argparse_internal_s): Add flag
+       insysconfig.
+       (initialize): Init flag.  Add error strings.
+       (_gpgrt_argparser): Set that flag.
+       (_gpgrt_argparse): Add parsing of meta commands.
+
+       * tests/etc/t-argparse.conf: Add some test cases.
+       * tests/t-argparse.conf: Ditto.
+       * tests/t-argparse.c (main): Die only after printing all warnings.
+
+       core: Fold duplicated code from _gpgrt_argparse.
+       + commit ca79d5edee8c6d93575708643ec825f81107e624
+       * src/argparse.c (_gpgrt_argparse): Fold common code.
+
+       core: Improve readability of _gpgrt_argparse.
+       + commit 8c185e719860aaa93cc37c0ec91c7bd5e3c2a5ce
+       * src/argparse.c (_gpgrt_argparse): Use enum for the states and
+       replace continue and break.
+
+       core: New flag ARGPARSE_FLAG_USERVERS to try versioned config files.
+       + commit e9f36cabe157aa046b32dfc0b9f5c175b9808722
+       * src/gpg-error.h.in (ARGPARSE_FLAG_USERVERS): New.
+       * src/argparse.c: Include unistd.h.
+       (try_versioned_conffile): New.
+       (_gpgrt_argparser): Use it.
+
+       core: New pseudo option ARGPARSE_PERMISSION_ERROR.
+       + commit f25555aed0da7f0492b68efb789dbe3e03ec7fe8
+       * src/gpg-error.h.in (ARGPARSE_PERMISSION_ERROR): New.
+       * src/argparse.c (initialize): Add code to print this error.
+
+2020-02-25  NIIBE Yutaka  <gniibe@fsij.org>
+
+       w32: Fix exporting gpgrt_argparser.
+       + commit 732ac9c681a0b6afdee2e8eb6937500850f74986
+       * src/gpg-error.def.in (gpgrt_argparser): Fix typo.
+
+2020-02-22  Werner Koch  <wk@gnupg.org>
+
+       core: Extend the way a config file can be specified,
+       + commit b79b2a7fb3ad3ada45d17e8632f1ee4212ce0764
+       * src/argparse.c (PATHSEP_C, DIRSEP_C): New.
+       (is_absfname, is_twopartfname): New.
+       (_gpgrt_argparser): Allow for a two-part config name.
+
+2020-02-20  Werner Koch  <wk@gnupg.org>
+
+       core: Skip cmdline parsing for no or an empty argv.
+       + commit 44258227f7dfb12b3c0faa8ab417a9dc2be46eed
+       * src/argparse.c (_gpgrt_argparser): Allow for empty argv.  Also fix
+       memory leak.
+
+2020-02-19  Werner Koch  <wk@gnupg.org>
+
+       core: More fixes for the new option/argument parser.
+       + commit 46b3749997da84c41f583b22cda812dd5e42bde0
+       * src/argparse.c (arg_parse): Always set opt_flags.  New flag no_init.
+       (_gpgrt_argparse): Clear opt_flags at start.
+       (_gpgrt_argparser): Call arg_parse directly.  Call arg_parse with
+       no_init set.
+
+       core: Some fixes for the new option/argument parser.
+       + commit a264fe9c55251458df558718fae0845928bf225e
+       * src/argparse.c (ARGPARSE_FLAG__INITIALIZED): New.
+       (initialize): Use a flag bit to track the initialization state.
+       (_gpgrt_argparser): Clear some state on switching files.
+
+2020-02-18  Werner Koch  <wk@gnupg.org>
+
+       core: Add a high level option/argument parser.
+       + commit 933eb9346a84c87f83f77d990be2f66e2f7b62e7
+       * gpg-error.h.in (GPGRT_CONFDIR_USER, GPGRT_CONFDIR_SYS): New consts.
+       (ARGPARSE_FLAG_SYS, ARGPARSE_FLAG_USER, ARGPARSE_FLAG_VERBOSE)
+       (ARGPARSE_NO_CONFFILE, ARGPARSE_CONFFILE, ARGPARSE_OPT_CONFFILE): New
+       consts.
+       (ARGPARSE_conffile, ARGPARSE_noconffile): New macros.
+       (gpgrt_set_confdir): New func.
+       (gpgrt_argparser): New func.
+       * src/argparse.c (confdir): New var.
+       (enum argparser_states): New.
+       (struct _gpgrt_argparse_internal_s): Add a couple of new fields.
+       (initialize): Init them.
+       (any_opt_conffile): New.
+       (_gpgrt_argparser): New.
+       (_gpgrt_set_confdir): New.
+       * src/visibility.c (gpgrt_argparser): New.
+       (gpgrt_set_confdir): New.
+       * src/gpg-error.def.in, src/gpg-error.vers: Add those functions.
+       * tests/t-argparse.c (main): Reworked.
+       * tests/etc/t-argparse.conf: New file.
+       * tests/t-argparse.conf: New file.
+
+       core: Add gpgrt_fnameconcat and gpgrt_absfnameconcat.
+       + commit 5742b8eaf3fa9cda3dfb6b3ad0fea7485fff1a12
+       * src/gpg-error.h.in (gpgrt_fnameconcat): New.
+       (gpgrt_absfnameconcat): New.
+       * src/visibility.c (gpgrt_fnameconcat, gpgrt_absfnameconcat): New.
+       * src/stringutils.c: New file.
+       (_gpgrt_vfnameconcat): New.
+       (_gpgrt_fnameconcat, _gpgrt_absfnameconcat): New.
+       * src/gpg-error.def.in: Add new functions.
+       * src/gpg-error.vers: Ditto.
+       * src/sysutils.c: Include pwd.h.
+       (_gpgrt_getpwdir): New.
+       * configure.ac: Test for pwd.h, getpwnam, getpwuid, and their _r
+       variants.
+       * src/Makefile.am (libgpg_error_la_SOURCES): Add new file.
+
+       * tests/t-stringutils.c: New.
+       * tests/t-common.h (xmalloc, xstrdup, xfree): New.
+       (die): Kludge to avoid compiler warnings.
+
+2020-02-18  NIIBE Yutaka  <gniibe@fsij.org>
+
+       w32: Support static link with -lws2_32.
+       + commit a6ab8e3a710b899ecfb2ff518725314a1e0e64ff
+       * configure.ac (GPG_ERROR_CONFIG_LIBS_PRIVATE): New.
+       * src/Makefile.am (socklibs): Use GPG_ERROR_CONFIG_LIBS_PRIVATE.
+       * src/gpg-error.pc.in: Require @GPG_ERROR_CONFIG_LIBS_PRIVATE@.
+
+2020-02-10  Werner Koch  <wk@gnupg.org>
+
+       logging: Also protect gpgrt_inc_errorcount against counter overflow.
+       + commit d72c1ddfde09ffa69745ec2439c5a16d15e2202f
+       * src/logging.c (_gpgrt_inc_errorcount): Protect against counter
+       overflow.
+       (_gpgrt_logv_internal): Use that function here so that we have only
+       one check for counter overflow.
+
+2020-02-07  Werner Koch  <wk@gnupg.org>
+
+       Release 1.37.
+       + commit 36b9924b483198f896c7ca3db233978978141b60
+
+
+2020-02-06  Werner Koch  <wk@gnupg.org>
+
+       tools: Allow error symbol lookup w/o the GPG_ERR_ prefix.
+       + commit 796b66a9449c442991cc205f8a618dffab54d8a3
+       * src/gpg-error.c (get_err_from_codesymbol): New.
+       (main): Use it here.
+
+       build: Always pass -no-undefined to libtool.
+       + commit 6e4b5ca624cb7f771c8dd1f12cbad851a5f0d782
+       * src/Makefile.am: Remove no_undefined macro.
+
+2020-01-23  NIIBE Yutaka  <gniibe@fsij.org>
+
+       po: Update Japanese Translation.
+       + commit d1e4b4b001b3fd34b91403f880a42c4a474cdb83
+
+
+2020-01-07  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Don't use -O0 which is not portable.
+       + commit a2674207f7fef6d0f96b80838303a2e6a55e7785
+       * src/Makefile.am (mkheader): Remove -O0 option.
+
+2019-12-13  Werner Koch  <wk@gnupg.org>
+
+       New error codes for SQLite.
+       + commit 308574372055662c76d27f1681b182afddce9166
+       * src/err-codes.h.in: Add GPG_ERR_SQL_ codes.
+       * src/gpg-error.h.in (gpg_err_code_from_sqlite): New.
+
+2019-09-24  NIIBE Yutaka  <gniibe@fsij.org>
+
+       Fix gpg-error.c for preprocessor use.
+       + commit f73605e039493ca875f992a45730a6c99430fb14
+       * src/gpg-error.c (main): Fix conditional compilation.
+
+2019-09-18  NIIBE Yutaka  <gniibe@fsij.org>
+
+       tests: Fix deallocation of buffer in t-b64.c.
+       + commit 46bb7eb8c5541d62cd90227bde205f663ef0e6d5
+       * tests/t-b64.c (test_b64dec_string): De-allocate.
+
+       gpgrt_setenv: Define behavior when value=NULL.
+       + commit 4b8e8ba9f60cb6eb644be5f86b9c19ebf4332763
+       * src/sysutils.c (_gpgrt_setenv): Avoid call with value=NULL.
+
+       logging: Fix the case of using socket_dir_cb which may return NULL.
+       + commit 521aeecf1e41e8e34bb354cf51bfd37ff7a900c6
+       * src/logging.c (fun_writer): Fix for socket_dir_cb.
+
+       estream: Care about erroneous case for stream close.
+       + commit f41991480aaa79db55e75363dfbb4f278cb8ea21
+       * src/estream.c (do_list_remove): Only access ITEM->NEXT when it's not
+       null.
+
+2019-09-10  Werner Koch  <wk@gnupg.org>
+
+       core: Fix broken strings (first letter missing)
+       + commit c1e80f6e8e368c271bbf413d9eaea772ef2062d1
+       src/err-codes.h.in (GPG_ERR_KEYBOXD): Add missing tabs.
+
+2019-09-08  Werner Koch  <wk@gnupg.org>
+
+       estream: Fix dead assigniment.
+       + commit f7c24427329075adc98eb93d2abb12c087e0f9d2
+       * src/estream-printf.c (pr_string): Here.
+
+2019-09-04  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpgrt-config: Support Libs.private and Requires.private.
+       + commit cb877252c4dc787755fb4e1ffc36757453af12eb
+       * src/gpgrt-config.in: Support Libs.private and Requires.private.
+
+2019-08-23  NIIBE Yutaka  <gniibe@fsij.org>
+
+       estream: Fix gpgrt_poll at EOF.
+       + commit 157b9f6fafb6905fd94c21aaa9e2c103d954a9fc
+       * src/estream.c [HAVE_POLL_H] (_gpgrt_poll): Catch POLLHUP event
+       for want_read.
+
+       estream: Fix gpgrt_poll to prevent waiting indefinitely for others.
+       + commit ab87480fc201ad687153429aee043ab454fed0a3
+       * src/estream.c (_gpgrt_poll): Go to leave, when something is ready.
+
+2019-08-22  NIIBE Yutaka  <gniibe@fsij.org>
+
+       estream: Fix poll condition.
+       + commit fc1a7591bdcd64a3df1d2db29afca8e224f64c0a
+       * src/estream.c (_gpgrt_poll): Fix for want_oob.
+
+2019-07-25  NIIBE Yutaka  <gniibe@fsij.org>
+
+       w32: Fix cast to internal fd.
+       + commit f93a0358dc82886db12c91180dc82e8bb1258ef0
+       * src/estream.c (tmpfd): Use intptr_t.
+
+       estream: Fix IS_INVALID_FD.
+       + commit 5f9f2c32b038848212bec9d9a95858c18b9a0eee
+       * src/estream.c (IS_INVALID_FD): Simply compare to -1.
+
+2019-07-24  NIIBE Yutaka  <gniibe@fsij.org>
+
+       w32: Fix HANDLE to internal fd conversion.
+       + commit 655ed9d83889bbb61d4b96755a2bd676622064c8
+       * src/spawn-w32.c (handle_to_fd): Use intptr_t type.
+
+2019-07-18  Daniel Kahn Gillmor  <dkg@fifthhorseman.net>
+
+       build: Use {CFLAGS,CPPFLAGS, LDFLAGS}_FOR_BUILD for helper programs.
+       + commit 732855a483709345a5c0f49504f45cb8da3f883a
+       * doc/Makefile.am: add CPPFLAGS_FOR_BUILD for yat2m-for-build (other
+       flags were already present).
+       * src/Makefile.am: add {CFLAGS,CPPFLAGS,LDFLAGS}_FOR_BUILD for
+       mkhelper, mkw32errmap, and mkerrcodes.
+
+2019-07-11  NIIBE Yutaka  <gniibe@fsij.org>
+
+       Fix signedness for a single-bit field.
+       + commit 7ffab1750fdec31d6f6f62c3ff50f1a33eacda5c
+       * src/gpgrt-int.h (struct _gpgrt_b64state): Use unsigned for bit flags.
+
+2019-06-27  Werner Koch  <wk@gnupg.org>
+
+       estream: Add missing malloc check.
+       + commit 382fddc151fd42cd6d1d02dbedb7b5031cc68958
+       * src/estream.c (_gpgrt_poll): Check for malloc error.
+
+2019-06-27  NIIBE Yutaka  <gniibe@fsij.org>
+
+       estream: Don't use variable length array.
+       + commit 70a5ea407c71cf094794d3d3375aab7fc2c4eca6
+       * src/estream.c [HAVE_POLL_H] (_gpgrt_poll): No VLA.
+
+2019-06-26  NIIBE Yutaka  <gniibe@fsij.org>
+
+       estream: Use poll(2) when available.
+       + commit a21a7de8c2cf986235382e7e04805744f6df116e
+       * configure.ac: Detect poll.h.
+       * src/estream.c [HAVE_POLL_H] (_gpgrt_poll): Use poll.
+
+2019-06-18  NIIBE Yutaka  <gniibe@fsij.org>
+
+       tests: Skip the test when pkg-config is too old.
+       + commit 6c2fc52d72b4dbd9dac44d9c3105dc3e8a4d5605
+       * src/gpg-error-config-test.sh.in: Check pkg-config version.
+
+       build: Take care of POSIX shell path.
+       + commit 7a7caf4ba1c460c9c36f754fcd0ebfeb4aa5cc6a
+       * configure.ac (INSTALLSHELLPATH): New.
+       * src/Makefile.am: Change invocation of gpg-error-config-test.sh.
+       * src/gpgrt-config.in (INSTALLSHELLPATH): To be substituted.
+       * src/gpg-error-config-test.sh.in: Likewise.
+
+       Portability fix for PID.
+       + commit 10ae655db22321f0d6efb75f88e169b57ce63375
+       * src/spawn-posix.c (gpgrt_wait_processes): Cast to int.
+
+       build: Add failure exit for gpg-error-config build.
+       + commit 849ac6abe3ce0001fb11cef0e26df0893468d238
+       * src/Makefile.am (gpg-error-config): Exit 1 on failure.
+
+2019-05-29  NIIBE Yutaka  <gniibe@fsij.org>
+
+       Detect to use strerror_s.
+       + commit cd49ee71887cb2e7f2ca422fbc5c28f4bd92b3ca
+       * configure.ac [mingw32*] (strerror_s): Detect.
+       * src/strerror.c [HAVE_STRERROR_S] (system_strerror_r): Use strerror_s.
+
+2019-05-14  NIIBE Yutaka  <gniibe@fsij.org>
+
+       tests: Fix a memory leak.
+       + commit bdb9561a366fa5afee0e855a22390e9282e1abd5
+       * tests/t-logging.c (check_log_info): Free LOGBUF.
+
+2019-05-13  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Update m4/iconv.m4.
+       + commit 07b1b3be179883cbd38446f38ae950f6d94a150b
+       * m4/iconv.m4: Update from gettext 0.20.1.
+
+2019-04-15  NIIBE Yutaka  <gniibe@fsij.org>
+
+       awk: Prepare for Gawk 5.0.
+       + commit 7865041c77f4f7005282f10f9b6666b19072fbdf
+       * src/Makefile.am: Use pkg_namespace (instead of namespace).
+       * src/mkerrnos.awk: Likewise.
+       * lang/cl/mkerrcodes.awk: Don't escape # in regexp.
+       * src/mkerrcodes.awk, src/mkerrcodes1.awk, src/mkerrcodes2.awk: Ditto.
+
+2019-03-19  Werner Koch  <wk@gnupg.org>
+
+       Release 1.36.
+       + commit 85f427fd28ae5947277ba02dffc83c53d9da2591
+       * configure.ac: Bump LT version to C27/A27/R0.
+
+       estream: Increase buffer size for Windows.
+       + commit e4f460d8e338d6866a6ab457dcd811c63399706a
+       * src/gpgrt-int.h (BUFFER_BLOCK_SIZE) [W32]: Increase from 512 to 8k.
+       * src/w32-estream.c (READBUF_SIZE, WRITEBUF_SIZE): Increase from 4k to
+       8k.
+
+2019-02-04  Werner Koch  <wk@gnupg.org>
+
+       build: Fix for Microsoft MSVC.
+       + commit 21dd885eecdee13da1689519e2fc50fcf64f6ef2
+       * src/gpgrt-int.h (_gpgrt_functions_w32_pollable): Declare with extern
+       so that strict toolchains don't get confused.
+
+2019-01-23  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpgscm: Build well even if NDEBUG defined.
+       + commit 8a9397896fd202dcfb3fb46259e43bc05a0ddd2e
+       * gpgscm/scheme.c (gc_reservation_failure): Fix adding ";".
+       [!NDEBUG] (scheme_init_custom_alloc): Don't init seserved_lineno.
+
+2019-01-16  Werner Koch  <wk@gnupg.org>
+
+       Release 1.34.
+       + commit 8bc75741cadf95e2fac64891cf402cde891afe64
+       * configure.ac: Bump LT version to C26/A26/R0.
+
+       build: Fix regression in make distcheck.
+       + commit 5d2b20a04b526d090a2328bd79bc3a76ced327dc
+       * doc/Makefile.am (errorref.txt.x):
+
+2019-01-15  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Fix for BSD make.
+       + commit fd6f64f1897e00b1d9711463ebb6ec7d099e1995
+       * doc/Makefile.am (errorref.txt.x): Don't use $<.
+
+2019-01-14  Andre Heinecke  <aheinecke@gnupg.org>
+
+       Fix symbol name typo in gpg-error.def.in.
+       + commit 51ea153871b79799f88b85f6b60c2b0a3bbd6a12
+       * src/gpg-error.def.in (gogrt_abort): Correct to gpgrt_abort.
+
+2019-01-10  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Build with LD_LIBRARY_PATH, use of DT_RPATH (2/2).
+       + commit 1fd997231b717853822dff9d3e981d95765f323d
+       * configure.ac (LDADD_FOR_TESTS_KLUDGE): New for --disable-new-dtags.
+       * tests/Makefile.am (LDADD): Use LDADD_FOR_TESTS_KLUDGE.
+       (t_lock_LDADD, t_poll_LDADD): Use LDADD.
+
+       build: Build with LD_LIBRARY_PATH, use of DT_RPATH (1/2).
+       + commit 1044ee639dab7260da481250cd2a46a69ab2b5d3
+       * configure.ac: Check against --disable-new-dtags.
+
+2019-01-04  Werner Koch  <wk@gnupg.org>
+
+       core: New functions gpgrt_abort and gpgrt_add_emergency_cleanup.
+       + commit 933bfd7b652a907c0d8dd5337c6b5b9cb82ce7b7
+       * src/init.c (emergency_cleanup_list): New gloabl var.
+       (_gpgrt_add_emergency_cleanup): New.
+       (_gpgrt_abort): New. Repalce all calls to abort by this.  Also replace
+       all assert by either log_assert or a stderr output followed by a
+       _gpgrt_abort.
+       (run_emergency_cleanup): New.
+       * src/visibility.c (gpgrt_add_emergency_cleanup): New public API.
+       (gpgrt_abort): New public API.
+
+2018-12-12  Werner Koch  <wk@gnupg.org>
+
+       estream: Use correct POSIX name THOUSEP.
+       + commit 12349de46d241cfbadbdf99773d6cabfcbc97578
+       * src/estream-printf.c: Replace HAVE_LANGINFO_THOUSANDS_SEP by
+       HAVE_LANGINFO_THOUSEP.
+       (pr_integer): Use THOUSEP.
+
+2018-12-11  Alistair Francis  <Alistair.Francis@wdc.com>
+
+       syscfg: Add a riscv32 architecture.
+       + commit 27ded21fea2a6f1fc161a91744014cce711ad1b3
+       * src/syscfg/lock-obj-pub.riscv32-unknown-linux-gnu.h: New.
+       * src/Makefile.am (lock_obj_pub): Add it.
+
+2018-12-10  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpgrt-config: Portability fix for use of expr.
+       + commit 1d71dbb13709318567aba5b61928d8af37563097
+       * src/gpgrt-config (sysroot): Care about possible interpretation of
+       minus sign be considered an option to a program.
+       (MAIN): Don't use 'match' of expr but use ':' instead.
+
+2018-12-07  Werner Koch  <wk@gnupg.org>
+
+       Silence cc warning about snprintf redefinition.
+       + commit 60f3d4440249d7beec3390df66143204ea80be39
+       * src/gpgrt-int.h: First undef snprintf.
+
+       Release 1.33.
+       + commit 174985d91ff277bd4a58a0de3d61fbbb46841cde
+       * configure.ac: Set LT version to C25/A25/R0.
+
+       Add W32-only function gpgrt_w32_override_locale.
+       + commit 0b190ce89de7b3df873c3896d5126c7882b82e18
+       * src/w32-gettext.c (struct override_locale): new.
+       (my_nl_locale_name): Take care of that.
+       (gpgrt_w32_override_locale): New.
+       * src/gpg-error.def.in: Add gpgrt_w32_override_locale.
+       * src/gpg-error.c: New command --locale for Windows.
+
+2018-12-06  Werner Koch  <wk@gnupg.org>
+
+       logging: Escape controls in string arguments of log_ functions.
+       + commit b7fae45c24cccb9898c6d5a3a633897afb4649dc
+       * src/logging.c (struct fmt_string_filter_s): New.
+       (fmt_string_filter): New.
+       (_gpgrt_logv_internal): Use the filter.
+
+2018-12-05  Werner Koch  <wk@gnupg.org>
+
+       core: Allow logging to an estream.
+       + commit f4d139b399e1e5044fe6bb0ceecd4c72e63dac94
+       * src/logging.c (set_file_fd): Add and use new arg 'stream'.
+       (_gpgrt_log_set_sink): Implement setting an estream sink.
+       * tests/t-logging.c: New test.
+       * tests/Makefile.am (TESTS): Add test.
+
+       tests: Check print arguments of t-common functions.
+       + commit 793838fd859afd837df070ee2e75c100e932b220
+       * tests/t-common.h: Include gpgrt.h  instead of gpg-error.h.
+       (die, fail, show): Add printf attributes.
+
+2018-12-05  Marcus Brinkmann  <marcus.brinkmann@rub.de>
+
+       Fix gpgrt_ftruncate declaration.
+       + commit 34d6637a34b139fbfafa6c15eaf2fc88158a1c3c
+
+
+2018-11-26  Werner Koch  <wk@gnupg.org>
+
+       core: New functions gpgrt_fprintf_sf anf gpgrt_fprintf_sf_unlocked.
+       + commit bd8668c120ac0f725edb092b2c4ca49ffdb78ed2
+       * src/gpg-error.h.in (gpgrt_string_filter_t): New type.
+       (gpgrt_fprintf_sf, gpgrt_fprintf_sf_unlocked): New.
+       * src/gpg-error.vers, src/gpg-error.def.in: Add them.
+       * src/visibility.c (gpgrt_fprintf_sf): New.
+       (gpgrt_fprintf_sf_unlocked): New.
+       * src/estream-printf.c (pr_string): Add and use args sf, sfvalue and
+       string_no.
+       (do_format): Add args sf and sfvalue.  Keep a string format counter.
+       (_gpgrt_estream_format): Add args sf and sfvalue.  Change all callers
+       to provide NULL for them.
+       * src/estream.c (_gpgrt_vfprintf_unlocked, _gpgrt_vfprintf): Add sf
+       and sfvalue and adjust all callers.
+       (do_print_stream): Ditto.
+
+       * tests/t-printf.c (stream_to_string): New.
+       (struct sfstate_s): New.
+       (string_filter): New.
+       (check_fprintf_sf): New.
+       (main): Call new test.
+
+       core: Add a limited version of gpgrt_ftruncate.
+       + commit ffb49b72f132d954a3d9fa11e45803c36a62fd25
+       * src/gpg-error.h.in (gpgrt_ftruncate, es_ftruncate): New.
+       * src/gpg-error.def.in, src/gpg-error.vers: Add gpgrt_ftruncate.
+       * src/visibility.c (gpgrt_ftruncate): new.
+       * src/gpgrt-int.h (COOKIE_IOCTL_TRUNCATE): New.
+       * src/estream.c (func_mem_ioctl): Support new internal IOCTL.
+       (_gpgrt_ftruncate): New.
+
+2018-11-15  Werner Koch  <wk@gnupg.org>
+
+       core: New API gpgrt_cmp_version.
+       + commit a5d4a4b32b11814d673241d62624ecec1d577571
+       * src/gpg-error.h.in: New API gpgrt_cmp_version.
+       * src/visibility.c (gpgrt_cmp_version): New wrapper.
+       * src/version.c (parse_version_string): Revamped.
+       (do_cmp_version): New.
+       (_gpgrt_cmp_version): New.
+       (_gpg_error_check_version): Re-implemented using the new func.
+       * tests/t-version.c: Include t-common.h.
+       (t_gpgrt_cmp_version): New test.
+       (main): Run new test.  Change test for new version number to require a
+       2 level number.
+
+2018-11-14  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpgrt-config: Prepend PKG_CONFIG_LIBDIR to PKG_CONFIG_PATH.
+       + commit 4a92763a6e529824f1c6043b75ac1346af41a926
+       * src/gpgrt-config: Handle empty PKG_CONFIG_LIBDIR config, which
+       should ignore --libdir option.  Otherwise, prepend
+       PKG_CONFIG_LIBDIR (instead of appending) to PKG_CONFIG_PATH.
+
+2018-11-13  NIIBE Yutaka  <gniibe@fsij.org>
+
+       Fix typo in the annotation.
+       + commit 4b41cf3bd16c8afcb4ba152ab9d5d679a7cb91e7
+       * src/init.c [DLL_EXPORT] (DllMain): Fix typo.
+
+       gpgrt.m4: Don't support --with-*-prefix or SYSROOT.
+       + commit 8ed48537de2b141a8f2050b15a65775374f1aa79
+       * src/gpgrt.m4: Remove old backward compatible support.
+
+2018-11-07  NIIBE Yutaka  <gniibe@fsij.org>
+
+       Fix a typo.
+       + commit b39b44b9acbed6d4889acba4fe9eae2556c80acc
+       * src/spawn-w32.c (src/spawn-w32.c): Fix to use pid_to_handle.
+
+2018-11-02  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpgrt-config: Don't support variable reference in --libdir option.
+       + commit 78af09ce13969b64f121ae5990e66fb7f1cd3f1d
+       * src/gpgrt-config: Simplify --libdir support, remove variable
+       substituion.
+       * src/gpg-error.m4: Expand possible ${prefix}, ${exec_prefix} in
+       libdir.  Simplify invocation of gpgrt-config.
+       * src/gpgrt.m4: Likewise.
+
+       gpg-error.m4: Emit message when using gpgrt-config.
+       + commit 42413de59a063def05620d899a7fbda265b6c406
+       * src/gpg-error.m4: Add AC_MSG_NOTICE.
+
+       gpg-error.m4: Find gpgrt_libdir by CC.
+       + commit 7ffd88b0e98af21aa61a57dde042d75f0d403839
+       * src/gpg-error.m4 (gpgrt_libdir): New.  Bump the version date.
+       * src/gpgrt.m4: Likewise.
+
+2018-11-01  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpg-error.m4: Unset GPGRT_CONFIG when gpgrt-config doesn't work.
+       + commit 8f034bb3a1bbde2fc7a8d2ada6e3d779c465895b
+       * src/gpg-error.m4: Unset GPGRT_CONFIG when gpgrt-config doesn't work.
+
+       gpgrt-config: It's distributed script.
+       + commit 998313bd321ae161ec58111ccc6c6f0921007bc5
+       * src/Makefile.am (dist_bin_SCRIPTS): Add gpgrt-config.
+       (bin_SCRIPTS): Remove gpgrt-config.
+
+2018-10-31  Andre Heinecke  <aheinecke@intevation.de>
+
+       w32: Remove cruft in w32-estream from olden times.
+       + commit 5b898b8bc89c18e2fd02e6c9efd5e91cb96357cc
+       * src/w32-io.c (set_synchronize): Remove.
+       (create_reader, create_writer): No need for set_synchronize.
+
+2018-10-31  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpgrt-config: Fix typo in the script.
+       + commit 2e9ee747ac81434ca542291287eb56c9025f0a39
+       * src/gpgrt-config: Add missing $ for libdir_option.
+
+2018-10-29  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpgrt-config: Better architecture independent support.
+       + commit 93d45f7e7e937020c796781705516a4b62e6589a
+       * configure.ac: Don't generate gpgrt-config.
+       * src/gpgrt-config: Rename from gpgrt-config.in.
+       (--prefix, --exec-prefix, --libdir): Use --libdir to determine
+       PKG_CONFIG_LIBDIR.
+       * src/Makefile.am (EXTRA_DIST): Remove gpgrt-config.in.
+       * src/gpg-error-config-test.sh: Fix for path to gpgrt-config.
+       * src/gpg-error.m4: Provide --prefix, --exec-prefix, --libdir
+       option from configure.  Don't use CC because we have --libdir.
+       Bump version date.
+       * src/gpgrt.m4: Likewise.
+
+2018-10-27  Ben Kibbey  <bjk@luxsci.net>
+
+       b64dec: Fix to use custom memory handlers.
+       + commit b229ed40e2653bd3eabaa6931cd8582280a226d7
+       * src/b64dec.c (_gpgrt_b64dec_finish): Use xfree().
+
+2018-10-26  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpgrt-config: Clean up the implementation.
+       + commit aec676c9ca2da4feb2970f6ce036179afe778b25
+       * src/gpgrt-config.in: Fix copyright notice.
+       (--exists): Support new option of pkg-config.
+       (--mt): Relax usage.
+       (--api-version): Support old option.
+       (default_module): New.
+       (usage): Only show pkg-config compatible options.
+
+       gpg-error.m4: Better backward compatibility support.
+       + commit 1096ff770b3d5cc58f423b129cc5d83731398dd9
+       * src/gpg-error.m4: Don't assume newer implementation of
+       gpg-error-config.  Use old way when it found old.
+
+2018-10-25  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpg-error-config: Keep old gpg-error-config implementation.
+       + commit ffbff048bde636e3ec19f2912fa4034e70e18f44
+       * configure.ac: Generate gpgrt-config from gpgrt-config.in.
+       * src/gpgrt-config.in: Rename from src/gpg-error-config-new.in.
+       * src/Makefile.am (bin_SCRIPTS): Add gpgrt-config.
+       (EXTRA_DIST): Add gpgrt-config.in removing gpg-error-config-new.in.
+       (BUILT_SOURCES, CLEANFILES): Remove gpgrt-config.
+       (gpg-error-config): Always copy from gpg-error-config-old.
+       * src/gpg-error-config-test.sh: Follow the rename.
+
+       build: Set GPGRT_CONFIG in gpg-error.m4.
+       + commit e06af32bdde0b4ce8c97193472961f31c5b55ddf
+       * src/gpg-error.m4: Detect gpgrt-config to set GPGRT_CONFIG.
+
+       build: Update gpg-error.m4 and gpgrt.m4.
+       + commit abc641f27cf712dec572b6629552b6a6f0b7af27
+       * src/gpg-error.m4: Bump version date.
+       (min_gpg_error_version): Require >= 1.33, if not specified.
+       (gpg_error_config_args): Remove bogus uses.
+       * src/gpgrt.m4: Bump version date.
+       (libgpgrt-prefix): Add support of --with-libgpgrt-prefix option.
+       (gpgrt-config): Search/call gpgrt-config instead of gpg-error-config.
+       (min_gpgrt_version): Require >= 1.33, if not specified.
+       (gpgrt_config_args): Remove bogus uses.
+
+2018-10-24  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpg-error-config: Fix previous commit.
+       + commit 184c22bea37d2bee3885ef96c1a3664361b02912
+
+
+       gpg-error-config: Old gpg-error-config support --modversion.
+       + commit 6d8b1e958ca96b366daac38e7084f999d252a9f8
+       * src/gpg-error-config.in: Support --modversion.
+
+       gpg-error-config: Get var/attr from the first package.
+       + commit 7b81ec272b0c54ac893c09be4715b76e84c27b23
+       * src/gpg-error-config-new.in: Only get it from the first.
+
+2018-10-23  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Fix permission.
+       + commit 25ea85066cf100e3381f7f7b2d8858a7dfcea480
+       * build-aux/config.guess: Chmod +x.
+       * build-aux/config.sub: Chmod +x.
+
+       build: Fix detecting build on multiarch environment.
+       + commit 00e955558c66f80acad9225d2eae82459d87dc54
+       * configure.ac: Rough match by shell pattern.
+
+       build: Supply CC to invoke gpg-error-config.
+       + commit f575b2fd3f733d78fb61b04805ea63ce65d89e19
+       * src/gpg-error.m4: Add CC when invoking gpg-error-config.
+       * src/gpgrt.m4: Likewise.
+
+       gpg-error-config: Fix cross build support.
+       + commit 40e22c774afebca23fdaa6dec2b8698572501c32
+       * configure.ac: Fix regexp matching multiarch environment.
+       * src/gpg-error-config-new.in: Support standard cross build.
+       Handle the case where $multiarch != $triplet.
+
+2018-10-22  NIIBE Yutaka  <gniibe@fsij.org>
+
+       yat2m: Avoid compiler warnings.
+       + commit 12b834ba59ae2f3cd0568e4cfa1dca47fc41269a
+       * doc/yat2m.c (isodatestring): Prepare enough buffer.
+
+       gpg-error-config: Support "auto", architecture independent script.
+       + commit 91bcb2c7d824de50c7dfedd4490e515ddb5dfc5a
+       * configure.ac (pkg_config_libdir): Set it "auto" when it looks
+       multiarch environment.
+       * src/gpg-error-config-new.in: Automatically detects the triplet.
+
+       build: Update config.{guess,sub} to {2018-08-29,2018-08-29}.
+       + commit 6d2e0546d50a0d4511fb7167566bfd0058a68f38
+       * build-aux/config.guess: Update.
+       * build-aux/config.sub: Update.
+
+2018-10-19  Daniel Kahn Gillmor  <dkg@fifthhorseman.net>
+
+       build-aux: use https instead of http.
+       + commit e99480affa595702595e59333aca96ab28389d34
+
+
+2018-10-17  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpg-error-config: Fix PKG_CONFIG_LIBDIR support.
+       + commit d8cf57c35d4627fa28588d6ec385fcffbc5a01a0
+       * configure.ac (pkg_config_libdir): New.
+       * src/gpg-error-config-new.in: Use pkg_config_libdir.
+
+2018-10-16  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpg-error-config: Support PKG_CONFIG_LIBDIR.
+       + commit e9566da20cf9428e3094cbd63277ea2179459232
+       * src/gpg-error-config-new.in: Use PKG_CONFIG_LIBDIR if specified.
+
+2018-10-12  Wookey  <wookey@debian.org>
+           Wookey  <wookey@debian.org>
+
+       syscfg: Add support for arm64ilp32.
+       + commit a3f4e8838036a14e87cca811e40c9f670f152fcd
+       * src/syscfg/lock-obj-pub.aarch64-unknown-linux-gnu_ilp32.h: New.
+       * src/Makefile.am (lock_obj_pub): Add it.
+
+2018-10-10  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpg-error-config: Fix the place of *.pc (for multilib).
+       + commit 9f71b28dcb38e1d5d9001692e2f64009396aaf9b
+       * src/Makefile.am (pkgconfigdir): It should be under libdir.
+       * src/gpg-error-config-new.in: Likewise.
+
+       gpg-error-config: Add PKG_CONFIG_SYSROOT_DIR support.
+       + commit 6167f3c461a4e53ccc5af620cdbfa28bfa9234f5
+       * src/gpg-error-config-new.in (sysroot): New function.
+       (want_cflags, want_libs): Use sysroot.
+       * src/gpg-error-config-test.sh: Test with PKG_CONFIG_SYSROOT_DIR.
+
+2018-09-21  Werner Koch  <wk@gnupg.org>
+
+       syscfg: Add support for arc-unknown-linux-gnu.
+       + commit f4f0da74f526d7e35cedbc2e93454df6440dbfa5
+       * src/mkheader.c (canon_host_triplet): Add to table.
+
+       core: Make cross building in mkheader more explicit.
+       + commit b371e3ca906e6a4db31900d419ddc2b21bed1ea3
+       * src/mkheader.c (main): Add option --cross.
+       (write_special): Don't use native in cross mode.
+       * src/Makefile.am (mkheader_opts): New.
+       (gpg-error.h): Add MKHEADER_OPTS.
+
+       core: Simplify calling convention of mkheader.
+       + commit 3fc4ce49b23a364a1cf255c8e9e259047206e1e8
+       * src/Makefile.am (gpg-error.h): Remove HOST_OS from mkheader call.
+       * src/mkheader.c (canon_host_triplet): Add return arg r_os.
+       (main): Remove first arg and derive host_os from host_triplet.
+
+2018-09-20  NIIBE Yutaka  <gniibe@fsij.org>
+
+       src: Fix portability for echo.
+       + commit 15309d0fb4c78f8de9bc5dea7d0f8b7468a957b4
+       * src/Makefile.am: Use ECHO_N and ECHO_C.
+
+       gpg-error-config: Remove white space for the output by old.
+       + commit d510f38ccbc715faa8e07828bf6acd8e9b9a0658
+       * src/gpg-error-config-test.sh: Remove white spaces at the
+       end or at the beginning.
+
+       gpg-error-config: Use expr to remove var in expression.
+       + commit a338801aa4bac9a3551729598bcb0ca41882cdb9
+       * src/gpg-error-config-new.in (remove_var_expr): Use expr.
+
+       gpg-error-config: Fix a variable name for zsh.
+       + commit 4c2601a95f06efd352ad407add71a7ea6bab8152
+       * src/gpg-error-config-new.in (module_list): Rename from modules.
+
+       gpg-error-config: Don't use local variables.
+       + commit 5731ad6377abcd3d36fd6aa59923a640b25b589b
+       * src/gpg-error-config-new.in: Use global variables only.
+
+       gpg-error-config: Avoid more space char.
+       + commit 95ab4d037ce2b69754c0542949bf7d9d2467d96b
+       * src/gpg-error-config-new.in: Don't put more space.
+
+2018-09-19  NIIBE Yutaka  <gniibe@fsij.org>
+
+       src: Fix Makefile for BSD make.
+       + commit 144f4b3df5200ce056f00e20420cde77eb1f673d
+       * src/Makefile.am (BUILT_SOURCES): Add srcdir to err-sources.h and
+       err-codes.h.
+       (CLEANFILES): Move err-sources.h and err-codes.h to...
+       (MAINTAINERCLEANFILES): ... this new target.
+       (gpg_error_LDADD): Remove ./ to generate libgpg-error.la.
+
+       Accept pkgconf difference for spaces.
+       + commit 5564efac95e9546af948fc13c90584264b322950
+       * src/gpg-error-config-test.sh (OUTPUT_OLD): Use shell
+       and echo to remove spaces.
+
+2018-09-18  Werner Koch  <wk@gnupg.org>
+
+       syscfg: Support ARC CPUs and simplify aliasing table.
+       + commit 48c8f8ddfc80551db7615e1eb3555c1dc3f6a657
+       * src/mkheader.c (xmalloc): New.
+       (xstrdup): Implement using xmalloc.
+       (canon_host_triplet): Add supporr for arc CPU.  Adjust alias table to
+       also alias *-pc-*.  Rename ibm to unknown. Add internal arg.  Add
+       unknown vendor hack.
+       (main): New mode to just print the canonicalized form.
+       * src/Makefile.am (lock_obj_pub): s/-(pc|ibm)-/-unknown/.  Also rename
+       files accordingly.
+
+2018-09-11  NIIBE Yutaka  <gniibe@fsij.org>
+
+       Make gpg-error-config compatible to pkg-config.
+       + commit 78b679a778ddf37b8952f1808fd8c52cc8163f17
+       * configure.ac (AC_CONFIG_FILES): Generate src/gpg-error.pc, as well
+       as src/gpg-error-config-old and src/gpg-error-config-new.
+       * src/Makefile.am (pkgconfigdir, pkgconfig_DATA): New.
+       (EXTRA_DIST): Add gpg-error-config-new.in, gpg-error-config-test.sh,
+       and gpg-error.pc.in.
+       (CLEANFILES): Add gpg-error-config gpg-error-config-test.log.
+       (TESTS): New.
+       (gpg-error-config): New target.
+       * src/gpg-error-config-new.in: New.
+       * src/gpg-error-config-test.sh: New.
+       * src/gpg-error.pc.in: New.
+       * src/gpg-error.m4 (GPG_ERROR_MT_CFLAGS): Use --variable.
+       (GPG_ERROR_MT_LIBS, gpg_error_config_host): Likewise.
+
+2018-09-06  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpgscm: Suppress warnings for GCC > 6.
+       + commit b2aba1bec151d6e6cbf66359a30ba2ff458fc138
+       * tests/gpgscm/scheme.c (CASE): Use unused attribute for GCC > 6.
+       (FALLTHROUGH): New for fallthrough.
+       (Eval_Cycle): Use FALLTHROUGH.  Remove not-needed comment of
+       fallthrough.
+
+       po: Fix the previous commit.
+       + commit 2148e19fbefa9c5d5cdc4982cd2043136c31fb64
+
+
+2018-09-05  NIIBE Yutaka  <gniibe@fsij.org>
+
+       po: Update Japanese Translation.
+       + commit cb0113f4690ed130c55ef4c6d8699ebc051e957e
+
+
+       gpg-error-config: Forward compatibility support.
+       + commit 61d78fdc25e5ff9289697c141457d8d322232250
+       * src/gpg-error-config.in: Support --variable=* option.
+
+2018-09-04  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpg-error-config: Determine output at configure time.
+       + commit aa697dae4c363b3d24ec9be3a0cd41df3bf806ce
+       * src/gpg-error-config.in (isubdirafter): Remove.
+       Also for --cflags and --libs.
+       * configure.ac (GPG_ERROR_CONFIG_ISUBDIRAFTER): Remove.
+       (GPG_ERROR_CONFIG_CFLAGS): Add -idirafter gpg-extra for W32CE.
+       (GPG_ERROR_CONFIG_CFLAGS): Decide here if adding -I$includedir.
+       (GPG_ERROR_CONFIG_LIBS): Decide here if adding -L$libdir.
+
+2018-07-17  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
+
+       build: use EXEEXT_FOR_BUILD everywhere.
+       + commit 19f9902b004cb980de4da908fa571103bfe2b630
+       * src/Makefile.am: Use EXEEXT_FOR_BUILD with all build tools.
+
+               <michael.haubenwallner@ssi-schaefer.com>
+
+2018-07-12  Werner Koch  <wk@gnupg.org>
+
+       Release 1.32.
+       + commit 7b08307ff25b757ed2502cb2bf7893640e404ad1
+
+
+       estream: Always propagate flush event to cookie functions.
+       + commit bd5bcd2dd19ef0b1c3d33a3a388b537ba08a4eb6
+       * src/estream.c (flush_stream): Always call cookie's flush func.
+
+2018-07-11  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Use AX_CC_FOR_BUILD and EXEEXT.
+       + commit 0727c394562237d7e626849eae04790264e56208
+       * configure.ac (AX_CC_FOR_BUILD): New.
+       * doc/Makefile.am: Use EXEEXT and EXEEXT_FOR_BUILD.
+       * m4/ac_prog_cc_for_build.m4: Remove.
+       * m4/ax_cc_for_build.m4: New.
+
+       doc: Now, yat2m is a standard tool.
+       + commit f1162767e3552d05c1255497d49de15c2d94d0b4
+       * configure.ac (YAT2M, HAVE_YAT2M): Remove.
+       * doc/Makefile.am: Always use yat2m which comes with this source.
+
+2018-07-10  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Remove version_parts in autogen.sh.
+       + commit 302d43a130e2364ea882474088a8b0a31bc325b9
+       * autogen.rc (version_parts): Remove.
+       * autogen.sh: Determine by $micro argument.
+
+2018-07-05  Werner Koch  <wk@gnupg.org>
+
+       Remove leftover debug output from gpg-error.
+       + commit 1ac63f630cbe1b558ebe20b746bbe4962117d36f
+       * src/gpg-error.c (main): Remove a log_debug.
+
+2018-07-05  Yuri Chornoivan  <yurchor@ukr.net>
+
+       po: Update Ukrainian translation.
+       + commit 8a72604dc44d36790669e6e591c12cc0b6e057bd
+
+
+2018-07-05  Andre Heinecke  <aheinecke@intevation.de>
+
+       core: Initialize values in estream_format.
+       + commit fe2f8fca3114e3a5727fdbbc5e7ebc4e442d0401
+       * src/estream-printf.c (_gpgrt_estream_format): Make sure
+       valuetable.value is inialized even on stack.
+
+2018-05-30  Ineiev  <ineiev@gnu.org>
+
+       po: Update Russian translation.
+       + commit 043a91b8cd4bb71cb96086b51d6bc1b1a1821a41
+
+
+2018-05-30  Werner Koch  <wk@gnupg.org>
+
+       core: Fix problem with C11 and stdnoreturn.h.
+       + commit 3eee9efc46f983fe0bf474c814944fef93a2a1b7
+       * src/gpg-error.h.in (GPGRT_ATTR_NORETURN): Use gcc specific symbol name
+       __noreturn__.
+
+2018-05-03  Andre Heinecke  <aheinecke@intevation.de>
+
+       doc: Fix yat2m name for native w32 build.
+       + commit 6eb80abcde5ad776379069871e4156b28ef69712
+       * doc/Makefile.am: Handle not cross compiling but building for
+       windows.
+
+2018-05-02  Werner Koch  <wk@gnupg.org>
+
+       Release 1.31.
+       + commit 10a984d25048a09d1c489224bae866372e8066a1
+       * configure.ac: Set LT version to C24/A24/R2.
+
+2018-05-01  Werner Koch  <wk@gnupg.org>
+
+       core,w32: Avoid recursive use of npth_unprotect.
+       + commit b26a227173e8e9b91be14f06ee781c6e214e50ff
+       * src/w32-estream.c (reader): Use standard free.
+       (writer): Ditto.
+
+2018-05-01  emma peel  <emma.peel@riseup.net>
+
+       po: new Spanish translation.
+       + commit 7e2517a29619c35257b38aa137b6772e471d7e4e
+
+
+2018-04-30  Werner Koch  <wk@gnupg.org>
+
+       Release 1.30.
+       + commit cac048bf8454ade95a905f9d3840b1ec284fce20
+       * configure.ac: Bump LT version to C24/A/24/R1.
+
+       build: More release creation automation.
+       + commit d1d4c4f8eb9830bfb671054e1558342106ba9d8d
+       * Makefile.am: Add release and sign-release targets.
+
+       core: Fix gpgrt_poll for Windows under nPth.
+       + commit 4f45f3e0bb404b4a9787cb55ca154c6f60c1437b
+       * src/estream.c (_gpgrt_poll) [W32]: Use syscall clamp.
+
+2018-04-13  NIIBE Yutaka  <gniibe@fsij.org>
+
+       doc: Fix yat2m build for cross compilation.
+       + commit 792877a08ca7bc9d1377161dc9af374602a394cc
+       * doc/Makefile.am: Fix target of yat2m-for-build.
+
+2018-04-12  NIIBE Yutaka  <gniibe@fsij.org>
+
+       build: Check -lsocket -lnsl for Solaris.
+       + commit e35749023ca68de6f1f85d3072f7b36fd6f6fe7c
+       * configure.ac: Check inet_addr for -lnsl, and socket for -lsocket.
+
+2018-04-11  Damien Goutte-Gattat via Gnupg-devel  <gnupg-devel@gnupg.org>
+
+       build: Make sure version.texi is generated in time.
+       + commit 8ef76d9373db16f1ca176f9c87c8dac2758c8b85
+       [[PGP Signed Part:Good signature from AA4373E6C82C78AD Damien Goutte-Gattat <dgouttegattat@incenp.org> (trust undefined) created at 2018-04-11T17:05:27+0200 using RSA]]
+       [1. text/plain]
+
+       * doc/Makefile.am (yat2m-stamp): Depend on version.texi.
+
+2018-04-11  Werner Koch  <wk@gnupg.org>
+
+       Release 1.29.
+       + commit c3825327da826e434ada9abde34e6bbd7ef61737
+       * configure.ac: Bump LT version to C24/A24/R0.
+
+       core: Finalize the API for argparse.
+       + commit e901c9fb04f5a96ba2bd49225b396ce7857a3782
+       * src/gpg-error.h.in (ARGPARSE_end): Simplify.
+       * src/argparse.c (_gpgrt_argparse_internal_s): Add field opts.
+       (deinitialize): Release new field.
+       (initialize): Add arg opts and create a copy of the option list.  Add
+       the internal options.
+       (_gpgrt_argparse): Rename arg opts to opts_orig and set new local var
+       opts.  Adjust all references to opts.
+       (find_long_option): Adjust for chnaged type of OPTS.  Re-indent.
+       (arg_parse): Remove internal option assignment.  Rename arg opts to
+       opts_orig and set new local var opts.  Adjust all references to opts.
+       (show_help): Adjust all references to opts.
+
+2018-03-27  NIIBE Yutaka  <gniibe@fsij.org>
+
+       doc: Support cross compilation for yat2m.
+       + commit efc4769339d42a4a399c040c146cf4a29c02ea4f
+       * configure.ac (HAVE_YAT2M): New.
+       * doc/Makefile.am [CROSS_COMPILING]: Supported.
+
+2018-03-22  Werner Koch  <wk@gnupg.org>
+
+       build: Add option --git-build to autogen.sh.
+       + commit 1b30d21c8780f5510815d4fb2523afad9fff85dc
+
+
+       yat2m: Avoid compiler warnings.
+       + commit 30621ee4c13006d08881994c32c89f60604c0188
+       * doc/yat2m.c (evaluate_conditions): Mark args unused
+       (proc_texi_cmd): Avoid shadowing warning.
+
+       core: Add Base-64 encoder.
+       + commit ffc8f805165a13d16ed227051c59d732117ec9d4
+       * src/b64enc.c: Change to fit into libgpg-error.
+       * src/Makefile.am: Add b64enc.c
+       * src/b64dec.c: Use xtrymalloc etc.  Always use gpg_err_code_t.
+       (_gpgrt_b64dec_start): Set decoder flag
+       (_gpgrt_b64dec_finish): Check for conflict.
+       (_gpgrt_b64state): Move to ...
+       * src/gpgrt-int.h: here.  Add new fields.
+       * src/visibility.c (gpgrt_b64enc_start): New.
+       (gpgrt_b64enc_write): New.
+       (gpgrt_b64enc_finish): New.
+       * src/gpg-error.vers, src/gpg-error.def.in: Add new functions.
+       * src/gpg-error.h.in: Ditto.
+       * src/visibility.h: Ditto.
+
+       * tests/t-b64dec.c: Remove.
+       * tests/t-b64.c: New.
+       * tests/Makefile.am (TESTS): Replace t-b64dec by t-b64.
+
+2018-03-22  NIIBE Yutaka  <gniibe@fsij.org>
+
+       doc: Fix build and installation of yat2m.
+       + commit 4dc6d4d2067c726cdb13593bf151637319ff65e6
+       * configure.ac (YAT2M): Require it when cross compiling.
+       * doc/Makefile.am (bin_PROGRAMS): Add yat2m.
+
+2018-03-21  Werner Koch  <wk@gnupg.org>
+
+       po: Merge GnuPG's strings from argparse.c.
+       + commit e492e0a0a73e1ea9c80f355a25f632af69d3a569
+
+
+       tools: Use gpgrt_argparse for the gpg-error tool.
+       + commit 11ce9bc3d6fe75859e18112824ae7ec3ca0fc8df
+       * src/gpg-error.c (show_usage): Remove.
+       (my_strusage): New.
+       (main): Change to use argparse.  Also use log_error.
+
+       core: Add public function gpgrt_usage.
+       + commit ed78ef7f06649f85f1c94c4fb2bd3f6b16fd9a63
+       * src/visibility.c (gpgrt_usage): New.
+
+       core: Add the group of argparse functions.
+       + commit 13d6fbfd4360cb74588556a3a0058c4057d0bcf0
+       * src/visibility.c (gpgrt_argparse): New.
+       (gpgrt_strusage): New.
+       (gpgrt_set_strusage): New.
+       (gpgrt_set_usage_outfnc): New.
+       (gpgrt_set_fixed_string_mapper): New.
+       * src/gpg-error.def.in, src/gpg-error.vers: Add new functions.
+       * src/gpg-error.h.in: Add ARGPARSE macros from the former argparse.h.
+       (gpgrt_argparse_t): New.
+       (gpgrt_opt_t): New.
+       * configure.ac (AH_BOTTOM): Request argparse macros.
+       * src/Makefile.am (libgpg_error_la_SOURCES): Add argparse.c.
+       * src/argparse.h: Remove.
+       * src/argparse.c: Revamp to fit into libgpg-error.
+       (_gpgrt_argparse): New.
+       (_gpgrt_usage): Rename from usage.
+       (_gpgrt_strusage): Rename from strusage.  Define two new levels and
+       templates for three common licenses.
+       (_gpgrt_set_strusage): Rename from set_strusage.
+       (_gpgrt_set_usage_outfnc): New.
+       (_gpgrt_set_fixed_string_mapper): New.
+
+       * tests/t-argparse.c: New.
+
+2018-03-18  Werner Koch  <wk@gnupg.org>
+
+       core: Fix regression on arm64 due to invalid use of va_list.
+       + commit 791177de023574223eddf7288eb7c5a0721ac623
+       * src/logging.c (_gpgrt_log_printhex): Provide a dummy arg instead of
+       NULL.
+
+2018-03-14  Werner Koch  <wk@gnupg.org>
+
+       core: Fix building on W64.
+       + commit c36a60687976d98b54dac17f699dfca4918a737c
+       * src/w32-add.h: Remove hack to define pid_t.
+       * src/gpg-error.h.in: Eval macro to define pid_t.
+       * src/mkheader.c (have_sys_types_h, sys_types_h_included): New.
+       (parse_config_h): Test for sys/types.h.
+       (write_special): Protect inclusion of sys/types.h.  Define new macro
+       'define:pid_t'.
+
+2018-03-13  Werner Koch  <wk@gnupg.org>
+
+       Release 1.28.
+       + commit e32342397eab85fed5ef709317cc50dc7cbc41a5
+
+
+2018-02-28  NIIBE Yutaka  <gniibe@fsij.org>
+           Karsten Merker  <merker@debian.org>
+
+       syscfg: Add a riscv64 architecture.
+       + commit 596c0d701edeb45e0069bb74b9343e3d5b708ef0
+       * src/syscfg/lock-obj-pub.riscv64-unknown-linux-gnu.h: New.
+       * src/Makefile.am (lock_obj_pub): Add it.
+
+2018-02-21  Werner Koch  <wk@gnupg.org>
+           Todd Zullinger
+
+       build: Document how to use git send-email.
+       + commit 70058cd9f944d620764e57c838209afae8a58c78
+       * autogen.rc: Add patches_to.
+       * autogen.sh: Run git config sendemail.to.
+       * doc/HACKING: Describe use of git send-email.
+
+2018-02-21  Thorsten Behrens  <Thorsten.Behrens@CIB.de>
+
+       doc: clarify patch submission workflow.
+       + commit 887530733d0486ab68ff351c4855f5450c2d50e6
+
+
+2017-12-11  Werner Koch  <wk@gnupg.org>
+
+       core: Avoid using estream_t in the public API.
+       + commit f9a33a7f7e44a644ff4e31f7e9f1c2c1ec1f8eee
+       * src/gpg-error.h.in: Always use gpgrt_stream-t.
+
+2017-12-08  Werner Koch  <wk@gnupg.org>
+
+       core: Rename the gpgrt_log_levels enum values.
+       + commit de167fa92d009745c51dae547990845282cbb351
+       * src/gpg-error.h.in (gprt_log_levels): Rename to GPGRT_LOGLVL.
+
+2017-11-29  Werner Koch  <wk@gnupg.org>
+
+       core: Wrap blocking system calls of the spawn functions.
+       + commit 4acf116ba6d144c2cfa39ff54a23b8864b4ce895
+
+
+       core: Unify syscall_clamp functions.
+       + commit adc786d034b63176b941a1ef8d996acbf8d0ea5d
+       * src/estream.c (_gpgrt_set_syscall_clamp)
+       (_gpgrt_get_syscall_clamp): Move to ...
+       * src/syscall-clamp.c: new file.
+       (_gpgrt_pre_syscall, _gpgrt_post_syscall): New.
+       * src/Makefile.am (libgpg_error_la_SOURCES): Add that file.
+       * src/estream.c: Replace the syscall wrapper with the new functions.
+       * src/posix-lock.c: Ditto.
+       * src/w32-lock.c: Ditto.
+       * src/posix-thread.c: Ditto.
+       * src/w32-thread.c: Ditto.
+
+       core: Implement the spawn functions.
+       + commit 1865c0ba1769b407a3c504f1ab0a4278704a9fc1
+       * src/gpg-error.h.in  (GPGRT_SPAWN_NONBLOCK): New const.
+       (GPGRT_SPAWN_RUN_ASFW): New const.
+       (GPGRT_SPAWN_DETACHED): New const.
+       (gpgrt_make_pipe): New function.
+       (gpgrt_create_pipe): New macro.
+       (gpgrt_create_inbound_pipe): New macro.
+       (gpgrt_create_outbound_pipe): New macro.
+       (gpgrt_spawn_process): New function.
+       (gpgrt_spawn_process_fd): New function.
+       (gpgrt_spawn_process_detached): New function.
+       (gpgrt_wait_process): New function.
+       (gpgrt_wait_processes): New function.
+       (gpgrt_kill_process): New function.
+       (gpgrt_release_process): New function.
+       * src/gpg-error.def.in, src/gpg-error.vers: Add new functions.
+       * src/visibility.c, src/visibility.h: Add wrappers for new functions.
+       * src/spawn-posix.c: Rework to better fit the use in gpgrt.  Rename
+       all public function with a _gpgrt prefix.
+       * src/spawn-w32.c: Ditto.
+       * src/gpgrt-int.h: Likewise.
+       * src/Makefile.am (arch_sources): Add spawn-posix.c and spawn-w32.c.
+       * src/w32-add.h: Add pid_t typedef as a temporary hack.
+       * configure.ac: Check for signal.h and getrlimit.
+       (AC_FUNC_FORK): New.
+
+       Import and relicense exechelp* functions from GnuPG.
+       + commit 8f41cc23b12485404203be5881aaaadb78696b4d
+       * src/spawn-posix.c: New.  Taken from GnuPG's exechelp-posix.c.
+       * src/spawn-w32.c: New.  Taken from GnuPG's exechelp-w32.c.
+       * src/gpgrt-int.h: Include prototypes from GnuPG's exechelp.h.
+
+2017-11-28  Werner Koch  <wk@gnupg.org>
+
+       core: Change new functions to return gpg_err_code_t.
+       + commit 513415c71781ab400ebb01f6b4cf2984ec6b1757
+       * src/gpg-error.h.in (gpgrt_sentenv, gpgrt_mkdir, gpgrt_chdir): Change
+       return type to gpg_err_code_t.
+       * src/sysutils.c (_gpgrt_setenv): Implement that.
+       (_gpgrt_mkdir): Ditto.
+       (_gpgrt_chdir): Ditto.
+       * gpgscm/ffi.c (do_setenv, do_mkdir): Adjust for this change.
+
+       gpgscm: Some adjustments for use in gpgrt.
+       + commit 930d27ba6b1205395add0c79139e62355a1d5b62
+       * gpgscm/Makefile.am: Remove cruft leftover from GnuPG.  Link to the
+       just build libgpg-error.
+       * gpgscm/private.h: Include gpgrt.h and provide i18n macros.
+       (xfree, xtrymalloc, xtrycalloc, xtryrealloc): New macros.
+       (xmalloc, xstrdup): New inline functions.
+       * gpgscm/main.c: Remove inclusion of gcrypt.h and gpg-error.h.  Remove
+       all other gnupg specific headers.
+       (opts, parse_arguments): Temporary comment out.
+       (main): Adjust for use with gpgrt.  Temporary comment out some stuff.
+       * gpgscm/ffi-private.h: Include local gpgrt.h instead of gpg-error.h.
+       * gpgscm/ffi.h: Ditto.
+       * gpgscm/ffi.c: Remove gpg-error.h and headers from GnuPG.
+       (do_getenv): Use gpgrt_getenv.
+       (do_setenv): Use gpgrt_setenv.
+       (do_mkdtemp): Temporary return an error.
+       (unlink_recursively): Use gpgrt_bsprintf.
+       (do_getcwd): Use gpgrt_getcwd.
+       (do_mkdir): Use gpgrt_mkdir.
+       (do_get_isotime): Temporary return an error.
+       (do_get_time): Directly use time().
+
+       core: New API functions gpgrt_mkdir, gpgrt_chdir, gpgrt_getcwd.
+       + commit 4a2538e69dd35377bce0fb584f72322c69a111b3
+       * src/gpg-error.h.in (gpgrt_mkdir, gpgrt_chdir, gpgrt_getcwd): New.
+       * src/visibility.c, src/visibility.h: Add wrappers.
+       * src/gpg-error.vers, src/gpg-error.def.in: Add them.
+       * src/sysutils.c (modestr_to_mode): New.
+       (_gpgrt_mkdir, _gpgrt_chdir, _gpgrt_getcwd): New.
+       * m4/gnupg-misc.m4: New.
+       * m4/Makefile.am (EXTRA_DIST): Add new M4 file.
+       * configure.ac: Call new GNUPG_FUNC_MKDIR_TAKES_ONE_ARG.
+       (AC_CHECK_FUNCS): Add stat.
+
+       core: Prepare to build with gpgscm.
+       + commit 241e9a73891fcd12f124aab1a299c2cf4f8eebc4
+       * configure.ac: New option --enable-gpgscm.  Create gpgscm/Makefile.
+       (GPGRT_ENABLE_LOG_MACROS): Define.
+       * Makefile.am (SUBDIRS): Add gpgscm
+       * src/logging.c (_gpgrt_logv_clock): Do not use the log_debug macro.
+
+       core: New API functions gpgrt_getenv and gpgrt_setenv.
+       + commit b67daca506991507cea9d383df7faf95117e58a6
+       * src/gpg-error.h.in (gpgrt_getenv, gpgrt_setenv): New.
+       (gpgrt_unsetenv): New macro.
+       * src/gpg-error.vers, src/gpg-error.def.in: Add them.
+       * src/visibility.c (gpgrt_getenv, gpgrt_setenv): New.
+       * src/visibility.h: Add them.
+       * src/sysutils.c: Include string.h and on Windows windows.h.
+       (_gpgrt_getenv): New.
+       (_gpgrt_setenv): New.
+
+2017-11-27  Werner Koch  <wk@gnupg.org>
+
+       core: Install new files gpgrt.m4 and gpgrt-config.
+       + commit 97b0881216af24f2a46c11650e23691cff9cb12a
+       * src/gpgrt.m4: New.  Bascially a copy of libgpg-error.m4
+       * src/gpg-error-config.in: Decide which name to print.
+       * src/Makefile.am (nodist_bin_SCRIPTS): Add gpgrt-config.
+       (m4data_DATA): Add gpgrt.m4
+       (EXTRA_DIST): Add gpgrt.m4.
+       (BUILT_SOURCES): Add gpgrt-config.
+       (CLEANFILES): Add gpgrt-config.
+       (gpgrt-config): Create from gpg-error-config.
+
+       core: Avoid endless recursion if log_set_sink has not been used.
+       + commit 84ebd2f34882d29510f819a797fade0297fe9ab9
+       * src/logging.c (_gpgrt_log_set_sink): Do not call gf_is_valid if the
+       default sink has been requested.
+
+       core: Add new macro log_assert to the API.
+       + commit d1e3401013f85620f3136958be079c13ca758b20
+       * src/gpg-error.h.in (log_assert): New macro.
+
+2017-11-22  Werner Koch  <wk@gnupg.org>
+
+       core: Do not use the estream_t alias in gpg-error.h.
+       + commit e0ef8126c20216f79b7ad147c103bb2cf2790c59
+       * src/gpg-error.h.in: Use gpgrt_stream_t in prototypes.
+
+2017-11-17  Werner Koch  <wk@gnupg.org>
+
+       w32: Avoid unused code warning.
+       + commit a950326d20990fa33cee637d5b54d708fff585b2
+       * src/w32-estream.c (_gpgrt_w32_poll) [!ENABLE_TRACING]: Do not use
+       waitinfo.
+
+       w32: Add new API fucntion gpgrt_w32_reg_query_string.
+       + commit b5c4a2721d7b4bd54705c53e6f294ab2ef66a6f7
+       * src/w32-reg.c: New.
+       * src/w32-add.h: Add gpgrt_w32_reg_query_string.
+       * src/visibility.c (gpgrt_w32_reg_query_string): New wrapper.
+       * src/gpg-error.def.in: Add gpgrt_w32_reg_query_string.
+       * configure.ac (ac_check_funcs): Add stpcpy.
+       * src/Makefile.am (arch_sources): Add w32-reg.c
+       (socklibs): New.
+       (libgpg_error_la_LIBADD): Add socklibs.
+       * src/gpgrt-int.h (xfree, xtrymalloc, xtrycalloc)
+       (xtryrealloc): New internal macros.
+       (_gpgrt_stpcpy, stpcpy): New replacement fucntion and macro.
+       * src/logging.c (_gpgrt_logv_internal): Use new registry query
+       function and add standard registry key.
+
+       core: New API functions gpgrt_strdup and gpgrt_strconcat.
+       + commit 0d8d46c76a32176be440b062d2501bbb044fb99d
+       * src/visibility.c (gpgrt_strdup): New API fucntion.
+       (gpgrt_strconcat): New API fucntion.
+       * src/visibility.h: Add corresponding macros.
+       * src/gpg-error.def.in: Add them.
+       * src/gpg-error.vers: Add them.
+       * src/gpgrt-int.h (DIM): New macro.
+       * src/init.c (_gpgrt_strdup): New.
+       (_gpgrt_strconcat_core): New.
+       (_gpgrt_strconcat): New.
+
+       core: New API functions gpgrt_malloc, gpgrt_calloc, and gpgrt_realloc.
+       + commit 80c18e1b212cc91946864db7a53da50e9f91b861
+       * src/visibility.c (gpgrt_realloc): New API function.
+       (gpgrt_malloc): New API function.
+       (gpgrt_calloc): New API function.
+       * src/visibility.h: Add corresponding macros.
+       * src/gpg-error.def.in: Add them.
+       * src/gpg-error.vers: Add them.
+       * src/init.c (_gpgrt_calloc): New.
+       * src/gpg-error.h.in: Add prototypes.
+
+       core: Add logging API.
+       + commit 1b653e7f37e2eb2a8f590a43651eb8aecbe8756e
+       * src/visibility.c (gpgrt_get_errorcount): New API.
+       (gpgrt_inc_errorcount): New API.
+       (gpgrt_log_set_sink): New API.
+       (gpgrt_log_set_socket_dir_cb): New API.
+       (gpgrt_log_set_pid_suffix_cb): New API.
+       (gpgrt_log_set_prefix): New API.
+       (gpgrt_log_get_prefix): New API.
+       (gpgrt_log_test_fd): New API.
+       (gpgrt_log_get_fd): New API.
+       (gpgrt_log_get_stream): New API.
+       (gpgrt_log): New API.
+       (gpgrt_logv): New API.
+       (gpgrt_logv_prefix): New API.
+       (gpgrt_log_string): New API.
+       (gpgrt_log_info): New API.
+       (gpgrt_log_error): New API.
+       (gpgrt_log_fatal): New API.
+       (gpgrt_log_bug): New API.
+       (gpgrt_log_debug): New API.
+       (gpgrt_log_debug_string): New API.
+       (gpgrt_log_printf): New API.
+       (gpgrt_log_flush): New API.
+       (gpgrt_log_printhex): New API.
+       (gpgrt_log_clock): New API.
+       (_gpgrt_log_assert): New function for the ABI.
+       * src/visibility.h: Add corresponding macros.
+       * src/gpg-error.def.in: Add new functions.
+       * src/gpg-error.vers: Add new functions.
+       * src/gpg-error.h.in (GPGRT_LOG_WITH_PREFIX): New constant.
+       (GPGRT_LOG_WITH_TIME): New constant.
+       (GPGRT_LOG_WITH_PID): New constant.
+       (GPGRT_LOG_RUN_DETACHED): New constant.
+       (GPGRT_LOG_NO_REGISTRY): New constant.
+       (GPGRT_LOG_BEGIN): New enum value.
+       (GPGRT_LOG_CONT): New enum value.
+       (GPGRT_LOG_INFO): New enum value.
+       (GPGRT_LOG_WARN): New enum value.
+       (GPGRT_LOG_ERROR): New enum value.
+       (GPGRT_LOG_FATAL): New enum value.
+       (GPGRT_LOG_BUG): New enum value.
+       (GPGRT_LOG_DEBUG): New enum value.
+       (log_get_errorcount, log_inc_errorcount, log_set_file, log_set_fd)
+       (log_set_stream, log_set_socket_dir_cb, log_set_pid_suffix_cb)
+       (log_set_prefix, log_get_prefix, log_test_fd, log_get_fd)
+       (log_get_stream, log_log, log_logv, log_logv_prefix, log_string)
+       (log_bug, log_fatal, log_error, log_info, log_debug, log_debug_string)
+       (log_printf, log_printhex, log_clock)
+       (log_flush) [GPGRT_ENABLE_LOG_MACROS]: New wrapper macros.
+       (gpgrt_assert): New macro.
+       * src/gpgrt-int.h: Add prototypes for logging.c.
+       (gpgrt_assert): Redefine for internal use.
+       * src/logging.h: Remove.
+       * src/logging.c: Include gpgrt-int.h instead of the stuff from GnuPG.
+       Use _gpgrt malloc funcsions and the internal versions of the estream
+       functions.  Rename all public fucntions with a _gpgrt_ prefix.
+       (print_prefix): Return the printed length.
+       (_gpgrt_logv_internal): Ditto.
+       (_gpgrt_log_printhex): Change order of args and turn into a printf
+       like function.
+       (_gpgrt_logv_printhex): New. Take the core of the former
+       log_printhex.
+       (_gpgrt_log_clock): Turn into a printf like functions.
+       (_gpgrt_logv_clock): New.  Take the core of the former log_clock.
+
+       New configure options and macros for internal use.
+       + commit 9c904765c9b2b75e73b196b381470f0fb2f3b458
+       * configure.ac: Add option --enable-log-clock.
+       * configure.ac: Add option --enable-werror.
+       * src/sysutils.c: New.
+       * src/Makefile.am (libgpg_error_la_SOURCES): Add sysutils.c
+       * src/gpgrt-int.h: Add internal i18n macros and hacks to make working
+       with sockets easier.
+       (es_stdin, es_stdout, es_stderr): New internal macros.
+       (snprintf): New macro.
+
+2017-10-05  Werner Koch  <wk@gnupg.org>
+
+       gpgscm: Add required configure checks.
+       + commit 7c48edad2c782f416854eaa5c03bcf546d68eae2
+       * configure.ac: Add new checks.
+       * m4/readline.m4: New.  Taken from gnupg.
+       * m4/Makefile.am (EXTRA_DIST): Add it.
+
+2017-08-21  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Fix -Wimplicit-fallthrough warnings.
+       + commit dda5fb3474a81047e5bd52a194640fb44e1d60ab
+       * tests/gpgscm/scheme.c (CASE): Rearrange so that the case statement
+       is at the front.
+       (Eval_Cycle): Improve fallthrough annotations.
+
+2017-08-08  Werner Koch  <wk@gnupg.org>
+
+       build: New configure option --enable-all-tests.
+       + commit 3aa37d802ac10a38414a8cfe120de92a76968836
+       * configure.ac: New option --enable-all-tests.
+       * tests/gpgscm/ffi.c (ffi_init): New gloabl var *run-all-tests*.
+       * tests/openpgp/all-tests.scm (all-tests): Use that var instead
+       of *maintainer-mode*.
+       * Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Add --enable-all-tests.
+
+       gpgscm: Make the test summary stand out.
+       + commit c2fbc80c643db372f16aed100393cd2d4de46979
+       * tests/gpgscm/tests.scm (test-pool): Add delimiter lines.
+
+2017-08-07  Justus Winter  <justus@g10code.com>
+
+       tests: Do not run all tests unless in maintainer mode.
+       + commit d230224c38dd4b31348f7a1ad24be9e27935dc80
+       * configure.ac: Leak the maintainer mode flag into 'config.h'.
+       * tests/gpgscm/ffi.c: Pass it into the scheme environment.
+       * tests/openpgp/all-tests.scm: Only run tests against non-default
+       configurations (keyring, extended-key-format) in maintainer mode.
+
+2017-07-18  Justus Winter  <justus@g10code.com>
+
+       gpgscm,w32: Fix testing for absolute paths.
+       + commit c4230af0e62d7c8812eaedf4e6451a6288ff5769
+       * tests/gpgscm/main.c (path_absolute_p): New function.
+       (load): Use new function.
+
+2017-07-14  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Library improvements.
+       + commit a4dbace8c1d771bed5783aadf87a8075454e5a35
+       * tests/gpgscm/repl.scm (prompt-yes-no?): New function.
+       * tests/gpgscm/tests.scm (pathsep-split): Likewise.
+       (pathsep-join): Likewise.
+       (with-path): Use the new function.
+
+       gpgscm: Fail early if the test setup fails.
+       + commit c67386dcd95dd6a451b861e178503b29a7b13502
+       * tests/gpgscm/tests.scm (make-environment-cache): Check status code
+       of setup script.
+
+2017-07-13  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Make loading of modules less verbose.
+       + commit 8377569cae0764fd44701d67626b4c96f0bd8804
+       * tests/gpgscm/main.c (load): Increase logging threshold.
+
+       gpgscm: Make it impossible to catch '*interpreter-exit*'.
+       + commit ba3164673676468472ae37f32c3964d231e8a8f8
+       * tests/gpgscm/init.scm (throw'): Make it impossible to catch
+       '*interpreter-exit*'.  This fixes 'exit' (and with it 'fail') inside
+       'catch' statements.
+
+2017-07-05  Werner Koch  <wk@gnupg.org>
+
+       syscfg: Add lock-obj-pub file for ia64-unknown-linux-gnu.
+       + commit 0f5c3f67946fb5389df5b9963e6976b462bf5726
+       * src/syscfg/lock-obj-pub.ia64-unknown-linux-gnu.h: new.
+       * src/Makefile.am (lock_obj_pub): Add it.
+
+       yat2m: Use version from libgpg-error.
+       + commit 0148ea8d5acde2ad5d0376fb7eaa2221e88f258a
+       * doc/yat2m.c (VERSION): Define as PACKAGE_VERSION.
+       * doc/Makefile.am (yat2m): Pass PACKAGE_VERSION with -D.
+
+       build: Install yat2m.
+       + commit d81b1379edbc6007a89c3b2fff1b51c8dfe2e868
+       * doc/Makefile.am (install-exec-hook): New.
+       (uninstall-local): Uninstall yat2m.
+
+       yat2m: Take care of SOURCE_DATE_EPOCH.
+       + commit 5494a5728418938d2e42158bb646b07124184e64
+       * doc/yat2m.c (main): Set a default for OPT_DATE.
+
+2017-07-05  NIIBE Yutaka  <gniibe@fsij.org>
+
+       doc: minor fix for @xref.
+       + commit 187e2ad24fb92210587beb779a1cc746821a169c
+       * doc/yat2m.c (proc_texi_cmd): Captalize "see" for xref.
+
+2017-07-05  Justus Winter  <justus@g10code.com>
+
+       doc: Implement simple '@ref'erences.
+       + commit 55d560358f7ee4a8b68f98e051021a05d4c0bb1f
+       * doc/yat2m.c (proc_texi_cmd): Handle '@ref'.
+
+2017-06-19  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Limit the number of parallel jobs.
+       + commit 895ae4c6b1bd2fd9758d9c2835d9a3881e57a85a
+       * ffi.c (do_wait_processes): Suppress the timeout error.
+       * tests.scm (semaphore): New definition.
+       (test-pool): Only run a bounded number of tests in parallel.
+       (test::started?): New function.
+       (run-tests-parallel): Do not report results, do not start the tests.
+       (run-tests-sequential): Adapt.
+       (run-tests): Parse the number of parallel jobs.
+
+       gpgscm: Improve option parsing.
+       + commit b4628b4a23d7e8b55ef3f17d79ca86ae77cbc685
+       * tests/gpgscm/tests.scm (flag): Accept arguments of the form
+       '--foo=bar'.
+
+       gpgscm: Improve error handling of foreign functions.
+       + commit f8934d091a274685c1b2a303ac2772adddd303c6
+       * tests/gpgscm/ffi.scm (ffi-fail): Do not needlessly join the error
+       message.
+
+       gpgscm: Improve error reporting.
+       + commit f57405bea31bac1e3c8e4353aea9bb3cede1b90c
+       * tests/gpgscm/init.scm (throw'): Guard against 'args' being atomic.
+       * tests/gpgscm/scheme.c (Eval_Cycle): Remove any superfluous colons in
+       error messages.
+
+2017-05-31  Justus Winter  <justus@g10code.com>
+
+       Align 'es_poll' semantics closer with POSIX.
+       + commit 4a9857a2b6d8a8e847638416d35398508b3291fd
+       * src/estream.c (_gpgrt_poll): Do not return early if some streams are
+       found to be ready before even polling the others.
+
+       build: Prepend the maintainer CFLAGS.
+       + commit df1d61d5c84d984fb2d2a6f1b69c57878decf13e
+       * configure.ac: Prepend the maintainer CFLAGS making it possible to
+       override e.g. the optimization level for debugging.
+
+2017-05-30  NIIBE Yutaka  <gniibe@fsij.org>
+
+       Fix memory leak for estream.
+       + commit 1e7203515be0b030709109e9da621642dfa20312
+       * src/estream.c (do_list_remove): Free the item.
+       (do_close): Free the buffer.
+
+2017-05-17  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Fix checking for opcode arguments.
+       + commit d2747ce24d445ae7ef3ec4ed0cca2f30aa833e7c
+       * tests/gpgscm/scheme.c (Eval_Cycle): Update 'pcd' after dispatching
+       an instruction.
+
+2017-05-11  Justus Winter  <justus@g10code.com>
+
+       tests: Make it possible to run all tests using our infrastructure.
+       + commit 4bc110e219b13d551c0c6c9987b7602e44715032
+       * Makefile.am (TESTS_ENVIRONMENT): New variable.
+       (check-all): New phony target to run all tests.
+       * tests/gpgme/gpgme-defs.scm (have-gpgme?): New function that tests
+       whether the GPGME test suite is available instead of exiting the
+       process.
+       * tests/gpgscm/init.scm (export): New macro.
+       * tests/gpgscm/tests.scm (run-tests): New function.
+       (load-tests): Likewise.
+       * tests/gpgme/run-tests.scm: Simplify and move the parsing of the list
+       of tests to 'all-tests.scm'.
+       * tests/gpgsm/run-tests.scm: Likewise.
+       * tests/migrations/run-tests.scm: Likewise.
+       * tests/openpgp/run-tests.scm: Likewise.
+       * tests/gpgme/Makefile.am: To select the tests to run, use the
+       variable 'TESTS'.  This harmonizes the interface with the automake
+       test suite.
+       * tests/gpgsm/Makefile.am: Likewise.
+       * tests/migrations/Makefile.am: Likewise.
+       * tests/openpgp/Makefile.am: Likewise.
+       * tests/openpgp/README: Likewise.
+       * agent/all-tests.scm: New file.
+       * common/all-tests.scm: Likewise.
+       * g10/all-tests.scm: Likewise.
+       * g13/all-tests.scm: Likewise.
+       * tests/gpgme/all-tests.scm: Likewise.
+       * tests/gpgsm/all-tests.scm: Likewise.
+       * tests/migrations/all-tests.scm: Likewise.
+       * tests/openpgp/all-tests.scm: Likewise.
+       * tests/run-tests.scm: Likewise.
+
+       tests: Move the makefile parser.
+       + commit 197404aae66c688d004337c0aefe153ef6b10f87
+       * tests/gpgme/gpgme-defs.scm (parse-makefile, parse-makefile-expand):
+       Move...
+       * tests/gpgscm/makefile.scm: ... here.
+       * tests/gpgscm/Makefile.am (EXTRA_DIST): Add new file.
+
+       gpgscm: Make it possible to set the logfile name.
+       + commit dd48994b0c99a4099f49ccd437a08ddff39af8a2
+       * tests/gpgscm/tests.scm (test): Only set the default log filename
+       when it has not been set before.
+
+2017-05-04  Justus Winter  <justus@g10code.com>
+
+       tests: Support tests that are expected to fail.
+       + commit 212a0febf8bbaf735ae2e65722f39a47a1c5b122
+       * tests/gpgscm/tests.scm (test-pool): Rework reporting.  Filter using
+       the computed test status instead of the return value.  Also print the
+       new categories 'failed expectedly' and 'passed unexpectedly'.
+       (test): If a test ends with a bang (!), it is expected to fail.  Adapt
+       status, status-string, and xml accordingly.
+
+2017-05-03  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Create and re-use frame objects.
+       + commit 272b0ad65ec4c6023d4b5a4fb2f003ada432b6e5
+       * tests/gpgscm/scheme-private.h (struct scheme): New field
+       'frame_freelist'.
+       * tests/gpgscm/scheme.c (enum scheme_types): New type 'T_FRAME'.
+       (type_to_string): Handle new type.
+       (settype): New macro.
+       (gc_disable): Make sure there is at least one frame in the free list.
+       (mark): Handle frame objects.
+       (finalize_cell): Likewise.
+       (dump_stack_initialize): Initialize free list.
+       (dump_stack_free): Simplify.
+       (frame_length): New variable.
+       (dump_stack_make_frame): New function.
+       (frame_slots): Likewise.
+       (frame_payload): New macro.
+       (dump_stack_allocate_frame): New function.
+       (dump_stack_deallocate_frame): Likewise.
+       (dump_stack_preallocate_frame): Likewise.
+       (_s_return): Unpack frame object and deallocate it.
+       (s_save): Wrap state in an frame object.
+       (dump_stack_mark): Mark the free list.
+
+       gpgscm: Merge opexe_0.
+       + commit df499c6ee5edf0a560138640141a3abef360b4f5
+       * tests/gpgscm/scheme-private.h (struct scheme): Remove field 'op'.
+       * tests/gpgscm/scheme.c (opexe_0): Inline into 'Eval_Cycle'.
+       (_Error_1): Return the opcode to evaluate next.
+       (Error_1): Do not return, but set the opcode and goto dispatch.
+       (Error_0): Likewise.
+       (s_goto): Likewise.
+       (s_return): Likewise.
+       (s_return_enable_gc): Likewise.
+       (s_thread_to): Remove superfluous cast.
+       (_s_return): Return the opcode to evaluate next.
+       (scheme_init_custom_alloc): Adapt to removal of field 'op'.
+
+2017-04-24  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Refactor cell finalization.
+       + commit 36e266a5cbb78560d32bc33f18f9041db1ff5080
+       * tests/gpgscm/scheme.c (finalize_cell): Use switch, return whether
+       the cell may be freed.
+       (gc): Update callsite.
+
+       gpgscm: Tweak error message display.
+       + commit e8c896c7f9aabad6e1387f538accb54ac6b2b1cc
+       * tests/gpgscm/init.scm (throw'): If the first argument to the error
+       is a string, display it as such.
+
+       gpgscm: Fix test.
+       + commit b67d1a3f36f2b15fb75de613942668b71cad1bd7
+       * tests/gpgscm/t-child.scm: Use 'string-length' on the string.
+
+       gpgscm: Improve syntax checking.
+       + commit 008894eff46724d60a24879d319b427606fcafd1
+       * tests/gpgscm/scheme.c (opexe_0): Make sure closure arguments are
+       symbols.
+
+       gpgscm: Emit JUnit-style XML reports.
+       + commit 5dc43e579ef4340c668fa7e294f5a69fef9d622e
+       * tests/gpgscm/Makefile.am (EXTRA_DIST): Add new file.
+       * tests/gpgscm/lib.scm (string-translate): New function.
+       * tests/gpgscm/main.c (main): Load new file.
+       * tests/gpgscm/tests.scm (dirname): New function.
+       (test-pool): Record execution times, emit XML report.
+       (test): Record execution times, record log file name, emit XML report.
+       (run-tests-parallel): Write XML report.
+       (run-tests-sequential): Likewise.
+       * tests/gpgscm/xml.scm: New file.
+       * tests/gpgme/Makefile.am (CLEANFILES): Add 'report.xml'.
+       * tests/gpgsm/Makefile.am: Likewise.
+       * tests/migrations/Makefile.am: Likewise.
+       * tests/openpgp/Makefile.am: Likewise.
+
+       gpgscm: Make logging less verbose and more useful.
+       + commit a3e51fab6b30774959dc7d4d3409000fdbe1f7b3
+       * tests/gpgscm/tests.scm (call-with-io): When being verbose, include
+       the pid in the output, and avoid duplicating the command arguments.
+
+       gpgscm: Make test framework less functional.
+       + commit aa843dbcd32c65eeac8c7c3cea4efb3ed7a94a0c
+       * tests/gpgscm/tests.scm (test-pool, tests): Previously, these methods
+       updated objects by creating new updated copies of the object being
+       manipulated.  This made the code awkward without any benefit,
+       therefore I change it to just update the object.
+
+       gpgscm: Move 'trace' and 'stringify'.
+       + commit 763bd518b27d4e125fa3dce64417ae2aca2101d4
+       * tests/gpgscm/tests.scm (trace, stringify): Move...
+       * tests/gpgscm/lib.scm: ... here.
+
+       gpgscm: Avoid fruitless garbage collection cycles.
+       + commit 8bda9387d5be9193fd0f484fd1272367a7422389
+       * tests/gpgscm/scheme-private.h (CELL_MINRECOVER): New macro.
+       * tests/gpgscm/scheme.c (_get_cell): Move the heuristic to get more
+       cells...
+       (gc): ... here where every caller benefits from the optimization.
+
+2017-04-19  NIIBE Yutaka  <gniibe@fsij.org>
+
+       Minor clean up.
+       + commit a8d267a7220399f7acf69723fe1d31efd2160319
+       * src/b64dec.c (_gpgrt_b64dec_proc): Add a comment.
+       * src/estream.c (_gpgrt_fread, _gpgrt_fwrite): Use &&.
+       * src/mkheader.c (xstrdup): Use memcpy as we know length.
+
+2017-04-12  NIIBE Yutaka  <gniibe@fsij.org>
+
+       gpgscm: Fix test program.
+       + commit e71c0d39d2fb896df85949a61811e3b19fd050d7
+       * tests/gpgscm/t-child.c (main): Fix for setmode.
+
+2017-04-11  Justus Winter  <justus@g10code.com>
+
+       tests: Fix distcheck.
+       + commit b03bcee96fc4eb950c6ae38fd8b5af831b281f02
+       * tests/gpgscm/Makefile.am (EXTRA_DIST): Add 'gnupg.scm'.
+
+       tests: Move common functionality.
+       + commit d9dd8135ec6e1a4b7a66bc385714b8c1beba3e96
+       * tests/openpgp/defs.scm (with-home-directory,
+       with-ephemeral-home-directory): Move...
+       * tests/gpgscm/gnupg.scm: ... to this new file.
+       * tests/gpgscm/main.c (main): Load the new file.
+
+2017-04-10  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Fix opcode dispatch.
+       + commit afb7060de5c55976d08e0692fbffd0cc108914a0
+       * tests/gpgscm/scheme.c (opexe_0): Consider 'op', not 'sc->op'.  The
+       former is the opcode we are currently executing.
+
+       gpgscm: Mmap script files.
+       + commit ef41f332cba624e9bca6100ebacd4fffe4e61679
+       * tests/gpgscm/main.c (load): Try to mmap the script.
+       * tests/gpgscm/scheme.c (scheme_load_memory): New function, a
+       generalization of 'scheme_load_string'.
+       * tests/gpgscm/scheme.h (scheme_load_memory): New prototype.
+
+       gpgscm: Refactor checking for opcode arguments.
+       + commit 6c9de8ff59a9c637de944706533421dc4cf20708
+       * tests/gpgscm/scheme.c (op_code_info): Fix type, add forward
+       declaration.
+       (check_arguments): New function.
+       (Eval_cycle): Use the new function.
+
+       gpgscm: Improve syntax dispatch.
+       + commit 173531921d133a007d30c32cec00546749d8cfbf
+       * tests/gpgscm/scheme.c (assign_syntax): Add opcode parameter, store
+       opcode in the tag.
+       (syntaxnum): Add sc parameter, retrieve opcode from tag.
+       (opexe_0): Adapt callsite.
+       (scheme_init_custom_alloc): Likewise.
+
+       gpgscm: Make tags mandatory.
+       + commit d6c83fbb06abc99de696b3f9a0b1cb962fa05b26
+       * tests/gpgscm/opdefines.h: Make tags mandatory.
+       * tests/gpgscm/scheme.c: Likewise.
+       * tests/gpgscm/scheme.h: Likewise.
+
+       gpgscm: Add and use opcode for reversing a list in place.
+       + commit be78c20cdd93ed295bfee1aef1e9d2e9253b779c
+       * tests/gpgscm/lib.scm (string-split-pln): Use 'reverse!'.
+       (string-rtrim): Likewise.
+       * tests/gpgscm/opdefines.h (reverse!): New opcode.
+       * tests/gpgscm/scheme.c (opexe_0): Handle new opcode.
+
+       gpgscm: Deduplicate code.
+       + commit 8a2d1706e5d4b3d33ff349838f0c51631e32a2ce
+       * tests/gpgscm/scheme.c (oblist_add_by_name): Deduplicate.
+       (new_slot_spec_in_env): Likewise.
+
+       gpgscm: Move dispatch table into rodata.
+       + commit 5aeeb5af96dce901a8b21613e33baed8b9331692
+       * tests/gpgscm/opdefines.h: Use 0 instead of NULL.
+       * tests/gpgscm/scheme.c (op_code_info): Use char arrays instead of
+       pointers, make arity parameters smaller.
+       (INF_ARG): Adapt.
+       (_OP_DEF): Likewise.
+       (dispatch_table): Likewise.
+       (procname): Likewise.
+       (Eval_cycle): Likewise.
+       (scheme_init_custom_alloc): Likewise.
+
+       gpgscm: Use more threaded code.
+       + commit 49c22bd71892f47835d9e03f3bd3122a1f0b8faa
+       * tests/gpgscm/scheme.c (opexe_0): Use 's_thread_to' instead of
+       's_goto' wherever possible.
+
+       gpgscm: Remove now obsolete dispatcher function from the opcodes.
+       + commit 6d99d2f287aa40d8add81ce892026dfe05768fd4
+       * tests/gpgscm/opdefines.h: Remove now obsolete dispatcher function
+       from the opcodes.
+       * tests/gpgscm/scheme-private.h (_OP_DEF): Adapt.
+       * tests/gpgscm/scheme.c (dispatch_func): Remove type declaration.
+       (op_code_info): Remove 'func'.
+       (_OP_DEF): Adapt.
+       (Eval_Cycle): Always call 'opexe_0'.
+
+       gpgscm: Merge 'opexe_6'.
+       + commit c183d8f4c6cdf6b48265f01e4c007895f2626fc5
+       * tests/gpgscm/scheme.c (opexe_6): Merge into 'opexe_0'.
+       * tests/gpgscm/opdefines.h: Adapt.
+
+       gpgscm: Merge 'opexe_5'.
+       + commit 72674f169386d68a6d0fc2ba4bc5a065435802a0
+       * tests/gpgscm/scheme.c (opexe_5): Merge into 'opexe_0'.
+       * tests/gpgscm/opdefines.h: Adapt.
+
+       gpgscm: Merge 'opexe_4'.
+       + commit 5898ead4a99d3bc9e23859daf2cca9632d92f1f7
+       * tests/gpgscm/scheme.c (opexe_4): Merge into 'opexe_0'.
+       * tests/gpgscm/opdefines.h: Adapt.
+
+       gpgscm: Merge 'opexe_3'.
+       + commit b13610ec7bf2bf199eb22f936bc2f2d4ac240fde
+       * tests/gpgscm/scheme.c (opexe_3): Merge into 'opexe_0'.
+       * tests/gpgscm/opdefines.h: Adapt.
+
+       gpgscm: Merge 'opexe_2'.
+       + commit 7bc96831c7156fa07cfd55259f309ca4fa676c2e
+       * tests/gpgscm/scheme.c (opexe_2): Merge into 'opexe_0'.
+       * tests/gpgscm/opdefines.h: Adapt.
+
+       gpgscm: Merge 'opexe_1'.
+       + commit 19a1be5ac3c9f3e26c453cf2ddc6d88af19e2d43
+       * tests/gpgscm/scheme.c (opexe_1): Merge into 'opexe_0'.
+       * tests/gpgscm/opdefines.h: Adapt.
+
+2017-04-07  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Allocate small integers in the rodata section.
+       + commit 7cee693e31fa1196161d5fbe7149a176049735ac
+       * tests/gpgscm/Makefile.am (gpgscm_SOURCES): Add new file.
+       * tests/gpgscm/scheme-private.h (struct cell): Move number to the top
+       of the union so that we can initialize it.
+       (struct scheme): Remove 'integer_segment'.
+       * tests/gpgscm/scheme.c (initialize_small_integers): Remove function.
+       (small_integers): New variable.
+       (MAX_SMALL_INTEGER): Compute.
+       (mk_small_integer): Adapt.
+       (mark): Avoid marking objects already marked.  This allows us to run
+       the algorithm over objects in the rodata section if they are already
+       marked.
+       (scheme_init_custom_alloc): Remove initialization.
+       (scheme_deinit): Remove deallocation.
+       * tests/gpgscm/small-integers.h: New file.
+
+       gpgscm: Make global data constant when possible.
+       + commit 9fc4e6cbe6d5d3f2dd1c61ded15e2ad42f8f9460
+       * tests/gpgscm/scheme-private.h (struct scheme): Make 'vptr' const.
+       * tests/gpgscm/scheme.c (num_zero): Statically initialize and turn
+       into constant.
+       (num_one): Likewise.
+       (charnames): Change type so that it can be stored in rodata.
+       (is_ascii_name): Adapt slightly.
+       (assign_proc): Make argument const char *.
+       (op_code_info): Make some fields const char *.
+       (tests): Make const.
+       (dispatch_table): Make const.  At least it can be made read-only after
+       relocation.
+       (Eval_Cycle): Adapt slightly.
+       (vtbl): Make const.
+
+       gpgscm: Remove arbitrary limit on number of cell segments.
+       + commit 961f3b3a3001384d5df1d5a9963c5f67f800cd4d
+       * tests/gpgscm/scheme-private.h (struct scheme): Remove fixed-size
+       arrays for cell segments, replace them with a pointer to the new
+       'struct cell_segment' instead.
+       * tests/gpgscm/scheme.c (struct cell_segment): New definition.
+       (_alloc_cellseg): Allocate the header within the segment, return a
+       pointer to the header.
+       (_dealloc_cellseg): New function.
+       (alloc_cellseg): Insert the segments into a list.
+       (_get_cell): Allocate a new segment if less than a quarter of
+       CELL_SIGSIZE is recovered during garbage collection.
+       (initialize_small_integers): Adapt callsite.
+       (gc): Walk the list of segments.
+       (scheme_init_custom_alloc): Remove initialization of removed field.
+       (scheme_deinit): Adapt deallocation.
+
+       gpgscm: Fix compact vector encoding.
+       + commit a493ad44b6a67026aeae08d25575fee8c0f137b4
+       * tests/gpgscm/scheme-private.h (struct cell): Use uintptr_t for
+       '_flags'.  This way, '_flags' has the size of a machine word.
+
+2017-04-06  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Avoid mutating integer.
+       + commit 00de0fd1cebd89330765470bbb6e1e8bf5f3dfc9
+       * tests/gpgscm/scheme.c (opexe_5): Do not modify the integer in-place
+       while printing an vector.  Integer objects may be shared, so they must
+       not be mutated.
+
+       gpgscm: Initialize unused slots in vectors.
+       + commit 54ea82c2e7e5700b9644c663142c2d46441a3f4e
+       * tests/gpgscm/scheme.c (get_vector_object): Initialize unused slots
+       at the end of vectors.
+
+2017-04-04  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Fix copying values.
+       + commit 52d0423e48dfe4dd51dc0acbf119431701280a70
+       * tests/gpgscm/scheme.c (copy_value): New function.
+       (mk_tagged_value): Use new function.
+       (opexe_4): Likewise for OP_SAVE_FORCED.
+
+       gpgscm: Simplify get-output-string operation.
+       + commit c9244b2eb43e0f06928b709ac35127966e1d24ce
+       * tests/gpgscm/scheme.c (opexe_4): Simplify 'get-output-string'.
+
+       gpgscm: Simplify substring operation.
+       + commit 6900f118303962262923f9d103b802508d5f469f
+       * tests/gpgscm/scheme.c (opexe_2): Simplify 'substring'.
+
+2017-04-03  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Slightly improve the procedure dispatch.
+       + commit 9a4283ed6aafc1e43d8f7a5fd9cef6118615f284
+       * tests/gpgscm/scheme.c (procnum): Procedures always have an integer
+       number, so we can safely use the cheaper 'ivalue_unchecked'.
+
+2017-03-23  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Make test cleanup more robust.
+       + commit e1780b2f981d3fd48bbf2672b35f2f33152f6c32
+       * tests/gpgscm/tests.scm (mkdtemp-autoremove): New function that
+       cleans up at interpreter shutdown.
+       (run-tests-parallel): Use the new function.
+       (run-tests-sequential): Likewise.
+       (make-environment-cache): Execute setup with an temporary working
+       directory.
+
+2017-03-21  Justus Winter  <justus@g10code.com>
+
+       tests,w32: Use GetTempPath to get the path for temporary files.
+       + commit 8835ee681f5ae92ded982b51f5808935d227b126
+       * tests/gpgscm/ffi.c (do_get_temp_path): New function.
+       (ffi_init): Make function available.
+       * tests/gpgscm/tests.scm (mkdtemp): Use the new function.
+
+       tests: Create temporary directories in '/tmp'.
+       + commit cfc49428a427d1a140424c687cb45ba00117d443
+       * tests/gpgscm/tests.scm (mkdtemp): Create temporary directories in
+       '/tmp' on UNIX, or in '%Temp' on Windows.
+       * tests/migrations/common.scm (run-test): Turn error into a warning.
+       * tests/openpgp/defs.scm (start-agent): Likewise.
+
+2017-03-17  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Simplify hash tables.
+       + commit 053a3f9a61a2918131b9dec60149b93861c04a51
+       * tests/gpgscm/scheme.c (oblist_add_by_name): We now always get a
+       slot.  Simplify accordingly.
+       (oblist_find_by_name): Always return the slot.
+       (vector_elem_slot): New function.
+       (new_slot_spec_in_env): We now always get a slot.  Remove parameter
+       'env'.  Simplify accordingly.
+       (find_slot_spec_in_env): Always return a slot.
+       (new_slot_in_env): Adapt callsite.
+       (opexe_0): Likewise.
+       (opexe_1): Likewise.
+       (scheme_define): Likewise.
+
+       gpgscm: Remove framework for immediate values.
+       + commit a1ed4b6ab25f28114d8ba6f704824a456d4fdc0c
+       * tests/gpgscm/scheme.c (IMMEDIATE_TAG): Remove macro.
+       (is_immediate): Likewise.
+       (set_immediate): Likewise.
+       (clr_immediate): Likewise.
+       (enum scheme_types): Set the LSB in every value.
+       (fill_vector): Adapt.
+       (vector_elem): Likewise.
+       (set_vector_elem): Likewise.
+       (mark): Likewise.
+       (gc): Test for the LSB to tell typeflags apart from pointers stored in
+       the same memory location.
+
+2017-03-09  Justus Winter  <justus@g10code.com>
+
+       tests: Rework environment setup.
+       + commit 14fcdcabb25d975f0f91be86b0571694fb533e7a
+       * tests/gpgscm/tests.scm (test::scm): Add a setup argument.
+       (test::binary): Likewise.
+       (run-tests-parallel): Remove setup parameter.
+       (run-tests-sequential): Likewise.
+       (make-environment-cache): New function that handles the cache
+       protocol.
+       * tests/gpgme/run-tests.scm: Adapt accordingly.
+       * tests/gpgsm/run-tests.scm: Likewise.
+       * tests/migrations/run-tests.scm: Likewise.
+       * tests/openpgp/run-tests.scm: Likewise.
+
+2017-03-08  Justus Winter  <justus@g10code.com>
+
+       build: Use macOS' compatibility macros to enable all features.
+       + commit 5e51b642f747547c737a7abbc37e65b0f630d188
+       * configure.ac: On macOS, use the compatibility macros to expose every
+       feature of the libc.  This is the equivalent of _GNU_SOURCE on GNU
+       libc.
+
+2017-03-07  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
+
+       gpgscm: Use system strlwr if available.
+       + commit ca3d31ec77612cecc16c376ac7c06ce09541b28e
+       * tests/gpgscm/scheme.c: Define local strlwr only when HAVE_STRLWR is
+       not defined in config.h.
+       * tests/gpgscm/scheme-config.h: Remove hack.
+
+2017-03-07  NIIBE Yutaka  <gniibe@fsij.org>
+
+       More change for common.
+       + commit d372378d28b2504225aae6819d056330e7ac0674
+       * g10, scd, test, tools: Follow the change of removal of -Icommon.
+
+       w32: Conditionalize ISO 2022 definitions.
+       + commit 1126c4c117a47c8ea8435ac11561d51b13f538dd
+       * src/w32-iconv.c (iso2022_SI_seq, iso2022_SO_seq) [USE_MLANG_DLL]:
+       Only for USE_MLANG_DLL.
+
+2017-03-06  Justus Winter  <justus@g10code.com>
+
+       tests: Harmonize temporary and socket directory handling.
+       + commit 490c5d5afeaae66dc061295afbc254e57abd20c8
+       * tests/gpgscm/tests.scm (mkdtemp): Do not magically obey the
+       environment variable 'TMP', make sure to always return an absolute
+       path.
+       * tests/gpgme/Makefile.am (TMP): Drop variable.
+       (TESTS_ENVIRONMENT): Drop 'TMP'.
+       * tests/gpgme/gpgme-defs.scm (create-gpgmehome): Start the agent.  Do
+       not create private key store, the agent does that for us.
+       * tests/gpgsm/Makefile.am (TMP): Drop variable.
+       (TESTS_ENVIRONMENT): Drop 'TMP'.
+       * tests/gpgme/gpgme-defs.scm (create-gpgsmhome): Start the agent.  Do
+       not create private key store, the agent does that for us.
+       * tests/migrations/Makefile.am (TMP): Drop variable.
+       (TESTS_ENVIRONMENT): Drop 'TMP'.
+       * tests/migrations/common.scm (gpgconf): New variable.
+       (run-test): Create and remove socket directory.
+       * tests/migrations/extended-pkf.scm (src-tarball): Remove variable.
+       (setup): Remove function.
+       (trigger-migration): Likewise.
+       Use 'run-test' to execute the test.
+       * tests/migrations/from-classic.scm (src-tarball): Remove variable.
+       (setup): Remove function.
+       Use 'run-test' to execute the tests.
+       * tests/openpgp/Makefile.am (TMP): Drop variable.
+       (TESTS_ENVIRONMENT): Drop 'TMP'.
+       * tests/openpgp/README: Do not mention 'TMP'.
+       * tests/openpgp/defs.scm (with-home-directory): New macro.
+       (create-legacy-gpghome): Do not create private key store, the agent
+       does that for us.
+       (start-agent): Make sure to terminate the right agent with 'atexit'.
+
+       gpgscm: Fix creation of temporary directories.
+       + commit 9e29af900544fe4210a72cae87be78186d03e231
+       * tests/gpgscm/ffi.c (do_mkdtemp): Use a larger buffer for the
+       template.
+
+2017-02-28  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Improve parsing.
+       + commit 9467f3c7758864f3c025c14166c9d099bea6fe62
+       * tests/gpgscm/scheme.c (port_increment_current_line): Avoid creating
+       the same integer if the delta is zero.  This happens a lot during
+       parsing, and puts pressure on the memory allocator.
+
+       gpgscm: Fix calculating the line number.
+       + commit 08e1cfddc94a6aae79b21d7795accf3e100a1f2f
+       * tests/gpgscm/scheme.c (opexe_5): Only increment the line number on
+       newlines.
+
 2017-02-28  Werner Koch  <wk@gnupg.org>
 
        Release 1.27.
        (print_internal_trace_prefix): New.
        * src/estream.c, src/w32-estream.c: Improve tracing.
 
+2017-02-28  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Track source locations in every kind of ports.
+       + commit 9b23e71a6b41cd11b39ab1e1d18c140eaf63c3e7
+       * tests/gpgscm/scheme-private.h (struct port): Move location
+       information out of the union.
+       * tests/gpgscm/scheme.c (mark): All ports need marking now.
+       (gc): Likewise all ports on the load stack.
+       (port_clear_location): Adapt accordingly.  Also, add an empty function
+       for !SHOW_ERROR_LINE.
+       (port_increment_current_line): Likewise.
+       (port_reset_current_line): Drop function in favor of...
+       (port_init_location): ... this new function.
+       (file_push): Simplify.
+       (file_pop): Likewise.
+       (port_rep_from_filename): Likewise.
+       (port_rep_from_file): Likewise.
+       (port_rep_from_string): Also initialize the location.
+       (port_rep_from_scratch): Likewise.
+       (port_close): Simplify and generalize.
+       (skipspace): Likewise.
+       (token): Likewise.
+       (_Error_1): Generalize.
+       (opexe_5): Likewise.
+       (scheme_deinit): Simplify and generalize.
+       (scheme_load_named_file): Likewise.
+       (scheme_load_string): Also initialize the location.
+
+2017-02-28  Werner Koch  <wk@gnupg.org>
+
        w32: Fix gpgrt_poll for Windows.
        + commit 07d5bd918d2185f79c7d61d56ee7f3090b6f5dcd
        * src/estream.c (_gpgrt_poll) [W32]: Do not call the syscall clamp.
        + commit 3a2ee6df5911728938a2fb56237b08f790841a0c
 
 
+2017-02-17  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Guard use of tagged expressions.
+       + commit 86082852350810afa548c607241df95f9cac777a
+       * tests/gpgscm/init.scm (vm-history-print): Check that the tag added
+       to expressions when parsing source files matches the expected format.
+       * tests/gpgscm/lib.scm (assert): Likewise.
+
+2017-02-15  Justus Winter  <justus@g10code.com>
+
+       tests,build: Fix distcheck.
+       + commit 52748cd96c70c9da01c35de10dd1627f7897d085
+       * tests/gpgscm/Makefile.am (EXTRA_DIST): Add 'time.scm'.
+
+       tests: Check expiration times of created keys.
+       + commit b2db15dfe894a27246236ed416c8e2c2fc0e73c4
+       * tests/gpgscm/ffi.c (do_get_time): New function.
+       (ffi_init): Expose new function.
+       * tests/gpgscm/ffi.scm (get-time): Document new function.
+       * tests/gpgscm/time.scm: New file.
+       * tests/openpgp/quick-key-manipulation.scm: Use the new facilities to
+       check the expiration times of created keys.
+       * tests/openpgp/tofu.scm: Use the new module.
+
 2017-02-02  NIIBE Yutaka  <gniibe@fsij.org>
 
        syscfg: Add a sh3 architecture.
        * tests/Makefile.am (TESTS): Add t-b64dec.
        * tests/t-b64dec.c: New.
 
+2017-01-31  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Tune the hash tables.
+       + commit 1c99db04ed62d395c1c88171ef147a580e0bb4ab
+       * tests/gpgscm/scheme.c (oblist_initial_value): Increase the size of
+       the hash table based on the number of symbols used after initializing
+       the interpreter.
+       (new_frame_in_env): Increase the size of the hash table based on the
+       number of variables in the global environement.
+
+       gpgscm: Optimize environment lookups and insertions.
+       + commit fa2363d9d903dfc9885f7d2f290fb4d7738bb737
+       * tests/gpgscm/scheme.c (pointercmp): New function.
+       (new_slot_spec_in_env): Add and use slot for insertions.
+       (find_slot_spec_in_env): New variant of 'find_slot_in_env' that
+       returns the slot on failures.
+       (find_slot_in_env): Express using the new function.
+       (new_slot_in_env): Update callsite.
+       (opexe_0): Optimize lookup-or-insert.
+       (opexe_1): Likewise.
+       (scheme_define): Likewise.
+
+       gpgscm: Fix build with list environments.
+       + commit e982432ba66652bc9bc16e334e1d4d184e1b68bd
+       * tests/gpgscm/scheme.c (new_slot_spec_in_env): Provide preallocation
+       inforomation if USE_ALIST_ENV.
+
+       gpgscm: Optimize symbol lookups and insertions.
+       + commit d374a1271326e503bd7cabe11cf5fd10a970d9fc
+       * tests/gpgscm/scheme.c (oblist_find_by_name): Keep the list of
+       symbols sorted, return the slot where a new symbol must be inserted on
+       lookup failures.
+       (oblist_add_by_name): Add the new symbol at the given slot.
+       (mk_symbol): Adjust callsite.
+       (gensym): Likewise.
+       (assign_syntax): Likewise.
+
+       gpgscm: Fix build with object list.
+       + commit 85f6f60197fe56c90b663fb34db4cddf62c28c1b
+       * tests/gpgscm/scheme.c (oblist_add_by_name): Provide preallocation
+       information if USE_OBJECT_LIST.
+
+       gpgscm: Remove unused functions.
+       + commit 92e929d4b91cbb5e36d6cb89aabf2211a7185a65
+       * tests/gpgscm/scheme.c (check_cell_alloced): Remove function.
+       (check_range_alloced): Likewise.
+
+2017-01-30  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Use a compact vector representation.
+       + commit 5809edef40acf1f8f0e71b69dcb10e1d5464f2a5
+       * tests/gpgscm/scheme-private.h (struct cell): Add a compact vector
+       representation.
+       * tests/gpgscm/scheme.c (vector_length): Use new representation.
+       (vector_size): New macro.
+       (get_vector_object): Use the new representation.
+       (fill_vector): Likewise.
+       (vector_elem): Likewise.
+       (set_vector_elem): Likewise.
+       (mark): Likewise.
+       (gc): Likewise.  Be careful not to confuse immediate values for type
+       flags.
+       (finalize_cell): Vectors now require finalization.
+
+       gpgscm: Provide framework for immediate values.
+       + commit e1dc204ac465498436f463d419b9583011026807
+       * tests/gpgscm/scheme.c (IMMEDIATE_TAG): New macro.
+       ({is,set,clr}_immediate): Likewise.
+       (enum scheme_types): Make type tags disjoint from immediate values.
+       (TYPE_BITS): We need one more bit now.
+       (ADJ,T_MASKTYPE): Compute values.
+
+       gpgscm: Fix setting the line of the first gc reservation.
+       + commit c587e6a038fc532df064eec7bea2ad1db31238ad
+       * tests/gpgscm/scheme.c (_gc_disable): Negate guard.
+
+       gpgscm: Introduce macro for the vector length.
+       + commit e2caaa957b56f20cfe09bc6ca5a595b37a860b51
+       * tests/gpgscm/scheme.c (vector_length): New macro.
+       (get_vector_object): Use the new macro.
+       (oblist_add_by_name): Likewise.
+       (oblist_find_by_name): Likewise.
+       (oblist_all_symbols): Likewise.
+       (mk_vector): Likewise.
+       (mark): Likewise.
+       (new_slot_spec_in_env): Likewise.
+       (find_slot_spec_in_env): Likewise.
+       (opexe_2): Likewise.
+       (opexe_5): Likewise.
+
 2017-01-19  Werner Koch  <wk@gnupg.org>
 
        estream: Correctly set ERRNO to EOPNOTSUPP.
        + commit 704c31992e8716bbe61e6d5751e125a64badeef0
        * src/gpg-error.h.in (GPGRT_GCC_VERSION): Fix.
 
+2017-01-02  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Fail if too many arguments are given.
+       + commit 56787d898a6911e62b35c3054a22df1a913c26cf
+       * tests/gpgscm/scheme.c (opexe_0): Enable check.
+       * tests/gpgscm/tests.scm (test::report): Remove superfluous argument.
+
+       gpgscm: Add 'finally', rework all macros.
+       + commit 7d95db002aac773e596c551b8fcba2d983244495
+       * tests/gpgscm/init.scm (finally): New macro.
+       * tests/gpgscm/tests.scm (letfd): Rewrite.
+       (with-working-directory): Likewise.
+       (with-temporary-working-directory): Likewise.
+       (lettmp): Likewise.
+
+       gpgscm: Use boxed values for source locations.
+       + commit 4165c9303d894179c0da3a1b12316d3df8d4ce82
+       * tests/gpgscm/scheme-private.h (struct port): Use boxed values for
+       filename and current line.  This allows us to use the same Scheme
+       object for labeling all expressions in a file.
+       * tests/gpgscm/scheme.c (file_push): Use boxed type for filename.
+       (mark): Mark location objects of port objects.
+       (gc): Mark location objects in the load stack.
+       (port_clear_location): New function.
+       (port_reset_current_line): Likewise.
+       (port_increment_current_line): Likewise.
+       (file_pop): Adapt accordingly.
+       (port_rep_from_filename): Likewise.
+       (port_rep_from_file): Likewise.
+       (port_close): Likewise.
+       (skipspace): Likewise.
+       (token): Likewise.
+       (_Error_1): Likewise.
+       (opexe_0): Likewise.
+       (opexe_5): Likewise.
+       (scheme_deinit): Likewise.
+       (scheme_load_file): Likewise.
+       (scheme_load_named_file): Likewise.
+
+2016-12-21  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Guard use of union member.
+       + commit aa6b3449bf1b42703b4c6466d87f91620743a5d2
+       * tests/gpgscm/scheme.c (opexe_5): Check that we have a file port
+       before accessing filename.  Fixes a crash on 32-bit architectures.
+
 2016-12-21  Werner Koch  <wk@gnupg.org>
 
        Release 1.26.
        + commit 82266defa39901ec9f97533623af5638a35e5a77
        * configure.ac: Bump LT version to C21/A21/R0.
 
+2016-12-20  Justus Winter  <justus@g10code.com>
+
+       tests: Move argument parser.
+       + commit 5f16dec938ac6e337c6ff72981285385d75ec455
+       * tests/gpgme/gpgme-defs.scm (flag): Move...
+       * tests/gpgscm/tests.scm: ... over here.
+
+2016-12-19  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Change associativity of ::.
+       + commit 3ae0b5d9af063e7af03558be2bf8f32e5bb4e5cd
+       * tests/gpgscm/scheme.c (mk_atom): Change associativity of the ::
+       infix-operator.  This makes it possible to naturally express accessing
+       nested structures (e.g. a::b::c).
+
+       gpgscm: Display location when assertions fail.
+       + commit b852ac097f3dfe4e62c3d27e18a22f1b9f704530
+       * tests/gpgscm/lib.scm (assert): Use location information if
+       available.
+
+       gpgscm: Make exception handling more robust.
+       + commit 5221e0b2a3bd2dbb4f997e3c2118b176e10e116e
+       * tests/gpgscm/init.scm (throw'): Check that args is a list.
+
+2016-12-13  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Print failed and skipped tests.
+       + commit e8c5871609dd3ff3b2aa3d21ab5c3651ba683ed7
+       * tests/gpgscm/tests.scm (test-pool::report): Print failed and skipped
+       tests at the end.
+
+       gpgscm: Generalize the test runner.
+       + commit b1e67a725d17ff1605ba79d8bb61f37c4a48f0a5
+       * tests/gpgscm/tests.scm (test::scm) Add explicit name argument.
+       (test::binary): Likewise.  Also, add missing unquote.
+       * tests/openpgp/run-tests.scm: Adapt accordingly.
+
+       gpgscm: Move the test runner to the Scheme library.
+       + commit 0031a4d4d8a1851f0c32ad1af2f42f59bd016001
+       * tests/openpgp/run-tests.scm: Move most of the code...
+       * tests/gpgscm/tests.scm: ... here.
+
+       gpgscm: Improve library functions.
+       + commit f745dcab2b1789c8f64c2be4b5dcc7322212e1d2
+       * tests/gpgscm/tests.scm (absolute-path?): New function.
+       (canonical-path): Use the new function.
+       * tests/gpgscm/lib.scm (string-split-pln): New function.
+       (string-indexp, string-splitp): Likewise.
+       (string-splitn): Express using the above function.
+       (string-ltrim, string-rtrim): Fix corner case.
+       (list->string-reversed): New function.
+       (read-line): Fix performance.
+
 2016-12-13  Werner Koch  <wk@gnupg.org>
 
        New error code GPG_ERR_TRY_LATER.
        + commit 56ab574c28586fccd95a08acdc9ee4962ab0db50
 
 
+2016-12-08  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Better error reporting.
+       + commit 735c66bd2d5672de8cc7573fe9d6af4615b86fe2
+       * tests/gpgscm/ffi.scm: Move the customized exception handling and
+       atexit logic...
+       * tests/gpgscm/init.scm: ... here.
+       (throw): Record the current history.
+       (throw'): New function that is history-aware.
+       (rethrow): New function.
+       (*error-hook*): Use the new throw'.
+       * tests/gpgscm/main.c (load): Fix error handling.
+       (main): Save and use the 'sc->retcode' as exit code.
+       * tests/gpgscm/repl.scm (repl): Print call history.
+       * tests/gpgscm/scheme.c (_Error_1): Make a snapshot of the history,
+       use it to provide a accurate location of the expression causing the
+       error at runtime, and hand the history trace to the '*error-hook*'.
+       (opexe_5): Tag all lists at parse time with the current location.
+       * tests/gpgscm/tests.scm: Update calls to 'throw', use 'rethrow'.
+
+       gpgscm: Keep a history of calls for error messages.
+       + commit 81c95b26e769a1ed4933fdf598a3df42d0416928
+       * tests/gpgscm/init.scm (vm-history-print): New function.
+       * tests/gpgscm/opdefines.h: New opcodes 'CALLSTACK_POP', 'APPLY_CODE',
+       and 'VM_HISTORY'.
+       * tests/gpgscm/scheme-private.h (struct history): New definition.
+       (struct scheme): New field 'history'.
+       * tests/gpgscm/scheme.c (gc): Mark objects in the history.
+       (history_free): New function.
+       (history_init): Likewise.
+       (history_mark): Likewise.
+       (add_mod): New macro.
+       (sub_mod): Likewise.
+       (tailstack_clear): New function.
+       (callstack_pop): Likewise.
+       (callstack_push): Likewise.
+       (tailstack_push): Likewise.
+       (tailstack_flatten): Likewise.
+       (callstack_flatten): Likewise.
+       (history_flatten): Likewise.
+       (opexe_0): New variable 'callsite', keep track of the expression if it
+       is a call, implement the new opcodes, record function applications in
+       the history.
+       (opexe_6): Implement new opcode.
+       (scheme_init_custom_alloc): Initialize history.
+       (scheme_deinit): Free history.
+       * tests/gpgscm/scheme.h (USE_HISTORY): New macro.
+
+       gpgscm: Add flag TAIL_CONTEXT.
+       + commit 83175b317dccceb149906cda721aa33178797f3e
+       * tests/gpgscm/scheme.c (S_FLAG_TAIL_CONTEXT): New macro.  This flag
+       indicates that the interpreter is evaluating an expression in a tail
+       context (see R5RS, section 3.5).
+       (opexe_0): Clear and set the flag according to the rules layed out in
+       R5RS, section 3.5.
+       (opexe_1): Likewise.
+
+       gpgscm: Add flags to the interpreter.
+       + commit 14d9ea4bd43e077fab4c756b513557cad76aacd2
+       * tests/gpgscm/scheme-private.h (struct scheme): Add field 'flags'.
+       * tests/gpgscm/scheme.c (S_OP_MASK): New macro.
+       (S_FLAG_MASK, s_set_flag, s_clear_flag, s_get_flag): Likewise.
+       (_s_return): Unpack the encoded opcode and flags.
+       (s_save): Encode the flags along with the opcode.  Use normal
+       integers to encode the result.
+       (scheme_init_custom_alloc): Initialize 'op' and 'flags'.
+
+       gpgscm: Implement tags.
+       + commit 88753eea0d9b1ea40a46f3b3969d418ba75cccf9
+       * tests/gpgscm/opdefines.h: Add opcodes to create and retrieve tags.
+       * tests/gpgscm/scheme.c (T_TAGGED): New macro.
+       (mk_tagged_value): New function.
+       (has_tag): Likewise.
+       (get_tag): Likewise.
+       (mark): Mark tag.
+       (opexe_4): Implement new opcodes.
+       * tests/gpgscm/scheme.h (USE_TAGS): New macro.
+
+       gpgscm: Generalize 'for-each-p'.
+       + commit 94e8811cb2fd0cb56b330a811d13075d54681e38
+       * tests/gpgscm/tests.scm (for-each-p): Generalize to N lists like
+       for-each.
+       (for-each-p'): Likewise.
+
+2016-12-06  Justus Winter  <justus@g10code.com>
+
+       tests: Rename 'error' to 'fail'.
+       + commit 85613efd8d49b39c1310d84484cb1647db83b4d5
+       * tests/gpgscm/tests.scm (error): Rename to 'fail'.  'error' is a
+       primitive function (an opcode) of the TinySCHEME vm, and 'error' is
+       also defined by R6RS.  Better avoid redefining that.  Fix all call
+       sites.
+       * tests/openpgp/4gb-packet.scm: Adapt.
+       * tests/openpgp/decrypt-multifile.scm: Likewise.
+       * tests/openpgp/ecc.scm: Likewise.
+       * tests/openpgp/export.scm: Likewise.
+       * tests/openpgp/gpgtar.scm: Likewise.
+       * tests/openpgp/gpgv-forged-keyring.scm: Likewise.
+       * tests/openpgp/import.scm: Likewise.
+       * tests/openpgp/issue2015.scm: Likewise.
+       * tests/openpgp/issue2346.scm: Likewise.
+       * tests/openpgp/issue2419.scm: Likewise.
+       * tests/openpgp/key-selection.scm: Likewise.
+       * tests/openpgp/mds.scm: Likewise.
+       * tests/openpgp/multisig.scm: Likewise.
+       * tests/openpgp/setup.scm: Likewise.
+       * tests/openpgp/signencrypt.scm: Likewise.
+       * tests/openpgp/ssh-import.scm: Likewise.
+       * tests/openpgp/tofu.scm: Likewise.
+       * tests/openpgp/verify.scm: Likewise.
+
+2016-12-06  Neal H. Walfield  <neal@g10code.com>
+
+       tests: Change (interactive-shell) to start an interactive shell.
+       + commit 0d27b63f35c1e3a36631874fd111d3df2a1d51db
+       * tests/gpgscm/tests.scm (interactive-shell): Start an interactive
+       shell.
+
 2016-12-02  Werner Koch  <wk@gnupg.org>
 
        Fix NULL segv in new option --desc.
        (main): Improve option parser.  Add new option --desc.  Call
        print_desc.
 
+2016-11-29  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Avoid truncating pointers.
+       + commit 941c0efdf826717aae88ea448ec60801f74bb476
+       * tests/gpgscm/scheme.c (_alloc_cellseg): Avoid truncating pointers on
+       systems where sizeof(unsigned long) < sizeof(void *).
+
+2016-11-23  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Make 'reverse' compatible with 'reverse_in_place'.
+       + commit 7f7869357cae0f75c5976ece12a1d94a659b904a
+       * tests/gpgscm/scheme.c (reverse): Update prototype, add terminator
+       argument.
+       (opexe_4): Update callsite.
+
+       gpgscm: Clean sweeped cells.
+       + commit a078d448415c74ee5169d548a901d27380d933f3
+       * tests/gpgscm/scheme.c (gc): Zero typeflag and car of free cells.
+
+       gpgscm: Fix initialization of 'sink'.
+       + commit 95db0d64ac0ccab6cf0e6d6ec25251ccb0fab9d3
+       * tests/gpgscm/scheme.c (scheme_init_custom_alloc): Also initialize
+       cdr.
+
+2016-11-22  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Refactor.
+       + commit b18458f3dfd53627994783d0f2ad835ae70a05af
+       * tests/gpgscm/scheme.c (opexe_0): Reduce code duplication.
+
+       gpgscm: Fix property lists.
+       + commit 08f16887de9d6f6dcb0b7a377407dbd4f541fe13
+       * tests/gpgscm/opdefines.h (put, get): Check arguments.  Also rename
+       to 'set-symbol-property' and 'symbol-property', the names used by
+       Guile, because put and get are too unspecific.
+       * tests/gpgscm/scheme.c (hasprop): Only symbols have property lists.
+       (get_property): New function.
+       (set_property): Likewise.
+       (opexe_4): Use the new functions.
+
+       gpgscm: Fix installation of error handler.
+       + commit 185ba177abeaf2f8ad66529a42966362107a2d8b
+       * tests/gpgscm/ffi.scm: Set '*error-hook*' again so that the
+       interpreter will use our function.
+
+       gpgscm: Use a static pool of cells for small integers.
+       + commit eca7b9bbee2986157ec6c078c998bd8a25becd8f
+       * tests/gpgscm/scheme-private.h (struct scheme): New fields for the
+       static integer cells.
+       * tests/gpgscm/scheme.c (_alloc_cellseg): New function.
+       (alloc_cellseg): Use the new function.
+       (MAX_SMALL_INTEGER): New macro.
+       (initialize_small_integers): New function.
+       (mk_small_integer): Likewise.
+       (mk_integer): Return a small integer if possible.
+       (_s_return): Do not free 'op' if it is a small integer.
+       (s_save): Use a small integer to box the opcode.
+       (scheme_init_custom_alloc): Initialize small integers.
+       (scheme_deinit): Free chunk of small integers.
+       * tests/gpgscm/scheme.h (USE_SMALL_INTEGERS): New macro.
+
+2016-11-17  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Re-enable the garbage collector in case of errors.
+       + commit d2a75dc5ae2b172a232dad88639b15b4930b9151
+       * tests/gpgscm/scheme.c (opexe_0): Enable gc before calling 'Error_1'.
+
+       gpgscm: Fix string.
+       + commit 63cad2c16fdd343be89b576901c8f34de7cb74bf
+       * tests/gpgscm/scheme.c (type_to_string): Fix string.
+
 2016-11-17  NIIBE Yutaka  <gniibe@fsij.org>
 
        Fix EXEEXT for lock obj creation.
        * src/Makefile.am (lock-obj-pub.native.h): Add EXEEXT for
        the executable gen-posix-lock-obj.
 
+2016-11-15  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Mark cells requiring finalization.
+       + commit ad10069af6b0d247f27b7dbf891029eb34d264e0
+       * tests/gpgscm/scheme.c (T_FINALIZE): New macro.
+       (mk_port): Use the new macro.
+       (mk_foreign_object): Likewise.
+       (mk_counted_string): Likewise.
+       (mk_empty_string): Likewise.
+       (gc): Only call 'finalize_cell' for cells with the new flag.
+
+       gpgscm: Recover more cells.
+       + commit dd6bd1bf2a767e22bb7c1bd470ce94527a9fae3d
+       * tests/gpgscm/scheme.c (_s_return): Recover the cell holding the
+       opcode.
+
 2016-11-14  Werner Koch  <wk@gnupg.org>
 
        Release 1.25.
        + commit 80350f97e9e811b9e77b59b8fc4172043f072f42
 
 
+2016-11-14  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Avoid cell allocation overhead.
+       + commit dc1d3a79fa3e7944ea6ef02bc968446f9aa6d648
+       * tests/gpgscm/scheme-private.h (struct scheme): New fields
+       'inhibit_gc', 'reserved_cells', and 'reserved_lineno'.
+       * tests/gpgscm/scheme.c (GC_ENABLED): New macro.
+       (USE_GC_LOCKING): Likewise.
+       (gc_reservations): Likewise.
+       (gc_reservation_failure): New function.
+       (_gc_disable): Likewise.
+       (gc_disable): New macro.
+       (gc_enable): Likewise.
+       (gc_enabled): Likewise.
+       (gc_consume): Likewise.
+       (get_cell_x): Consume reserved cell if garbage collection is disabled.
+       (_get_cell): Assert that gc is enabled.
+       (get_cell): Only record cell in the list of recently allocated cells
+       if gc is enabled.
+       (get_vector_object): Likewise.
+       (gc): Assert that gc is enabled.
+       (s_return): Add comment, adjust call to '_s_return'.
+       (s_return_enable_gc): New macro.
+       (_s_return): Add flag 'enable_gc' and re-enable gc if set.
+       (oblist_add_by_name): Use the new facilities to protect the
+       allocations.
+       (new_frame_in_env): Likewise.
+       (new_slot_spec_in_env): Likewise.
+       (s_save): Likewise.
+       (opexe_0): Likewise.
+       (opexe_1): Likewise.
+       (opexe_2): Likewise.
+       (opexe_5): Likewise.
+       (opexe_6): Likewise.
+       (scheme_init_custom_alloc): Initialize the new fields.
+
 2016-11-12  Justus Winter  <justus@g10code.com>
 
        estream: Support 'es_poll' on Windows.
        + commit bae57a21cfab25ad11c82dc6e69d82d1f2f7a415
 
 
+2016-11-10  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Recover cells from the list of recently allocated cells.
+       + commit 1659878b827d0a4e041921e0c3a3555d39a742df
+       * tests/gpgscm/scheme.c (ok_to_freely_gc): Recover cells.
+
+       gpgscm: Recover cells used to maintain interpreter state.
+       + commit 85388f1ef82bd0a92e94a463acfa157e6f9356f8
+       * tests/gpgscm/scheme.c (free_cell): New function.
+       (free_cons): Likewise.
+       (_s_return): Use the new function to recover cells used to save the
+       state of the interpreter in 's_save'.  This reduces the need to do a
+       garbage collection considerably.
+
+       gpgscm: Reduce opcode dispatch overhead.
+       + commit f65fb16724712b3d6072f27b47e2658f27398dd4
+       * tests/gpgscm/scheme.c (s_thread_to): New macro.
+       (CASE): Likewise.
+       (opexe_[0-6]): Use 'CASE' instead of 'case' statements, replace
+       's_goto' with 's_thread_to' where applicable.
+
+       gpgscm: Make the compile-hook configurable.
+       + commit a678b9fdf7d48409a32afab5b487322a7fc11e16
+       * tests/gpgscm/scheme-private.h (struct scheme): Make field
+       'COMPILE_HOOK' optional.
+       * tests/gpgscm/scheme.c (opexe_0): Fix guard.
+       (scheme_init_custom_alloc): Conditionally initialize 'COMPILE_HOOK'.
+       * tests/gpgscm/scheme.h (USE_COMPILE_HOOK): Define to 1 by default.
+
+       gpgscm: Drop obsolete commented-out code.
+       + commit f69a754515f43037da8ac8535967cd825b220be4
+       * tests/gpgscm/scheme.c (opexe_5): Drop obsolete code.
+
+       gpgscm: Remove dubious stack implementation.
+       + commit a6ce303f0c69542999c607309128afd6293e2e1b
+       * tests/gpgscm/scheme-private.h (struct scheme): Remove related fields.
+       * tests/gpgscm/scheme.c: Drop all !USE_SCHEME_STACK code.
+       * tests/gpgscm/scheme.h (USE_SCHEME_STACK): Remove macro.
+
+2016-11-08  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Expose seek and associated constants.
+       + commit 13831e9cd6839e44a8e32c640589edb8bf17ef51
+       * tests/gpgscm/ffi.c (do_seek): New function.
+       (ffi_init): Expose 'seek' and 'SEEK_{SET,CUR,END}'.
+       * tests/gpgscm/lib.scm: Document the new function.
+
+       gpgscm: Fix error message.
+       + commit d5458258299889af97e714c15e6a9b859e1a0545
+       * tests/gpgscm/ffi.c (do_wait_processes): Fix and improve error
+       messages.
+
+2016-11-07  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Generalize splice to write to multiple sinks.
+       + commit 1edacbc5a4a0f4dee3ab82c1fda7c7b1c5874761
+       * tests/gpgscm/ffi.c (ordinal_suffix): New function.
+       (do_splice): Generalize splice to write to multiple sinks.
+       * tests/gpgscm/lib.scm (splice): Document this fact.
+
+       gpgscm: Drop 'len' argument from splice.
+       + commit 598aeda60bc3e6d49d935927b5ec33145f7af9db
+       * tests/gpgscm/ffi.c (do_splice): Drop 'len' argument, no-one uses it.
+       * tests/gpgscm/lib.scm (splice): Document foreign function.
+
+       tests: Move environment creation and teardown into each test.
+       + commit 1564fc3b2ff52e7e5ad9b01a24e1f399934775b8
+       * tests/gpgscm/tests.scm (log): New function.
+       * tests/openpgp/run-tests.scm (run-tests-parallel): Do not run the
+       startup and teardown scripts.
+       (run-tests-sequential): Likewise.
+       * tests/openpgp/setup.scm: Move all functions...
+       * tests/openpgp/defs.scm: ... here and make them less verbose.
+       (setup-environment): New function.
+       (setup-legacy-environment): Likewise.
+       (start-agent): Make less verbose, run 'stop-agent' at interpreter
+       exit.
+       (stop-agent): Make less verbose.
+       * tests/openpgp/finish.scm: Drop file.
+       * tests/openpgp/Makefile.am (EXTRA_DIST): Drop removed file.
+       * tests/openpgp/4gb-packet.scm: Use 'setup-environment' or
+       'setup-legacy-environment' as appropriate.
+       * tests/openpgp/armdetach.scm: Likewise.
+       * tests/openpgp/armdetachm.scm: Likewise.
+       * tests/openpgp/armencrypt.scm: Likewise.
+       * tests/openpgp/armencryptp.scm: Likewise.
+       * tests/openpgp/armor.scm: Likewise.
+       * tests/openpgp/armsignencrypt.scm: Likewise.
+       * tests/openpgp/armsigs.scm: Likewise.
+       * tests/openpgp/clearsig.scm: Likewise.
+       * tests/openpgp/conventional-mdc.scm: Likewise.
+       * tests/openpgp/conventional.scm: Likewise.
+       * tests/openpgp/decrypt-dsa.scm: Likewise.
+       * tests/openpgp/decrypt.scm: Likewise.
+       * tests/openpgp/default-key.scm: Likewise.
+       * tests/openpgp/detach.scm: Likewise.
+       * tests/openpgp/detachm.scm: Likewise.
+       * tests/openpgp/ecc.scm: Likewise.
+       * tests/openpgp/encrypt-dsa.scm: Likewise.
+       * tests/openpgp/encrypt.scm: Likewise.
+       * tests/openpgp/encryptp.scm: Likewise.
+       * tests/openpgp/export.scm: Likewise.
+       * tests/openpgp/finish.scm: Likewise.
+       * tests/openpgp/genkey1024.scm: Likewise.
+       * tests/openpgp/gpgtar.scm: Likewise.
+       * tests/openpgp/gpgv-forged-keyring.scm: Likewise.
+       * tests/openpgp/import.scm: Likewise.
+       * tests/openpgp/issue2015.scm: Likewise.
+       * tests/openpgp/issue2417.scm: Likewise.
+       * tests/openpgp/issue2419.scm: Likewise.
+       * tests/openpgp/key-selection.scm: Likewise.
+       * tests/openpgp/mds.scm: Likewise.
+       * tests/openpgp/multisig.scm: Likewise.
+       * tests/openpgp/quick-key-manipulation.scm: Likewise.
+       * tests/openpgp/seat.scm: Likewise.
+       * tests/openpgp/shell.scm: Likewise.
+       * tests/openpgp/signencrypt-dsa.scm: Likewise.
+       * tests/openpgp/signencrypt.scm: Likewise.
+       * tests/openpgp/sigs-dsa.scm: Likewise.
+       * tests/openpgp/sigs.scm: Likewise.
+       * tests/openpgp/ssh.scm: Likewise.
+       * tests/openpgp/tofu.scm: Likewise.
+       * tests/openpgp/use-exact-key.scm: Likewise.
+       * tests/openpgp/verify.scm: Likewise.
+       * tests/openpgp/version.scm: Likewise.
+       * tests/openpgp/issue2346.scm: Likewise and simplify.
+
+       gpgscm,w32: Provide schemish file handling for binary files.
+       + commit fa82512020f8cd91c68bbf1d24a4f6bffe5385ba
+       * tests/gpgscm/lib.scm (call-with-binary-input-file): New function.
+       (call-with-binary-output-file): Likewise.
+
+       gpgscm: Add support for pseudo-random numbers.
+       + commit 70c5f30074ec996f60f62cd09e67167da78c6d8a
+       * tests/gpgscm/ffi.c (do_getpid): New function.
+       (do_srandom): Likewise.
+       (random_scaled): Likewise.
+       (do_random): Likewise.
+       (do_make_random_string): Likewise.
+       (ffi_init): Expose the new functions.
+       * tests/gpgscm/lib.scm: Document the new functions.
+
+2016-11-04  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Fix printing strings containing zero bytes.
+       + commit fa221a1d5272eb231393a2cc0173635a5098bb89
+       * tests/gpgscm/scheme.c (atom2str): Fix computing the length of Scheme
+       strings.  Scheme strings can contain zero bytes.
+
+       gpgscm: Implement 'atexit'.
+       + commit 97024a0cd0e1f5262ee60bf40a91f169bcc45a23
+       * tests/gpgscm/ffi.scm (throw): Run *run-atexit-handlers* when
+       terminating the interpreter.
+       (*atexit-handlers*): New variable.
+       (*run-atexit-handlers*): New function.
+       (atexit): Likewise.
+       * tests/gpgscm/main.c (main): Run *run-atexit-handlers* at normal
+       interpreter shutdown.
+
+2016-11-03  Justus Winter  <justus@g10code.com>
+
+       gpgscm,tests: Add new functions to the test environment.
+       + commit e4a694eb48a098c3a3983767099dcce4e9157d16
+       * tests/gpgscm/lib.scm (first, last, powerset): New functions.
+       * tests/gpgscm/tests.scm (interactive-shell): New function.
+       * tests/openpgp/Makefile.am (EXTRA_DIST): Add new file.
+       * tests/openpgp/README: Document 'interactive-shell'.
+       * tests/openpgp/shell.scm: New file.
+
+2016-11-02  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Fix inclusion of readline header.
+       + commit 0ccc6f5ffccec23587d06e32da88fb0acd80f2c6
+       * tests/gpgscm/ffi.c: Define magic macro to prevent the completion
+       function from redefined.
+
 2016-11-02  Werner Koch  <wk@gnupg.org>
 
        Add error codes GPG_ERR_TOO_YOUNG and GPG_ERR_TOO_OLD.
        + commit 49e32eed4550869644d706352d683ddba5696d4e
 
 
+2016-10-20  Justus Winter  <justus@g10code.com>
+
+       common,w32: Fix setting environment variables on Windows.
+       + commit e7ba35f207cb06f6d0e085ab3faf68d118606655
+       * common/sysutils.c (gnupg_setenv): Also update the environment block
+       maintained by the C runtime.
+       (gnupg_unsetenv): Likewise.
+       * tests/gpgscm/ffi.c (do_setenv): Fix error handling.
+
 2016-10-18  Justus Winter  <justus@g10code.com>
 
        estream: Fix modestring parsing.
        + commit 0734f4863859257d18ca96f4b9be62be75fcffe1
        * src/estream.c (parse_mode): Fix parsing the 'sysopen' flag.
 
+2016-10-17  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Initialize nesting stack.
+       + commit 7a262df038f495d27e2d8ec806ea0d47c925c88b
+       * tests/gpgscm/scheme.c (scheme_init_custom_alloc): Initialize nesting
+       stack.
+
+2016-10-07  Justus Winter  <justus@g10code.com>
+
+       tests: Improve handling of Windows newlines.
+       + commit e8db2ea9542eef0bc7b51c9f69109a056269c048
+       * tests/gpgscm/lib.scm (string-split-newlines): New function.
+       * tests/openpgp/default-key.scm: Use new function.
+       * tests/openpgp/defs.scm: Likewise.
+       * tests/openpgp/export.scm: Likewise.
+       * tests/openpgp/import.scm: Likewise.
+
+       gpgscm: Improve test of low-level functions.
+       + commit 2e47dcf432bc26cbaa1a6ba6716ab74facd06353
+       * tests/gpgscm/t-child.c: Print large amounts of data.
+       * tests/gpgscm/t-child.scm: Test that this works.
+
+       gpgscm: Improve path handling.
+       + commit ff00a2d792091f35380c9541ee88fbd9c0d76c43
+       * tests/gpgscm/ffi.c (ffi_init): New Scheme variable '*win32*'.
+       * tests/gpgscm/tests.scm (canonical-path): Correctly handle paths with
+       drive letter on Windows.  Use 'path-join'.
+       (path-expand): Use 'path-join'.
+
 2016-10-07  Werner Koch  <wk@gnupg.org>
 
        Add error code USER_ID_EXISTS, NAME_EXISTS, and DUP_NAME.
        + commit 0c837a82207d0b19f9dabc8870ffb23d6a4ade64
 
 
+2016-10-06  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Update callsite of 'gnupg_spawn_process'.
+       + commit bbd3be18ca9feac21963cc7d682f5a7d89fd9aba
+       * tests/gpgscm/ffi.c (do_spawn_process): Adapt to the changes to
+       'gnupg_spawn_process'.
+
+2016-10-04  Justus Winter  <justus@g10code.com>
+
+       tests,w32: Do not expose 'glob' to gpgscm.
+       + commit 7359d7acb687d572dd0a4e40fd979566efbf4e21
+       * tests/gpgscm/ffi.c (do_glob): Remove function.
+       (ffi_init): Likewise.
+
+2016-09-19  Justus Winter  <justus@g10code.com>
+
+       tests: Refine the repl function.
+       + commit a3b6b7643d906264b56d6fa041bcb95e96eb1898
+       * tests/gpgscm/repl.scm (repl): Add an argument 'environment'.
+       (interactive-repl): Add an optional argument 'environment'.
+
+       tests: Implement interpreter shutdown using exceptions.
+       + commit ea399aaaf4c9de92d24ab59cdc3586608bf35698
+       * tests/gpgscm/ffi.c (ffi_init): Rename 'exit' to '_exit'.
+       * tests/gpgscm/ffi.scm (*interpreter-exit*): New variable.
+       (throw): New function.
+       (exit): New function.
+
+       tests: Correctly handle exceptions in resource handling macros.
+       + commit ec34346129c77a7011872812567689aa09d99caa
+       * tests/gpgscm/tests.scm (letfd): Correctly release resources when an
+       exception is thrown.
+       (with-working-directory): Likewise.
+       (with-temporary-working-directory): Likewise.
+       (lettmp): Likewise.
+
+       tests: Refine exception handling.
+       + commit 3fd08ed018f837399564896462f64af8ae389eec
+       * tests/gpgscm/init.scm (catch): Bind all arguments to '*error*' in
+       the error handler, update and fix comment.
+       (*error-hook*): Revert to original definition.
+       * tests/gpgscm/tests.scm (tr:do): Adapt accordingly.
+       * tests/openpgp/issue2419.scm: Likewise.
+
+       tests: Use descriptive temporary file names.
+       + commit 86f421b7de364138d2d066b267b0f08a62c42a42
+       * tests/gpgscm/ffi.c (do_get_isotime): New function.
+       (ffi_init): Add parameter 'scriptname', bind new function and
+       scriptname.
+       * tests/gpgscm/ffi.h (ffi_init): Update prototype.
+       * tests/gpgscm/main.c (main): Hand in the script name.
+       * tests/gpgscm/tests.scm (mkdtemp): Use current time and script name
+       for the names of temporary directories.
+
+2016-09-19  Werner Koch  <wk@gnupg.org>
+
+       gpgscm: Fix gcrypt version check.
+       + commit a3cdf6ba9987ec2f4b951c3b2519f6beea147126
+       * tests/gpgscm/main.c (main): Check against required and not installed
+       version.
+
+2016-09-17  Daniel Kahn Gillmor  <dkg@fifthhorseman.net>
+
+       Fix more spelling.
+       + commit 42b61e8469179292814fea267ecd7d911396b965
+       * NEWS, acinclude.m4, agent/command-ssh.c, agent/command.c,
+         agent/gpg-agent.c, agent/keyformat.txt, agent/protect-tool.c,
+         common/asshelp.c, common/b64enc.c, common/recsel.c, doc/DETAILS,
+         doc/HACKING, doc/Notes, doc/TRANSLATE, doc/dirmngr.texi,
+         doc/faq.org, doc/gpg-agent.texi, doc/gpg.texi, doc/gpgsm.texi,
+         doc/instguide.texi, g10/armor.c, g10/gpg.c, g10/keyedit.c,
+         g10/mainproc.c, g10/pkclist.c, g10/tofu.c, g13/sh-cmd.c,
+         g13/sh-dmcrypt.c, kbx/keybox-init.c, m4/pkg.m4, sm/call-dirmngr.c,
+         sm/gpgsm.c, tests/Makefile.am, tests/gpgscm/Manual.txt,
+         tests/gpgscm/scheme.c, tests/openpgp/gpgv-forged-keyring.scm,
+         tests/openpgp/multisig.test, tests/openpgp/verify.scm,
+         tests/pkits/README, tools/applygnupgdefaults,
+         tools/gpg-connect-agent.c, tools/mime-maker.c, tools/mime-parser.c:
+         minor spelling cleanup.
+
+2016-09-15  NIIBE Yutaka  <gniibe@fsij.org>
+
+       tests/gpgscm: Fix use of pointer.
+       + commit 95f7320a37d3870330a2b1f3493025b4820fa767
+       * tests/gpgscm/scheme-private.h (struct scheme): Use (void *) for
+       alloc_seg.
+       * tests/gpgscm/scheme.c (alloc_cellseg): Use (void *) for cp.  Use
+       (void *) for coercion of address calculation.
+
+2016-09-06  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Fix detection of unbalanced parenthesis.
+       + commit 36405b2d208e5ec4c2c289d99ba4e7e1a29b8321
+       * tests/gpgscm/main.c (load): Print error message.
+       * tests/gpgscm/scheme.c (opexe_0): Correctly report nesting level when
+       loading files.
+
 2016-09-01  Werner Koch  <wk@gnupg.org>
 
        Check the size of the time_t.
        + commit b2640cb1f7b3b056ea4f8fe4b79d58fcd10ef93b
 
 
+2016-08-12  Daniel Kahn Gillmor  <dkg@fifthhorseman.net>
+
+       Call log_set_prefix() with human-readable labels.
+       + commit b912b371ffc56b0e657d58e2a891f6bb1affab4b
+       * agent/preset-passphrase.c, agent/protect-tool.c, dirmngr/dirmngr.c
+       * dirmngr/t-http.c, g10/gpg.c, g10/gpgv.c, g13/g13-syshelp.c
+       * g13/g13.c, kbx/kbxutil.c, scd/scdaemon.c, sm/gpgsm.c
+       * tests/gpgscm/main.c, tools/gpg-check-pattern.c
+       * tools/gpg-connect-agent.c, tools/gpgconf.c, tools/gpgtar.c
+       * tools/symcryptrun.c: Invoke log_set_prefix() with
+       human-readable labels.
+
+2016-08-10  Justus Winter  <justus@g10code.com>
+
+       tests: Improve temporary directory handling.
+       + commit 0b5146376ba4e6ef129ed4a0641591bafa5902f9
+       * tests/gpgscm/ffi.c (ffi_init): Rename 'mkdtemp'.
+       * tests/gpgscm/tests.scm (mkdtemp): New function that uses a sensible
+       location and template if no arguments are given.
+       (with-temporary-working-directory): Simplify accordingly.
+       (make-temporary-file): Likewise.
+       * tests/openpgp/run-tests.scm (run-tests-parallel-isolated): Likewise.
+       (run-tests-sequential-isolated): Likewise.
+
+       gpgscm: Make the name of foreign functions more unique.
+       + commit c609b6e6b08719b86a64fb186f6eee03d0b01b16
+       * tests/gpgscm/ffi-private.h (ffi_define_function_name): Add another
+       underscore.
+
+2016-07-26  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Do not shadow common function name in catch macro.
+       + commit d764c08a9215ab1c90a97fb019aa99ccf3721e02
+       * tests/gpgscm/init.scm (catch): Do not shadow 'exit'.
+
+       gpgscm: Make the verbose setting more useful.
+       + commit bd958b94ea3cdafa2457fdf0dcf436458fa755f6
+       * tests/gpgscm/ffi.c (do_get_verbose): New function.
+       (do_set_verbose): Likewise.
+       (ffi_init): Turn *verbose* into a function, add *set-verbose!*.
+       * tests/gpgscm/tests.scm (call): Adapt accordingly.
+       (call-with-io): Dump output if *verbose* is high.
+       (pipe-do): Adapt accordingly.
+       * tests/openpgp/defs.scm: Set verbosity according to environment.
+       * tests/openpgp/run-tests.scm (test): Adapt accordingly.
+
+2016-07-22  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Make function more general.
+       + commit 593c5ac8553922a7cf8055c6f3d4d3ea6d0f8cb6
+       * tests/gpgscm/tests.scm (in-srcdir): Accept more path fragments.
+
+2016-07-21  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Make assert macro more accurate.
+       + commit 4f5e0f510d72935ed6bc37f38261efd0ca45e04b
+       * tests/gpgscm/lib.scm (assert): Print the representation of the
+       failed expression.
+
+       gpgscm: Make error message more useful.
+       + commit bc5199d51c45e11c5d9cba828b31ced9381bd27c
+       * tests/gpgscm/scheme.c (opexe_0): Include names of missing function
+       parameters in the error message.
+
+2016-07-19  Justus Winter  <justus@g10code.com>
+
+       tests: Add test for ssh support.
+       + commit 5851aec15309e9137603bf0e564fd5028ff742c1
+       * tests/gpgscm/tests.scm (path-expand): New function.
+       * tests/openpgp/Makefile.am (TESTS): Add new test.
+       (sample_keys): Add new keys.
+       (CLEANFILES): Clean ssh socket and control file.
+       * tests/openpgp/fake-pinentry.c (main): Add a default passphrase.
+       * tests/openpgp/gpg-agent.conf.tmpl: Enable ssh support.
+       * tests/openpgp/samplekeys/ssh-dsa.key: New file.
+       * tests/openpgp/samplekeys/ssh-ecdsa.key: Likewise.
+       * tests/openpgp/samplekeys/ssh-ed25519.key: Likewise.
+       * tests/openpgp/samplekeys/ssh-rsa.key: Likewise.
+       * tests/openpgp/ssh.scm: Likewise.
+
+2016-07-15  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Fix linking.
+       + commit 4932ef5277957153f4d066f17feb47a4db2b923b
+       * tests/gpgscm/Makefile.am: Add -lintl.
+
 2016-07-14  Werner Koch  <wk@gnupg.org>
 
+       gpgscm: Use kludge to avoid improper use of ffi_schemify_name.
+       + commit 95c04eca273fe9bacbbd9666fd6806e0748792ed
+       * tests/gpgscm/ffi.c (ffi_schemify_name): Use xstrdup instead of
+       strdup for now.
+
        Release 1.24.
        + commit bb1269c85bb41dbb6391756a65e8bc357d82d6b6
 
        * tests/t-lock.c: likewise
        * tests/t-poll.c: likewise
 
+2016-07-07  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Capture output of spawned processes.
+       + commit 912977e668d59baf39464fab7e93b9a617f9706f
+       * tests/gpgscm/tests.scm (call-check): Capture stdout and stderr, and
+       return stdout if the child exited successfully, or include stderr in
+       the error.
+       * tests/openpgp/version.scm: Demonstrate this by checking the stdout.
+
+2016-07-05  Justus Winter  <justus@g10code.com>
+
+       tests: Honor environment variable 'TMP'.
+       + commit 228b225c412573d73901e3e79b7cab64a05bb26e
+       This fixes problems with long socket names, e.g. when doing distcheck.
+
+       * tests/gpgscm/tests.scm (path-join): New function.
+       (with-temporary-working-directory): Honor 'TMP'.
+       (make-temporary-file): Likewise.
+       * tests/migrations/Makefile.am (TMP): Default to '/tmp'.
+       (TESTS_ENVIRONMENT): Set 'TMP'.
+       * tests/openpgp/Makefile.am (TMP): Default to '/tmp'.
+       (TESTS_ENVIRONMENT): Set 'TMP'.
+
+       gpgscm: Improve robustness and compatibility.
+       + commit 1406aa0fdf349b370cc2a5b87ada557455203dd2
+       * tests/gpgscm/ffi.c (do_getenv): Avoid gccism.
+       (do_mkdtemp): Handle errors.
+
 2016-07-05  Andre Heinecke  <aheinecke@intevation.de>
 
        Define EWOULDBLOCK in case it is not defined.
        * doc/yat2m.c (proc_texi_cmd): Use .TQ for @itemx.  Print a .P at the
        end of a level 0 table.
 
+2016-06-30  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Fix reallocating string ports.
+       + commit 27d423b785afa3458e102fa3d7c1220ec50a47fe
+       * tests/gpgscm/scheme.c (realloc_port_string): Use memcpy because
+       Scheme strings may contain 0s.
+
+       gpgscm: Free memory backing string ports.
+       + commit f103dd1d9dd69eb0a32cf2d91e3a595082f3f41c
+       * tests/gpgscm/scheme.c (finalize_cell): Free memory backing string
+       ports.
+
+       gpgscm: Use the allocator from libgcrypt.
+       + commit 9af66b27499646f6386ab902e75056b961192f50
+       * tests/gpgscm/main.c (main): Use the allocator from libgcrypt.
+
+2016-06-28  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Fix memory leaks.
+       + commit b4e31c551b9205684e812e941bd974cc594cf97f
+       * tests/gpgscm/ffi-private.h (ffi_schemify_name): Fix prototype.
+       (ffi_define_function_name): Free schemified name.
+       (ffi_define_function): Likewise.
+       (ffi_define_constant): Likewise.
+       (ffi_define_variable_pointer): Likewise.
+       * tests/gpgscm/ffi.c (do_wait_processes): Free arrays.
+       (ffi_schemify_name): Fix type.
+       * tests/gpgscm/main.c (main): Free 'sc'.
+
+       gpgscm: Free file names.
+       + commit 9368fd55602a1d36f6bf6bc3797a4f2d7a782ded
+       * tests/gpgscm/scheme.c (scheme_load_named_file): Free file name.
+
+       gpgscm: Fix buffer overflow.
+       + commit 73b24ed0cb0ba3271e887d1044a497e53ca90b62
+       * tests/gpgscm/scheme.c (store_string): Avoid writing past allocated
+       buffer.
+
 2016-06-27  Werner Koch  <wk@gnupg.org>
 
        estream: Fix bug es_fclose_snatch if a seek has been used.
        (doreadline): Do not decrement SPACE_LEFT before breaking the loop.
        Add an extra block to limit the scope of that variable.
 
+2016-06-23  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Handle exceptions in the transformation monad.
+       + commit 7b6728b7ecf7b0646db2de35625aba3b0cd0bf02
+       * tests/gpgscm/tests.scm (pipe:do): Raise errors.
+       (tr:spawn): Catch and return errors.
+       (tr:call-with-content): Likewise.
+       (tr:{open,write-to,pipe-do,assert-identity,assert-weak-identity}):
+       Adapt.
+
+       gpgscm: Add types for special objects.
+       + commit 24df932e5fdda891760b34b7e5fccd5aba62fde8
+       * tests/gpgscm/scheme.c (enum scheme_types): Add types for boolean,
+       nil, eof, and the sink object.
+       (type_to_string): Handle new types.
+       (scheme_init_custom_alloc): Give special objects a type.
+
+       gpgscm: Fix Scheme initialization.
+       + commit 64ab51521f1a5fabee292554d7403113898f1b28
+       This potentially causes a crash if the garbage collector marks an eof
+       object.
+
+       * tests/gpgscm/scheme.c (scheme_init_custom_alloc): Initialize
+       'EOF_OBJ'.
+
+2016-06-21  Justus Winter  <justus@g10code.com>
+
+       gpgscm: Add more file handling functions.
+       + commit 5fee932e0ad2b2f5e876a70bdeef77c38e248a2e
+       * tests/gpgscm/ffi.c (do_glob): New function.
+       (ffi_init): Define new function.
+       * tests/gpgscm/tests.scm (basename-suffix): New function.x
+
+       gpgscm: Improve test framework.
+       + commit d7df61081ec228db17e2bfe2e05820da8cc2d264
+       * tests/gpgscm/lib.scm (echo): Move...
+       * tests/gpgscm/tests.scm (echo): ... here.
+       (info, error, skip): And use echo here.
+       (file-exists?): New function.
+       (tr:spawn): Check that source exists and if the sink has been created.
+       (tr:call-with-content): Hand in optional arguments.
+
+       gpgscm: Use native string searching functions.
+       + commit f4a23bc0fae621ac4b0978de4ea8f976ec6b650f
+       * tests/gpgscm/ffi-private.h: Handle character arguments.
+       * tests/gpgscm/ffi.c (do_string_index): New function.
+       (do_string_rindex): Likewise.
+       (do_string_contains): Likewise.
+       (ffi_init): Define new functions.
+       * tests/gpgscm/ffi.scm (ffi-define): New macro.
+       * tests/gpgscm/lib.scm (string-index): Use native function,
+       demonstrate behavior.
+       (string-rindex): Likewise.
+       (string-contains?): Likewise.
+       Demonstrate behavior of various other functions.
+       (read-all): Rework so that it can handle large files.
+
+       gpgscm: Improve error reporting.
+       + commit 2bc2f95ac823f0a6449bd68dee4fc094db52f2e5
+       * tests/gpgscm/scheme.c (type_to_string): New function.
+       (Eval_Cycle): Include actual type in error message.
+
+       gpgscm: Make memory allocation failures fatal.
+       + commit 224c171c856c662d22ba236eaa2128323bde1d08
+       * tests/gpgscm/scheme.c (Eval_Cycle): Exit if we run out of memory.
+
+2016-06-17  Werner Koch  <wk@gnupg.org>
+
+       tests: Make make distcheck work again.
+       + commit cdd09e054a6bc4716c7847fd0779a091cbca0e8f
+       * Makefile.am (tests): Remove test code which would led to doubling
+       calls to for e.g. "make distclean".
+       * tests/Makefile.am: Typo fixes.
+       * tests/gpgscm/Makefile.am (EXTRA_DIST): Fix name of License file.
+       Add repl.scm.
+       (check): Replace by check-local because check is a standard automake
+       target.
+       * tests/openpgp/Makefile.am (TESTS_ENVIRONMENT): Replace gmake0sim by
+       automake generated macro.
+       (EXTRA_DIST): Add defs.scm
+
+       gpgscm: Silence compiler warnings.
+       + commit d230bf3ee80cac2fe721afccab9e98b3a9be2e9a
+       * tests/gpgscm/scheme.c (mk_integer): Rename arg NUM to N.
+       (fill_vector): Ditto.
+       (mark): Rename var NUM to N.
+       (set_slot_in_env): Mark SC as unused.
+       (is_any): Mark P as unused.
+
+       Add license notices for TinySCHEME.
+       + commit 8b1798f10c2641f79f4d770e88712be8b13dc22f
+       * tests/gpgscm/COPYING: Rename to ...
+       * tests/gpgscm/LICENSE.TinySCHEME: this.
+       * AUTHORS: Add a note about TinySCHEME.
+       * build-aux/speedo/w32/pkg-copyright.txt: Add TinySCHEME notice.
+
+2016-06-17  Justus Winter  <justus@g10code.com>
+
+       tests/gpgscm: Add a TinySCHEME-based test driver.
+       + commit 5b417d262de048ef221ed77b2f9d2c1a843096bb
+       * configure.ac: Add new component.
+       * tests/Makefile.am: Likewise.
+       * tests/gpgscm/Makefile.am: New file.
+       * tests/gpgscm/ffi-private.h: Likewise.
+       * tests/gpgscm/ffi.c: Likewise.
+       * tests/gpgscm/ffi.h: Likewise.
+       * tests/gpgscm/ffi.scm: Likewise.
+       * tests/gpgscm/lib.scm: Likewise.
+       * tests/gpgscm/main.c: Likewise.
+       * tests/gpgscm/private.h: Likewise.
+       * tests/gpgscm/repl.scm: Likewise.
+       * tests/gpgscm/scheme-config.h: Likewise.
+       * tests/gpgscm/t-child.c: Likewise.
+       * tests/gpgscm/t-child.scm: Likewise.
+       * tests/gpgscm/tests.scm: Likewise.
+
+       tests/gpgscm: Foreign objects support for TinySCHEME.
+       + commit 9fecd60c32aca6b32008310237d0ed524eede3d5
+       * tests/gpgscm/scheme-private.h (struct cell): Add 'foreign_object'.
+       (is_foreign_object): New prototype.
+       (get_foreign_object_{vtable,data}): Likewise.
+       * tests/gpgscm/scheme.c (enum scheme_types): New type.
+       (is_foreign_object): New function.
+       (get_foreign_object_{vtable,data}): Likewise.
+       (mk_foreign_object): Likewise.
+       (finalize_cell): Free foreign objects.
+       (atom2str): Pretty-print foreign objects.
+       (vtbl): Add new functions.
+       * tests/gpgscm/scheme.h (struct foreign_object_vtable): New type.
+       (mk_foreign_object): New prototype.
+       (struct scheme_interface): Add new functions.
+
+       Patch from Thomas Munro,
+       https://sourceforge.net/p/tinyscheme/patches/13/
+
+       tests/gpgscm: Dynamically allocate string buffer.
+       + commit ef65b7bb2232343f72d03a0e0521de4ada3dc63b
+       * tests/gpgscm/scheme-config.h (strbuff{,_size}): Make buffer dynamic.
+       * tests/gpgscm/scheme.c (expand_strbuff): New function.
+       (putcharacter): Adapt length test.
+       (readstrexp): Expand buffer if necessary.
+       (scheme_init_custom_alloc): Initialize buffer.
+       (scheme_deinit): Free buffer.
+
+       Patch from Thomas Munro,
+       https://sourceforge.net/p/tinyscheme/patches/11/
+
+       tests/gpgscm: Make exception value available.
+       + commit c0cf52627d8d68d23bcac60571455ffd1b052106
+       * tests/gpgscm/init.scm (throw): Hand exception value to the handler.
+       (catch): And bind it to *error*.
+
+       tests/gpgscm: Add package macro.
+       + commit f6c0f9a420c4401d8d358049f8814799161185fa
+       * tests/gpgscm/init.scm: Add package macro from manual.
+
+       tests/gpgscm: Expose function to open streams as Scheme ports.
+       + commit 2717b9c172f0a25094ad2e654459dbe9d7180e38
+       * tests/gpgscm/scheme.c (vtbl): Add 'port_from_file' to the vtable.
+       * tests/gpgscm/scheme.h (struct scheme_interface): New field
+       'mk_port_from_file'.
+
+       tests/gpgscm: Nicer error message.
+       + commit 0c601ae085e95745a950a9d75ffdc8be42b3e1b2
+       * tests/gpgscm/scheme.c (opexe_0): Include the value that we tried to
+       evaluate as function-like in the error message.
+
+       tests/gpgscm: Fix error hook.
+       + commit 16e4898a735e8f85c4ca6b44adf5a92b1a42d1af
+       * tests/gpgscm/init.scm (*error-hook*): Fix error hook so that the
+       whole error message is displayed.
+
+       tests/gpgscm: Handle unhandled enumeration values.
+       + commit fe1c0866bc1b2c685136ea19521ffab2deb25ec3
+       * tests/gpgscm/scheme.c (opexe_{3,4}): Handle unhandled enumeration
+       values in the opcode dispatching code.
+
+       tests/gpgscm: Verbatim import of latest TinySCHEME.
+       + commit 864992fdf695996dbac9bb344b1fdd879f735473
+       Revision 110 from svn://svn.code.sf.net/p/tinyscheme/code/trunk
+
+       * tests/gpgscm/COPYING: New file.
+       * tests/gpgscm/Manual.txt: Likewise.
+       * tests/gpgscm/init.scm: Likewise.
+       * tests/gpgscm/opdefines.h: Likewise.
+       * tests/gpgscm/scheme-private.h: Likewise.
+       * tests/gpgscm/scheme.c: Likewise.
+       * tests/gpgscm/scheme.h: Likewise.
+
 2016-06-15  Werner Koch  <wk@gnupg.org>
 
        Release 1.23.
index f5d0b81..b67a276 100644 (file)
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this program; if not, see <https://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: LGPL-2.1-or-later
 
+# Location of the released tarball archives.  Note that this is an
+# internal archive and before uploading this to the public server,
+# manual tests should be run and the git release tat set and pushed.
+# Adjust as needed.
+RELEASE_ARCHIVE_DIR  = wk@vigenere:tarballs/libgpg-error/
+
+# The key used to sign the released sources.  Adjust as needed.
+RELEASE_SIGNING_KEY  = 6DAA6E64A76D2840571B4902528897B826403ADA
+
+# Autoconf flags
 ACLOCAL_AMFLAGS = -I m4
 DISTCHECK_CONFIGURE_FLAGS = --enable-doc
 
@@ -27,12 +38,19 @@ EXTRA_DIST = autogen.sh autogen.rc libgpg-error.spec.in             \
             po/ChangeLog-2011 m4/ChangeLog-2011 contrib/ChangeLog-2011 \
              build-aux/git-log-footer  build-aux/git-log-fix
 
+
 if LANGUAGES_SOME
 lang_subdirs = lang
 else
 lang_subdirs =
 endif
 
+#if BUILD_GPGSCM
+#doc = gpgscm
+#else
+#doc =
+#endif
+
 if BUILD_DOC
 doc = doc
 else
@@ -68,7 +86,7 @@ distcheck-hook:
 
 
 gen_start_date = 2011-12-01T00:00:00
-.PHONY: gen-ChangeLog
+.PHONY: gen-ChangeLog release sign-release
 gen-ChangeLog:
        set -e;                                                         \
        if test -d $(top_srcdir)/.git; then                             \
@@ -96,3 +114,51 @@ endif
 
 stowinstall:
        $(MAKE) $(AM_MAKEFLAGS) install prefix=/usr/local/stow/libgpg-error
+
+
+# Macro to help the release target.
+RELEASE_NAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
+
+release:
+       +(set -e;\
+        if [ "$(abs_top_builddir)" = "$(abs_top_srcdir)" ]; then \
+           echo "error: build directory must not be the source directory" >&2;\
+          exit 2;\
+         fi ;\
+        echo "/* Build started at $$(date -uIseconds) */" ;\
+        cd $(top_srcdir); \
+        ./autogen.sh --force; \
+        cd $(abs_top_builddir); \
+        rm -rf dist; mkdir dist ; cd dist ; \
+        $(abs_top_srcdir)/configure --enable-maintainer-mode; \
+        $(MAKE) distcheck; \
+        echo "/* Build finished at $$(date -uIseconds) */" ;\
+         echo "/*" ;\
+        echo " * Please run the final step interactivly:" ;\
+        echo " *   make sign-release" ;\
+        echo " */" ;\
+       ) 2>&1 | tee "$(RELEASE_NAME).buildlog"
+
+sign-release:
+        +(set -e; \
+         cd dist; \
+         files1="$(RELEASE_NAME).tar.bz2 \
+                 $(RELEASE_NAME).tar.gz" ; \
+         files2="$(RELEASE_NAME).tar.bz2.sig \
+                 $(RELEASE_NAME).tar.gz.sig  \
+                 $(RELEASE_NAME).swdb \
+                 $(RELEASE_NAME).buildlog" ;\
+         echo "/* Signing the source tarball ..." ;\
+         gpg -sbu $(RELEASE_SIGNING_KEY) $(RELEASE_NAME).tar.bz2 ;\
+         gpg -sbu $(RELEASE_SIGNING_KEY) $(RELEASE_NAME).tar.gz  ;\
+         cat $(RELEASE_NAME).swdb >swdb.snippet;\
+         echo >>swdb.snippet ;\
+         sha1sum $${files1} >>swdb.snippet ;\
+          cat "../$(RELEASE_NAME).buildlog" swdb.snippet \
+               | gzip >$(RELEASE_NAME).buildlog ;\
+          echo "Copying to local archive ..." ;\
+         scp -p $${files1} $${files2} $(RELEASE_ARCHIVE_DIR)/ || true;\
+         echo '/*' ;\
+         echo ' * All done; for checksums see dist/swdb.snippet' ;\
+         echo ' */' ;\
+         )
index 4dc69cb..6eb3f31 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this program; if not, see <https://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: LGPL-2.1-or-later
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -96,34 +107,23 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = .
-DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
-       $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-       $(top_srcdir)/configure $(am__configure_deps) \
-       $(srcdir)/config.h.in ABOUT-NLS COPYING COPYING.LIB THANKS \
-       build-aux/compile build-aux/config.guess \
-       build-aux/config.rpath build-aux/config.sub build-aux/depcomp \
-       build-aux/install-sh build-aux/mdate-sh build-aux/missing \
-       mkinstalldirs build-aux/texinfo.tex build-aux/ltmain.sh \
-       $(top_srcdir)/build-aux/compile \
-       $(top_srcdir)/build-aux/config.guess \
-       $(top_srcdir)/build-aux/config.rpath \
-       $(top_srcdir)/build-aux/config.sub \
-       $(top_srcdir)/build-aux/install-sh \
-       $(top_srcdir)/build-aux/ltmain.sh \
-       $(top_srcdir)/build-aux/missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/autobuild.m4 \
-       $(top_srcdir)/m4/estream.m4 $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/ax_cc_for_build.m4 \
+       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/estream.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gnupg-misc.m4 \
        $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
        $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/lock.m4 \
        $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
        $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
        $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/threadlib.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
+       $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+       $(am__configure_deps) $(am__DIST_COMMON)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
@@ -164,9 +164,9 @@ am__recursive_targets = \
   $(RECURSIVE_CLEAN_TARGETS) \
   $(am__extra_recursive_targets)
 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-       cscope distdir dist dist-all distcheck
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
-       $(LISP)config.h.in
+       cscope distdir distdir-am dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
+       config.h.in
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
 # *not* preserved.
@@ -187,6 +187,19 @@ ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
 DIST_SUBDIRS = m4 src doc tests po lang
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+       $(top_srcdir)/build-aux/compile \
+       $(top_srcdir)/build-aux/config.guess \
+       $(top_srcdir)/build-aux/config.rpath \
+       $(top_srcdir)/build-aux/config.sub \
+       $(top_srcdir)/build-aux/install-sh \
+       $(top_srcdir)/build-aux/ltmain.sh \
+       $(top_srcdir)/build-aux/missing ABOUT-NLS AUTHORS COPYING \
+       COPYING.LIB ChangeLog INSTALL NEWS README THANKS \
+       build-aux/compile build-aux/config.guess \
+       build-aux/config.rpath build-aux/config.sub build-aux/depcomp \
+       build-aux/install-sh build-aux/ltmain.sh build-aux/mdate-sh \
+       build-aux/missing build-aux/texinfo.tex mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -225,6 +238,8 @@ am__relativize = \
 DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
 GZIP_ENV = --best
 DIST_TARGETS = dist-bzip2 dist-gzip
+# Exists only to be overridden by the user if desired.
+AM_DISTCHECK_DVI_TARGET = dvi
 distuninstallcheck_listfiles = find . -type f -print
 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
   | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@@ -259,18 +274,20 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
 FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GPG_ERROR_CONFIG_CFLAGS = @GPG_ERROR_CONFIG_CFLAGS@
 GPG_ERROR_CONFIG_HOST = @GPG_ERROR_CONFIG_HOST@
-GPG_ERROR_CONFIG_ISUBDIRAFTER = @GPG_ERROR_CONFIG_ISUBDIRAFTER@
 GPG_ERROR_CONFIG_LIBS = @GPG_ERROR_CONFIG_LIBS@
+GPG_ERROR_CONFIG_LIBS_PRIVATE = @GPG_ERROR_CONFIG_LIBS_PRIVATE@
 GPG_ERROR_CONFIG_MT_CFLAGS = @GPG_ERROR_CONFIG_MT_CFLAGS@
 GPG_ERROR_CONFIG_MT_LIBS = @GPG_ERROR_CONFIG_MT_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
+INSTALLSHELLPATH = @INSTALLSHELLPATH@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -278,6 +295,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
+LDADD_FOR_TESTS_KLUDGE = @LDADD_FOR_TESTS_KLUDGE@
 LDFLAGS = @LDFLAGS@
 LIBGPG_ERROR_LT_AGE = @LIBGPG_ERROR_LT_AGE@
 LIBGPG_ERROR_LT_CURRENT = @LIBGPG_ERROR_LT_CURRENT@
@@ -286,9 +304,14 @@ LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBREADLINE = @LIBREADLINE@
 LIBS = @LIBS@
+LIBSTDTHREAD = @LIBSTDTHREAD@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
+LIB_NETWORK = @LIB_NETWORK@
 LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
 LIPO = @LIPO@
 LN_S = @LN_S@
@@ -375,6 +398,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -383,6 +407,17 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+
+# Location of the released tarball archives.  Note that this is an
+# internal archive and before uploading this to the public server,
+# manual tests should be run and the git release tat set and pushed.
+# Adjust as needed.
+RELEASE_ARCHIVE_DIR = wk@vigenere:tarballs/libgpg-error/
+
+# The key used to sign the released sources.  Adjust as needed.
+RELEASE_SIGNING_KEY = 6DAA6E64A76D2840571B4902528897B826403ADA
+
+# Autoconf flags
 ACLOCAL_AMFLAGS = -I m4
 DISTCHECK_CONFIGURE_FLAGS = --enable-doc
 
@@ -396,11 +431,20 @@ EXTRA_DIST = autogen.sh autogen.rc libgpg-error.spec.in           \
 @LANGUAGES_SOME_FALSE@lang_subdirs = 
 @LANGUAGES_SOME_TRUE@lang_subdirs = lang
 @BUILD_DOC_FALSE@doc = 
+
+#if BUILD_GPGSCM
+#doc = gpgscm
+#else
+#doc =
+#endif
 @BUILD_DOC_TRUE@doc = doc
 @BUILD_TESTS_FALSE@tests = 
 @BUILD_TESTS_TRUE@tests = tests
 SUBDIRS = m4 src $(doc) $(tests) po $(lang_subdirs)
 gen_start_date = 2011-12-01T00:00:00
+
+# Macro to help the release target.
+RELEASE_NAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
 all: config.h
        $(MAKE) $(AM_MAKEFLAGS) all-recursive
 
@@ -420,15 +464,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --gnu Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            echo ' $(SHELL) ./config.status'; \
            $(SHELL) ./config.status;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -570,7 +613,10 @@ distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
        -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        $(am__remove_distdir)
        test -d "$(distdir)" || mkdir "$(distdir)"
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -638,7 +684,7 @@ distdir: $(DISTFILES)
          ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
        || chmod -R a+r "$(distdir)"
 dist-gzip: distdir
-       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
        $(am__post_remove_distdir)
 dist-bzip2: distdir
        tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
@@ -652,18 +698,22 @@ dist-xz: distdir
        tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
        $(am__post_remove_distdir)
 
+dist-zstd: distdir
+       tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
+       $(am__post_remove_distdir)
+
 dist-tarZ: distdir
-       @echo WARNING: "Support for shar distribution archives is" \
-                      "deprecated." >&2
+       @echo WARNING: "Support for distribution archives compressed with" \
+                      "legacy program 'compress' is deprecated." >&2
        @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
        tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
        $(am__post_remove_distdir)
 
 dist-shar: distdir
-       @echo WARNING: "Support for distribution archives compressed with" \
-                      "legacy program 'compress' is deprecated." >&2
+       @echo WARNING: "Support for shar distribution archives is" \
+                      "deprecated." >&2
        @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
-       shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+       shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
        $(am__post_remove_distdir)
 
 dist-zip: distdir
@@ -681,7 +731,7 @@ dist dist-all:
 distcheck: dist
        case '$(DIST_ARCHIVES)' in \
        *.tar.gz*) \
-         GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+         eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
        *.tar.bz2*) \
          bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
        *.tar.lz*) \
@@ -691,26 +741,28 @@ distcheck: dist
        *.tar.Z*) \
          uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
        *.shar.gz*) \
-         GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+         eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
        *.zip*) \
          unzip $(distdir).zip ;;\
+       *.tar.zst*) \
+         zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
        esac
        chmod -R a-w $(distdir)
        chmod u+w $(distdir)
-       mkdir $(distdir)/_build $(distdir)/_inst
+       mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
        chmod a-w $(distdir)
        test -d $(distdir)/_build || exit 0; \
        dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
          && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
          && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
          && am__cwd=`pwd` \
-         && $(am__cd) $(distdir)/_build \
-         && ../configure \
+         && $(am__cd) $(distdir)/_build/sub \
+         && ../../configure \
            $(AM_DISTCHECK_CONFIGURE_FLAGS) \
            $(DISTCHECK_CONFIGURE_FLAGS) \
-           --srcdir=.. --prefix="$$dc_install_base" \
+           --srcdir=../.. --prefix="$$dc_install_base" \
          && $(MAKE) $(AM_MAKEFLAGS) \
-         && $(MAKE) $(AM_MAKEFLAGS) dvi \
+         && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
          && $(MAKE) $(AM_MAKEFLAGS) check \
          && $(MAKE) $(AM_MAKEFLAGS) install \
          && $(MAKE) $(AM_MAKEFLAGS) installcheck \
@@ -875,7 +927,7 @@ uninstall-am:
        am--refresh check check-am clean clean-cscope clean-generic \
        clean-libtool cscope cscopelist-am ctags ctags-am dist \
        dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \
-       dist-tarZ dist-xz dist-zip distcheck distclean \
+       dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \
        distclean-generic distclean-hdr distclean-libtool \
        distclean-tags distcleancheck distdir distuninstallcheck dvi \
        dvi-am html html-am info info-am install install-am \
@@ -888,6 +940,8 @@ uninstall-am:
        mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
        ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 dist-hook: gen-ChangeLog
        sed -e 's/@pkg_version@/$(VERSION)/g' \
@@ -906,7 +960,7 @@ distcheck-hook:
            echo "$${pref}sha2 $$(sha256sum <$$i|cut -d' ' -f1)" ;;\
          esac;\
        done ) | tee $(distdir).swdb
-.PHONY: gen-ChangeLog
+.PHONY: gen-ChangeLog release sign-release
 gen-ChangeLog:
        set -e;                                                         \
        if test -d $(top_srcdir)/.git; then                             \
@@ -932,6 +986,50 @@ gen-ChangeLog:
 stowinstall:
        $(MAKE) $(AM_MAKEFLAGS) install prefix=/usr/local/stow/libgpg-error
 
+release:
+       +(set -e;\
+        if [ "$(abs_top_builddir)" = "$(abs_top_srcdir)" ]; then \
+           echo "error: build directory must not be the source directory" >&2;\
+          exit 2;\
+         fi ;\
+        echo "/* Build started at $$(date -uIseconds) */" ;\
+        cd $(top_srcdir); \
+        ./autogen.sh --force; \
+        cd $(abs_top_builddir); \
+        rm -rf dist; mkdir dist ; cd dist ; \
+        $(abs_top_srcdir)/configure --enable-maintainer-mode; \
+        $(MAKE) distcheck; \
+        echo "/* Build finished at $$(date -uIseconds) */" ;\
+         echo "/*" ;\
+        echo " * Please run the final step interactivly:" ;\
+        echo " *   make sign-release" ;\
+        echo " */" ;\
+       ) 2>&1 | tee "$(RELEASE_NAME).buildlog"
+
+sign-release:
+        +(set -e; \
+         cd dist; \
+         files1="$(RELEASE_NAME).tar.bz2 \
+                 $(RELEASE_NAME).tar.gz" ; \
+         files2="$(RELEASE_NAME).tar.bz2.sig \
+                 $(RELEASE_NAME).tar.gz.sig  \
+                 $(RELEASE_NAME).swdb \
+                 $(RELEASE_NAME).buildlog" ;\
+         echo "/* Signing the source tarball ..." ;\
+         gpg -sbu $(RELEASE_SIGNING_KEY) $(RELEASE_NAME).tar.bz2 ;\
+         gpg -sbu $(RELEASE_SIGNING_KEY) $(RELEASE_NAME).tar.gz  ;\
+         cat $(RELEASE_NAME).swdb >swdb.snippet;\
+         echo >>swdb.snippet ;\
+         sha1sum $${files1} >>swdb.snippet ;\
+          cat "../$(RELEASE_NAME).buildlog" swdb.snippet \
+               | gzip >$(RELEASE_NAME).buildlog ;\
+          echo "Copying to local archive ..." ;\
+         scp -p $${files1} $${files2} $(RELEASE_ARCHIVE_DIR)/ || true;\
+         echo '/*' ;\
+         echo ' * All done; for checksums see dist/swdb.snippet' ;\
+         echo ' */' ;\
+         )
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/NEWS b/NEWS
index 89920ca..eccabac 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,404 @@
+Noteworthy changes in version 1.43 (2021-11-03) [C32/A32/R1]
+-----------------------------------------------
+
+ * Fix for building against GNU libc 2.34.  [T5547]
+
+ * Fix build problems on macOS.  [T5440,T5610]
+
+ * Fix gpgrt-config problems.  [T5381,T5595]
+
+ * Fix gpgrt_free for legacy platforms.  [448bf7b01cad]
+
+ * Fix truncation of error message in the middle of a character.
+   [T5048]
+
+ * Fix the --disable-threads configure options.  [T5495]
+
+ * Improve lock-obj generation for cross-builds [99ae862a96a5]
+
+ * Improve cross-builds. [T5365]
+
+ * Improve gpgrt_wait_processes.  [T5381]
+
+ * Allow config files to read values from the Windows Registry and
+   from envvars.  [b1790f4cc71f]
+
+ * Update the Russian and Czech translations.
+
+ Release-info: https://dev.gnupg.org/T5352
+
+
+Noteworthy changes in version 1.42 (2021-03-22) [C32/A32/R0]
+-----------------------------------------------
+
+ * Allow Unicode file names under Windows for the gettext domain.
+
+ * Improve cross-compiling support.  [#5289]
+
+ * Improve $libdir determination by gpgrt-config.  [#5293]
+
+ * Support --disable-thread by gen-lock-obj.sh.  [#5296]
+
+ * Interface changes relative to the 1.40 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_SOURCE_TPM2D             NEW.
+
+ Release-info: https://dev.gnupg.org/T5194
+
+
+Noteworthy changes in version 1.41 (2020-12-21) [C31/A31/R1]
+-----------------------------------------------
+
+ * Fixes another glitch in the "ignore" meta command.
+
+ * Fixes two typos in the German translation.
+
+ Release-info: https://dev.gnupg.org/T5192
+
+
+Noteworthy changes in version 1.40 (2020-12-21) [C31/A31/R0]
+-----------------------------------------------
+
+ * New function gpgrt_access.
+
+ * Make "ignore" meta command work correctly in the option parser.
+
+ * On Windows gpgrt_getcwd and the internal getusername now handle
+   Unicode values.  [#5098]
+
+ * Update the build system.
+
+ * Interface changes relative to the 1.39 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ gpgrt_access                     NEW.
+
+ Release-info: https://dev.gnupg.org/T5191
+
+
+Noteworthy changes in version 1.39 (2020-08-24) [C30/A30/R0]
+-----------------------------------------------
+
+ * On Windows gpgrt_fopen, gpgrt_chdir, and gpgrt_mkdir now handle
+   UTF-8 names.  [#4083]
+
+ * Make timeout of gpgrt_poll work correctly on Windows if no file
+   descriptors are active.
+
+ * New function gpgrt_fcancel as alternative to gpgrt_close.  This
+   function avoid flushing out buffered data and also tries to delete
+   a newly created file.
+
+ * Changes to ease cross-building.  [#4973]
+
+ * "gpg-error --lib-version" works again.
+
+ * Interface changes relative to the 1.38 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ gpgrt_fcancel                    NEW.
+
+ Release-info: https://dev.gnupg.org/T5031
+
+
+Noteworthy changes in version 1.38 (2020-05-29) [C29/A29/R0]
+-----------------------------------------------
+
+ * New option parser with features to implement system wide
+   configuration files.
+
+ * New functions to build file names.
+
+ * New function to help reallocating arrays.
+
+ * Protect gpgrt_inc_errorcount against counter overflow.
+
+ * Improve cross-building for new platforms.  [#4774]
+
+ * Support 64-bit big-endian MIPS architecture.  [#4952]
+
+ * Support static link for Windows with -lws2_32.  [#4623]
+
+ * Interface changes relative to the 1.37 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ gpgrt_fnameconcat                NEW.
+ gpgrt_absfnameconcat             NEW.
+ gpgrt_reallocarray               NEW.
+ gpgrt_set_confdir                NEW.
+ gpgrt_argparser                  NEW.
+ ARGPARSE_FLAG_SYS                NEW.
+ ARGPARSE_FLAG_USER               NEW.
+ ARGPARSE_FLAG_VERBOSE            NEW.
+ ARGPARSE_FLAG_USERVERS           NEW.
+ ARGPARSE_FLAG_WITHATTR           NEW.
+ ARGPARSE_NO_CONFFILE             NEW.
+ ARGPARSE_CONFFILE                NEW.
+ ARGPARSE_OPT_CONFFILE            NEW.
+ ARGPARSE_ATTR_FORCE              NEW.
+ ARGPARSE_ATTR_IGNORE             NEW.
+ ARGPARSE_TYPE_MASK               NEW.
+ ARGPARSE_PERMISSION_ERROR        NEW.
+ ARGPARSE_INVALID_META            NEW.
+ ARGPARSE_UNKNOWN_META            NEW.
+ ARGPARSE_UNEXPECTED_META         NEW.
+ ARGPARSE_conffile                NEW.
+ ARGPARSE_noconffile              NEW.
+ ARGPARSE_verbatim                NEW.
+ ARGPARSE_header                  NEW.
+ GPGRT_CONFDIR_USER               NEW.
+ GPGRT_CONFDIR_SYS                NEW.
+
+ Release-info: https://dev.gnupg.org/T4859
+
+
+Noteworthy changes in version 1.37 (2020-02-07) [C28/A28/R0]
+-----------------------------------------------
+
+ * Fixes a build problems when using Gawk 5.0  [#4459]
+
+ * Fixes Bourne shell incompatibilities on Solaris.  [#4574]
+
+ * Improves cross-comiling support.  [#4643]
+
+ * On Windows strerror_s is now used to emulate strerror_r.  [#4539]
+
+ * New error codes to map SQLite primary error codes.
+
+ * Now uses poll(2) instead of select(2) in gpgrt_poll if possible.
+
+ * Fixes a bug in gpgrt_close.  [#4698]
+
+ * Fixes build problem under Cygwin.  [#4474]
+
+ * Fixes a few minor portability bugs.
+
+ * Interface changes relative to the 1.36 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_NO_KEYBOXD               NEW.
+ GPG_ERR_KEYBOXD                  NEW.
+ GPG_ERR_NO_SERVICE               NEW.
+ GPG_ERR_SERVICE.                 NEW.
+ GPG_ERR_SQL_OK                          NEW.
+ GPG_ERR_SQL_ERROR               NEW.
+ GPG_ERR_SQL_INTERNAL            NEW.
+ GPG_ERR_SQL_PERM                NEW.
+ GPG_ERR_SQL_ABORT               NEW.
+ GPG_ERR_SQL_BUSY                NEW.
+ GPG_ERR_SQL_LOCKED              NEW.
+ GPG_ERR_SQL_NOMEM               NEW.
+ GPG_ERR_SQL_READONLY            NEW.
+ GPG_ERR_SQL_INTERRUPT           NEW.
+ GPG_ERR_SQL_IOERR               NEW.
+ GPG_ERR_SQL_CORRUPT             NEW.
+ GPG_ERR_SQL_NOTFOUND            NEW.
+ GPG_ERR_SQL_FULL                NEW.
+ GPG_ERR_SQL_CANTOPEN            NEW.
+ GPG_ERR_SQL_PROTOCOL            NEW.
+ GPG_ERR_SQL_EMPTY               NEW.
+ GPG_ERR_SQL_SCHEMA              NEW.
+ GPG_ERR_SQL_TOOBIG              NEW.
+ GPG_ERR_SQL_CONSTRAINT                  NEW.
+ GPG_ERR_SQL_MISMATCH            NEW.
+ GPG_ERR_SQL_MISUSE              NEW.
+ GPG_ERR_SQL_NOLFS               NEW.
+ GPG_ERR_SQL_AUTH                NEW.
+ GPG_ERR_SQL_FORMAT              NEW.
+ GPG_ERR_SQL_RANGE               NEW.
+ GPG_ERR_SQL_NOTADB              NEW.
+ GPG_ERR_SQL_NOTICE              NEW.
+ GPG_ERR_SQL_WARNING             NEW.
+ GPG_ERR_SQL_ROW                 NEW.
+ GPG_ERR_SQL_DONE                NEW.
+ gpg_err_code_from_sqlite         NEW.
+
+ Release-info: https://dev.gnupg.org/T4772
+
+
+Noteworthy changes in version 1.36 (2019-03-19) [C27/A27/R0]
+-----------------------------------------------
+
+ * Two new error codes to better support PIV cards.
+
+ * Support armv7a-unknown-linux-gnueabihf.
+
+ * Increased estream buffer sizes for Windows.
+
+ * Interface changes relative to the 1.34 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_NO_AUTH                  NEW.
+ GPG_ERR_BAD_AUTH                 NEW.
+
+ Release-info: https://dev.gnupg.org/T4413
+
+
+Noteworthy changes in version 1.35 (2019-01-28) [C26/A26/R1]
+-----------------------------------------------
+
+ * Distribute the correct gpgrt-config.
+
+
+Noteworthy changes in version 1.34 (2019-01-16) [C26/A26/R0]
+-----------------------------------------------
+
+ * Support for riscv32.
+
+ * New API to allow emergency cleanup after internal fatal errors.
+
+ * Minor bug and portability fixes. [#4286,#4298
+
+ * Interface changes relative to the 1.33 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ gpgrt_abort                     NEW.
+ gpgrt_add_emergency_cleanup     NEW.
+
+ Release-info: https://dev.gnupg.org/T4296
+
+
+Noteworthy changes in version 1.33 (2018-12-07) [C25/A25/R0]
+-----------------------------------------------
+
+ * New unified config script gpgrt-config which can now be used by all
+   GnuPG related packages.
+
+ * Support for ARC and arm64ilp32.
+
+ * The log functions now sanitize strings printed with the "%s" format
+   specifier.  All control characters are C-escaped in the output.
+   Users of that function may want to remove their own escaping to
+   avoid doubling of backslashes.
+
+ * New fprintf style function to apply a custom filter for string
+   arguments.
+
+ * New function to compare version strings.
+
+ * Interface changes relative to the 1.28 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ gpgrt_cmp_version               New.
+ gpgrt_string_filter_t           New.
+ gpgrt_fprintf_sf                New.
+ gpgrt_fprintf_sf_unlocked       New.
+ gpgrt_ftruncate                 New but limited functionality.
+ gpgrt_w32_override_locale       New.
+
+ Release-info: https://dev.gnupg.org/T4205
+
+
+Noteworthy changes in version 1.32 (2018-07-12) [C24/A24/R3]
+-----------------------------------------------
+
+ * Fixes a problem with gpgrt_fflush and gpgrt_fopencookie.  [#4069]
+
+ * Fixes a problem with the C11 header stdnoreturn.h.  [#4002]
+
+ * The yat2m tool can now also be build on Windows.
+
+ * Updates translations for Spanish, Russian and Ukrainian.
+
+
+Noteworthy changes in version 1.31 (2018-05-02) [C24/A24/R2]
+-----------------------------------------------
+
+ * Fixes another problem with gpgrt_poll under Windows.  [#3937]
+
+ * New translation for Spanish.
+
+
+Noteworthy changes in version 1.30 (2018-04-30) [C24/A24/R1]
+-----------------------------------------------
+
+ * Fixes a hang on Windows when using gpgrt_poll under nPth.
+
+ * Build fix for Solaris.  [#3869]
+
+
+Noteworthy changes in version 1.29 (2018-04-11) [C24/A24/R0]
+-----------------------------------------------
+
+ * The yat2m tool is during cross-compile now also installed on the
+   host platform.
+
+ * New option parser and associated functions similar to the one used
+   by GnuPG.
+
+ * New Base-64 encoder.
+
+ * Fixes regression in 1.28 for arm64 and w64 builds.
+
+ * Interface changes relative to the 1.28 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ gpgrt_argparse                  New.
+ gpgrt_usage                     New.
+ gpgrt_strusage                  New.
+ gpgrt_set_strusage              New.
+ gpgrt_set_usage_outfnc          New.
+ gpgrt_set_fixed_string_mapper   New.
+ GPGRT_ENABLE_ARGPARSE_MACROS    New macro.
+ gpgrt_b64enc_start              New.
+ gpgrt_b64enc_write              New.
+ gpgrt_b64enc_finish             New.
+
+
+Noteworthy changes in version 1.28 (2018-03-13) [C23/A23/R0]
+-----------------------------------------------
+
+ * The formerly internal yat2m tool is now installed for a native
+   build.
+
+ * The new files gpgrt.m4 and gpgrt-config are now installed.  They
+   can be used instead of gpg-error.m4 and gpg-error-config.
+
+ * New logging functions similar to those used by GnuPG.
+
+ * New helper functions for platform abstraction.
+
+ * Interface changes relative to the 1.27 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ gpgrt_get_errorcount            New API.
+ gpgrt_inc_errorcount            New API.
+ gpgrt_log_set_sink              New API.
+ gpgrt_log_set_socket_dir_cb     New API.
+ gpgrt_log_set_pid_suffix_cb     New API.
+ gpgrt_log_set_prefix            New API.
+ gpgrt_log_get_prefix            New API.
+ gpgrt_log_test_fd               New API.
+ gpgrt_log_get_fd                New API.
+ gpgrt_log_get_stream            New API.
+ gpgrt_log                       New API.
+ gpgrt_logv                      New API.
+ gpgrt_logv_prefix               New API.
+ gpgrt_log_string                New API.
+ gpgrt_log_info                  New API.
+ gpgrt_log_error                 New API.
+ gpgrt_log_fatal                 New API.
+ gpgrt_log_bug                   New API.
+ gpgrt_log_debug                 New API.
+ gpgrt_log_debug_string          New API.
+ gpgrt_log_printf                New API.
+ gpgrt_log_flush                 New API.
+ gpgrt_log_printhex              New API.
+ gpgrt_log_clock                 New API.
+ gpgrt_assert                    New macro.
+ _gpgrt_log_assert               New internal API.
+ GPGRT_LOGLVL_BEGIN              New const.
+ GPGRT_LOGLVL_CONT               New const.
+ GPGRT_LOGLVL_INFO               New const.
+ GPGRT_LOGLVL_WARN               New const.
+ GPGRT_LOGLVL_ERROR              New const.
+ GPGRT_LOGLVL_FATAL              New const.
+ GPGRT_LOGLVL_BUG                New const.
+ GPGRT_LOGLVL_DEBUG              New const.
+ gpgrt_realloc                   New API.
+ gpgrt_malloc                    New API.
+ gpgrt_calloc                    New API.
+ gpgrt_strdup                    New API.
+ gpgrt_strconcat                 New API.
+ gpgrt_w32_reg_query_string      New API.
+ gpgrt_getenv                    New API.
+ gpgrt_setenv                    New API.
+ gpgrt_mkdir                     New API.
+ gpgrt_chdir                     New API.
+ gpgrt_getcwd                    New API.
+
+
 Noteworthy changes in version 1.27 (2017-02-28) [C22/A22/R0]
 -----------------------------------------------
 
diff --git a/README b/README
index fd6e1a8..e0b9f16 100644 (file)
--- a/README
+++ b/README
@@ -20,6 +20,12 @@ components are
 
  - A lean gettext and iconv implementation for Windows.
 
+ - Log functions
+
+ - Option parser
+
+ - Base-64 encoder and decoder.
+
 More components will be added over time.  Most functions are prefixed
 with "gpgrt" (GnuPG Run Time) instead of "gpg_err" to indicate the
 long term plan to rename this library to gpgrt.
@@ -104,13 +110,8 @@ To build for Windows you you may use the convenience command:
 
    ./autogen.sh --build-w32
 
-which runs configure with suitable options.  For WindowsCE the command
-is:
-
-   ./autogen.sh --build-w32ce
-
-There is also _experimental_ support for building a 64 bit Windows
-version:
+which runs configure with suitable options.  There is also basic
+support for building a 64 bit Windows version:
 
    ./autogen.sh --build-w64
 
diff --git a/VERSION b/VERSION
index b0c101e..d9d7ef5 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.27
+1.43
index a21574b..86f4cbe 100644 (file)
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.3 -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -21,18 +21,18 @@ If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
 # intlmacosx.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2004-2014 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2014, 2016 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
-dnl This file can can be used in projects which are not available under
+dnl This file can be used in projects which are not available under
 dnl the GNU General Public License or the GNU Library General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
 dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Checks for special options needed on Mac OS X.
@@ -78,7 +78,7 @@ AC_DEFUN([gt_INTL_MACOSX],
 ])
 
 # longlong.m4 serial 17
-dnl Copyright (C) 1999-2007, 2009-2014 Free Software Foundation, Inc.
+dnl Copyright (C) 1999-2007, 2009-2016 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.
@@ -191,7 +191,7 @@ AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
               | (ullmax / ull) | (ullmax % ull));]])
 ])
 
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -203,10 +203,10 @@ AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.14'
+[am__api_version='1.16'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.14.1], [],
+m4_if([$1], [1.16.3], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -222,14 +222,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.14.1])dnl
+[AM_AUTOMAKE_VERSION([1.16.3])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -281,7 +281,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -312,7 +312,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -503,13 +503,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 #
 # 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.
 
-
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@@ -517,49 +516,43 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
   # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  AS_CASE([$CONFIG_FILES],
+          [*\'*], [eval set x "$CONFIG_FILES"],
+          [*], [set x $CONFIG_FILES])
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
     # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`AS_DIRNAME("$mf")`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "$am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`AS_DIRNAME(["$file"])`
-      AS_MKDIR_P([$dirpart/$fdir])
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`AS_DIRNAME(["$am_mf"])`
+    am_filepart=`AS_BASENAME(["$am_mf"])`
+    AM_RUN_LOG([cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles]) || am_rc=$?
   done
+  if test $am_rc -ne 0; then
+    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  If GNU make was not used, consider
+    re-running the configure script with MAKE="gmake" (or whatever is
+    necessary).  You can also try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).])
+  fi
+  AS_UNSET([am_dirpart])
+  AS_UNSET([am_filepart])
+  AS_UNSET([am_mf])
+  AS_UNSET([am_rc])
+  rm -f conftest-deps.mk
 }
 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
@@ -568,18 +561,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 # -----------------------------
 # This macro should only be invoked once -- use via AC_REQUIRE.
 #
-# This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 [AC_CONFIG_COMMANDS([depfiles],
      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
-     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
+     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -666,11 +658,11 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 # For better backward compatibility.  To be removed once Automake 1.9.x
 # dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -734,7 +726,7 @@ END
 Aborting the configuration process, to ensure you take notice of the issue.
 
 You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
 
 If you want to complete the configuration process using your problematic
 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -744,6 +736,9 @@ END
     AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
   fi
 fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
 ])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
@@ -773,7 +768,7 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -784,7 +779,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
   case $am_aux_dir in
   *\ * | *\    *)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -794,7 +789,7 @@ if test x"${install_sh}" != xset; then
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -816,7 +811,7 @@ AC_SUBST([am__leading_dot])])
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -851,7 +846,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
 
 # Check to see how 'make' treats includes.                 -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -859,49 +854,42 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
 
 # AM_MAKE_INCLUDE()
 # -----------------
-# Check to see how make treats includes.
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
 AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
 am__doit:
-       @echo this is the am__doit target
+       @echo this is the am__doit target >confinc.out
 .PHONY: am__doit
 END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
 am__include="#"
 am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
-     ;;
-   esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+      ['0:this is the am__doit target'],
+      [AS_CASE([$s],
+          [BSD], [am__include='.include' am__quote='"'],
+          [am__include='include' am__quote=''])])
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -922,12 +910,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
 if test x"${MISSING+set}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\    *)
-    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
-  *)
-    MISSING="\${SHELL} $am_aux_dir/missing" ;;
-  esac
+  MISSING="\${SHELL} '$am_aux_dir/missing'"
 fi
 # Use eval to expand $SHELL
 if eval "$MISSING --is-lightweight"; then
@@ -940,7 +923,7 @@ fi
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -969,7 +952,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1016,7 +999,7 @@ AC_LANG_POP([C])])
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1035,7 +1018,7 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1116,7 +1099,7 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1176,7 +1159,7 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1204,7 +1187,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1223,7 +1206,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1355,8 +1338,11 @@ AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
 m4_include([m4/autobuild.m4])
+m4_include([m4/ax_cc_for_build.m4])
+m4_include([m4/codeset.m4])
 m4_include([m4/estream.m4])
 m4_include([m4/gettext.m4])
+m4_include([m4/gnupg-misc.m4])
 m4_include([m4/iconv.m4])
 m4_include([m4/lib-ld.m4])
 m4_include([m4/lib-link.m4])
@@ -1370,4 +1356,5 @@ m4_include([m4/lt~obsolete.m4])
 m4_include([m4/nls.m4])
 m4_include([m4/po.m4])
 m4_include([m4/progtest.m4])
+m4_include([m4/readline.m4])
 m4_include([m4/threadlib.m4])
index b128361..a15b3a3 100644 (file)
@@ -1,6 +1,7 @@
 # autogen.sh configuration for libgpg-error                   -*- sh -*-
 
-version_parts=2
+display_name="Libgpg-error"
+patches_to="gnupg-devel@gnupg.org"
 
 case "$myhost:$myhostsub" in
   w32:ce)
index e5ba5bf..9b36158 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # autogen.sh
-# Copyright (C) 2003, 2014, 2017 g10 Code GmbH
+# Copyright (C) 2003, 2014, 2017, 2018 g10 Code GmbH
 #
 # This file is free software; as a special exception the author gives
 # unlimited permission to copy and/or distribute it, with or without
@@ -15,7 +15,7 @@
 # configure it for the respective package.  It is maintained as part of
 # GnuPG and source copied by other packages.
 #
-# Version: 2017-01-17
+# Version: 2018-07-10
 
 configure_ac="configure.ac"
 
@@ -74,7 +74,6 @@ PRINT_HOST=no
 PRINT_BUILD=no
 tmp=$(dirname "$0")
 tsdir=$(cd "${tmp}"; pwd)
-version_parts=3
 
 if [ -n "${AUTOGEN_SH_SILENT}" ]; then
   SILENT=" --silent"
@@ -85,9 +84,10 @@ if test x"$1" = x"--help"; then
   echo "    --silent       Silent operation"
   echo "    --force        Pass --force to autoconf"
   echo "    --find-version Helper for configure.ac"
-  echo "    --build-TYPE   Configure to cross build for TYPE"
+  echo "    --git-build    Run all commands to  build from a Git"
   echo "    --print-host   Print only the host triplet"
   echo "    --print-build  Print only the build platform triplet"
+  echo "    --build-TYPE   Configure to cross build for TYPE"
   echo ""
   echo "  ARGS are passed to configure in --build-TYPE mode."
   echo "  Configuration for this script is expected in autogen.rc"
@@ -159,6 +159,10 @@ case "$1" in
         SILENT=" --silent"
         shift
         ;;
+    --git-build)
+        myhost="git-build"
+        shift
+        ;;
     --build-w32)
         myhost="w32"
         shift
@@ -187,6 +191,25 @@ esac
 die_p
 
 
+# **** GIT BUILD ****
+# This is a helper to build from git.
+if [ "$myhost" = "git-build" ]; then
+    tmp="$(pwd)"
+    cd "$tsdir" || fatal "error cd-ing to $tsdir"
+    ./autogen.sh || fatal "error running ./autogen.sh"
+    cd "$tmp"   || fatal "error cd-ing back to $tmp"
+    die_p
+    "$tsdir"/configure || fatal "error running $tsdir/configure"
+    die_p
+    make || fatal "error running make"
+    die_p
+    make check || fatal "error running male check"
+    die_p
+    exit 0
+fi
+# **** end GIT BUILD ****
+
+
 # Source our configuration
 if [ -f "${tsdir}/autogen.rc" ]; then
     . "${tsdir}/autogen.rc"
@@ -215,18 +238,15 @@ if [ "$myhost" = "find-version" ]; then
       exit 1
     fi
 
-    case "$version_parts" in
-      2)
-        matchstr1="$package-$major.[0-9]*"
-        matchstr2="$package-$major-base"
-        vers="$major.$minor"
-        ;;
-      *)
-        matchstr1="$package-$major.$minor.[0-9]*"
-        matchstr2="$package-$major.$minor-base"
-        vers="$major.$minor.$micro"
-        ;;
-    esac
+    if [ -z "$micro" ]; then
+      matchstr1="$package-$major.[0-9]*"
+      matchstr2="$package-$major-base"
+      vers="$major.$minor"
+    else
+      matchstr1="$package-$major.$minor.[0-9]*"
+      matchstr2="$package-$major.$minor-base"
+      vers="$major.$minor.$micro"
+    fi
 
     beta=no
     if [ -e .git ]; then
@@ -467,6 +487,10 @@ EOF
 EOF
       $CP build-aux/git-hooks/commit-msg .git/hooks/commit-msg
       chmod +x  .git/hooks/commit-msg
+      if [ x"${display_name}" != x ]; then
+         git config format.subjectPrefix "PATCH ${display_name}"
+         git config sendemail.to "${patches_to}"
+      fi
   fi
 fi
 
index c4bd827..b33c9e8 100755 (executable)
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2016 Free Software Foundation, Inc.
+#   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2016-05-15'
+timestamp='2018-08-29'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2016-05-15'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -27,7 +27,7 @@ timestamp='2016-05-15'
 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 #
 # Please send patches to <config-patches@gnu.org>.
 
@@ -39,7 +39,7 @@ Usage: $0 [OPTION]
 
 Output the configuration name of the system \`$me' is run on.
 
-Operation modes:
+Options:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
   -v, --version      print version number, then exit
@@ -50,7 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2016 Free Software Foundation, Inc.
+Copyright 1992-2018 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -84,8 +84,6 @@ if test $# != 0; then
   exit 1
 fi
 
-trap 'exit 1' 1 2 15
-
 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
 # compiler to aid in system detection is discouraged as it requires
 # temporary files to be created and, as you can see below, it is a
@@ -96,34 +94,39 @@ trap 'exit 1' 1 2 15
 
 # Portable tmp directory creation inspired by the Autoconf team.
 
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > $dummy.c ;
-       for c in cc gcc c89 c99 ; do
-         if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
-            CC_FOR_BUILD="$c"; break ;
-         fi ;
-       done ;
-       if test x"$CC_FOR_BUILD" = x ; then
-         CC_FOR_BUILD=no_compiler_found ;
-       fi
-       ;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15
+trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0
+
+set_cc_for_build() {
+    : "${TMPDIR=/tmp}"
+    # shellcheck disable=SC2039
+    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+       { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+       { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+       { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+    dummy=$tmp/dummy
+    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+       ,,)    echo "int x;" > "$dummy.c"
+              for driver in cc gcc c89 c99 ; do
+                  if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+                      CC_FOR_BUILD="$driver"
+                      break
+                  fi
+              done
+              if test x"$CC_FOR_BUILD" = x ; then
+                  CC_FOR_BUILD=no_compiler_found
+              fi
+              ;;
+       ,,*)   CC_FOR_BUILD=$CC ;;
+       ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+    esac
+}
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
        PATH=$PATH:/.attbin ; export PATH
 fi
 
@@ -132,14 +135,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-case "${UNAME_SYSTEM}" in
+case "$UNAME_SYSTEM" in
 Linux|GNU|GNU/*)
        # If the system lacks a compiler, then just pick glibc.
        # We could probably try harder.
        LIBC=gnu
 
-       eval $set_cc_for_build
-       cat <<-EOF > $dummy.c
+       set_cc_for_build
+       cat <<-EOF > "$dummy.c"
        #include <features.h>
        #if defined(__UCLIBC__)
        LIBC=uclibc
@@ -149,13 +152,20 @@ Linux|GNU|GNU/*)
        LIBC=gnu
        #endif
        EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+       eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+       # If ldd exists, use it to detect musl libc.
+       if command -v ldd >/dev/null && \
+               ldd --version 2>&1 | grep -q ^musl
+       then
+           LIBC=musl
+       fi
        ;;
 esac
 
 # Note: order is significant - the case branches are not exclusive.
 
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
     *:NetBSD:*:*)
        # NetBSD (nbsd) targets should (where applicable) match one or
        # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -169,30 +179,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # portion of the name.  We always set it to "unknown".
        sysctl="sysctl -n hw.machine_arch"
        UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
-           /sbin/$sysctl 2>/dev/null || \
-           /usr/sbin/$sysctl 2>/dev/null || \
+           "/sbin/$sysctl" 2>/dev/null || \
+           "/usr/sbin/$sysctl" 2>/dev/null || \
            echo unknown)`
-       case "${UNAME_MACHINE_ARCH}" in
+       case "$UNAME_MACHINE_ARCH" in
            armeb) machine=armeb-unknown ;;
            arm*) machine=arm-unknown ;;
            sh3el) machine=shl-unknown ;;
            sh3eb) machine=sh-unknown ;;
            sh5el) machine=sh5le-unknown ;;
            earmv*)
-               arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
-               endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
-               machine=${arch}${endian}-unknown
+               arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+               endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+               machine="${arch}${endian}"-unknown
                ;;
-           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+           *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
        esac
        # The Operating System including object format, if it has switched
        # to ELF recently (or will in the future) and ABI.
-       case "${UNAME_MACHINE_ARCH}" in
+       case "$UNAME_MACHINE_ARCH" in
            earm*)
                os=netbsdelf
                ;;
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-               eval $set_cc_for_build
+               set_cc_for_build
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
                        | grep -q __ELF__
                then
@@ -208,10 +218,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                ;;
        esac
        # Determine ABI tags.
-       case "${UNAME_MACHINE_ARCH}" in
+       case "$UNAME_MACHINE_ARCH" in
            earm*)
                expr='s/^earmv[0-9]/-eabi/;s/eb$//'
-               abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+               abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
                ;;
        esac
        # The OS release
@@ -219,46 +229,55 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # thus, need a distinct triplet. However, they do not need
        # kernel version information, so it can be replaced with a
        # suitable tag, in the style of linux-gnu.
-       case "${UNAME_VERSION}" in
+       case "$UNAME_VERSION" in
            Debian*)
                release='-gnu'
                ;;
            *)
-               release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
+               release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
                ;;
        esac
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
        # contains redundant information, the shorter form:
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-       echo "${machine}-${os}${release}${abi}"
+       echo "$machine-${os}${release}${abi-}"
        exit ;;
     *:Bitrig:*:*)
        UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+       echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
        exit ;;
     *:OpenBSD:*:*)
        UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
        exit ;;
     *:LibertyBSD:*:*)
        UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+       exit ;;
+    *:MidnightBSD:*:*)
+       echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
        exit ;;
     *:ekkoBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
        exit ;;
     *:SolidBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
        exit ;;
     macppc:MirBSD:*:*)
-       echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+       echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
        exit ;;
     *:MirBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
        exit ;;
     *:Sortix:*:*)
-       echo ${UNAME_MACHINE}-unknown-sortix
+       echo "$UNAME_MACHINE"-unknown-sortix
        exit ;;
+    *:Redox:*:*)
+       echo "$UNAME_MACHINE"-unknown-redox
+       exit ;;
+    mips:OSF1:*.*)
+        echo mips-dec-osf1
+        exit ;;
     alpha:OSF1:*:*)
        case $UNAME_RELEASE in
        *4.0)
@@ -310,28 +329,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # A Tn.n version is a released field test version.
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
-       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+       echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
        # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
        exitcode=$?
        trap '' 0
        exit $exitcode ;;
-    Alpha\ *:Windows_NT*:*)
-       # How do we know it's Interix rather than the generic POSIX subsystem?
-       # Should we change UNAME_MACHINE based on the output of uname instead
-       # of the specific Alpha model?
-       echo alpha-pc-interix
-       exit ;;
-    21064:Windows_NT:50:3)
-       echo alpha-dec-winnt3.5
-       exit ;;
     Amiga*:UNIX_System_V:4.0:*)
        echo m68k-unknown-sysv4
        exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-amigaos
+       echo "$UNAME_MACHINE"-unknown-amigaos
        exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-morphos
+       echo "$UNAME_MACHINE"-unknown-morphos
        exit ;;
     *:OS/390:*:*)
        echo i370-ibm-openedition
@@ -343,7 +353,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        echo powerpc-ibm-os400
        exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-       echo arm-acorn-riscix${UNAME_RELEASE}
+       echo arm-acorn-riscix"$UNAME_RELEASE"
        exit ;;
     arm*:riscos:*:*|arm*:RISCOS:*:*)
        echo arm-unknown-riscos
@@ -370,38 +380,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
            sparc) echo sparc-icl-nx7; exit ;;
        esac ;;
     s390x:SunOS:*:*)
-       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
        exit ;;
     sun4H:SunOS:5.*:*)
-       echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
        exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-       echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
        exit ;;
     i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-       echo i386-pc-auroraux${UNAME_RELEASE}
+       echo i386-pc-auroraux"$UNAME_RELEASE"
        exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-       eval $set_cc_for_build
-       SUN_ARCH=i386
-       # If there is a compiler, see if it is configured for 64-bit objects.
-       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
-       # This test works for both compilers.
-       if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
-           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
-               (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-               grep IS_64BIT_ARCH >/dev/null
-           then
-               SUN_ARCH=x86_64
-           fi
-       fi
-       echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
+       case `isainfo -b` in
+           32)
+               echo i386-pc-solaris2"$UNAME_REL"
+               ;;
+           64)
+               echo x86_64-pc-solaris2"$UNAME_REL"
+               ;;
+       esac
        exit ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
        # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
        # it's likely to be more like Solaris than SunOS4.
-       echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
        exit ;;
     sun4*:SunOS:*:*)
        case "`/usr/bin/arch -k`" in
@@ -410,25 +415,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                ;;
        esac
        # Japanese Language versions have a version number like `4.1.3-JL'.
-       echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+       echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
        exit ;;
     sun3*:SunOS:*:*)
-       echo m68k-sun-sunos${UNAME_RELEASE}
+       echo m68k-sun-sunos"$UNAME_RELEASE"
        exit ;;
     sun*:*:4.2BSD:*)
        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-       test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
+       test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
        case "`/bin/arch`" in
            sun3)
-               echo m68k-sun-sunos${UNAME_RELEASE}
+               echo m68k-sun-sunos"$UNAME_RELEASE"
                ;;
            sun4)
-               echo sparc-sun-sunos${UNAME_RELEASE}
+               echo sparc-sun-sunos"$UNAME_RELEASE"
                ;;
        esac
        exit ;;
     aushp:SunOS:*:*)
-       echo sparc-auspex-sunos${UNAME_RELEASE}
+       echo sparc-auspex-sunos"$UNAME_RELEASE"
        exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
@@ -439,44 +444,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-       echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint"$UNAME_RELEASE"
        exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-       echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint"$UNAME_RELEASE"
        exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-       echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint"$UNAME_RELEASE"
        exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-       echo m68k-milan-mint${UNAME_RELEASE}
+       echo m68k-milan-mint"$UNAME_RELEASE"
        exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-       echo m68k-hades-mint${UNAME_RELEASE}
+       echo m68k-hades-mint"$UNAME_RELEASE"
        exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-       echo m68k-unknown-mint${UNAME_RELEASE}
+       echo m68k-unknown-mint"$UNAME_RELEASE"
        exit ;;
     m68k:machten:*:*)
-       echo m68k-apple-machten${UNAME_RELEASE}
+       echo m68k-apple-machten"$UNAME_RELEASE"
        exit ;;
     powerpc:machten:*:*)
-       echo powerpc-apple-machten${UNAME_RELEASE}
+       echo powerpc-apple-machten"$UNAME_RELEASE"
        exit ;;
     RISC*:Mach:*:*)
        echo mips-dec-mach_bsd4.3
        exit ;;
     RISC*:ULTRIX:*:*)
-       echo mips-dec-ultrix${UNAME_RELEASE}
+       echo mips-dec-ultrix"$UNAME_RELEASE"
        exit ;;
     VAX*:ULTRIX*:*:*)
-       echo vax-dec-ultrix${UNAME_RELEASE}
+       echo vax-dec-ultrix"$UNAME_RELEASE"
        exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
-       echo clipper-intergraph-clix${UNAME_RELEASE}
+       echo clipper-intergraph-clix"$UNAME_RELEASE"
        exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
+       set_cc_for_build
+       sed 's/^        //' << EOF > "$dummy.c"
 #ifdef __cplusplus
 #include <stdio.h>  /* for printf() prototype */
        int main (int argc, char *argv[]) {
@@ -485,23 +490,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 #endif
        #if defined (host_mips) && defined (MIPSEB)
        #if defined (SYSTYPE_SYSV)
-         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+         printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
        #endif
        #if defined (SYSTYPE_SVR4)
-         printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+         printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
        #endif
        #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
-         printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+         printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
        #endif
        #endif
          exit (-1);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c &&
-         dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-         SYSTEM_NAME=`$dummy $dummyarg` &&
+       $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+         dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+         SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
            { echo "$SYSTEM_NAME"; exit; }
-       echo mips-mips-riscos${UNAME_RELEASE}
+       echo mips-mips-riscos"$UNAME_RELEASE"
        exit ;;
     Motorola:PowerMAX_OS:*:*)
        echo powerpc-motorola-powermax
@@ -527,17 +532,17 @@ EOF
     AViiON:dgux:*:*)
        # DG/UX returns AViiON for all architectures
        UNAME_PROCESSOR=`/usr/bin/uname -p`
-       if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+       if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
        then
-           if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-              [ ${TARGET_BINARY_INTERFACE}x = x ]
+           if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
+              [ "$TARGET_BINARY_INTERFACE"x = x ]
            then
-               echo m88k-dg-dgux${UNAME_RELEASE}
+               echo m88k-dg-dgux"$UNAME_RELEASE"
            else
-               echo m88k-dg-dguxbcs${UNAME_RELEASE}
+               echo m88k-dg-dguxbcs"$UNAME_RELEASE"
            fi
        else
-           echo i586-dg-dgux${UNAME_RELEASE}
+           echo i586-dg-dgux"$UNAME_RELEASE"
        fi
        exit ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
@@ -554,7 +559,7 @@ EOF
        echo m68k-tektronix-bsd
        exit ;;
     *:IRIX*:*:*)
-       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+       echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
        exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
        echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
@@ -566,14 +571,14 @@ EOF
        if [ -x /usr/bin/oslevel ] ; then
                IBM_REV=`/usr/bin/oslevel`
        else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+               IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
        fi
-       echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+       echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
        exit ;;
     *:AIX:2:3)
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-               eval $set_cc_for_build
-               sed 's/^                //' << EOF >$dummy.c
+               set_cc_for_build
+               sed 's/^                //' << EOF > "$dummy.c"
                #include <sys/systemcfg.h>
 
                main()
@@ -584,7 +589,7 @@ EOF
                        exit(0);
                        }
 EOF
-               if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+               if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
                then
                        echo "$SYSTEM_NAME"
                else
@@ -598,7 +603,7 @@ EOF
        exit ;;
     *:AIX:*:[4567])
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
-       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+       if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
                IBM_ARCH=rs6000
        else
                IBM_ARCH=powerpc
@@ -607,18 +612,18 @@ EOF
                IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
                           awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
        else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+               IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
        fi
-       echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+       echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
        exit ;;
     *:AIX:*:*)
        echo rs6000-ibm-aix
        exit ;;
-    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
        echo romp-ibm-bsd4.4
        exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-       echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+       echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
        exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
        echo rs6000-bull-bosx
@@ -633,28 +638,28 @@ EOF
        echo m68k-hp-bsd4.4
        exit ;;
     9000/[34678]??:HP-UX:*:*)
-       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-       case "${UNAME_MACHINE}" in
-           9000/31? )            HP_ARCH=m68000 ;;
-           9000/[34]?? )         HP_ARCH=m68k ;;
+       HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+       case "$UNAME_MACHINE" in
+           9000/31?)            HP_ARCH=m68000 ;;
+           9000/[34]??)         HP_ARCH=m68k ;;
            9000/[678][0-9][0-9])
                if [ -x /usr/bin/getconf ]; then
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                   case "${sc_cpu_version}" in
+                   case "$sc_cpu_version" in
                      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
                      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
                      532)                      # CPU_PA_RISC2_0
-                       case "${sc_kernel_bits}" in
+                       case "$sc_kernel_bits" in
                          32) HP_ARCH=hppa2.0n ;;
                          64) HP_ARCH=hppa2.0w ;;
                          '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
                        esac ;;
                    esac
                fi
-               if [ "${HP_ARCH}" = "" ]; then
-                   eval $set_cc_for_build
-                   sed 's/^            //' << EOF >$dummy.c
+               if [ "$HP_ARCH" = "" ]; then
+                   set_cc_for_build
+                   sed 's/^            //' << EOF > "$dummy.c"
 
                #define _HPUX_SOURCE
                #include <stdlib.h>
@@ -687,13 +692,13 @@ EOF
                    exit (0);
                }
 EOF
-                   (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+                   (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
                    test -z "$HP_ARCH" && HP_ARCH=hppa
                fi ;;
        esac
-       if [ ${HP_ARCH} = hppa2.0w ]
+       if [ "$HP_ARCH" = hppa2.0w ]
        then
-           eval $set_cc_for_build
+           set_cc_for_build
 
            # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
            # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
@@ -712,15 +717,15 @@ EOF
                HP_ARCH=hppa64
            fi
        fi
-       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+       echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
        exit ;;
     ia64:HP-UX:*:*)
-       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-       echo ia64-hp-hpux${HPUX_REV}
+       HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+       echo ia64-hp-hpux"$HPUX_REV"
        exit ;;
     3050*:HI-UX:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
+       set_cc_for_build
+       sed 's/^        //' << EOF > "$dummy.c"
        #include <unistd.h>
        int
        main ()
@@ -745,11 +750,11 @@ EOF
          exit (0);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+       $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
                { echo "$SYSTEM_NAME"; exit; }
        echo unknown-hitachi-hiuxwe2
        exit ;;
-    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
        echo hppa1.1-hp-bsd
        exit ;;
     9000/8??:4.3bsd:*:*)
@@ -758,7 +763,7 @@ EOF
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
        echo hppa1.0-hp-mpeix
        exit ;;
-    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
        echo hppa1.1-hp-osf
        exit ;;
     hp8??:OSF1:*:*)
@@ -766,9 +771,9 @@ EOF
        exit ;;
     i*86:OSF1:*:*)
        if [ -x /usr/sbin/sysversion ] ; then
-           echo ${UNAME_MACHINE}-unknown-osf1mk
+           echo "$UNAME_MACHINE"-unknown-osf1mk
        else
-           echo ${UNAME_MACHINE}-unknown-osf1
+           echo "$UNAME_MACHINE"-unknown-osf1
        fi
        exit ;;
     parisc*:Lites*:*:*)
@@ -793,127 +798,120 @@ EOF
        echo c4-convex-bsd
        exit ;;
     CRAY*Y-MP:*:*:*)
-       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*[A-Z]90:*:*:*)
-       echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+       echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
              -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*TS:*:*:*)
-       echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*T3E:*:*:*)
-       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*SV1:*:*:*)
-       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     *:UNICOS/mp:*:*)
-       echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
        FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
        FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-       FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+       FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
        exit ;;
     5000:UNIX_System_V:4.*:*)
        FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-       FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+       FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
        exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
-       echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
        exit ;;
     sparc*:BSD/OS:*:*)
-       echo sparc-unknown-bsdi${UNAME_RELEASE}
+       echo sparc-unknown-bsdi"$UNAME_RELEASE"
        exit ;;
     *:BSD/OS:*:*)
-       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+       exit ;;
+    arm:FreeBSD:*:*)
+       UNAME_PROCESSOR=`uname -p`
+       set_cc_for_build
+       if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_PCS_VFP
+       then
+           echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
+       else
+           echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
+       fi
        exit ;;
     *:FreeBSD:*:*)
        UNAME_PROCESSOR=`/usr/bin/uname -p`
-       case ${UNAME_PROCESSOR} in
+       case "$UNAME_PROCESSOR" in
            amd64)
-               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-           *)
-               echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+               UNAME_PROCESSOR=x86_64 ;;
+           i386)
+               UNAME_PROCESSOR=i586 ;;
        esac
+       echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
        exit ;;
     i*:CYGWIN*:*)
-       echo ${UNAME_MACHINE}-pc-cygwin
+       echo "$UNAME_MACHINE"-pc-cygwin
        exit ;;
     *:MINGW64*:*)
-       echo ${UNAME_MACHINE}-pc-mingw64
+       echo "$UNAME_MACHINE"-pc-mingw64
        exit ;;
     *:MINGW*:*)
-       echo ${UNAME_MACHINE}-pc-mingw32
+       echo "$UNAME_MACHINE"-pc-mingw32
        exit ;;
     *:MSYS*:*)
-       echo ${UNAME_MACHINE}-pc-msys
-       exit ;;
-    i*:windows32*:*)
-       # uname -m includes "-pc" on this system.
-       echo ${UNAME_MACHINE}-mingw32
+       echo "$UNAME_MACHINE"-pc-msys
        exit ;;
     i*:PW*:*)
-       echo ${UNAME_MACHINE}-pc-pw32
+       echo "$UNAME_MACHINE"-pc-pw32
        exit ;;
     *:Interix*:*)
-       case ${UNAME_MACHINE} in
+       case "$UNAME_MACHINE" in
            x86)
-               echo i586-pc-interix${UNAME_RELEASE}
+               echo i586-pc-interix"$UNAME_RELEASE"
                exit ;;
            authenticamd | genuineintel | EM64T)
-               echo x86_64-unknown-interix${UNAME_RELEASE}
+               echo x86_64-unknown-interix"$UNAME_RELEASE"
                exit ;;
            IA64)
-               echo ia64-unknown-interix${UNAME_RELEASE}
+               echo ia64-unknown-interix"$UNAME_RELEASE"
                exit ;;
        esac ;;
-    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
-       echo i${UNAME_MACHINE}-pc-mks
-       exit ;;
-    8664:Windows_NT:*)
-       echo x86_64-pc-mks
-       exit ;;
-    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-       # How do we know it's Interix rather than the generic POSIX subsystem?
-       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-       # UNAME_MACHINE based on the output of uname instead of i386?
-       echo i586-pc-interix
-       exit ;;
     i*:UWIN*:*)
-       echo ${UNAME_MACHINE}-pc-uwin
+       echo "$UNAME_MACHINE"-pc-uwin
        exit ;;
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
        echo x86_64-unknown-cygwin
        exit ;;
-    p*:CYGWIN*:*)
-       echo powerpcle-unknown-cygwin
-       exit ;;
     prep*:SunOS:5.*:*)
-       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
        exit ;;
     *:GNU:*:*)
        # the GNU system
-       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+       echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
        exit ;;
     *:GNU/*:*:*)
        # other systems with GNU libc and userland
-       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+       echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
        exit ;;
-    i*86:Minix:*:*)
-       echo ${UNAME_MACHINE}-pc-minix
+    *:Minix:*:*)
+       echo "$UNAME_MACHINE"-unknown-minix
        exit ;;
     aarch64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     aarch64_be:Linux:*:*)
        UNAME_MACHINE=aarch64_be
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     alpha:Linux:*:*)
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -927,63 +925,63 @@ EOF
        esac
        objdump --private-headers /bin/sh | grep -q ld.so.1
        if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     arc:Linux:*:* | arceb:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     arm*:Linux:*:*)
-       eval $set_cc_for_build
+       set_cc_for_build
        if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
            | grep -q __ARM_EABI__
        then
-           echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+           echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        else
            if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
                | grep -q __ARM_PCS_VFP
            then
-               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+               echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
            else
-               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+               echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
            fi
        fi
        exit ;;
     avr32*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     cris:Linux:*:*)
-       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+       echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
        exit ;;
     crisv32:Linux:*:*)
-       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+       echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
        exit ;;
     e2k:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     frv:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     hexagon:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     i*86:Linux:*:*)
-       echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+       echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
        exit ;;
     ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     k1om:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     m32r*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     m68*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
+       set_cc_for_build
+       sed 's/^        //' << EOF > "$dummy.c"
        #undef CPU
        #undef ${UNAME_MACHINE}
        #undef ${UNAME_MACHINE}el
@@ -997,64 +995,70 @@ EOF
        #endif
        #endif
 EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+       eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
+       test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
        ;;
+    mips64el:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
     openrisc*:Linux:*:*)
-       echo or1k-unknown-linux-${LIBC}
+       echo or1k-unknown-linux-"$LIBC"
        exit ;;
     or32:Linux:*:* | or1k*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     padre:Linux:*:*)
-       echo sparc-unknown-linux-${LIBC}
+       echo sparc-unknown-linux-"$LIBC"
        exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-unknown-linux-${LIBC}
+       echo hppa64-unknown-linux-"$LIBC"
        exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-         PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
-         PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
-         *)    echo hppa-unknown-linux-${LIBC} ;;
+         PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+         PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+         *)    echo hppa-unknown-linux-"$LIBC" ;;
        esac
        exit ;;
     ppc64:Linux:*:*)
-       echo powerpc64-unknown-linux-${LIBC}
+       echo powerpc64-unknown-linux-"$LIBC"
        exit ;;
     ppc:Linux:*:*)
-       echo powerpc-unknown-linux-${LIBC}
+       echo powerpc-unknown-linux-"$LIBC"
        exit ;;
     ppc64le:Linux:*:*)
-       echo powerpc64le-unknown-linux-${LIBC}
+       echo powerpc64le-unknown-linux-"$LIBC"
        exit ;;
     ppcle:Linux:*:*)
-       echo powerpcle-unknown-linux-${LIBC}
+       echo powerpcle-unknown-linux-"$LIBC"
+       exit ;;
+    riscv32:Linux:*:* | riscv64:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-       echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+       echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
        exit ;;
     sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     sh*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     tile*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     vax:Linux:*:*)
-       echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+       echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
        exit ;;
     x86_64:Linux:*:*)
-       echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+       echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
        exit ;;
     xtensa*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1068,34 +1072,34 @@ EOF
        # I am not positive that other SVR4 systems won't match this,
        # I just have to hope.  -- rms.
        # Use sysv4.2uw... so that sysv4* matches it.
-       echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+       echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
        exit ;;
     i*86:OS/2:*:*)
        # If we were able to find `uname', then EMX Unix compatibility
        # is probably installed.
-       echo ${UNAME_MACHINE}-pc-os2-emx
+       echo "$UNAME_MACHINE"-pc-os2-emx
        exit ;;
     i*86:XTS-300:*:STOP)
-       echo ${UNAME_MACHINE}-unknown-stop
+       echo "$UNAME_MACHINE"-unknown-stop
        exit ;;
     i*86:atheos:*:*)
-       echo ${UNAME_MACHINE}-unknown-atheos
+       echo "$UNAME_MACHINE"-unknown-atheos
        exit ;;
     i*86:syllable:*:*)
-       echo ${UNAME_MACHINE}-pc-syllable
+       echo "$UNAME_MACHINE"-pc-syllable
        exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-       echo i386-unknown-lynxos${UNAME_RELEASE}
+       echo i386-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     i*86:*DOS:*:*)
-       echo ${UNAME_MACHINE}-pc-msdosdjgpp
+       echo "$UNAME_MACHINE"-pc-msdosdjgpp
        exit ;;
-    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
-       UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+    i*86:*:4.*:*)
+       UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-               echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+               echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
        else
-               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+               echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
        fi
        exit ;;
     i*86:*:5:[678]*)
@@ -1105,12 +1109,12 @@ EOF
            *Pentium)        UNAME_MACHINE=i586 ;;
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
        esac
-       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+       echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
        exit ;;
     i*86:*:3.2:*)
        if test -f /usr/options/cb.name; then
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+               echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
                UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
                (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1120,9 +1124,9 @@ EOF
                        && UNAME_MACHINE=i686
                (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
                        && UNAME_MACHINE=i686
-               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+               echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
        else
-               echo ${UNAME_MACHINE}-pc-sysv32
+               echo "$UNAME_MACHINE"-pc-sysv32
        fi
        exit ;;
     pc:*:*:*)
@@ -1142,9 +1146,9 @@ EOF
        exit ;;
     i860:*:4.*:*) # i860-SVR4
        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-         echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+         echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
        else # Add other i860-SVR4 vendors below as they are discovered.
-         echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+         echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
        fi
        exit ;;
     mini*:CTIX:SYS*5:*)
@@ -1164,9 +1168,9 @@ EOF
        test -r /etc/.relid \
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-         && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+         && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-         && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+         && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
          && { echo i486-ncr-sysv4; exit; } ;;
@@ -1175,28 +1179,28 @@ EOF
        test -r /etc/.relid \
            && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-           && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+           && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-           && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+           && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-           && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+           && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-       echo m68k-unknown-lynxos${UNAME_RELEASE}
+       echo m68k-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     mc68030:UNIX_System_V:4.*:*)
        echo m68k-atari-sysv4
        exit ;;
     TSUNAMI:LynxOS:2.*:*)
-       echo sparc-unknown-lynxos${UNAME_RELEASE}
+       echo sparc-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     rs6000:LynxOS:2.*:*)
-       echo rs6000-unknown-lynxos${UNAME_RELEASE}
+       echo rs6000-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-       echo powerpc-unknown-lynxos${UNAME_RELEASE}
+       echo powerpc-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     SM[BE]S:UNIX_SV:*:*)
-       echo mips-dde-sysv${UNAME_RELEASE}
+       echo mips-dde-sysv"$UNAME_RELEASE"
        exit ;;
     RM*:ReliantUNIX-*:*:*)
        echo mips-sni-sysv4
@@ -1207,7 +1211,7 @@ EOF
     *:SINIX-*:*:*)
        if uname -p 2>/dev/null >/dev/null ; then
                UNAME_MACHINE=`(uname -p) 2>/dev/null`
-               echo ${UNAME_MACHINE}-sni-sysv4
+               echo "$UNAME_MACHINE"-sni-sysv4
        else
                echo ns32k-sni-sysv
        fi
@@ -1227,23 +1231,23 @@ EOF
        exit ;;
     i*86:VOS:*:*)
        # From Paul.Green@stratus.com.
-       echo ${UNAME_MACHINE}-stratus-vos
+       echo "$UNAME_MACHINE"-stratus-vos
        exit ;;
     *:VOS:*:*)
        # From Paul.Green@stratus.com.
        echo hppa1.1-stratus-vos
        exit ;;
     mc68*:A/UX:*:*)
-       echo m68k-apple-aux${UNAME_RELEASE}
+       echo m68k-apple-aux"$UNAME_RELEASE"
        exit ;;
     news*:NEWS-OS:6*:*)
        echo mips-sony-newsos6
        exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
        if [ -d /usr/nec ]; then
-               echo mips-nec-sysv${UNAME_RELEASE}
+               echo mips-nec-sysv"$UNAME_RELEASE"
        else
-               echo mips-unknown-sysv${UNAME_RELEASE}
+               echo mips-unknown-sysv"$UNAME_RELEASE"
        fi
        exit ;;
     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
@@ -1262,49 +1266,56 @@ EOF
        echo x86_64-unknown-haiku
        exit ;;
     SX-4:SUPER-UX:*:*)
-       echo sx4-nec-superux${UNAME_RELEASE}
+       echo sx4-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-5:SUPER-UX:*:*)
-       echo sx5-nec-superux${UNAME_RELEASE}
+       echo sx5-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-6:SUPER-UX:*:*)
-       echo sx6-nec-superux${UNAME_RELEASE}
+       echo sx6-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-7:SUPER-UX:*:*)
-       echo sx7-nec-superux${UNAME_RELEASE}
+       echo sx7-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-8:SUPER-UX:*:*)
-       echo sx8-nec-superux${UNAME_RELEASE}
+       echo sx8-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-8R:SUPER-UX:*:*)
-       echo sx8r-nec-superux${UNAME_RELEASE}
+       echo sx8r-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-ACE:SUPER-UX:*:*)
-       echo sxace-nec-superux${UNAME_RELEASE}
+       echo sxace-nec-superux"$UNAME_RELEASE"
        exit ;;
     Power*:Rhapsody:*:*)
-       echo powerpc-apple-rhapsody${UNAME_RELEASE}
+       echo powerpc-apple-rhapsody"$UNAME_RELEASE"
        exit ;;
     *:Rhapsody:*:*)
-       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
        exit ;;
     *:Darwin:*:*)
        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-       eval $set_cc_for_build
+       set_cc_for_build
        if test "$UNAME_PROCESSOR" = unknown ; then
            UNAME_PROCESSOR=powerpc
        fi
-       if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+       if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
            if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
                if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-                   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-                   grep IS_64BIT_ARCH >/dev/null
+                      (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+                      grep IS_64BIT_ARCH >/dev/null
                then
                    case $UNAME_PROCESSOR in
                        i386) UNAME_PROCESSOR=x86_64 ;;
                        powerpc) UNAME_PROCESSOR=powerpc64 ;;
                    esac
                fi
+               # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+               if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+                      (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+                      grep IS_PPC >/dev/null
+               then
+                   UNAME_PROCESSOR=powerpc
+               fi
            fi
        elif test "$UNAME_PROCESSOR" = i386 ; then
            # Avoid executing cc on OS X 10.9, as it ships with a stub
@@ -1315,7 +1326,7 @@ EOF
            # that Apple uses in portable devices.
            UNAME_PROCESSOR=x86_64
        fi
-       echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+       echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
        exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
        UNAME_PROCESSOR=`uname -p`
@@ -1323,19 +1334,25 @@ EOF
                UNAME_PROCESSOR=i386
                UNAME_MACHINE=pc
        fi
-       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+       echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
        exit ;;
     *:QNX:*:4*)
        echo i386-pc-qnx
        exit ;;
-    NEO-?:NONSTOP_KERNEL:*:*)
-       echo neo-tandem-nsk${UNAME_RELEASE}
+    NEO-*:NONSTOP_KERNEL:*:*)
+       echo neo-tandem-nsk"$UNAME_RELEASE"
        exit ;;
     NSE-*:NONSTOP_KERNEL:*:*)
-       echo nse-tandem-nsk${UNAME_RELEASE}
+       echo nse-tandem-nsk"$UNAME_RELEASE"
+       exit ;;
+    NSR-*:NONSTOP_KERNEL:*:*)
+       echo nsr-tandem-nsk"$UNAME_RELEASE"
        exit ;;
-    NSR-?:NONSTOP_KERNEL:*:*)
-       echo nsr-tandem-nsk${UNAME_RELEASE}
+    NSV-*:NONSTOP_KERNEL:*:*)
+       echo nsv-tandem-nsk"$UNAME_RELEASE"
+       exit ;;
+    NSX-*:NONSTOP_KERNEL:*:*)
+       echo nsx-tandem-nsk"$UNAME_RELEASE"
        exit ;;
     *:NonStop-UX:*:*)
        echo mips-compaq-nonstopux
@@ -1344,18 +1361,19 @@ EOF
        echo bs2000-siemens-sysv
        exit ;;
     DS/*:UNIX_System_V:*:*)
-       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
        exit ;;
     *:Plan9:*:*)
        # "uname -m" is not consistent, so use $cputype instead. 386
        # is converted to i386 for consistency with other x86
        # operating systems.
+       # shellcheck disable=SC2154
        if test "$cputype" = 386; then
            UNAME_MACHINE=i386
        else
            UNAME_MACHINE="$cputype"
        fi
-       echo ${UNAME_MACHINE}-unknown-plan9
+       echo "$UNAME_MACHINE"-unknown-plan9
        exit ;;
     *:TOPS-10:*:*)
        echo pdp10-unknown-tops10
@@ -1376,14 +1394,14 @@ EOF
        echo pdp10-unknown-its
        exit ;;
     SEI:*:*:SEIUX)
-       echo mips-sei-seiux${UNAME_RELEASE}
+       echo mips-sei-seiux"$UNAME_RELEASE"
        exit ;;
     *:DragonFly:*:*)
-       echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
        exit ;;
     *:*VMS:*:*)
        UNAME_MACHINE=`(uname -p) 2>/dev/null`
-       case "${UNAME_MACHINE}" in
+       case "$UNAME_MACHINE" in
            A*) echo alpha-dec-vms ; exit ;;
            I*) echo ia64-dec-vms ; exit ;;
            V*) echo vax-dec-vms ; exit ;;
@@ -1392,32 +1410,44 @@ EOF
        echo i386-pc-xenix
        exit ;;
     i*86:skyos:*:*)
-       echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
+       echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
        exit ;;
     i*86:rdos:*:*)
-       echo ${UNAME_MACHINE}-pc-rdos
+       echo "$UNAME_MACHINE"-pc-rdos
        exit ;;
     i*86:AROS:*:*)
-       echo ${UNAME_MACHINE}-pc-aros
+       echo "$UNAME_MACHINE"-pc-aros
        exit ;;
     x86_64:VMkernel:*:*)
-       echo ${UNAME_MACHINE}-unknown-esx
+       echo "$UNAME_MACHINE"-unknown-esx
        exit ;;
     amd64:Isilon\ OneFS:*:*)
        echo x86_64-unknown-onefs
        exit ;;
 esac
 
+echo "$0: unable to guess system type" >&2
+
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+    mips:Linux | mips64:Linux)
+       # If we got here on MIPS GNU/Linux, output extra information.
+       cat >&2 <<EOF
+
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+       ;;
+esac
+
 cat >&2 <<EOF
-$0: unable to guess system type
 
 This script (version $timestamp), has failed to recognize the
-operating system you are using. If your script is old, overwrite
-config.guess and config.sub with the latest versions from:
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
 
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 and
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
 If $0 has already been updated, send the following data and any
 information you think might be pertinent to config-patches@gnu.org to
@@ -1440,16 +1470,16 @@ hostinfo               = `(hostinfo) 2>/dev/null`
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
 
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM  = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM  = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
 EOF
 
 exit 1
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
index 9feb73b..b51fb8c 100755 (executable)
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2016 Free Software Foundation, Inc.
+#   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2016-06-20'
+timestamp='2018-08-29'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2016-06-20'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -33,7 +33,7 @@ timestamp='2016-06-20'
 # Otherwise, we print the canonical config type on stdout and succeed.
 
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
@@ -57,7 +57,7 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
 
 Canonicalize a configuration name.
 
-Operation modes:
+Options:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
   -v, --version      print version number, then exit
@@ -67,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright 1992-2016 Free Software Foundation, Inc.
+Copyright 1992-2018 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -94,7 +94,7 @@ while test $# -gt 0 ; do
 
     *local*)
        # First pass through any local machine types.
-       echo $1
+       echo "$1"
        exit ;;
 
     * )
@@ -110,1242 +110,1159 @@ case $# in
     exit 1;;
 esac
 
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
-  kopensolaris*-gnu* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
-    os=-$maybe_os
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-    ;;
-  android-linux)
-    os=-linux-android
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
-    ;;
-  *)
-    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
-    if [ $basic_machine != $1 ]
-    then os=`echo $1 | sed 's/.*-/-/'`
-    else os=; fi
-    ;;
-esac
+# Split fields of configuration type
+IFS="-" read -r field1 field2 field3 field4 <<EOF
+$1
+EOF
 
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-       -sun*os*)
-               # Prevent following clause from handling this invalid input.
-               ;;
-       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-       -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-       -apple | -axis | -knuth | -cray | -microblaze*)
-               os=
-               basic_machine=$1
-               ;;
-       -bluegene*)
-               os=-cnk
-               ;;
-       -sim | -cisco | -oki | -wec | -winbond)
-               os=
-               basic_machine=$1
-               ;;
-       -scout)
-               ;;
-       -wrs)
-               os=-vxworks
-               basic_machine=$1
-               ;;
-       -chorusos*)
-               os=-chorusos
-               basic_machine=$1
-               ;;
-       -chorusrdb)
-               os=-chorusrdb
-               basic_machine=$1
-               ;;
-       -hiux*)
-               os=-hiuxwe2
-               ;;
-       -sco6)
-               os=-sco5v6
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco5)
-               os=-sco3.2v5
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco4)
-               os=-sco3.2v4
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco3.2.[4-9]*)
-               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco3.2v[4-9]*)
-               # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco5v6*)
-               # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco*)
-               os=-sco3.2v2
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -udk*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -isc)
-               os=-isc2.2
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -clix*)
-               basic_machine=clipper-intergraph
-               ;;
-       -isc*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -lynx*178)
-               os=-lynxos178
-               ;;
-       -lynx*5)
-               os=-lynxos5
-               ;;
-       -lynx*)
-               os=-lynxos
+# Separate into logical components for further validation
+case $1 in
+       *-*-*-*-*)
+               echo Invalid configuration \`"$1"\': more than four components >&2
+               exit 1
                ;;
-       -ptx*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+       *-*-*-*)
+               basic_machine=$field1-$field2
+               os=$field3-$field4
                ;;
-       -windowsnt*)
-               os=`echo $os | sed -e 's/windowsnt/winnt/'`
+       *-*-*)
+               # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+               # parts
+               maybe_os=$field2-$field3
+               case $maybe_os in
+                       nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
+                       | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
+                       | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+                       | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+                       | storm-chaos* | os2-emx* | rtmk-nova*)
+                               basic_machine=$field1
+                               os=$maybe_os
+                               ;;
+                       android-linux)
+                               basic_machine=$field1-unknown
+                               os=linux-android
+                               ;;
+                       *)
+                               basic_machine=$field1-$field2
+                               os=$field3
+                               ;;
+               esac
                ;;
-       -psos*)
-               os=-psos
+       *-*)
+               # A lone config we happen to match not fitting any patern
+               case $field1-$field2 in
+                       decstation-3100)
+                               basic_machine=mips-dec
+                               os=
+                               ;;
+                       *-*)
+                               # Second component is usually, but not always the OS
+                               case $field2 in
+                                       # Prevent following clause from handling this valid os
+                                       sun*os*)
+                                               basic_machine=$field1
+                                               os=$field2
+                                               ;;
+                                       # Manufacturers
+                                       dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+                                       | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+                                       | unicom* | ibm* | next | hp | isi* | apollo | altos* \
+                                       | convergent* | ncr* | news | 32* | 3600* | 3100* \
+                                       | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+                                       | ultra | tti* | harris | dolphin | highlevel | gould \
+                                       | cbm | ns | masscomp | apple | axis | knuth | cray \
+                                       | microblaze* | sim | cisco \
+                                       | oki | wec | wrs | winbond)
+                                               basic_machine=$field1-$field2
+                                               os=
+                                               ;;
+                                       *)
+                                               basic_machine=$field1
+                                               os=$field2
+                                               ;;
+                               esac
+                       ;;
+               esac
                ;;
-       -mint | -mint[0-9]*)
-               basic_machine=m68k-atari
-               os=-mint
+       *)
+               # Convert single-component short-hands not valid as part of
+               # multi-component configurations.
+               case $field1 in
+                       386bsd)
+                               basic_machine=i386-pc
+                               os=bsd
+                               ;;
+                       a29khif)
+                               basic_machine=a29k-amd
+                               os=udi
+                               ;;
+                       adobe68k)
+                               basic_machine=m68010-adobe
+                               os=scout
+                               ;;
+                       alliant)
+                               basic_machine=fx80-alliant
+                               os=
+                               ;;
+                       altos | altos3068)
+                               basic_machine=m68k-altos
+                               os=
+                               ;;
+                       am29k)
+                               basic_machine=a29k-none
+                               os=bsd
+                               ;;
+                       amdahl)
+                               basic_machine=580-amdahl
+                               os=sysv
+                               ;;
+                       amiga)
+                               basic_machine=m68k-unknown
+                               os=
+                               ;;
+                       amigaos | amigados)
+                               basic_machine=m68k-unknown
+                               os=amigaos
+                               ;;
+                       amigaunix | amix)
+                               basic_machine=m68k-unknown
+                               os=sysv4
+                               ;;
+                       apollo68)
+                               basic_machine=m68k-apollo
+                               os=sysv
+                               ;;
+                       apollo68bsd)
+                               basic_machine=m68k-apollo
+                               os=bsd
+                               ;;
+                       aros)
+                               basic_machine=i386-pc
+                               os=aros
+                               ;;
+                       aux)
+                               basic_machine=m68k-apple
+                               os=aux
+                               ;;
+                       balance)
+                               basic_machine=ns32k-sequent
+                               os=dynix
+                               ;;
+                       blackfin)
+                               basic_machine=bfin-unknown
+                               os=linux
+                               ;;
+                       cegcc)
+                               basic_machine=arm-unknown
+                               os=cegcc
+                               ;;
+                       convex-c1)
+                               basic_machine=c1-convex
+                               os=bsd
+                               ;;
+                       convex-c2)
+                               basic_machine=c2-convex
+                               os=bsd
+                               ;;
+                       convex-c32)
+                               basic_machine=c32-convex
+                               os=bsd
+                               ;;
+                       convex-c34)
+                               basic_machine=c34-convex
+                               os=bsd
+                               ;;
+                       convex-c38)
+                               basic_machine=c38-convex
+                               os=bsd
+                               ;;
+                       cray)
+                               basic_machine=j90-cray
+                               os=unicos
+                               ;;
+                       crds | unos)
+                               basic_machine=m68k-crds
+                               os=
+                               ;;
+                       da30)
+                               basic_machine=m68k-da30
+                               os=
+                               ;;
+                       decstation | pmax | pmin | dec3100 | decstatn)
+                               basic_machine=mips-dec
+                               os=
+                               ;;
+                       delta88)
+                               basic_machine=m88k-motorola
+                               os=sysv3
+                               ;;
+                       dicos)
+                               basic_machine=i686-pc
+                               os=dicos
+                               ;;
+                       djgpp)
+                               basic_machine=i586-pc
+                               os=msdosdjgpp
+                               ;;
+                       ebmon29k)
+                               basic_machine=a29k-amd
+                               os=ebmon
+                               ;;
+                       es1800 | OSE68k | ose68k | ose | OSE)
+                               basic_machine=m68k-ericsson
+                               os=ose
+                               ;;
+                       gmicro)
+                               basic_machine=tron-gmicro
+                               os=sysv
+                               ;;
+                       go32)
+                               basic_machine=i386-pc
+                               os=go32
+                               ;;
+                       h8300hms)
+                               basic_machine=h8300-hitachi
+                               os=hms
+                               ;;
+                       h8300xray)
+                               basic_machine=h8300-hitachi
+                               os=xray
+                               ;;
+                       h8500hms)
+                               basic_machine=h8500-hitachi
+                               os=hms
+                               ;;
+                       harris)
+                               basic_machine=m88k-harris
+                               os=sysv3
+                               ;;
+                       hp300)
+                               basic_machine=m68k-hp
+                               ;;
+                       hp300bsd)
+                               basic_machine=m68k-hp
+                               os=bsd
+                               ;;
+                       hp300hpux)
+                               basic_machine=m68k-hp
+                               os=hpux
+                               ;;
+                       hppaosf)
+                               basic_machine=hppa1.1-hp
+                               os=osf
+                               ;;
+                       hppro)
+                               basic_machine=hppa1.1-hp
+                               os=proelf
+                               ;;
+                       i386mach)
+                               basic_machine=i386-mach
+                               os=mach
+                               ;;
+                       vsta)
+                               basic_machine=i386-pc
+                               os=vsta
+                               ;;
+                       isi68 | isi)
+                               basic_machine=m68k-isi
+                               os=sysv
+                               ;;
+                       m68knommu)
+                               basic_machine=m68k-unknown
+                               os=linux
+                               ;;
+                       magnum | m3230)
+                               basic_machine=mips-mips
+                               os=sysv
+                               ;;
+                       merlin)
+                               basic_machine=ns32k-utek
+                               os=sysv
+                               ;;
+                       mingw64)
+                               basic_machine=x86_64-pc
+                               os=mingw64
+                               ;;
+                       mingw32)
+                               basic_machine=i686-pc
+                               os=mingw32
+                               ;;
+                       mingw32ce)
+                               basic_machine=arm-unknown
+                               os=mingw32ce
+                               ;;
+                       monitor)
+                               basic_machine=m68k-rom68k
+                               os=coff
+                               ;;
+                       morphos)
+                               basic_machine=powerpc-unknown
+                               os=morphos
+                               ;;
+                       moxiebox)
+                               basic_machine=moxie-unknown
+                               os=moxiebox
+                               ;;
+                       msdos)
+                               basic_machine=i386-pc
+                               os=msdos
+                               ;;
+                       msys)
+                               basic_machine=i686-pc
+                               os=msys
+                               ;;
+                       mvs)
+                               basic_machine=i370-ibm
+                               os=mvs
+                               ;;
+                       nacl)
+                               basic_machine=le32-unknown
+                               os=nacl
+                               ;;
+                       ncr3000)
+                               basic_machine=i486-ncr
+                               os=sysv4
+                               ;;
+                       netbsd386)
+                               basic_machine=i386-pc
+                               os=netbsd
+                               ;;
+                       netwinder)
+                               basic_machine=armv4l-rebel
+                               os=linux
+                               ;;
+                       news | news700 | news800 | news900)
+                               basic_machine=m68k-sony
+                               os=newsos
+                               ;;
+                       news1000)
+                               basic_machine=m68030-sony
+                               os=newsos
+                               ;;
+                       necv70)
+                               basic_machine=v70-nec
+                               os=sysv
+                               ;;
+                       nh3000)
+                               basic_machine=m68k-harris
+                               os=cxux
+                               ;;
+                       nh[45]000)
+                               basic_machine=m88k-harris
+                               os=cxux
+                               ;;
+                       nindy960)
+                               basic_machine=i960-intel
+                               os=nindy
+                               ;;
+                       mon960)
+                               basic_machine=i960-intel
+                               os=mon960
+                               ;;
+                       nonstopux)
+                               basic_machine=mips-compaq
+                               os=nonstopux
+                               ;;
+                       os400)
+                               basic_machine=powerpc-ibm
+                               os=os400
+                               ;;
+                       OSE68000 | ose68000)
+                               basic_machine=m68000-ericsson
+                               os=ose
+                               ;;
+                       os68k)
+                               basic_machine=m68k-none
+                               os=os68k
+                               ;;
+                       paragon)
+                               basic_machine=i860-intel
+                               os=osf
+                               ;;
+                       parisc)
+                               basic_machine=hppa-unknown
+                               os=linux
+                               ;;
+                       pw32)
+                               basic_machine=i586-unknown
+                               os=pw32
+                               ;;
+                       rdos | rdos64)
+                               basic_machine=x86_64-pc
+                               os=rdos
+                               ;;
+                       rdos32)
+                               basic_machine=i386-pc
+                               os=rdos
+                               ;;
+                       rom68k)
+                               basic_machine=m68k-rom68k
+                               os=coff
+                               ;;
+                       sa29200)
+                               basic_machine=a29k-amd
+                               os=udi
+                               ;;
+                       sei)
+                               basic_machine=mips-sei
+                               os=seiux
+                               ;;
+                       sequent)
+                               basic_machine=i386-sequent
+                               os=
+                               ;;
+                       sps7)
+                               basic_machine=m68k-bull
+                               os=sysv2
+                               ;;
+                       st2000)
+                               basic_machine=m68k-tandem
+                               os=
+                               ;;
+                       stratus)
+                               basic_machine=i860-stratus
+                               os=sysv4
+                               ;;
+                       sun2)
+                               basic_machine=m68000-sun
+                               os=
+                               ;;
+                       sun2os3)
+                               basic_machine=m68000-sun
+                               os=sunos3
+                               ;;
+                       sun2os4)
+                               basic_machine=m68000-sun
+                               os=sunos4
+                               ;;
+                       sun3)
+                               basic_machine=m68k-sun
+                               os=
+                               ;;
+                       sun3os3)
+                               basic_machine=m68k-sun
+                               os=sunos3
+                               ;;
+                       sun3os4)
+                               basic_machine=m68k-sun
+                               os=sunos4
+                               ;;
+                       sun4)
+                               basic_machine=sparc-sun
+                               os=
+                               ;;
+                       sun4os3)
+                               basic_machine=sparc-sun
+                               os=sunos3
+                               ;;
+                       sun4os4)
+                               basic_machine=sparc-sun
+                               os=sunos4
+                               ;;
+                       sun4sol2)
+                               basic_machine=sparc-sun
+                               os=solaris2
+                               ;;
+                       sun386 | sun386i | roadrunner)
+                               basic_machine=i386-sun
+                               os=
+                               ;;
+                       sv1)
+                               basic_machine=sv1-cray
+                               os=unicos
+                               ;;
+                       symmetry)
+                               basic_machine=i386-sequent
+                               os=dynix
+                               ;;
+                       t3e)
+                               basic_machine=alphaev5-cray
+                               os=unicos
+                               ;;
+                       t90)
+                               basic_machine=t90-cray
+                               os=unicos
+                               ;;
+                       toad1)
+                               basic_machine=pdp10-xkl
+                               os=tops20
+                               ;;
+                       tpf)
+                               basic_machine=s390x-ibm
+                               os=tpf
+                               ;;
+                       udi29k)
+                               basic_machine=a29k-amd
+                               os=udi
+                               ;;
+                       ultra3)
+                               basic_machine=a29k-nyu
+                               os=sym1
+                               ;;
+                       v810 | necv810)
+                               basic_machine=v810-nec
+                               os=none
+                               ;;
+                       vaxv)
+                               basic_machine=vax-dec
+                               os=sysv
+                               ;;
+                       vms)
+                               basic_machine=vax-dec
+                               os=vms
+                               ;;
+                       vxworks960)
+                               basic_machine=i960-wrs
+                               os=vxworks
+                               ;;
+                       vxworks68)
+                               basic_machine=m68k-wrs
+                               os=vxworks
+                               ;;
+                       vxworks29k)
+                               basic_machine=a29k-wrs
+                               os=vxworks
+                               ;;
+                       xbox)
+                               basic_machine=i686-pc
+                               os=mingw32
+                               ;;
+                       ymp)
+                               basic_machine=ymp-cray
+                               os=unicos
+                               ;;
+                       *)
+                               basic_machine=$1
+                               os=
+                               ;;
+               esac
                ;;
 esac
 
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
 case $basic_machine in
-       # Recognize the basic CPU types without company name.
-       # Some are omitted here because they have special meanings below.
-       1750a | 580 \
-       | a29k \
-       | aarch64 | aarch64_be \
-       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
-       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-       | am33_2.0 \
-       | arc | arceb \
-       | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
-       | avr | avr32 \
-       | ba \
-       | be32 | be64 \
-       | bfin \
-       | c4x | c8051 | clipper \
-       | d10v | d30v | dlx | dsp16xx \
-       | e2k | epiphany \
-       | fido | fr30 | frv | ft32 \
-       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-       | hexagon \
-       | i370 | i860 | i960 | ia64 \
-       | ip2k | iq2000 \
-       | k1om \
-       | le32 | le64 \
-       | lm32 \
-       | m32c | m32r | m32rle | m68000 | m68k | m88k \
-       | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
-       | mips | mipsbe | mipseb | mipsel | mipsle \
-       | mips16 \
-       | mips64 | mips64el \
-       | mips64octeon | mips64octeonel \
-       | mips64orion | mips64orionel \
-       | mips64r5900 | mips64r5900el \
-       | mips64vr | mips64vrel \
-       | mips64vr4100 | mips64vr4100el \
-       | mips64vr4300 | mips64vr4300el \
-       | mips64vr5000 | mips64vr5000el \
-       | mips64vr5900 | mips64vr5900el \
-       | mipsisa32 | mipsisa32el \
-       | mipsisa32r2 | mipsisa32r2el \
-       | mipsisa32r6 | mipsisa32r6el \
-       | mipsisa64 | mipsisa64el \
-       | mipsisa64r2 | mipsisa64r2el \
-       | mipsisa64r6 | mipsisa64r6el \
-       | mipsisa64sb1 | mipsisa64sb1el \
-       | mipsisa64sr71k | mipsisa64sr71kel \
-       | mipsr5900 | mipsr5900el \
-       | mipstx39 | mipstx39el \
-       | mn10200 | mn10300 \
-       | moxie \
-       | mt \
-       | msp430 \
-       | nds32 | nds32le | nds32be \
-       | nios | nios2 | nios2eb | nios2el \
-       | ns16k | ns32k \
-       | open8 | or1k | or1knd | or32 \
-       | pdp10 | pdp11 | pj | pjl \
-       | powerpc | powerpc64 | powerpc64le | powerpcle \
-       | pyramid \
-       | riscv32 | riscv64 \
-       | rl78 | rx \
-       | score \
-       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
-       | sh64 | sh64le \
-       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-       | spu \
-       | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
-       | ubicom32 \
-       | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
-       | visium \
-       | we32k \
-       | x86 | xc16x | xstormy16 | xtensa \
-       | z8k | z80)
-               basic_machine=$basic_machine-unknown
-               ;;
-       c54x)
-               basic_machine=tic54x-unknown
-               ;;
-       c55x)
-               basic_machine=tic55x-unknown
-               ;;
-       c6x)
-               basic_machine=tic6x-unknown
-               ;;
-       leon|leon[3-9])
-               basic_machine=sparc-$basic_machine
-               ;;
-       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
-               basic_machine=$basic_machine-unknown
-               os=-none
+       # Here we handle the default manufacturer of certain CPU types.  It is in
+       # some cases the only manufacturer, in others, it is the most popular.
+       w89k)
+               cpu=hppa1.1
+               vendor=winbond
                ;;
-       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+       op50n)
+               cpu=hppa1.1
+               vendor=oki
                ;;
-       ms1)
-               basic_machine=mt-unknown
+       op60c)
+               cpu=hppa1.1
+               vendor=oki
                ;;
-
-       strongarm | thumb | xscale)
-               basic_machine=arm-unknown
+       ibm*)
+               cpu=i370
+               vendor=ibm
                ;;
-       xgate)
-               basic_machine=$basic_machine-unknown
-               os=-none
+       orion105)
+               cpu=clipper
+               vendor=highlevel
                ;;
-       xscaleeb)
-               basic_machine=armeb-unknown
+       mac | mpw | mac-mpw)
+               cpu=m68k
+               vendor=apple
                ;;
-
-       xscaleel)
-               basic_machine=armel-unknown
+       pmac | pmac-mpw)
+               cpu=powerpc
+               vendor=apple
                ;;
 
-       # We use `pc' rather than `unknown'
-       # because (1) that's what they normally are, and
-       # (2) the word "unknown" tends to confuse beginning users.
-       i*86 | x86_64)
-         basic_machine=$basic_machine-pc
-         ;;
-       # Object if more than one company name word.
-       *-*-*)
-               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-               exit 1
-               ;;
-       # Recognize the basic CPU types with company name.
-       580-* \
-       | a29k-* \
-       | aarch64-* | aarch64_be-* \
-       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
-       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
-       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-       | avr-* | avr32-* \
-       | ba-* \
-       | be32-* | be64-* \
-       | bfin-* | bs2000-* \
-       | c[123]* | c30-* | [cjt]90-* | c4x-* \
-       | c8051-* | clipper-* | craynv-* | cydra-* \
-       | d10v-* | d30v-* | dlx-* \
-       | e2k-* | elxsi-* \
-       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
-       | h8300-* | h8500-* \
-       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-       | hexagon-* \
-       | i*86-* | i860-* | i960-* | ia64-* \
-       | ip2k-* | iq2000-* \
-       | k1om-* \
-       | le32-* | le64-* \
-       | lm32-* \
-       | m32c-* | m32r-* | m32rle-* \
-       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
-       | microblaze-* | microblazeel-* \
-       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
-       | mips16-* \
-       | mips64-* | mips64el-* \
-       | mips64octeon-* | mips64octeonel-* \
-       | mips64orion-* | mips64orionel-* \
-       | mips64r5900-* | mips64r5900el-* \
-       | mips64vr-* | mips64vrel-* \
-       | mips64vr4100-* | mips64vr4100el-* \
-       | mips64vr4300-* | mips64vr4300el-* \
-       | mips64vr5000-* | mips64vr5000el-* \
-       | mips64vr5900-* | mips64vr5900el-* \
-       | mipsisa32-* | mipsisa32el-* \
-       | mipsisa32r2-* | mipsisa32r2el-* \
-       | mipsisa32r6-* | mipsisa32r6el-* \
-       | mipsisa64-* | mipsisa64el-* \
-       | mipsisa64r2-* | mipsisa64r2el-* \
-       | mipsisa64r6-* | mipsisa64r6el-* \
-       | mipsisa64sb1-* | mipsisa64sb1el-* \
-       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
-       | mipsr5900-* | mipsr5900el-* \
-       | mipstx39-* | mipstx39el-* \
-       | mmix-* \
-       | mt-* \
-       | msp430-* \
-       | nds32-* | nds32le-* | nds32be-* \
-       | nios-* | nios2-* | nios2eb-* | nios2el-* \
-       | none-* | np1-* | ns16k-* | ns32k-* \
-       | open8-* \
-       | or1k*-* \
-       | orion-* \
-       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
-       | pyramid-* \
-       | riscv32-* | riscv64-* \
-       | rl78-* | romp-* | rs6000-* | rx-* \
-       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
-       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
-       | sparclite-* \
-       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
-       | tahoe-* \
-       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-       | tile*-* \
-       | tron-* \
-       | ubicom32-* \
-       | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
-       | vax-* \
-       | visium-* \
-       | we32k-* \
-       | x86-* | x86_64-* | xc16x-* | xps100-* \
-       | xstormy16-* | xtensa*-* \
-       | ymp-* \
-       | z8k-* | z80-*)
-               ;;
-       # Recognize the basic CPU types without company name, with glob match.
-       xtensa*)
-               basic_machine=$basic_machine-unknown
-               ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
-       386bsd)
-               basic_machine=i386-unknown
-               os=-bsd
-               ;;
        3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
-               basic_machine=m68000-att
+               cpu=m68000
+               vendor=att
                ;;
        3b*)
-               basic_machine=we32k-att
-               ;;
-       a29khif)
-               basic_machine=a29k-amd
-               os=-udi
-               ;;
-       abacus)
-               basic_machine=abacus-unknown
-               ;;
-       adobe68k)
-               basic_machine=m68010-adobe
-               os=-scout
-               ;;
-       alliant | fx80)
-               basic_machine=fx80-alliant
-               ;;
-       altos | altos3068)
-               basic_machine=m68k-altos
-               ;;
-       am29k)
-               basic_machine=a29k-none
-               os=-bsd
-               ;;
-       amd64)
-               basic_machine=x86_64-pc
-               ;;
-       amd64-*)
-               basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       amdahl)
-               basic_machine=580-amdahl
-               os=-sysv
-               ;;
-       amiga | amiga-*)
-               basic_machine=m68k-unknown
-               ;;
-       amigaos | amigados)
-               basic_machine=m68k-unknown
-               os=-amigaos
-               ;;
-       amigaunix | amix)
-               basic_machine=m68k-unknown
-               os=-sysv4
-               ;;
-       apollo68)
-               basic_machine=m68k-apollo
-               os=-sysv
-               ;;
-       apollo68bsd)
-               basic_machine=m68k-apollo
-               os=-bsd
-               ;;
-       aros)
-               basic_machine=i386-pc
-               os=-aros
-               ;;
-       asmjs)
-               basic_machine=asmjs-unknown
-               ;;
-       aux)
-               basic_machine=m68k-apple
-               os=-aux
-               ;;
-       balance)
-               basic_machine=ns32k-sequent
-               os=-dynix
-               ;;
-       blackfin)
-               basic_machine=bfin-unknown
-               os=-linux
-               ;;
-       blackfin-*)
-               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
-               os=-linux
+               cpu=we32k
+               vendor=att
                ;;
        bluegene*)
-               basic_machine=powerpc-ibm
-               os=-cnk
-               ;;
-       c54x-*)
-               basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       c55x-*)
-               basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       c6x-*)
-               basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       c90)
-               basic_machine=c90-cray
-               os=-unicos
-               ;;
-       cegcc)
-               basic_machine=arm-unknown
-               os=-cegcc
-               ;;
-       convex-c1)
-               basic_machine=c1-convex
-               os=-bsd
-               ;;
-       convex-c2)
-               basic_machine=c2-convex
-               os=-bsd
-               ;;
-       convex-c32)
-               basic_machine=c32-convex
-               os=-bsd
-               ;;
-       convex-c34)
-               basic_machine=c34-convex
-               os=-bsd
-               ;;
-       convex-c38)
-               basic_machine=c38-convex
-               os=-bsd
-               ;;
-       cray | j90)
-               basic_machine=j90-cray
-               os=-unicos
-               ;;
-       craynv)
-               basic_machine=craynv-cray
-               os=-unicosmp
-               ;;
-       cr16 | cr16-*)
-               basic_machine=cr16-unknown
-               os=-elf
-               ;;
-       crds | unos)
-               basic_machine=m68k-crds
-               ;;
-       crisv32 | crisv32-* | etraxfs*)
-               basic_machine=crisv32-axis
-               ;;
-       cris | cris-* | etrax*)
-               basic_machine=cris-axis
-               ;;
-       crx)
-               basic_machine=crx-unknown
-               os=-elf
-               ;;
-       da30 | da30-*)
-               basic_machine=m68k-da30
-               ;;
-       decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
-               basic_machine=mips-dec
+               cpu=powerpc
+               vendor=ibm
+               os=cnk
                ;;
        decsystem10* | dec10*)
-               basic_machine=pdp10-dec
-               os=-tops10
+               cpu=pdp10
+               vendor=dec
+               os=tops10
                ;;
        decsystem20* | dec20*)
-               basic_machine=pdp10-dec
-               os=-tops20
+               cpu=pdp10
+               vendor=dec
+               os=tops20
                ;;
        delta | 3300 | motorola-3300 | motorola-delta \
              | 3300-motorola | delta-motorola)
-               basic_machine=m68k-motorola
-               ;;
-       delta88)
-               basic_machine=m88k-motorola
-               os=-sysv3
-               ;;
-       dicos)
-               basic_machine=i686-pc
-               os=-dicos
-               ;;
-       djgpp)
-               basic_machine=i586-pc
-               os=-msdosdjgpp
-               ;;
-       dpx20 | dpx20-*)
-               basic_machine=rs6000-bull
-               os=-bosx
-               ;;
-       dpx2* | dpx2*-bull)
-               basic_machine=m68k-bull
-               os=-sysv3
-               ;;
-       e500v[12])
-               basic_machine=powerpc-unknown
-               os=$os"spe"
-               ;;
-       e500v[12]-*)
-               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-               os=$os"spe"
+               cpu=m68k
+               vendor=motorola
                ;;
-       ebmon29k)
-               basic_machine=a29k-amd
-               os=-ebmon
-               ;;
-       elxsi)
-               basic_machine=elxsi-elxsi
-               os=-bsd
+       dpx2*)
+               cpu=m68k
+               vendor=bull
+               os=sysv3
                ;;
        encore | umax | mmax)
-               basic_machine=ns32k-encore
+               cpu=ns32k
+               vendor=encore
                ;;
-       es1800 | OSE68k | ose68k | ose | OSE)
-               basic_machine=m68k-ericsson
-               os=-ose
+       elxsi)
+               cpu=elxsi
+               vendor=elxsi
+               os=${os:-bsd}
                ;;
        fx2800)
-               basic_machine=i860-alliant
+               cpu=i860
+               vendor=alliant
                ;;
        genix)
-               basic_machine=ns32k-ns
-               ;;
-       gmicro)
-               basic_machine=tron-gmicro
-               os=-sysv
-               ;;
-       go32)
-               basic_machine=i386-pc
-               os=-go32
+               cpu=ns32k
+               vendor=ns
                ;;
        h3050r* | hiux*)
-               basic_machine=hppa1.1-hitachi
-               os=-hiuxwe2
-               ;;
-       h8300hms)
-               basic_machine=h8300-hitachi
-               os=-hms
-               ;;
-       h8300xray)
-               basic_machine=h8300-hitachi
-               os=-xray
-               ;;
-       h8500hms)
-               basic_machine=h8500-hitachi
-               os=-hms
-               ;;
-       harris)
-               basic_machine=m88k-harris
-               os=-sysv3
-               ;;
-       hp300-*)
-               basic_machine=m68k-hp
-               ;;
-       hp300bsd)
-               basic_machine=m68k-hp
-               os=-bsd
-               ;;
-       hp300hpux)
-               basic_machine=m68k-hp
-               os=-hpux
+               cpu=hppa1.1
+               vendor=hitachi
+               os=hiuxwe2
                ;;
        hp3k9[0-9][0-9] | hp9[0-9][0-9])
-               basic_machine=hppa1.0-hp
+               cpu=hppa1.0
+               vendor=hp
                ;;
        hp9k2[0-9][0-9] | hp9k31[0-9])
-               basic_machine=m68000-hp
+               cpu=m68000
+               vendor=hp
                ;;
        hp9k3[2-9][0-9])
-               basic_machine=m68k-hp
+               cpu=m68k
+               vendor=hp
                ;;
        hp9k6[0-9][0-9] | hp6[0-9][0-9])
-               basic_machine=hppa1.0-hp
+               cpu=hppa1.0
+               vendor=hp
                ;;
        hp9k7[0-79][0-9] | hp7[0-79][0-9])
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k78[0-9] | hp78[0-9])
                # FIXME: really hppa2.0-hp
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
                # FIXME: really hppa2.0-hp
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k8[0-9][13679] | hp8[0-9][13679])
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k8[0-9][0-9] | hp8[0-9][0-9])
-               basic_machine=hppa1.0-hp
-               ;;
-       hppa-next)
-               os=-nextstep3
-               ;;
-       hppaosf)
-               basic_machine=hppa1.1-hp
-               os=-osf
-               ;;
-       hppro)
-               basic_machine=hppa1.1-hp
-               os=-proelf
-               ;;
-       i370-ibm* | ibm*)
-               basic_machine=i370-ibm
+               cpu=hppa1.0
+               vendor=hp
                ;;
        i*86v32)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv32
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=sysv32
                ;;
        i*86v4*)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv4
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=sysv4
                ;;
        i*86v)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=sysv
                ;;
        i*86sol2)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-solaris2
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=solaris2
                ;;
-       i386mach)
-               basic_machine=i386-mach
-               os=-mach
-               ;;
-       i386-vsta | vsta)
-               basic_machine=i386-unknown
-               os=-vsta
+       j90 | j90-cray)
+               cpu=j90
+               vendor=cray
+               os=${os:-unicos}
                ;;
        iris | iris4d)
-               basic_machine=mips-sgi
+               cpu=mips
+               vendor=sgi
                case $os in
-                   -irix*)
+                   irix*)
                        ;;
                    *)
-                       os=-irix4
+                       os=irix4
                        ;;
                esac
                ;;
-       isi68 | isi)
-               basic_machine=m68k-isi
-               os=-sysv
-               ;;
-       leon-*|leon[3-9]-*)
-               basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
-               ;;
-       m68knommu)
-               basic_machine=m68k-unknown
-               os=-linux
-               ;;
-       m68knommu-*)
-               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
-               os=-linux
-               ;;
-       m88k-omron*)
-               basic_machine=m88k-omron
-               ;;
-       magnum | m3230)
-               basic_machine=mips-mips
-               os=-sysv
-               ;;
-       merlin)
-               basic_machine=ns32k-utek
-               os=-sysv
-               ;;
-       microblaze*)
-               basic_machine=microblaze-xilinx
-               ;;
-       mingw64)
-               basic_machine=x86_64-pc
-               os=-mingw64
-               ;;
-       mingw32)
-               basic_machine=i686-pc
-               os=-mingw32
-               ;;
-       mingw32ce)
-               basic_machine=arm-unknown
-               os=-mingw32ce
-               ;;
        miniframe)
-               basic_machine=m68000-convergent
-               ;;
-       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
-               basic_machine=m68k-atari
-               os=-mint
-               ;;
-       mips3*-*)
-               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
-               ;;
-       mips3*)
-               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
-               ;;
-       monitor)
-               basic_machine=m68k-rom68k
-               os=-coff
-               ;;
-       morphos)
-               basic_machine=powerpc-unknown
-               os=-morphos
-               ;;
-       moxiebox)
-               basic_machine=moxie-unknown
-               os=-moxiebox
-               ;;
-       msdos)
-               basic_machine=i386-pc
-               os=-msdos
-               ;;
-       ms1-*)
-               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
-               ;;
-       msys)
-               basic_machine=i686-pc
-               os=-msys
-               ;;
-       mvs)
-               basic_machine=i370-ibm
-               os=-mvs
+               cpu=m68000
+               vendor=convergent
                ;;
-       nacl)
-               basic_machine=le32-unknown
-               os=-nacl
-               ;;
-       ncr3000)
-               basic_machine=i486-ncr
-               os=-sysv4
-               ;;
-       netbsd386)
-               basic_machine=i386-unknown
-               os=-netbsd
-               ;;
-       netwinder)
-               basic_machine=armv4l-rebel
-               os=-linux
-               ;;
-       news | news700 | news800 | news900)
-               basic_machine=m68k-sony
-               os=-newsos
-               ;;
-       news1000)
-               basic_machine=m68030-sony
-               os=-newsos
+       *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+               cpu=m68k
+               vendor=atari
+               os=mint
                ;;
        news-3600 | risc-news)
-               basic_machine=mips-sony
-               os=-newsos
-               ;;
-       necv70)
-               basic_machine=v70-nec
-               os=-sysv
+               cpu=mips
+               vendor=sony
+               os=newsos
                ;;
-       next | m*-next )
-               basic_machine=m68k-next
+       next | m*-next)
+               cpu=m68k
+               vendor=next
                case $os in
-                   -nextstep* )
+                   nextstep* )
                        ;;
-                   -ns2*)
-                     os=-nextstep2
+                   ns2*)
+                     os=nextstep2
                        ;;
                    *)
-                     os=-nextstep3
+                     os=nextstep3
                        ;;
                esac
                ;;
-       nh3000)
-               basic_machine=m68k-harris
-               os=-cxux
-               ;;
-       nh[45]000)
-               basic_machine=m88k-harris
-               os=-cxux
-               ;;
-       nindy960)
-               basic_machine=i960-intel
-               os=-nindy
-               ;;
-       mon960)
-               basic_machine=i960-intel
-               os=-mon960
-               ;;
-       nonstopux)
-               basic_machine=mips-compaq
-               os=-nonstopux
-               ;;
        np1)
-               basic_machine=np1-gould
-               ;;
-       neo-tandem)
-               basic_machine=neo-tandem
-               ;;
-       nse-tandem)
-               basic_machine=nse-tandem
-               ;;
-       nsr-tandem)
-               basic_machine=nsr-tandem
+               cpu=np1
+               vendor=gould
                ;;
        op50n-* | op60c-*)
-               basic_machine=hppa1.1-oki
-               os=-proelf
-               ;;
-       openrisc | openrisc-*)
-               basic_machine=or32-unknown
-               ;;
-       os400)
-               basic_machine=powerpc-ibm
-               os=-os400
-               ;;
-       OSE68000 | ose68000)
-               basic_machine=m68000-ericsson
-               os=-ose
-               ;;
-       os68k)
-               basic_machine=m68k-none
-               os=-os68k
+               cpu=hppa1.1
+               vendor=oki
+               os=proelf
                ;;
        pa-hitachi)
-               basic_machine=hppa1.1-hitachi
-               os=-hiuxwe2
-               ;;
-       paragon)
-               basic_machine=i860-intel
-               os=-osf
-               ;;
-       parisc)
-               basic_machine=hppa-unknown
-               os=-linux
-               ;;
-       parisc-*)
-               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
-               os=-linux
+               cpu=hppa1.1
+               vendor=hitachi
+               os=hiuxwe2
                ;;
        pbd)
-               basic_machine=sparc-tti
+               cpu=sparc
+               vendor=tti
                ;;
        pbb)
-               basic_machine=m68k-tti
-               ;;
-       pc532 | pc532-*)
-               basic_machine=ns32k-pc532
+               cpu=m68k
+               vendor=tti
                ;;
-       pc98)
-               basic_machine=i386-pc
-               ;;
-       pc98-*)
-               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentium | p5 | k5 | k6 | nexgen | viac3)
-               basic_machine=i586-pc
-               ;;
-       pentiumpro | p6 | 6x86 | athlon | athlon_*)
-               basic_machine=i686-pc
-               ;;
-       pentiumii | pentium2 | pentiumiii | pentium3)
-               basic_machine=i686-pc
-               ;;
-       pentium4)
-               basic_machine=i786-pc
-               ;;
-       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-               basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentiumpro-* | p6-* | 6x86-* | athlon-*)
-               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentium4-*)
-               basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+       pc532)
+               cpu=ns32k
+               vendor=pc532
                ;;
        pn)
-               basic_machine=pn-gould
+               cpu=pn
+               vendor=gould
                ;;
-       power)  basic_machine=power-ibm
-               ;;
-       ppc | ppcbe)    basic_machine=powerpc-unknown
-               ;;
-       ppc-* | ppcbe-*)
-               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppcle | powerpclittle | ppc-le | powerpc-little)
-               basic_machine=powerpcle-unknown
-               ;;
-       ppcle-* | powerpclittle-*)
-               basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppc64)  basic_machine=powerpc64-unknown
-               ;;
-       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppc64le | powerpc64little | ppc64-le | powerpc64-little)
-               basic_machine=powerpc64le-unknown
-               ;;
-       ppc64le-* | powerpc64little-*)
-               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+       power)
+               cpu=power
+               vendor=ibm
                ;;
        ps2)
-               basic_machine=i386-ibm
-               ;;
-       pw32)
-               basic_machine=i586-unknown
-               os=-pw32
-               ;;
-       rdos | rdos64)
-               basic_machine=x86_64-pc
-               os=-rdos
-               ;;
-       rdos32)
-               basic_machine=i386-pc
-               os=-rdos
-               ;;
-       rom68k)
-               basic_machine=m68k-rom68k
-               os=-coff
+               cpu=i386
+               vendor=ibm
                ;;
        rm[46]00)
-               basic_machine=mips-siemens
+               cpu=mips
+               vendor=siemens
                ;;
        rtpc | rtpc-*)
-               basic_machine=romp-ibm
-               ;;
-       s390 | s390-*)
-               basic_machine=s390-ibm
-               ;;
-       s390x | s390x-*)
-               basic_machine=s390x-ibm
+               cpu=romp
+               vendor=ibm
                ;;
-       sa29200)
-               basic_machine=a29k-amd
-               os=-udi
+       sde)
+               cpu=mipsisa32
+               vendor=sde
+               os=${os:-elf}
                ;;
-       sb1)
-               basic_machine=mipsisa64sb1-unknown
+       simso-wrs)
+               cpu=sparclite
+               vendor=wrs
+               os=vxworks
                ;;
-       sb1el)
-               basic_machine=mipsisa64sb1el-unknown
+       tower | tower-32)
+               cpu=m68k
+               vendor=ncr
                ;;
-       sde)
-               basic_machine=mipsisa32-sde
-               os=-elf
+       vpp*|vx|vx-*)
+               cpu=f301
+               vendor=fujitsu
                ;;
-       sei)
-               basic_machine=mips-sei
-               os=-seiux
+       w65)
+               cpu=w65
+               vendor=wdc
                ;;
-       sequent)
-               basic_machine=i386-sequent
+       w89k-*)
+               cpu=hppa1.1
+               vendor=winbond
+               os=proelf
                ;;
-       sh)
-               basic_machine=sh-hitachi
-               os=-hms
+       none)
+               cpu=none
+               vendor=none
                ;;
-       sh5el)
-               basic_machine=sh5le-unknown
+       leon|leon[3-9])
+               cpu=sparc
+               vendor=$basic_machine
                ;;
-       sh64)
-               basic_machine=sh64-unknown
+       leon-*|leon[3-9]-*)
+               cpu=sparc
+               vendor=`echo "$basic_machine" | sed 's/-.*//'`
                ;;
-       sparclite-wrs | simso-wrs)
-               basic_machine=sparclite-wrs
-               os=-vxworks
+
+       *-*)
+               IFS="-" read -r cpu vendor <<EOF
+$basic_machine
+EOF
                ;;
-       sps7)
-               basic_machine=m68k-bull
-               os=-sysv2
+       # We use `pc' rather than `unknown'
+       # because (1) that's what they normally are, and
+       # (2) the word "unknown" tends to confuse beginning users.
+       i*86 | x86_64)
+               cpu=$basic_machine
+               vendor=pc
                ;;
-       spur)
-               basic_machine=spur-unknown
+       # These rules are duplicated from below for sake of the special case above;
+       # i.e. things that normalized to x86 arches should also default to "pc"
+       pc98)
+               cpu=i386
+               vendor=pc
                ;;
-       st2000)
-               basic_machine=m68k-tandem
+       x64 | amd64)
+               cpu=x86_64
+               vendor=pc
                ;;
-       stratus)
-               basic_machine=i860-stratus
-               os=-sysv4
+       # Recognize the basic CPU types without company name.
+       *)
+               cpu=$basic_machine
+               vendor=unknown
                ;;
-       strongarm-* | thumb-*)
-               basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+       # Here we handle the default manufacturer of certain CPU types in cannonical form. It is in
+       # some cases the only manufacturer, in others, it is the most popular.
+       craynv-unknown)
+               vendor=cray
+               os=${os:-unicosmp}
                ;;
-       sun2)
-               basic_machine=m68000-sun
+       c90-unknown | c90-cray)
+               vendor=cray
+               os=${os:-unicos}
                ;;
-       sun2os3)
-               basic_machine=m68000-sun
-               os=-sunos3
+       fx80-unknown)
+               vendor=alliant
                ;;
-       sun2os4)
-               basic_machine=m68000-sun
-               os=-sunos4
+       romp-unknown)
+               vendor=ibm
                ;;
-       sun3os3)
-               basic_machine=m68k-sun
-               os=-sunos3
+       mmix-unknown)
+               vendor=knuth
                ;;
-       sun3os4)
-               basic_machine=m68k-sun
-               os=-sunos4
+       microblaze-unknown | microblazeel-unknown)
+               vendor=xilinx
                ;;
-       sun4os3)
-               basic_machine=sparc-sun
-               os=-sunos3
+       rs6000-unknown)
+               vendor=ibm
                ;;
-       sun4os4)
-               basic_machine=sparc-sun
-               os=-sunos4
+       vax-unknown)
+               vendor=dec
                ;;
-       sun4sol2)
-               basic_machine=sparc-sun
-               os=-solaris2
+       pdp11-unknown)
+               vendor=dec
                ;;
-       sun3 | sun3-*)
-               basic_machine=m68k-sun
+       we32k-unknown)
+               vendor=att
                ;;
-       sun4)
-               basic_machine=sparc-sun
+       cydra-unknown)
+               vendor=cydrome
                ;;
-       sun386 | sun386i | roadrunner)
-               basic_machine=i386-sun
+       i370-ibm*)
+               vendor=ibm
                ;;
-       sv1)
-               basic_machine=sv1-cray
-               os=-unicos
+       orion-unknown)
+               vendor=highlevel
                ;;
-       symmetry)
-               basic_machine=i386-sequent
-               os=-dynix
+       xps-unknown | xps100-unknown)
+               cpu=xps100
+               vendor=honeywell
                ;;
-       t3e)
-               basic_machine=alphaev5-cray
-               os=-unicos
+
+       # Here we normalize CPU types with a missing or matching vendor
+       dpx20-unknown | dpx20-bull)
+               cpu=rs6000
+               vendor=bull
+               os=${os:-bosx}
                ;;
-       t90)
-               basic_machine=t90-cray
-               os=-unicos
+
+       # Here we normalize CPU types irrespective of the vendor
+       amd64-*)
+               cpu=x86_64
                ;;
-       tile*)
-               basic_machine=$basic_machine-unknown
-               os=-linux-gnu
+       blackfin-*)
+               cpu=bfin
+               os=linux
                ;;
-       tx39)
-               basic_machine=mipstx39-unknown
+       c54x-*)
+               cpu=tic54x
                ;;
-       tx39el)
-               basic_machine=mipstx39el-unknown
+       c55x-*)
+               cpu=tic55x
                ;;
-       toad1)
-               basic_machine=pdp10-xkl
-               os=-tops20
+       c6x-*)
+               cpu=tic6x
                ;;
-       tower | tower-32)
-               basic_machine=m68k-ncr
+       e500v[12]-*)
+               cpu=powerpc
+               os=$os"spe"
                ;;
-       tpf)
-               basic_machine=s390x-ibm
-               os=-tpf
+       mips3*-*)
+               cpu=mips64
                ;;
-       udi29k)
-               basic_machine=a29k-amd
-               os=-udi
+       ms1-*)
+               cpu=mt
                ;;
-       ultra3)
-               basic_machine=a29k-nyu
-               os=-sym1
+       m68knommu-*)
+               cpu=m68k
+               os=linux
                ;;
-       v810 | necv810)
-               basic_machine=v810-nec
-               os=-none
+       m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+               cpu=s12z
                ;;
-       vaxv)
-               basic_machine=vax-dec
-               os=-sysv
+       openrisc-*)
+               cpu=or32
                ;;
-       vms)
-               basic_machine=vax-dec
-               os=-vms
+       parisc-*)
+               cpu=hppa
+               os=linux
                ;;
-       vpp*|vx|vx-*)
-               basic_machine=f301-fujitsu
+       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+               cpu=i586
                ;;
-       vxworks960)
-               basic_machine=i960-wrs
-               os=-vxworks
+       pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+               cpu=i686
                ;;
-       vxworks68)
-               basic_machine=m68k-wrs
-               os=-vxworks
+       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+               cpu=i686
                ;;
-       vxworks29k)
-               basic_machine=a29k-wrs
-               os=-vxworks
+       pentium4-*)
+               cpu=i786
                ;;
-       w65*)
-               basic_machine=w65-wdc
-               os=-none
+       pc98-*)
+               cpu=i386
                ;;
-       w89k-*)
-               basic_machine=hppa1.1-winbond
-               os=-proelf
+       ppc-* | ppcbe-*)
+               cpu=powerpc
                ;;
-       xbox)
-               basic_machine=i686-pc
-               os=-mingw32
+       ppcle-* | powerpclittle-*)
+               cpu=powerpcle
                ;;
-       xps | xps100)
-               basic_machine=xps100-honeywell
+       ppc64-*)
+               cpu=powerpc64
                ;;
-       xscale-* | xscalee[bl]-*)
-               basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+       ppc64le-* | powerpc64little-*)
+               cpu=powerpc64le
                ;;
-       ymp)
-               basic_machine=ymp-cray
-               os=-unicos
+       sb1-*)
+               cpu=mipsisa64sb1
                ;;
-       z8k-*-coff)
-               basic_machine=z8k-unknown
-               os=-sim
+       sb1el-*)
+               cpu=mipsisa64sb1el
                ;;
-       z80-*-coff)
-               basic_machine=z80-unknown
-               os=-sim
+       sh5e[lb]-*)
+               cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
                ;;
-       none)
-               basic_machine=none-none
-               os=-none
+       spur-*)
+               cpu=spur
                ;;
-
-# Here we handle the default manufacturer of certain CPU types.  It is in
-# some cases the only manufacturer, in others, it is the most popular.
-       w89k)
-               basic_machine=hppa1.1-winbond
+       strongarm-* | thumb-*)
+               cpu=arm
                ;;
-       op50n)
-               basic_machine=hppa1.1-oki
+       tx39-*)
+               cpu=mipstx39
                ;;
-       op60c)
-               basic_machine=hppa1.1-oki
+       tx39el-*)
+               cpu=mipstx39el
                ;;
-       romp)
-               basic_machine=romp-ibm
+       x64-*)
+               cpu=x86_64
                ;;
-       mmix)
-               basic_machine=mmix-knuth
-               ;;
-       rs6000)
-               basic_machine=rs6000-ibm
+       xscale-* | xscalee[bl]-*)
+               cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
                ;;
-       vax)
-               basic_machine=vax-dec
+
+       # Recognize the cannonical CPU Types that limit and/or modify the
+       # company names they are paired with.
+       cr16-*)
+               os=${os:-elf}
                ;;
-       pdp10)
-               # there are many clones, so DEC is not a safe bet
-               basic_machine=pdp10-unknown
+       crisv32-* | etraxfs*-*)
+               cpu=crisv32
+               vendor=axis
                ;;
-       pdp11)
-               basic_machine=pdp11-dec
+       cris-* | etrax*-*)
+               cpu=cris
+               vendor=axis
                ;;
-       we32k)
-               basic_machine=we32k-att
+       crx-*)
+               os=${os:-elf}
                ;;
-       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
-               basic_machine=sh-unknown
+       neo-tandem)
+               cpu=neo
+               vendor=tandem
                ;;
-       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
-               basic_machine=sparc-sun
+       nse-tandem)
+               cpu=nse
+               vendor=tandem
                ;;
-       cydra)
-               basic_machine=cydra-cydrome
+       nsr-tandem)
+               cpu=nsr
+               vendor=tandem
                ;;
-       orion)
-               basic_machine=orion-highlevel
+       nsv-tandem)
+               cpu=nsv
+               vendor=tandem
                ;;
-       orion105)
-               basic_machine=clipper-highlevel
+       nsx-tandem)
+               cpu=nsx
+               vendor=tandem
                ;;
-       mac | mpw | mac-mpw)
-               basic_machine=m68k-apple
+       s390-*)
+               cpu=s390
+               vendor=ibm
                ;;
-       pmac | pmac-mpw)
-               basic_machine=powerpc-apple
+       s390x-*)
+               cpu=s390x
+               vendor=ibm
                ;;
-       *-unknown)
-               # Make sure to match an already-canonicalized machine name.
+       tile*-*)
+               os=${os:-linux-gnu}
                ;;
+
        *)
-               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-               exit 1
+               # Recognize the cannonical CPU types that are allowed with any
+               # company name.
+               case $cpu in
+                       1750a | 580 \
+                       | a29k \
+                       | aarch64 | aarch64_be \
+                       | abacus \
+                       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+                       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+                       | alphapca5[67] | alpha64pca5[67] \
+                       | am33_2.0 \
+                       | arc | arceb \
+                       | arm  | arm[lb]e | arme[lb] | armv* \
+                       | avr | avr32 \
+                       | asmjs \
+                       | ba \
+                       | be32 | be64 \
+                       | bfin | bs2000 \
+                       | c[123]* | c30 | [cjt]90 | c4x \
+                       | c8051 | clipper | craynv | csky | cydra \
+                       | d10v | d30v | dlx | dsp16xx \
+                       | e2k | elxsi | epiphany \
+                       | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+                       | h8300 | h8500 \
+                       | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+                       | hexagon \
+                       | i370 | i*86 | i860 | i960 | ia16 | ia64 \
+                       | ip2k | iq2000 \
+                       | k1om \
+                       | le32 | le64 \
+                       | lm32 \
+                       | m32c | m32r | m32rle \
+                       | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k | v70 | w65 \
+                       | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \
+                       | m88110 | m88k | maxq | mb | mcore | mep | metag \
+                       | microblaze | microblazeel \
+                       | mips | mipsbe | mipseb | mipsel | mipsle \
+                       | mips16 \
+                       | mips64 | mips64el \
+                       | mips64octeon | mips64octeonel \
+                       | mips64orion | mips64orionel \
+                       | mips64r5900 | mips64r5900el \
+                       | mips64vr | mips64vrel \
+                       | mips64vr4100 | mips64vr4100el \
+                       | mips64vr4300 | mips64vr4300el \
+                       | mips64vr5000 | mips64vr5000el \
+                       | mips64vr5900 | mips64vr5900el \
+                       | mipsisa32 | mipsisa32el \
+                       | mipsisa32r2 | mipsisa32r2el \
+                       | mipsisa32r6 | mipsisa32r6el \
+                       | mipsisa64 | mipsisa64el \
+                       | mipsisa64r2 | mipsisa64r2el \
+                       | mipsisa64r6 | mipsisa64r6el \
+                       | mipsisa64sb1 | mipsisa64sb1el \
+                       | mipsisa64sr71k | mipsisa64sr71kel \
+                       | mipsr5900 | mipsr5900el \
+                       | mipstx39 | mipstx39el \
+                       | mmix \
+                       | mn10200 | mn10300 \
+                       | moxie \
+                       | mt \
+                       | msp430 \
+                       | nds32 | nds32le | nds32be \
+                       | nfp \
+                       | nios | nios2 | nios2eb | nios2el \
+                       | none | np1 | ns16k | ns32k \
+                       | open8 \
+                       | or1k* \
+                       | or32 \
+                       | orion \
+                       | pdp10 | pdp11 | pj | pjl | pn | power \
+                       | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+                       | pru \
+                       | pyramid \
+                       | riscv | riscv32 | riscv64 \
+                       | rl78 | romp | rs6000 | rx \
+                       | score \
+                       | sh | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+                       | sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+                       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+                       | sparclite \
+                       | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+                       | spu \
+                       | tahoe \
+                       | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+                       | tron \
+                       | ubicom32 \
+                       | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+                       | vax \
+                       | visium \
+                       | wasm32 \
+                       | we32k \
+                       | x86 | x86_64 | xc16x | xgate | xps100 \
+                       | xstormy16 | xtensa* \
+                       | ymp \
+                       | z8k | z80)
+                               ;;
+
+                       *)
+                               echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+                               exit 1
+                               ;;
+               esac
                ;;
 esac
 
 # Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
-       *-digital*)
-               basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+case $vendor in
+       digital*)
+               vendor=dec
                ;;
-       *-commodore*)
-               basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+       commodore*)
+               vendor=cbm
                ;;
        *)
                ;;
@@ -1353,200 +1270,246 @@ esac
 
 # Decode manufacturer-specific aliases for certain operating systems.
 
-if [ x"$os" != x"" ]
+if [ x$os != x ]
 then
 case $os in
-       # First match some system type aliases
-       # that might get confused with valid system types.
-       # -solaris* is a basic system type, with this one exception.
-       -auroraux)
-               os=-auroraux
+       # First match some system type aliases that might get confused
+       # with valid system types.
+       # solaris* is a basic system type, with this one exception.
+       auroraux)
+               os=auroraux
                ;;
-       -solaris1 | -solaris1.*)
-               os=`echo $os | sed -e 's|solaris1|sunos4|'`
+       bluegene*)
+               os=cnk
                ;;
-       -solaris)
-               os=-solaris2
+       solaris1 | solaris1.*)
+               os=`echo $os | sed -e 's|solaris1|sunos4|'`
                ;;
-       -svr4*)
-               os=-sysv4
+       solaris)
+               os=solaris2
                ;;
-       -unixware*)
-               os=-sysv4.2uw
+       unixware*)
+               os=sysv4.2uw
                ;;
-       -gnu/linux*)
+       gnu/linux*)
                os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
                ;;
-       # First accept the basic system types.
+       # es1800 is here to avoid being matched by es* (a different OS)
+       es1800*)
+               os=ose
+               ;;
+       # Some version numbers need modification
+       chorusos*)
+               os=chorusos
+               ;;
+       isc)
+               os=isc2.2
+               ;;
+       sco6)
+               os=sco5v6
+               ;;
+       sco5)
+               os=sco3.2v5
+               ;;
+       sco4)
+               os=sco3.2v4
+               ;;
+       sco3.2.[4-9]*)
+               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+               ;;
+       sco3.2v[4-9]* | sco5v6*)
+               # Don't forget version if it is 3.2v4 or newer.
+               ;;
+       scout)
+               # Don't match below
+               ;;
+       sco*)
+               os=sco3.2v2
+               ;;
+       psos*)
+               os=psos
+               ;;
+       # Now accept the basic system types.
        # The portable systems comes first.
-       # Each alternative MUST END IN A *, to match a version number.
-       # -sysv* is not here because it comes later, after sysvr4.
-       -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-             | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
-             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-             | -sym* | -kopensolaris* | -plan9* \
-             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-             | -aos* | -aros* | -cloudabi* | -sortix* \
-             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
-             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-             | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
-             | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
-             | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
-             | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* | -cegcc* \
-             | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
-             | -linux-newlib* | -linux-musl* | -linux-uclibc* \
-             | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
-             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-             | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-             | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-             | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
-             | -onefs* | -tirtos* | -phoenix*)
+       # Each alternative MUST end in a * to match a version number.
+       # sysv* is not here because it comes later, after sysvr4.
+       gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+            | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
+            | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+            | sym* | kopensolaris* | plan9* \
+            | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+            | aos* | aros* | cloudabi* | sortix* \
+            | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+            | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+            | knetbsd* | mirbsd* | netbsd* \
+            | bitrig* | openbsd* | solidbsd* | libertybsd* \
+            | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
+            | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+            | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+            | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
+            | chorusrdb* | cegcc* | glidix* \
+            | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+            | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
+            | linux-newlib* | linux-musl* | linux-uclibc* \
+            | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+            | interix* | uwin* | mks* | rhapsody* | darwin* \
+            | openstep* | oskit* | conix* | pw32* | nonstopux* \
+            | storm-chaos* | tops10* | tenex* | tops20* | its* \
+            | os2* | vos* | palmos* | uclinux* | nucleus* \
+            | morphos* | superux* | rtmk* | windiss* \
+            | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+            | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+            | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+            | midnightbsd*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
-       -qnx*)
-               case $basic_machine in
-                   x86-* | i*86-*)
+       qnx*)
+               case $cpu in
+                   x86 | i*86)
                        ;;
                    *)
-                       os=-nto$os
+                       os=nto-$os
                        ;;
                esac
                ;;
-       -nto-qnx*)
+       hiux*)
+               os=hiuxwe2
                ;;
-       -nto*)
-               os=`echo $os | sed -e 's|nto|nto-qnx|'`
+       nto-qnx*)
                ;;
-       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-             | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
-             | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+       nto*)
+               os=`echo $os | sed -e 's|nto|nto-qnx|'`
                ;;
-       -mac*)
-               os=`echo $os | sed -e 's|mac|macos|'`
+       sim | xray | os68k* | v88r* \
+           | windows* | osx | abug | netware* | os9* \
+           | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
                ;;
-       -linux-dietlibc)
-               os=-linux-dietlibc
+       linux-dietlibc)
+               os=linux-dietlibc
                ;;
-       -linux*)
+       linux*)
                os=`echo $os | sed -e 's|linux|linux-gnu|'`
                ;;
-       -sunos5*)
-               os=`echo $os | sed -e 's|sunos5|solaris2|'`
+       lynx*178)
+               os=lynxos178
                ;;
-       -sunos6*)
-               os=`echo $os | sed -e 's|sunos6|solaris3|'`
+       lynx*5)
+               os=lynxos5
                ;;
-       -opened*)
-               os=-openedition
+       lynx*)
+               os=lynxos
                ;;
-       -os400*)
-               os=-os400
+       mac*)
+               os=`echo "$os" | sed -e 's|mac|macos|'`
                ;;
-       -wince*)
-               os=-wince
+       opened*)
+               os=openedition
                ;;
-       -osfrose*)
-               os=-osfrose
+       os400*)
+               os=os400
                ;;
-       -osf*)
-               os=-osf
+       sunos5*)
+               os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
                ;;
-       -utek*)
-               os=-bsd
+       sunos6*)
+               os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
                ;;
-       -dynix*)
-               os=-bsd
+       wince*)
+               os=wince
                ;;
-       -acis*)
-               os=-aos
+       utek*)
+               os=bsd
                ;;
-       -atheos*)
-               os=-atheos
+       dynix*)
+               os=bsd
                ;;
-       -syllable*)
-               os=-syllable
+       acis*)
+               os=aos
                ;;
-       -386bsd)
-               os=-bsd
+       atheos*)
+               os=atheos
                ;;
-       -ctix* | -uts*)
-               os=-sysv
+       syllable*)
+               os=syllable
                ;;
-       -nova*)
-               os=-rtmk-nova
+       386bsd)
+               os=bsd
+               ;;
+       ctix* | uts*)
+               os=sysv
+               ;;
+       nova*)
+               os=rtmk-nova
                ;;
-       -ns2 )
-               os=-nextstep2
+       ns2)
+               os=nextstep2
                ;;
-       -nsk*)
-               os=-nsk
+       nsk*)
+               os=nsk
                ;;
        # Preserve the version number of sinix5.
-       -sinix5.*)
+       sinix5.*)
                os=`echo $os | sed -e 's|sinix|sysv|'`
                ;;
-       -sinix*)
-               os=-sysv4
+       sinix*)
+               os=sysv4
                ;;
-       -tpf*)
-               os=-tpf
+       tpf*)
+               os=tpf
                ;;
-       -triton*)
-               os=-sysv3
+       triton*)
+               os=sysv3
                ;;
-       -oss*)
-               os=-sysv3
+       oss*)
+               os=sysv3
                ;;
-       -svr4)
-               os=-sysv4
+       svr4*)
+               os=sysv4
                ;;
-       -svr3)
-               os=-sysv3
+       svr3)
+               os=sysv3
                ;;
-       -sysvr4)
-               os=-sysv4
+       sysvr4)
+               os=sysv4
                ;;
-       # This must come after -sysvr4.
-       -sysv*)
+       # This must come after sysvr4.
+       sysv*)
                ;;
-       -ose*)
-               os=-ose
+       ose*)
+               os=ose
                ;;
-       -es1800*)
-               os=-ose
+       *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+               os=mint
                ;;
-       -xenix)
-               os=-xenix
+       zvmoe)
+               os=zvmoe
                ;;
-       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-               os=-mint
+       dicos*)
+               os=dicos
                ;;
-       -aros*)
-               os=-aros
-               ;;
-       -zvmoe)
-               os=-zvmoe
+       pikeos*)
+               # Until real need of OS specific support for
+               # particular features comes up, bare metal
+               # configurations are quite functional.
+               case $cpu in
+                   arm*)
+                       os=eabi
+                       ;;
+                   *)
+                       os=elf
+                       ;;
+               esac
                ;;
-       -dicos*)
-               os=-dicos
+       nacl*)
                ;;
-       -nacl*)
+       ios)
                ;;
-       -ios)
+       none)
                ;;
-       -none)
+       *-eabi)
                ;;
        *)
-               # Get rid of the `-' at the beginning of $os.
-               os=`echo $os | sed 's/[^-]*-//'`
-               echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+               echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
                exit 1
                ;;
 esac
@@ -1562,261 +1525,265 @@ else
 # will signal an error saying that MANUFACTURER isn't an operating
 # system, and we'll never get to this point.
 
-case $basic_machine in
+case $cpu-$vendor in
        score-*)
-               os=-elf
+               os=elf
                ;;
        spu-*)
-               os=-elf
+               os=elf
                ;;
        *-acorn)
-               os=-riscix1.2
+               os=riscix1.2
                ;;
        arm*-rebel)
-               os=-linux
+               os=linux
                ;;
        arm*-semi)
-               os=-aout
+               os=aout
                ;;
        c4x-* | tic4x-*)
-               os=-coff
+               os=coff
                ;;
        c8051-*)
-               os=-elf
+               os=elf
+               ;;
+       clipper-intergraph)
+               os=clix
                ;;
        hexagon-*)
-               os=-elf
+               os=elf
                ;;
        tic54x-*)
-               os=-coff
+               os=coff
                ;;
        tic55x-*)
-               os=-coff
+               os=coff
                ;;
        tic6x-*)
-               os=-coff
+               os=coff
                ;;
        # This must come before the *-dec entry.
        pdp10-*)
-               os=-tops20
+               os=tops20
                ;;
        pdp11-*)
-               os=-none
+               os=none
                ;;
        *-dec | vax-*)
-               os=-ultrix4.2
+               os=ultrix4.2
                ;;
        m68*-apollo)
-               os=-domain
+               os=domain
                ;;
        i386-sun)
-               os=-sunos4.0.2
+               os=sunos4.0.2
                ;;
        m68000-sun)
-               os=-sunos3
+               os=sunos3
                ;;
        m68*-cisco)
-               os=-aout
+               os=aout
                ;;
        mep-*)
-               os=-elf
+               os=elf
                ;;
        mips*-cisco)
-               os=-elf
+               os=elf
                ;;
        mips*-*)
-               os=-elf
+               os=elf
                ;;
        or32-*)
-               os=-coff
+               os=coff
                ;;
        *-tti)  # must be before sparc entry or we get the wrong os.
-               os=-sysv3
+               os=sysv3
                ;;
        sparc-* | *-sun)
-               os=-sunos4.1.1
+               os=sunos4.1.1
                ;;
-       *-be)
-               os=-beos
+       pru-*)
+               os=elf
                ;;
-       *-haiku)
-               os=-haiku
+       *-be)
+               os=beos
                ;;
        *-ibm)
-               os=-aix
+               os=aix
                ;;
        *-knuth)
-               os=-mmixware
+               os=mmixware
                ;;
        *-wec)
-               os=-proelf
+               os=proelf
                ;;
        *-winbond)
-               os=-proelf
+               os=proelf
                ;;
        *-oki)
-               os=-proelf
+               os=proelf
                ;;
        *-hp)
-               os=-hpux
+               os=hpux
                ;;
        *-hitachi)
-               os=-hiux
+               os=hiux
                ;;
        i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-               os=-sysv
+               os=sysv
                ;;
        *-cbm)
-               os=-amigaos
+               os=amigaos
                ;;
        *-dg)
-               os=-dgux
+               os=dgux
                ;;
        *-dolphin)
-               os=-sysv3
+               os=sysv3
                ;;
        m68k-ccur)
-               os=-rtu
+               os=rtu
                ;;
        m88k-omron*)
-               os=-luna
+               os=luna
                ;;
-       *-next )
-               os=-nextstep
+       *-next)
+               os=nextstep
                ;;
        *-sequent)
-               os=-ptx
+               os=ptx
                ;;
        *-crds)
-               os=-unos
+               os=unos
                ;;
        *-ns)
-               os=-genix
+               os=genix
                ;;
        i370-*)
-               os=-mvs
-               ;;
-       *-next)
-               os=-nextstep3
+               os=mvs
                ;;
        *-gould)
-               os=-sysv
+               os=sysv
                ;;
        *-highlevel)
-               os=-bsd
+               os=bsd
                ;;
        *-encore)
-               os=-bsd
+               os=bsd
                ;;
        *-sgi)
-               os=-irix
+               os=irix
                ;;
        *-siemens)
-               os=-sysv4
+               os=sysv4
                ;;
        *-masscomp)
-               os=-rtu
+               os=rtu
                ;;
        f30[01]-fujitsu | f700-fujitsu)
-               os=-uxpv
+               os=uxpv
                ;;
        *-rom68k)
-               os=-coff
+               os=coff
                ;;
        *-*bug)
-               os=-coff
+               os=coff
                ;;
        *-apple)
-               os=-macos
+               os=macos
                ;;
        *-atari*)
-               os=-mint
+               os=mint
+               ;;
+       *-wrs)
+               os=vxworks
                ;;
        *)
-               os=-none
+               os=none
                ;;
 esac
 fi
 
 # Here we handle the case where we know the os, and the CPU type, but not the
 # manufacturer.  We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
-       *-unknown)
+case $vendor in
+       unknown)
                case $os in
-                       -riscix*)
+                       riscix*)
                                vendor=acorn
                                ;;
-                       -sunos*)
+                       sunos*)
                                vendor=sun
                                ;;
-                       -cnk*|-aix*)
+                       cnk*|-aix*)
                                vendor=ibm
                                ;;
-                       -beos*)
+                       beos*)
                                vendor=be
                                ;;
-                       -hpux*)
+                       hpux*)
                                vendor=hp
                                ;;
-                       -mpeix*)
+                       mpeix*)
                                vendor=hp
                                ;;
-                       -hiux*)
+                       hiux*)
                                vendor=hitachi
                                ;;
-                       -unos*)
+                       unos*)
                                vendor=crds
                                ;;
-                       -dgux*)
+                       dgux*)
                                vendor=dg
                                ;;
-                       -luna*)
+                       luna*)
                                vendor=omron
                                ;;
-                       -genix*)
+                       genix*)
                                vendor=ns
                                ;;
-                       -mvs* | -opened*)
+                       clix*)
+                               vendor=intergraph
+                               ;;
+                       mvs* | opened*)
                                vendor=ibm
                                ;;
-                       -os400*)
+                       os400*)
                                vendor=ibm
                                ;;
-                       -ptx*)
+                       ptx*)
                                vendor=sequent
                                ;;
-                       -tpf*)
+                       tpf*)
                                vendor=ibm
                                ;;
-                       -vxsim* | -vxworks* | -windiss*)
+                       vxsim* | vxworks* | windiss*)
                                vendor=wrs
                                ;;
-                       -aux*)
+                       aux*)
                                vendor=apple
                                ;;
-                       -hms*)
+                       hms*)
                                vendor=hitachi
                                ;;
-                       -mpw* | -macos*)
+                       mpw* | macos*)
                                vendor=apple
                                ;;
-                       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+                       *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
                                vendor=atari
                                ;;
-                       -vos*)
+                       vos*)
                                vendor=stratus
                                ;;
                esac
-               basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
                ;;
 esac
 
-echo $basic_machine$os
+echo "$cpu-$vendor-$os"
 exit
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
index 394f82a..35725f4 100644 (file)
@@ -6,6 +6,9 @@
 /* The time this package was configured for a build */
 #undef BUILD_TIMESTAMP
 
+/* Defined to use log_clock timestamps */
+#undef ENABLE_LOG_CLOCK
+
 /* Define to 1 if translation of program messages to the user's native
    language is requested. */
 #undef ENABLE_NLS
    don't. */
 #undef HAVE_DECL_STRERROR_R
 
+/* Define to 1 if you have the <direct.h> header file. */
+#undef HAVE_DIRECT_H
+
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
 /* Define to 1 if you have the `flockfile' function. */
 #undef HAVE_FLOCKFILE
 
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
 /* Defined if a GCC style "__attribute__ ((aligned (n))" is supported */
 #undef HAVE_GCC_ATTRIBUTE_ALIGNED
 
+/* Define to 1 if you have the `getpwnam' function. */
+#undef HAVE_GETPWNAM
+
+/* Define to 1 if you have the `getpwnam_r' function. */
+#undef HAVE_GETPWNAM_R
+
+/* Define to 1 if you have the `getpwuid' function. */
+#undef HAVE_GETPWUID
+
+/* Define to 1 if you have the `getpwuid_r' function. */
+#undef HAVE_GETPWUID_R
+
+/* Define to 1 if you have the `getrlimit' function. */
+#undef HAVE_GETRLIMIT
+
 /* Define if the GNU gettext() function is already present or preinstalled. */
 #undef HAVE_GETTEXT
 
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
-/* Define if you have <langinfo.h> and nl_langinfo(THOUSANDS_SEP). */
-#undef HAVE_LANGINFO_THOUSANDS_SEP
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
+
+/* Define if you have <langinfo.h> and nl_langinfo(THOUSEP). */
+#undef HAVE_LANGINFO_THOUSEP
+
+/* Define to 1 if you have a fully functional readline library. */
+#undef HAVE_LIBREADLINE
 
 /* Define to 1 if you have the <locale.h> header file. */
 #undef HAVE_LOCALE_H
 /* Define to 1 if you have the `memrchr' function. */
 #undef HAVE_MEMRCHR
 
+/* Define to 1 if you have the `mmap' function. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the <poll.h> header file. */
+#undef HAVE_POLL_H
+
+/* Define if you have the <pthread.h> header and the POSIX threads API. */
+#undef HAVE_PTHREAD_API
+
 /* Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE. */
 #undef HAVE_PTHREAD_MUTEX_RECURSIVE
 
 /* Define to 1 if the system has the type `ptrdiff_t'. */
 #undef HAVE_PTRDIFF_T
 
+/* Define to 1 if you have the <pwd.h> header file. */
+#undef HAVE_PWD_H
+
+/* Define to 1 if you have the `rand' function. */
+#undef HAVE_RAND
+
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
+
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* Define to 1 if you have the `stat' function. */
+#undef HAVE_STAT
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
 /* Define to 1 if you have the <stdlib.h> header file. */
 #undef HAVE_STDLIB_H
 
+/* Define to 1 if you have the `stpcpy' function. */
+#undef HAVE_STPCPY
+
 /* Define to 1 if you have the `strerror_r' function. */
 #undef HAVE_STRERROR_R
 
 /* Define to 1 if you have the <string.h> header file. */
 #undef HAVE_STRING_H
 
+/* Define to 1 if you have the `strlwr' function. */
+#undef HAVE_STRLWR
+
 /* Define to 1 if you have the <sys/select.h> header file. */
 #undef HAVE_SYS_SELECT_H
 
+/* Define to 1 if you have the <sys/single_threaded.h> header file. */
+#undef HAVE_SYS_SINGLE_THREADED_H
+
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* Define to 1 if you have the `thrd_create' function. */
+#undef HAVE_THRD_CREATE
+
+/* Define to 1 if you have the <threads.h> header file. */
+#undef HAVE_THREADS_H
+
 /* Define to 1 if the system has the type `uintmax_t'. */
 #undef HAVE_UINTMAX_T
 
 /* Define to 1 if you have the `vasprintf' function. */
 #undef HAVE_VASPRINTF
 
+/* Define to 1 if you have the `vfork' function. */
+#undef HAVE_VFORK
+
+/* Define to 1 if you have the <vfork.h> header file. */
+#undef HAVE_VFORK_H
+
 /* Defined if we run on WindowsCE */
 #undef HAVE_W32CE_SYSTEM
 
 /* Defined if we run on 64 bit W32 API system */
 #undef HAVE_W64_SYSTEM
 
+/* Define to 1 if the compiler and linker support weak declarations of
+   symbols. */
+#undef HAVE_WEAK_SYMBOLS
+
+/* Define to 1 if `fork' works. */
+#undef HAVE_WORKING_FORK
+
+/* Define to 1 if `vfork' works. */
+#undef HAVE_WORKING_VFORK
+
 /* The host triplet */
 #undef HOST_TRIPLET_STRING
 
    */
 #undef LT_OBJDIR
 
+/* Defined if mkdir() does not take permission flags */
+#undef MKDIR_TAKES_ONE_ARG
+
 /* Name of package */
 #undef PACKAGE
 
 /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
 #undef TIME_WITH_SYS_TIME
 
+/* Define if the combination of the ISO C and POSIX multithreading APIs can be
+   used. */
+#undef USE_ISOC_AND_POSIX_THREADS
+
+/* Define if the ISO C multithreading library can be used. */
+#undef USE_ISOC_THREADS
+
 /* Define if the POSIX multithreading library can be used. */
 #undef USE_POSIX_THREADS
 
+/* Define if references to the POSIX multithreading library are satisfied by
+   libc. */
+#undef USE_POSIX_THREADS_FROM_LIBC
+
 /* Define if references to the POSIX multithreading library should be made
    weak. */
 #undef USE_POSIX_THREADS_WEAK
 
-/* Define if the old Solaris multithreading library can be used. */
-#undef USE_SOLARIS_THREADS
-
-/* Define if references to the old Solaris multithreading library should be
-   made weak. */
-#undef USE_SOLARIS_THREADS_WEAK
-
 /* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 /* Version number of package */
 #undef VERSION
 
+/* Expose all libc features (__DARWIN_C_FULL). */
+#undef _DARWIN_C_SOURCE
+
 /* Enable large inode numbers on Mac OS X 10.5.  */
 #ifndef _DARWIN_USE_64_BIT_INODE
 # define _DARWIN_USE_64_BIT_INODE 1
    not define. */
 #undef intmax_t
 
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
 /* Define to the widest unsigned integer type if <stdint.h> and <inttypes.h>
    do not define. */
 #undef uintmax_t
 
+/* Define as `fork' if `vfork' does not work. */
+#undef vfork
+
 
 /* Force using of NLS for W32 even if no libintl has been found.  This is
    okay because we have our own gettext implementation for W32.  */
 #define GPG_ERR_ENABLE_GETTEXT_MACROS 1
 #define GPG_ERR_ENABLE_ERRNO_MACROS 1
 #define GPGRT_ENABLE_ES_MACROS 1
+#define GPGRT_ENABLE_LOG_MACROS 1
+#define GPGRT_ENABLE_ARGPARSE_MACROS 1
 
index ac8ba25..f2908f5 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libgpg-error 1.27.
+# Generated by GNU Autoconf 2.69 for libgpg-error 1.43.
 #
 # Report bugs to <https://bugs.gnupg.org>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='libgpg-error'
 PACKAGE_TARNAME='libgpg-error'
-PACKAGE_VERSION='1.27'
-PACKAGE_STRING='libgpg-error 1.27'
+PACKAGE_VERSION='1.43'
+PACKAGE_STRING='libgpg-error 1.43'
 PACKAGE_BUGREPORT='https://bugs.gnupg.org'
 PACKAGE_URL=''
 
@@ -633,7 +633,9 @@ ac_includes_default="\
 #endif"
 
 gl_use_threads_default=
+gl_use_winpthreads_default=
 gt_needs=
+ac_header_list=
 ac_subst_vars='am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
@@ -648,6 +650,10 @@ BUILD_TIMESTAMP
 BUILD_FILEVERSION
 BUILD_VERSION
 BUILD_REVISION
+BUILD_GPGSCM_FALSE
+BUILD_GPGSCM_TRUE
+HAVE_GENERATED_LOCK_OBJ_H_FALSE
+HAVE_GENERATED_LOCK_OBJ_H_TRUE
 FORCE_USE_SYSCFG_FALSE
 FORCE_USE_SYSCFG_TRUE
 CROSS_COMPILING_FALSE
@@ -659,18 +665,24 @@ HAVE_W64_SYSTEM_TRUE
 HAVE_W32_SYSTEM_FALSE
 HAVE_W32_SYSTEM_TRUE
 GPG_ERROR_CONFIG_HOST
-GPG_ERROR_CONFIG_ISUBDIRAFTER
+GPG_ERROR_CONFIG_LIBS_PRIVATE
 GPG_ERROR_CONFIG_MT_CFLAGS
 GPG_ERROR_CONFIG_MT_LIBS
 GPG_ERROR_CONFIG_CFLAGS
 GPG_ERROR_CONFIG_LIBS
+LIBREADLINE
+LIB_NETWORK
+LIBSTDTHREAD
 LIB_SCHED_YIELD
+LIBPMULTITHREAD
+LIBPTHREAD
 LTLIBMULTITHREAD
 LIBMULTITHREAD
 LTLIBTHREAD
 LIBTHREAD
 HAVE_LD_VERSION_SCRIPT_FALSE
 HAVE_LD_VERSION_SCRIPT_TRUE
+INSTALLSHELLPATH
 POSUB
 LTLIBINTL
 LIBINTL
@@ -688,6 +700,7 @@ GMSGFMT
 MSGFMT
 GETTEXT_MACRO_VERSION
 USE_NLS
+EXEEXT_FOR_BUILD
 CC_FOR_BUILD
 RC
 OTOOL64
@@ -709,6 +722,7 @@ LIBTOOL
 OBJDUMP
 DLLTOOL
 AS
+LDADD_FOR_TESTS_KLUDGE
 EGREP
 GREP
 AR
@@ -720,7 +734,6 @@ am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
-am__quote
 am__include
 DEPDIR
 OBJEXT
@@ -791,6 +804,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -809,7 +823,8 @@ PACKAGE_VERSION
 PACKAGE_TARNAME
 PACKAGE_NAME
 PATH_SEPARATOR
-SHELL'
+SHELL
+am__quote'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
@@ -830,6 +845,9 @@ enable_rpath
 with_libiconv_prefix
 with_libintl_prefix
 enable_ld_version_script
+with_readline
+enable_log_clock
+enable_werror
 enable_build_timestamp
 enable_languages
 enable_doc
@@ -843,8 +861,7 @@ CFLAGS
 LDFLAGS
 LIBS
 CPPFLAGS
-CPP
-CC_FOR_BUILD'
+CPP'
 
 
 # Initialize some variables set by options.
@@ -883,6 +900,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1135,6 +1153,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1272,7 +1299,7 @@ fi
 for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
                datadir sysconfdir sharedstatedir localstatedir includedir \
                oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-               libdir localedir mandir
+               libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1385,7 +1412,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libgpg-error 1.27 to adapt to many kinds of systems.
+\`configure' configures libgpg-error 1.43 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1425,6 +1452,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -1455,7 +1483,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libgpg-error 1.27:";;
+     short | recursive ) echo "Configuration of libgpg-error 1.43:";;
    esac
   cat <<\_ACEOF
 
@@ -1472,7 +1500,7 @@ Optional Features:
                           do not reject slow dependency extractors
   --disable-dependency-tracking
                           speeds up one-time build
-  --enable-threads={posix|solaris|windows}
+  --enable-threads={isoc|posix|isoc+posix|windows}
                           specify multithreading API
   --disable-threads       build without multithread safety
   --disable-largefile     omit support for large files
@@ -1486,6 +1514,8 @@ Optional Features:
   --enable-ld-version-script
                           enable/disable use of linker version script.
                           (default is system dependent)
+  --enable-log-clock      enable log_clock timestamps
+  --enable-werror         append -Werror to CFLAGS
   --enable-build-timestamp
                           set an explicit build timestamp for reproducibility.
                           (default is the current time in ISO-8601 format)
@@ -1506,6 +1536,7 @@ Optional Packages:
   --without-libiconv-prefix     don't search for libiconv in includedir and libdir
   --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
   --without-libintl-prefix     don't search for libintl in includedir and libdir
+  --with-readline=DIR     look for the readline library in DIR
 
 Some influential environment variables:
   CC          C compiler command
@@ -1516,8 +1547,6 @@ Some influential environment variables:
   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
-  CC_FOR_BUILD
-              build system C compiler
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1585,7 +1614,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libgpg-error configure 1.27
+libgpg-error configure 1.43
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1997,6 +2026,60 @@ $as_echo "$ac_res" >&6; }
 
 } # ac_fn_c_check_decl
 
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+        return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+           return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
 # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
 # --------------------------------------------
 # Tries to find the compile-time value of EXPR in a program that includes
@@ -2179,65 +2262,11 @@ rm -f conftest.val
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_compute_int
-
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=no"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof ($2))
-        return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
-           return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  eval "$3=yes"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_type
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libgpg-error $as_me 1.27, which was
+It was created by libgpg-error $as_me 1.43, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2518,6 +2547,7 @@ $as_echo "$as_me: creating cache $cache_file" >&6;}
 fi
 
 gt_needs="$gt_needs "
+as_fn_append ac_header_list " threads.h"
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
@@ -2592,16 +2622,16 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 #   (Interfaces added:                 AGE++)
 #   (Interfaces removed:               AGE=0)
 # Note that added error codes don't constitute an interface change.
-LIBGPG_ERROR_LT_CURRENT=22
-LIBGPG_ERROR_LT_AGE=22
-LIBGPG_ERROR_LT_REVISION=0
+LIBGPG_ERROR_LT_CURRENT=32
+LIBGPG_ERROR_LT_AGE=32
+LIBGPG_ERROR_LT_REVISION=1
 ################################################
 
 
 
 
 
-VERSION_NUMBER=0x011b00
+VERSION_NUMBER=0x012b00
 
 
 ac_aux_dir=
@@ -2633,7 +2663,7 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
-am__api_version='1.14'
+am__api_version='1.16'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -2809,12 +2839,7 @@ program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 if test x"${MISSING+set}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\    *)
-    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
-  *)
-    MISSING="\${SHELL} $am_aux_dir/missing" ;;
-  esac
+  MISSING="\${SHELL} '$am_aux_dir/missing'"
 fi
 # Use eval to expand $SHELL
 if eval "$MISSING --is-lightweight"; then
@@ -2825,7 +2850,7 @@ else
 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
   case $am_aux_dir in
   *\ * | *\    *)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -3119,7 +3144,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='libgpg-error'
- VERSION='1.27'
+ VERSION='1.43'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3149,12 +3174,12 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 # For better backward compatibility.  To be removed once Automake 1.9.x
 # dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 mkdir_p='$(MKDIR_P)'
 
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
 # Always define AMTAR for backward compatibility.  Yes, it's still used
 # in the wild :-(  We should find a proper way to deprecate it ...
 AMTAR='$${TAR-tar}'
@@ -3201,7 +3226,7 @@ END
 Aborting the configuration process, to ensure you take notice of the issue.
 
 You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
 
 If you want to complete the configuration process using your problematic
 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -4228,45 +4253,45 @@ DEPDIR="${am__leading_dot}deps"
 
 ac_config_commands="$ac_config_commands depfiles"
 
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
 am__doit:
-       @echo this is the am__doit target
+       @echo this is the am__doit target >confinc.out
 .PHONY: am__doit
 END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
 am__include="#"
 am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+   (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }
+  case $?:`cat confinc.out 2>/dev/null` in #(
+  '0:this is the am__doit target') :
+    case $s in #(
+  BSD) :
+    am__include='.include' am__quote='"' ;; #(
+  *) :
+    am__include='include' am__quote='' ;;
+esac ;; #(
+  *) :
      ;;
-   esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
+esac
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+$as_echo "${_am_result}" >&6; }
 
 # Check whether --enable-dependency-tracking was given.
 if test "${enable_dependency_tracking+set}" = set; then :
@@ -5012,7 +5037,73 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
 
 
 
-# Set some internal variables depending on the platform for later use.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
+$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
+if ${am_cv_langinfo_codeset+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <langinfo.h>
+int
+main ()
+{
+char* cs = nl_langinfo(CODESET);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  am_cv_langinfo_codeset=yes
+else
+  am_cv_langinfo_codeset=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
+$as_echo "$am_cv_langinfo_codeset" >&6; }
+  if test $am_cv_langinfo_codeset = yes; then
+
+$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
+
+  fi
+
+
+# Taken from mpfr-4.0.1, then modified for LDADD_FOR_TESTS_KLUDGE
+case $host in
+  *-*-linux*)
+    if test -n "$LD_LIBRARY_PATH"; then
+      saved_LDFLAGS="$LDFLAGS"
+      LDADD_FOR_TESTS_KLUDGE="-Wl,--disable-new-dtags"
+      LDFLAGS="$LDFLAGS $LDADD_FOR_TESTS_KLUDGE"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --disable-new-dtags is supported by the linker" >&5
+$as_echo_n "checking whether --disable-new-dtags is supported by the linker... " >&6; }
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int main (void) { return 0; }
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (use it since LD_LIBRARY_PATH is set)" >&5
+$as_echo "yes (use it since LD_LIBRARY_PATH is set)" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       LDADD_FOR_TESTS_KLUDGE=""
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+      LDFLAGS="$saved_LDFLAGS"
+    fi
+    ;;
+esac
+
+
+# Set some variables depending on the platform for later use.
 have_w32_system=no
 have_w64_system=no
 have_w32ce_system=no
@@ -5028,6 +5119,13 @@ case "${host}" in
     *-mingw32*)
         have_w32_system=yes
         ;;
+    *-apple-darwin*)
+        # This is the equivalent of the _GNU_SOURCE feature-test-macro
+        # on GNU libc systems.
+
+$as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h
+
+        ;;
     *)
        ;;
 esac
@@ -5040,6 +5138,7 @@ if test "$have_w32_system" != yes; then
 
     THREADLIB_CPPFLAGS=""
 
+
   # Check whether --enable-threads was given.
 if test "${enable_threads+set}" = set; then :
   enableval=$enable_threads; gl_use_threads=$enableval
@@ -5048,21 +5147,34 @@ else
        gl_use_threads="$gl_use_threads_default"
      else
        case "$host_os" in
-                                                               osf*) gl_use_threads=no ;;
-         cygwin*)
+                                    osf*) gl_use_threads=no ;;
+                                    cygwin*)
                case `uname -r` in
                  1.[0-5].*) gl_use_threads=no ;;
                  *)         gl_use_threads=yes ;;
                esac
                ;;
+                  mingw*)
+               case "$gl_use_winpthreads_default" in
+                 yes) gl_use_threads=posix ;;
+                 no)  gl_use_threads=windows ;;
+                 *)   gl_use_threads=yes ;;
+               esac
+               ;;
          *)    gl_use_threads=yes ;;
        esac
      fi
 
 fi
 
-  if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
-    # For using <pthread.h>:
+  if test "$gl_use_threads" = yes \
+     || test "$gl_use_threads" = isoc \
+     || test "$gl_use_threads" = posix \
+     || test "$gl_use_threads" = isoc+posix; then
+    # For using <threads.h> or <pthread.h>:
+
+
+  if test -z "$gl_anythreadlib_early_done"; then
     case "$host_os" in
       osf*)
         # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
@@ -5078,16 +5190,15 @@ fi
     # need special flags to disable these optimizations. For example, the
     # definition of 'errno' in <errno.h>.
     case "$host_os" in
-      aix* | freebsd*)
-           THREADLIB_CPPFLAGS="$THREADLIB_CPPFLAGS -D_THREAD_SAFE"
-           ;;
-      solaris*)
-           THREADLIB_CPPFLAGS="$THREADLIB_CPPFLAGS -D_REENTRANT"
-           ;;
+      aix* | freebsd*) THREADLIB_CPPFLAGS="$THREADLIB_CPPFLAGS -D_THREAD_SAFE" ;;
+      solaris*) THREADLIB_CPPFLAGS="$THREADLIB_CPPFLAGS -D_REENTRANT" ;;
     esac
+    gl_anythreadlib_early_done=done
   fi
   if test x"$THREADLIB_CPPFLAGS" != x ; then
-      CPPFLAGS="$CPPFLAGS $THREADLIB_CPPFLAGS"
+    CPPFLAGS="$CPPFLAGS $THREADLIB_CPPFLAGS"
+  fi
+
   fi
 
 
@@ -8364,16 +8475,11 @@ $as_echo "$lt_cv_ld_force_load" >&6; }
       _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
     darwin1.*)
       _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    darwin*) # darwin 5.x on
-      # if running on 10.5 or later, the deployment target defaults
-      # to the OS version, if on x86, and 10.4, the deployment
-      # target defaults to 10.4. Don't you love it?
-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-       10.0,*86*-darwin8*|10.0,*-darwin[91]*)
-         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-       10.[012]*)
+    darwin*)
+      case ${MACOSX_DEPLOYMENT_TARGET},$host in
+       10.[012]*,*|,*powerpc*)
          _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-       10.*)
+       *)
          _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
@@ -12928,16 +13034,42 @@ CFLAGS=$lt_save_CFLAGS
 
 
 # We need to compile and run a program on the build machine.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cc for build" >&5
-$as_echo_n "checking for cc for build... " >&6; }
-if test "$cross_compiling" = "yes"; then
-  CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
-else
-  CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
+# Put a plausible default for CC_FOR_BUILD in Makefile.
+if test -z "$CC_FOR_BUILD"; then
+  if test "x$cross_compiling" = "xno"; then
+    CC_FOR_BUILD='$(CC)'
+  else
+    CC_FOR_BUILD=gcc
+  fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5
-$as_echo "$CC_FOR_BUILD" >&6; }
 
+# Also set EXEEXT_FOR_BUILD.
+if test "x$cross_compiling" = "xno"; then
+  EXEEXT_FOR_BUILD='$(EXEEXT)'
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for build system executable suffix" >&5
+$as_echo_n "checking for build system executable suffix... " >&6; }
+if ${bfd_cv_build_exeext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -f conftest*
+     echo 'int main () { return 0; }' > conftest.c
+     bfd_cv_build_exeext=
+     ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
+     for file in conftest.*; do
+       case $file in
+       *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+       *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
+       esac
+     done
+     rm -f conftest*
+     test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_build_exeext" >&5
+$as_echo "$bfd_cv_build_exeext" >&6; }
+  EXEEXT_FOR_BUILD=""
+  test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
+fi
 
 
 
@@ -14212,36 +14344,42 @@ else
       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
-
+      am_cv_func_iconv_works=no
+      for ac_iconv_const in '' 'const'; do
+        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 ()
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+
+int
+main ()
 {
-  int result = 0;
+int result = 0;
   /* 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 */
+        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
         char buf[10];
-        const char *inptr = input;
+        ICONV_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,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
           result |= 1;
@@ -14254,14 +14392,14 @@ int main ()
     iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
     if (cd_ascii_to_88591 != (iconv_t)(-1))
       {
-        static const char input[] = "\263";
+        static ICONV_CONST char input[] = "\263";
         char buf[10];
-        const char *inptr = input;
+        ICONV_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,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
           result |= 2;
@@ -14273,14 +14411,14 @@ int main ()
     iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
     if (cd_88591_to_utf8 != (iconv_t)(-1))
       {
-        static const char input[] = "\304";
+        static ICONV_CONST char input[] = "\304";
         static char buf[2] = { (char)0xDE, (char)0xAD };
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = 1;
         char *outptr = buf;
         size_t outbytesleft = 1;
         size_t res = iconv (cd_88591_to_utf8,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
           result |= 4;
@@ -14293,14 +14431,14 @@ int main ()
     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";
+        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
         char buf[50];
-        const char *inptr = input;
+        ICONV_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,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if ((int)res > 0)
           result |= 8;
@@ -14310,27 +14448,42 @@ int main ()
 #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))
-    result |= 16;
+  {
+    /* Try standardized names.  */
+    iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+    /* Try IRIX, OSF/1 names.  */
+    iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+    /* Try AIX names.  */
+    iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+    /* Try HP-UX names.  */
+    iconv_t cd4 = iconv_open ("utf8", "eucJP");
+    if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+        && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+      result |= 16;
+    if (cd1 != (iconv_t)(-1))
+      iconv_close (cd1);
+    if (cd2 != (iconv_t)(-1))
+      iconv_close (cd2);
+    if (cd3 != (iconv_t)(-1))
+      iconv_close (cd3);
+    if (cd4 != (iconv_t)(-1))
+      iconv_close (cd4);
+  }
   return result;
+
+  ;
+  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
 
+        test "$am_cv_func_iconv_works" = no || break
+      done
       LIBS="$am_save_LIBS"
 
 fi
@@ -15122,7 +15275,8 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
 fi
 
-for ac_header in stdlib.h locale.h stdint.h sys/select.h sys/time.h
+for ac_header in locale.h stdint.h sys/select.h sys/time.h \
+                  signal.h poll.h pwd.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"
@@ -15135,6 +15289,7 @@ fi
 
 done
 
+
 ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
 if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
   ac_have_decl=1
@@ -15228,11 +15383,21 @@ $as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
 fi
 
 case "${host_os}" in
+     mingw32*)
+     INSTALLSHELLPATH=/bin/sh
+     ac_fn_c_check_func "$LINENO" "strerror_s" "ac_cv_func_strerror_s"
+if test "x$ac_cv_func_strerror_s" = xyes; then :
+
+fi
+
+     ;;
      solaris*)
+     INSTALLSHELLPATH=/usr/xpg4/bin/sh
      # All versions of Solaris from 2.4 have a thread-safe strerror().
      # Since Solaris 10, in addition strerror_r() exists.
      ;;
      *)
+     INSTALLSHELLPATH=/bin/sh
      ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
 if test "x$ac_cv_func_strerror_r" = xyes; then :
 
      ;;
 esac
 
-for ac_func in flockfile vasprintf
+
+ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
+if test "x$ac_cv_type_pid_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+for ac_header in vfork.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
+if test "x$ac_cv_header_vfork_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_VFORK_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_func in fork vfork
 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"
@@ -15256,28 +15445,230 @@ _ACEOF
 fi
 done
 
-
-
-#
-# Checks for typedefs, structures, and compiler characteristics.
-#
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
+if test "x$ac_cv_func_fork" = xyes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
+$as_echo_n "checking for working fork... " >&6; }
+if ${ac_cv_func_fork_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_fork_works=cross
+else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
+$ac_includes_default
 int
 main ()
 {
 
-#ifndef __cplusplus
-  /* Ultrix mips cc rejects this sort of thing.  */
-  typedef int charset[2];
-  const charset cs = { 0, 0 };
-  /* SunOS 4.1.1 cc rejects this.  */
+         /* By Ruediger Kuhlmann. */
+         return fork () < 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_fork_works=yes
+else
+  ac_cv_func_fork_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
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
+$as_echo "$ac_cv_func_fork_works" >&6; }
+
+else
+  ac_cv_func_fork_works=$ac_cv_func_fork
+fi
+if test "x$ac_cv_func_fork_works" = xcross; then
+  case $host in
+    *-*-amigaos* | *-*-msdosdjgpp*)
+      # Override, as these systems have only a dummy fork() stub
+      ac_cv_func_fork_works=no
+      ;;
+    *)
+      ac_cv_func_fork_works=yes
+      ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
+$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
+fi
+ac_cv_func_vfork_works=$ac_cv_func_vfork
+if test "x$ac_cv_func_vfork" = xyes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
+$as_echo_n "checking for working vfork... " >&6; }
+if ${ac_cv_func_vfork_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_vfork_works=cross
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Thanks to Paul Eggert for this test.  */
+$ac_includes_default
+#include <sys/wait.h>
+#ifdef HAVE_VFORK_H
+# include <vfork.h>
+#endif
+/* On some sparc systems, changes by the child to local and incoming
+   argument registers are propagated back to the parent.  The compiler
+   is told about this with #include <vfork.h>, but some compilers
+   (e.g. gcc -O) don't grok <vfork.h>.  Test for this by using a
+   static variable whose address is put into a register that is
+   clobbered by the vfork.  */
+static void
+#ifdef __cplusplus
+sparc_address_test (int arg)
+# else
+sparc_address_test (arg) int arg;
+#endif
+{
+  static pid_t child;
+  if (!child) {
+    child = vfork ();
+    if (child < 0) {
+      perror ("vfork");
+      _exit(2);
+    }
+    if (!child) {
+      arg = getpid();
+      write(-1, "", 0);
+      _exit (arg);
+    }
+  }
+}
+
+int
+main ()
+{
+  pid_t parent = getpid ();
+  pid_t child;
+
+  sparc_address_test (0);
+
+  child = vfork ();
+
+  if (child == 0) {
+    /* Here is another test for sparc vfork register problems.  This
+       test uses lots of local variables, at least as many local
+       variables as main has allocated so far including compiler
+       temporaries.  4 locals are enough for gcc 1.40.3 on a Solaris
+       4.1.3 sparc, but we use 8 to be safe.  A buggy compiler should
+       reuse the register of parent for one of the local variables,
+       since it will think that parent can't possibly be used any more
+       in this routine.  Assigning to the local variable will thus
+       munge parent in the parent process.  */
+    pid_t
+      p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
+      p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
+    /* Convince the compiler that p..p7 are live; otherwise, it might
+       use the same hardware register for all 8 local variables.  */
+    if (p != p1 || p != p2 || p != p3 || p != p4
+       || p != p5 || p != p6 || p != p7)
+      _exit(1);
+
+    /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
+       from child file descriptors.  If the child closes a descriptor
+       before it execs or exits, this munges the parent's descriptor
+       as well.  Test for this by closing stdout in the child.  */
+    _exit(close(fileno(stdout)) != 0);
+  } else {
+    int status;
+    struct stat st;
+
+    while (wait(&status) != child)
+      ;
+    return (
+        /* Was there some problem with vforking?  */
+        child < 0
+
+        /* Did the child fail?  (This shouldn't happen.)  */
+        || status
+
+        /* Did the vfork/compiler bug occur?  */
+        || parent != getpid()
+
+        /* Did the file descriptor bug occur?  */
+        || fstat(fileno(stdout), &st) != 0
+        );
+  }
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_vfork_works=yes
+else
+  ac_cv_func_vfork_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
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
+$as_echo "$ac_cv_func_vfork_works" >&6; }
+
+fi;
+if test "x$ac_cv_func_fork_works" = xcross; then
+  ac_cv_func_vfork_works=$ac_cv_func_vfork
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
+$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
+fi
+
+if test "x$ac_cv_func_vfork_works" = xyes; then
+
+$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h
+
+else
+
+$as_echo "#define vfork fork" >>confdefs.h
+
+fi
+if test "x$ac_cv_func_fork_works" = xyes; then
+
+$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
+
+fi
+
+for ac_func in flockfile vasprintf mmap rand strlwr stpcpy setenv stat \
+                getrlimit getpwnam getpwuid getpwnam_r getpwuid_r
+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"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+#
+# Checks for typedefs, structures, and compiler characteristics.
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this sort of thing.  */
+  typedef int charset[2];
+  const charset cs = { 0, 0 };
+  /* SunOS 4.1.1 cc rejects this.  */
   char const *const *pcpcc;
   char **ppc;
   /* NEC SVR4.0.2 mips cc rejects this.  */
@@ -15524,6 +15915,62 @@ _ACEOF
 
 
 
+for ac_header in sys/stat.h unistd.h direct.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"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if mkdir takes one argument" >&5
+$as_echo_n "checking if mkdir takes one argument... " >&6; }
+if ${gnupg_cv_mkdir_takes_one_arg+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_DIRECT_H
+# include <direct.h>
+#endif
+int
+main ()
+{
+mkdir ("foo", 0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gnupg_cv_mkdir_takes_one_arg=no
+else
+  gnupg_cv_mkdir_takes_one_arg=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnupg_cv_mkdir_takes_one_arg" >&5
+$as_echo "$gnupg_cv_mkdir_takes_one_arg" >&6; }
+if test $gnupg_cv_mkdir_takes_one_arg = yes ; then
+
+$as_echo "#define MKDIR_TAKES_ONE_ARG 1" >>confdefs.h
+
+fi
+
+
+
 # Find a 64 bit integer type to be used instead of off_t.  We prefer
 # the standard integer types over int64_t and finally try long long.
 if test "$ac_cv_sizeof_int" = "8"; then
@@ -15547,7 +15994,6 @@ _ACEOF
 
 
 
-
 #
 # Setup gcc specific options
 #
@@ -15585,8 +16031,8 @@ $as_echo "$_gcc_silent_wno" >&6; }
     # warning options and the user should have a chance of overriding
     # them.
     if test "$USE_MAINTAINER_MODE" = "yes"; then
-        CFLAGS="$CFLAGS -O3 -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
-        CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
+        M_CFLAGS="-O3 -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
+        M_CFLAGS="$M_CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
         if test x"$_gcc_silent_wno" = xyes ; then
           _gcc_wopt=yes
         else
@@ -15616,7 +16062,7 @@ $as_echo "$_gcc_wopt" >&6; }
           CFLAGS=$_gcc_cflags_save;
         fi
         if test x"$_gcc_wopt" = xyes ; then
-          CFLAGS="$CFLAGS -W -Wno-sign-compare -Wno-missing-field-initializers"
+          M_CFLAGS="$M_CFLAGS -W -Wno-sign-compare -Wno-missing-field-initializers"
         fi
 
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wdeclaration-after-statement" >&5
@@ -15644,8 +16090,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 $as_echo "$_gcc_wopt" >&6; }
         CFLAGS=$_gcc_cflags_save;
         if test x"$_gcc_wopt" = xyes ; then
-          CFLAGS="$CFLAGS -Wdeclaration-after-statement"
+          M_CFLAGS="$M_CFLAGS -Wdeclaration-after-statement"
         fi
+
+       # Prepend the maintainer-cflags so that the user can override
+       # them, e.g. to override the optimization flags for debugging.
+       CFLAGS="$M_CFLAGS $CFLAGS"
     else
         CFLAGS="$CFLAGS -Wall"
     fi
@@ -15876,6 +16326,7 @@ fi
 # Windows has always thread support; thus we don't bother to test for
 # it as it may lead to false results when cross building.
 if test "$have_w32_system" = yes; then
+  GPG_ERROR_CONFIG_LIBS_PRIVATE=-lws2_32
   $as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h
 
   LIBTHREAD=
@@ -15888,6 +16339,26 @@ if test "$have_w32_system" = yes; then
 
 
 else
+  GPG_ERROR_CONFIG_LIBS_PRIVATE=""
+
+
+
+  for ac_header in $ac_header_list
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
 
 
   gl_threads_api=none
@@ -15896,13 +16367,15 @@ else
   LIBMULTITHREAD=
   LTLIBMULTITHREAD=
   if test "$gl_use_threads" != no; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
 $as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
 if ${gl_cv_have_weak+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   gl_cv_have_weak=no
-              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 extern void xyzzy ();
 #pragma weak xyzzy
@@ -15919,13 +16392,13 @@ if ac_fn_c_try_link "$LINENO"; then :
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-       if test $gl_cv_have_weak = maybe; then
-                           if test "$cross_compiling" = yes; then :
-                          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+     if test $gl_cv_have_weak = maybe; then
+                     if test "$cross_compiling" = yes; then :
+                      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __ELF__
-               Extensible Linking Format
-               #endif
+             Extensible Linking Format
+             #endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
@@ -15957,15 +16430,63 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-       fi
+     fi
+          case " $LDFLAGS " in
+       *" -static "*) gl_cv_have_weak=no ;;
+     esac
+                    case "$gl_cv_have_weak" in
+       *yes)
+         case "$host_os" in
+           freebsd* | dragonfly* | midnightbsd*)
+             : > conftest1.c
+             $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
+             cat <<EOF > conftest2.c
+#include <pthread.h>
+#pragma weak pthread_mutexattr_gettype
+int main ()
+{
+  return (pthread_mutexattr_gettype != NULL);
+}
+EOF
+             $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
+               || gl_cv_have_weak=no
+             rm -f conftest1.c libempty.so conftest2.c conftest
+             ;;
+         esac
+         ;;
+     esac
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
 $as_echo "$gl_cv_have_weak" >&6; }
-    if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
-      # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
-      # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
-      ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+  case "$gl_cv_have_weak" in
+    *yes)
+
+$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
+
+      ;;
+  esac
+
+    if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+
+      :
+    fi
+    if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then
+
+      gl_have_isoc_threads="$ac_cv_header_threads_h"
+    fi
+    if test "$gl_use_threads" = yes \
+       || test "$gl_use_threads" = posix \
+       || test "$gl_use_threads" = isoc+posix; then
+
+
+  if test -z "$gl_pthreadlib_body_done"; then
+    gl_pthread_api=no
+    LIBPTHREAD=
+    LIBPMULTITHREAD=
+    # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+    # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
+    ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
 if test "x$ac_cv_header_pthread_h" = xyes; then :
   gl_have_pthread_h=yes
 else
@@ -15973,37 +16494,79 @@ else
 fi
 
 
-      if test "$gl_have_pthread_h" = yes; then
-        # Other possible tests:
-        #   -lpthreads (FSU threads, PCthreads)
-        #   -lgthreads
-        gl_have_pthread=
-        # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
-        # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
-        # the second one only in libpthread, and lock.c needs it.
+    if test "$gl_have_pthread_h" = yes; then
+      # Other possible tests:
+      #   -lpthreads (FSU threads, PCthreads)
+      #   -lgthreads
+      # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+      # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+      # the second one only in libpthread, and lock.c needs it.
+      #
+      # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+      # needs -pthread for some reason.  See:
+      # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
+      save_LIBS=$LIBS
+      for gl_pthread in '' '-pthread'; do
+        LIBS="$LIBS $gl_pthread"
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <pthread.h>
+               pthread_mutex_t m;
+               pthread_mutexattr_t ma;
+
 int
 main ()
 {
-pthread_mutex_lock((pthread_mutex_t*)0);
-               pthread_mutexattr_init((pthread_mutexattr_t*)0);
+pthread_mutex_lock (&m);
+               pthread_mutexattr_init (&ma);
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  gl_have_pthread=yes
+  gl_pthread_api=yes
+           LIBPTHREAD=$gl_pthread
+           LIBPMULTITHREAD=$gl_pthread
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-        # Test for libpthread by looking for pthread_kill. (Not pthread_self,
-        # since it is defined as a macro on OSF/1.)
-        if test -n "$gl_have_pthread"; then
-          # The program links fine without libpthread. But it may actually
-          # need to link with libpthread in order to create multiple threads.
-          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+        LIBS=$save_LIBS
+        test $gl_pthread_api = yes && break
+      done
+      echo "$as_me:16536: gl_pthread_api=$gl_pthread_api" >&5
+      echo "$as_me:16537: LIBPTHREAD=$LIBPTHREAD" >&5
+
+      gl_pthread_in_glibc=no
+      # On Linux with glibc >= 2.34, libc contains the fully functional
+      # pthread functions.
+      case "$host_os" in
+        linux*)
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <features.h>
+             #ifdef __GNU_LIBRARY__
+              #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || (__GLIBC__ > 2)
+               Lucky user
+              #endif
+             #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Lucky user" >/dev/null 2>&1; then :
+  gl_pthread_in_glibc=yes
+fi
+rm -f conftest*
+
+          ;;
+      esac
+      echo "$as_me:16562: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5
+
+      # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+      # since it is defined as a macro on OSF/1.)
+      if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
+        # The program links fine without libpthread. But it may actually
+        # need to link with libpthread in order to create multiple threads.
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
 $as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
 if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
   $as_echo_n "(cached) " >&6
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
 $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
 if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
-  LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
+  if test $gl_pthread_in_glibc = yes; then
+             LIBPMULTITHREAD=
+           else
+             LIBPMULTITHREAD=-lpthread
              # On Solaris and HP-UX, most pthread functions exist also in libc.
              # Therefore pthread_in_use() needs to actually try to create a
              # thread: pthread_create from libc will fail, whereas
              # pthread_create will actually create a thread.
+             # On Solaris 10 or newer, this test is no longer needed, because
+             # libc contains the fully functional pthread functions.
              case "$host_os" in
-               solaris* | hpux*)
+               solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
 
 $as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
 
              esac
+           fi
 
 fi
 
-        else
-          # Some library is needed. Try libpthread and libc_r.
-          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+      elif test $gl_pthread_api != yes; then
+        # Some library is needed. Try libpthread and libc_r.
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
 $as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
 if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
   $as_echo_n "(cached) " >&6
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
 $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
 if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
-  gl_have_pthread=yes
-             LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
-             LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
+  gl_pthread_api=yes
+           LIBPTHREAD=-lpthread
+           LIBPMULTITHREAD=-lpthread
 fi
 
-          if test -z "$gl_have_pthread"; then
-            # For FreeBSD 4.
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
+        if test $gl_pthread_api != yes; then
+          # For FreeBSD 4.
+          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
 $as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
 if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
   $as_echo_n "(cached) " >&6
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
 $as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
 if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
-  gl_have_pthread=yes
-               LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
-               LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r
+  gl_pthread_api=yes
+             LIBPTHREAD=-lc_r
+             LIBPMULTITHREAD=-lc_r
 fi
 
-          fi
         fi
-        if test -n "$gl_have_pthread"; then
-          gl_threads_api=posix
+      fi
+      echo "$as_me:16716: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5
+    fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
+$as_echo_n "checking whether POSIX threads API is available... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
+$as_echo "$gl_pthread_api" >&6; }
 
-$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h
 
-          if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
-            if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+    if test $gl_pthread_api = yes; then
 
-$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h
+$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
 
-              LIBTHREAD=
-              LTLIBTHREAD=
-            fi
-          fi
-        fi
-      fi
     fi
-    if test -z "$gl_have_pthread"; then
-      if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
-        gl_have_solaristhread=
-        gl_save_LIBS="$LIBS"
-        LIBS="$LIBS -lthread"
+
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <sched.h>
+int
+main ()
+{
+sched_yield ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  LIB_SCHED_YIELD=
 
-#include <thread.h>
-#include <synch.h>
+else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
+$as_echo_n "checking for sched_yield in -lrt... " >&6; }
+if ${ac_cv_lib_rt_sched_yield+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
 int
 main ()
 {
-thr_self();
+return sched_yield ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  gl_have_solaristhread=yes
+  ac_cv_lib_rt_sched_yield=yes
+else
+  ac_cv_lib_rt_sched_yield=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-        LIBS="$gl_save_LIBS"
-        if test -n "$gl_have_solaristhread"; then
-          gl_threads_api=solaris
-          LIBTHREAD=-lthread
-          LTLIBTHREAD=-lthread
-          LIBMULTITHREAD="$LIBTHREAD"
-          LTLIBMULTITHREAD="$LTLIBTHREAD"
-
-$as_echo "#define USE_SOLARIS_THREADS 1" >>confdefs.h
-
-          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
-
-$as_echo "#define USE_SOLARIS_THREADS_WEAK 1" >>confdefs.h
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
+$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
+if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
+  LIB_SCHED_YIELD=-lrt
+else
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
+$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
+if ${ac_cv_lib_posix4_sched_yield+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix4  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-            LIBTHREAD=
-            LTLIBTHREAD=
-          fi
-        fi
-      fi
-    fi
-    if test -z "$gl_have_pthread"; then
-      case "$gl_use_threads" in
-        yes | windows | win32) # The 'win32' is for backward compatibility.
-          if { case "$host_os" in
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
+int
+main ()
+{
+return sched_yield ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_posix4_sched_yield=yes
+else
+  ac_cv_lib_posix4_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
+$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
+if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
+  LIB_SCHED_YIELD=-lposix4
+fi
+
+fi
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+
+    gl_pthreadlib_body_done=done
+  fi
+
+      LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD
+      LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD
+      if test $gl_pthread_api = yes; then
+        if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then
+          gl_threads_api='isoc+posix'
+
+$as_echo "#define USE_ISOC_AND_POSIX_THREADS 1" >>confdefs.h
+
+          LIBTHREAD= LTLIBTHREAD=
+        else
+          gl_threads_api=posix
+
+$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h
+
+          if test -z "$LIBMULTITHREAD" && test -z "$LTLIBMULTITHREAD"; then
+
+$as_echo "#define USE_POSIX_THREADS_FROM_LIBC 1" >>confdefs.h
+
+          else
+            if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+
+$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h
+
+              LIBTHREAD= LTLIBTHREAD=
+            else
+              case "$host_os" in
+                freebsd* | dragonfly* | midnightbsd*)
+                  if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then
+
+$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
+
+                  fi
+                  ;;
+              esac
+            fi
+          fi
+        fi
+      fi
+    fi
+    if test $gl_threads_api = none; then
+      if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
+
+
+
+  if test -z "$gl_stdthreadlib_body_done"; then
+
+
+    case "$host_os" in
+      mingw*)
+        LIBSTDTHREAD=
+        ;;
+      *)
+
+
+  if test -z "$gl_pthreadlib_body_done"; then
+    gl_pthread_api=no
+    LIBPTHREAD=
+    LIBPMULTITHREAD=
+    # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+    # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
+    ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes; then :
+  gl_have_pthread_h=yes
+else
+  gl_have_pthread_h=no
+fi
+
+
+    if test "$gl_have_pthread_h" = yes; then
+      # Other possible tests:
+      #   -lpthreads (FSU threads, PCthreads)
+      #   -lgthreads
+      # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+      # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+      # the second one only in libpthread, and lock.c needs it.
+      #
+      # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+      # needs -pthread for some reason.  See:
+      # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
+      save_LIBS=$LIBS
+      for gl_pthread in '' '-pthread'; do
+        LIBS="$LIBS $gl_pthread"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+               pthread_mutex_t m;
+               pthread_mutexattr_t ma;
+
+int
+main ()
+{
+pthread_mutex_lock (&m);
+               pthread_mutexattr_init (&ma);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_pthread_api=yes
+           LIBPTHREAD=$gl_pthread
+           LIBPMULTITHREAD=$gl_pthread
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        LIBS=$save_LIBS
+        test $gl_pthread_api = yes && break
+      done
+      echo "$as_me:16942: gl_pthread_api=$gl_pthread_api" >&5
+      echo "$as_me:16943: LIBPTHREAD=$LIBPTHREAD" >&5
+
+      gl_pthread_in_glibc=no
+      # On Linux with glibc >= 2.34, libc contains the fully functional
+      # pthread functions.
+      case "$host_os" in
+        linux*)
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <features.h>
+             #ifdef __GNU_LIBRARY__
+              #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || (__GLIBC__ > 2)
+               Lucky user
+              #endif
+             #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Lucky user" >/dev/null 2>&1; then :
+  gl_pthread_in_glibc=yes
+fi
+rm -f conftest*
+
+          ;;
+      esac
+      echo "$as_me:16968: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5
+
+      # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+      # since it is defined as a macro on OSF/1.)
+      if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
+        # The program links fine without libpthread. But it may actually
+        # need to link with libpthread in order to create multiple threads.
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pthread_pthread_kill=yes
+else
+  ac_cv_lib_pthread_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
+  if test $gl_pthread_in_glibc = yes; then
+             LIBPMULTITHREAD=
+           else
+             LIBPMULTITHREAD=-lpthread
+             # On Solaris and HP-UX, most pthread functions exist also in libc.
+             # Therefore pthread_in_use() needs to actually try to create a
+             # thread: pthread_create from libc will fail, whereas
+             # pthread_create will actually create a thread.
+             # On Solaris 10 or newer, this test is no longer needed, because
+             # libc contains the fully functional pthread functions.
+             case "$host_os" in
+               solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
+
+$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
+
+             esac
+           fi
+
+fi
+
+      elif test $gl_pthread_api != yes; then
+        # Some library is needed. Try libpthread and libc_r.
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pthread_pthread_kill=yes
+else
+  ac_cv_lib_pthread_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
+  gl_pthread_api=yes
+           LIBPTHREAD=-lpthread
+           LIBPMULTITHREAD=-lpthread
+fi
+
+        if test $gl_pthread_api != yes; then
+          # For FreeBSD 4.
+          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
+$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
+if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_c_r_pthread_kill=yes
+else
+  ac_cv_lib_c_r_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
+$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
+if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
+  gl_pthread_api=yes
+             LIBPTHREAD=-lc_r
+             LIBPMULTITHREAD=-lc_r
+fi
+
+        fi
+      fi
+      echo "$as_me:17122: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5
+    fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
+$as_echo_n "checking whether POSIX threads API is available... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
+$as_echo "$gl_pthread_api" >&6; }
+
+
+    if test $gl_pthread_api = yes; then
+
+$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
+
+    fi
+
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sched.h>
+int
+main ()
+{
+sched_yield ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  LIB_SCHED_YIELD=
+
+else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
+$as_echo_n "checking for sched_yield in -lrt... " >&6; }
+if ${ac_cv_lib_rt_sched_yield+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
+int
+main ()
+{
+return sched_yield ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_rt_sched_yield=yes
+else
+  ac_cv_lib_rt_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
+$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
+if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
+  LIB_SCHED_YIELD=-lrt
+else
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
+$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
+if ${ac_cv_lib_posix4_sched_yield+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix4  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
+int
+main ()
+{
+return sched_yield ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_posix4_sched_yield=yes
+else
+  ac_cv_lib_posix4_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
+$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
+if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
+  LIB_SCHED_YIELD=-lposix4
+fi
+
+fi
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+
+    gl_pthreadlib_body_done=done
+  fi
+
+        if test $ac_cv_header_threads_h = yes; then
+                                                            for ac_func in thrd_create
+do :
+  ac_fn_c_check_func "$LINENO" "thrd_create" "ac_cv_func_thrd_create"
+if test "x$ac_cv_func_thrd_create" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_THRD_CREATE 1
+_ACEOF
+
+fi
+done
+
+          if test $ac_cv_func_thrd_create = yes; then
+            LIBSTDTHREAD=
+          else
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thrd_create in -lstdthreads" >&5
+$as_echo_n "checking for thrd_create in -lstdthreads... " >&6; }
+if ${ac_cv_lib_stdthreads_thrd_create+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lstdthreads  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char thrd_create ();
+int
+main ()
+{
+return thrd_create ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_stdthreads_thrd_create=yes
+else
+  ac_cv_lib_stdthreads_thrd_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdthreads_thrd_create" >&5
+$as_echo "$ac_cv_lib_stdthreads_thrd_create" >&6; }
+if test "x$ac_cv_lib_stdthreads_thrd_create" = xyes; then :
+
+              LIBSTDTHREAD='-lstdthreads -lpthread'
+
+else
+
+                            LIBSTDTHREAD="$LIBPMULTITHREAD"
+
+fi
+
+          fi
+        else
+                    LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
+        fi
+        ;;
+    esac
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ISO C threads API is available" >&5
+$as_echo_n "checking whether ISO C threads API is available... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_threads_h" >&5
+$as_echo "$ac_cv_header_threads_h" >&6; }
+    gl_stdthreadlib_body_done=done
+  fi
+
+        LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD
+        LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD
+        gl_threads_api=isoc
+
+$as_echo "#define USE_ISOC_THREADS 1" >>confdefs.h
+
+      fi
+    fi
+    if test $gl_threads_api = none; then
+      case "$gl_use_threads" in
+        yes | windows | win32) # The 'win32' is for backward compatibility.
+          if { case "$host_os" in
                  mingw*) true;;
                  *) false;;
                esac
@@ -16316,20 +17433,152 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+    for ac_header in sys/single_threaded.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "sys/single_threaded.h" "ac_cv_header_sys_single_threaded_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_single_threaded_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_SINGLE_THREADED_H 1
+_ACEOF
+
+fi
+
+done
+
+  fi
+fi
+
+# Default value for GPG_ERROR_CONFIG_LIBS
+config_libs="-lgpg-error"
+
+#
+# Check for other libraries
+#
+LIB_SCHED_YIELD=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_yield" >&5
+$as_echo_n "checking for library containing sched_yield... " >&6; }
+if ${ac_cv_search_sched_yield+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
+int
+main ()
+{
+return sched_yield ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' rt posix4; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_sched_yield=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_sched_yield+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_sched_yield+:} false; then :
+
+else
+  ac_cv_search_sched_yield=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_yield" >&5
+$as_echo "$ac_cv_search_sched_yield" >&6; }
+ac_res=$ac_cv_search_sched_yield
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  if test "$ac_cv_search_sched_yield" != "none required"; then
+                  LIB_SCHED_YIELD=$ac_cv_search_sched_yield
+                  config_libs="$config_libs $LIB_SCHED_YIELD"
+                fi
+fi
+
+
+LIB_NETWORK=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_addr" >&5
+$as_echo_n "checking for library containing inet_addr... " >&6; }
+if ${ac_cv_search_inet_addr+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_addr ();
+int
+main ()
+{
+return inet_addr ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
   fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_inet_addr=$ac_res
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_inet_addr+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_inet_addr+:} false; then :
 
-# Default value for GPG_ERROR_CONFIG_LIBS
-config_libs="-lgpg-error"
-
-#
-# Check for other libraries (now only for -lrt).
-#
-LIB_SCHED_YIELD=
+else
+  ac_cv_search_inet_addr=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_addr" >&5
+$as_echo "$ac_cv_search_inet_addr" >&6; }
+ac_res=$ac_cv_search_inet_addr
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  if test "$ac_cv_search_inet_addr" != "none required"; then
+                  LIB_NETWORK=$ac_cv_search_inet_addr
+                fi
+fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_yield" >&5
-$as_echo_n "checking for library containing sched_yield... " >&6; }
-if ${ac_cv_search_sched_yield+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
+$as_echo_n "checking for library containing socket... " >&6; }
+if ${ac_cv_search_socket+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
@@ -16342,50 +17591,132 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char sched_yield ();
+char socket ();
 int
 main ()
 {
-return sched_yield ();
+return socket ();
   ;
   return 0;
 }
 _ACEOF
-for ac_lib in '' rt posix4; do
+for ac_lib in '' socket; do
   if test -z "$ac_lib"; then
     ac_res="none required"
   else
     ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+    LIBS="-l$ac_lib $LIB_NETWORK $ac_func_search_save_LIBS"
   fi
   if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_sched_yield=$ac_res
+  ac_cv_search_socket=$ac_res
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext
-  if ${ac_cv_search_sched_yield+:} false; then :
+  if ${ac_cv_search_socket+:} false; then :
   break
 fi
 done
-if ${ac_cv_search_sched_yield+:} false; then :
+if ${ac_cv_search_socket+:} false; then :
 
 else
-  ac_cv_search_sched_yield=no
+  ac_cv_search_socket=no
 fi
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_yield" >&5
-$as_echo "$ac_cv_search_sched_yield" >&6; }
-ac_res=$ac_cv_search_sched_yield
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
+$as_echo "$ac_cv_search_socket" >&6; }
+ac_res=$ac_cv_search_socket
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-  if test "$ac_cv_search_sched_yield" != "none required"; then
-                  LIB_SCHED_YIELD=$ac_cv_search_sched_yield
-                  config_libs="$config_libs $LIB_SCHED_YIELD"
+  if test "$ac_cv_search_socket" != "none required"; then
+                  LIB_NETWORK="$ac_cv_search_socket $LIB_NETWORK"
                 fi
 fi
 
+if test "x$LIB_NETWORK" != x; then
+  config_libs="$config_libs $LIB_NETWORK"
+fi
+
+# Check for optional readline support
+
+
+# Check whether --with-readline was given.
+if test "${with_readline+set}" = set; then :
+  withval=$with_readline; _do_readline=$withval
+else
+  _do_readline=yes
+fi
+
+
+  gnupg_cv_have_readline=no
+  if test "$_do_readline" != "no" ; then
+     if test -d "$withval" ; then
+        CPPFLAGS="${CPPFLAGS} -I$withval/include"
+        LDFLAGS="${LDFLAGS} -L$withval/lib"
+     fi
+
+     for _termcap in "" "-ltermcap" "-lcurses" "-lncurses" ; do
+        _readline_save_libs=$LIBS
+        _combo="-lreadline${_termcap:+ $_termcap}"
+        LIBS="$LIBS $_combo"
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline via \"$_combo\" is present and sane" >&5
+$as_echo_n "checking whether readline via \"$_combo\" is present and sane... " >&6; }
+
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <readline/readline.h>
+#include <readline/history.h>
+
+int
+main ()
+{
+
+rl_completion_func_t *completer;
+add_history("foobar");
+rl_catch_signals=0;
+rl_inhibit_completion=0;
+rl_attempted_completion_function=NULL;
+rl_completion_matches(NULL,NULL);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  _found_readline=yes
+else
+  _found_readline=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_found_readline" >&5
+$as_echo "$_found_readline" >&6; }
+
+        LIBS=$_readline_save_libs
+
+        if test $_found_readline = yes ; then
+
+$as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
+
+           LIBREADLINE=$_combo
+
+           gnupg_cv_have_readline=yes
+           break
+        fi
+     done
+
+     unset _termcap
+     unset _readline_save_libs
+     unset _combo
+     unset _found_readline
+  fi
+
+
 
 #
 # Prepare building of estream
@@ -16678,9 +18009,9 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and THOUSANDS_SEP" >&5
-$as_echo_n "checking for nl_langinfo and THOUSANDS_SEP... " >&6; }
-if ${estream_cv_langinfo_thousands_sep+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and THOUSEP" >&5
+$as_echo_n "checking for nl_langinfo and THOUSEP... " >&6; }
+if ${estream_cv_langinfo_thousep+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -16689,25 +18020,25 @@ else
 int
 main ()
 {
-char* cs = nl_langinfo(THOUSANDS_SEP); return !cs;
+char* cs = nl_langinfo(THOUSEP); return !cs;
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  estream_cv_langinfo_thousands_sep=yes
+  estream_cv_langinfo_thousep=yes
 else
-  estream_cv_langinfo_thousands_sep=no
+  estream_cv_langinfo_thousep=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $estream_cv_langinfo_thousands_sep" >&5
-$as_echo "$estream_cv_langinfo_thousands_sep" >&6; }
-  if test $estream_cv_langinfo_thousands_sep = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $estream_cv_langinfo_thousep" >&5
+$as_echo "$estream_cv_langinfo_thousep" >&6; }
+  if test $estream_cv_langinfo_thousep = yes; then
 
-$as_echo "#define HAVE_LANGINFO_THOUSANDS_SEP 1" >>confdefs.h
+$as_echo "#define HAVE_LANGINFO_THOUSEP 1" >>confdefs.h
 
   fi
 
@@ -16740,15 +18071,52 @@ if test "x$LIBMULTITHREAD" != x; then
 else
   GPG_ERROR_CONFIG_MT_LIBS=""
 fi
-GPG_ERROR_CONFIG_CFLAGS=""
+if test "$have_w32ce_system" = yes; then
+  GPG_ERROR_CONFIG_CFLAGS="-idirafter \${includedir}/gpg-extra"
+else
+  GPG_ERROR_CONFIG_CFLAGS=""
+fi
 if test "x$THREADLIB_CPPFLAGS" != x; then
   GPG_ERROR_CONFIG_MT_CFLAGS="${THREADLIB_CPPFLAGS}"
 else
   GPG_ERROR_CONFIG_MT_CFLAGS=""
 fi
-GPG_ERROR_CONFIG_ISUBDIRAFTER=""
 GPG_ERROR_CONFIG_HOST="$host"
 
+case "$includedir" in
+  /usr/include|/include) ;;
+  '${prefix}/include')
+    if test "$prefix" != / -a "$prefix" != /usr; then
+      if test -z "$GPG_ERROR_CONFIG_CFLAGS"; then
+        GPG_ERROR_CONFIG_CFLAGS="-I$includedir"
+      else
+        GPG_ERROR_CONFIG_CFLAGS="-I$includedir $GPG_ERROR_CONFIG_CFLAGS"
+      fi
+    fi
+    ;;
+  *)
+    if test -z "$GPG_ERROR_CONFIG_CFLAGS"; then
+      GPG_ERROR_CONFIG_CFLAGS="-I$includedir"
+    else
+      GPG_ERROR_CONFIG_CFLAGS="-I$includedir $GPG_ERROR_CONFIG_CFLAGS"
+    fi
+    ;;
+esac
+case "$libdir" in
+  /usr/lib|/usr/lib64|/lib|/lib64) ;;
+  '${exec_prefix}/lib')
+    if test "$exec_prefix" = "NONE"; then
+      if test "$prefix" != / -a "$prefix" != /usr; then
+        GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS"
+      fi
+    elif test "$exec_prefix" != / -a "$exec_prefix" != /usr; then
+      GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS"
+    fi
+    ;;
+  *) GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS" ;;
+esac
+
+
 
 
 
@@ -16773,12 +18141,129 @@ $as_echo "#define HAVE_W64_SYSTEM 1" >>confdefs.h
 
 $as_echo "#define HAVE_W32CE_SYSTEM 1" >>confdefs.h
 
-      GPG_ERROR_CONFIG_ISUBDIRAFTER="gpg-extra"
     fi
     force_use_syscfg=yes
 fi
-if test x$cross_compiling = xyes; then
+if test x"$gl_use_threads" = xno; then
+  lock_obj_h_generated=yes
+  if test ! -d src; then mkdir src; fi
+  host=$host $srcdir/src/gen-lock-obj.sh --disable-threads \
+    >src/lock-obj-pub.native.h
+  { $as_echo "$as_me:${as_lineno-$LINENO}: generated src/lock-obj-pub.native.h for $host" >&5
+$as_echo "$as_me: generated src/lock-obj-pub.native.h for $host" >&6;}
+elif test x$cross_compiling = xyes; then
+  case $host in
+    *-*-linux-gnu*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+    if test -n "$OBJDUMP"; then
+      lock_obj_h_generated=yes
+      if test ! -d src; then mkdir src; fi
+      LOCK_ABI_VERSION=1 host=$host host_alias=$host_alias \
+          CC=$CC OBJDUMP=$OBJDUMP \
+          ac_ext=$ac_ext ac_objext=$ac_objext \
+          AWK=$AWK $srcdir/src/gen-lock-obj.sh \
+          >src/lock-obj-pub.native.h
+      { $as_echo "$as_me:${as_lineno-$LINENO}: generated src/lock-obj-pub.native.h using $host_alias-objdump and $AWK" >&5
+$as_echo "$as_me: generated src/lock-obj-pub.native.h using $host_alias-objdump and $AWK" >&6;}
+    else
+      force_use_syscfg=yes
+    fi
+    ;;
+    *)
     force_use_syscfg=yes
+    ;;
+  esac
 fi
 
  if test "$have_w32_system" = yes; then
@@ -16821,6 +18306,14 @@ else
   FORCE_USE_SYSCFG_FALSE=
 fi
 
+ if test x$lock_obj_h_generated = xyes; then
+  HAVE_GENERATED_LOCK_OBJ_H_TRUE=
+  HAVE_GENERATED_LOCK_OBJ_H_FALSE='#'
+else
+  HAVE_GENERATED_LOCK_OBJ_H_TRUE='#'
+  HAVE_GENERATED_LOCK_OBJ_H_FALSE=
+fi
+
 
 
 cat >>confdefs.h <<_ACEOF
@@ -16830,9 +18323,65 @@ _ACEOF
 
 
 #
+# gpgrt_log_clock may require linking with extra libaries.  As long as
+# we don't have a good test for this we require the use of this
+# configure option to enabling printing of a timestamp.
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable log_clock" >&5
+$as_echo_n "checking whether to enable log_clock... " >&6; }
+# Check whether --enable-log_clock was given.
+if test "${enable_log_clock+set}" = set; then :
+  enableval=$enable_log_clock; enable_log_clock=$enableval
+else
+  enable_log_clock=no
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_log_clock" >&5
+$as_echo "$enable_log_clock" >&6; }
+if test "$enable_log_clock" = yes ; then
+
+$as_echo "#define ENABLE_LOG_CLOCK 1" >>confdefs.h
+
+fi
+
+#
+# For now we do not build gpgscm by default.
+# Eventually we will reverse the meaning of that option.
+#
+build_gpgscm=no
+#AC_MSG_CHECKING([whether to build gpgscm])
+#AC_ARG_ENABLE(gpgscm,
+#              AS_HELP_STRING([--enable-gpgscm],
+#                             [build the gpgscm tool]),
+#              build_gpgscm=$enableval, build_gpgscm=no)
+#AC_MSG_RESULT($build_gpgscm)
+ if test "x$build_gpgscm" != xno; then
+  BUILD_GPGSCM_TRUE=
+  BUILD_GPGSCM_FALSE='#'
+else
+  BUILD_GPGSCM_TRUE='#'
+  BUILD_GPGSCM_FALSE=
+fi
+
+
+
+#
+# Add -Werror to CFLAGS.  This hack can be used to avoid problems with
+# misbehaving autoconf tests in case the user supplied -Werror.
+#
+# Check whether --enable-werror was given.
+if test "${enable_werror+set}" = set; then :
+  enableval=$enable_werror; if test $enableval = yes ; then
+                      CFLAGS="$CFLAGS -Werror"
+                   fi
+fi
+
+
+
+#
 # Provide information about the build.
 #
-BUILD_REVISION="c1668f6"
+BUILD_REVISION="d7fb048"
 
 
 cat >>confdefs.h <<_ACEOF
@@ -16841,7 +18390,7 @@ _ACEOF
 
 
 BUILD_VERSION=`echo "$PACKAGE_VERSION"|sed 's/\([0-9.]*\).*/\1./'`
-BUILD_VERSION="${BUILD_VERSION}0.49510"
+BUILD_VERSION="${BUILD_VERSION}0.55291"
 BUILD_FILEVERSION=`echo "${BUILD_VERSION}" | tr . ,`
 
 
@@ -16927,7 +18476,13 @@ ac_config_files="$ac_config_files lang/Makefile lang/cl/Makefile lang/cl/gpg-err
 
 ac_config_files="$ac_config_files src/versioninfo.rc src/gpg-error.w32-manifest"
 
-ac_config_files="$ac_config_files src/gpg-error-config"
+ac_config_files="$ac_config_files src/gpg-error.pc"
+
+ac_config_files="$ac_config_files src/gpg-error-config-old:src/gpg-error-config.in"
+
+ac_config_files="$ac_config_files src/gpgrt-config"
+
+ac_config_files="$ac_config_files src/gpg-error-config-test.sh"
 
 
 cat >confcache <<\_ACEOF
@@ -17091,6 +18646,14 @@ if test -z "${FORCE_USE_SYSCFG_TRUE}" && test -z "${FORCE_USE_SYSCFG_FALSE}"; th
   as_fn_error $? "conditional \"FORCE_USE_SYSCFG\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${HAVE_GENERATED_LOCK_OBJ_H_TRUE}" && test -z "${HAVE_GENERATED_LOCK_OBJ_H_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_GENERATED_LOCK_OBJ_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_GPGSCM_TRUE}" && test -z "${BUILD_GPGSCM_FALSE}"; then
+  as_fn_error $? "conditional \"BUILD_GPGSCM\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${LANGUAGES_SOME_TRUE}" && test -z "${LANGUAGES_SOME_FALSE}"; then
   as_fn_error $? "conditional \"LANGUAGES_SOME\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -17500,7 +19063,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libgpg-error $as_me 1.27, which was
+This file was extended by libgpg-error $as_me 1.43, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -17566,7 +19129,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libgpg-error config.status 1.27
+libgpg-error config.status 1.43
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -17685,7 +19248,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #
 # INIT-COMMANDS
 #
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
 
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
     "lang/cl/gpg-error.asd") CONFIG_FILES="$CONFIG_FILES lang/cl/gpg-error.asd" ;;
     "src/versioninfo.rc") CONFIG_FILES="$CONFIG_FILES src/versioninfo.rc" ;;
     "src/gpg-error.w32-manifest") CONFIG_FILES="$CONFIG_FILES src/gpg-error.w32-manifest" ;;
-    "src/gpg-error-config") CONFIG_FILES="$CONFIG_FILES src/gpg-error-config" ;;
+    "src/gpg-error.pc") CONFIG_FILES="$CONFIG_FILES src/gpg-error.pc" ;;
+    "src/gpg-error-config-old") CONFIG_FILES="$CONFIG_FILES src/gpg-error-config-old:src/gpg-error-config.in" ;;
+    "src/gpgrt-config") CONFIG_FILES="$CONFIG_FILES src/gpgrt-config" ;;
+    "src/gpg-error-config-test.sh") CONFIG_FILES="$CONFIG_FILES src/gpg-error-config-test.sh" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
@@ -18670,29 +20236,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
   # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  case $CONFIG_FILES in #(
+  *\'*) :
+    eval set x "$CONFIG_FILES" ;; #(
+  *) :
+    set x $CONFIG_FILES ;; #(
+  *) :
+     ;;
+esac
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
     # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$mf" : 'X\(//\)[^/]' \| \
-        X"$mf" : 'X\(//\)$' \| \
-        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$am_mf" : 'X\(//\)[^/]' \| \
+        X"$am_mf" : 'X\(//\)$' \| \
+        X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$am_mf" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
            s//\1/
            q
@@ -18710,53 +20282,50 @@ $as_echo X"$mf" |
            q
          }
          s/.*/./; q'`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "$am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$file" : 'X\(//\)[^/]' \| \
-        X"$file" : 'X\(//\)$' \| \
-        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)[^/].*/{
+    am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$am_mf" : 'X\(//\)$' \| \
+        X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$am_mf" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
            s//\1/
            q
          }
-         /^X\(\/\/\)$/{
+         /^X\/\(\/\/\)$/{
            s//\1/
            q
          }
-         /^X\(\/\).*/{
+         /^X\/\(\/\).*/{
            s//\1/
            q
          }
          s/.*/./; q'`
-      as_dir=$dirpart/$fdir; as_fn_mkdir_p
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    { echo "$as_me:$LINENO: cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles" >&5
+   (cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } || am_rc=$?
   done
+  if test $am_rc -ne 0; then
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  If GNU make was not used, consider
+    re-running the configure script with MAKE=\"gmake\" (or whatever is
+    necessary).  You can also try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+  { am_dirpart=; unset am_dirpart;}
+  { am_filepart=; unset am_filepart;}
+  { am_mf=; unset am_mf;}
+  { am_rc=; unset am_rc;}
+  rm -f conftest-deps.mk
 }
  ;;
     "libtool":C)
@@ -19645,7 +21214,9 @@ _LT_EOF
         ;;
       esac
     done ;;
-    "src/gpg-error-config":F) chmod +x src/gpg-error-config ;;
+    "src/gpg-error-config-old":F) chmod +x src/gpg-error-config-old ;;
+    "src/gpgrt-config":F) chmod +x src/gpgrt-config ;;
+    "src/gpg-error-config-test.sh":F) chmod +x src/gpg-error-config-test.sh ;;
 
   esac
 done # for ac_tag
@@ -19694,7 +21265,7 @@ fi
 echo "
         $PACKAGE_NAME v$PACKAGE_VERSION has been configured as follows:
 
-        Revision: c1668f6  (49510)
+        Revision: d7fb048  (55291)
         Platform: $host$tmp
 "
 if test "$gcry_cv_gcc_attribute_aligned" != "yes" ; then
index 6c5a76c..e0d4c42 100644 (file)
@@ -1,5 +1,5 @@
 # configure.ac for libgpg-error
-# Copyright (C) 2003, 2004, 2006, 2010, 2013-2017 g10 Code GmbH
+# Copyright (C) 2003, 2004, 2006, 2010, 2013-2020 g10 Code GmbH
 #
 # This file is part of libgpg-error.
 #
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, see <https://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: LGPL-2.1+
 
 # (Process this file with autoconf to produce a configure script.)
 # The following lines are used by ./autogen.sh.
-AC_PREREQ(2.59)
+AC_PREREQ([2.59])
 min_automake_version="1.14"
 
 # To build a release you need to create a tag with the version number
@@ -28,7 +29,7 @@ min_automake_version="1.14"
 # See below for the LT versions.
 m4_define([mym4_package],[libgpg-error])
 m4_define([mym4_major], [1])
-m4_define([mym4_minor], [27])
+m4_define([mym4_minor], [43])
 
 # Below is m4 magic to extract and compute the revision number, the
 # decimalized short revision number, a beta version string, and a flag
@@ -41,16 +42,16 @@ m4_define([mym4_version],      m4_argn(4, mym4_verslist))
 m4_define([mym4_revision],     m4_argn(7, mym4_verslist))
 m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist))
 m4_esyscmd([echo ]mym4_version[>VERSION])
-AC_INIT([mym4_package],[mym4_version], [https://bugs.gnupg.org])
+AC_INIT([mym4_package],[mym4_version],[https://bugs.gnupg.org])
 # LT Version numbers, remember to change them just *before* a release.
 #   (Code changed:                     REVISION++)
 #   (Interfaces added/removed/changed: CURRENT++, REVISION=0)
 #   (Interfaces added:                 AGE++)
 #   (Interfaces removed:               AGE=0)
 # Note that added error codes don't constitute an interface change.
-LIBGPG_ERROR_LT_CURRENT=22
-LIBGPG_ERROR_LT_AGE=22
-LIBGPG_ERROR_LT_REVISION=0
+LIBGPG_ERROR_LT_CURRENT=32
+LIBGPG_ERROR_LT_AGE=32
+LIBGPG_ERROR_LT_REVISION=1
 ################################################
 
 AC_SUBST(LIBGPG_ERROR_LT_CURRENT)
@@ -79,9 +80,46 @@ AM_PROG_CC_C_O
 AC_PROG_CPP
 AC_PROG_AWK
 AC_CHECK_TOOL(AR, ar, :)
-AC_GNU_SOURCE
+AC_USE_SYSTEM_EXTENSIONS
+
+AM_LANGINFO_CODESET
+
+# Taken from mpfr-4.0.1, then modified for LDADD_FOR_TESTS_KLUDGE
+dnl Under Linux, make sure that the old dtags are used if LD_LIBRARY_PATH
+dnl is defined. The issue is that with the new dtags, LD_LIBRARY_PATH has
+dnl the precedence over the run path, so that if a compatible MPFR library
+dnl is installed in some directory from $LD_LIBRARY_PATH, then the tested
+dnl MPFR library will be this library instead of the MPFR library from the
+dnl build tree. Other OS with the same issue might be added later.
+dnl
+dnl References:
+dnl   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859732
+dnl   http://lists.gnu.org/archive/html/libtool/2017-05/msg00000.html
+dnl
+dnl We need to check whether --disable-new-dtags is supported as alternate
+dnl linkers may be used (e.g., with tcc: CC=tcc LD=tcc).
+dnl
+case $host in
+  *-*-linux*)
+    if test -n "$LD_LIBRARY_PATH"; then
+      saved_LDFLAGS="$LDFLAGS"
+      LDADD_FOR_TESTS_KLUDGE="-Wl,--disable-new-dtags"
+      LDFLAGS="$LDFLAGS $LDADD_FOR_TESTS_KLUDGE"
+      AC_MSG_CHECKING(whether --disable-new-dtags is supported by the linker)
+      AC_LINK_IFELSE([AC_LANG_SOURCE([[
+int main (void) { return 0; }
+      ]])],
+      [AC_MSG_RESULT(yes (use it since LD_LIBRARY_PATH is set))],
+      [AC_MSG_RESULT(no)
+       LDADD_FOR_TESTS_KLUDGE=""
+      ])
+      LDFLAGS="$saved_LDFLAGS"
+    fi
+    ;;
+esac
+AC_SUBST([LDADD_FOR_TESTS_KLUDGE])
 
-# Set some internal variables depending on the platform for later use.
+# Set some variables depending on the platform for later use.
 have_w32_system=no
 have_w64_system=no
 have_w32ce_system=no
@@ -97,6 +135,12 @@ case "${host}" in
     *-mingw32*)
         have_w32_system=yes
         ;;
+    *-apple-darwin*)
+        # This is the equivalent of the _GNU_SOURCE feature-test-macro
+        # on GNU libc systems.
+        AC_DEFINE(_DARWIN_C_SOURCE, 1,
+                  Expose all libc features (__DARWIN_C_FULL).)
+        ;;
     *)
        ;;
 esac
@@ -119,18 +163,7 @@ LT_LANG([Windows Resource])
 
 
 # We need to compile and run a program on the build machine.
-dnl The AC_PROG_CC_FOR_BUILD macro in the AC archive is broken for
-dnl autoconf 2.57.
-dnl AC_PROG_CC_FOR_BUILD
-AC_MSG_CHECKING(for cc for build)
-if test "$cross_compiling" = "yes"; then
-  CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
-else
-  CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
-fi
-AC_MSG_RESULT($CC_FOR_BUILD)
-AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
-
+AX_CC_FOR_BUILD
 
 AH_BOTTOM([
 /* Force using of NLS for W32 even if no libintl has been found.  This is
@@ -147,6 +180,8 @@ AH_BOTTOM([
 #define GPG_ERR_ENABLE_GETTEXT_MACROS 1
 #define GPG_ERR_ENABLE_ERRNO_MACROS 1
 #define GPGRT_ENABLE_ES_MACROS 1
+#define GPGRT_ENABLE_LOG_MACROS 1
+#define GPGRT_ENABLE_ARGPARSE_MACROS 1
 ])
 
 
@@ -156,20 +191,31 @@ AM_GNU_GETTEXT([external])
 
 # Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS([stdlib.h locale.h stdint.h sys/select.h sys/time.h])
+AC_CHECK_HEADERS([locale.h stdint.h sys/select.h sys/time.h \
+                  signal.h poll.h pwd.h])
+
 AC_FUNC_STRERROR_R
 case "${host_os}" in
+     mingw32*)
+     INSTALLSHELLPATH=/bin/sh
+     AC_CHECK_FUNC([strerror_s])
+     ;;
      solaris*)
+     INSTALLSHELLPATH=/usr/xpg4/bin/sh
      # All versions of Solaris from 2.4 have a thread-safe strerror().
      # Since Solaris 10, in addition strerror_r() exists.
      ;;
      *)
+     INSTALLSHELLPATH=/bin/sh
      AC_CHECK_FUNC([strerror_r], [],
 AC_MSG_WARN([[Without strerror_r, gpg_strerror_r might not be thread-safe]]))
      ;;
 esac
+AC_SUBST(INSTALLSHELLPATH)
 
-AC_CHECK_FUNCS([flockfile vasprintf])
+AC_FUNC_FORK
+AC_CHECK_FUNCS([flockfile vasprintf mmap rand strlwr stpcpy setenv stat \
+                getrlimit getpwnam getpwuid getpwnam_r getpwuid_r ])
 
 
 #
@@ -195,6 +241,9 @@ AC_CHECK_SIZEOF(time_t,,[[
 #endif
 ]])
 
+GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
+
+
 # Find a 64 bit integer type to be used instead of off_t.  We prefer
 # the standard integer types over int64_t and finally try long long.
 if test "$ac_cv_sizeof_int" = "8"; then
@@ -215,7 +264,6 @@ AC_DEFINE_UNQUOTED(REPLACEMENT_FOR_OFF_T, "$replacement_for_off_t",
                    [Used by mkheader to insert the replacement type.])
 
 
-
 #
 # Setup gcc specific options
 #
@@ -234,8 +282,8 @@ if test "$GCC" = yes; then
     # warning options and the user should have a chance of overriding
     # them.
     if test "$USE_MAINTAINER_MODE" = "yes"; then
-        CFLAGS="$CFLAGS -O3 -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
-        CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
+        M_CFLAGS="-O3 -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
+        M_CFLAGS="$M_CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
         if test x"$_gcc_silent_wno" = xyes ; then
           _gcc_wopt=yes
         else
@@ -248,7 +296,7 @@ if test "$GCC" = yes; then
           CFLAGS=$_gcc_cflags_save;
         fi
         if test x"$_gcc_wopt" = xyes ; then
-          CFLAGS="$CFLAGS -W -Wno-sign-compare -Wno-missing-field-initializers"
+          M_CFLAGS="$M_CFLAGS -W -Wno-sign-compare -Wno-missing-field-initializers"
         fi
 
         AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement])
@@ -258,8 +306,12 @@ if test "$GCC" = yes; then
         AC_MSG_RESULT($_gcc_wopt)
         CFLAGS=$_gcc_cflags_save;
         if test x"$_gcc_wopt" = xyes ; then
-          CFLAGS="$CFLAGS -Wdeclaration-after-statement"
+          M_CFLAGS="$M_CFLAGS -Wdeclaration-after-statement"
         fi
+
+       # Prepend the maintainer-cflags so that the user can override
+       # them, e.g. to override the optimization flags for debugging.
+       CFLAGS="$M_CFLAGS $CFLAGS"
     else
         CFLAGS="$CFLAGS -Wall"
     fi
@@ -394,7 +446,7 @@ case "${host}" in
         ;;
 esac
 AC_ARG_ENABLE([ld-version-script],
-              AC_HELP_STRING([--enable-ld-version-script],
+              AS_HELP_STRING([--enable-ld-version-script],
                              [enable/disable use of linker version script.
                               (default is system dependent)]),
               [have_ld_version_script=$enableval],
@@ -408,6 +460,7 @@ AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
 # Windows has always thread support; thus we don't bother to test for
 # it as it may lead to false results when cross building.
 if test "$have_w32_system" = yes; then
+  GPG_ERROR_CONFIG_LIBS_PRIVATE=-lws2_32
   AC_DEFINE([USE_WINDOWS_THREADS], [1])
   LIBTHREAD=
   LTLIBTHREAD=
@@ -419,10 +472,12 @@ if test "$have_w32_system" = yes; then
   AC_SUBST([LIBMULTITHREAD])
   AC_SUBST([LTLIBMULTITHREAD])
 else
+  GPG_ERROR_CONFIG_LIBS_PRIVATE=""
   gl_LOCK
   if test "$gl_threads_api" = posix; then
     AC_CHECK_SIZEOF(pthread_mutex_t,,[AC_INCLUDES_DEFAULT
                                       #include <pthread.h>])
+    AC_CHECK_HEADERS([sys/single_threaded.h])
   fi
 fi
 
@@ -430,7 +485,7 @@ fi
 config_libs="-lgpg-error"
 
 #
-# Check for other libraries (now only for -lrt).
+# Check for other libraries
 #
 LIB_SCHED_YIELD=
 AC_SUBST([LIB_SCHED_YIELD])
@@ -440,6 +495,24 @@ AC_SEARCH_LIBS([sched_yield], [rt posix4],
                   config_libs="$config_libs $LIB_SCHED_YIELD"
                 fi])
 
+LIB_NETWORK=
+AC_SUBST([LIB_NETWORK])
+AC_SEARCH_LIBS([inet_addr], [nsl],
+               [if test "$ac_cv_search_inet_addr" != "none required"; then
+                  LIB_NETWORK=$ac_cv_search_inet_addr
+                fi])
+AC_SEARCH_LIBS([socket], [socket],
+               [if test "$ac_cv_search_socket" != "none required"; then
+                  LIB_NETWORK="$ac_cv_search_socket $LIB_NETWORK"
+                fi], [], [$LIB_NETWORK])
+if test "x$LIB_NETWORK" != x; then
+  config_libs="$config_libs $LIB_NETWORK"
+fi
+
+# Check for optional readline support
+GNUPG_CHECK_READLINE
+
+
 #
 # Prepare building of estream
 #
@@ -457,19 +530,56 @@ if test "x$LIBMULTITHREAD" != x; then
 else
   GPG_ERROR_CONFIG_MT_LIBS=""
 fi
-GPG_ERROR_CONFIG_CFLAGS=""
+if test "$have_w32ce_system" = yes; then
+  GPG_ERROR_CONFIG_CFLAGS="-idirafter \${includedir}/gpg-extra"
+else
+  GPG_ERROR_CONFIG_CFLAGS=""
+fi
 if test "x$THREADLIB_CPPFLAGS" != x; then
   GPG_ERROR_CONFIG_MT_CFLAGS="${THREADLIB_CPPFLAGS}"
 else
   GPG_ERROR_CONFIG_MT_CFLAGS=""
 fi
-GPG_ERROR_CONFIG_ISUBDIRAFTER=""
 GPG_ERROR_CONFIG_HOST="$host"
+
+case "$includedir" in
+  /usr/include|/include) ;;
+  '${prefix}/include')
+    if test "$prefix" != / -a "$prefix" != /usr; then
+      if test -z "$GPG_ERROR_CONFIG_CFLAGS"; then
+        GPG_ERROR_CONFIG_CFLAGS="-I$includedir"
+      else
+        GPG_ERROR_CONFIG_CFLAGS="-I$includedir $GPG_ERROR_CONFIG_CFLAGS"
+      fi
+    fi
+    ;;
+  *)
+    if test -z "$GPG_ERROR_CONFIG_CFLAGS"; then
+      GPG_ERROR_CONFIG_CFLAGS="-I$includedir"
+    else
+      GPG_ERROR_CONFIG_CFLAGS="-I$includedir $GPG_ERROR_CONFIG_CFLAGS"
+    fi
+    ;;
+esac
+case "$libdir" in
+  /usr/lib|/usr/lib64|/lib|/lib64) ;;
+  '${exec_prefix}/lib')
+    if test "$exec_prefix" = "NONE"; then
+      if test "$prefix" != / -a "$prefix" != /usr; then
+        GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS"
+      fi
+    elif test "$exec_prefix" != / -a "$exec_prefix" != /usr; then
+      GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS"
+    fi
+    ;;
+  *) GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS" ;;
+esac
+
 AC_SUBST(GPG_ERROR_CONFIG_LIBS)
 AC_SUBST(GPG_ERROR_CONFIG_CFLAGS)
 AC_SUBST(GPG_ERROR_CONFIG_MT_LIBS)
 AC_SUBST(GPG_ERROR_CONFIG_MT_CFLAGS)
-AC_SUBST(GPG_ERROR_CONFIG_ISUBDIRAFTER)
+AC_SUBST(GPG_ERROR_CONFIG_LIBS_PRIVATE)
 AC_SUBST(GPG_ERROR_CONFIG_HOST)
 
 
@@ -484,12 +594,36 @@ if test "$have_w32_system" = yes; then
     fi
     if test "$have_w32ce_system" = yes; then
       AC_DEFINE(HAVE_W32CE_SYSTEM,1,[Defined if we run on WindowsCE])
-      GPG_ERROR_CONFIG_ISUBDIRAFTER="gpg-extra"
     fi
     force_use_syscfg=yes
 fi
-if test x$cross_compiling = xyes; then
+if test x"$gl_use_threads" = xno; then
+  lock_obj_h_generated=yes
+  if test ! -d src; then mkdir src; fi
+  host=$host $srcdir/src/gen-lock-obj.sh --disable-threads \
+    >src/lock-obj-pub.native.h
+  AC_MSG_NOTICE([generated src/lock-obj-pub.native.h for $host])
+elif test x$cross_compiling = xyes; then
+  case $host in
+    *-*-linux-gnu*)
+    AC_CHECK_TOOL(OBJDUMP, [objdump])
+    if test -n "$OBJDUMP"; then
+      lock_obj_h_generated=yes
+      if test ! -d src; then mkdir src; fi
+      LOCK_ABI_VERSION=1 host=$host host_alias=$host_alias \
+          CC=$CC OBJDUMP=$OBJDUMP \
+          ac_ext=$ac_ext ac_objext=$ac_objext \
+          AWK=$AWK $srcdir/src/gen-lock-obj.sh \
+          >src/lock-obj-pub.native.h
+      AC_MSG_NOTICE([generated src/lock-obj-pub.native.h using $host_alias-objdump and $AWK])
+    else
+      force_use_syscfg=yes
+    fi
+    ;;
+    *)
     force_use_syscfg=yes
+    ;;
+  esac
 fi
 
 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
@@ -497,11 +631,53 @@ AM_CONDITIONAL(HAVE_W64_SYSTEM, test "$have_w64_system" = yes)
 AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes)
 AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
 AM_CONDITIONAL(FORCE_USE_SYSCFG, test x$force_use_syscfg = xyes)
+AM_CONDITIONAL(HAVE_GENERATED_LOCK_OBJ_H, test x$lock_obj_h_generated = xyes)
 
 AC_DEFINE_UNQUOTED(HOST_TRIPLET_STRING, "$host", [The host triplet])
 
 
 #
+# gpgrt_log_clock may require linking with extra libaries.  As long as
+# we don't have a good test for this we require the use of this
+# configure option to enabling printing of a timestamp.
+#
+AC_MSG_CHECKING([whether to enable log_clock])
+AC_ARG_ENABLE(log_clock,
+              AS_HELP_STRING([--enable-log-clock],
+                             [enable log_clock timestamps]),
+              enable_log_clock=$enableval, enable_log_clock=no)
+AC_MSG_RESULT($enable_log_clock)
+if test "$enable_log_clock" = yes ; then
+  AC_DEFINE(ENABLE_LOG_CLOCK,1,[Defined to use log_clock timestamps])
+fi
+
+#
+# For now we do not build gpgscm by default.
+# Eventually we will reverse the meaning of that option.
+#
+build_gpgscm=no
+#AC_MSG_CHECKING([whether to build gpgscm])
+#AC_ARG_ENABLE(gpgscm,
+#              AS_HELP_STRING([--enable-gpgscm],
+#                             [build the gpgscm tool]),
+#              build_gpgscm=$enableval, build_gpgscm=no)
+#AC_MSG_RESULT($build_gpgscm)
+AM_CONDITIONAL([BUILD_GPGSCM], [test "x$build_gpgscm" != xno])
+
+
+#
+# Add -Werror to CFLAGS.  This hack can be used to avoid problems with
+# misbehaving autoconf tests in case the user supplied -Werror.
+#
+AC_ARG_ENABLE(werror,
+   AS_HELP_STRING([--enable-werror],
+                  [append -Werror to CFLAGS]),
+                  [if test $enableval = yes ; then
+                      CFLAGS="$CFLAGS -Werror"
+                   fi])
+
+
+#
 # Provide information about the build.
 #
 BUILD_REVISION="mym4_revision"
@@ -518,7 +694,7 @@ AC_SUBST(BUILD_VERSION)
 AC_SUBST(BUILD_FILEVERSION)
 
 AC_ARG_ENABLE([build-timestamp],
-  AC_HELP_STRING([--enable-build-timestamp],
+  AS_HELP_STRING([--enable-build-timestamp],
                  [set an explicit build timestamp for reproducibility.
                   (default is the current time in ISO-8601 format)]),
      [if test "$enableval" = "yes"; then
@@ -533,18 +709,18 @@ AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP",
 
 
 
-AC_ARG_ENABLE(languages, AC_HELP_STRING([--disable-languages],
+AC_ARG_ENABLE(languages, AS_HELP_STRING([--disable-languages],
                         [do not build support for other languages than C]))
 AM_CONDITIONAL([LANGUAGES_SOME], [test "x$enable_languages" != xno])
 
 build_doc=yes
-AC_ARG_ENABLE([doc], AC_HELP_STRING([--disable-doc],
+AC_ARG_ENABLE([doc], AS_HELP_STRING([--disable-doc],
                                     [do not build the documentation]),
                      build_doc=$enableval, build_doc=yes)
 AM_CONDITIONAL([BUILD_DOC], [test "x$build_doc" != xno])
 
 build_tests=yes
-AC_ARG_ENABLE([tests], AC_HELP_STRING([--disable-tests],
+AC_ARG_ENABLE([tests], AS_HELP_STRING([--disable-tests],
                                     [do not build the tests]),
                      build_tests=$enableval, build_tests=yes)
 AM_CONDITIONAL([BUILD_TESTS], [test "x$build_tests" != xno])
@@ -557,7 +733,10 @@ AC_CONFIG_FILES([doc/Makefile po/Makefile.in m4/Makefile])
 AC_CONFIG_FILES([src/Makefile tests/Makefile])
 AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpg-error.asd])
 AC_CONFIG_FILES([src/versioninfo.rc src/gpg-error.w32-manifest])
-AC_CONFIG_FILES([src/gpg-error-config], [chmod +x src/gpg-error-config])
+AC_CONFIG_FILES([src/gpg-error.pc])
+AC_CONFIG_FILES([src/gpg-error-config-old:src/gpg-error-config.in], [chmod +x src/gpg-error-config-old])
+AC_CONFIG_FILES([src/gpgrt-config], [chmod +x src/gpgrt-config])
+AC_CONFIG_FILES([src/gpg-error-config-test.sh], [chmod +x src/gpg-error-config-test.sh])
 
 AC_OUTPUT
 
index e30b2f8..33b56d5 100644 (file)
@@ -2,6 +2,11 @@
 #+TITLE: Various hacking notes
 #+STARTUP: showall
 
+* How to contribute
+
+  The following stuff explains some basic procedures you need to
+  follow if you want to contribute code or documentation.
+
 * No more ChangeLog files
 
   Do not modify any of the ChangeLog files in Libgpg-error.  Starting
   in a "real" ChangeLog file, but keep the maximum line length at 72
   or smaller, so that the generated ChangeLog lines, each with its
   leading TAB, will not exceed 80 columns.
+
+* Commit log keywords
+
+  - GnuPG-bug-id :: Values are comma or space delimited bug numbers
+                    from bug.gnupg.org pertaining to this commit.
+  - Debian-bug-id :: Same as above but from the Debian bug tracker.
+  - CVE-id :: CVE id number pertaining to this commit.
+  - Regression-due-to :: Commit id of the regression fixed by this commit.
+  - Fixes-commit :: Commit id this commit fixes.
+  - Reported-by :: Value is a name or mail address of a bug reporte.
+  - Suggested-by :: Value is a name or mail address of someone how
+                    suggested this change.
+  - Co-authored-by :: Name or mail address of a co-author
+  - Some-comments-by :: Name or mail address of the author of
+                        additional comments (commit log or code).
+  - Proofread-by :: Sometimes used by translation commits.
+  - Signed-off-by :: Name or mail address of the developer
+
+* Sending patches
+
+  - submitting patches, and subsequent discussions around them,
+    happens via the gnupg-devel@gnupg.org public mailing list
+
+  - send your patches to that list, preferably PGP/MIME signed. Make
+    sure to include a mention of 'libgpg-error' in the subject line,
+    the list is used for several different projects
+
+  - if you're working from the git repo, here's a suggested workflow:
+
+    - configure git send-email defaults:
+
+        git config format.subjectPrefix 'PATCH libgpg-error'
+        git config sendemail.to gnupg-devel@gnupg.org
+
+      Note that running ./autogen.sh on a fresh clone will do this for
+      you.
+
+    - hack hack hack
+
+    - commit your changes; group changes into easily-reviewable commit
+      units, feel free to submit several patches at once
+
+    - e.g. if you want to submit a single patch on top of master, do:
+      git send-email --annotate -1
+
+    - e.g. if you have two commits on top of master, do:
+      git send-email --annotate --cover-letter -2
+      (that prompts you for a summary mail to precede your actual
+      patch mails)
+
+    - use --dry-run to test your setup
index 565bb09..46b4545 100644 (file)
 # License along with this program; if not, see <https://www.gnu.org/licenses/>.
 
 
-EXTRA_DIST = HACKING errorref.txt \
-            yat2m.c
+EXTRA_DIST = HACKING errorref.txt
+
+bin_PROGRAMS = yat2m
+yat2m_SOURCES = yat2m.c
+yat2m_CFLAGS= -DPACKAGE_VERSION="\"$(PACKAGE_VERSION)\""
 
 DISTCLEANFILES = gpgrt.cps yat2m-stamp.tmp yat2m-stamp $(myman_pages)
-CLEANFILES = yat2m errorref.txt.x
+CLEANFILES = errorref.txt.x
 
 info_TEXINFOS = gpgrt.texi
 gpgrt_TEXINFOS = lgpl.texi gpl.texi
@@ -30,23 +33,32 @@ YAT2M_OPTIONS = -I $(srcdir) \
        --release "Libgpg-error @PACKAGE_VERSION@" --source "GnuPG"
 
 myman_sources = gpgrt.texi
-myman_pages   = gpg-error-config.1
+myman_pages   = gpgrt-config.1
 
 man_MANS = $(myman_pages)
 
-yat2m: yat2m.c
-       $(CC_FOR_BUILD) -o $@ $(srcdir)/yat2m.c
+if CROSS_COMPILING
+YAT2M_CMD = ./yat2m-for-build$(EXEEXT_FOR_BUILD)
+YAT2M_DEP = yat2m-for-build$(EXEEXT_FOR_BUILD)
+CLEANFILES += yat2m-for-build$(EXEEXT_FOR_BUILD)
 
+yat2m-for-build$(EXEEXT_FOR_BUILD): yat2m.c
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \
+       $(CPPFLAGS_FOR_BUILD) -o $@ $(srcdir)/yat2m.c
+else
+YAT2M_CMD = ./yat2m$(EXEEXT)
+YAT2M_DEP = yat2m$(EXEEXT)
+endif
 
-yat2m-stamp: $(myman_sources)
+yat2m-stamp: $(myman_sources) $(srcdir)/version.texi
        @rm -f yat2m-stamp.tmp
        @touch yat2m-stamp.tmp
        for file in $(myman_sources) ; do \
-              ./yat2m $(YAT2M_OPTIONS) --store \
+              $(YAT2M_CMD) $(YAT2M_OPTIONS) --store \
                  `test -f '$$file' || echo '$(srcdir)/'`$$file ; done
        @mv -f yat2m-stamp.tmp $@
 
-yat2m-stamp: yat2m
+yat2m-stamp: $(YAT2M_DEP)
 
 $(myman_pages) : yat2m-stamp
        @if test -f $@; then :; else \
@@ -68,7 +80,7 @@ gpgrt.texi : $(gpgrt_TEXINFOS)
        touch $(srcdir)/gpgrt.texi
 
 errorref.txt.x : errorref.txt
-       sed '/^##/ d' $< >$@
+       sed '/^##/ d' $(srcdir)/errorref.txt >$@
        echo "# Installed by $(PACKAGE_NAME) $(PACKAGE_VERSION)" >>$@
 
 install-data-local: errorref.txt.x
index eccc77f..96563d0 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this program; if not, see <https://www.gnu.org/licenses/>.
+
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -95,28 +106,43 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
+bin_PROGRAMS = yat2m$(EXEEXT)
+@CROSS_COMPILING_TRUE@am__append_1 = yat2m-for-build$(EXEEXT_FOR_BUILD)
 subdir = doc
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-       $(gpgrt_TEXINFOS) $(top_srcdir)/build-aux/mdate-sh \
-       $(srcdir)/version.texi $(srcdir)/stamp-vti \
-       $(top_srcdir)/build-aux/texinfo.tex
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/autobuild.m4 \
-       $(top_srcdir)/m4/estream.m4 $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/ax_cc_for_build.m4 \
+       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/estream.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gnupg-misc.m4 \
        $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
        $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/lock.m4 \
        $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
        $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
        $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/threadlib.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
+       $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \
+       $(srcdir)/stamp-vti $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" \
+       "$(DESTDIR)$(man1dir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_yat2m_OBJECTS = yat2m-yat2m.$(OBJEXT)
+yat2m_OBJECTS = $(am_yat2m_OBJECTS)
+yat2m_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+yat2m_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(yat2m_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -129,8 +155,31 @@ AM_V_at = $(am__v_at_@AM_V@)
 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
 am__v_at_0 = @
 am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/yat2m-yat2m.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(yat2m_SOURCES)
+DIST_SOURCES = $(yat2m_SOURCES)
 AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
 am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@)
 am__v_DVIPS_0 = @echo "  DVIPS   " $@;
@@ -177,7 +226,6 @@ am__can_run_installinfo = \
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
-am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -209,6 +257,28 @@ man1dir = $(mandir)/man1
 NROFF = nroff
 MANS = $(man_MANS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(gpgrt_TEXINFOS) $(srcdir)/Makefile.in \
+       $(top_srcdir)/build-aux/depcomp \
+       $(top_srcdir)/build-aux/mdate-sh \
+       $(top_srcdir)/build-aux/texinfo.tex
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -240,18 +310,20 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
 FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GPG_ERROR_CONFIG_CFLAGS = @GPG_ERROR_CONFIG_CFLAGS@
 GPG_ERROR_CONFIG_HOST = @GPG_ERROR_CONFIG_HOST@
-GPG_ERROR_CONFIG_ISUBDIRAFTER = @GPG_ERROR_CONFIG_ISUBDIRAFTER@
 GPG_ERROR_CONFIG_LIBS = @GPG_ERROR_CONFIG_LIBS@
+GPG_ERROR_CONFIG_LIBS_PRIVATE = @GPG_ERROR_CONFIG_LIBS_PRIVATE@
 GPG_ERROR_CONFIG_MT_CFLAGS = @GPG_ERROR_CONFIG_MT_CFLAGS@
 GPG_ERROR_CONFIG_MT_LIBS = @GPG_ERROR_CONFIG_MT_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
+INSTALLSHELLPATH = @INSTALLSHELLPATH@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -259,6 +331,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
+LDADD_FOR_TESTS_KLUDGE = @LDADD_FOR_TESTS_KLUDGE@
 LDFLAGS = @LDFLAGS@
 LIBGPG_ERROR_LT_AGE = @LIBGPG_ERROR_LT_AGE@
 LIBGPG_ERROR_LT_CURRENT = @LIBGPG_ERROR_LT_CURRENT@
@@ -267,9 +340,14 @@ LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBREADLINE = @LIBREADLINE@
 LIBS = @LIBS@
+LIBSTDTHREAD = @LIBSTDTHREAD@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
+LIB_NETWORK = @LIB_NETWORK@
 LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
 LIPO = @LIPO@
 LN_S = @LN_S@
@@ -356,6 +434,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -364,23 +443,27 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-EXTRA_DIST = HACKING errorref.txt \
-            yat2m.c
-
+EXTRA_DIST = HACKING errorref.txt
+yat2m_SOURCES = yat2m.c
+yat2m_CFLAGS = -DPACKAGE_VERSION="\"$(PACKAGE_VERSION)\""
 DISTCLEANFILES = gpgrt.cps yat2m-stamp.tmp yat2m-stamp $(myman_pages)
-CLEANFILES = yat2m errorref.txt.x
+CLEANFILES = errorref.txt.x $(am__append_1)
 info_TEXINFOS = gpgrt.texi
 gpgrt_TEXINFOS = lgpl.texi gpl.texi
 YAT2M_OPTIONS = -I $(srcdir) \
        --release "Libgpg-error @PACKAGE_VERSION@" --source "GnuPG"
 
 myman_sources = gpgrt.texi
-myman_pages = gpg-error-config.1
+myman_pages = gpgrt-config.1
 man_MANS = $(myman_pages)
+@CROSS_COMPILING_FALSE@YAT2M_CMD = ./yat2m$(EXEEXT)
+@CROSS_COMPILING_TRUE@YAT2M_CMD = ./yat2m-for-build$(EXEEXT_FOR_BUILD)
+@CROSS_COMPILING_FALSE@YAT2M_DEP = yat2m$(EXEEXT)
+@CROSS_COMPILING_TRUE@YAT2M_DEP = yat2m-for-build$(EXEEXT_FOR_BUILD)
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .dvi .html .info .pdf .ps .texi
+.SUFFIXES: .c .dvi .html .info .lo .o .obj .pdf .ps .texi
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -393,14 +476,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --gnu doc/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -411,6 +493,108 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+       fi; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p \
+        || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
+
+yat2m$(EXEEXT): $(yat2m_OBJECTS) $(yat2m_DEPENDENCIES) $(EXTRA_yat2m_DEPENDENCIES) 
+       @rm -f yat2m$(EXEEXT)
+       $(AM_V_CCLD)$(yat2m_LINK) $(yat2m_OBJECTS) $(yat2m_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yat2m-yat2m.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+yat2m-yat2m.o: yat2m.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(yat2m_CFLAGS) $(CFLAGS) -MT yat2m-yat2m.o -MD -MP -MF $(DEPDIR)/yat2m-yat2m.Tpo -c -o yat2m-yat2m.o `test -f 'yat2m.c' || echo '$(srcdir)/'`yat2m.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/yat2m-yat2m.Tpo $(DEPDIR)/yat2m-yat2m.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='yat2m.c' object='yat2m-yat2m.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(yat2m_CFLAGS) $(CFLAGS) -c -o yat2m-yat2m.o `test -f 'yat2m.c' || echo '$(srcdir)/'`yat2m.c
+
+yat2m-yat2m.obj: yat2m.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(yat2m_CFLAGS) $(CFLAGS) -MT yat2m-yat2m.obj -MD -MP -MF $(DEPDIR)/yat2m-yat2m.Tpo -c -o yat2m-yat2m.obj `if test -f 'yat2m.c'; then $(CYGPATH_W) 'yat2m.c'; else $(CYGPATH_W) '$(srcdir)/yat2m.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/yat2m-yat2m.Tpo $(DEPDIR)/yat2m-yat2m.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='yat2m.c' object='yat2m-yat2m.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(yat2m_CFLAGS) $(CFLAGS) -c -o yat2m-yat2m.obj `if test -f 'yat2m.c'; then $(CYGPATH_W) 'yat2m.c'; else $(CYGPATH_W) '$(srcdir)/yat2m.c'; fi`
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -472,15 +656,16 @@ $(srcdir)/stamp-vti: gpgrt.texi $(top_srcdir)/configure
        echo "@set UPDATED $$1 $$2 $$3"; \
        echo "@set UPDATED-MONTH $$2 $$3"; \
        echo "@set EDITION $(VERSION)"; \
-       echo "@set VERSION $(VERSION)") > vti.tmp
-       @cmp -s vti.tmp $(srcdir)/version.texi \
-         || (echo "Updating $(srcdir)/version.texi"; \
-             cp vti.tmp $(srcdir)/version.texi)
-       -@rm -f vti.tmp
+       echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \
+       (cmp -s vti.tmp$$$$ $(srcdir)/version.texi \
+         || (echo "Updating $(srcdir)/version.texi" && \
+             cp vti.tmp$$$$ $(srcdir)/version.texi.tmp$$$$ && \
+             mv $(srcdir)/version.texi.tmp$$$$ $(srcdir)/version.texi)) && \
+       rm -f vti.tmp$$$$ $(srcdir)/version.texi.$$$$
        @cp $(srcdir)/version.texi $@
 
 mostlyclean-vti:
-       -rm -f vti.tmp
+       -rm -f vti.tmp* $(srcdir)/version.texi.tmp*
 
 maintainer-clean-vti:
 @MAINTAINER_MODE_TRUE@ -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
@@ -620,14 +805,63 @@ uninstall-man1:
        } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
        dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
-tags TAGS:
 
-ctags CTAGS:
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
 
-cscope cscopelist:
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
 
-distdir: $(DISTFILES)
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -662,9 +896,9 @@ distdir: $(DISTFILES)
          dist-info
 check-am: all-am
 check: check-am
-all-am: Makefile $(INFO_DEPS) $(MANS)
+all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(MANS)
 installdirs:
-       for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \
+       for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: install-am
@@ -701,11 +935,14 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-aminfo clean-generic clean-libtool mostlyclean-am
+clean-am: clean-aminfo clean-binPROGRAMS clean-generic clean-libtool \
+       mostlyclean-am
 
 distclean: distclean-am
+               -rm -f ./$(DEPDIR)/yat2m-yat2m.Po
        -rm -f Makefile
-distclean-am: clean-am distclean-generic
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-tags
 
 dvi: dvi-am
 
@@ -738,7 +975,7 @@ install-dvi-am: $(DVIS)
          echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \
          $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \
        done
-install-exec-am:
+install-exec-am: install-binPROGRAMS
 
 install-html: install-html-am
 
@@ -839,14 +1076,15 @@ install-ps-am: $(PSS)
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
+               -rm -f ./$(DEPDIR)/yat2m-yat2m.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-aminfo \
        maintainer-clean-generic maintainer-clean-vti
 
 mostlyclean: mostlyclean-am
 
-mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \
-       mostlyclean-libtool mostlyclean-vti
+mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool mostlyclean-vti
 
 pdf: pdf-am
 
@@ -856,17 +1094,20 @@ ps: ps-am
 
 ps-am: $(PSS)
 
-uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
-       uninstall-local uninstall-man uninstall-pdf-am uninstall-ps-am
+uninstall-am: uninstall-binPROGRAMS uninstall-dvi-am uninstall-html-am \
+       uninstall-info-am uninstall-local uninstall-man \
+       uninstall-pdf-am uninstall-ps-am
 
 uninstall-man: uninstall-man1
 
 .MAKE: install-am install-strip
 
-.PHONY: all all-am check check-am clean clean-aminfo clean-generic \
-       clean-libtool cscopelist-am ctags-am dist-info distclean \
-       distclean-generic distclean-libtool distdir dvi dvi-am html \
-       html-am info info-am install install-am install-data \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-aminfo clean-binPROGRAMS clean-generic clean-libtool \
+       cscopelist-am ctags ctags-am dist-info distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-binPROGRAMS install-data \
        install-data-am install-data-local install-dvi install-dvi-am \
        install-exec install-exec-am install-html install-html-am \
        install-info install-info-am install-man install-man1 \
@@ -874,25 +1115,29 @@ uninstall-man: uninstall-man1
        install-strip installcheck installcheck-am installdirs \
        maintainer-clean maintainer-clean-aminfo \
        maintainer-clean-generic maintainer-clean-vti mostlyclean \
-       mostlyclean-aminfo mostlyclean-generic mostlyclean-libtool \
-       mostlyclean-vti pdf pdf-am ps ps-am tags-am uninstall \
-       uninstall-am uninstall-dvi-am uninstall-html-am \
-       uninstall-info-am uninstall-local uninstall-man uninstall-man1 \
-       uninstall-pdf-am uninstall-ps-am
+       mostlyclean-aminfo mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool mostlyclean-vti pdf pdf-am ps ps-am tags \
+       tags-am uninstall uninstall-am uninstall-binPROGRAMS \
+       uninstall-dvi-am uninstall-html-am uninstall-info-am \
+       uninstall-local uninstall-man uninstall-man1 uninstall-pdf-am \
+       uninstall-ps-am
+
+.PRECIOUS: Makefile
 
 
-yat2m: yat2m.c
-       $(CC_FOR_BUILD) -o $@ $(srcdir)/yat2m.c
+@CROSS_COMPILING_TRUE@yat2m-for-build$(EXEEXT_FOR_BUILD): yat2m.c
+@CROSS_COMPILING_TRUE@ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \
+@CROSS_COMPILING_TRUE@ $(CPPFLAGS_FOR_BUILD) -o $@ $(srcdir)/yat2m.c
 
-yat2m-stamp: $(myman_sources)
+yat2m-stamp: $(myman_sources) $(srcdir)/version.texi
        @rm -f yat2m-stamp.tmp
        @touch yat2m-stamp.tmp
        for file in $(myman_sources) ; do \
-              ./yat2m $(YAT2M_OPTIONS) --store \
+              $(YAT2M_CMD) $(YAT2M_OPTIONS) --store \
                  `test -f '$$file' || echo '$(srcdir)/'`$$file ; done
        @mv -f yat2m-stamp.tmp $@
 
-yat2m-stamp: yat2m
+yat2m-stamp: $(YAT2M_DEP)
 
 $(myman_pages) : yat2m-stamp
        @if test -f $@; then :; else \
@@ -914,7 +1159,7 @@ gpgrt.texi : $(gpgrt_TEXINFOS)
        touch $(srcdir)/gpgrt.texi
 
 errorref.txt.x : errorref.txt
-       sed '/^##/ d' $< >$@
+       sed '/^##/ d' $(srcdir)/errorref.txt >$@
        echo "# Installed by $(PACKAGE_NAME) $(PACKAGE_VERSION)" >>$@
 
 install-data-local: errorref.txt.x
index 284123b..26d73fd 100644 (file)
@@ -268,7 +268,8 @@ GPG_ERR_UNUSABLE_SECKEY                 Unusable secret key
 GPG_ERR_INV_VALUE               Invalid value
 
     NTBTLS: - A DH parameter is out of range
-
+    GnuPG:  - An Assuan server returns a status line with
+              unexpected values.
 
 GPG_ERR_BAD_CERT_CHAIN          Bad certificate chain
 
@@ -481,6 +482,9 @@ GPG_ERR_NOTHING_FOUND           Nothing found
 
 GPG_ERR_WRONG_BLOB_TYPE                 Wrong blob type
 
+    GNUPG: - The keyboxd returns an unexpected blob
+             (e.g. OpenPGP was requested but X.509 returned).
+
 GPG_ERR_MISSING_VALUE           Missing value
 
     GNUPG: - Not enough parameters for a secret key send to gpg-agent.
@@ -494,6 +498,14 @@ GPG_ERR_PIN_BLOCKED             PIN blocked
 
 GPG_ERR_USE_CONDITIONS          Conditions of use not satisfied
 
+    GNUPG: - The PIN given to a smartcard is too short or has
+             unacceptable characters so that the smartcard does
+             not even try to verify it.
+           - The smartcard can't do an operation because some
+             intermediate command send to a card is missing or the
+             card can't use the provided data due to an unsupported
+             algorithm.
+
 GPG_ERR_PIN_NOT_SYNCED          PINs are not synced
 
 GPG_ERR_INV_CRL                         Invalid CRL
@@ -568,7 +580,6 @@ GPG_ERR_INV_STATE               Invalid state
     NTBTLS: - Data received in an unexpected state.
             - A function is called while not being in the right state.
 
-
 GPG_ERR_DUP_VALUE               Duplicated value
 
 GPG_ERR_MISSING_ACTION          Missing action
@@ -596,6 +607,7 @@ GPG_ERR_INV_CERT_OBJ            Invalid certificate object
     GPGME: - A bad certificate (gpgme_key_t) has been passed to a
              function.  For example it might be incomplete due to a
              missing fingerprint.
+    GNUPG: - A certificate has a length of zero.
 
 
 GPG_ERR_UNKNOWN_NAME            Unknown name
@@ -781,15 +793,20 @@ GPG_ERR_SEXP_ODD_HEX_NUMBERS  Odd hexadecimal numbers in S-expression
 
 GPG_ERR_SEXP_BAD_OCT_CHAR     Bad octal character in S-expression
 
-GPG_ERR_SUBKEYS_EXP_REV           All subkeys are expired or revoked
+GPG_ERR_SUBKEYS_EXP_REV       All subkeys are expired or revoked
 
-GPG_ERR_DB_CORRUPTED            Database is corrupted
+GPG_ERR_DB_CORRUPTED          Database is corrupted
 
-GPG_ERR_SERVER_FAILED           Server indicated a failure
+GPG_ERR_SERVER_FAILED         Server indicated a failure
 
-GPG_ERR_NO_NAME                         No name
+GPG_ERR_NO_NAME               No name
 
-    EAI_NONAME may be mapped to this code.
+    GNUPG: - No component given in gpgconf runs.
+           - A field name is missing in an import/export filter.
+           - "Domain not found".
+           - "Host not found".
+           - Host or service name not found (EAI_NONAME).
+           - No or erroneous SRV record.
 
 GPG_ERR_NO_KEY          No key
 
@@ -1053,6 +1070,34 @@ GPG_ERR_WRONG_NAME              Wrong name
 
     NTBTLS: - Hostname does not match the certificate
 
+GPG_ERR_NO_AUTH                 Not authenticated
+
+    GnuPG: - A smartcard requires authentication
+
+GPG_ERR_BAD_AUTH                Bad authentication
+
+    GnuPG: - A smartcard could not be authenticated.  For example
+             a wrong authentication key was used with a PIV card.
+
+GPG_ERR_NO_KEYBOXD              No Keyboxd running
+
+    GnuPG: - The keyboxd component is not running
+
+GPG_ERR_KEYBOXD                 Keyboxd error
+
+    GnuPG: - Malfunction in the keyboxd
+
+GPG_ERR_NO_SERVICE              Service is not running
+
+    A component is not running.  Tnis is a generic version of
+    GPG_ERR_NO_AGENT et al.
+
+GPG_ERR_SERVICE                 Service error
+
+    An error occured in a service component.  This is a generic
+    version of GPG_ERR_AGENT et al.
+
+
 GPG_ERR_SYSTEM_BUG              System bug detected
 
    The underlying operating system misbehaved.  For example it wrote
@@ -1119,4 +1164,69 @@ GPG_ERR_LDAP_OTHER_GENERAL      LDAP Other general error
   #define LDAP_E_ERROR(n)        LDAP_RANGE((n),0x1000,0x3FFF)
   #define LDAP_X_ERROR(n)        LDAP_RANGE((n),0x4000,0xFFFF)
 
+GPG_ERR_SQL_OK          SQL success
+
+  This code is normally not used because it it mapped to GPG_ERR_NO_ERROR.
+
+GPG_ERR_SQL_ERROR      SQL error
+
+GPG_ERR_SQL_INTERNAL   Internal logic error in SQL library
+
+GPG_ERR_SQL_PERM       Access permission denied (SQL)
+
+GPG_ERR_SQL_ABORT      SQL abort was requested
+
+GPG_ERR_SQL_BUSY       SQL database file is locked
+
+GPG_ERR_SQL_LOCKED     An SQL table in the database is locked
+
+GPG_ERR_SQL_NOMEM      SQL library ran out of core
+
+GPG_ERR_SQL_READONLY   Attempt to write a readonly SQL database
+
+GPG_ERR_SQL_INTERRUPT  SQL operation terminated by interrupt
+
+GPG_ERR_SQL_IOERR      I/O error during SQL operation
+
+GPG_ERR_SQL_CORRUPT    SQL database disk image is malformed
+
+GPG_ERR_SQL_NOTFOUND   Unknown opcode in SQL file control
+
+GPG_ERR_SQL_FULL       Insertion failed because SQL database is full
+
+GPG_ERR_SQL_CANTOPEN   Unable to open the SQL database file
+
+GPG_ERR_SQL_PROTOCOL   SQL database lock protocol error
+
+GPG_ERR_SQL_EMPTY      (internal SQL code: empty)
+
+GPG_ERR_SQL_SCHEMA     SQL database schema changed
+
+GPG_ERR_SQL_TOOBIG     String or blob exceeds size limit (SQL)
+
+GPG_ERR_SQL_CONSTRAINT SQL abort due to constraint violation
+
+GPG_ERR_SQL_MISMATCH   Data type mismatch (SQL)
+
+GPG_ERR_SQL_MISUSE     SQL library used incorrectly
+
+GPG_ERR_SQL_NOLFS      SQL library uses unsupported OS features
+
+GPG_ERR_SQL_AUTH       Authorization denied (SQL)
+
+GPG_ERR_SQL_FORMAT     (unused SQL code: format)
+
+GPG_ERR_SQL_RANGE      SQL bind parameter out of range
+
+GPG_ERR_SQL_NOTADB     File opened that is not an SQL database file
+
+GPG_ERR_SQL_NOTICE     Notifications from SQL logger
+
+GPG_ERR_SQL_WARNING    Warnings from SQL logger
+
+GPG_ERR_SQL_ROW                SQL has another row ready
+
+GPG_ERR SQL_DONE       SQL has finished executing
+
+
 ## end of errorref.txt
index 350955f..0e7dfbe 100644 (file)
@@ -1,6 +1,6 @@
-This is gpgrt.info, produced by makeinfo version 6.3 from gpgrt.texi.
+This is gpgrt.info, produced by makeinfo version 6.5 from gpgrt.texi.
 
-This manual is for Libgpg-error (version 1.27, 17 January 2017), which
+This manual is for Libgpg-error (version 1.43, 7 December 2018), which
 is a library for code used by all GnuPG related packages.
 
 Copyright (C) 2014 g10 Code GmbH
@@ -22,7 +22,7 @@ File: gpgrt.info,  Node: Top,  Next: Introduction,  Up: (dir)
 The Libgpg-error Library
 ************************
 
-This manual is for Libgpg-error (version 1.27, 17 January 2017), which
+This manual is for Libgpg-error (version 1.43, 7 December 2018), which
 is a library for code used by all GnuPG related packages.
 
 Copyright (C) 2014 g10 Code GmbH
@@ -162,32 +162,32 @@ which the header file is located to the compilers include file search
 path (via the '-I' option).
 
    However, the path to the include file is determined at the time the
-source is configured.  To solve this problem, Libgpg-error ships with a
-small helper program 'gpg-error-config' that knows the path to the
+source is configured.  To solve this problem, Libgpg-error ships with
+the small helper program 'gpgrt-config' which know the path to the
 include file and other configuration options.  The options that need to
 be added to the compiler invocation at compile time are output by the
-'--cflags' option to 'gpg-error-config'.  The following example shows
-how it can be used at the command line:
+'--cflags' option to 'gpgrt-config' The following example shows how it
+can be used at the command line:
 
-     gcc -c foo.c $(gpg-error-config --cflags)
+     gcc -c foo.c $(gpgrt-config --cflags)
 
-   Adding the output of 'gpg-error-config --cflags' to the compiler’s
+   Adding the output of 'gpgrt-config --cflags' to the compiler’s
 command line will ensure that the compiler can find the Libgpg-error
 header file.
 
    A similar problem occurs when linking the program with the library.
 Again, the compiler has to find the library files.  For this to work,
 the path to the library files has to be added to the library search path
-(via the '-L' option).  For this, the option '--libs' to
-'gpg-error-config' can be used.  The example shows how to link 'foo.o'
-with the Libgpg-error library to a program 'foo'.
+(via the '-L' option).  For this, the option '--libs' to 'gpgrt-config'
+can be used.  The example shows how to link 'foo.o' with the
+Libgpg-error library to a program 'foo'.
 
-     gcc -o foo foo.o $(gpg-error-config --libs)
+     gcc -o foo foo.o $(gpgrt-config --libs)
 
    Of course you can also combine both examples to a single command by
-specifying both options to 'gpg-error-config':
+specifying both options to 'gpgrt-config':
 
-     gcc -o foo foo.c $(gpg-error-config --cflags --libs)
+     gcc -o foo foo.c $(gpgrt-config --cflags --libs)
 
 \1f
 File: gpgrt.info,  Node: Building sources using Automake,  Next: Initializing the library,  Prev: Building sources,  Up: Preparation
@@ -197,7 +197,7 @@ File: gpgrt.info,  Node: Building sources using Automake,  Next: Initializing th
 
 It is much easier if you use GNU Automake instead of writing your own
 Makefiles.  If you do that, you do not have to worry about finding and
-invoking the 'gpg-error-config' script at all.  Libgpg-error provides an
+invoking the 'gpgrt-config' script at all.  Libgpg-error provides an
 extension to Automake that does all the work for you.
 
  -- Macro: AM_PATH_GPG_ERROR ([MINIMUM-VERSION], [ACTION-IF-FOUND],
@@ -214,8 +214,8 @@ extension to Automake that does all the work for you.
      warning is printed and the string 'libgpg-error' is appended to the
      variable 'gpg_config_script_warn'.
 
-     This macro searches for 'gpg-error-config' along the PATH. If you
-     are cross-compiling, it is useful to set the environment variable
+     This macro searches for 'gpgrt-config' along the PATH. If you are
+     cross-compiling, it is useful to set the environment variable
      'SYSROOT' to the top directory of your target.  The macro will then
      first look for the helper program in the 'bin' directory below that
      top directory.  An absolute directory name must be used for
@@ -279,20 +279,20 @@ File: gpgrt.info,  Node: Tools,  Next: Library Copying,  Prev: Generalities,  Up
 
 * Menu:
 
-* gpg-error-config::    Print required compiler flags
+* gpgrt-config::    Print required compiler flags
 
 \1f
-File: gpgrt.info,  Node: gpg-error-config,  Up: Tools
+File: gpgrt.info,  Node: gpgrt-config,  Up: Tools
 
 4.1 Print required compiler flags
 =================================
 
-'gpg-error-config' is a tool that is used to configure to determine the
+'gpgrt-config' is a tool that is used to configure to determine the
 compiler and linker flags that should be used to compile and link
 programs that use Libgpg-error.  It is also used internally to the '.m4'
 macros for GNU autoconf that are included with Libgpg-error.
 
-'gpg-error-config' accepts the following options:
+'gpgrt-config' accepts the following options:
 
 '--mt'
      Provide output appropriate for multithreaded programs.  '--mt' is
@@ -1248,15 +1248,15 @@ Node: Overview\7f3111
 Node: Preparation\7f3307
 Node: Header\7f4108
 Node: Building sources\7f5193
-Node: Building sources using Automake\7f6956
-Node: Initializing the library\7f8901
-Node: Multi-Threading\7f10089
-Node: Generalities\7f10231
-Node: Tools\7f10418
-Node: gpg-error-config\7f10588
-Node: Library Copying\7f12167
-Node: Copying\7f40268
-Node: Concept Index\7f59438
-Node: Function and Data Index\7f59735
+Node: Building sources using Automake\7f6924
+Node: Initializing the library\7f8861
+Node: Multi-Threading\7f10049
+Node: Generalities\7f10191
+Node: Tools\7f10378
+Node: gpgrt-config\7f10544
+Node: Library Copying\7f12111
+Node: Copying\7f40212
+Node: Concept Index\7f59382
+Node: Function and Data Index\7f59679
 \1f
 End Tag Table
index 857973a..d4a3b41 100644 (file)
@@ -209,18 +209,20 @@ directory in which the header file is located to the compilers include
 file search path (via the @option{-I} option).
 
 However, the path to the include file is determined at the time the
-source is configured.  To solve this problem, Libgpg-error ships with a small
-helper program @command{gpg-error-config} that knows the path to the
-include file and other configuration options.  The options that need
-to be added to the compiler invocation at compile time are output by
-the @option{--cflags} option to @command{gpg-error-config}.  The following
-example shows how it can be used at the command line:
+source is configured.  To solve this problem, Libgpg-error ships with
+the small helper program @command{gpgrt-config}
+which know the path to the include file
+and other configuration options.  The options that need to be added to
+the compiler invocation at compile time are output by the
+@option{--cflags} option to @command{gpgrt-config}
+The following example shows how it can be
+used at the command line:
 
 @example
-gcc -c foo.c $(gpg-error-config --cflags)
+gcc -c foo.c $(gpgrt-config --cflags)
 @end example
 
-Adding the output of @samp{gpg-error-config --cflags} to the
+Adding the output of @samp{gpgrt-config --cflags} to the
 compiler’s command line will ensure that the compiler can find the
 Libgpg-error header file.
 
@@ -228,19 +230,19 @@ A similar problem occurs when linking the program with the library.
 Again, the compiler has to find the library files.  For this to work,
 the path to the library files has to be added to the library search
 path (via the @option{-L} option).  For this, the option
-@option{--libs} to @command{gpg-error-config} can be used.  The
+@option{--libs} to @command{gpgrt-config} can be used.  The
 example shows how to link @file{foo.o} with the Libgpg-error library
 to a program @command{foo}.
 
 @example
-gcc -o foo foo.o $(gpg-error-config --libs)
+gcc -o foo foo.o $(gpgrt-config --libs)
 @end example
 
 Of course you can also combine both examples to a single command by
-specifying both options to @command{gpg-error-config}:
+specifying both options to @command{gpgrt-config}:
 
 @example
-gcc -o foo foo.c $(gpg-error-config --cflags --libs)
+gcc -o foo foo.c $(gpgrt-config --cflags --libs)
 @end example
 
 @node Building sources using Automake
@@ -248,7 +250,7 @@ gcc -o foo foo.c $(gpg-error-config --cflags --libs)
 
 It is much easier if you use GNU Automake instead of writing your own
 Makefiles.  If you do that, you do not have to worry about finding and
-invoking the @command{gpg-error-config} script at all.  Libgpg-error
+invoking the @command{gpgrt-config} script at all.  Libgpg-error
 provides an extension to Automake that does all the work for you.
 
 @c A simple macro for optional variables.
@@ -269,7 +271,7 @@ the used helper script does not match the target type you are building
 for a warning is printed and the string @code{libgpg-error} is
 appended to the variable @code{gpg_config_script_warn}.
 
-This macro searches for @command{gpg-error-config} along the PATH.  If
+This macro searches for @command{gpgrt-config} along the PATH.  If
 you are cross-compiling, it is useful to set the environment variable
 @code{SYSROOT} to the top directory of your target.  The macro will
 then first look for the helper program in the @file{bin} directory
@@ -338,27 +340,27 @@ TBD.  (Description of the error function may be taken from Libgcrypt.)
 @chapter Tools
 
 @menu
-* gpg-error-config::    Print required compiler flags
+* gpgrt-config::    Print required compiler flags
 @end menu
 
 @c The original version of this man page has been written for Debian and was
 @c contributed to libgpg-error by Daniel Kahn Gillmor <dkg@fifthhorseman.net>.
-@manpage gpg-error-config.1
-@node gpg-error-config
+@manpage gpgrt-config.1
+@node gpgrt-config
 @section Print required compiler flags
 @ifset manverb
-.B gpg-error-config
+.B gpgrt-config
 \- Script to get information about the installed version of libgpg-error
 @end ifset
 
 @mansect synopsis
 @ifset manverb
-.B  gpg-error-config
+.B  gpgrt-config
 .RI [ options ]
 @end ifset
 
 @mansect description
-@command{gpg-error-config} is a tool that is used to configure to
+@command{gpgrt-config} is a tool that is used to configure to
 determine the compiler and linker flags that should be used to compile
 and link programs that use Libgpg-error. It is also used
 internally to the @code{.m4} macros for GNU autoconf that are included
@@ -366,7 +368,7 @@ with Libgpg-error.
 
 @mansect options
 @noindent
-@command{gpg-error-config} accepts the following options:
+@command{gpgrt-config} accepts the following options:
 
 @table @gnupgtabopt
 
index 6e2ad60..e50742e 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 17 January 2017
-@set UPDATED-MONTH January 2017
-@set EDITION 1.27
-@set VERSION 1.27
+@set UPDATED 7 December 2018
+@set UPDATED-MONTH December 2018
+@set EDITION 1.43
+@set VERSION 1.43
index 6e2ad60..e50742e 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 17 January 2017
-@set UPDATED-MONTH January 2017
-@set EDITION 1.27
-@set VERSION 1.27
+@set UPDATED 7 December 2018
+@set UPDATED-MONTH December 2018
+@set EDITION 1.43
+@set VERSION 1.43
index 9b76f19..10e03ec 100644 (file)
@@ -1,5 +1,5 @@
 /* yat2m.c - Yet Another Texi 2 Man converter
- *     Copyright (C) 2005, 2013, 2015, 2016 g10 Code GmbH
+ *     Copyright (C) 2005, 2013, 2015, 2016, 2017 g10 Code GmbH
  *      Copyright (C) 2006, 2008, 2011 Free Software Foundation, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -49,7 +49,7 @@
       .B whateever you want
       @end ifset
 
-    alternativly a special comment may be used:
+    alternatively a special comment may be used:
 
       @c man:.B whatever you want
 
 
 
 #define PGM "yat2m"
-#define VERSION "1.0"
+#ifdef PACKAGE_VERSION
+# define VERSION PACKAGE_VERSION
+#else
+# define VERSION "1.0"
+#endif
 
 /* The maximum length of a line including the linefeed and one extra
    character. */
 /* Number of allowed condition nestings.  */
 #define MAX_CONDITION_NESTING  10
 
+static char const default_css[] =
+  "<style type=\"text/css\">\n"
+  "  .y2m {\n"
+  "    font-family: monospace;\n"
+  "  }\n"
+  "  .y2m u {\n"
+  "    text-decoration: underline;\n"
+  "  }\n"
+  "  .y2m-sc {\n"
+  "    font-variant: small-caps;\n"
+  "  }\n"
+  "  .y2m li {\n"
+  "    margin-top: 1em;\n"
+  "  }\n"
+  "  .y2m-item {\n"
+  "     display: block;\n"
+  "     font-weight: bold;\n"
+  "  }\n"
+  "  .y2m-args {\n"
+  "     font-weight: normal;\n"
+  "  }\n"
+  "</style>\n";
+
+
+
 /* Option flags. */
 static int verbose;
 static int quiet;
 static int debug;
+static int htmlmode;
 static const char *opt_source;
 static const char *opt_release;
 static const char *opt_date;
@@ -353,7 +383,7 @@ ascii_strupr (char *string)
 const char *
 isodatestring (void)
 {
-  static char buffer[11+5];
+  static char buffer[36];
   struct tm *tp;
   time_t atime;
 
@@ -482,6 +512,9 @@ evaluate_conditions (const char *fname, int lnr)
 {
   int i;
 
+  (void)fname;
+  (void)lnr;
+
   /* for (i=0; i < condition_stack_idx; i++) */
   /*   inf ("%s:%d:   stack[%d] %s %s %c", */
   /*        fname, lnr, i, condition_stack[i]->isset? "set":"clr", */
@@ -672,6 +705,25 @@ start_page (char *name)
 }
 
 
+/* Write a character to FP.  */
+static void
+writechr (int c, FILE *fp)
+{
+  putc (c, fp);
+}
+
+
+/* Write depending on HTMLMODE either ROFF or HTML to FP.  */
+static void
+writestr (const char *roff, const char *html, FILE *fp)
+{
+  const char *s = htmlmode? html : roff;
+
+  if (s)
+    fputs (s, fp);
+}
+
+
 /* Write the .TH entry of the current page.  Return -1 if there is a
    problem with the page. */
 static int
@@ -679,7 +731,9 @@ write_th (FILE *fp)
 {
   char *name, *p;
 
-  fputs (".\\\" Created from Texinfo source by yat2m " VERSION "\n", fp);
+  writestr (".\\\" Created from Texinfo source by yat2m " VERSION "\n",
+            "<!-- Created from Texinfo source by yat2m " VERSION " -->\n",
+            fp);
 
   name = ascii_strupr (xstrdup (thepage.name));
   p = strrchr (name, '.');
@@ -690,15 +744,159 @@ write_th (FILE *fp)
       return -1;
     }
   *p++ = 0;
-  fprintf (fp, ".TH %s %s %s \"%s\" \"%s\"\n",
-           name, p, isodatestring (), opt_release, opt_source);
+
+  if (htmlmode)
+    {
+      fputs ("<html>\n"
+             "<head>\n", fp);
+      fprintf (fp, " <title>%s(%s)</title>\n", name, p);
+      fputs (default_css, fp);
+      fputs ("</head>\n"
+             "<body>\n", fp);
+      fputs ("<div class=\"y2m\">\n", fp);
+    }
+
+  /* This roff source
+   *   .TH GPG 1 2016-12-20 "GnuPG 2.1.17" "GNU Privacy Guard 2.1"
+   * is rendered by man like this:
+   *   GPG(1)         GNU Privacy Guard 2.1      GPG(1)
+   *   [...]
+   *   GnuPG 2.1.17        2016-12-20            GPG(1)
+   */
+  if (htmlmode)
+    {
+      fprintf (fp, "<p class=\"y2m y2m-top\">"
+               "<span class=\"y2m-left\">%s(%s)</span> "
+               "<span class=\"y2m-center\">%s</span> "
+               "<span class=\"y2m-right\">%s(%s)</span>"
+               "</p>\n",
+               name, p, opt_source, name, p);
+      /* Note that the HTML footer is written by write_bottom().  */
+
+    }
+  else
+    fprintf (fp, ".TH %s %s %s \"%s\" \"%s\"\n",
+             name, p, isodatestring (), opt_release, opt_source);
+
   free (name);
   return 0;
 }
 
 
+/* In HTML mode we need to render a footer.  */
+static int
+write_bottom (FILE *fp)
+{
+  char *name, *p;
+
+  if (!htmlmode)
+    return 0;
+
+  name = ascii_strupr (xstrdup (thepage.name));
+  p = strrchr (name, '.');
+  if (!p || !p[1])
+    {
+      err ("no section name in man page '%s'", thepage.name);
+      free (name);
+      return -1;
+    }
+  *p++ = 0;
+
+  /* This roff source
+   *   .TH GPG 1 2016-12-20 "GnuPG 2.1.17" "GNU Privacy Guard 2.1"
+   * is rendered by man to this footer:
+   *   GnuPG 2.1.17        2016-12-20            GPG(1)
+   */
+  fprintf (fp, "<p class=\"y2m y2m-footer\">"
+           "<span class=\"y2m-left\">%s</span> "
+           "<span class=\"y2m-center\">%s</span> "
+           "<span class=\"y2m-right\">%s(%s)</span>"
+           "</p>\n",
+           opt_release, isodatestring (), name, p);
+  fputs ("</div><!-- class y2m -->\n", fp);
+  fputs ("</body>\n"
+         "</html>\n", fp);
+
+  free (name);
+  return 0;
+}
+
+
+/* Write the .SH header.  With NULL passed for NAME just close a
+ * section in html mode if there is an open section. */
+static void
+write_sh (FILE *fp, const char *name)
+{
+  static int in_section;
+
+  if (htmlmode && in_section)
+    fprintf (fp, "</div>\n");
+  in_section = 0;
+
+  if (name)
+    {
+      if (htmlmode)
+        fprintf (fp,
+                 "<div class=\"y2m-section\">\n"
+                 "<p class=\"y2m-sh\">%s</p>\n", name);
+      else
+        fprintf (fp, ".SH %s\n", name);
+      in_section = 1;
+    }
+}
+
+/* Render a @item line to HTML.  (LINE,LEN) gives the arguments of
+ * @item.  Use NULL for LINE to close a possible open <li>.  ITEMX
+ * flags a @itemx line.  */
+static void
+write_html_item (FILE *fp, const char *line, size_t len, int itemx)
+{
+  static int in_li;
+  const char *rest;
+  size_t n, n0;
+  int eol_action = 0;
+  int table_level = 0;
+
+  if (!itemx && in_li)
+    {
+      fprintf (fp, "</li>\n");
+      in_li = 0;
+    }
+
+  if (line)
+    {
+      /* Trim the LF and skip leading spaces. */
+      if (len && line[len-1] == '\n')
+        len--;
+      for (; len && (*line == ' ' || *line == '\t'); len--, line++)
+        ;
+      if (len)
+        {
+          rest = line;
+          for (n=0; n < len && !(*rest == ' ' || *rest == '\t'); n++, rest++)
+            ;
+          n0 = n;
+          for (; n < len && (*rest == ' ' || *rest == '\t'); n++, rest++)
+            ;
+          len -= n;
+          /* Now the first word is (LINE,N0) and the args are (REST,LEN) */
+          fprintf (fp, "%s<span class=\"y2m-item\">%.*s",
+                   itemx? "    ":"<li>", (int)n0, line);
+          if (len)
+            {
+              fputs (" <span class=\"y2m-args\">", fp);
+              proc_texi_buffer (fp, rest, len, &table_level, &eol_action);
+              fputs ("</span>", fp);
+            }
+          fputs ("</span>\n", fp);
+          in_li = 1;
+        }
+    }
+}
+
+
 /* Process the texinfo command COMMAND (without the leading @) and
-   write output if needed to FP. REST is the remainer of the line
+   write output if needed to FP. REST is the remainder of the line
    which should either point to an opening brace or to a white space.
    The function returns the number of characters already processed
    from REST.  LEN is the usable length of REST.  TABLE_LEVEL is used to
@@ -712,28 +910,32 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
     int what;            /* What to do with this command. */
     const char *lead_in; /* String to print with a opening brace.  */
     const char *lead_out;/* String to print with the closing brace. */
+    const char *html_in; /* Same as LEAD_IN but for HTML.  */
+    const char *html_out;/* Same as LEAD_OUT but for HTML.  */
   } cmdtbl[] = {
-    { "command", 0, "\\fB", "\\fR" },
-    { "code",    0, "\\fB", "\\fR" },
-    { "url",     0, "\\fB", "\\fR" },
-    { "sc",      0, "\\fB", "\\fR" },
-    { "var",     0, "\\fI", "\\fR" },
-    { "samp",    0, "\\(aq", "\\(aq"  },
+    { "command", 0, "\\fB", "\\fR", "<i>", "</i>" },
+    { "code",    0, "\\fB", "\\fR", "<samp>", "</samp>" },
+    { "url",     0, "\\fB", "\\fR", "<strong>", "</strong>" },
+    { "sc",      0, "\\fB", "\\fR", "<span class=\"y2m-sc\">", "</span>" },
+    { "var",     0, "\\fI", "\\fR", "<u>", "</u>" },
+    { "samp",    0, "\\(oq", "\\(cq"  },
+    { "kbd",     0, "\\(oq", "\\(cq"  },
     { "file",    0, "\\(oq\\fI","\\fR\\(cq" },
     { "env",     0, "\\(oq\\fI","\\fR\\(cq" },
     { "acronym", 0 },
     { "dfn",     0 },
-    { "option",  0, "\\fB", "\\fR"   },
-    { "example", 1, ".RS 2\n.nf\n" },
-    { "smallexample", 1, ".RS 2\n.nf\n" },
+    { "option",  0, "\\fB", "\\fR", "<samp>", "</samp>" },
+    { "example", 1, ".RS 2\n.nf\n",      NULL, "\n<pre>\n", "\n</pre>\n" },
+    { "smallexample", 1, ".RS 2\n.nf\n", NULL, "\n<pre>\n", "\n</pre>\n" },
     { "asis",    7 },
     { "anchor",  7 },
     { "cartouche", 1 },
-    { "xref",    0, "see: [", "]" },
+    { "ref",     0, "[", "]" },
+    { "xref",    0, "See: [", "]" },
     { "pxref",   0, "see: [", "]" },
     { "uref",    0, "(\\fB", "\\fR)" },
     { "footnote",0, " ([", "])" },
-    { "emph",    0, "\\fI", "\\fR" },
+    { "emph",    0, "\\fI", "\\fR", "<em>", "</em>" },
     { "w",       1 },
     { "c",       5 },
     { "efindex", 1 },
@@ -747,7 +949,7 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
     { "chapheading", 0},
     { "item",    2, ".TP\n.B " },
     { "itemx",   2, ".TQ\n.B " },
-    { "table",   3 },
+    { "table",   3, NULL, NULL, "<ul>\n", "</ul>\n" },
     { "itemize",   3 },
     { "bullet",  0, "* " },
     { "*",       0, "\n.br"},
@@ -761,26 +963,36 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
   int i;
   const char *s;
   const char *lead_out = NULL;
+  const char *html_out = NULL;
   int ignore_args = 0;
 
   for (i=0; cmdtbl[i].name && strcmp (cmdtbl[i].name, command); i++)
     ;
   if (cmdtbl[i].name)
     {
-      s = cmdtbl[i].lead_in;
-      if (s)
-        fputs (s, fp);
+      writestr (cmdtbl[i].lead_in, cmdtbl[i].html_in, fp);
       lead_out = cmdtbl[i].lead_out;
+      html_out = cmdtbl[i].html_out;
       switch (cmdtbl[i].what)
         {
         case 1: /* Throw away the entire line.  */
           s = memchr (rest, '\n', len);
           return s? (s-rest)+1 : len;
         case 2: /* Handle @item.  */
+          if (htmlmode)
+            {
+              s = memchr (rest, '\n', len);
+              n = s? (s-rest)+1 : len;
+              write_html_item (fp, rest, n, !strcmp(cmdtbl[i].name, "itemx"));
+              return n;
+            }
           break;
         case 3: /* Handle table.  */
           if (++(*table_level) > 1)
-            fputs (".RS\n", fp);
+            {
+              write_html_item (fp, NULL, 0, 0);
+              writestr (".RS\n", "<ul>\n", fp);
+            }
           /* Now throw away the entire line. */
           s = memchr (rest, '\n', len);
           return s? (s-rest)+1 : len;
@@ -791,25 +1003,27 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
           if (n >= 5 && !memcmp (s, "table", 5)
               && (!n || s[5] == ' ' || s[5] == '\t' || s[5] == '\n'))
             {
+              if (htmlmode)
+                write_html_item (fp, NULL, 0, 0);
               if ((*table_level)-- > 1)
-                fputs (".RE\n", fp);
+                writestr (".RE\n", "</ul>\n", fp);
               else
-                fputs (".P\n", fp);
+                writestr (".P\n", "</ul>\n", fp);
             }
           else if (n >= 7 && !memcmp (s, "example", 7)
               && (!n || s[7] == ' ' || s[7] == '\t' || s[7] == '\n'))
             {
-              fputs (".fi\n.RE\n", fp);
+              writestr (".fi\n.RE\n", "</pre>\n", fp);
             }
           else if (n >= 12 && !memcmp (s, "smallexample", 12)
               && (!n || s[12] == ' ' || s[12] == '\t' || s[12] == '\n'))
             {
-              fputs (".fi\n.RE\n", fp);
+              writestr (".fi\n.RE\n", "</pre>\n", fp);
             }
           else if (n >= 9 && !memcmp (s, "quotation", 9)
               && (!n || s[9] == ' ' || s[9] == '\t' || s[9] == '\n'))
             {
-              fputs ("\\fR\n.RE\n", fp);
+              writestr ("\\fR\n.RE\n", "xx", fp);
             }
           /* Now throw away the entire line. */
           s = memchr (rest, '\n', len);
@@ -819,9 +1033,22 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
             ;
           if (n >= 4 && !memcmp (s, "man:", 4))
             {
-              for (s+=4, n-=4; n && *s != '\n'; n--, s++)
-                putc (*s, fp);
-              putc ('\n', fp);
+              s += 4;
+              n -= 4;
+              if (htmlmode)
+                {
+                  if (!strncmp (s, ".RE\n", 4)
+                      || !strncmp (s, ".RS\n", 4))
+                    ;
+                  else
+                    inf ("unknown special comment \"man:\"");
+                }
+              else
+                {
+                  for (; n && *s != '\n'; n--, s++)
+                    writechr (*s, fp);
+                  writechr ('\n', fp);
+                }
             }
           /* Now throw away the entire line. */
           s = memchr (rest, '\n', len);
@@ -852,18 +1079,20 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
                 }
               else
                 {
-                  size_t len = s - (rest + 1);
+                  size_t rlen = s - (rest + 1);
                   macro_t m;
 
                   for (m = variablelist; m; m = m->next)
-                    if (strlen (m->name) == len
-                        &&!strncmp (m->name, rest+1, len))
-                      break;
+                    {
+                      if (strlen (m->name) == rlen
+                          && !strncmp (m->name, rest+1, rlen))
+                        break;
+                    }
                   if (m)
-                    fputs (m->value, fp);
+                    writestr (m->value, m->value, fp);
                   else
                     inf ("texinfo variable '%.*s' is not set",
-                         (int)len, rest+1);
+                         (int)rlen, rest+1);
                 }
             }
           break;
@@ -908,8 +1137,7 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
   else
     n = 0;
 
-  if (lead_out)
-    fputs (lead_out, fp);
+  writestr (lead_out, html_out, fp);
 
   return n;
 }
@@ -936,16 +1164,16 @@ proc_texi_buffer (FILE *fp, const char *line, size_t len,
               switch (*s)
                 {
                 case '@': case '{': case '}':
-                  putc (*s, fp); in_cmd = 0;
+                  writechr (*s, fp); in_cmd = 0;
                   break;
                 case ':': /* Not ending a sentence flag.  */
                   in_cmd = 0;
                   break;
                 case '.': case '!': case '?': /* Ending a sentence. */
-                  putc (*s, fp); in_cmd = 0;
+                  writechr (*s, fp); in_cmd = 0;
                   break;
                 case ' ': case '\t': case '\n': /* Non collapsing spaces.  */
-                  putc (*s, fp); in_cmd = 0;
+                  writechr (*s, fp); in_cmd = 0;
                   break;
                 default:
                   cmdidx = 0;
@@ -978,17 +1206,17 @@ proc_texi_buffer (FILE *fp, const char *line, size_t len,
           switch (*eol_action)
             {
             case 1: /* Create a dummy paragraph. */
-              fputs ("\n\\ \n", fp);
+              writestr ("\n\\ \n", "\n<-- dummy par -->\n", fp);
               break;
             default:
-              putc (*s, fp);
+              writechr (*s, fp);
             }
           *eol_action = 0;
         }
       else if (*s == '\\')
-        fputs ("\\\\", fp);
+        writestr ("\\\\", "\\\\", fp);
       else
-        putc (*s, fp);
+        writechr (*s, fp);
     }
 
   if (in_cmd > 1)
@@ -1012,12 +1240,13 @@ parse_texi_line (FILE *fp, const char *line, int *table_level)
   /* A quick test whether there are any texinfo commands.  */
   if (!strchr (line, '@'))
     {
-      fputs (line, fp);
-      putc ('\n', fp);
+      /* FIXME: In html mode escape HTML stuff. */
+      writestr (line, line, fp);
+      writechr ('\n', fp);
       return;
     }
   proc_texi_buffer (fp, line, strlen (line), table_level, &eol_action);
-  putc ('\n', fp);
+  writechr ('\n', fp);
 }
 
 
@@ -1032,8 +1261,10 @@ write_content (FILE *fp, line_buffer_t lines)
     {
       if (line->verbatim)
         {
-          fputs (line->line, fp);
-          putc ('\n', fp);
+          /* FIXME: IN HTML mode we need to employ a parser for roff
+           * markup.  */
+          writestr (line->line, line->line, fp);
+          writechr ('\n', fp);
         }
       else
         {
@@ -1116,7 +1347,7 @@ finish_page (void)
 
       if (sect)
         {
-          fprintf (fp, ".SH %s\n", sect->name);
+          write_sh (fp, sect->name);
           write_content (fp, sect->lines);
           /* Now continue with all non standard sections directly
              following this one. */
@@ -1127,7 +1358,7 @@ finish_page (void)
                 break;
               if (sect->name)
                 {
-                  fprintf (fp, ".SH %s\n", sect->name);
+                  write_sh (fp, sect->name);
                   write_content (fp, sect->lines);
                 }
             }
@@ -1135,6 +1366,9 @@ finish_page (void)
         }
     }
 
+  write_sh (fp, NULL);
+  if (write_bottom (fp))
+    goto leave;
 
  leave:
   if (fp != stdout)
@@ -1477,6 +1711,7 @@ int
 main (int argc, char **argv)
 {
   int last_argc = -1;
+  const char *s;
 
   opt_source = "GNU";
   opt_release = "";
@@ -1504,6 +1739,7 @@ main (int argc, char **argv)
           puts (
                 "Usage: " PGM " [OPTION] [FILE]\n"
                 "Extract man pages from a Texinfo source.\n\n"
+                "  --html           render output as HTML\n"
                 "  --source NAME    use NAME as source field\n"
                 "  --release STRING use STRING as the release field\n"
                 "  --date EPOCH     use EPOCH as publication date\n"
@@ -1513,20 +1749,25 @@ main (int argc, char **argv)
                 "  --debug          enable additional debug output\n"
                 "  --help           display this help and exit\n"
                 "  -I DIR           also search in include DIR\n"
-                "  -D gpgone        the only usable define\n\n"
+                "  -D MACRO         define MACRO to 1\n\n"
                 "With no FILE, or when FILE is -, read standard input.\n\n"
-                "Report bugs to <bugs@g10code.com>.");
+                "Report bugs to <https://bugs.gnupg.org>.");
           exit (0);
         }
       else if (!strcmp (*argv, "--version"))
         {
           puts (PGM " " VERSION "\n"
-               "Copyright (C) 2005 g10 Code GmbH\n"
+               "Copyright (C) 2005, 2017 g10 Code GmbH\n"
                "This program comes with ABSOLUTELY NO WARRANTY.\n"
                "This is free software, and you are welcome to redistribute it\n"
                 "under certain conditions. See the file COPYING for details.");
           exit (0);
         }
+      else if (!strcmp (*argv, "--html"))
+        {
+          htmlmode = 1;
+          argc--; argv++;
+        }
       else if (!strcmp (*argv, "--verbose"))
         {
           verbose = 1;
@@ -1610,6 +1851,11 @@ main (int argc, char **argv)
   if (argc > 1)
     die ("usage: " PGM " [OPTION] [FILE] (try --help for more information)\n");
 
+  /* Take care of supplied timestamp for reproducible builds.  See
+   * https://reproducible-builds.org/specs/source-date-epoch/  */
+  if (!opt_date && (s = getenv ("SOURCE_DATE_EPOCH")) && *s)
+    opt_date = s;
+
   /* Start processing. */
   if (argc && strcmp (*argv, "-"))
     {
index b5e278c..76f5df3 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # License along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -97,20 +107,22 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = lang
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am README
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/autobuild.m4 \
-       $(top_srcdir)/m4/estream.m4 $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/ax_cc_for_build.m4 \
+       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/estream.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gnupg-misc.m4 \
        $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
        $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/lock.m4 \
        $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
        $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
        $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/threadlib.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
+       $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -149,7 +161,7 @@ am__recursive_targets = \
   $(RECURSIVE_CLEAN_TARGETS) \
   $(am__extra_recursive_targets)
 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-       distdir
+       distdir distdir-am
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -170,6 +182,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -226,18 +239,20 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
 FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GPG_ERROR_CONFIG_CFLAGS = @GPG_ERROR_CONFIG_CFLAGS@
 GPG_ERROR_CONFIG_HOST = @GPG_ERROR_CONFIG_HOST@
-GPG_ERROR_CONFIG_ISUBDIRAFTER = @GPG_ERROR_CONFIG_ISUBDIRAFTER@
 GPG_ERROR_CONFIG_LIBS = @GPG_ERROR_CONFIG_LIBS@
+GPG_ERROR_CONFIG_LIBS_PRIVATE = @GPG_ERROR_CONFIG_LIBS_PRIVATE@
 GPG_ERROR_CONFIG_MT_CFLAGS = @GPG_ERROR_CONFIG_MT_CFLAGS@
 GPG_ERROR_CONFIG_MT_LIBS = @GPG_ERROR_CONFIG_MT_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
+INSTALLSHELLPATH = @INSTALLSHELLPATH@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -245,6 +260,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
+LDADD_FOR_TESTS_KLUDGE = @LDADD_FOR_TESTS_KLUDGE@
 LDFLAGS = @LDFLAGS@
 LIBGPG_ERROR_LT_AGE = @LIBGPG_ERROR_LT_AGE@
 LIBGPG_ERROR_LT_CURRENT = @LIBGPG_ERROR_LT_CURRENT@
@@ -253,9 +269,14 @@ LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBREADLINE = @LIBREADLINE@
 LIBS = @LIBS@
+LIBSTDTHREAD = @LIBSTDTHREAD@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
+LIB_NETWORK = @LIB_NETWORK@
 LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
 LIPO = @LIPO@
 LN_S = @LN_S@
@@ -342,6 +363,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -367,14 +389,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lang/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --gnu lang/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -491,7 +512,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -662,6 +686,8 @@ uninstall-am:
        mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
        ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
index 7a47337..f2736c0 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -98,21 +108,23 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = lang/cl
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-       $(srcdir)/gpg-error.asd.in $(dist_clfiles_DATA) README
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/autobuild.m4 \
-       $(top_srcdir)/m4/estream.m4 $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/ax_cc_for_build.m4 \
+       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/estream.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gnupg-misc.m4 \
        $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
        $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/lock.m4 \
        $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
        $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
        $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/threadlib.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
+       $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(dist_clfiles_DATA) \
+       $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES = gpg-error.asd
@@ -166,6 +178,8 @@ am__uninstall_files_from_dir = { \
 am__installdirs = "$(DESTDIR)$(clfilesdir)" "$(DESTDIR)$(clfilesdir)"
 DATA = $(dist_clfiles_DATA) $(nodist_clfiles_DATA)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/gpg-error.asd.in \
+       README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -197,18 +211,20 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
 FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GPG_ERROR_CONFIG_CFLAGS = @GPG_ERROR_CONFIG_CFLAGS@
 GPG_ERROR_CONFIG_HOST = @GPG_ERROR_CONFIG_HOST@
-GPG_ERROR_CONFIG_ISUBDIRAFTER = @GPG_ERROR_CONFIG_ISUBDIRAFTER@
 GPG_ERROR_CONFIG_LIBS = @GPG_ERROR_CONFIG_LIBS@
+GPG_ERROR_CONFIG_LIBS_PRIVATE = @GPG_ERROR_CONFIG_LIBS_PRIVATE@
 GPG_ERROR_CONFIG_MT_CFLAGS = @GPG_ERROR_CONFIG_MT_CFLAGS@
 GPG_ERROR_CONFIG_MT_LIBS = @GPG_ERROR_CONFIG_MT_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
+INSTALLSHELLPATH = @INSTALLSHELLPATH@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -216,6 +232,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
+LDADD_FOR_TESTS_KLUDGE = @LDADD_FOR_TESTS_KLUDGE@
 LDFLAGS = @LDFLAGS@
 LIBGPG_ERROR_LT_AGE = @LIBGPG_ERROR_LT_AGE@
 LIBGPG_ERROR_LT_CURRENT = @LIBGPG_ERROR_LT_CURRENT@
@@ -224,9 +241,14 @@ LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBREADLINE = @LIBREADLINE@
 LIBS = @LIBS@
+LIBSTDTHREAD = @LIBSTDTHREAD@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
+LIB_NETWORK = @LIB_NETWORK@
 LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
 LIPO = @LIPO@
 LN_S = @LN_S@
@@ -313,6 +335,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -350,14 +373,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lang/cl/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --gnu lang/cl/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -425,7 +447,10 @@ ctags CTAGS:
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -576,6 +601,8 @@ uninstall-am: uninstall-dist_clfilesDATA uninstall-nodist_clfilesDATA
        uninstall-am uninstall-dist_clfilesDATA \
        uninstall-nodist_clfilesDATA
 
+.PRECIOUS: Makefile
+
 
 gpg-error-codes.lisp: Makefile mkerrcodes.awk $(codes_file) $(errno_file)
        echo '@errnos@' | cat $(codes_file) - $(errno_file) \
index a745581..d5ccb1c 100644 (file)
@@ -27,7 +27,7 @@
 (defsystem gpg-error
     :description "Common error values for all GnuPG components."
     :author "g10 Code GmbH"
-    :version "1.27"
+    :version "1.43"
     :licence "LGPL"
     :depends-on ("cffi")
     :components ((:file "gpg-error-package")
index ae29043..9a1fc18 100644 (file)
@@ -122,7 +122,7 @@ header {
 }
 
 !header {
-  sub (/\#.+/, "");
+  sub (/#.+/, "");
   sub (/[      ]+$/, ""); # Strip trailing space and tab characters.
 
   if (/^$/)
index 41178bf..3ce4011 100644 (file)
@@ -1,7 +1,7 @@
 # This is a template.  The dist target uses it to create the real file.
 Summary: libgpg-error
 Name: libgpg-error
-Version: 1.27
+Version: 1.43
 Release: 1
 URL: ftp://ftp.gnupg.org/gcrypt/alpha/libgpg-error/
 Source: ftp://ftp.gnupg.org/gcrypt/alpha/libgpg-error/%{name}-%{version}.tar.gz
index 2f16e46..a82737d 100644 (file)
@@ -1,3 +1,5 @@
-EXTRA_DIST = inttypes-h.m4 lock.m4 visibility.m4 glibc2.m4 intmax.m4 longdouble.m4 longlong.m4 printf-posix.m4 signed.m4 size_max.m4 wchar_t.m4 wint_t.m4 xsize.m4 ac_prog_cc_for_build.m4 nls.m4 po.m4  codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4
+EXTRA_DIST = inttypes-h.m4 lock.m4 visibility.m4 glibc2.m4 intmax.m4 longdouble.m4 longlong.m4 printf-posix.m4 signed.m4 size_max.m4 wchar_t.m4 wint_t.m4 xsize.m4 nls.m4 po.m4  codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4
 
-EXTRA_DIST += autobuild.m4 estream.m4
+EXTRA_DIST += ax_cc_for_build.m4
+
+EXTRA_DIST += autobuild.m4 estream.m4 readline.m4 gnupg-misc.m4
index 6a7e1a3..8c0d912 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,20 +88,22 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = m4
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/autobuild.m4 \
-       $(top_srcdir)/m4/estream.m4 $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/ax_cc_for_build.m4 \
+       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/estream.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gnupg-misc.m4 \
        $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
        $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/lock.m4 \
        $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
        $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
        $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/threadlib.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
+       $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -116,6 +128,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -147,18 +160,20 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
 FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GPG_ERROR_CONFIG_CFLAGS = @GPG_ERROR_CONFIG_CFLAGS@
 GPG_ERROR_CONFIG_HOST = @GPG_ERROR_CONFIG_HOST@
-GPG_ERROR_CONFIG_ISUBDIRAFTER = @GPG_ERROR_CONFIG_ISUBDIRAFTER@
 GPG_ERROR_CONFIG_LIBS = @GPG_ERROR_CONFIG_LIBS@
+GPG_ERROR_CONFIG_LIBS_PRIVATE = @GPG_ERROR_CONFIG_LIBS_PRIVATE@
 GPG_ERROR_CONFIG_MT_CFLAGS = @GPG_ERROR_CONFIG_MT_CFLAGS@
 GPG_ERROR_CONFIG_MT_LIBS = @GPG_ERROR_CONFIG_MT_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
+INSTALLSHELLPATH = @INSTALLSHELLPATH@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -166,6 +181,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
+LDADD_FOR_TESTS_KLUDGE = @LDADD_FOR_TESTS_KLUDGE@
 LDFLAGS = @LDFLAGS@
 LIBGPG_ERROR_LT_AGE = @LIBGPG_ERROR_LT_AGE@
 LIBGPG_ERROR_LT_CURRENT = @LIBGPG_ERROR_LT_CURRENT@
@@ -174,9 +190,14 @@ LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBREADLINE = @LIBREADLINE@
 LIBS = @LIBS@
+LIBSTDTHREAD = @LIBSTDTHREAD@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
+LIB_NETWORK = @LIB_NETWORK@
 LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
 LIPO = @LIPO@
 LN_S = @LN_S@
@@ -263,6 +284,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -273,12 +295,12 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 EXTRA_DIST = inttypes-h.m4 lock.m4 visibility.m4 glibc2.m4 intmax.m4 \
        longdouble.m4 longlong.m4 printf-posix.m4 signed.m4 \
-       size_max.m4 wchar_t.m4 wint_t.m4 xsize.m4 \
-       ac_prog_cc_for_build.m4 nls.m4 po.m4 codeset.m4 gettext.m4 \
-       glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 inttypes_h.m4 \
-       inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 \
-       lib-link.m4 lib-prefix.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \
-       ulonglong.m4 autobuild.m4 estream.m4
+       size_max.m4 wchar_t.m4 wint_t.m4 xsize.m4 nls.m4 po.m4 \
+       codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 \
+       inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 \
+       lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 progtest.m4 \
+       stdint_h.m4 uintmax_t.m4 ulonglong.m4 ax_cc_for_build.m4 \
+       autobuild.m4 estream.m4 readline.m4 gnupg-misc.m4
 all: all-am
 
 .SUFFIXES:
@@ -294,14 +316,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --gnu m4/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -325,7 +346,10 @@ ctags CTAGS:
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -469,6 +493,8 @@ uninstall-am:
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/m4/ac_prog_cc_for_build.m4 b/m4/ac_prog_cc_for_build.m4
deleted file mode 100644 (file)
index 32329c7..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-dnl Available from the GNU Autoconf Macro Archive at:
-dnl https://www.gnu.org/software/ac-archive/htmldoc/ac_prog_cc_for_build.html
-dnl
-dnl All content of this archive is free software;
-dnl you can redistribute it and/or modify it under the terms of the GNU
-dnl General Public License as published by the Free Software Foundation;
-dnl either version 2, or (at your option) any later version.
-dnl
-dnl As a special exception, the respective Autoconf Macro's copyright
-dnl owner gives unlimited permission to copy, distribute and modify the
-dnl configure scripts that are the output of Autoconf when processing the
-dnl Macro. You need not follow the terms of the GNU General Public License
-dnl when using or distributing such scripts, even though portions of the
-dnl text of the Macro appear in them. The GNU General Public License (GPL)
-dnl does govern all other use of the material that constitutes the
-dnl Autoconf Macro.
-dnl 
-dnl This special exception to the GPL applies to versions of the Autoconf
-dnl Macro released by the GNU Autoconf Macro Archive. When you make and
-dnl distribute a modified version of the Autoconf Macro, you may extend
-dnl this special exception to the GPL to apply to your modified version as
-dnl well.
-
-dnl Synopsis AC_PROG_CC_FOR_BUILD
-dnl
-dnl This macro searches for a C compiler that generates native
-dnl executables, that is a C compiler that surely is not a cross-compiler.
-dnl This can be useful if you have to generate source code at compile-time
-dnl like for example GCC does.
-dnl
-dnl The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything
-dnl needed to compile or link (CC_FOR_BUILD) and preprocess
-dnl (CPP_FOR_BUILD).  The value of these variables can be overridden by
-dnl the user by specifying a compiler with an environment variable (like
-dnl you do for standard CC).
-dnl
-dnl It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and
-dnl object file extensions for the build platform, and GCC_FOR_BUILD
-dnl to `yes' if the compiler we found is GCC.  All these variables but
-dnl GCC_FOR_BUILD are substituted in the Makefile.
-dnl
-dnl Author Paolo Bonzini <bonzini@gnu.org>
-dnl
-AC_DEFUN([AC_PROG_CC_FOR_BUILD], [dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_CPP])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
-dnl
-pushdef([AC_TRY_COMPILER], [
-cat > conftest.$ac_ext << EOF
-#line __oline__ "configure"
-#include "confdefs.h"
-[$1]
-EOF
-# If we can't run a trivial program, we are probably using a cross
-compiler.
-# Fail miserably.
-if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} && (./conftest;
-exit) 2>/dev/null; then
-  [$2]=yes
-else
-  echo "configure: failed program was:" >&AC_FD_CC
-  cat conftest.$ac_ext >&AC_FD_CC
-  [$2]=no
-fi
-[$3]=no
-rm -fr conftest*])dnl
-
-dnl Use the standard macros, but make them use other variable names
-dnl
-pushdef([cross_compiling], [#])dnl
-pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl
-pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl
-pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl
-pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl
-pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl
-pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl
-pushdef([ac_cv_objext], ac_cv_build_objext)dnl
-pushdef([ac_exeext], ac_build_exeext)dnl
-pushdef([ac_objext], ac_build_objext)dnl
-pushdef([CC], CC_FOR_BUILD)dnl
-pushdef([CPP], CPP_FOR_BUILD)dnl
-pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl
-pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
-pushdef([host], build)dnl
-pushdef([host_alias], build_alias)dnl
-pushdef([host_cpu], build_cpu)dnl
-pushdef([host_vendor], build_vendor)dnl
-pushdef([host_os], build_os)dnl
-pushdef([ac_cv_host], ac_cv_build)dnl
-pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
-pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
-pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
-pushdef([ac_cv_host_os], ac_cv_build_os)dnl
-pushdef([ac_cpp], ac_build_cpp)dnl
-pushdef([ac_compile], ac_build_compile)dnl
-pushdef([ac_link], ac_build_link)dnl
-
-dnl Defeat the anti-duplication mechanism
-dnl
-dnl undefine([AC_PROVIDE_AC_PROG_CPP])dnl
-dnl undefine([AC_PROVIDE_AC_PROG_C])dnl
-dnl undefine([AC_PROVIDE_AC_EXEEXT])dnl
-
-AC_PROG_CC
-AC_PROG_CPP
-AC_EXEEXT
-
-dnl Restore the old definitions
-dnl
-popdef([AC_TRY_COMPILER])dnl
-popdef([ac_link])dnl
-popdef([ac_compile])dnl
-popdef([ac_cpp])dnl
-popdef([ac_cv_host_os])dnl
-popdef([ac_cv_host_vendor])dnl
-popdef([ac_cv_host_cpu])dnl
-popdef([ac_cv_host_alias])dnl
-popdef([ac_cv_host])dnl
-popdef([host_os])dnl
-popdef([host_vendor])dnl
-popdef([host_cpu])dnl
-popdef([host_alias])dnl
-popdef([host])dnl
-popdef([CPPFLAGS])dnl
-popdef([CFLAGS])dnl
-popdef([CPP])dnl
-popdef([CC])dnl
-popdef([ac_objext])dnl
-popdef([ac_exeext])dnl
-popdef([ac_cv_objext])dnl
-popdef([ac_cv_exeext])dnl
-popdef([ac_cv_prog_cc_g])dnl
-popdef([ac_cv_prog_cc_works])dnl
-popdef([ac_cv_prog_cc_cross])dnl
-popdef([ac_cv_prog_gcc])dnl
-popdef([ac_cv_prog_CPP])dnl
-popdef([cross_compiling])dnl
-
-dnl Finally, set Makefile variables
-dnl
-BUILD_EXEEXT=$ac_build_exeext
-BUILD_OBJEXT=$ac_build_objext
-AC_SUBST(BUILD_EXEEXT)dnl
-AC_SUBST(BUILD_OBJEXT)dnl
-AC_SUBST([CFLAGS_FOR_BUILD])dnl
-AC_SUBST([CPPFLAGS_FOR_BUILD])dnl
-])
diff --git a/m4/ax_cc_for_build.m4 b/m4/ax_cc_for_build.m4
new file mode 100644 (file)
index 0000000..c62ffad
--- /dev/null
@@ -0,0 +1,77 @@
+# ===========================================================================
+#     https://www.gnu.org/software/autoconf-archive/ax_cc_for_build.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_CC_FOR_BUILD
+#
+# DESCRIPTION
+#
+#   Find a build-time compiler. Sets CC_FOR_BUILD and EXEEXT_FOR_BUILD.
+#
+# LICENSE
+#
+#   Copyright (c) 2010 Reuben Thomas <rrt@sc3d.org>
+#   Copyright (c) 1999 Richard Henderson <rth@redhat.com>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 3
+
+dnl Get a default for CC_FOR_BUILD to put into Makefile.
+AC_DEFUN([AX_CC_FOR_BUILD],
+[# Put a plausible default for CC_FOR_BUILD in Makefile.
+if test -z "$CC_FOR_BUILD"; then
+  if test "x$cross_compiling" = "xno"; then
+    CC_FOR_BUILD='$(CC)'
+  else
+    CC_FOR_BUILD=gcc
+  fi
+fi
+AC_SUBST(CC_FOR_BUILD)
+# Also set EXEEXT_FOR_BUILD.
+if test "x$cross_compiling" = "xno"; then
+  EXEEXT_FOR_BUILD='$(EXEEXT)'
+else
+  AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
+    [rm -f conftest*
+     echo 'int main () { return 0; }' > conftest.c
+     bfd_cv_build_exeext=
+     ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
+     for file in conftest.*; do
+       case $file in
+       *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+       *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
+       esac
+     done
+     rm -f conftest*
+     test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
+  EXEEXT_FOR_BUILD=""
+  test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
+fi
+AC_SUBST(EXEEXT_FOR_BUILD)])dnl
index 402ef74..deb972d 100644 (file)
@@ -24,16 +24,17 @@ AC_DEFUN([estream_PRINTF_INIT],
   AC_CHECK_TYPES([ptrdiff_t])
   AC_CHECK_SIZEOF([unsigned long])
   AC_CHECK_SIZEOF([void *])
-  AC_CACHE_CHECK([for nl_langinfo and THOUSANDS_SEP],
-                  estream_cv_langinfo_thousands_sep,
-      [AC_TRY_LINK([#include <langinfo.h>],
-        [char* cs = nl_langinfo(THOUSANDS_SEP); return !cs;],
-        estream_cv_langinfo_thousands_sep=yes,
-        estream_cv_langinfo_thousands_sep=no)
+  AC_CACHE_CHECK([for nl_langinfo and THOUSEP],
+                  estream_cv_langinfo_thousep,
+      [AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM([[#include <langinfo.h>]],
+          [[char* cs = nl_langinfo(THOUSEP); return !cs;]])],
+        estream_cv_langinfo_thousep=yes,
+        estream_cv_langinfo_thousep=no)
       ])
-  if test $estream_cv_langinfo_thousands_sep = yes; then
-    AC_DEFINE(HAVE_LANGINFO_THOUSANDS_SEP, 1,
-      [Define if you have <langinfo.h> and nl_langinfo(THOUSANDS_SEP).])
+  if test $estream_cv_langinfo_thousep = yes; then
+    AC_DEFINE(HAVE_LANGINFO_THOUSEP, 1,
+      [Define if you have <langinfo.h> and nl_langinfo(THOUSEP).])
   fi
 ])
 
diff --git a/m4/gnupg-misc.m4 b/m4/gnupg-misc.m4
new file mode 100644 (file)
index 0000000..c707b35
--- /dev/null
@@ -0,0 +1,35 @@
+dnl gnupg-misc.m4 - Autoconf macros originally from GnuPG
+dnl Copyright (C) 2017 g10 Code GmbH
+dnl
+dnl This file is free software; as a special exception the author gives
+dnl unlimited permission to copy and/or distribute it, with or without
+dnl modifications, as long as this notice is preserved.
+dnl
+dnl This file is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+dnl SPDX-License-Identifier: FSFULLR
+
+
+dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead
+dnl of the usual 2.
+AC_DEFUN([GNUPG_FUNC_MKDIR_TAKES_ONE_ARG],
+[AC_CHECK_HEADERS(sys/stat.h unistd.h direct.h)
+AC_CACHE_CHECK([if mkdir takes one argument], gnupg_cv_mkdir_takes_one_arg,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_DIRECT_H
+# include <direct.h>
+#endif]], [[mkdir ("foo", 0);]])],
+        gnupg_cv_mkdir_takes_one_arg=no, gnupg_cv_mkdir_takes_one_arg=yes)])
+if test $gnupg_cv_mkdir_takes_one_arg = yes ; then
+  AC_DEFINE(MKDIR_TAKES_ONE_ARG,1,
+            [Defined if mkdir() does not take permission flags])
+fi
+])
index 4b29c5f..a285e9d 100644 (file)
@@ -1,5 +1,6 @@
-# iconv.m4 serial 18 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2007-2014 Free Software Foundation, Inc.
+# iconv.m4 serial 21
+dnl Copyright (C) 2000-2002, 2007-2014, 2016-2019 Free Software Foundation,
+dnl 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.
@@ -72,27 +73,33 @@ AC_DEFUN([AM_ICONV_LINK],
       if test $am_cv_lib_iconv = yes; then
         LIBS="$LIBS $LIBICONV"
       fi
-      AC_RUN_IFELSE(
-        [AC_LANG_SOURCE([[
+      am_cv_func_iconv_works=no
+      for ac_iconv_const in '' 'const'; do
+        AC_RUN_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[
 #include <iconv.h>
 #include <string.h>
-int main ()
-{
-  int result = 0;
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+             ]],
+             [[int result = 0;
   /* 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 */
+        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
         char buf[10];
-        const char *inptr = input;
+        ICONV_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,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
           result |= 1;
@@ -105,14 +112,14 @@ int main ()
     iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
     if (cd_ascii_to_88591 != (iconv_t)(-1))
       {
-        static const char input[] = "\263";
+        static ICONV_CONST char input[] = "\263";
         char buf[10];
-        const char *inptr = input;
+        ICONV_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,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
           result |= 2;
@@ -124,14 +131,14 @@ int main ()
     iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
     if (cd_88591_to_utf8 != (iconv_t)(-1))
       {
-        static const char input[] = "\304";
+        static ICONV_CONST char input[] = "\304";
         static char buf[2] = { (char)0xDE, (char)0xAD };
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = 1;
         char *outptr = buf;
         size_t outbytesleft = 1;
         size_t res = iconv (cd_88591_to_utf8,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
           result |= 4;
@@ -144,14 +151,14 @@ int main ()
     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";
+        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
         char buf[50];
-        const char *inptr = input;
+        ICONV_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,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if ((int)res > 0)
           result |= 8;
@@ -161,27 +168,36 @@ int main ()
 #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))
-    result |= 16;
+  {
+    /* Try standardized names.  */
+    iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+    /* Try IRIX, OSF/1 names.  */
+    iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+    /* Try AIX names.  */
+    iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+    /* Try HP-UX names.  */
+    iconv_t cd4 = iconv_open ("utf8", "eucJP");
+    if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+        && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+      result |= 16;
+    if (cd1 != (iconv_t)(-1))
+      iconv_close (cd1);
+    if (cd2 != (iconv_t)(-1))
+      iconv_close (cd2);
+    if (cd3 != (iconv_t)(-1))
+      iconv_close (cd3);
+    if (cd4 != (iconv_t)(-1))
+      iconv_close (cd4);
+  }
   return result;
-}]])],
-        [am_cv_func_iconv_works=yes],
-        [am_cv_func_iconv_works=no],
-        [
-changequote(,)dnl
-         case "$host_os" in
-           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
-           *)            am_cv_func_iconv_works="guessing yes" ;;
-         esac
-changequote([,])dnl
-        ])
+]])],
+          [am_cv_func_iconv_works=yes], ,
+          [case "$host_os" in
+             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+             *)            am_cv_func_iconv_works="guessing yes" ;;
+           esac])
+        test "$am_cv_func_iconv_works" = no || break
+      done
       LIBS="$am_save_LIBS"
     ])
     case "$am_cv_func_iconv_works" in
@@ -255,14 +271,18 @@ size_t iconv();
     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
     AC_MSG_RESULT([
          $am_cv_proto_iconv])
-    AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
-      [Define as const if the declaration of iconv() needs const.])
-    dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
-    m4_ifdef([gl_ICONV_H_DEFAULTS],
-      [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
-       if test -n "$am_cv_proto_iconv_arg1"; then
-         ICONV_CONST="const"
-       fi
-      ])
+  else
+    dnl When compiling GNU libiconv on a system that does not have iconv yet,
+    dnl pick the POSIX compliant declaration without 'const'.
+    am_cv_proto_iconv_arg1=""
   fi
+  AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
+    [Define as const if the declaration of iconv() needs const.])
+  dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
+  m4_ifdef([gl_ICONV_H_DEFAULTS],
+    [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+     if test -n "$am_cv_proto_iconv_arg1"; then
+       ICONV_CONST="const"
+     fi
+    ])
 ])
index 0cd84af..c6f534e 100644 (file)
@@ -1045,16 +1045,11 @@ _LT_EOF
       _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
     darwin1.*)
       _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    darwin*) # darwin 5.x on
-      # if running on 10.5 or later, the deployment target defaults
-      # to the OS version, if on x86, and 10.4, the deployment
-      # target defaults to 10.4. Don't you love it?
-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-       10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
-         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-       10.[[012]]*)
+    darwin*)
+      case ${MACOSX_DEPLOYMENT_TARGET},$host in
+       10.[[012]]*,*|,*powerpc*)
          _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-       10.*)
+       *)
          _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
@@ -7474,7 +7469,7 @@ AC_LANG_POP
 # to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_GCJ_CONFIG],
 [AC_REQUIRE([LT_PROG_GCJ])dnl
-AC_LANG_SAVE
+AC_LANG_PUSH([Java])
 
 # Source file extension for Java test sources.
 ac_ext=java
@@ -7530,7 +7525,7 @@ if test -n "$compiler"; then
   _LT_CONFIG($1)
 fi
 
-AC_LANG_RESTORE
+AC_LANG_POP
 
 GCC=$lt_save_GCC
 CC=$lt_save_CC
@@ -7545,7 +7540,7 @@ CFLAGS=$lt_save_CFLAGS
 # to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_GO_CONFIG],
 [AC_REQUIRE([LT_PROG_GO])dnl
-AC_LANG_SAVE
+AC_LANG_PUSH([Go])
 
 # Source file extension for Go test sources.
 ac_ext=go
@@ -7601,7 +7596,7 @@ if test -n "$compiler"; then
   _LT_CONFIG($1)
 fi
 
-AC_LANG_RESTORE
+AC_LANG_POP
 
 GCC=$lt_save_GCC
 CC=$lt_save_CC
@@ -7616,7 +7611,9 @@ CFLAGS=$lt_save_CFLAGS
 # to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_RC_CONFIG],
 [AC_REQUIRE([LT_PROG_RC])dnl
-AC_LANG_SAVE
+
+dnl Here, something like AC_LANG_PUSH([RC]) is expected.
+dnl But Resource Compiler is not supported as a language by autoconf
 
 # Source file extension for RC test sources.
 ac_ext=rc
@@ -7655,8 +7652,10 @@ if test -n "$compiler"; then
   _LT_CONFIG($1)
 fi
 
+dnl Here, AC_LANG_POP is expected.
 GCC=$lt_save_GCC
-AC_LANG_RESTORE
+dnl Back to C
+AC_LANG([C])
 CC=$lt_save_CC
 CFLAGS=$lt_save_CFLAGS
 ])# _LT_LANG_RC_CONFIG
diff --git a/m4/readline.m4 b/m4/readline.m4
new file mode 100644 (file)
index 0000000..2ffbc7b
--- /dev/null
@@ -0,0 +1,66 @@
+dnl Check for readline and dependencies
+dnl Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+dnl
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl Defines HAVE_LIBREADLINE to 1 if a working readline setup is
+dnl found, and sets @LIBREADLINE@ to the necessary libraries.
+
+
+AC_DEFUN([GNUPG_CHECK_READLINE],
+[
+  AC_ARG_WITH(readline,
+     AS_HELP_STRING([--with-readline=DIR],
+       [look for the readline library in DIR]),
+     [_do_readline=$withval],[_do_readline=yes])
+
+  gnupg_cv_have_readline=no
+  if test "$_do_readline" != "no" ; then
+     if test -d "$withval" ; then
+        CPPFLAGS="${CPPFLAGS} -I$withval/include"
+        LDFLAGS="${LDFLAGS} -L$withval/lib"
+     fi
+
+     for _termcap in "" "-ltermcap" "-lcurses" "-lncurses" ; do
+        _readline_save_libs=$LIBS
+        _combo="-lreadline${_termcap:+ $_termcap}"
+        LIBS="$LIBS $_combo"
+
+        AC_MSG_CHECKING([whether readline via "$_combo" is present and sane])
+
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+#include <readline/readline.h>
+#include <readline/history.h>
+]],[[
+rl_completion_func_t *completer;
+add_history("foobar");
+rl_catch_signals=0;
+rl_inhibit_completion=0;
+rl_attempted_completion_function=NULL;
+rl_completion_matches(NULL,NULL);
+]])],[_found_readline=yes],[_found_readline=no])
+
+        AC_MSG_RESULT([$_found_readline])
+
+        LIBS=$_readline_save_libs
+
+        if test $_found_readline = yes ; then
+           AC_DEFINE(HAVE_LIBREADLINE,1,
+             [Define to 1 if you have a fully functional readline library.])
+           AC_SUBST(LIBREADLINE,$_combo)
+           gnupg_cv_have_readline=yes
+           break
+        fi
+     done
+
+     unset _termcap
+     unset _readline_save_libs
+     unset _combo
+     unset _found_readline
+  fi
+])dnl
index 32c2ea5..6a24e49 100644 (file)
-# threadlib.m4 serial 10 (gettext-0.18.2) modified by wk 2014-01-24.
-dnl Copyright (C) 2005-2014 Free Software Foundation, Inc.
+# threadlib.m4 serial 31
+dnl Copyright (C) 2005-2021 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.
 
+AC_PREREQ([2.60])
+
+dnl The general structure of the multithreading modules in gnulib is that we
+dnl have three set of modules:
+dnl
+dnl   * POSIX API:
+dnl     pthread, which combines
+dnl       pthread-h
+dnl       pthread-thread
+dnl       pthread-once
+dnl       pthread-mutex
+dnl       pthread-rwlock
+dnl       pthread-cond
+dnl       pthread-tss
+dnl       pthread-spin
+dnl     sched_yield
+dnl
+dnl   * ISO C API:
+dnl     threads, which combines
+dnl       threads-h
+dnl       thrd
+dnl       mtx
+dnl       cnd
+dnl       tss
+dnl
+dnl   * Gnulib API, with an implementation that can be chosen at configure
+dnl     time through the option --enable-threads=...
+dnl       thread
+dnl       lock
+dnl       cond
+dnl       tls
+dnl       yield
+dnl
+dnl They are independent, except for the fact that
+dnl   - the implementation of the ISO C API may use the POSIX (or some other
+dnl     platform dependent) API,
+dnl   - the implementation of the Gnulib API may use the POSIX or ISO C or
+dnl     some other platform dependent API, depending on the --enable-threads
+dnl     option.
+dnl
+dnl This file contains macros for all of these APIs!
+
+dnl ============================================================================
+dnl Macros for all thread APIs
+
+AC_DEFUN([gl_ANYTHREADLIB_EARLY],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  if test -z "$gl_anythreadlib_early_done"; then
+    case "$host_os" in
+      osf*)
+        # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
+        # groks <pthread.h>. cc also understands the flag -pthread, but
+        # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
+        # 2. putting a flag into CPPFLAGS that has an effect on the linker
+        # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
+        # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
+        THREADLIB_CPPFLAGS="$THREADLIB_CPPFLAGS -D_REENTRANT"
+        ;;
+    esac
+    # Some systems optimize for single-threaded programs by default, and
+    # need special flags to disable these optimizations. For example, the
+    # definition of 'errno' in <errno.h>.
+    case "$host_os" in
+      aix* | freebsd*) THREADLIB_CPPFLAGS="$THREADLIB_CPPFLAGS -D_THREAD_SAFE" ;;
+      solaris*) THREADLIB_CPPFLAGS="$THREADLIB_CPPFLAGS -D_REENTRANT" ;;
+    esac
+    gl_anythreadlib_early_done=done
+  fi
+  if test x"$THREADLIB_CPPFLAGS" != x ; then
+    CPPFLAGS="$CPPFLAGS $THREADLIB_CPPFLAGS"
+  fi
+])
+
+dnl Checks whether the compiler and linker support weak declarations of symbols.
+
+AC_DEFUN([gl_WEAK_SYMBOLS],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CACHE_CHECK([whether imported symbols can be declared weak],
+    [gl_cv_have_weak],
+    [gl_cv_have_weak=no
+     dnl First, test whether the compiler accepts it syntactically.
+     AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[extern void xyzzy ();
+#pragma weak xyzzy]],
+          [[xyzzy();]])],
+       [gl_cv_have_weak=maybe])
+     if test $gl_cv_have_weak = maybe; then
+       dnl Second, test whether it actually works. On Cygwin 1.7.2, with
+       dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
+       AC_RUN_IFELSE(
+         [AC_LANG_SOURCE([[
+#include <stdio.h>
+#pragma weak fputs
+int main ()
+{
+  return (fputs == NULL);
+}]])],
+         [gl_cv_have_weak=yes],
+         [gl_cv_have_weak=no],
+         [dnl When cross-compiling, assume that only ELF platforms support
+          dnl weak symbols.
+          AC_EGREP_CPP([Extensible Linking Format],
+            [#ifdef __ELF__
+             Extensible Linking Format
+             #endif
+            ],
+            [gl_cv_have_weak="guessing yes"],
+            [gl_cv_have_weak="guessing no"])
+         ])
+     fi
+     dnl But when linking statically, weak symbols don't work.
+     case " $LDFLAGS " in
+       *" -static "*) gl_cv_have_weak=no ;;
+     esac
+     dnl Test for a bug in FreeBSD 11: A link error occurs when using a weak
+     dnl symbol and linking against a shared library that has a dependency on
+     dnl the shared library that defines the symbol.
+     case "$gl_cv_have_weak" in
+       *yes)
+         case "$host_os" in
+           freebsd* | dragonfly* | midnightbsd*)
+             : > conftest1.c
+             $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&AS_MESSAGE_LOG_FD 2>&1
+             cat <<EOF > conftest2.c
+#include <pthread.h>
+#pragma weak pthread_mutexattr_gettype
+int main ()
+{
+  return (pthread_mutexattr_gettype != NULL);
+}
+EOF
+             $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&AS_MESSAGE_LOG_FD 2>&1 \
+               || gl_cv_have_weak=no
+             rm -f conftest1.c libempty.so conftest2.c conftest
+             ;;
+         esac
+         ;;
+     esac
+    ])
+  case "$gl_cv_have_weak" in
+    *yes)
+      AC_DEFINE([HAVE_WEAK_SYMBOLS], [1],
+        [Define to 1 if the compiler and linker support weak declarations of symbols.])
+      ;;
+  esac
+])
+
+dnl ============================================================================
+dnl Macros for the POSIX API
+
+dnl gl_PTHREADLIB
+dnl -------------
+dnl Tests for the libraries needs for using the POSIX threads API.
+dnl Sets the variable LIBPTHREAD to the linker options for use in a Makefile.
+dnl Sets the variable LIBPMULTITHREAD, for programs that really need
+dnl multithread functionality. The difference between LIBPTHREAD and
+dnl LIBPMULTITHREAD is that on platforms supporting weak symbols, typically
+dnl LIBPTHREAD is empty whereas LIBPMULTITHREAD is not.
+dnl Sets the variable LIB_SCHED_YIELD to the linker options needed to use the
+dnl sched_yield() function.
+dnl Sets the variable THREADLIB_CPPFLAGS the flag -D_REENTRANT or
+dnl -D_THREAD_SAFE if needed for multithread-safe programs and adds
+dnl THREADLIB_CPPFLAGS to CPPFLAGS.
+dnl Defines the C macro HAVE_PTHREAD_API if (at least parts of) the POSIX
+dnl threads API is available.
+
+dnl The guts of gl_PTHREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_PTHREADLIB_BODY],
+[
+  AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+  if test -z "$gl_pthreadlib_body_done"; then
+    gl_pthread_api=no
+    LIBPTHREAD=
+    LIBPMULTITHREAD=
+    # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+    # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
+    AC_CHECK_HEADER([pthread.h],
+      [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
+    if test "$gl_have_pthread_h" = yes; then
+      # Other possible tests:
+      #   -lpthreads (FSU threads, PCthreads)
+      #   -lgthreads
+      # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+      # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+      # the second one only in libpthread, and lock.c needs it.
+      #
+      # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+      # needs -pthread for some reason.  See:
+      # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
+      save_LIBS=$LIBS
+      for gl_pthread in '' '-pthread'; do
+        LIBS="$LIBS $gl_pthread"
+        AC_LINK_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[#include <pthread.h>
+               pthread_mutex_t m;
+               pthread_mutexattr_t ma;
+             ]],
+             [[pthread_mutex_lock (&m);
+               pthread_mutexattr_init (&ma);]])],
+          [gl_pthread_api=yes
+           LIBPTHREAD=$gl_pthread
+           LIBPMULTITHREAD=$gl_pthread])
+        LIBS=$save_LIBS
+        test $gl_pthread_api = yes && break
+      done
+      echo "$as_me:__oline__: gl_pthread_api=$gl_pthread_api" >&AS_MESSAGE_LOG_FD
+      echo "$as_me:__oline__: LIBPTHREAD=$LIBPTHREAD" >&AS_MESSAGE_LOG_FD
+
+      gl_pthread_in_glibc=no
+      # On Linux with glibc >= 2.34, libc contains the fully functional
+      # pthread functions.
+      case "$host_os" in
+        linux*)
+          AC_EGREP_CPP([Lucky user],
+            [#include <features.h>
+             #ifdef __GNU_LIBRARY__
+              #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || (__GLIBC__ > 2)
+               Lucky user
+              #endif
+             #endif
+            ],
+            [gl_pthread_in_glibc=yes],
+            [])
+          ;;
+      esac
+      echo "$as_me:__oline__: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&AS_MESSAGE_LOG_FD
+
+      # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+      # since it is defined as a macro on OSF/1.)
+      if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
+        # The program links fine without libpthread. But it may actually
+        # need to link with libpthread in order to create multiple threads.
+        AC_CHECK_LIB([pthread], [pthread_kill],
+          [if test $gl_pthread_in_glibc = yes; then
+             LIBPMULTITHREAD=
+           else
+             LIBPMULTITHREAD=-lpthread
+             # On Solaris and HP-UX, most pthread functions exist also in libc.
+             # Therefore pthread_in_use() needs to actually try to create a
+             # thread: pthread_create from libc will fail, whereas
+             # pthread_create will actually create a thread.
+             # On Solaris 10 or newer, this test is no longer needed, because
+             # libc contains the fully functional pthread functions.
+             case "$host_os" in
+               solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*)
+                 AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
+                   [Define if the pthread_in_use() detection is hard.])
+             esac
+           fi
+          ])
+      elif test $gl_pthread_api != yes; then
+        # Some library is needed. Try libpthread and libc_r.
+        AC_CHECK_LIB([pthread], [pthread_kill],
+          [gl_pthread_api=yes
+           LIBPTHREAD=-lpthread
+           LIBPMULTITHREAD=-lpthread])
+        if test $gl_pthread_api != yes; then
+          # For FreeBSD 4.
+          AC_CHECK_LIB([c_r], [pthread_kill],
+            [gl_pthread_api=yes
+             LIBPTHREAD=-lc_r
+             LIBPMULTITHREAD=-lc_r])
+        fi
+      fi
+      echo "$as_me:__oline__: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&AS_MESSAGE_LOG_FD
+    fi
+    AC_MSG_CHECKING([whether POSIX threads API is available])
+    AC_MSG_RESULT([$gl_pthread_api])
+    AC_SUBST([LIBPTHREAD])
+    AC_SUBST([LIBPMULTITHREAD])
+    if test $gl_pthread_api = yes; then
+      AC_DEFINE([HAVE_PTHREAD_API], [1],
+        [Define if you have the <pthread.h> header and the POSIX threads API.])
+    fi
+
+    dnl On some systems, sched_yield is in librt, rather than in libpthread.
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM(
+         [[#include <sched.h>]],
+         [[sched_yield ();]])],
+      [LIB_SCHED_YIELD=
+      ],
+      [dnl Solaris 7...10 has sched_yield in librt, not in libpthread or libc.
+       AC_CHECK_LIB([rt], [sched_yield], [LIB_SCHED_YIELD=-lrt],
+         [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt.
+          AC_CHECK_LIB([posix4], [sched_yield], [LIB_SCHED_YIELD=-lposix4])])
+      ])
+    AC_SUBST([LIB_SCHED_YIELD])
+
+    gl_pthreadlib_body_done=done
+  fi
+])
+
+AC_DEFUN([gl_PTHREADLIB],
+[
+  AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+  gl_PTHREADLIB_BODY
+])
+
+dnl ============================================================================
+dnl Macros for the ISO C API
+
+dnl gl_STDTHREADLIB
+dnl ---------------
+dnl Tests for the libraries needs for using the ISO C threads API.
+dnl Sets the variable LIBSTDTHREAD to the linker options for use in a Makefile.
+dnl Sets the variable THREADLIB_CPPFLAGS the flag -D_REENTRANT or
+dnl -D_THREAD_SAFE if needed for multithread-safe programs and adds
+dnl THREADLIB_CPPFLAGS to CPPFLAGS.
+dnl Defines the C macro HAVE_THREADS_H if (at least parts of) the ISO C threads
+dnl API is available.
+
+dnl The guts of gl_STDTHREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_STDTHREADLIB_BODY],
+[
+  AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  if test -z "$gl_stdthreadlib_body_done"; then
+    AC_CHECK_HEADERS_ONCE([threads.h])
+
+    case "$host_os" in
+      mingw*)
+        LIBSTDTHREAD=
+        ;;
+      *)
+        gl_PTHREADLIB_BODY
+        if test $ac_cv_header_threads_h = yes; then
+          dnl glibc >= 2.29 has thrd_create in libpthread.
+          dnl FreeBSD >= 10 has thrd_create in libstdthreads; this library depends
+          dnl on libpthread (for the symbol 'pthread_mutexattr_gettype').
+          dnl glibc >= 2.34, AIX >= 7.1, and Solaris >= 11.4 have thrd_create in
+          dnl libc.
+          AC_CHECK_FUNCS([thrd_create])
+          if test $ac_cv_func_thrd_create = yes; then
+            LIBSTDTHREAD=
+          else
+            AC_CHECK_LIB([stdthreads], [thrd_create], [
+              LIBSTDTHREAD='-lstdthreads -lpthread'
+            ], [
+              dnl Guess that thrd_create is in libpthread.
+              LIBSTDTHREAD="$LIBPMULTITHREAD"
+            ])
+          fi
+        else
+          dnl Libraries needed by thrd.c, mtx.c, cnd.c, tss.c.
+          LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
+        fi
+        ;;
+    esac
+    AC_SUBST([LIBSTDTHREAD])
+
+    AC_MSG_CHECKING([whether ISO C threads API is available])
+    AC_MSG_RESULT([$ac_cv_header_threads_h])
+    gl_stdthreadlib_body_done=done
+  fi
+])
+
+AC_DEFUN([gl_STDTHREADLIB],
+[
+  AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+  gl_STDTHREADLIB_BODY
+])
+
+dnl ============================================================================
+dnl Macros for the Gnulib API
+
 dnl gl_THREADLIB
 dnl ------------
 dnl Tests for a multithreading library to be used.
@@ -14,17 +386,26 @@ dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the
 dnl default is 'no', otherwise it is system dependent. In both cases, the user
 dnl can change the choice through the options --enable-threads=choice or
 dnl --disable-threads.
-dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
-dnl USE_WINDOWS_THREADS
+dnl Defines at most one of the macros USE_ISOC_THREADS, USE_POSIX_THREADS,
+dnl USE_ISOC_AND_POSIX_THREADS, USE_WINDOWS_THREADS.
+dnl The choice --enable-threads=isoc+posix is available only on platforms that
+dnl have both the ISO C and the POSIX threads APIs. It has the effect of using
+dnl the ISO C API for most things and the POSIX API only for creating and
+dnl controlling threads (because there is no equivalent to pthread_atfork in
+dnl the ISO C API).
 dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
 dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
 dnl libtool).
 dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
 dnl programs that really need multithread functionality. The difference
 dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
-dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
-dnl Sets THREADLIB_CPPFLAGS to -D_REENTRANT or -D_THREAD_SAFE if needed for
-dnl multithread-safe programs and adds THREADLIB_CPPFLAGS to CPPFLAGS.
+dnl symbols, typically LIBTHREAD is empty whereas LIBMULTITHREAD is not.
+dnl Sets the variable THREADLIB_CPPFLAGS the flag -D_REENTRANT or
+dnl -D_THREAD_SAFE if needed for multithread-safe programs and adds
+dnl THREADLIB_CPPFLAGS to CPPFLAGS.
+dnl Since support for GNU pth was removed, $LTLIBTHREAD and $LIBTHREAD have the
+dnl same value, and similarly $LTLIBMULTITHREAD and $LIBMULTITHREAD have the
+dnl same value. Only system libraries are needed.
 
 AC_DEFUN([gl_THREADLIB_EARLY],
 [
@@ -43,19 +424,16 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY],
 
   AC_REQUIRE([AC_CANONICAL_HOST])
   dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
-  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_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
   dnl Check for multithreading.
   THREADLIB_CPPFLAGS=""
   m4_ifdef([gl_THREADLIB_DEFAULT_NO],
     [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
     [m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
+  m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=])
   AC_ARG_ENABLE([threads],
-AC_HELP_STRING([--enable-threads={posix|solaris|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
-AC_HELP_STRING([--disable-threads], [build without multithread safety])]),
+AS_HELP_STRING([--enable-threads={isoc|posix|isoc+posix|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
+AS_HELP_STRING([--disable-threads], [build without multithread safety])]),
     [gl_use_threads=$enableval],
     [if test -n "$gl_use_threads_default"; then
        gl_use_threads="$gl_use_threads_default"
@@ -65,48 +443,35 @@ changequote(,)dnl
          dnl Disable multithreading by default on OSF/1, because it interferes
          dnl with fork()/exec(): When msgexec is linked with -lpthread, its
          dnl child process gets an endless segmentation fault inside execvp().
+         osf*) gl_use_threads=no ;;
          dnl Disable multithreading by default on Cygwin 1.5.x, because it has
          dnl bugs that lead to endless loops or crashes. See
          dnl <https://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
-         osf*) gl_use_threads=no ;;
          cygwin*)
                case `uname -r` in
                  1.[0-5].*) gl_use_threads=no ;;
                  *)         gl_use_threads=yes ;;
                esac
                ;;
+         dnl Obey gl_AVOID_WINPTHREAD on mingw.
+         mingw*)
+               case "$gl_use_winpthreads_default" in
+                 yes) gl_use_threads=posix ;;
+                 no)  gl_use_threads=windows ;;
+                 *)   gl_use_threads=yes ;;
+               esac
+               ;;
          *)    gl_use_threads=yes ;;
        esac
 changequote([,])dnl
      fi
     ])
-  if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
-    # For using <pthread.h>:
-    case "$host_os" in
-      osf*)
-        # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
-        # groks <pthread.h>. cc also understands the flag -pthread, but
-        # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
-        # 2. putting a flag into CPPFLAGS that has an effect on the linker
-        # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
-        # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
-        THREADLIB_CPPFLAGS="$THREADLIB_CPPFLAGS -D_REENTRANT"
-        ;;
-    esac
-    # Some systems optimize for single-threaded programs by default, and
-    # need special flags to disable these optimizations. For example, the
-    # definition of 'errno' in <errno.h>.
-    case "$host_os" in
-      aix* | freebsd*)
-           THREADLIB_CPPFLAGS="$THREADLIB_CPPFLAGS -D_THREAD_SAFE"
-           ;;
-      solaris*)
-           THREADLIB_CPPFLAGS="$THREADLIB_CPPFLAGS -D_REENTRANT"
-           ;;
-    esac
-  fi
-  if test x"$THREADLIB_CPPFLAGS" != x ; then
-      CPPFLAGS="$CPPFLAGS $THREADLIB_CPPFLAGS"
+  if test "$gl_use_threads" = yes \
+     || test "$gl_use_threads" = isoc \
+     || test "$gl_use_threads" = posix \
+     || test "$gl_use_threads" = isoc+posix; then
+    # For using <threads.h> or <pthread.h>:
+    gl_ANYTHREADLIB_EARLY
   fi
 ])
 
@@ -122,138 +487,69 @@ AC_DEFUN([gl_THREADLIB_BODY],
   LTLIBMULTITHREAD=
   if test "$gl_use_threads" != no; then
     dnl Check whether the compiler and linker support weak declarations.
-    AC_CACHE_CHECK([whether imported symbols can be declared weak],
-      [gl_cv_have_weak],
-      [gl_cv_have_weak=no
-       dnl First, test whether the compiler accepts it syntactically.
-       AC_LINK_IFELSE(
-         [AC_LANG_PROGRAM(
-            [[extern void xyzzy ();
-#pragma weak xyzzy]],
-            [[xyzzy();]])],
-         [gl_cv_have_weak=maybe])
-       if test $gl_cv_have_weak = maybe; then
-         dnl Second, test whether it actually works. On Cygwin 1.7.2, with
-         dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
-         AC_RUN_IFELSE(
-           [AC_LANG_SOURCE([[
-#include <stdio.h>
-#pragma weak fputs
-int main ()
-{
-  return (fputs == NULL);
-}]])],
-           [gl_cv_have_weak=yes],
-           [gl_cv_have_weak=no],
-           [dnl When cross-compiling, assume that only ELF platforms support
-            dnl weak symbols.
-            AC_EGREP_CPP([Extensible Linking Format],
-              [#ifdef __ELF__
-               Extensible Linking Format
-               #endif
-              ],
-              [gl_cv_have_weak="guessing yes"],
-              [gl_cv_have_weak="guessing no"])
-           ])
-       fi
-      ])
-    if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
-      # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
-      # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
-      AC_CHECK_HEADER([pthread.h],
-        [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
-      if test "$gl_have_pthread_h" = yes; then
-        # Other possible tests:
-        #   -lpthreads (FSU threads, PCthreads)
-        #   -lgthreads
-        gl_have_pthread=
-        # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
-        # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
-        # the second one only in libpthread, and lock.c needs it.
-        AC_LINK_IFELSE(
-          [AC_LANG_PROGRAM(
-             [[#include <pthread.h>]],
-             [[pthread_mutex_lock((pthread_mutex_t*)0);
-               pthread_mutexattr_init((pthread_mutexattr_t*)0);]])],
-          [gl_have_pthread=yes])
-        # Test for libpthread by looking for pthread_kill. (Not pthread_self,
-        # since it is defined as a macro on OSF/1.)
-        if test -n "$gl_have_pthread"; then
-          # The program links fine without libpthread. But it may actually
-          # need to link with libpthread in order to create multiple threads.
-          AC_CHECK_LIB([pthread], [pthread_kill],
-            [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
-             # On Solaris and HP-UX, most pthread functions exist also in libc.
-             # Therefore pthread_in_use() needs to actually try to create a
-             # thread: pthread_create from libc will fail, whereas
-             # pthread_create will actually create a thread.
-             case "$host_os" in
-               solaris* | hpux*)
-                 AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
-                   [Define if the pthread_in_use() detection is hard.])
-             esac
-            ])
+    gl_WEAK_SYMBOLS
+    if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+      dnl If we use weak symbols to implement pthread_in_use / pth_in_use /
+      dnl thread_in_use, we also need to test whether the ISO C 11 thrd_create
+      dnl facility is in use.
+      AC_CHECK_HEADERS_ONCE([threads.h])
+      :
+    fi
+    if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then
+      AC_CHECK_HEADERS_ONCE([threads.h])
+      gl_have_isoc_threads="$ac_cv_header_threads_h"
+    fi
+    if test "$gl_use_threads" = yes \
+       || test "$gl_use_threads" = posix \
+       || test "$gl_use_threads" = isoc+posix; then
+      gl_PTHREADLIB_BODY
+      LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD
+      LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD
+      if test $gl_pthread_api = yes; then
+        if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then
+          gl_threads_api='isoc+posix'
+          AC_DEFINE([USE_ISOC_AND_POSIX_THREADS], [1],
+            [Define if the combination of the ISO C and POSIX multithreading APIs can be used.])
+          LIBTHREAD= LTLIBTHREAD=
         else
-          # Some library is needed. Try libpthread and libc_r.
-          AC_CHECK_LIB([pthread], [pthread_kill],
-            [gl_have_pthread=yes
-             LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
-             LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
-          if test -z "$gl_have_pthread"; then
-            # For FreeBSD 4.
-            AC_CHECK_LIB([c_r], [pthread_kill],
-              [gl_have_pthread=yes
-               LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
-               LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
-          fi
-        fi
-        if test -n "$gl_have_pthread"; then
           gl_threads_api=posix
           AC_DEFINE([USE_POSIX_THREADS], [1],
             [Define if the POSIX multithreading library can be used.])
-          if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
+          if test -z "$LIBMULTITHREAD" && test -z "$LTLIBMULTITHREAD"; then
+            AC_DEFINE([USE_POSIX_THREADS_FROM_LIBC], [1],
+              [Define if references to the POSIX multithreading library are satisfied by libc.])
+          else
             if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
               AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
                 [Define if references to the POSIX multithreading library should be made weak.])
-              LIBTHREAD=
-              LTLIBTHREAD=
+              LIBTHREAD= LTLIBTHREAD=
+            else
+              case "$host_os" in
+                freebsd* | dragonfly* | midnightbsd*)
+                  if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then
+                    dnl If weak symbols can't tell whether pthread_create(), pthread_key_create()
+                    dnl etc. will succeed, we need a runtime test.
+                    AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
+                      [Define if the pthread_in_use() detection is hard.])
+                  fi
+                  ;;
+              esac
             fi
           fi
         fi
       fi
     fi
-    if test -z "$gl_have_pthread"; then
-      if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
-        gl_have_solaristhread=
-        gl_save_LIBS="$LIBS"
-        LIBS="$LIBS -lthread"
-        AC_LINK_IFELSE(
-          [AC_LANG_PROGRAM(
-             [[
-#include <thread.h>
-#include <synch.h>
-             ]],
-             [[thr_self();]])],
-          [gl_have_solaristhread=yes])
-        LIBS="$gl_save_LIBS"
-        if test -n "$gl_have_solaristhread"; then
-          gl_threads_api=solaris
-          LIBTHREAD=-lthread
-          LTLIBTHREAD=-lthread
-          LIBMULTITHREAD="$LIBTHREAD"
-          LTLIBMULTITHREAD="$LTLIBTHREAD"
-          AC_DEFINE([USE_SOLARIS_THREADS], [1],
-            [Define if the old Solaris multithreading library can be used.])
-          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
-            AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
-              [Define if references to the old Solaris multithreading library should be made weak.])
-            LIBTHREAD=
-            LTLIBTHREAD=
-          fi
-        fi
+    if test $gl_threads_api = none; then
+      if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
+        gl_STDTHREADLIB_BODY
+        LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD
+        LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD
+        gl_threads_api=isoc
+        AC_DEFINE([USE_ISOC_THREADS], [1],
+          [Define if the ISO C multithreading library can be used.])
       fi
     fi
-    if test -z "$gl_have_pthread"; then
+    if test $gl_threads_api = none; then
       case "$gl_use_threads" in
         yes | windows | win32) # The 'win32' is for backward compatibility.
           if { case "$host_os" in
@@ -295,6 +591,21 @@ AC_DEFUN([gl_DISABLE_THREADS], [
 ])
 
 
+dnl gl_AVOID_WINPTHREAD
+dnl -------------------
+dnl Sets the gl_THREADLIB default so that on mingw, a dependency to the
+dnl libwinpthread DLL (mingw-w64 winpthreads library) is avoided.
+dnl The user can still override it at installation time, by using the
+dnl configure option '--enable-threads'.
+
+AC_DEFUN([gl_AVOID_WINPTHREAD], [
+  m4_divert_text([INIT_PREPARE], [gl_use_winpthreads_default=no])
+])
+
+
+dnl ============================================================================
+
+
 dnl Survey of platforms:
 dnl
 dnl Platform           Available  Compiler    Supports   test-lock
@@ -302,7 +613,11 @@ dnl                    flavours   option      weak       result
 dnl ---------------    ---------  ---------   --------   ---------
 dnl Linux 2.4/glibc    posix      -lpthread       Y      OK
 dnl
-dnl GNU Hurd/glibc     posix
+dnl Linux/glibc 2.34   posix                      Y      OK
+dnl
+dnl GNU Hurd/glibc     posix      -lpthread       Y      OK
+dnl
+dnl Ubuntu 14.04       posix      -pthread        Y      OK
 dnl
 dnl FreeBSD 5.3        posix      -lc_r           Y
 dnl                    posix      -lkse ?         Y
@@ -322,7 +637,6 @@ dnl
 dnl Mac OS X 10.[123]  posix      -lpthread       Y      OK
 dnl
 dnl Solaris 7,8,9      posix      -lpthread       Y      Sol 7,8: 0.0; Sol 9: OK
-dnl                    solaris    -lthread        Y      Sol 7,8: 0.0; Sol 9: OK
 dnl
 dnl HP-UX 11           posix      -lpthread       N (cc) OK
 dnl                                               Y (gcc)
@@ -336,8 +650,6 @@ dnl                               -lpthread (gcc) Y
 dnl
 dnl Cygwin             posix      -lpthread       Y      OK
 dnl
-dnl Any of the above   pth        -lpth                  0.0
-dnl
 dnl Mingw              windows                    N      OK
 dnl
 dnl BeOS 5             --
index bff6ab5..33a80b7 100644 (file)
@@ -3,6 +3,7 @@ cs
 da
 de
 eo
+es
 fr
 hu
 it
index 2a3aabc..0932c98 100644 (file)
@@ -11,4 +11,5 @@
 
 src/err-sources.h
 src/err-codes.h
+src/argparse.c
 src/gpg-error.c
index aec56de..b6a02f8 100644 (file)
Binary files a/po/cs.gmo and b/po/cs.gmo differ
index f64305d..6a4232e 100644 (file)
--- a/po/cs.po
+++ b/po/cs.po
@@ -1,7 +1,7 @@
 # Czech translation of libgpg-error.
 # Copyright (C) 2009 Free Software Foundation, Inc.
 # This file is distributed under the same license as the libgpg-error package.
-# Petr Pisar <petr.pisar@atlas.cz>, 2009, 2012, 2014.
+# Petr Pisar <petr.pisar@atlas.cz>, 2009, 2012, 2014, 2021.
 #
 # certificate chain → řetězec (posloupnost) certifikátů
 # keybox → schránka (na klíče)
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: libgpg-error 1.18\n"
+"Project-Id-Version: libgpg-error 1.42\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2014-11-27 19:31+0100\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-10-15 21:07+02:00\n"
 "Last-Translator: Petr Pisar <petr.pisar@atlas.cz>\n"
 "Language-Team: Czech <translation-team-cs@lists.sourceforge.net>\n"
 "Language: cs\n"
@@ -89,30 +89,34 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
+msgid "TPM2d"
+msgstr "TPM2d"
+
+#: src/err-sources.h:45
 msgid "TLS"
 msgstr "TLS"
 
-#: src/err-sources.h:45
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "Nespecifikovaný zdroj"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "Uživatelem definovaný zdroj 1"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "Uživatelem definovaný zdroj 2"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "Uživatelem definovaný zdroj 3"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "Uživatelem definovaný zdroj 4"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Neznámý zdroj"
 
@@ -170,7 +174,7 @@ msgstr "Neplatný šifrovací algoritmus"
 
 #: src/err-codes.h:41
 msgid "Cannot open keyring"
-msgstr "Klíčenka otevřena"
+msgstr "Klíčenku nelze otevřít"
 
 #: src/err-codes.h:42
 msgid "Invalid packet"
@@ -976,49 +980,39 @@ msgstr "Chybný osmičkový znak v S-výrazu"
 
 #: src/err-codes.h:242
 msgid "All subkeys are expired or revoked"
-msgstr ""
+msgstr "Všem podklíčům skončila platnost nebo byly odvolány"
 
 #: src/err-codes.h:243
-#, fuzzy
-#| msgid "Data not encrypted"
 msgid "Database is corrupted"
-msgstr "Data nešifrována"
+msgstr "Databáze je poškozená"
 
 #: src/err-codes.h:244
 msgid "Server indicated a failure"
-msgstr ""
+msgstr "Server ohlásil selhání"
 
 #: src/err-codes.h:245
-#, fuzzy
-#| msgid "Unknown name"
 msgid "No name"
-msgstr "Neznámé jméno"
+msgstr "Žádné jméno"
 
 #: src/err-codes.h:246
-#, fuzzy
-#| msgid "No public key"
 msgid "No key"
-msgstr "Žádný veřejný klíč"
+msgstr "Žádný klíč"
 
 #: src/err-codes.h:247
 msgid "Legacy key"
-msgstr ""
+msgstr "Zastaralý klíč"
 
 #: src/err-codes.h:248
-#, fuzzy
-#| msgid "Buffer too short"
 msgid "Request too short"
-msgstr "Vyrovnávací paměť je příliš malá"
+msgstr "Požadavek je příliš krátký"
 
 #: src/err-codes.h:249
-#, fuzzy
-#| msgid "Line too long"
 msgid "Request too long"
-msgstr "Příliš dlouhý řádek"
+msgstr "Požadavek je příliš dlouhý"
 
 #: src/err-codes.h:250
 msgid "Object is in termination state"
-msgstr ""
+msgstr "Objekt je v konečném stavu"
 
 #: src/err-codes.h:251
 msgid "No certificate chain"
@@ -1122,7 +1116,7 @@ msgstr "Chybný řetězec"
 
 #: src/err-codes.h:276
 msgid "Forbidden"
-msgstr ""
+msgstr "Zakázán"
 
 #: src/err-codes.h:277
 msgid "Key disabled"
@@ -1134,15 +1128,15 @@ msgstr "Nelze provést s klíčem na kartě"
 
 #: src/err-codes.h:279
 msgid "Invalid lock object"
-msgstr "Neplatný objekt"
+msgstr "Neplatný objekt zámku"
 
 #: src/err-codes.h:280
 msgid "True"
-msgstr ""
+msgstr "Pravda"
 
 #: src/err-codes.h:281
 msgid "False"
-msgstr ""
+msgstr "Nepravda"
 
 #: src/err-codes.h:282
 msgid "General IPC error"
@@ -1241,668 +1235,768 @@ msgid "Unknown IPC inquire"
 msgstr "Neznámý dotaz IPC"
 
 #: src/err-codes.h:306
-#, fuzzy
-#| msgid "No crypto engine"
 msgid "Crypto engine too old"
-msgstr "Chybí kryptografická jednotka"
+msgstr "Kryptografická jednotka je příliš stará"
 
 #: src/err-codes.h:307
 msgid "Screen or window too small"
-msgstr ""
+msgstr "Obrazovka nebo okno je příliš malé"
 
 #: src/err-codes.h:308
 msgid "Screen or window too large"
-msgstr ""
+msgstr "Obrazovka nebo okno je příliš velké"
 
 #: src/err-codes.h:309
 msgid "Required environment variable not set"
-msgstr ""
+msgstr "Požadovaná proměnná prostředí není nastavena"
 
 #: src/err-codes.h:310
 msgid "User ID already exists"
-msgstr ""
+msgstr "ID uživatele již existuje"
 
 #: src/err-codes.h:311
 msgid "Name already exists"
-msgstr ""
+msgstr "Název již existuje"
 
 #: src/err-codes.h:312
-#, fuzzy
-#| msgid "Duplicated value"
 msgid "Duplicated name"
-msgstr "Zdvojená hodnota"
+msgstr "Zdvojený název"
 
 #: src/err-codes.h:313
-#, fuzzy
-#| msgid "Certificate too young"
 msgid "Object is too young"
-msgstr "Certifikát je příliš mladý"
+msgstr "Objekt je příliš mladý"
 
 #: src/err-codes.h:314
-#, fuzzy
-#| msgid "Provided object is too short"
 msgid "Object is too old"
-msgstr "Dodaný objekt je příliš krátký"
+msgstr "Objekt je příliš starý"
 
 #: src/err-codes.h:315
-#, fuzzy
-#| msgid "Unknown name"
 msgid "Unknown flag"
-msgstr "Neznámé jméno"
+msgstr "Neznámý pÅ\99íznak"
 
 #: src/err-codes.h:316
-#, fuzzy
-#| msgid "Invalid operation code"
 msgid "Invalid execution order"
-msgstr "Neplatný kód operace"
+msgstr "Neplatné poÅ\99adí vykonávání"
 
 #: src/err-codes.h:317
 msgid "Already fetched"
-msgstr ""
+msgstr "Již staženo"
 
 #: src/err-codes.h:318
 msgid "Try again later"
-msgstr ""
+msgstr "Opakujte později"
 
 #: src/err-codes.h:319
-#, fuzzy
-#| msgid "Unknown name"
 msgid "Wrong name"
-msgstr "Neznámé jméno"
+msgstr "Špatný název"
 
 #: src/err-codes.h:320
-msgid "System bug detected"
-msgstr ""
+msgid "Not authenticated"
+msgstr "Neautentizováno"
 
 #: src/err-codes.h:321
-#, fuzzy
-#| msgid "Unknown system error"
-msgid "Unknown DNS error"
-msgstr "Neznámá chyba systému"
+msgid "Bad authentication"
+msgstr "Chybná autentizace"
 
 #: src/err-codes.h:322
-#, fuzzy
-#| msgid "Invalid OID string"
-msgid "Invalid DNS section"
-msgstr "Neplatný řetězec OID"
+msgid "No Keybox daemon running"
+msgstr "Démon pro schránku na klíče neběží"
 
 #: src/err-codes.h:323
-#, fuzzy
-#| msgid "Invalid S-expression"
-msgid "Invalid textual address form"
-msgstr "Neplatný S-výraz"
+msgid "Keybox daemon error"
+msgstr "Chyba démona pro schránku na klíče"
 
 #: src/err-codes.h:324
-#, fuzzy
-#| msgid "Missing issuer certificate"
-msgid "Missing DNS query packet"
-msgstr "Chybí certifikát vydavatele"
+msgid "Service is not running"
+msgstr "Služba neběží"
 
 #: src/err-codes.h:325
-msgid "Missing DNS answer packet"
-msgstr ""
+msgid "Service error"
+msgstr "Chyba služby"
 
 #: src/err-codes.h:326
-msgid "Connection closed in DNS"
-msgstr ""
+msgid "System bug detected"
+msgstr "Objevena chyba systému"
 
 #: src/err-codes.h:327
-#, fuzzy
-#| msgid "Decryption failed"
-msgid "Verification failed in DNS"
-msgstr "Dešifrování selhalo"
+msgid "Unknown DNS error"
+msgstr "Neznámá chyba DNS"
 
 #: src/err-codes.h:328
-#, fuzzy
-#| msgid "Timeout"
-msgid "DNS Timeout"
-msgstr "Čas vypršel"
+msgid "Invalid DNS section"
+msgstr "Neplatný oddíl DNS"
 
 #: src/err-codes.h:329
-#, fuzzy
-#| msgid "General IPC error"
-msgid "General LDAP error"
-msgstr "Obecná chyba IPC"
+msgid "Invalid textual address form"
+msgstr "Neplatná textová podoba adresy"
 
 #: src/err-codes.h:330
-#, fuzzy
-#| msgid "General error"
-msgid "General LDAP attribute error"
-msgstr "Obecná chyba"
+msgid "Missing DNS query packet"
+msgstr "Chybí packet s dotazem DNS"
 
 #: src/err-codes.h:331
-#, fuzzy
-#| msgid "General error"
-msgid "General LDAP name error"
-msgstr "Obecná chyba"
+msgid "Missing DNS answer packet"
+msgstr "Chybí packet s odpovědí DNS"
 
 #: src/err-codes.h:332
-#, fuzzy
-#| msgid "General Assuan error"
-msgid "General LDAP security error"
-msgstr "Obecná chyba Assuanu"
+msgid "Connection closed in DNS"
+msgstr "Spojení v DNS uzavřeno"
 
 #: src/err-codes.h:333
-#, fuzzy
-#| msgid "General error"
-msgid "General LDAP service error"
-msgstr "Obecná chyba"
+msgid "Verification failed in DNS"
+msgstr "Ověřování v DNS selhalo"
 
 #: src/err-codes.h:334
-#, fuzzy
-#| msgid "General Assuan error"
-msgid "General LDAP update error"
-msgstr "Obecná chyba Assuanu"
+msgid "DNS Timeout"
+msgstr "Časový limit pro DNS vypršel"
 
 #: src/err-codes.h:335
-msgid "Experimental LDAP error code"
-msgstr ""
+msgid "General LDAP error"
+msgstr "Obecná chyba LDAP"
 
 #: src/err-codes.h:336
-#, fuzzy
-#| msgid "IPC write error"
-msgid "Private LDAP error code"
-msgstr "Chyba zápisu IPC"
+msgid "General LDAP attribute error"
+msgstr "Obecná chyba atributu LDAP"
 
 #: src/err-codes.h:337
-#, fuzzy
-#| msgid "General IPC error"
-msgid "Other general LDAP error"
-msgstr "Obecná chyba IPC"
+msgid "General LDAP name error"
+msgstr "Obecná chyba názvu LDAP"
 
 #: src/err-codes.h:338
-#, fuzzy
-#| msgid "IPC connect call failed"
-msgid "LDAP connecting failed (X)"
-msgstr "IPC volání connect (připojit) selhalo"
+msgid "General LDAP security error"
+msgstr "Obecná chyba zabezpečení LDAP"
 
 #: src/err-codes.h:339
-#, fuzzy
-#| msgid "General error"
-msgid "LDAP referral limit exceeded"
-msgstr "Obecná chyba"
+msgid "General LDAP service error"
+msgstr "Obecná chyba služby LDAP"
 
 #: src/err-codes.h:340
-msgid "LDAP client loop"
-msgstr ""
+msgid "General LDAP update error"
+msgstr "Obecná chyba aktualizace LDAP"
 
 #: src/err-codes.h:341
-#, fuzzy
-#| msgid "Card reset required"
-msgid "No LDAP results returned"
-msgstr "Vyžadován reset karty"
+msgid "Experimental LDAP error code"
+msgstr "Experimentální chybový kód LDAP"
 
 #: src/err-codes.h:342
-#, fuzzy
-#| msgid "Element not found"
-msgid "LDAP control not found"
-msgstr "Prvek nenalezen"
+msgid "Private LDAP error code"
+msgstr "Soukromý chybový kód LDAP"
 
 #: src/err-codes.h:343
-#, fuzzy
-#| msgid "Not supported"
-msgid "Not supported by LDAP"
-msgstr "Nepodporováno"
+msgid "Other general LDAP error"
+msgstr "Jiná obecná chyba LDAP"
 
 #: src/err-codes.h:344
-#, fuzzy
-#| msgid "Unexpected error"
-msgid "LDAP connect error"
-msgstr "Neočekávaná chyba"
+msgid "LDAP connecting failed (X)"
+msgstr "Spojení LDAP selhalo (X)"
 
 #: src/err-codes.h:345
-msgid "Out of memory in LDAP"
-msgstr ""
+msgid "LDAP referral limit exceeded"
+msgstr "Překročeno omezení na počet odkazů LDAP"
 
 #: src/err-codes.h:346
-msgid "Bad parameter to an LDAP routine"
-msgstr ""
+msgid "LDAP client loop"
+msgstr "Smyčka klienta LDAP"
 
 #: src/err-codes.h:347
-#, fuzzy
-#| msgid "Unsupported operation"
-msgid "User cancelled LDAP operation"
-msgstr "Nepodporovaná operace"
+msgid "No LDAP results returned"
+msgstr "Nevráceny žádné výsledky LDAP"
 
 #: src/err-codes.h:348
-#, fuzzy
-#| msgid "Bad certificate"
-msgid "Bad LDAP search filter"
-msgstr "Chybný certifikát"
+msgid "LDAP control not found"
+msgstr "Ovládání LDAP nenalezeno"
 
 #: src/err-codes.h:349
-#, fuzzy
-#| msgid "Unknown extension"
-msgid "Unknown LDAP authentication method"
-msgstr "Neznámé rozšíření"
+msgid "Not supported by LDAP"
+msgstr "Nepodporováno v LDAP"
 
 #: src/err-codes.h:350
-#, fuzzy
-#| msgid "Timeout"
-msgid "Timeout in LDAP"
-msgstr "Čas vypršel"
+msgid "LDAP connect error"
+msgstr "Chyba připojování LDAP"
 
 #: src/err-codes.h:351
-#, fuzzy
-#| msgid "dirmngr error"
-msgid "LDAP decoding error"
-msgstr "chyba dirmngr"
+msgid "Out of memory in LDAP"
+msgstr "Nedostatek paměti v LDAP"
 
 #: src/err-codes.h:352
-#, fuzzy
-#| msgid "dirmngr error"
-msgid "LDAP encoding error"
-msgstr "chyba dirmngr"
+msgid "Bad parameter to an LDAP routine"
+msgstr "Chybná parametr ve volání LDAP"
 
 #: src/err-codes.h:353
-#, fuzzy
-#| msgid "IPC read error"
-msgid "LDAP local error"
-msgstr "Chyba čtení IPC"
+msgid "User cancelled LDAP operation"
+msgstr "Uživatel zrušil operaci LDAP"
 
 #: src/err-codes.h:354
-#, fuzzy
-#| msgid "Not an IPC server"
-msgid "Cannot contact LDAP server"
-msgstr "Není serverem IPC"
+msgid "Bad LDAP search filter"
+msgstr "Chybný vyhledávací filtr LDAP"
 
 #: src/err-codes.h:355
-#, fuzzy
-#| msgid "Success"
-msgid "LDAP success"
-msgstr "Úspěch"
+msgid "Unknown LDAP authentication method"
+msgstr "Neznámá metoda autentizace LDAP"
 
-# Nastavení nebo nastavování?
 #: src/err-codes.h:356
-#, fuzzy
-#| msgid "Configuration error"
-msgid "LDAP operations error"
-msgstr "Chyba konfigurace"
+msgid "Timeout in LDAP"
+msgstr "Čas vypršel v LDAP"
 
 #: src/err-codes.h:357
-#, fuzzy
-#| msgid "Protocol violation"
-msgid "LDAP protocol error"
-msgstr "Narušení protokolu"
+msgid "LDAP decoding error"
+msgstr "Chyba dekódování LDAP"
 
 #: src/err-codes.h:358
-msgid "Time limit exceeded in LDAP"
-msgstr ""
+msgid "LDAP encoding error"
+msgstr "Chyba kódování do LDAP"
 
 #: src/err-codes.h:359
-msgid "Size limit exceeded in LDAP"
-msgstr ""
+msgid "LDAP local error"
+msgstr "Místní chyba LDAP"
 
 #: src/err-codes.h:360
-msgid "LDAP compare false"
-msgstr ""
+msgid "Cannot contact LDAP server"
+msgstr "LDAP server nelze kontaktovat"
 
 #: src/err-codes.h:361
-msgid "LDAP compare true"
-msgstr ""
+msgid "LDAP success"
+msgstr "Úspěch LDAP"
 
 #: src/err-codes.h:362
-#, fuzzy
-#| msgid "Unknown extension"
-msgid "LDAP authentication method not supported"
-msgstr "Neznámé rozšíření"
+msgid "LDAP operations error"
+msgstr "Chyba operací v LDAP"
 
 #: src/err-codes.h:363
-msgid "Strong(er) LDAP authentication required"
-msgstr ""
+msgid "LDAP protocol error"
+msgstr "Chyba protokolu LDAP"
 
 #: src/err-codes.h:364
-#, fuzzy
-#| msgid "Fatal alert message received"
-msgid "Partial LDAP results+referral received"
-msgstr "Přijata nepřekonatelná chybová zpráva"
+msgid "Time limit exceeded in LDAP"
+msgstr "Časový limit v LDAP vypršel"
 
 #: src/err-codes.h:365
-#, fuzzy
-#| msgid "General error"
-msgid "LDAP referral"
-msgstr "Obecná chyba"
+msgid "Size limit exceeded in LDAP"
+msgstr "Omezení na velikost v LDAP překročeno"
 
 #: src/err-codes.h:366
-msgid "Administrative LDAP limit exceeded"
-msgstr ""
+msgid "LDAP compare false"
+msgstr "Nepravdivé porovnání LDAP"
 
 #: src/err-codes.h:367
-msgid "Critical LDAP extension is unavailable"
-msgstr ""
+msgid "LDAP compare true"
+msgstr "Pravdivé porovnání LDAP"
 
 #: src/err-codes.h:368
-#, fuzzy
-#| msgid "Card reset required"
-msgid "Confidentiality required by LDAP"
-msgstr "Vyžadován reset karty"
+msgid "LDAP authentication method not supported"
+msgstr "Autentizační metoda LDAP není podporována"
 
 #: src/err-codes.h:369
-msgid "LDAP SASL bind in progress"
-msgstr ""
+msgid "Strong(er) LDAP authentication required"
+msgstr "Požadována silnější autentizace LDAP"
 
 #: src/err-codes.h:370
-msgid "No such LDAP attribute"
-msgstr ""
+msgid "Partial LDAP results+referral received"
+msgstr "Částečný výsledek LDAP a přijatý odkaz"
 
 #: src/err-codes.h:371
-#, fuzzy
-#| msgid "Invalid attribute"
-msgid "Undefined LDAP attribute type"
-msgstr "Neplatný atribut"
+msgid "LDAP referral"
+msgstr "Odkaz LDAP"
 
 #: src/err-codes.h:372
-#, fuzzy
-#| msgid "Unsupported protection"
-msgid "Inappropriate matching in LDAP"
-msgstr "Nepodporovaná ochrana"
+msgid "Administrative LDAP limit exceeded"
+msgstr "Administrativní omezení LDAP překročeno"
 
 #: src/err-codes.h:373
-#, fuzzy
-#| msgid "Protocol violation"
-msgid "Constraint violation in LDAP"
-msgstr "Narušení protokolu"
+msgid "Critical LDAP extension is unavailable"
+msgstr "Kritické rozšíření LDAP není dostupné"
 
 #: src/err-codes.h:374
-msgid "LDAP type or value exists"
-msgstr ""
+msgid "Confidentiality required by LDAP"
+msgstr "LDAP vyžaduje důvěrnost"
 
 #: src/err-codes.h:375
-#, fuzzy
-#| msgid "Invalid state"
-msgid "Invalid syntax in LDAP"
-msgstr "Neplatná stav"
+msgid "LDAP SASL bind in progress"
+msgstr "Navazuje se LDAP SASL"
 
 #: src/err-codes.h:376
-#, fuzzy
-#| msgid "No CMS object"
-msgid "No such LDAP object"
-msgstr "Žádný objekt CMS"
+msgid "No such LDAP attribute"
+msgstr "Taková LDAP atribut neexistuje"
 
 #: src/err-codes.h:377
-#, fuzzy
-#| msgid "Hardware problem"
-msgid "LDAP alias problem"
-msgstr "Hardwarový problém"
+msgid "Undefined LDAP attribute type"
+msgstr "Nedefinovaný druh LDAP atributu"
 
 #: src/err-codes.h:378
-#, fuzzy
-#| msgid "Invalid state"
-msgid "Invalid DN syntax in LDAP"
-msgstr "Neplatná stav"
+msgid "Inappropriate matching in LDAP"
+msgstr "Nevhodné shody v LDAP"
 
 #: src/err-codes.h:379
-msgid "LDAP entry is a leaf"
-msgstr ""
+msgid "Constraint violation in LDAP"
+msgstr "Porušení omezení v LDAP"
 
 #: src/err-codes.h:380
-#, fuzzy
-#| msgid "Encoding problem"
-msgid "LDAP alias dereferencing problem"
-msgstr "Chyba kódování"
+msgid "LDAP type or value exists"
+msgstr "Typ LDAP nebo hodnota existuje"
 
 #: src/err-codes.h:381
-msgid "LDAP proxy authorization failure (X)"
-msgstr ""
+msgid "Invalid syntax in LDAP"
+msgstr "Neplatná skladba v LDAP"
 
 #: src/err-codes.h:382
-#, fuzzy
-#| msgid "Unsupported protection"
-msgid "Inappropriate LDAP authentication"
-msgstr "Nepodporovaná ochrana"
+msgid "No such LDAP object"
+msgstr "Žádný takový objekt LDAP"
 
 #: src/err-codes.h:383
-#, fuzzy
-#| msgid "Invalid card"
-msgid "Invalid LDAP credentials"
-msgstr "Neplatná karta"
+msgid "LDAP alias problem"
+msgstr "Problém s aliasem LDAP"
 
 #: src/err-codes.h:384
-msgid "Insufficient access for LDAP"
-msgstr ""
+msgid "Invalid DN syntax in LDAP"
+msgstr "Neplatná skladba DN v LDAP"
 
 #: src/err-codes.h:385
-msgid "LDAP server is busy"
-msgstr ""
+msgid "LDAP entry is a leaf"
+msgstr "LDAP záznam je list"
 
 #: src/err-codes.h:386
-#, fuzzy
-#| msgid "No keyserver available"
-msgid "LDAP server is unavailable"
-msgstr "Není dostupný žádný server klíčů"
+msgid "LDAP alias dereferencing problem"
+msgstr "Problém s vyhodnocováním odkazu LDAP"
 
 #: src/err-codes.h:387
-msgid "LDAP server is unwilling to perform"
-msgstr ""
+msgid "LDAP proxy authorization failure (X)"
+msgstr "Selhání autorizace LDAP proxy (X)"
 
 #: src/err-codes.h:388
-msgid "Loop detected by LDAP"
-msgstr ""
+msgid "Inappropriate LDAP authentication"
+msgstr "Nevhodné autentizace LDAP"
 
 #: src/err-codes.h:389
-#, fuzzy
-#| msgid "Missing action"
-msgid "LDAP naming violation"
-msgstr "Chybí akce"
+msgid "Invalid LDAP credentials"
+msgstr "Neplatné autentizační údaje LDAP"
 
 #: src/err-codes.h:390
-#, fuzzy
-#| msgid "Protocol violation"
-msgid "LDAP object class violation"
-msgstr "Narušení protokolu"
+msgid "Insufficient access for LDAP"
+msgstr "Nedostatečná přístupová práva k LDAP"
 
 #: src/err-codes.h:391
-#, fuzzy
-#| msgid "Operation not yet finished"
-msgid "LDAP operation not allowed on non-leaf"
-msgstr "Operace ještě neskončila"
+msgid "LDAP server is busy"
+msgstr "Server LDAP je zaneprázdněný"
 
 #: src/err-codes.h:392
-#, fuzzy
-#| msgid "Operation cancelled"
-msgid "LDAP operation not allowed on RDN"
-msgstr "Operace zrušena"
+msgid "LDAP server is unavailable"
+msgstr "Server LDAP není dostupný"
 
 #: src/err-codes.h:393
-msgid "Already exists (LDAP)"
-msgstr ""
+msgid "LDAP server is unwilling to perform"
+msgstr "Server LDAP není ochoten vyhodnotit požadavek"
 
 #: src/err-codes.h:394
-msgid "Cannot modify LDAP object class"
-msgstr ""
+msgid "Loop detected by LDAP"
+msgstr "Objevena smyčka v LDAP"
 
 #: src/err-codes.h:395
-#, fuzzy
-#| msgid "Line too long"
-msgid "LDAP results too large"
-msgstr "Příliš dlouhý řádek"
+msgid "LDAP naming violation"
+msgstr "Narušení pojmenování v LDAP"
 
 #: src/err-codes.h:396
-#, fuzzy
-#| msgid "Operation cancelled"
-msgid "LDAP operation affects multiple DSAs"
-msgstr "Operace zrušena"
+msgid "LDAP object class violation"
+msgstr "Narušení třídy objektu LDAP"
 
 #: src/err-codes.h:397
-msgid "Virtual LDAP list view error"
-msgstr ""
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "Operace LDAP není na vnitřních uzlech dovolena"
 
 #: src/err-codes.h:398
-#, fuzzy
-#| msgid "General IPC error"
-msgid "Other LDAP error"
-msgstr "Obecná chyba IPC"
+msgid "LDAP operation not allowed on RDN"
+msgstr "Operace LDAP není dovolena na RDN"
 
 #: src/err-codes.h:399
-#, fuzzy
-#| msgid "Resources exhausted"
-msgid "Resources exhausted in LCUP"
-msgstr "Zdroje vyčerpány"
+msgid "Already exists (LDAP)"
+msgstr "Již existuje (LDAP)"
 
 #: src/err-codes.h:400
-#, fuzzy
-#| msgid "Protocol violation"
-msgid "Security violation in LCUP"
-msgstr "Narušení protokolu"
+msgid "Cannot modify LDAP object class"
+msgstr "Třídu objektu LDAP nelze upravit"
 
 #: src/err-codes.h:401
-#, fuzzy
-#| msgid "Invalid state"
-msgid "Invalid data in LCUP"
-msgstr "Neplatná stav"
+msgid "LDAP results too large"
+msgstr "Výsledek LDAP je příliš velký"
 
 #: src/err-codes.h:402
-#, fuzzy
-#| msgid "Unsupported certificate"
-msgid "Unsupported scheme in LCUP"
-msgstr "Nepodporovaný certifikát"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "LDAP operace ovlivňuje více DSA"
 
 #: src/err-codes.h:403
-#, fuzzy
-#| msgid "Card reset required"
-msgid "Reload required in LCUP"
-msgstr "Vyžadován reset karty"
+msgid "Virtual LDAP list view error"
+msgstr "Chyba v pohledu na virtuální seznam LDAP"
 
 #: src/err-codes.h:404
-#, fuzzy
-#| msgid "Success"
-msgid "LDAP cancelled"
-msgstr "Úspěch"
+msgid "Other LDAP error"
+msgstr "Jiný chyba LDAP"
 
 #: src/err-codes.h:405
-#, fuzzy
-#| msgid "Not operational"
-msgid "No LDAP operation to cancel"
-msgstr "Nefunkční"
+msgid "Resources exhausted in LCUP"
+msgstr "Zdroje vyčerpány v LCUP"
 
 #: src/err-codes.h:406
-#, fuzzy
-#| msgid "Not operational"
-msgid "Too late to cancel LDAP"
-msgstr "Nefunkční"
+msgid "Security violation in LCUP"
+msgstr "Narušení bezpečnosti v LCUP"
 
 #: src/err-codes.h:407
-#, fuzzy
-#| msgid "Not an IPC server"
-msgid "Cannot cancel LDAP"
-msgstr "Není serverem IPC"
+msgid "Invalid data in LCUP"
+msgstr "Neplatná data v LCUP"
 
 #: src/err-codes.h:408
-#, fuzzy
-#| msgid "Decryption failed"
-msgid "LDAP assertion failed"
-msgstr "Dešifrování selhalo"
+msgid "Unsupported scheme in LCUP"
+msgstr "Nepodporované schéma v LCUP"
 
 #: src/err-codes.h:409
-msgid "Proxied authorization denied by LDAP"
-msgstr ""
+msgid "Reload required in LCUP"
+msgstr "LCUP vyžaduje nové načtení"
 
 #: src/err-codes.h:410
+msgid "LDAP cancelled"
+msgstr "Operace LDAP zrušena"
+
+#: src/err-codes.h:411
+msgid "No LDAP operation to cancel"
+msgstr "Žádná operace LDAP ke zrušení"
+
+#: src/err-codes.h:412
+msgid "Too late to cancel LDAP"
+msgstr "Příliš pozdě na zrušení operace LDAP"
+
+#: src/err-codes.h:413
+msgid "Cannot cancel LDAP"
+msgstr "Operaci LDAP nelze zrušit"
+
+#: src/err-codes.h:414
+msgid "LDAP assertion failed"
+msgstr "Tvrzení LDAP selhalo"
+
+#: src/err-codes.h:415
+msgid "Proxied authorization denied by LDAP"
+msgstr "Delegovaná autorizace odmítnuta protokolem LDAP"
+
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "Uživatelem definovaný chybový kód 1"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "Uživatelem definovaný chybový kód 2"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "Uživatelem definovaný chybový kód 3"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "Uživatelem definovaný chybový kód 4"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "Uživatelem definovaný chybový kód 5"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "Uživatelem definovaný chybový kód 6"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "Uživatelem definovaný chybový kód 7"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "Uživatelem definovaný chybový kód 8"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "Uživatelem definovaný chybový kód 9"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "Uživatelem definovaný chybový kód 10"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "Uživatelem definovaný chybový kód 11"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "Uživatelem definovaný chybový kód 12"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "Uživatelem definovaný chybový kód 13"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "Uživatelem definovaný chybový kód 14"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "Uživatelem definovaný chybový kód 15"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "Uživatelem definovaný chybový kód 16"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+msgid "SQL success"
+msgstr "Úspěch SQL"
+
+#: src/err-codes.h:433
+msgid "SQL error"
+msgstr "Chyba SQL"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr "Vnitřní chyba v knihovně SQL"
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr "Přístupová práva zamítnuta (SQL)"
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr "Bylo vyžádání ukončení SQL"
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr "Soubor s databází SQL je zamknutý"
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr "Tabulka SQL v databázi je zamknuta"
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr "SQL knihovně došla paměť"
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr "Pokus zapsat do SQL databáze jen pro čtení"
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr "Operace SQL ukončena přerušením"
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr "Vstupně-výstupní chyba během operace SQL"
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr "Obraz disku databáze SQL je poškozený"
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr "Neznámý kód operace v řízení SQL souboru"
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr "Vložení do SQL databáze selhalo, protože je plná"
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr "Soubor SQL databáze nelze otevřít"
+
+#: src/err-codes.h:447
+msgid "SQL database lock protocol error"
+msgstr "Chyba v zamykacím protokolu SQL databáze"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr "(vnitřní kód SQL: prázdný)"
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr "Schéma SQL databáze se změnilo"
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr "Řetězec nebo binární objekt překračuje hraniční velikost (SQL)"
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr "SQL ukončeně kvůli narušení omezení"
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr "Datový typ se neshoduje (SQL)"
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr "SQL knihovna byla použita nesprávně"
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr "SQL knihovna používá nepodporované vlastnosti OS"
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr "Autorizace zamítnuta (SQL)"
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr "(nepoužitý kód SQL: formát)"
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr "Vázaný parametr SQL je mimo rozsah"
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr "Otevřený soubor není SQL databází"
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr "Upozornění od protokolování SQL"
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr "Varování od protokolování SQL"
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr "SQL již obsahuje jiný řádek"
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr "SQL dokončilo vykonávání"
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "Chyba systému bez čísla chyby (errno)"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Neznámá chyba systému"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Konec souboru"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Neznámý kód chyby"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+msgid "argument not expected"
+msgstr "argument neočekáván"
+
+#: src/argparse.c:496
+msgid "read error"
+msgstr "chyba čtení"
+
+#: src/argparse.c:498
+msgid "keyword too long"
+msgstr "klíčové slovo je příliš dlouhé"
+
+#: src/argparse.c:500
+msgid "missing argument"
+msgstr "chybí argument"
+
+#: src/argparse.c:502
+msgid "invalid argument"
+msgstr "neplatný argument"
+
+#: src/argparse.c:504
+msgid "invalid command"
+msgstr "neplatný příkaz"
+
+#: src/argparse.c:506
+msgid "invalid alias definition"
+msgstr "neplatná definice aliasu"
+
+#: src/argparse.c:508 src/argparse.c:545
+msgid "permission error"
+msgstr "chyba oprávnění"
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr "nedostatek paměti"
+
+#: src/argparse.c:514 src/argparse.c:549
+msgid "invalid meta command"
+msgstr "neplatný metapříkaz"
+
+#: src/argparse.c:516 src/argparse.c:551
+msgid "unknown meta command"
+msgstr "neznámý metapříkaz"
+
+#: src/argparse.c:518 src/argparse.c:553
+msgid "unexpected meta command"
+msgstr "neočekávaný metapříkaz"
+
+# Options from a konfiguration file.
+#: src/argparse.c:520
+msgid "invalid option"
+msgstr "neplatný volba"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr "u volby „%.50s“ chybí argument\n"
+
+#: src/argparse.c:532
+#, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "neplatný argument u volby „%.50s“\n"
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr "volba „%.50s“ nepřijímá argument\n"
+
+#: src/argparse.c:537
+#, c-format
+msgid "invalid command \"%.50s\"\n"
+msgstr "neplatný příkaz „%.50s“\n"
+
+#: src/argparse.c:539
+#, c-format
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr "volba „%.50s“ není jednoznačná\n"
+
+#: src/argparse.c:541
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Použití: %s CHYBA_GPG […]\n"
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr "příkaz „%.50s“ není jednoznačný\n"
 
-#: src/gpg-error.c:633
+#: src/argparse.c:555
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: pozor: %s nebylo možné rozpoznat\n"
-
-#, fuzzy
-#~| msgid "Resources exhausted"
-#~ msgid "LCUP Resources exhausted"
-#~ msgstr "Zdroje vyčerpány"
-
-#, fuzzy
-#~| msgid "Invalid data"
-#~ msgid "LCUP Invalid data"
-#~ msgstr "Neplatná data"
-
-#, fuzzy
-#~| msgid "General error"
-#~ msgid "LDAP Other general error"
-#~ msgstr "Obecná chyba"
-
-#, fuzzy
-#~| msgid "dirmngr error"
-#~ msgid "Encoding error"
-#~ msgstr "chyba dirmngr"
+msgid "invalid option \"%.50s\"\n"
+msgstr "neplatná volba „%.50s“\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr "Poznámka: žádný výchozí soubor s volbami „%s“\n"
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr "volby se čtou z „%s“\n"
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr "soubor s volbami „%s“: %s\n"
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr "Poznámka: přepínač „--%s“ se ignoruje kvůli globální konfiguraci\n"
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr "Chyby hlaste (anglicky) na <https://bugs.gnupg.org>.\n"
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "pozor: %s nebylo možné rozpoznat\n"
+
+#~ msgid "Keyring open"
+#~ msgstr "Klíčenka otevřena"
+
+#~ msgid "Usage: %s GPG-ERROR [...]\n"
+#~ msgstr "Použití: %s CHYBA_GPG […]\n"
index a302b84..6ecf850 100644 (file)
Binary files a/po/da.gmo and b/po/da.gmo differ
index ccdb67c..9aaa164 100644 (file)
--- a/po/da.po
+++ b/po/da.po
@@ -10,8 +10,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libgpg-error 1.10\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2014-11-17 20:08+0100\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:24+0100\n"
 "Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n"
 "Language-Team: Danish <debian-l10n-danish@lists.debian.org>\n"
 "Language: da\n"
@@ -85,30 +85,34 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
+msgid "TPM2d"
+msgstr "TPM2d"
+
+#: src/err-sources.h:45
 msgid "TLS"
 msgstr "TLS"
 
-#: src/err-sources.h:45
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "Enhver kilde"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "Brugerdefineret kilde 1"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "Brugerdefineret kilde 2"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "Brugerdefineret kilde 3"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "Brugerdefineret kilde 4"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Ukendt kilde"
 
@@ -1307,580 +1311,867 @@ msgid "Wrong name"
 msgstr "Ukendt navn"
 
 #: src/err-codes.h:320
+#, fuzzy
+#| msgid "Not enabled"
+msgid "Not authenticated"
+msgstr "Ikke aktiveret"
+
+#: src/err-codes.h:321
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Bad authentication"
+msgstr "Ej understøttet beskyttelse"
+
+#: src/err-codes.h:322
+#, fuzzy
+#| msgid "No agent running"
+msgid "No Keybox daemon running"
+msgstr "Ingen agent kører"
+
+#: src/err-codes.h:323
+#, fuzzy
+#| msgid "SmartCard daemon error"
+msgid "Keybox daemon error"
+msgstr "SmartCard-dæmonfejl"
+
+#: src/err-codes.h:324
+msgid "Service is not running"
+msgstr ""
+
+#: src/err-codes.h:325
+#, fuzzy
+#| msgid "Keyserver error"
+msgid "Service error"
+msgstr "Nøgleserverfejl"
+
+#: src/err-codes.h:326
 msgid "System bug detected"
 msgstr ""
 
-#: src/err-codes.h:321
+#: src/err-codes.h:327
 #, fuzzy
 #| msgid "Unknown system error"
 msgid "Unknown DNS error"
 msgstr "Ukendt systemfejl"
 
-#: src/err-codes.h:322
+#: src/err-codes.h:328
 #, fuzzy
 #| msgid "Invalid OID string"
 msgid "Invalid DNS section"
 msgstr "Ugyldig OID-streng"
 
-#: src/err-codes.h:323
+#: src/err-codes.h:329
 #, fuzzy
 #| msgid "Invalid S-expression"
 msgid "Invalid textual address form"
 msgstr "Ugyldigt S-udtryk"
 
-#: src/err-codes.h:324
+#: src/err-codes.h:330
 #, fuzzy
 #| msgid "Missing issuer certificate"
 msgid "Missing DNS query packet"
 msgstr "Manglende udstedercertfikat"
 
-#: src/err-codes.h:325
+#: src/err-codes.h:331
 msgid "Missing DNS answer packet"
 msgstr ""
 
-#: src/err-codes.h:326
+#: src/err-codes.h:332
 msgid "Connection closed in DNS"
 msgstr ""
 
-#: src/err-codes.h:327
+#: src/err-codes.h:333
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "Verification failed in DNS"
 msgstr "Afkryptering mislykkedes"
 
-#: src/err-codes.h:328
+#: src/err-codes.h:334
 #, fuzzy
 #| msgid "Timeout"
 msgid "DNS Timeout"
 msgstr "Tidsudløb"
 
-#: src/err-codes.h:329
+#: src/err-codes.h:335
 #, fuzzy
 #| msgid "General IPC error"
 msgid "General LDAP error"
 msgstr "Generel IPC-fejl"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP attribute error"
 msgstr "Generel fejl"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP name error"
 msgstr "Generel fejl"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP security error"
 msgstr "Generel Assuanfejl"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP service error"
 msgstr "Generel fejl"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP update error"
 msgstr "Generel Assuanfejl"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr ""
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 #, fuzzy
 #| msgid "IPC write error"
 msgid "Private LDAP error code"
 msgstr "IPC-skrivefejl"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other general LDAP error"
 msgstr "Generel IPC-fejl"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 #, fuzzy
 #| msgid "IPC connect call failed"
 msgid "LDAP connecting failed (X)"
 msgstr "IPC-forbindelseskald mislykkedes"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral limit exceeded"
 msgstr "Generel fejl"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr ""
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 #, fuzzy
 #| msgid "Card reset required"
 msgid "No LDAP results returned"
 msgstr "Kortnulstilling krævet"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 #, fuzzy
 #| msgid "Element not found"
 msgid "LDAP control not found"
 msgstr "Element er ikke fundet"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 #, fuzzy
 #| msgid "Not supported"
 msgid "Not supported by LDAP"
 msgstr "Ikke understøttet"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 #, fuzzy
 #| msgid "Unexpected error"
 msgid "LDAP connect error"
 msgstr "Uventet fejl"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr ""
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr ""
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 #, fuzzy
 #| msgid "Unsupported operation"
 msgid "User cancelled LDAP operation"
 msgstr "Ej understøttet handling"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 #, fuzzy
 #| msgid "Bad certificate"
 msgid "Bad LDAP search filter"
 msgstr "Ødelagt certifikat"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "Unknown LDAP authentication method"
 msgstr "Ukendt udvidelse"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 #, fuzzy
 #| msgid "Timeout"
 msgid "Timeout in LDAP"
 msgstr "Tidsudløb"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP decoding error"
 msgstr "dirmngr-fejl"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP encoding error"
 msgstr "dirmngr-fejl"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 #, fuzzy
 #| msgid "IPC read error"
 msgid "LDAP local error"
 msgstr "IPC-læsefejl"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot contact LDAP server"
 msgstr "Ikke en IPC-server"
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP success"
 msgstr "Lykkedes"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 #, fuzzy
 #| msgid "Configuration error"
 msgid "LDAP operations error"
 msgstr "Konfigurationsfejl"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP protocol error"
 msgstr "Protokolovertrædelse"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr ""
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr ""
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "LDAP authentication method not supported"
 msgstr "Ukendt udvidelse"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
 msgstr ""
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 #, fuzzy
 #| msgid "Fatal alert message received"
 msgid "Partial LDAP results+referral received"
 msgstr "Modtog »fatal alarm«-besked"
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral"
 msgstr "Generel fejl"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr ""
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr ""
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Confidentiality required by LDAP"
 msgstr "Kortnulstilling krævet"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr ""
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr ""
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 #, fuzzy
 #| msgid "Invalid attribute"
 msgid "Undefined LDAP attribute type"
 msgstr "Ugyldig attribut"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate matching in LDAP"
 msgstr "Ej understøttet beskyttelse"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Constraint violation in LDAP"
 msgstr "Protokolovertrædelse"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr ""
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid syntax in LDAP"
 msgstr "Ugyldig tilstand"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 #, fuzzy
 #| msgid "No CMS object"
 msgid "No such LDAP object"
 msgstr "Intet CMS-objekt"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 #, fuzzy
 #| msgid "Hardware problem"
 msgid "LDAP alias problem"
 msgstr "Maskinelt problem"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid DN syntax in LDAP"
 msgstr "Ugyldig tilstand"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr ""
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 #, fuzzy
 #| msgid "Encoding problem"
 msgid "LDAP alias dereferencing problem"
 msgstr "Kodningsproblem"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr ""
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate LDAP authentication"
 msgstr "Ej understøttet beskyttelse"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 #, fuzzy
 #| msgid "Invalid card"
 msgid "Invalid LDAP credentials"
 msgstr "Ugyldigt kort"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr ""
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr ""
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 #, fuzzy
 #| msgid "No keyserver available"
 msgid "LDAP server is unavailable"
 msgstr "Ingen nøgleserver tilgængelig"
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr ""
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr ""
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 #, fuzzy
 #| msgid "Missing action"
 msgid "LDAP naming violation"
 msgstr "Manglende handling"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP object class violation"
 msgstr "Protokolovertrædelse"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 #, fuzzy
 #| msgid "Operation not yet finished"
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "Handling ikke færdig endnu"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation not allowed on RDN"
 msgstr "Handling afbrudt"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr ""
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr ""
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 #, fuzzy
 #| msgid "Line too long"
 msgid "LDAP results too large"
 msgstr "Linje er for lang"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation affects multiple DSAs"
 msgstr "Handling afbrudt"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr ""
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other LDAP error"
 msgstr "Generel IPC-fejl"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 #, fuzzy
 #| msgid "Resources exhausted"
 msgid "Resources exhausted in LCUP"
 msgstr "Ressourcer opbrugt"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Security violation in LCUP"
 msgstr "Protokolovertrædelse"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid data in LCUP"
 msgstr "Ugyldig tilstand"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 #, fuzzy
 #| msgid "Unsupported certificate"
 msgid "Unsupported scheme in LCUP"
 msgstr "Ej understøttet certifikat"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Reload required in LCUP"
 msgstr "Kortnulstilling krævet"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP cancelled"
 msgstr "Lykkedes"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 #, fuzzy
 #| msgid "Not operational"
 msgid "No LDAP operation to cancel"
 msgstr "Ikke funktionsdygtig"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 #, fuzzy
 #| msgid "Not operational"
 msgid "Too late to cancel LDAP"
 msgstr "Ikke funktionsdygtig"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot cancel LDAP"
 msgstr "Ikke en IPC-server"
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "LDAP assertion failed"
 msgstr "Afkryptering mislykkedes"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr ""
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "Brugerdefineret fejlkode 1"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "Brugerdefineret fejlkode 2"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "Brugerdefineret fejlkode 3"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "Brugerdefineret fejlkode 4"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "Brugerdefineret fejlkode 5"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "Brugerdefineret fejlkode 6"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "Brugerdefineret fejlkode 7"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "Brugerdefineret fejlkode 8"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "Brugerdefineret fejlkode 9"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "Brugerdefineret fejlkode 10"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "Brugerdefineret fejlkode 11"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "Brugerdefineret fejlkode 12"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "Brugerdefineret fejlkode 13"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "Brugerdefineret fejlkode 14"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "Brugerdefineret fejlkode 15"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "Brugerdefineret fejlkode 16"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+#, fuzzy
+#| msgid "Success"
+msgid "SQL success"
+msgstr "Lykkedes"
+
+#: src/err-codes.h:433
+#, fuzzy
+#| msgid "Syntax error"
+msgid "SQL error"
+msgstr "Syntaksfejl"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr ""
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr ""
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr ""
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr ""
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr ""
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr ""
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr ""
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr ""
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr ""
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr ""
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr ""
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr ""
+
+#: src/err-codes.h:447
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "SQL database lock protocol error"
+msgstr "Protokolovertrædelse"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr ""
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr ""
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr ""
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr ""
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr ""
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr ""
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr ""
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr ""
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr ""
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr ""
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr ""
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr ""
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "Systemfejl w/o errno"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Ukendt systemfejl"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Slutning på fil"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Ukendt fejlkode"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+msgid "argument not expected"
+msgstr "parameter var ikke forventet"
+
+#: src/argparse.c:496
+msgid "read error"
+msgstr "læsefejl"
+
+#: src/argparse.c:498
+msgid "keyword too long"
+msgstr "nøgleord er for langt"
+
+#: src/argparse.c:500
+msgid "missing argument"
+msgstr "manglende parameter"
+
+#: src/argparse.c:502
+#, fuzzy
+#| msgid "invalid value\n"
+msgid "invalid argument"
+msgstr "ugyldig værdi\n"
+
+#: src/argparse.c:504
+msgid "invalid command"
+msgstr "ugyldig kommando"
+
+#: src/argparse.c:506
+msgid "invalid alias definition"
+msgstr "ugyldig aliasdefinition"
+
+#: src/argparse.c:508 src/argparse.c:545
+#, fuzzy
+#| msgid "Configuration error"
+msgid "permission error"
+msgstr "Konfigurationsfejl"
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr "ikke nok kerne"
+
+#: src/argparse.c:514 src/argparse.c:549
+#, fuzzy
+#| msgid "invalid command"
+msgid "invalid meta command"
+msgstr "ugyldig kommando"
+
+#: src/argparse.c:516 src/argparse.c:551
+#, fuzzy
+#| msgid "Unknown command"
+msgid "unknown meta command"
+msgstr "Ukendt kommando"
+
+#: src/argparse.c:518 src/argparse.c:553
+#, fuzzy
+#| msgid "Unexpected IPC command"
+msgid "unexpected meta command"
+msgstr "Uventet IPC-kommando"
+
+#: src/argparse.c:520
+msgid "invalid option"
+msgstr "ugyldig indstilling"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr "manglende parameter for indstilling »%.50s«\n"
+
+#: src/argparse.c:532
+#, fuzzy, c-format
+#| msgid "missing argument for option \"%.50s\"\n"
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "manglende parameter for indstilling »%.50s«\n"
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr "tilvalg »%.50s« forventer ikke et argument\n"
+
+#: src/argparse.c:537
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Brug: %s GPG-ERROR [...]\n"
+msgid "invalid command \"%.50s\"\n"
+msgstr "ugyldig kommando »%.50s«\n"
 
-#: src/gpg-error.c:633
+#: src/argparse.c:539
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: advarsel: kunne ikke genkende %s\n"
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr "tilvalg »%.50s« er tvetydigt\n"
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr "kommando »%.50s« er tvetydig\n"
+
+#: src/argparse.c:555
+#, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr "ugyldigt tilvalg »%.50s«\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr ""
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr ""
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "advarsel: kunne ikke genkende %s\n"
+
+#~ msgid "out of core\n"
+#~ msgstr "uden for kerne\n"
+
+#~ msgid "Usage: %s GPG-ERROR [...]\n"
+#~ msgstr "Brug: %s GPG-ERROR [...]\n"
 
 #, fuzzy
 #~| msgid "Resources exhausted"
index d044db2..81bbefa 100644 (file)
Binary files a/po/de.gmo and b/po/de.gmo differ
index bffe9b4..773e2f1 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libgpg-error-1.19\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2017-02-28 12:47+0100\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:25+0100\n"
 "Last-Translator: Werner Koch <wk@gnupg.org>\n"
 "Language-Team: none\n"
 "Language: de\n"
@@ -81,30 +81,34 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
+msgid "TPM2d"
+msgstr "TPM2d"
+
+#: src/err-sources.h:45
 msgid "TLS"
 msgstr "TLS"
 
-#: src/err-sources.h:45
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "Unspezifische Quelle"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "Benutzerdefinierte Quelle 1"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "Benutzerdefinierte Quelle 2"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "Benutzerdefinierte Quelle 3"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "Benutzerdefinierte Quelle 4"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Unbekannte Quelle"
 
@@ -390,7 +394,7 @@ msgstr "Nich implementiert"
 
 #: src/err-codes.h:98
 msgid "Conflicting use"
-msgstr "Zwiespältige Benutzung"
+msgstr "Widersprüchliche Benutzung"
 
 #: src/err-codes.h:99
 msgid "Invalid cipher mode"
@@ -889,7 +893,7 @@ msgstr "Fehlerhafter Crypto Context"
 
 #: src/err-codes.h:222
 msgid "Conflict in the crypto context"
-msgstr "Zwiespältige Benutzung des Crypto Context"
+msgstr "Widersprüchliche Benutzung des Crypto Context"
 
 #: src/err-codes.h:223
 msgid "Broken public key"
@@ -1283,457 +1287,719 @@ msgid "Wrong name"
 msgstr "Falscher Name"
 
 #: src/err-codes.h:320
+msgid "Not authenticated"
+msgstr "Nicht authentifiziert"
+
+#: src/err-codes.h:321
+msgid "Bad authentication"
+msgstr "Falsche Authentifizierung"
+
+#: src/err-codes.h:322
+msgid "No Keybox daemon running"
+msgstr "Keybox-Daemon läuft nicht"
+
+#: src/err-codes.h:323
+msgid "Keybox daemon error"
+msgstr "Fehler im Keybox-Daemon"
+
+#: src/err-codes.h:324
+msgid "Service is not running"
+msgstr "Service ist nicht aktiv"
+
+#: src/err-codes.h:325
+msgid "Service error"
+msgstr "Fehler im Service"
+
+#: src/err-codes.h:326
 msgid "System bug detected"
 msgstr "Fehler im System entdeckt"
 
-#: src/err-codes.h:321
+#: src/err-codes.h:327
 msgid "Unknown DNS error"
 msgstr "Unbekannter DNS Fehler"
 
-#: src/err-codes.h:322
+#: src/err-codes.h:328
 msgid "Invalid DNS section"
 msgstr "Ungültige DNS \"Section\""
 
-#: src/err-codes.h:323
+#: src/err-codes.h:329
 msgid "Invalid textual address form"
 msgstr "Ungültige Textadressenformat"
 
 # "in der Kette" ist part of the message because many users know about
 # certificate chains and thus that keyword might give them a good hint
 # what might be wrong.
-#: src/err-codes.h:324
+#: src/err-codes.h:330
 msgid "Missing DNS query packet"
 msgstr "Fehlendes DNS Anfragepaket"
 
-#: src/err-codes.h:325
+#: src/err-codes.h:331
 msgid "Missing DNS answer packet"
 msgstr "Fehlendes DNS Antwortpaket"
 
-#: src/err-codes.h:326
+#: src/err-codes.h:332
 msgid "Connection closed in DNS"
 msgstr "Verbindung im DNS geschlossen"
 
-#: src/err-codes.h:327
+#: src/err-codes.h:333
 msgid "Verification failed in DNS"
 msgstr "Prüfung im DNS fehlgeschlagen"
 
-#: src/err-codes.h:328
+#: src/err-codes.h:334
 msgid "DNS Timeout"
 msgstr "DNS Zeitüberschreitung"
 
-#: src/err-codes.h:329
+#: src/err-codes.h:335
 msgid "General LDAP error"
 msgstr "Allgemeiner LDAP Fehler"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 msgid "General LDAP attribute error"
 msgstr "Allgemeiner LDAP Attributfehler"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 msgid "General LDAP name error"
 msgstr "Allgemeiner LDAP Namensfehler"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 msgid "General LDAP security error"
 msgstr "Allgemeiner LDAP Sicherheitsfehler"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 msgid "General LDAP service error"
 msgstr "Allgemeiner LDAP Servicefehler"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 msgid "General LDAP update error"
 msgstr "Allgemeiner LDAP \"Update\" Fehler"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr "Experimenteller LDAP Fehlercode"
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 msgid "Private LDAP error code"
 msgstr "Privater LDAP Fehlercode"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 msgid "Other general LDAP error"
 msgstr "Sonstiger allgemeiner LDAP Fehler"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 msgid "LDAP connecting failed (X)"
 msgstr "Fehler beim LDAP Verbindungsaufbau (X)"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 msgid "LDAP referral limit exceeded"
 msgstr "Grenze für LDAP Verweise überschritten"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr "Schleife im LDAP Client entdeckt"
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 msgid "No LDAP results returned"
 msgstr "Keine LDAP Ergebnisse"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 msgid "LDAP control not found"
 msgstr "LDAP \"Control\" nicht gefunden"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 msgid "Not supported by LDAP"
 msgstr "Von LDAP nicht unterstützt"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 msgid "LDAP connect error"
 msgstr "LDAP Verbindungsfehler"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr "Nicht genügend Speicher für LDAP Operation"
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr "Ungültiger Parameter an LDAP Funktion übergeben"
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 msgid "User cancelled LDAP operation"
 msgstr "LDAP Verarbeitung durch Benutzer abgebrochen"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 msgid "Bad LDAP search filter"
 msgstr "Fehlerhaftes LDAP Suchfilter"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 msgid "Unknown LDAP authentication method"
 msgstr "Unbekanntes LDAP Authentifizierungsverfahren"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 msgid "Timeout in LDAP"
 msgstr "Zeitüberschreitung (LDAP)"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 msgid "LDAP decoding error"
 msgstr "LDAP Dekodierungsfehler"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 msgid "LDAP encoding error"
 msgstr "LDAP Kodierungsfehler"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 msgid "LDAP local error"
 msgstr "Lokaler LDAP Fehler"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 msgid "Cannot contact LDAP server"
 msgstr "Verbindung zum LDAP Server nicht möglich"
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 msgid "LDAP success"
 msgstr "LDAP erfolgreich"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 msgid "LDAP operations error"
 msgstr "LDAP Konfigurationsfehler"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 msgid "LDAP protocol error"
 msgstr "LDAP Protokollverletzung"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr "Zeitgrenze von LDAP überschritten"
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr "Größengrenze von LDAP überschritten"
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr "LDAP Vergleich falsch"
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr "LDAP Vergleich richtig"
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 msgid "LDAP authentication method not supported"
 msgstr "LDAP Authentifizierungsverfahren nicht unterstützt"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
 msgstr "Starke LDAP Authentifizierung benötigt"
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 msgid "Partial LDAP results+referral received"
 msgstr "Partielle LDAP Ergebnisse und Verweise erhalten"
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 msgid "LDAP referral"
 msgstr "LDAP Verweise"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr "Administrative LDAP Grenze überschritten"
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr "Kritische LDAP Erweiterung nicht vorhanden"
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 msgid "Confidentiality required by LDAP"
 msgstr "Vertraulichkeit von LDAP angefordert"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr "LDAP SALS \"bind\" wird durchgeführt"
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr "Kein solches LDAP Attribut"
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 msgid "Undefined LDAP attribute type"
 msgstr "Ungültiger LDAP Attributtyp"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 msgid "Inappropriate matching in LDAP"
 msgstr "Unpassende Zusammenstellung in LDAP"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 msgid "Constraint violation in LDAP"
 msgstr "Bedingung nicht eingehalten in LDAP"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr "LDAP Typ oder Wert existiert"
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 msgid "Invalid syntax in LDAP"
 msgstr "Ungültiger Status in LDAP"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 msgid "No such LDAP object"
 msgstr "Kein solches LDAP Objekt"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 msgid "LDAP alias problem"
 msgstr "Problem mit LDAP Alias"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 msgid "Invalid DN syntax in LDAP"
 msgstr "Ungültiger DN Synatx in LDAP"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr "LDAP Element ist ein \"leaf\""
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 msgid "LDAP alias dereferencing problem"
 msgstr "Problem bei der Auflösung eines LDAP Aliases"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr "LDAP Proxy Authentifizierung fehlgeschlagen (X)"
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 msgid "Inappropriate LDAP authentication"
 msgstr "Unpassende LDAP Authentifizierung"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 msgid "Invalid LDAP credentials"
 msgstr "Ungültige LDAP Credentials"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr "Ungenügende Zugriffsrechte für LDAP"
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr "LDAP Server ist beschäftigt"
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 msgid "LDAP server is unavailable"
 msgstr "LDAP Server nicht verfügbar"
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr "LDAP Server weigert sich etwas durchzuführen"
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr "LDAP hat eine Schleife erkannt"
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 msgid "LDAP naming violation"
 msgstr "LDAP Benennungsverletzung"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 msgid "LDAP object class violation"
 msgstr "Verletzung der LDAP Objektklasse"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "LDAP Operation auf einem Nicht-\"Leaf\" ist nicht erlaubt"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 msgid "LDAP operation not allowed on RDN"
 msgstr "LDAP Operation nicht erlaubt auf einem RDN"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr "Existiert bereits (LDAP)"
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr "Die LDAP Objektklasse kann nicht geändert werden"
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 msgid "LDAP results too large"
 msgstr "LDAP Ergebnisse sind zu lang"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 msgid "LDAP operation affects multiple DSAs"
 msgstr "LDAP Operation betrifft mehrere DSAs"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr "Fehler in virtueller LDAP \"list view\""
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 msgid "Other LDAP error"
 msgstr "Sonstiger allgemeiner LDAP Fehler"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 msgid "Resources exhausted in LCUP"
 msgstr "Ressourcen erschöpft in LCUP"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 msgid "Security violation in LCUP"
 msgstr "Sicherheitsverletzung in LCUP"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 msgid "Invalid data in LCUP"
 msgstr "Ungültige Daten in LDAP"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 msgid "Unsupported scheme in LCUP"
 msgstr "Nicht unterstütztes Schema in LCUP"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 msgid "Reload required in LCUP"
 msgstr "\"Reload\" notwendig in LCUP"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 msgid "LDAP cancelled"
 msgstr "LDAP wurde abgebrochen"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 msgid "No LDAP operation to cancel"
 msgstr "Fehlende LDAP Operation zum abbrechen"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 msgid "Too late to cancel LDAP"
 msgstr "Zu spät um LDAP Operation abzubrechen"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 msgid "Cannot cancel LDAP"
 msgstr "LDAP Operation kann nicht abgebrochen werden"
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 msgid "LDAP assertion failed"
 msgstr "LDAP \"Assertion\" fehlgeschlagen"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr "LDAP Authentifizierung via Proxy wurde verweigert"
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "Benutzerdefinierter Fehlercode 1"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "Benutzerdefinierter Fehlercode 2"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "Benutzerdefinierter Fehlercode 3"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "Benutzerdefinierter Fehlercode 4"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "Benutzerdefinierter Fehlercode 5"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "Benutzerdefinierter Fehlercode 6"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "Benutzerdefinierter Fehlercode 7"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "Benutzerdefinierter Fehlercode 8"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "Benutzerdefinierter Fehlercode 9"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "Benutzerdefinierter Fehlercode 10"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "Benutzerdefinierter Fehlercode 11"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "Benutzerdefinierter Fehlercode 12"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "Benutzerdefinierter Fehlercode 13"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "Benutzerdefinierter Fehlercode 14"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "Benutzerdefinierter Fehlercode 15"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "Benutzerdefinierter Fehlercode 16"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+msgid "SQL success"
+msgstr "SQL erfolgreich"
+
+#: src/err-codes.h:433
+msgid "SQL error"
+msgstr "SQL Fehler"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr "Interner Logikfehler in der SQL Bibliothek"
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr "Zugriff verweigert (SQL)"
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr "SQL Abbruch wurde angefordert"
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr "SQL Datenbank ist gesperrt"
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr "Eine SQL Tabelle in der Datenbank ist gesperrt"
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr "SQL Bibliothek hat nicht mehr genügend Hauptspeicher"
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr "Versuch auf einen read-only SQL Datenbank zu schreiben"
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr "SQL Operation durch einen Interrupt beendet"
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr "I/O Fehler während einer SQL Operation"
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr "Dateiabbild der SQL Datenbank ist fehlerhaft"
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr "Unbekannter \"opcode\" in der SQL Dateisteuerung"
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr "Einfügen in SQL Datenbank fehlgeschlagen da die Platte voll ist"
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr "Die Datei der SQL Datenbank konnte nicht geöffnet werden"
+
+#: src/err-codes.h:447
+msgid "SQL database lock protocol error"
+msgstr "SQL Dateisperren Protokollverletzung"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr "(Interner SQL Code: leer)"
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr "SQL Datenbankschema hat sich geändert"
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr "String oder Blob ist zu gross (SQL)"
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr "SQL Abbruch wg. einer nicht eingehaltenen Zwangsbedingung"
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr "Datentyp stimmt nicht überein (SQL)"
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr "SQL Bibliothek wurde falsch verwendet"
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr "SQL Bibliothek benutzt vom OS nicht unterstützte Funktionen"
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr "Authentifizierung verweigert (SQL)"
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr "(unused SQL code: format)"
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr "SQL Bind-Parameter ausserhalb der Grenzwerte"
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr "Geöffnete Datei ist keine SQL Datenbank"
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr "Benachrichtigungen vom SQL Logger"
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr "Warnungen vom SQL Logger"
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr "SQL hält eine neue \"Row\" bereit"
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr "SQL Ausführung ist beendet"
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "Systemfehler ohne gesetzten Systemfehlercode"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Unbekannter Systemfehler"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Dateiende"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Unbekannter Fehlercode"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+msgid "argument not expected"
+msgstr "Argument nicht erwartet"
+
+#: src/argparse.c:496
+msgid "read error"
+msgstr "Lesefehler"
+
+#: src/argparse.c:498
+msgid "keyword too long"
+msgstr "Schlüsselwort ist zu lang"
+
+#: src/argparse.c:500
+msgid "missing argument"
+msgstr "Fehlendes Argument"
+
+#: src/argparse.c:502
+msgid "invalid argument"
+msgstr "Ungültiges Argument"
+
+#: src/argparse.c:504
+msgid "invalid command"
+msgstr "Ungültiger Befehl"
+
+#: src/argparse.c:506
+msgid "invalid alias definition"
+msgstr "Ungültige Alias-Definition"
+
+#: src/argparse.c:508 src/argparse.c:545
+msgid "permission error"
+msgstr "Zugriffsrechte nicht ausreichend"
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr "Nicht genügend Speicher"
+
+#: src/argparse.c:514 src/argparse.c:549
+msgid "invalid meta command"
+msgstr "Ungültige Meta-Anweisung"
+
+#: src/argparse.c:516 src/argparse.c:551
+msgid "unknown meta command"
+msgstr "Unbekannte Meta-Anweisung"
+
+#: src/argparse.c:518 src/argparse.c:553
+msgid "unexpected meta command"
+msgstr "Unerwartete Meta-Anweisung"
+
+#: src/argparse.c:520
+msgid "invalid option"
+msgstr "Ungültige Option"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr "Fehlendes Argument für Option \"%.50s\"\n"
+
+#: src/argparse.c:532
+#, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "Ungültiges Argument für Option \"%.50s\"\n"
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr "Option \"%.50s\" erwartet kein Argument\n"
+
+#: src/argparse.c:537
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Aufruf: %s GPG-FEHLER [...]\n"
+msgid "invalid command \"%.50s\"\n"
+msgstr "Ungültiger Befehl \"%.50s\"\n"
 
-#: src/gpg-error.c:633
+#: src/argparse.c:539
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: Warnung: %s konnte nicht erkannt werden\n"
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr "Option \"%.50s\" ist mehrdeutig\n"
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr "Befehl \"%.50s\" ist mehrdeutig\n"
+
+#: src/argparse.c:555
+#, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr "Ungültige Option \"%.50s\"\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr "Hinweis: Keine voreingestellte Optionendatei '%s' vorhanden\n"
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr "Optionen werden aus '%s' gelesen\n"
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr "Optionendatei '%s': %s\n"
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+"Hinweis: Option \"--%s\" aufgrund der globalen Konfiguration ignoriert\n"
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr ""
+"Berichte über Programmfehler bitte in englisch an <https://bugs.gnupg.org>.\n"
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "Warnung: %s konnte nicht erkannt werden\n"
+
+#~ msgid "out of core\n"
+#~ msgstr "Nicht genügend Speicher\n"
+
+#~ msgid "Usage: %s GPG-ERROR [...]\n"
+#~ msgstr "Aufruf: %s GPG-FEHLER [...]\n"
 
 #~ msgid "LCUP Resources exhausted"
 #~ msgstr "LCUP Ressourcen erschöpft"
index 1099c7b..5eb1671 100644 (file)
Binary files a/po/eo.gmo and b/po/eo.gmo differ
index 4e7bff3..12a0110 100644 (file)
--- a/po/eo.po
+++ b/po/eo.po
@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libgpg-error 1.7\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2013-02-23 20:22+0100\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:25+0100\n"
 "Last-Translator: Felipe Castro <fefcas@gmail.com>\n"
 "Language-Team: Esperanto <translation-team-eo@lists.sourceforge.net>\n"
 "Language: eo\n"
@@ -81,30 +81,34 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
-msgid "TLS"
-msgstr ""
+msgid "TPM2d"
+msgstr "TPM2d"
 
 #: src/err-sources.h:45
+msgid "TLS"
+msgstr "TLS"
+
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "Iu ajn fonto"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "Uzant-difinita fonto 1"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "Uzant-difinita fonto 2"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "Uzant-difinita fonto 3"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "Uzant-difinita fonto 4"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Nekonata fonto"
 
@@ -1365,576 +1369,870 @@ msgid "Wrong name"
 msgstr "Nekonata nomo"
 
 #: src/err-codes.h:320
+#, fuzzy
+#| msgid "Not locked"
+msgid "Not authenticated"
+msgstr "Ne ŝlosita"
+
+#: src/err-codes.h:321
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Bad authentication"
+msgstr "Nesubtenata protekto"
+
+#: src/err-codes.h:322
+#, fuzzy
+#| msgid "No agent running"
+msgid "No Keybox daemon running"
+msgstr "Neniu agento rulas"
+
+#: src/err-codes.h:323
+#, fuzzy
+#| msgid "SmartCard daemon error"
+msgid "Keybox daemon error"
+msgstr "Eraro de la demono SmartCard"
+
+#: src/err-codes.h:324
+msgid "Service is not running"
+msgstr ""
+
+#: src/err-codes.h:325
+#, fuzzy
+#| msgid "Keyserver error"
+msgid "Service error"
+msgstr "Ŝlosilservila eraro"
+
+#: src/err-codes.h:326
 msgid "System bug detected"
 msgstr ""
 
-#: src/err-codes.h:321
+#: src/err-codes.h:327
 #, fuzzy
 #| msgid "Unknown system error"
 msgid "Unknown DNS error"
 msgstr "Nekonata sistem-eraro"
 
-#: src/err-codes.h:322
+#: src/err-codes.h:328
 #, fuzzy
 #| msgid "Invalid OID string"
 msgid "Invalid DNS section"
 msgstr "Malvalida ĉeno OID"
 
-#: src/err-codes.h:323
+#: src/err-codes.h:329
 #, fuzzy
 #| msgid "Invalid S-expression"
 msgid "Invalid textual address form"
 msgstr "Malvalida S-esprimo"
 
-#: src/err-codes.h:324
+#: src/err-codes.h:330
 #, fuzzy
 #| msgid "Missing certificate"
 msgid "Missing DNS query packet"
 msgstr "Mankas atestilo"
 
-#: src/err-codes.h:325
+#: src/err-codes.h:331
 msgid "Missing DNS answer packet"
 msgstr ""
 
-#: src/err-codes.h:326
+#: src/err-codes.h:332
 msgid "Connection closed in DNS"
 msgstr ""
 
-#: src/err-codes.h:327
+#: src/err-codes.h:333
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "Verification failed in DNS"
 msgstr "Malĉifro fiaskis"
 
-#: src/err-codes.h:328
+#: src/err-codes.h:334
 #, fuzzy
 #| msgid "Timeout"
 msgid "DNS Timeout"
 msgstr "Tempofino"
 
-#: src/err-codes.h:329
+#: src/err-codes.h:335
 #, fuzzy
 #| msgid "General IPC error"
 msgid "General LDAP error"
 msgstr "Ĝenerala eraro de IPC"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP attribute error"
 msgstr "Ĝenerala eraro"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP name error"
 msgstr "Ĝenerala eraro"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP security error"
 msgstr "Ĝenerala eraro de Assuan"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP service error"
 msgstr "Ĝenerala eraro"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP update error"
 msgstr "Ĝenerala eraro de Assuan"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr ""
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 #, fuzzy
 #| msgid "IPC write error"
 msgid "Private LDAP error code"
 msgstr "Skrib-eraro de IPC"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other general LDAP error"
 msgstr "Ĝenerala eraro de IPC"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 #, fuzzy
 #| msgid "IPC connect call failed"
 msgid "LDAP connecting failed (X)"
 msgstr "Konekta voko de IPC fiaskis"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral limit exceeded"
 msgstr "Ĝenerala eraro"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr ""
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 #, fuzzy
 #| msgid "Card reset required"
 msgid "No LDAP results returned"
 msgstr "Kart-reekigo estas postulata"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 #, fuzzy
 #| msgid "Element not found"
 msgid "LDAP control not found"
 msgstr "Elemento ne estas trovita"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 #, fuzzy
 #| msgid "Not supported"
 msgid "Not supported by LDAP"
 msgstr "Ne subtenata"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 #, fuzzy
 #| msgid "Unexpected error"
 msgid "LDAP connect error"
 msgstr "Neatendita eraro"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr ""
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr ""
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 #, fuzzy
 #| msgid "Unsupported operation"
 msgid "User cancelled LDAP operation"
 msgstr "Nesubtenata operacio"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 #, fuzzy
 #| msgid "Bad certificate"
 msgid "Bad LDAP search filter"
 msgstr "Malĝusta atestilo"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "Unknown LDAP authentication method"
 msgstr "Nekonata aldono"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 #, fuzzy
 #| msgid "Timeout"
 msgid "Timeout in LDAP"
 msgstr "Tempofino"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP decoding error"
 msgstr "eraro de dirmngr"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP encoding error"
 msgstr "eraro de dirmngr"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 #, fuzzy
 #| msgid "IPC read error"
 msgid "LDAP local error"
 msgstr "Leg-eraro de IPC"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot contact LDAP server"
 msgstr "Ne estas servilo IPC"
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP success"
 msgstr "Sukceso"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 #, fuzzy
 #| msgid "Configuration error"
 msgid "LDAP operations error"
 msgstr "Agord-eraro"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP protocol error"
 msgstr "Perforto de protokolo"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr ""
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr ""
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "LDAP authentication method not supported"
 msgstr "Nekonata aldono"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
 msgstr ""
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 msgid "Partial LDAP results+referral received"
 msgstr ""
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral"
 msgstr "Ĝenerala eraro"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr ""
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr ""
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Confidentiality required by LDAP"
 msgstr "Kart-reekigo estas postulata"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr ""
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr ""
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 #, fuzzy
 #| msgid "Invalid attribute"
 msgid "Undefined LDAP attribute type"
 msgstr "Malvalida atributo"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate matching in LDAP"
 msgstr "Nesubtenata protekto"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Constraint violation in LDAP"
 msgstr "Perforto de protokolo"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr ""
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid syntax in LDAP"
 msgstr "Malvalida stato"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 #, fuzzy
 #| msgid "No CMS object"
 msgid "No such LDAP object"
 msgstr "Neniu objekto CMS"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 #, fuzzy
 #| msgid "Hardware problem"
 msgid "LDAP alias problem"
 msgstr "Problemo de aparataro"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid DN syntax in LDAP"
 msgstr "Malvalida stato"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr ""
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 #, fuzzy
 #| msgid "Encoding problem"
 msgid "LDAP alias dereferencing problem"
 msgstr "Ekodiga problemo"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr ""
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate LDAP authentication"
 msgstr "Nesubtenata protekto"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 #, fuzzy
 #| msgid "Invalid card"
 msgid "Invalid LDAP credentials"
 msgstr "Malvalida karto"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr ""
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr ""
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 msgid "LDAP server is unavailable"
 msgstr ""
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr ""
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr ""
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 #, fuzzy
 #| msgid "Missing action"
 msgid "LDAP naming violation"
 msgstr "Mankas ago"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP object class violation"
 msgstr "Perforto de protokolo"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 #, fuzzy
 #| msgid "Operation not yet finished"
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "La operacio ankoraŭ ne finiĝis"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation not allowed on RDN"
 msgstr "Operacio estas nuligita"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr ""
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr ""
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 #, fuzzy
 #| msgid "Line too long"
 msgid "LDAP results too large"
 msgstr "Linio tro longas"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation affects multiple DSAs"
 msgstr "Operacio estas nuligita"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr ""
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other LDAP error"
 msgstr "Ĝenerala eraro de IPC"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 #, fuzzy
 #| msgid "Resources exhausted"
 msgid "Resources exhausted in LCUP"
 msgstr "Rimedoj estas plenuzitaj"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Security violation in LCUP"
 msgstr "Perforto de protokolo"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid data in LCUP"
 msgstr "Malvalida stato"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 #, fuzzy
 #| msgid "Unsupported certificate"
 msgid "Unsupported scheme in LCUP"
 msgstr "Nesubtenata atestilo"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Reload required in LCUP"
 msgstr "Kart-reekigo estas postulata"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP cancelled"
 msgstr "Sukceso"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 #, fuzzy
 #| msgid "Not operational"
 msgid "No LDAP operation to cancel"
 msgstr "Ne operaciebla"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 #, fuzzy
 #| msgid "Not operational"
 msgid "Too late to cancel LDAP"
 msgstr "Ne operaciebla"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot cancel LDAP"
 msgstr "Ne estas servilo IPC"
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "LDAP assertion failed"
 msgstr "Malĉifro fiaskis"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr ""
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "Uzant-difinita erarkodo 1"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "Uzant-difinita erarkodo 2"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "Uzant-difinita erarkodo 3"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "Uzant-difinita erarkodo 4"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "Uzant-difinita erarkodo 5"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "Uzant-difinita erarkodo 6"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "Uzant-difinita erarkodo 7"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "Uzant-difinita erarkodo 8"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "Uzant-difinita erarkodo 9"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "Uzant-difinita erarkodo 10"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "Uzant-difinita erarkodo 11"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "Uzant-difinita erarkodo 12"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "Uzant-difinita erarkodo 13"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "Uzant-difinita erarkodo 14"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "Uzant-difinita erarkodo 15"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "Uzant-difinita erarkodo 16"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+#, fuzzy
+#| msgid "Success"
+msgid "SQL success"
+msgstr "Sukceso"
+
+#: src/err-codes.h:433
+#, fuzzy
+#| msgid "Syntax error"
+msgid "SQL error"
+msgstr "Sintaks-eraro"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr ""
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr ""
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr ""
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr ""
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr ""
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr ""
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr ""
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr ""
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr ""
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr ""
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr ""
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr ""
+
+#: src/err-codes.h:447
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "SQL database lock protocol error"
+msgstr "Perforto de protokolo"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr ""
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr ""
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr ""
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr ""
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr ""
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr ""
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr ""
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr ""
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr ""
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr ""
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr ""
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr ""
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "Sistem-eraro sen errno"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Nekonata sistem-eraro"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Fino de dosiero"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Nekonata erar-kodo"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+#, fuzzy
+msgid "argument not expected"
+msgstr "skribas sekretan ŝlosilon al '%s'\n"
+
+#: src/argparse.c:496
+#, fuzzy
+msgid "read error"
+msgstr "legeraro ĉe dosiero"
+
+#: src/argparse.c:498
+#, fuzzy
+msgid "keyword too long"
+msgstr "pasfrazo estas tro longa\n"
+
+#: src/argparse.c:500
+#, fuzzy
+msgid "missing argument"
+msgstr "nevalida argumento"
+
+#: src/argparse.c:502
+#, fuzzy
+#| msgid "invalid armor"
+msgid "invalid argument"
+msgstr "nevalida kiraso"
+
+#: src/argparse.c:504
+#, fuzzy
+msgid "invalid command"
+msgstr "malkongruaj komandoj\n"
+
+#: src/argparse.c:506
+#, fuzzy
+msgid "invalid alias definition"
+msgstr "nevalida kiraso"
+
+#: src/argparse.c:508 src/argparse.c:545
+#, fuzzy
+#| msgid "Configuration error"
+msgid "permission error"
+msgstr "Agord-eraro"
+
+#: src/argparse.c:510 src/argparse.c:543
+#, fuzzy
+msgid "out of core"
+msgstr "ne traktita"
+
+#: src/argparse.c:514 src/argparse.c:549
+#, fuzzy
+msgid "invalid meta command"
+msgstr "malkongruaj komandoj\n"
+
+#: src/argparse.c:516 src/argparse.c:551
+#, fuzzy
+#| msgid "Unknown command"
+msgid "unknown meta command"
+msgstr "Nekonata komando"
+
+#: src/argparse.c:518 src/argparse.c:553
+#, fuzzy
+#| msgid "Unexpected IPC command"
+msgid "unexpected meta command"
+msgstr "Neatendita komando IPC"
+
+#: src/argparse.c:520
+#, fuzzy
+msgid "invalid option"
+msgstr "nevalida kiraso"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:532
+#, fuzzy, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "nevalida kiraso"
+
+#: src/argparse.c:534
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Uzmaniero: %s GPG-ERARO [...]\n"
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr ""
+
+#: src/argparse.c:537
+#, fuzzy, c-format
+msgid "invalid command \"%.50s\"\n"
+msgstr "Nevalida komando (provu per \"helpo\")\n"
 
-#: src/gpg-error.c:633
+#: src/argparse.c:539
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: averto: ne eblis rekoni %s\n"
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:555
+#, fuzzy, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr "nevalida kiraso"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr ""
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr ""
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "averto: ne eblis rekoni %s\n"
+
+#, fuzzy
+#~ msgid "out of core\n"
+#~ msgstr "ne traktita"
+
+#~ msgid "Usage: %s GPG-ERROR [...]\n"
+#~ msgstr "Uzmaniero: %s GPG-ERARO [...]\n"
 
 #, fuzzy
 #~| msgid "Resources exhausted"
diff --git a/po/es.gmo b/po/es.gmo
new file mode 100644 (file)
index 0000000..3909cc5
Binary files /dev/null and b/po/es.gmo differ
diff --git a/po/es.po b/po/es.po
new file mode 100644 (file)
index 0000000..9e871f8
--- /dev/null
+++ b/po/es.po
@@ -0,0 +1,2017 @@
+#
+# Copyright (C) 2018 g10 Code GmbH
+# This file is distributed under the same license as the libgpg-error package.
+# emma peel <emma.peel@riseup.net>, 2018
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error 1.30-beta4\n"
+"Report-Msgid-Bugs-To: translations@gnupg.org\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:25+0100\n"
+"Last-Translator: Tails translators <amnesia@boum.org>\n"
+"Language-Team: es <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.8.11\n"
+
+#: src/err-sources.h:28
+msgid "Unspecified source"
+msgstr "Fuente no especificada"
+
+#: src/err-sources.h:29
+msgid "gcrypt"
+msgstr "gcrypt"
+
+#: src/err-sources.h:30
+msgid "GnuPG"
+msgstr "GnuPG"
+
+#: src/err-sources.h:31
+msgid "GpgSM"
+msgstr "GpgSM"
+
+#: src/err-sources.h:32
+msgid "GPG Agent"
+msgstr "GPG Agent"
+
+#: src/err-sources.h:33
+msgid "Pinentry"
+msgstr "Pinentry"
+
+#: src/err-sources.h:34
+msgid "SCD"
+msgstr "SCD"
+
+#: src/err-sources.h:35
+msgid "GPGME"
+msgstr "GPGME"
+
+#: src/err-sources.h:36
+msgid "Keybox"
+msgstr "Keybox"
+
+#: src/err-sources.h:37
+msgid "KSBA"
+msgstr "KSBA"
+
+#: src/err-sources.h:38
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+#: src/err-sources.h:39
+msgid "GSTI"
+msgstr "GSTI"
+
+#: src/err-sources.h:40
+msgid "GPA"
+msgstr "GPA"
+
+#: src/err-sources.h:41
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+#: src/err-sources.h:42
+msgid "G13"
+msgstr "G13"
+
+#: src/err-sources.h:43
+msgid "Assuan"
+msgstr "Assuan"
+
+#: src/err-sources.h:44
+msgid "TPM2d"
+msgstr "TPM2d"
+
+#: src/err-sources.h:45
+msgid "TLS"
+msgstr "TLS"
+
+#: src/err-sources.h:46
+msgid "Any source"
+msgstr "Cualquier origen"
+
+#: src/err-sources.h:47
+msgid "User defined source 1"
+msgstr "Origen determinado por el usuario 1"
+
+#: src/err-sources.h:48
+msgid "User defined source 2"
+msgstr "Origen determinado por el usuario 2"
+
+#: src/err-sources.h:49
+msgid "User defined source 3"
+msgstr "Origen determinado por el usuario 3"
+
+#: src/err-sources.h:50
+msgid "User defined source 4"
+msgstr "Origen determinado por el usuario 4"
+
+#: src/err-sources.h:51
+msgid "Unknown source"
+msgstr "Origen desconocido"
+
+#: src/err-codes.h:28
+msgid "Success"
+msgstr "Éxito"
+
+#: src/err-codes.h:29
+msgid "General error"
+msgstr "Error general"
+
+#: src/err-codes.h:30
+msgid "Unknown packet"
+msgstr "Paquete desconocido"
+
+#: src/err-codes.h:31
+msgid "Unknown version in packet"
+msgstr "Versión desconocida en el paquete"
+
+#: src/err-codes.h:32
+msgid "Invalid public key algorithm"
+msgstr "Algoritmo de clave pública no válido"
+
+#: src/err-codes.h:33
+msgid "Invalid digest algorithm"
+msgstr "Algoritmo de resumen seleccionado no válido"
+
+#: src/err-codes.h:34
+msgid "Bad public key"
+msgstr "Clave pública incorrecta"
+
+#: src/err-codes.h:35
+msgid "Bad secret key"
+msgstr "Clave secreta incorrecta"
+
+#: src/err-codes.h:36
+msgid "Bad signature"
+msgstr "Firma incorrecta"
+
+#: src/err-codes.h:37
+msgid "No public key"
+msgstr "No hay clave pública"
+
+#: src/err-codes.h:38
+msgid "Checksum error"
+msgstr "Error de checksum"
+
+#: src/err-codes.h:39
+msgid "Bad passphrase"
+msgstr "Frase contraseña errónea"
+
+#: src/err-codes.h:40
+msgid "Invalid cipher algorithm"
+msgstr "El algoritmo de cifrado seleccionado no es correcto"
+
+#: src/err-codes.h:41
+msgid "Cannot open keyring"
+msgstr "No se puede abrir el anillo de claves"
+
+#: src/err-codes.h:42
+msgid "Invalid packet"
+msgstr "Paquete incorrecto"
+
+#: src/err-codes.h:43
+msgid "Invalid armor"
+msgstr "Armadura incorrecta"
+
+#: src/err-codes.h:44
+msgid "No user ID"
+msgstr "No hay identificador de usuario"
+
+#: src/err-codes.h:45
+msgid "No secret key"
+msgstr "No tenemos la clave secreta"
+
+#: src/err-codes.h:46
+msgid "Wrong secret key used"
+msgstr "Clave secreta"
+
+#: src/err-codes.h:47
+msgid "Bad session key"
+msgstr "Clave incorrecta de sesión"
+
+#: src/err-codes.h:48
+msgid "Unknown compression algorithm"
+msgstr "Algoritmo de compresión desconocido"
+
+#: src/err-codes.h:49
+msgid "Number is not prime"
+msgstr "El número no es primo"
+
+#: src/err-codes.h:50
+msgid "Invalid encoding method"
+msgstr "Método de codificación incorrecto"
+
+#: src/err-codes.h:51
+msgid "Invalid encryption scheme"
+msgstr "Esquema de cifrado incorrecto"
+
+#: src/err-codes.h:52
+msgid "Invalid signature scheme"
+msgstr "Esquema de firmado incorrecto"
+
+#: src/err-codes.h:53
+msgid "Invalid attribute"
+msgstr "Atributo incorrecto"
+
+#: src/err-codes.h:54
+msgid "No value"
+msgstr "No hay valor"
+
+#: src/err-codes.h:55
+msgid "Not found"
+msgstr "No hallado"
+
+#: src/err-codes.h:56
+msgid "Value not found"
+msgstr "Valor no encontrado"
+
+#: src/err-codes.h:57
+msgid "Syntax error"
+msgstr "Error de sintaxis"
+
+#: src/err-codes.h:58
+msgid "Bad MPI value"
+msgstr "Valor MPI incorrecto"
+
+#: src/err-codes.h:59
+msgid "Invalid passphrase"
+msgstr "Frase contraseña errónea"
+
+#: src/err-codes.h:60
+msgid "Invalid signature class"
+msgstr "Clase de firma incorrecta"
+
+#: src/err-codes.h:61
+msgid "Resources exhausted"
+msgstr "Recursos agotados"
+
+#: src/err-codes.h:62
+msgid "Invalid keyring"
+msgstr "Anillo de claves incorrecto"
+
+#: src/err-codes.h:63
+msgid "Trust DB error"
+msgstr "Error de la base de datos de confianza"
+
+#: src/err-codes.h:64
+msgid "Bad certificate"
+msgstr "Certficado incorrecto"
+
+#: src/err-codes.h:65
+msgid "Invalid user ID"
+msgstr "Identificador de usuario no válido"
+
+#: src/err-codes.h:66
+msgid "Unexpected error"
+msgstr "Error inesperado"
+
+#: src/err-codes.h:67
+msgid "Time conflict"
+msgstr "Conflicto de tiempo"
+
+#: src/err-codes.h:68
+msgid "Keyserver error"
+msgstr "Error del servidor de claves"
+
+#: src/err-codes.h:69
+msgid "Wrong public key algorithm"
+msgstr "Algoritmo de clave pública equivocado"
+
+#: src/err-codes.h:70
+msgid "Tribute to D. A."
+msgstr "Tributo a D. A."
+
+#: src/err-codes.h:71
+msgid "Weak encryption key"
+msgstr "Clave de cifrado débil"
+
+#: src/err-codes.h:72
+msgid "Invalid key length"
+msgstr "Longitud incorrecta de clave"
+
+#: src/err-codes.h:73
+msgid "Invalid argument"
+msgstr "Argumento incorrecto"
+
+#: src/err-codes.h:74
+msgid "Syntax error in URI"
+msgstr "Error de sintaxis en la URI"
+
+#: src/err-codes.h:75
+msgid "Invalid URI"
+msgstr "URI incorrecta"
+
+#: src/err-codes.h:76
+msgid "Network error"
+msgstr "Error de red"
+
+#: src/err-codes.h:77
+msgid "Unknown host"
+msgstr "Host desconocido"
+
+#: src/err-codes.h:78
+msgid "Selftest failed"
+msgstr "Ha fallado el auto-test"
+
+#: src/err-codes.h:79
+msgid "Data not encrypted"
+msgstr "Los datos no están cifrados"
+
+#: src/err-codes.h:80
+msgid "Data not processed"
+msgstr "Los datos no han sido procesados"
+
+#: src/err-codes.h:81
+msgid "Unusable public key"
+msgstr "Clave pública no se puede usar"
+
+#: src/err-codes.h:82
+msgid "Unusable secret key"
+msgstr "Clave secreta no se puede usar"
+
+#: src/err-codes.h:83
+msgid "Invalid value"
+msgstr "Valor incorrecto"
+
+#: src/err-codes.h:84
+msgid "Bad certificate chain"
+msgstr "Cadena de certificados incorrecta"
+
+#: src/err-codes.h:85
+msgid "Missing certificate"
+msgstr "Certificado faltante"
+
+#: src/err-codes.h:86
+msgid "No data"
+msgstr "No hay datos"
+
+#: src/err-codes.h:87
+msgid "Bug"
+msgstr "Bug"
+
+#: src/err-codes.h:88
+msgid "Not supported"
+msgstr "No disponible"
+
+#: src/err-codes.h:89
+msgid "Invalid operation code"
+msgstr "Código de operación desconocido"
+
+#: src/err-codes.h:90
+msgid "Timeout"
+msgstr "Vida máxima"
+
+#: src/err-codes.h:91
+msgid "Internal error"
+msgstr "Error interno"
+
+#: src/err-codes.h:92
+msgid "EOF (gcrypt)"
+msgstr "Fin de fichero (gcrypt)"
+
+#: src/err-codes.h:93
+msgid "Invalid object"
+msgstr "Objecto incorrecto"
+
+#: src/err-codes.h:94
+msgid "Provided object is too short"
+msgstr "El objeto es demasiado corto"
+
+#: src/err-codes.h:95
+msgid "Provided object is too large"
+msgstr "El objeto es demasiado grande"
+
+#: src/err-codes.h:96
+msgid "Missing item in object"
+msgstr "Falta un item en el objeto"
+
+#: src/err-codes.h:97
+msgid "Not implemented"
+msgstr "No está implementado"
+
+#: src/err-codes.h:98
+msgid "Conflicting use"
+msgstr "Uso incompatible"
+
+#: src/err-codes.h:99
+msgid "Invalid cipher mode"
+msgstr "Modo de cifrado incorrecto"
+
+#: src/err-codes.h:100
+msgid "Invalid flag"
+msgstr "Etiqueta incorrecta"
+
+#: src/err-codes.h:101
+msgid "Invalid handle"
+msgstr ""
+
+#: src/err-codes.h:102
+msgid "Result truncated"
+msgstr "Resultado truncado"
+
+#: src/err-codes.h:103
+msgid "Incomplete line"
+msgstr "Línea incompleta"
+
+#: src/err-codes.h:104
+msgid "Invalid response"
+msgstr "Respuesta no válida"
+
+#: src/err-codes.h:105
+msgid "No agent running"
+msgstr "No hay ningún agente en ejecución"
+
+#: src/err-codes.h:106
+msgid "Agent error"
+msgstr "Error del agente"
+
+#: src/err-codes.h:107
+msgid "Invalid data"
+msgstr "Datos no válidos"
+
+#: src/err-codes.h:108
+msgid "Unspecific Assuan server fault"
+msgstr "Error no especificado del servidor Assuan"
+
+#: src/err-codes.h:109
+msgid "General Assuan error"
+msgstr "Error general de Assuan"
+
+#: src/err-codes.h:110
+msgid "Invalid session key"
+msgstr "Clave de sesión no válida"
+
+#: src/err-codes.h:111
+msgid "Invalid S-expression"
+msgstr "S-expression no válida"
+
+#: src/err-codes.h:112
+msgid "Unsupported algorithm"
+msgstr "Algoritmo no soportado"
+
+#: src/err-codes.h:113
+msgid "No pinentry"
+msgstr "No hay Pinentry"
+
+#: src/err-codes.h:114
+msgid "pinentry error"
+msgstr "error de pinentry"
+
+#: src/err-codes.h:115
+msgid "Bad PIN"
+msgstr "PIN incorrecto"
+
+#: src/err-codes.h:116
+msgid "Invalid name"
+msgstr "Nombre no válido"
+
+#: src/err-codes.h:117
+msgid "Bad data"
+msgstr "Datos corruptos"
+
+#: src/err-codes.h:118
+msgid "Invalid parameter"
+msgstr "Parámetro incorrecto"
+
+#: src/err-codes.h:119
+msgid "Wrong card"
+msgstr "Tarjeta incorrecta"
+
+#: src/err-codes.h:120
+msgid "No dirmngr"
+msgstr "No existe dirmngr"
+
+#: src/err-codes.h:121
+msgid "dirmngr error"
+msgstr "Error de dirmngr"
+
+#: src/err-codes.h:122
+msgid "Certificate revoked"
+msgstr "Certificado revocado"
+
+#: src/err-codes.h:123
+msgid "No CRL known"
+msgstr "No hay ningún CRL conocido."
+
+#: src/err-codes.h:124
+msgid "CRL too old"
+msgstr "CRL es demasiado antiguo"
+
+#: src/err-codes.h:125
+msgid "Line too long"
+msgstr "Línea demasiado larga"
+
+#: src/err-codes.h:126
+msgid "Not trusted"
+msgstr "No confiable"
+
+#: src/err-codes.h:127
+msgid "Operation cancelled"
+msgstr "Operación cancelada"
+
+#: src/err-codes.h:128
+msgid "Bad CA certificate"
+msgstr "Certificado CA incorrecto"
+
+#: src/err-codes.h:129
+msgid "Certificate expired"
+msgstr "Certificado caducado"
+
+#: src/err-codes.h:130
+msgid "Certificate too young"
+msgstr "Cadena de certificados demasiado joven"
+
+#: src/err-codes.h:131
+msgid "Unsupported certificate"
+msgstr "Certificado no soportado"
+
+#: src/err-codes.h:132
+msgid "Unknown S-expression"
+msgstr "S-expression desconocida"
+
+#: src/err-codes.h:133
+msgid "Unsupported protection"
+msgstr "Protección no soportada"
+
+#: src/err-codes.h:134
+msgid "Corrupted protection"
+msgstr "Protección corrompida"
+
+#: src/err-codes.h:135
+msgid "Ambiguous name"
+msgstr "Nombre ambiguo"
+
+#: src/err-codes.h:136
+msgid "Card error"
+msgstr "Error de tarjeta"
+
+#: src/err-codes.h:137
+msgid "Card reset required"
+msgstr "Hay que resetear la tarjeta"
+
+#: src/err-codes.h:138
+msgid "Card removed"
+msgstr "Tarjeta removida"
+
+#: src/err-codes.h:139
+msgid "Invalid card"
+msgstr "Tarjeta no válida"
+
+#: src/err-codes.h:140
+msgid "Card not present"
+msgstr "La tarjeta no está"
+
+#: src/err-codes.h:141
+msgid "No PKCS15 application"
+msgstr "No hay aplicación PKCS15"
+
+#: src/err-codes.h:142
+msgid "Not confirmed"
+msgstr "Sin confirmar"
+
+#: src/err-codes.h:143
+msgid "Configuration error"
+msgstr "Error de configuración"
+
+#: src/err-codes.h:144
+msgid "No policy match"
+msgstr "No coincide ninguna política"
+
+#: src/err-codes.h:145
+msgid "Invalid index"
+msgstr "Índice incorrecto"
+
+#: src/err-codes.h:146
+msgid "Invalid ID"
+msgstr "Identificador no válido"
+
+#: src/err-codes.h:147
+msgid "No SmartCard daemon"
+msgstr "No hay agente de SmartCard"
+
+#: src/err-codes.h:148
+msgid "SmartCard daemon error"
+msgstr "Error del agente SmartCard"
+
+#: src/err-codes.h:149
+msgid "Unsupported protocol"
+msgstr "Protocolo no soportado"
+
+#: src/err-codes.h:150
+msgid "Bad PIN method"
+msgstr "Método de PIN incorrecto"
+
+#: src/err-codes.h:151
+msgid "Card not initialized"
+msgstr "Tarjeta no arrancada"
+
+#: src/err-codes.h:152
+msgid "Unsupported operation"
+msgstr "Operación no soportada"
+
+#: src/err-codes.h:153
+msgid "Wrong key usage"
+msgstr "Uso de clave incorrecto"
+
+#: src/err-codes.h:154
+msgid "Nothing found"
+msgstr "No se ha encontrado nada"
+
+#: src/err-codes.h:155
+msgid "Wrong blob type"
+msgstr "Tipo de blob incorrecto"
+
+#: src/err-codes.h:156
+msgid "Missing value"
+msgstr "Falta un valor"
+
+#: src/err-codes.h:157
+msgid "Hardware problem"
+msgstr "Problema de hardware"
+
+#: src/err-codes.h:158
+msgid "PIN blocked"
+msgstr "PIN bloqueado"
+
+#: src/err-codes.h:159
+msgid "Conditions of use not satisfied"
+msgstr "Condiciones de uso no satisfechas"
+
+#: src/err-codes.h:160
+msgid "PINs are not synced"
+msgstr "Los PINs no están sincronizados"
+
+#: src/err-codes.h:161
+msgid "Invalid CRL"
+msgstr "CRL no válido"
+
+#: src/err-codes.h:162
+msgid "BER error"
+msgstr "Error BER"
+
+#: src/err-codes.h:163
+msgid "Invalid BER"
+msgstr "BER no válido"
+
+#: src/err-codes.h:164
+msgid "Element not found"
+msgstr "No se ha encontrado el elemento"
+
+#: src/err-codes.h:165
+msgid "Identifier not found"
+msgstr "No se ha encontrado el identificador"
+
+#: src/err-codes.h:166
+msgid "Invalid tag"
+msgstr "Etiqueta no válida"
+
+#: src/err-codes.h:167
+msgid "Invalid length"
+msgstr "Longitud incorrecta"
+
+#: src/err-codes.h:168
+msgid "Invalid key info"
+msgstr "Información de clave incorrecta"
+
+#: src/err-codes.h:169
+msgid "Unexpected tag"
+msgstr "Etiqueta inesperada"
+
+#: src/err-codes.h:170
+msgid "Not DER encoded"
+msgstr "No está encodeado en DER"
+
+#: src/err-codes.h:171
+msgid "No CMS object"
+msgstr "No hay objeto CMS"
+
+#: src/err-codes.h:172
+msgid "Invalid CMS object"
+msgstr "Objeto CMS no válido"
+
+#: src/err-codes.h:173
+msgid "Unknown CMS object"
+msgstr "Objeto CMS desconocido"
+
+#: src/err-codes.h:174
+msgid "Unsupported CMS object"
+msgstr "Objeto CMS no soportado"
+
+#: src/err-codes.h:175
+msgid "Unsupported encoding"
+msgstr "Encoding no soportado"
+
+#: src/err-codes.h:176
+msgid "Unsupported CMS version"
+msgstr "Versión CMS no soportada"
+
+#: src/err-codes.h:177
+msgid "Unknown algorithm"
+msgstr "Algoritmo desconocido"
+
+#: src/err-codes.h:178
+msgid "Invalid crypto engine"
+msgstr "Motor de cifrado no válido"
+
+#: src/err-codes.h:179
+msgid "Public key not trusted"
+msgstr "Clave pública no confiable"
+
+#: src/err-codes.h:180
+msgid "Decryption failed"
+msgstr "Descifrado fallido"
+
+#: src/err-codes.h:181
+msgid "Key expired"
+msgstr "Clave caducada"
+
+#: src/err-codes.h:182
+msgid "Signature expired"
+msgstr "Firma caducada"
+
+#: src/err-codes.h:183
+msgid "Encoding problem"
+msgstr "Problema de codificación"
+
+#: src/err-codes.h:184
+msgid "Invalid state"
+msgstr "Estado no válido"
+
+#: src/err-codes.h:185
+msgid "Duplicated value"
+msgstr "Valor duplicado"
+
+#: src/err-codes.h:186
+msgid "Missing action"
+msgstr "Acción faltante"
+
+#: src/err-codes.h:187
+msgid "ASN.1 module not found"
+msgstr "No se ha encontrado el Módulo ASN.1"
+
+#: src/err-codes.h:188
+msgid "Invalid OID string"
+msgstr "Cadena OID no válida"
+
+#: src/err-codes.h:189
+msgid "Invalid time"
+msgstr "Hora equivocada"
+
+#: src/err-codes.h:190
+msgid "Invalid CRL object"
+msgstr "Objecto CRL incorrecto"
+
+#: src/err-codes.h:191
+msgid "Unsupported CRL version"
+msgstr "Versión CRL no soportada"
+
+#: src/err-codes.h:192
+msgid "Invalid certificate object"
+msgstr "Certificado de objeto incorrecto"
+
+#: src/err-codes.h:193
+msgid "Unknown name"
+msgstr "Nombre desconocido"
+
+#: src/err-codes.h:194
+msgid "A locale function failed"
+msgstr "Una función locale ha fallado"
+
+# What is not locked? the translation depends on the gender of the thing locked (bloqueado/bloqueada)
+#: src/err-codes.h:195
+msgid "Not locked"
+msgstr "No está bloqueada"
+
+#: src/err-codes.h:196
+msgid "Protocol violation"
+msgstr "Violación de protocolo"
+
+#: src/err-codes.h:197
+msgid "Invalid MAC"
+msgstr "Mac incorrecta"
+
+#: src/err-codes.h:198
+msgid "Invalid request"
+msgstr "Consulta no válida"
+
+#: src/err-codes.h:199
+msgid "Unknown extension"
+msgstr "Extensión desconocida"
+
+#: src/err-codes.h:200
+msgid "Unknown critical extension"
+msgstr "Extensión crítica desconocida"
+
+# needs information about the subject, because it has gender in Spanish and probably other languages too
+#: src/err-codes.h:201
+msgid "Locked"
+msgstr "Bloqueada"
+
+#: src/err-codes.h:202
+msgid "Unknown option"
+msgstr "Opción desconocida"
+
+#: src/err-codes.h:203
+msgid "Unknown command"
+msgstr "Orden desconocida"
+
+#: src/err-codes.h:204
+msgid "Not operational"
+msgstr "No operativo"
+
+#: src/err-codes.h:205
+msgid "No passphrase given"
+msgstr "No se ha dado ninguna frase contraseña"
+
+#: src/err-codes.h:206
+msgid "No PIN given"
+msgstr "No se ha dado ningún PIN"
+
+# gender information missing
+#: src/err-codes.h:207
+msgid "Not enabled"
+msgstr "No habilitado"
+
+#: src/err-codes.h:208
+msgid "No crypto engine"
+msgstr "No hay ningún motor de cifrado"
+
+#: src/err-codes.h:209
+msgid "Missing key"
+msgstr "Falta la clave"
+
+#: src/err-codes.h:210
+msgid "Too many objects"
+msgstr "Demasiados objetos"
+
+#: src/err-codes.h:211
+msgid "Limit reached"
+msgstr "Se ha alcanzado el límite"
+
+#: src/err-codes.h:212
+msgid "Not initialized"
+msgstr "Sin inicializar"
+
+#: src/err-codes.h:213
+msgid "Missing issuer certificate"
+msgstr "Falta el certificado del emisor"
+
+#: src/err-codes.h:214
+msgid "No keyserver available"
+msgstr "No hay ningún servidor de claves disponible"
+
+#: src/err-codes.h:215
+msgid "Invalid elliptic curve"
+msgstr "Curva elíptica incorrecta"
+
+#: src/err-codes.h:216
+msgid "Unknown elliptic curve"
+msgstr "Curva elíptica desconocida"
+
+#: src/err-codes.h:217
+msgid "Duplicated key"
+msgstr "Clave duplicada"
+
+#: src/err-codes.h:218
+msgid "Ambiguous result"
+msgstr "Resultado ambiguo"
+
+#: src/err-codes.h:219
+msgid "No crypto context"
+msgstr "No hay contexto de cifrado"
+
+#: src/err-codes.h:220
+msgid "Wrong crypto context"
+msgstr "Contexto de cifrado incorrecto"
+
+#: src/err-codes.h:221
+msgid "Bad crypto context"
+msgstr "Contexto de cifrado equivocado"
+
+#: src/err-codes.h:222
+msgid "Conflict in the crypto context"
+msgstr "Conflicto en el contexto de cifrado"
+
+#: src/err-codes.h:223
+msgid "Broken public key"
+msgstr "Clave pública rota"
+
+#: src/err-codes.h:224
+msgid "Broken secret key"
+msgstr "Clave secreta rota"
+
+#: src/err-codes.h:225
+msgid "Invalid MAC algorithm"
+msgstr "Algoritmo MAC no válido"
+
+#: src/err-codes.h:226
+msgid "Operation fully cancelled"
+msgstr "Operación cancelada definitivamente"
+
+#: src/err-codes.h:227
+msgid "Operation not yet finished"
+msgstr "Operación aún no terminada"
+
+#: src/err-codes.h:228
+msgid "Buffer too short"
+msgstr "Buffer demasiado corto"
+
+#: src/err-codes.h:229
+msgid "Invalid length specifier in S-expression"
+msgstr "Especificador de largo no válido en S-expression"
+
+#: src/err-codes.h:230
+msgid "String too long in S-expression"
+msgstr "Cadena demasiado larga en S-expression"
+
+#: src/err-codes.h:231
+msgid "Unmatched parentheses in S-expression"
+msgstr "Paréntesis incompleto en S-expression"
+
+#: src/err-codes.h:232
+msgid "S-expression not canonical"
+msgstr "S-expression no canónica"
+
+#: src/err-codes.h:233
+msgid "Bad character in S-expression"
+msgstr "Caracter erróneo en la S-expression"
+
+#: src/err-codes.h:234
+msgid "Bad quotation in S-expression"
+msgstr "Comillas mal puestas en la S-expression"
+
+#: src/err-codes.h:235
+msgid "Zero prefix in S-expression"
+msgstr "Prefijo cero en S-expression"
+
+#: src/err-codes.h:236
+msgid "Nested display hints in S-expression"
+msgstr "Sugerencias de exhibición anidadas en S-expression"
+
+#: src/err-codes.h:237
+msgid "Unmatched display hints"
+msgstr "Sugerencias de exhibición no concordadas"
+
+#: src/err-codes.h:238
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr ""
+
+#: src/err-codes.h:239
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Caracter hexadecimal equivocado en la S-expression"
+
+#: src/err-codes.h:240
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Caracteres hexadecimales pares en la S-expression"
+
+#: src/err-codes.h:241
+msgid "Bad octal character in S-expression"
+msgstr "Caracter octal equivocado en la S-expression"
+
+#: src/err-codes.h:242
+msgid "All subkeys are expired or revoked"
+msgstr "Todas las subclaves están caducadas o revocadas"
+
+#: src/err-codes.h:243
+msgid "Database is corrupted"
+msgstr "La base de datos está corrompida"
+
+#: src/err-codes.h:244
+msgid "Server indicated a failure"
+msgstr "El servidor ha indicado un fallo"
+
+#: src/err-codes.h:245
+msgid "No name"
+msgstr "Sin nombre"
+
+#: src/err-codes.h:246
+msgid "No key"
+msgstr "Sin clave"
+
+#: src/err-codes.h:247
+msgid "Legacy key"
+msgstr "Clave heredada"
+
+#: src/err-codes.h:248
+msgid "Request too short"
+msgstr "Consulta demasiado corta"
+
+#: src/err-codes.h:249
+msgid "Request too long"
+msgstr "Consulta demasiado larga"
+
+#: src/err-codes.h:250
+msgid "Object is in termination state"
+msgstr ""
+
+#: src/err-codes.h:251
+msgid "No certificate chain"
+msgstr "No hay cadena de certificados"
+
+#: src/err-codes.h:252
+msgid "Certificate is too large"
+msgstr "Certificado demasiado grande"
+
+#: src/err-codes.h:253
+msgid "Invalid record"
+msgstr ""
+
+#: src/err-codes.h:254
+msgid "The MAC does not verify"
+msgstr ""
+
+#: src/err-codes.h:255
+msgid "Unexpected message"
+msgstr "Mensaje inesperado"
+
+#: src/err-codes.h:256
+msgid "Compression or decompression failed"
+msgstr "Han fallado la compresión o la descompresión"
+
+#: src/err-codes.h:257
+msgid "A counter would wrap"
+msgstr ""
+
+#: src/err-codes.h:258
+msgid "Fatal alert message received"
+msgstr ""
+
+#: src/err-codes.h:259
+msgid "No cipher algorithm"
+msgstr "No hay algoritmo de cifrado"
+
+#: src/err-codes.h:260
+msgid "Missing client certificate"
+msgstr "Falta el certificado de cliente"
+
+#: src/err-codes.h:261
+msgid "Close notification received"
+msgstr "Recibida notificación de cierre"
+
+#: src/err-codes.h:262
+msgid "Ticket expired"
+msgstr "Ticket caducado"
+
+#: src/err-codes.h:263
+msgid "Bad ticket"
+msgstr "Ticket erróneo"
+
+#: src/err-codes.h:264
+msgid "Unknown identity"
+msgstr "Identidad desconocida"
+
+#: src/err-codes.h:265
+msgid "Bad certificate message in handshake"
+msgstr "Mensaje erróneo de certificado en el handshake"
+
+#: src/err-codes.h:266
+msgid "Bad certificate request message in handshake"
+msgstr "Mensaje erróneo de pedido de certificado en el handshake"
+
+#: src/err-codes.h:267
+msgid "Bad certificate verify message in handshake"
+msgstr "Mensaje erróneo de verificación de certificado en el handshake"
+
+#: src/err-codes.h:268
+msgid "Bad change cipher message in handshake"
+msgstr "Mensaje erróneo de cambio de cifrado en el handshake"
+
+#: src/err-codes.h:269
+msgid "Bad client hello message in handshake"
+msgstr "Mensaje erróneo de hola del cliente en el handshake"
+
+#: src/err-codes.h:270
+msgid "Bad server hello message in handshake"
+msgstr "Mensaje erróneo de hola del servidor en el handshake"
+
+#: src/err-codes.h:271
+msgid "Bad server hello done message in handshake"
+msgstr ""
+
+#: src/err-codes.h:272
+msgid "Bad finished message in handshake"
+msgstr "Mensaje mal terminado en el handshake"
+
+#: src/err-codes.h:273
+msgid "Bad server key exchange message in handshake"
+msgstr ""
+
+#: src/err-codes.h:274
+msgid "Bad client key exchange message in handshake"
+msgstr ""
+
+#: src/err-codes.h:275
+msgid "Bogus string"
+msgstr "Cadena errónea"
+
+#: src/err-codes.h:276
+msgid "Forbidden"
+msgstr "Prohibido"
+
+#: src/err-codes.h:277
+msgid "Key disabled"
+msgstr "Clave deshabilitada"
+
+#: src/err-codes.h:278
+msgid "Not possible with a card based key"
+msgstr "La operación no es posible con una clave basada en tarjeta"
+
+#: src/err-codes.h:279
+msgid "Invalid lock object"
+msgstr "Objecto de bloqueo incorrecto"
+
+#: src/err-codes.h:280
+msgid "True"
+msgstr "Verdadero"
+
+#: src/err-codes.h:281
+msgid "False"
+msgstr "Falso"
+
+#: src/err-codes.h:282
+msgid "General IPC error"
+msgstr "Error general de IPC"
+
+#: src/err-codes.h:283
+msgid "IPC accept call failed"
+msgstr "Fallo al aceptar la llamada IPC"
+
+#: src/err-codes.h:284
+msgid "IPC connect call failed"
+msgstr "Falló la llamada de conexión IPC"
+
+#: src/err-codes.h:285
+msgid "Invalid IPC response"
+msgstr "Respuesta IPC no válida"
+
+#: src/err-codes.h:286
+msgid "Invalid value passed to IPC"
+msgstr "Valor no válido pasado a IPC"
+
+#: src/err-codes.h:287
+msgid "Incomplete line passed to IPC"
+msgstr "Línea incompleta pasada a IPC"
+
+#: src/err-codes.h:288
+msgid "Line passed to IPC too long"
+msgstr "La línea pasada a IPC es demasiado larga"
+
+#: src/err-codes.h:289
+msgid "Nested IPC commands"
+msgstr "Órdenes IPC anidadas"
+
+#: src/err-codes.h:290
+msgid "No data callback in IPC"
+msgstr ""
+
+#: src/err-codes.h:291
+msgid "No inquire callback in IPC"
+msgstr ""
+
+#: src/err-codes.h:292
+msgid "Not an IPC server"
+msgstr "No es un servidor IPC"
+
+#: src/err-codes.h:293
+msgid "Not an IPC client"
+msgstr "No es un cliente IPC"
+
+#: src/err-codes.h:294
+msgid "Problem starting IPC server"
+msgstr "Problema al iniciar el servidor IPC"
+
+#: src/err-codes.h:295
+msgid "IPC read error"
+msgstr "error de lectura IPC"
+
+#: src/err-codes.h:296
+msgid "IPC write error"
+msgstr "error de escritura IPC"
+
+#: src/err-codes.h:297
+msgid "Too much data for IPC layer"
+msgstr "Demasiados datos para la capa IPC"
+
+#: src/err-codes.h:298
+msgid "Unexpected IPC command"
+msgstr "Orden IPC inesperada"
+
+#: src/err-codes.h:299
+msgid "Unknown IPC command"
+msgstr "Orden IPC desconocida"
+
+#: src/err-codes.h:300
+msgid "IPC syntax error"
+msgstr "Error de sintaxis IPC"
+
+#: src/err-codes.h:301
+msgid "IPC call has been cancelled"
+msgstr "Se ha cancelado IPC"
+
+#: src/err-codes.h:302
+msgid "No input source for IPC"
+msgstr "No hay fuente de entrada para IPC"
+
+#: src/err-codes.h:303
+msgid "No output source for IPC"
+msgstr "No hay fuente de salida para IPC"
+
+#: src/err-codes.h:304
+msgid "IPC parameter error"
+msgstr "Error de parámetro IPC"
+
+#: src/err-codes.h:305
+msgid "Unknown IPC inquire"
+msgstr ""
+
+#: src/err-codes.h:306
+msgid "Crypto engine too old"
+msgstr "Motor de cifrado demasiado antiguo"
+
+#: src/err-codes.h:307
+msgid "Screen or window too small"
+msgstr "La ventana o la pantalla son demasiado pequeñas."
+
+#: src/err-codes.h:308
+msgid "Screen or window too large"
+msgstr "La ventana o pantalla son demasiado grandes"
+
+#: src/err-codes.h:309
+msgid "Required environment variable not set"
+msgstr "No se ha configurado la variable de entorno requerida"
+
+#: src/err-codes.h:310
+msgid "User ID already exists"
+msgstr "Esa ID de usuario ya existe"
+
+#: src/err-codes.h:311
+msgid "Name already exists"
+msgstr "El nombre ya existe"
+
+#: src/err-codes.h:312
+msgid "Duplicated name"
+msgstr "Nombre duplicado"
+
+#: src/err-codes.h:313
+msgid "Object is too young"
+msgstr "El objeto es demasiado joven"
+
+#: src/err-codes.h:314
+msgid "Object is too old"
+msgstr "El objeto es demasiado antiguo"
+
+#: src/err-codes.h:315
+msgid "Unknown flag"
+msgstr ""
+
+#: src/err-codes.h:316
+msgid "Invalid execution order"
+msgstr "Orden de ejecución no válido"
+
+#: src/err-codes.h:317
+msgid "Already fetched"
+msgstr "Ya se ha descargado"
+
+#: src/err-codes.h:318
+msgid "Try again later"
+msgstr ""
+
+#: src/err-codes.h:319
+msgid "Wrong name"
+msgstr "Nombre incorrecto"
+
+# gender information missing
+#: src/err-codes.h:320
+#, fuzzy
+#| msgid "Not enabled"
+msgid "Not authenticated"
+msgstr "No habilitado"
+
+#: src/err-codes.h:321
+#, fuzzy
+#| msgid "Inappropriate LDAP authentication"
+msgid "Bad authentication"
+msgstr "Autentificación LDAP inapropiada"
+
+#: src/err-codes.h:322
+#, fuzzy
+#| msgid "No agent running"
+msgid "No Keybox daemon running"
+msgstr "No hay ningún agente en ejecución"
+
+#: src/err-codes.h:323
+#, fuzzy
+#| msgid "SmartCard daemon error"
+msgid "Keybox daemon error"
+msgstr "Error del agente SmartCard"
+
+#: src/err-codes.h:324
+msgid "Service is not running"
+msgstr ""
+
+#: src/err-codes.h:325
+#, fuzzy
+#| msgid "Keyserver error"
+msgid "Service error"
+msgstr "Error del servidor de claves"
+
+#: src/err-codes.h:326
+msgid "System bug detected"
+msgstr "Detectado error del sistema"
+
+#: src/err-codes.h:327
+msgid "Unknown DNS error"
+msgstr "Error DNS desconocido"
+
+#: src/err-codes.h:328
+msgid "Invalid DNS section"
+msgstr "Sección DNS incorrecta"
+
+#: src/err-codes.h:329
+msgid "Invalid textual address form"
+msgstr ""
+
+#: src/err-codes.h:330
+msgid "Missing DNS query packet"
+msgstr ""
+
+#: src/err-codes.h:331
+msgid "Missing DNS answer packet"
+msgstr ""
+
+#: src/err-codes.h:332
+msgid "Connection closed in DNS"
+msgstr "Conexión cerrada en DNS"
+
+#: src/err-codes.h:333
+msgid "Verification failed in DNS"
+msgstr "Fallo de verificación en DNS"
+
+#: src/err-codes.h:334
+msgid "DNS Timeout"
+msgstr "Tiempo excedido para DNS"
+
+#: src/err-codes.h:335
+msgid "General LDAP error"
+msgstr "Error general de LDAP"
+
+#: src/err-codes.h:336
+msgid "General LDAP attribute error"
+msgstr "Error general de atributo de LDAP"
+
+#: src/err-codes.h:337
+msgid "General LDAP name error"
+msgstr "Error general de nombre de LDAP"
+
+#: src/err-codes.h:338
+msgid "General LDAP security error"
+msgstr "Error general de seguridad de LDAP"
+
+#: src/err-codes.h:339
+msgid "General LDAP service error"
+msgstr "Error general de servicio de LDAP"
+
+#: src/err-codes.h:340
+msgid "General LDAP update error"
+msgstr "Error general de actualización de LDAP"
+
+#: src/err-codes.h:341
+msgid "Experimental LDAP error code"
+msgstr "Código de error experimental de LDAP"
+
+#: src/err-codes.h:342
+msgid "Private LDAP error code"
+msgstr "Código de error privado de LDAP"
+
+#: src/err-codes.h:343
+msgid "Other general LDAP error"
+msgstr "Otro error general de LDAP"
+
+#: src/err-codes.h:344
+msgid "LDAP connecting failed (X)"
+msgstr "Ha fallado la conexión LDAP (X)"
+
+#: src/err-codes.h:345
+msgid "LDAP referral limit exceeded"
+msgstr "Límite de referrals de LDAP excedido"
+
+#: src/err-codes.h:346
+msgid "LDAP client loop"
+msgstr "Bucle del cliente LDAP"
+
+#: src/err-codes.h:347
+msgid "No LDAP results returned"
+msgstr "No se devolvió ningún resultado LDAP"
+
+#: src/err-codes.h:348
+msgid "LDAP control not found"
+msgstr "Control de LDAP no encontrado"
+
+#: src/err-codes.h:349
+msgid "Not supported by LDAP"
+msgstr "No soportado por LDAP"
+
+#: src/err-codes.h:350
+msgid "LDAP connect error"
+msgstr "Error de conexión de LDAP"
+
+#: src/err-codes.h:351
+msgid "Out of memory in LDAP"
+msgstr "Sin memoria suficiente para LDAP"
+
+#: src/err-codes.h:352
+msgid "Bad parameter to an LDAP routine"
+msgstr "Parámetro incorrecto para una rutina de LDAP"
+
+#: src/err-codes.h:353
+msgid "User cancelled LDAP operation"
+msgstr "Operación LDAP cancelada por el usuario"
+
+#: src/err-codes.h:354
+msgid "Bad LDAP search filter"
+msgstr "Filtro de búsqueda de LDAP incorrecto"
+
+#: src/err-codes.h:355
+msgid "Unknown LDAP authentication method"
+msgstr "Método de autentificación de LDAP desconocido"
+
+#: src/err-codes.h:356
+msgid "Timeout in LDAP"
+msgstr "Tiempo excedido para LDAP"
+
+#: src/err-codes.h:357
+msgid "LDAP decoding error"
+msgstr "Error de decoding de LDAP"
+
+#: src/err-codes.h:358
+msgid "LDAP encoding error"
+msgstr "Error de encoding de LDAP"
+
+#: src/err-codes.h:359
+msgid "LDAP local error"
+msgstr "Error local de LDAP"
+
+#: src/err-codes.h:360
+msgid "Cannot contact LDAP server"
+msgstr "No se puede conectar al servidor LDAP"
+
+#: src/err-codes.h:361
+msgid "LDAP success"
+msgstr "Éxito LDAP"
+
+#: src/err-codes.h:362
+msgid "LDAP operations error"
+msgstr "Error de operación de LDAP"
+
+#: src/err-codes.h:363
+msgid "LDAP protocol error"
+msgstr "Error de protocolo de LDAP"
+
+#: src/err-codes.h:364
+msgid "Time limit exceeded in LDAP"
+msgstr "Límite de tiempo excedido en LDAP"
+
+#: src/err-codes.h:365
+msgid "Size limit exceeded in LDAP"
+msgstr "Límite de tamaño excedido en LDAP"
+
+#: src/err-codes.h:366
+msgid "LDAP compare false"
+msgstr ""
+
+#: src/err-codes.h:367
+msgid "LDAP compare true"
+msgstr ""
+
+#: src/err-codes.h:368
+msgid "LDAP authentication method not supported"
+msgstr "Método de autentificación LDAP no soportado"
+
+#: src/err-codes.h:369
+msgid "Strong(er) LDAP authentication required"
+msgstr "Se requiere una autentificación LDAP (más) fuerte"
+
+#: src/err-codes.h:370
+msgid "Partial LDAP results+referral received"
+msgstr ""
+
+#: src/err-codes.h:371
+msgid "LDAP referral"
+msgstr ""
+
+#: src/err-codes.h:372
+msgid "Administrative LDAP limit exceeded"
+msgstr "Excedido el límite administrativo de LDAP"
+
+#: src/err-codes.h:373
+msgid "Critical LDAP extension is unavailable"
+msgstr "Extensión crítica LDAP no disponible"
+
+#: src/err-codes.h:374
+msgid "Confidentiality required by LDAP"
+msgstr "Confidencialidad requerida por LDAP"
+
+#: src/err-codes.h:375
+msgid "LDAP SASL bind in progress"
+msgstr ""
+
+#: src/err-codes.h:376
+msgid "No such LDAP attribute"
+msgstr "Ese atributo LDAP no existe"
+
+#: src/err-codes.h:377
+msgid "Undefined LDAP attribute type"
+msgstr ""
+
+#: src/err-codes.h:378
+msgid "Inappropriate matching in LDAP"
+msgstr ""
+
+#: src/err-codes.h:379
+msgid "Constraint violation in LDAP"
+msgstr ""
+
+#: src/err-codes.h:380
+msgid "LDAP type or value exists"
+msgstr ""
+
+#: src/err-codes.h:381
+msgid "Invalid syntax in LDAP"
+msgstr ""
+
+#: src/err-codes.h:382
+msgid "No such LDAP object"
+msgstr "No existe ese objeto LDAP"
+
+#: src/err-codes.h:383
+msgid "LDAP alias problem"
+msgstr ""
+
+#: src/err-codes.h:384
+msgid "Invalid DN syntax in LDAP"
+msgstr ""
+
+#: src/err-codes.h:385
+msgid "LDAP entry is a leaf"
+msgstr "La entrada de LDAP es una hoja"
+
+#: src/err-codes.h:386
+msgid "LDAP alias dereferencing problem"
+msgstr ""
+
+#: src/err-codes.h:387
+msgid "LDAP proxy authorization failure (X)"
+msgstr ""
+
+#: src/err-codes.h:388
+msgid "Inappropriate LDAP authentication"
+msgstr "Autentificación LDAP inapropiada"
+
+#: src/err-codes.h:389
+msgid "Invalid LDAP credentials"
+msgstr "Credenciales LDAP no válidas"
+
+#: src/err-codes.h:390
+msgid "Insufficient access for LDAP"
+msgstr "Acceso insuficiente para LDAP"
+
+#: src/err-codes.h:391
+msgid "LDAP server is busy"
+msgstr "El servidor LDAP está ocupado"
+
+#: src/err-codes.h:392
+msgid "LDAP server is unavailable"
+msgstr "El servidor LDAP no está disponible"
+
+#: src/err-codes.h:393
+msgid "LDAP server is unwilling to perform"
+msgstr "El servidor LDAP no quiere funcionar"
+
+#: src/err-codes.h:394
+msgid "Loop detected by LDAP"
+msgstr "Bucle detectado por LDAP"
+
+#: src/err-codes.h:395
+msgid "LDAP naming violation"
+msgstr "Violación de nombre de LDAP"
+
+#: src/err-codes.h:396
+msgid "LDAP object class violation"
+msgstr "Violación de clase de objeto de LDAP"
+
+#: src/err-codes.h:397
+msgid "LDAP operation not allowed on non-leaf"
+msgstr ""
+
+#: src/err-codes.h:398
+msgid "LDAP operation not allowed on RDN"
+msgstr ""
+
+#: src/err-codes.h:399
+msgid "Already exists (LDAP)"
+msgstr "Ya existe (LDAP)"
+
+#: src/err-codes.h:400
+msgid "Cannot modify LDAP object class"
+msgstr ""
+
+#: src/err-codes.h:401
+msgid "LDAP results too large"
+msgstr ""
+
+#: src/err-codes.h:402
+msgid "LDAP operation affects multiple DSAs"
+msgstr ""
+
+#: src/err-codes.h:403
+msgid "Virtual LDAP list view error"
+msgstr ""
+
+#: src/err-codes.h:404
+msgid "Other LDAP error"
+msgstr "Error diferente de LDAP"
+
+#: src/err-codes.h:405
+msgid "Resources exhausted in LCUP"
+msgstr "Recursos agotados en LCUP"
+
+#: src/err-codes.h:406
+msgid "Security violation in LCUP"
+msgstr "Violación de seguridad en LCUP"
+
+#: src/err-codes.h:407
+msgid "Invalid data in LCUP"
+msgstr "Datos no válidos en LCUP"
+
+#: src/err-codes.h:408
+msgid "Unsupported scheme in LCUP"
+msgstr "Esquema no soportado en LCUP"
+
+#: src/err-codes.h:409
+msgid "Reload required in LCUP"
+msgstr "Se requiere un reload en LCUP"
+
+#: src/err-codes.h:410
+msgid "LDAP cancelled"
+msgstr "LDAP cancelado"
+
+#: src/err-codes.h:411
+msgid "No LDAP operation to cancel"
+msgstr "Lo hay ninguna operación de LDAP que cancelar"
+
+#: src/err-codes.h:412
+msgid "Too late to cancel LDAP"
+msgstr "Demasiado tarde para cancelar LDAP"
+
+#: src/err-codes.h:413
+msgid "Cannot cancel LDAP"
+msgstr "No se puede cancelar LDAP"
+
+#: src/err-codes.h:414
+msgid "LDAP assertion failed"
+msgstr "Falló de declaración de LDAP"
+
+#: src/err-codes.h:415
+msgid "Proxied authorization denied by LDAP"
+msgstr ""
+
+#: src/err-codes.h:416
+msgid "User defined error code 1"
+msgstr "Origen determinado por el usuario 1"
+
+#: src/err-codes.h:417
+msgid "User defined error code 2"
+msgstr "Origen determinado por el usuario 2"
+
+#: src/err-codes.h:418
+msgid "User defined error code 3"
+msgstr "Origen determinado por el usuario 3"
+
+#: src/err-codes.h:419
+msgid "User defined error code 4"
+msgstr "Origen determinado por el usuario 4"
+
+#: src/err-codes.h:420
+msgid "User defined error code 5"
+msgstr ""
+
+#: src/err-codes.h:421
+msgid "User defined error code 6"
+msgstr ""
+
+#: src/err-codes.h:422
+msgid "User defined error code 7"
+msgstr ""
+
+#: src/err-codes.h:423
+msgid "User defined error code 8"
+msgstr ""
+
+#: src/err-codes.h:424
+msgid "User defined error code 9"
+msgstr ""
+
+#: src/err-codes.h:425
+msgid "User defined error code 10"
+msgstr ""
+
+#: src/err-codes.h:426
+msgid "User defined error code 11"
+msgstr ""
+
+#: src/err-codes.h:427
+msgid "User defined error code 12"
+msgstr ""
+
+#: src/err-codes.h:428
+msgid "User defined error code 13"
+msgstr ""
+
+#: src/err-codes.h:429
+msgid "User defined error code 14"
+msgstr ""
+
+#: src/err-codes.h:430
+msgid "User defined error code 15"
+msgstr ""
+
+#: src/err-codes.h:431
+msgid "User defined error code 16"
+msgstr ""
+
+#: src/err-codes.h:432
+#, fuzzy
+#| msgid "LDAP success"
+msgid "SQL success"
+msgstr "Éxito LDAP"
+
+#: src/err-codes.h:433
+#, fuzzy
+#| msgid "Syntax error"
+msgid "SQL error"
+msgstr "Error de sintaxis"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr ""
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr ""
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr ""
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr ""
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr ""
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr ""
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr ""
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr ""
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr ""
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr ""
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr ""
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr ""
+
+#: src/err-codes.h:447
+#, fuzzy
+#| msgid "LDAP protocol error"
+msgid "SQL database lock protocol error"
+msgstr "Error de protocolo de LDAP"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr ""
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr ""
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr ""
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr ""
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr ""
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr ""
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr ""
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr ""
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr ""
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr ""
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr ""
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr ""
+
+#: src/err-codes.h:463
+msgid "System error w/o errno"
+msgstr ""
+
+#: src/err-codes.h:464
+msgid "Unknown system error"
+msgstr "Error desconocido del sistema"
+
+#: src/err-codes.h:465
+msgid "End of file"
+msgstr "Fin del fichero"
+
+#: src/err-codes.h:466
+msgid "Unknown error code"
+msgstr "Código de error desconocido"
+
+#: src/argparse.c:494
+msgid "argument not expected"
+msgstr "parámetro inesperado"
+
+#: src/argparse.c:496
+msgid "read error"
+msgstr "error de lectura"
+
+#: src/argparse.c:498
+msgid "keyword too long"
+msgstr "palabra clave demasiado larga"
+
+#: src/argparse.c:500
+msgid "missing argument"
+msgstr "falta el parámetro"
+
+#: src/argparse.c:502
+msgid "invalid argument"
+msgstr "parámetro incorrecto"
+
+#: src/argparse.c:504
+msgid "invalid command"
+msgstr "orden inválida"
+
+#: src/argparse.c:506
+msgid "invalid alias definition"
+msgstr "definición de alias inválida"
+
+#: src/argparse.c:508 src/argparse.c:545
+#, fuzzy
+#| msgid "LDAP operations error"
+msgid "permission error"
+msgstr "Error de operación de LDAP"
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr "memoria desbordada"
+
+#: src/argparse.c:514 src/argparse.c:549
+#, fuzzy
+#| msgid "invalid command"
+msgid "invalid meta command"
+msgstr "orden inválida"
+
+#: src/argparse.c:516 src/argparse.c:551
+#, fuzzy
+#| msgid "Unknown command"
+msgid "unknown meta command"
+msgstr "Orden desconocida"
+
+#: src/argparse.c:518 src/argparse.c:553
+#, fuzzy
+#| msgid "Unexpected IPC command"
+msgid "unexpected meta command"
+msgstr "Orden IPC inesperada"
+
+#: src/argparse.c:520
+msgid "invalid option"
+msgstr "opción inválida"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr "falta parámetro para la opción \"%.50s\"\n"
+
+#: src/argparse.c:532
+#, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "parámetro incorrecto para la opción \"%.50s\"\n"
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr "la opción \"%.50s\" no necesita parámetros\n"
+
+#: src/argparse.c:537
+#, c-format
+msgid "invalid command \"%.50s\"\n"
+msgstr "orden inválida \"%.50s\"\n"
+
+#: src/argparse.c:539
+#, c-format
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr "la opción \"%.50s\" es ambigua\n"
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr "la orden \"%.50s\" es ambigua\n"
+
+#: src/argparse.c:555
+#, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr "opción inválida \"%.50s\"\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr ""
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr "Reporta los problemas encontrados en <https://bugs.gnupg.org>.\n"
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "advertencia: no se pudo entender %s\n"
+
+#~ msgid "out of core\n"
+#~ msgstr "memoria desbordada\n"
index d249121..d3b83ac 100644 (file)
Binary files a/po/fr.gmo and b/po/fr.gmo differ
index 5df7dac..1f38786 100644 (file)
--- a/po/fr.po
+++ b/po/fr.po
@@ -8,8 +8,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libgpg-error-1.17\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2014-11-01 22:07-0400\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:26+0100\n"
 "Last-Translator: David Prévot <david@tilapin.org>\n"
 "Language-Team: French <traduc@traduc.org>\n"
 "Language: fr\n"
@@ -84,30 +84,34 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
+msgid "TPM2d"
+msgstr "TPM2d"
+
+#: src/err-sources.h:45
 msgid "TLS"
 msgstr "TLS"
 
-#: src/err-sources.h:45
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "N'importe quelle source"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "Source 1 définie par l'utilisateur"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "Source 2 définie par l'utilisateur"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "Source 3 définie par l'utilisateur"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "Source 4 définie par l'utilisateur"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Source inconnue"
 
@@ -1304,580 +1308,864 @@ msgid "Wrong name"
 msgstr "Nom inconnu"
 
 #: src/err-codes.h:320
+#, fuzzy
+#| msgid "Not enabled"
+msgid "Not authenticated"
+msgstr "Non activé"
+
+#: src/err-codes.h:321
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Bad authentication"
+msgstr "Protection non prise en charge"
+
+#: src/err-codes.h:322
+#, fuzzy
+#| msgid "No agent running"
+msgid "No Keybox daemon running"
+msgstr "Pas d'agent en cours d'exécution"
+
+#: src/err-codes.h:323
+#, fuzzy
+#| msgid "SmartCard daemon error"
+msgid "Keybox daemon error"
+msgstr "Erreur de démon SmartCard"
+
+#: src/err-codes.h:324
+msgid "Service is not running"
+msgstr ""
+
+#: src/err-codes.h:325
+#, fuzzy
+#| msgid "Keyserver error"
+msgid "Service error"
+msgstr "Erreur du serveur de clefs"
+
+#: src/err-codes.h:326
 msgid "System bug detected"
 msgstr ""
 
-#: src/err-codes.h:321
+#: src/err-codes.h:327
 #, fuzzy
 #| msgid "Unknown system error"
 msgid "Unknown DNS error"
 msgstr "Erreur système inconnue"
 
-#: src/err-codes.h:322
+#: src/err-codes.h:328
 #, fuzzy
 #| msgid "Invalid OID string"
 msgid "Invalid DNS section"
 msgstr "Chaîne OID incorrecte"
 
-#: src/err-codes.h:323
+#: src/err-codes.h:329
 #, fuzzy
 #| msgid "Invalid S-expression"
 msgid "Invalid textual address form"
 msgstr "Expression symbolique incorrecte"
 
-#: src/err-codes.h:324
+#: src/err-codes.h:330
 #, fuzzy
 #| msgid "Missing issuer certificate"
 msgid "Missing DNS query packet"
 msgstr "Certificat de l'émetteur manquant"
 
-#: src/err-codes.h:325
+#: src/err-codes.h:331
 msgid "Missing DNS answer packet"
 msgstr ""
 
-#: src/err-codes.h:326
+#: src/err-codes.h:332
 msgid "Connection closed in DNS"
 msgstr ""
 
-#: src/err-codes.h:327
+#: src/err-codes.h:333
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "Verification failed in DNS"
 msgstr "Échec de déchiffrement"
 
-#: src/err-codes.h:328
+#: src/err-codes.h:334
 #, fuzzy
 #| msgid "Timeout"
 msgid "DNS Timeout"
 msgstr "Délai d'attente dépassé"
 
-#: src/err-codes.h:329
+#: src/err-codes.h:335
 #, fuzzy
 #| msgid "General IPC error"
 msgid "General LDAP error"
 msgstr "Erreur générale IPC"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP attribute error"
 msgstr "Erreur générale"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP name error"
 msgstr "Erreur générale"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP security error"
 msgstr "Erreur générale Assuan"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP service error"
 msgstr "Erreur générale"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP update error"
 msgstr "Erreur générale Assuan"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr ""
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 #, fuzzy
 #| msgid "IPC write error"
 msgid "Private LDAP error code"
 msgstr "Erreur d'écriture IPC"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other general LDAP error"
 msgstr "Erreur générale IPC"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 #, fuzzy
 #| msgid "IPC connect call failed"
 msgid "LDAP connecting failed (X)"
 msgstr "Échec de l'appel IPC connect"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral limit exceeded"
 msgstr "Erreur générale"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr ""
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 #, fuzzy
 #| msgid "Card reset required"
 msgid "No LDAP results returned"
 msgstr "Réinitialisation de la carte nécessaire"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 #, fuzzy
 #| msgid "Element not found"
 msgid "LDAP control not found"
 msgstr "Élément non trouvé"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 #, fuzzy
 #| msgid "Not supported"
 msgid "Not supported by LDAP"
 msgstr "Non pris en charge"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 #, fuzzy
 #| msgid "Unexpected error"
 msgid "LDAP connect error"
 msgstr "Erreur inattendue"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr ""
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr ""
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 #, fuzzy
 #| msgid "Unsupported operation"
 msgid "User cancelled LDAP operation"
 msgstr "Opération non prise en charge"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 #, fuzzy
 #| msgid "Bad certificate"
 msgid "Bad LDAP search filter"
 msgstr "Mauvais certificat"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "Unknown LDAP authentication method"
 msgstr "Extension inconnue"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 #, fuzzy
 #| msgid "Timeout"
 msgid "Timeout in LDAP"
 msgstr "Délai d'attente dépassé"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP decoding error"
 msgstr "Erreur de dirmngr"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP encoding error"
 msgstr "Erreur de dirmngr"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 #, fuzzy
 #| msgid "IPC read error"
 msgid "LDAP local error"
 msgstr "Erreur de lecture IPC"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot contact LDAP server"
 msgstr "Pas un serveur IPC"
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP success"
 msgstr "Réussite"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 #, fuzzy
 #| msgid "Configuration error"
 msgid "LDAP operations error"
 msgstr "Erreur de configuration"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP protocol error"
 msgstr "Violation de protocole"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr ""
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr ""
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "LDAP authentication method not supported"
 msgstr "Extension inconnue"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
 msgstr ""
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 #, fuzzy
 #| msgid "Fatal alert message received"
 msgid "Partial LDAP results+referral received"
 msgstr "Message d’alerte fatale reçu"
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral"
 msgstr "Erreur générale"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr ""
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr ""
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Confidentiality required by LDAP"
 msgstr "Réinitialisation de la carte nécessaire"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr ""
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr ""
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 #, fuzzy
 #| msgid "Invalid attribute"
 msgid "Undefined LDAP attribute type"
 msgstr "Attribut incorrect"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate matching in LDAP"
 msgstr "Protection non prise en charge"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Constraint violation in LDAP"
 msgstr "Violation de protocole"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr ""
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid syntax in LDAP"
 msgstr "État incorrect"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 #, fuzzy
 #| msgid "No CMS object"
 msgid "No such LDAP object"
 msgstr "Pas d'objet CMS"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 #, fuzzy
 #| msgid "Hardware problem"
 msgid "LDAP alias problem"
 msgstr "Problème matériel"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid DN syntax in LDAP"
 msgstr "État incorrect"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr ""
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 #, fuzzy
 #| msgid "Encoding problem"
 msgid "LDAP alias dereferencing problem"
 msgstr "Problème d'encodage"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr ""
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate LDAP authentication"
 msgstr "Protection non prise en charge"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 #, fuzzy
 #| msgid "Invalid card"
 msgid "Invalid LDAP credentials"
 msgstr "Carte incorrecte"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr ""
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr ""
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 #, fuzzy
 #| msgid "No keyserver available"
 msgid "LDAP server is unavailable"
 msgstr "Aucun serveur de clefs disponible"
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr ""
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr ""
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 #, fuzzy
 #| msgid "Missing action"
 msgid "LDAP naming violation"
 msgstr "Action manquante"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP object class violation"
 msgstr "Violation de protocole"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 #, fuzzy
 #| msgid "Operation not yet finished"
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "L'opération n'est pas encore terminée"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation not allowed on RDN"
 msgstr "Opération annulée"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr ""
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr ""
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 #, fuzzy
 #| msgid "Line too long"
 msgid "LDAP results too large"
 msgstr "Ligne trop longue"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation affects multiple DSAs"
 msgstr "Opération annulée"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr ""
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other LDAP error"
 msgstr "Erreur générale IPC"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 #, fuzzy
 #| msgid "Resources exhausted"
 msgid "Resources exhausted in LCUP"
 msgstr "Ressources épuisées"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Security violation in LCUP"
 msgstr "Violation de protocole"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid data in LCUP"
 msgstr "État incorrect"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 #, fuzzy
 #| msgid "Unsupported certificate"
 msgid "Unsupported scheme in LCUP"
 msgstr "Certificat non pris en charge"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Reload required in LCUP"
 msgstr "Réinitialisation de la carte nécessaire"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP cancelled"
 msgstr "Réussite"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 #, fuzzy
 #| msgid "Not operational"
 msgid "No LDAP operation to cancel"
 msgstr "Non opérationnel"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 #, fuzzy
 #| msgid "Not operational"
 msgid "Too late to cancel LDAP"
 msgstr "Non opérationnel"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot cancel LDAP"
 msgstr "Pas un serveur IPC"
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "LDAP assertion failed"
 msgstr "Échec de déchiffrement"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr ""
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "Code d'erreur 1 défini par l'utilisateur"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "Code d'erreur 2 défini par l'utilisateur"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "Code d'erreur 3 défini par l'utilisateur"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "Code d'erreur 4 défini par l'utilisateur"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "Code d'erreur 5 défini par l'utilisateur"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "Code d'erreur 6 défini par l'utilisateur"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "Code d'erreur 7 défini par l'utilisateur"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "Code d'erreur 8 défini par l'utilisateur"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "Code d'erreur 9 défini par l'utilisateur"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "Code d'erreur 10 défini par l'utilisateur"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "Code d'erreur 11 défini par l'utilisateur"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "Code d'erreur 12 défini par l'utilisateur"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "Code d'erreur 13 défini par l'utilisateur"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "Code d'erreur 14 défini par l'utilisateur"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "Code d'erreur 15 défini par l'utilisateur"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "Code d'erreur 16 défini par l'utilisateur"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+#, fuzzy
+#| msgid "Success"
+msgid "SQL success"
+msgstr "Réussite"
+
+#: src/err-codes.h:433
+#, fuzzy
+#| msgid "Syntax error"
+msgid "SQL error"
+msgstr "Erreur de syntaxe"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr ""
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr ""
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr ""
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr ""
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr ""
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr ""
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr ""
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr ""
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr ""
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr ""
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr ""
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr ""
+
+#: src/err-codes.h:447
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "SQL database lock protocol error"
+msgstr "Violation de protocole"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr ""
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr ""
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr ""
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr ""
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr ""
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr ""
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr ""
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr ""
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr ""
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr ""
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr ""
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr ""
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "Erreur système sans numéro"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Erreur système inconnue"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Fin de fichier"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Code d'erreur inconnu"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+msgid "argument not expected"
+msgstr "argument inattendu"
+
+#: src/argparse.c:496
+msgid "read error"
+msgstr "erreur de lecture"
+
+#: src/argparse.c:498
+msgid "keyword too long"
+msgstr "mot-clef trop long"
+
+#: src/argparse.c:500
+msgid "missing argument"
+msgstr "argument manquant"
+
+#: src/argparse.c:502
+msgid "invalid argument"
+msgstr "argument incorrect"
+
+#: src/argparse.c:504
+msgid "invalid command"
+msgstr "commande incorrecte"
+
+#: src/argparse.c:506
+msgid "invalid alias definition"
+msgstr "définition d'alias incorrecte"
+
+#: src/argparse.c:508 src/argparse.c:545
+#, fuzzy
+#| msgid "Configuration error"
+msgid "permission error"
+msgstr "Erreur de configuration"
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr "hors limite"
+
+#: src/argparse.c:514 src/argparse.c:549
+#, fuzzy
+#| msgid "invalid command"
+msgid "invalid meta command"
+msgstr "commande incorrecte"
+
+#: src/argparse.c:516 src/argparse.c:551
+#, fuzzy
+#| msgid "Unknown command"
+msgid "unknown meta command"
+msgstr "Commande inconnue"
+
+#: src/argparse.c:518 src/argparse.c:553
+#, fuzzy
+#| msgid "Unexpected IPC command"
+msgid "unexpected meta command"
+msgstr "Commande IPC inattendue"
+
+#: src/argparse.c:520
+msgid "invalid option"
+msgstr "option incorrecte"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr "argument manquant pour l'option « %.50s »\n"
+
+#: src/argparse.c:532
+#, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "argument incorrect pour l'option « %.50s »\n"
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr "l'option « %.50s » n'attend pas d'argument\n"
+
+#: src/argparse.c:537
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Utilisation : %s GPG-ERROR [...]\n"
+msgid "invalid command \"%.50s\"\n"
+msgstr "commande « %.50s » incorrecte\n"
 
-#: src/gpg-error.c:633
+#: src/argparse.c:539
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s : attention : impossible de reconnaître %s\n"
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr "l'option « %.50s » est ambiguë\n"
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr "la commande « %.50s » est ambiguë\n"
+
+#: src/argparse.c:555
+#, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr "option « %.50s » incorrecte\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr ""
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr ""
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "attention : impossible de reconnaître %s\n"
+
+#~ msgid "out of core\n"
+#~ msgstr "hors limite\n"
+
+#~ msgid "Usage: %s GPG-ERROR [...]\n"
+#~ msgstr "Utilisation : %s GPG-ERROR [...]\n"
 
 #, fuzzy
 #~| msgid "Resources exhausted"
index 4b97b25..edc28b4 100644 (file)
Binary files a/po/hu.gmo and b/po/hu.gmo differ
index 03a5a0c..76126a4 100644 (file)
--- a/po/hu.po
+++ b/po/hu.po
@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libgpg-error-1.7\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2015-01-09 10:00+0100\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:26+0100\n"
 "Last-Translator: Balázs Úr <urbalazs@gmail.com>\n"
 "Language-Team: Hungarian <translation-team-hu@lists.sourceforge.net>\n"
 "Language: hu\n"
@@ -76,37 +76,41 @@ msgstr "Kleopatra"
 
 #: src/err-sources.h:42
 msgid "G13"
-msgstr ""
+msgstr "G13"
 
 #: src/err-sources.h:43
 msgid "Assuan"
-msgstr ""
+msgstr "Assuan"
 
 #: src/err-sources.h:44
-msgid "TLS"
-msgstr ""
+msgid "TPM2d"
+msgstr "TPM2d"
 
 #: src/err-sources.h:45
+msgid "TLS"
+msgstr "TLS"
+
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "Bármilyen forrás"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "1. felhasználó által megadott forrás"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "2. felhasználó által megadott forrás"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "3. felhasználó által megadott forrás"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "4. felhasználó által megadott forrás"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Ismeretlen forrás"
 
@@ -1363,576 +1367,870 @@ msgid "Wrong name"
 msgstr "Ismeretlen név"
 
 #: src/err-codes.h:320
+#, fuzzy
+#| msgid "Not locked"
+msgid "Not authenticated"
+msgstr "Nincs zárolva"
+
+#: src/err-codes.h:321
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Bad authentication"
+msgstr "Nem támogatott védelem"
+
+#: src/err-codes.h:322
+#, fuzzy
+#| msgid "No agent running"
+msgid "No Keybox daemon running"
+msgstr "Nincs futó ügynök"
+
+#: src/err-codes.h:323
+#, fuzzy
+#| msgid "SmartCard daemon error"
+msgid "Keybox daemon error"
+msgstr "SmartCard démon hiba"
+
+#: src/err-codes.h:324
+msgid "Service is not running"
+msgstr ""
+
+#: src/err-codes.h:325
+#, fuzzy
+#| msgid "Keyserver error"
+msgid "Service error"
+msgstr "Kulcskiszolgáló hiba"
+
+#: src/err-codes.h:326
 msgid "System bug detected"
 msgstr ""
 
-#: src/err-codes.h:321
+#: src/err-codes.h:327
 #, fuzzy
 #| msgid "Unknown system error"
 msgid "Unknown DNS error"
 msgstr "Ismeretlen rendszerhiba"
 
-#: src/err-codes.h:322
+#: src/err-codes.h:328
 #, fuzzy
 #| msgid "Invalid OID string"
 msgid "Invalid DNS section"
 msgstr "Érvénytelen OID karakterlánc"
 
-#: src/err-codes.h:323
+#: src/err-codes.h:329
 #, fuzzy
 #| msgid "Invalid S-expression"
 msgid "Invalid textual address form"
 msgstr "Érvénytelen S-kifejezés"
 
-#: src/err-codes.h:324
+#: src/err-codes.h:330
 #, fuzzy
 #| msgid "Missing certificate"
 msgid "Missing DNS query packet"
 msgstr "Hiányzó tanúsítvány"
 
-#: src/err-codes.h:325
+#: src/err-codes.h:331
 msgid "Missing DNS answer packet"
 msgstr ""
 
-#: src/err-codes.h:326
+#: src/err-codes.h:332
 msgid "Connection closed in DNS"
 msgstr ""
 
-#: src/err-codes.h:327
+#: src/err-codes.h:333
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "Verification failed in DNS"
 msgstr "Visszafejtés sikertelen"
 
-#: src/err-codes.h:328
+#: src/err-codes.h:334
 #, fuzzy
 #| msgid "Timeout"
 msgid "DNS Timeout"
 msgstr "Időtúllépés"
 
-#: src/err-codes.h:329
+#: src/err-codes.h:335
 #, fuzzy
 #| msgid "General IPC error"
 msgid "General LDAP error"
 msgstr "Általános IPC hiba"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP attribute error"
 msgstr "Általános hiba"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP name error"
 msgstr "Általános hiba"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP security error"
 msgstr "Általános Assuan hiba"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP service error"
 msgstr "Általános hiba"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP update error"
 msgstr "Általános Assuan hiba"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr ""
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 #, fuzzy
 #| msgid "IPC write error"
 msgid "Private LDAP error code"
 msgstr "IPC írási hiba"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other general LDAP error"
 msgstr "Általános IPC hiba"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 #, fuzzy
 #| msgid "IPC connect call failed"
 msgid "LDAP connecting failed (X)"
 msgstr "Az IPC kapcsolódási hívás meghiúsult"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral limit exceeded"
 msgstr "Általános hiba"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr ""
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 #, fuzzy
 #| msgid "Card reset required"
 msgid "No LDAP results returned"
 msgstr "Kártya visszaállítás szükséges"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 #, fuzzy
 #| msgid "Element not found"
 msgid "LDAP control not found"
 msgstr "Az elem nem található"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 #, fuzzy
 #| msgid "Not supported"
 msgid "Not supported by LDAP"
 msgstr "Nem támogatott"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 #, fuzzy
 #| msgid "Unexpected error"
 msgid "LDAP connect error"
 msgstr "Váratlan hiba"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr ""
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr ""
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 #, fuzzy
 #| msgid "Unsupported operation"
 msgid "User cancelled LDAP operation"
 msgstr "Nem támogatott művelet"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 #, fuzzy
 #| msgid "Bad certificate"
 msgid "Bad LDAP search filter"
 msgstr "Rossz tanúsítvány"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "Unknown LDAP authentication method"
 msgstr "Ismeretlen kiterjesztés"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 #, fuzzy
 #| msgid "Timeout"
 msgid "Timeout in LDAP"
 msgstr "Időtúllépés"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP decoding error"
 msgstr "dirmngr hiba"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP encoding error"
 msgstr "dirmngr hiba"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 #, fuzzy
 #| msgid "IPC read error"
 msgid "LDAP local error"
 msgstr "IPC olvasási hiba"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot contact LDAP server"
 msgstr "Nem IPC kiszolgáló"
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP success"
 msgstr "Sikeres"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 #, fuzzy
 #| msgid "Configuration error"
 msgid "LDAP operations error"
 msgstr "Beállítási hiba"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP protocol error"
 msgstr "Protokollsértés"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr ""
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr ""
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "LDAP authentication method not supported"
 msgstr "Ismeretlen kiterjesztés"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
 msgstr ""
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 msgid "Partial LDAP results+referral received"
 msgstr ""
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral"
 msgstr "Általános hiba"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr ""
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr ""
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Confidentiality required by LDAP"
 msgstr "Kártya visszaállítás szükséges"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr ""
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr ""
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 #, fuzzy
 #| msgid "Invalid attribute"
 msgid "Undefined LDAP attribute type"
 msgstr "Érvénytelen attribútum"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate matching in LDAP"
 msgstr "Nem támogatott védelem"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Constraint violation in LDAP"
 msgstr "Protokollsértés"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr ""
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid syntax in LDAP"
 msgstr "Érvénytelen állapot"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 #, fuzzy
 #| msgid "No CMS object"
 msgid "No such LDAP object"
 msgstr "Nincs CMS objektum"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 #, fuzzy
 #| msgid "Hardware problem"
 msgid "LDAP alias problem"
 msgstr "Hardverprobléma"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid DN syntax in LDAP"
 msgstr "Érvénytelen állapot"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr ""
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 #, fuzzy
 #| msgid "Encoding problem"
 msgid "LDAP alias dereferencing problem"
 msgstr "Kódolási probléma"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr ""
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate LDAP authentication"
 msgstr "Nem támogatott védelem"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 #, fuzzy
 #| msgid "Invalid card"
 msgid "Invalid LDAP credentials"
 msgstr "Érvénytelen kártya"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr ""
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr ""
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 msgid "LDAP server is unavailable"
 msgstr ""
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr ""
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr ""
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 #, fuzzy
 #| msgid "Missing action"
 msgid "LDAP naming violation"
 msgstr "Hiányzó művelet"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP object class violation"
 msgstr "Protokollsértés"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 #, fuzzy
 #| msgid "Operation not yet finished"
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "A művelet még nem fejeződött be"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation not allowed on RDN"
 msgstr "A művelet megszakítva"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr ""
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr ""
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 #, fuzzy
 #| msgid "Line too long"
 msgid "LDAP results too large"
 msgstr "Túl hosszú sor"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation affects multiple DSAs"
 msgstr "A művelet megszakítva"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr ""
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other LDAP error"
 msgstr "Általános IPC hiba"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 #, fuzzy
 #| msgid "Resources exhausted"
 msgid "Resources exhausted in LCUP"
 msgstr "Az erőforrások kimerültek"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Security violation in LCUP"
 msgstr "Protokollsértés"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid data in LCUP"
 msgstr "Érvénytelen állapot"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 #, fuzzy
 #| msgid "Unsupported certificate"
 msgid "Unsupported scheme in LCUP"
 msgstr "Nem támogatott tanúsítvány"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Reload required in LCUP"
 msgstr "Kártya visszaállítás szükséges"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP cancelled"
 msgstr "Sikeres"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 #, fuzzy
 #| msgid "Not operational"
 msgid "No LDAP operation to cancel"
 msgstr "Nem működik"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 #, fuzzy
 #| msgid "Not operational"
 msgid "Too late to cancel LDAP"
 msgstr "Nem működik"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot cancel LDAP"
 msgstr "Nem IPC kiszolgáló"
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "LDAP assertion failed"
 msgstr "Visszafejtés sikertelen"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr ""
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "1. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "2. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "3. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "4. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "5. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "6. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "7. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "8. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "9. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "10. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "11. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "12. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "13. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "14. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "15. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "16. felhasználó által megadott hibakód"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+#, fuzzy
+#| msgid "Success"
+msgid "SQL success"
+msgstr "Sikeres"
+
+#: src/err-codes.h:433
+#, fuzzy
+#| msgid "Syntax error"
+msgid "SQL error"
+msgstr "Szintaktikai hiba"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr ""
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr ""
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr ""
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr ""
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr ""
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr ""
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr ""
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr ""
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr ""
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr ""
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr ""
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr ""
+
+#: src/err-codes.h:447
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "SQL database lock protocol error"
+msgstr "Protokollsértés"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr ""
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr ""
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr ""
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr ""
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr ""
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr ""
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr ""
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr ""
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr ""
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr ""
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr ""
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr ""
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "Rendszerhiba w/o hibaszám"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Ismeretlen rendszerhiba"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Fájl vége"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Ismeretlen hibakód"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+#, fuzzy
+msgid "argument not expected"
+msgstr "Írom a titkos kulcsot a %s állományba.\n"
+
+#: src/argparse.c:496
+#, fuzzy
+msgid "read error"
+msgstr "állományolvasási hiba"
+
+#: src/argparse.c:498
+#, fuzzy
+msgid "keyword too long"
+msgstr "A sor túl hosszú!\n"
+
+#: src/argparse.c:500
+#, fuzzy
+msgid "missing argument"
+msgstr "érvénytelen argumentum"
+
+#: src/argparse.c:502
+#, fuzzy
+#| msgid "invalid armor"
+msgid "invalid argument"
+msgstr "érvénytelen páncél"
+
+#: src/argparse.c:504
+#, fuzzy
+msgid "invalid command"
+msgstr "Egymásnak ellentmondó parancsok!\n"
+
+#: src/argparse.c:506
+#, fuzzy
+msgid "invalid alias definition"
+msgstr "Érvénytelen import opciók!\n"
+
+#: src/argparse.c:508 src/argparse.c:545
+#, fuzzy
+#| msgid "Configuration error"
+msgid "permission error"
+msgstr "Beállítási hiba"
+
+#: src/argparse.c:510 src/argparse.c:543
+#, fuzzy
+msgid "out of core"
+msgstr "nem feldolgozott"
+
+#: src/argparse.c:514 src/argparse.c:549
+#, fuzzy
+msgid "invalid meta command"
+msgstr "Egymásnak ellentmondó parancsok!\n"
+
+#: src/argparse.c:516 src/argparse.c:551
+#, fuzzy
+#| msgid "Unknown command"
+msgid "unknown meta command"
+msgstr "Ismeretlen parancs"
+
+#: src/argparse.c:518 src/argparse.c:553
+#, fuzzy
+#| msgid "Unexpected IPC command"
+msgid "unexpected meta command"
+msgstr "Váratlan IPC parancs"
+
+#: src/argparse.c:520
+#, fuzzy
+msgid "invalid option"
+msgstr "Érvénytelen import opciók!\n"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:532
+#, fuzzy, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "Érvénytelen import opciók!\n"
+
+#: src/argparse.c:534
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Használat: %s GPG-ERROR […]\n"
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr ""
+
+#: src/argparse.c:537
+#, fuzzy, c-format
+msgid "invalid command \"%.50s\"\n"
+msgstr "Érvénytelen parancs! (Próbálja a súgót: \"help\".)\n"
 
-#: src/gpg-error.c:633
+#: src/argparse.c:539
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: figyelmeztetés: nem sikerült felismerni: %s\n"
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:555
+#, fuzzy, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr "Érvénytelen import opciók!\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr ""
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr ""
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "figyelmeztetés: nem sikerült felismerni: %s\n"
+
+#, fuzzy
+#~ msgid "out of core\n"
+#~ msgstr "nem feldolgozott"
+
+#~ msgid "Usage: %s GPG-ERROR [...]\n"
+#~ msgstr "Használat: %s GPG-ERROR […]\n"
 
 #, fuzzy
 #~| msgid "Resources exhausted"
index 7653cfb..a8b98bd 100644 (file)
Binary files a/po/it.gmo and b/po/it.gmo differ
index a7b24a1..34077dc 100644 (file)
--- a/po/it.po
+++ b/po/it.po
@@ -8,8 +8,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libgpg-error\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2014-11-17 09:06+0100\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:26+0100\n"
 "Last-Translator: Milo Casagrande <milo@milo.name>\n"
 "Language-Team: Italian <tp@lists.linux.it>\n"
 "Language: it\n"
@@ -82,30 +82,34 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
+msgid "TPM2d"
+msgstr "TPM2d"
+
+#: src/err-sources.h:45
 msgid "TLS"
 msgstr "TLS"
 
-#: src/err-sources.h:45
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "Qualsiasi fonte"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "Fonte 1 definita dall'utente"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "Fonte 2 definita dall'utente"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "Fonte 3 definita dall'utente"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "Fonte 4 definita dall'utente"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Fonte sconosciuta"
 
@@ -1302,580 +1306,876 @@ msgid "Wrong name"
 msgstr "Nome sconosciuto"
 
 #: src/err-codes.h:320
+#, fuzzy
+#| msgid "Not enabled"
+msgid "Not authenticated"
+msgstr "Disabilitato"
+
+#: src/err-codes.h:321
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Bad authentication"
+msgstr "Protezione non supportata"
+
+#: src/err-codes.h:322
+#, fuzzy
+#| msgid "No agent running"
+msgid "No Keybox daemon running"
+msgstr "Nessun agente in esecuzione"
+
+#: src/err-codes.h:323
+#, fuzzy
+#| msgid "SmartCard daemon error"
+msgid "Keybox daemon error"
+msgstr "Errore del demone della SmartCard"
+
+#: src/err-codes.h:324
+msgid "Service is not running"
+msgstr ""
+
+#: src/err-codes.h:325
+#, fuzzy
+#| msgid "Keyserver error"
+msgid "Service error"
+msgstr "Errore del server delle chiavi"
+
+#: src/err-codes.h:326
 msgid "System bug detected"
 msgstr ""
 
-#: src/err-codes.h:321
+#: src/err-codes.h:327
 #, fuzzy
 #| msgid "Unknown system error"
 msgid "Unknown DNS error"
 msgstr "Errore di sistema sconosciuto"
 
-#: src/err-codes.h:322
+#: src/err-codes.h:328
 #, fuzzy
 #| msgid "Invalid OID string"
 msgid "Invalid DNS section"
 msgstr "Testo per l'OID non valido"
 
-#: src/err-codes.h:323
+#: src/err-codes.h:329
 #, fuzzy
 #| msgid "Invalid S-expression"
 msgid "Invalid textual address form"
 msgstr "S-expression non valida"
 
-#: src/err-codes.h:324
+#: src/err-codes.h:330
 #, fuzzy
 #| msgid "Missing issuer certificate"
 msgid "Missing DNS query packet"
 msgstr "Manca il certificato dell'emittente"
 
-#: src/err-codes.h:325
+#: src/err-codes.h:331
 msgid "Missing DNS answer packet"
 msgstr ""
 
-#: src/err-codes.h:326
+#: src/err-codes.h:332
 msgid "Connection closed in DNS"
 msgstr ""
 
-#: src/err-codes.h:327
+#: src/err-codes.h:333
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "Verification failed in DNS"
 msgstr "Decifratura non riuscita"
 
-#: src/err-codes.h:328
+#: src/err-codes.h:334
 #, fuzzy
 #| msgid "Timeout"
 msgid "DNS Timeout"
 msgstr "Tempo scaduto"
 
-#: src/err-codes.h:329
+#: src/err-codes.h:335
 #, fuzzy
 #| msgid "General IPC error"
 msgid "General LDAP error"
 msgstr "Errore IPC generale"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP attribute error"
 msgstr "Errore generale"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP name error"
 msgstr "Errore generale"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP security error"
 msgstr "Errore generale per Assuan"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP service error"
 msgstr "Errore generale"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP update error"
 msgstr "Errore generale per Assuan"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr ""
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 #, fuzzy
 #| msgid "IPC write error"
 msgid "Private LDAP error code"
 msgstr "Errore di scrittura IPC"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other general LDAP error"
 msgstr "Errore IPC generale"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 #, fuzzy
 #| msgid "IPC connect call failed"
 msgid "LDAP connecting failed (X)"
 msgstr "Chiamata \"connect\" IPC non riuscita"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral limit exceeded"
 msgstr "Errore generale"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr ""
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 #, fuzzy
 #| msgid "Card reset required"
 msgid "No LDAP results returned"
 msgstr "È richiesto il riavvio della scheda"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 #, fuzzy
 #| msgid "Element not found"
 msgid "LDAP control not found"
 msgstr "Elemento non trovato"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 #, fuzzy
 #| msgid "Not supported"
 msgid "Not supported by LDAP"
 msgstr "Non supportato"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 #, fuzzy
 #| msgid "Unexpected error"
 msgid "LDAP connect error"
 msgstr "Errore inaspettato"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr ""
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr ""
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 #, fuzzy
 #| msgid "Unsupported operation"
 msgid "User cancelled LDAP operation"
 msgstr "Operazione non supportata"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 #, fuzzy
 #| msgid "Bad certificate"
 msgid "Bad LDAP search filter"
 msgstr "Certificato errato"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "Unknown LDAP authentication method"
 msgstr "Estensione sconosciuta"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 #, fuzzy
 #| msgid "Timeout"
 msgid "Timeout in LDAP"
 msgstr "Tempo scaduto"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP decoding error"
 msgstr "Errore di dirmngr"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP encoding error"
 msgstr "Errore di dirmngr"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 #, fuzzy
 #| msgid "IPC read error"
 msgid "LDAP local error"
 msgstr "Errore di lettura IPC"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot contact LDAP server"
 msgstr "Non è un server IPC"
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP success"
 msgstr "Eseguito"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 #, fuzzy
 #| msgid "Configuration error"
 msgid "LDAP operations error"
 msgstr "Errore di configurazione"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP protocol error"
 msgstr "Violazione del protocollo"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr ""
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr ""
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "LDAP authentication method not supported"
 msgstr "Estensione sconosciuta"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
 msgstr ""
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 #, fuzzy
 #| msgid "Fatal alert message received"
 msgid "Partial LDAP results+referral received"
 msgstr "Ricevuto un messaggio di avviso fatale"
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral"
 msgstr "Errore generale"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr ""
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr ""
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Confidentiality required by LDAP"
 msgstr "È richiesto il riavvio della scheda"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr ""
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr ""
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 #, fuzzy
 #| msgid "Invalid attribute"
 msgid "Undefined LDAP attribute type"
 msgstr "Attributo non valido"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate matching in LDAP"
 msgstr "Protezione non supportata"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Constraint violation in LDAP"
 msgstr "Violazione del protocollo"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr ""
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid syntax in LDAP"
 msgstr "Stato non valido"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 #, fuzzy
 #| msgid "No CMS object"
 msgid "No such LDAP object"
 msgstr "Non esiste alcun oggetto CMS"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 #, fuzzy
 #| msgid "Hardware problem"
 msgid "LDAP alias problem"
 msgstr "Problema hardware"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid DN syntax in LDAP"
 msgstr "Stato non valido"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr ""
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 #, fuzzy
 #| msgid "Encoding problem"
 msgid "LDAP alias dereferencing problem"
 msgstr "Problema nella codifica"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr ""
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate LDAP authentication"
 msgstr "Protezione non supportata"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 #, fuzzy
 #| msgid "Invalid card"
 msgid "Invalid LDAP credentials"
 msgstr "Scheda non valida"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr ""
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr ""
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 #, fuzzy
 #| msgid "No keyserver available"
 msgid "LDAP server is unavailable"
 msgstr "Nessun server di chiavi disponibile"
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr ""
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr ""
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 #, fuzzy
 #| msgid "Missing action"
 msgid "LDAP naming violation"
 msgstr "Azione mancante"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP object class violation"
 msgstr "Violazione del protocollo"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 #, fuzzy
 #| msgid "Operation not yet finished"
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "Operazione non ancora terminata"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation not allowed on RDN"
 msgstr "Operazione annullata"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr ""
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr ""
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 #, fuzzy
 #| msgid "Line too long"
 msgid "LDAP results too large"
 msgstr "Riga troppo lunga"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation affects multiple DSAs"
 msgstr "Operazione annullata"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr ""
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other LDAP error"
 msgstr "Errore IPC generale"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 #, fuzzy
 #| msgid "Resources exhausted"
 msgid "Resources exhausted in LCUP"
 msgstr "Risorse esaurite"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Security violation in LCUP"
 msgstr "Violazione del protocollo"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid data in LCUP"
 msgstr "Stato non valido"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 #, fuzzy
 #| msgid "Unsupported certificate"
 msgid "Unsupported scheme in LCUP"
 msgstr "Certificato non supportato"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Reload required in LCUP"
 msgstr "È richiesto il riavvio della scheda"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP cancelled"
 msgstr "Eseguito"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 #, fuzzy
 #| msgid "Not operational"
 msgid "No LDAP operation to cancel"
 msgstr "Non è in funzione"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 #, fuzzy
 #| msgid "Not operational"
 msgid "Too late to cancel LDAP"
 msgstr "Non è in funzione"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot cancel LDAP"
 msgstr "Non è un server IPC"
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "LDAP assertion failed"
 msgstr "Decifratura non riuscita"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr ""
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "Codice errore 1 definito dall'utente"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "Codice errore 2 definito dall'utente"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "Codice errore 3 definito dall'utente"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "Codice errore 4 definito dall'utente"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "Codice errore 5 definito dall'utente"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "Codice errore 6 definito dall'utente"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "Codice errore 7 definito dall'utente"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "Codice errore 8 definito dall'utente"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "Codice errore 9 definito dall'utente"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "Codice errore 10 definito dall'utente"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "Codice errore 11 definito dall'utente"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "Codice errore 12 definito dall'utente"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "Codice errore 13 definito dall'utente"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "Codice errore 14 definito dall'utente"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "Codice errore 15 definito dall'utente"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "Codice errore 16 definito dall'utente"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+#, fuzzy
+#| msgid "Success"
+msgid "SQL success"
+msgstr "Eseguito"
+
+#: src/err-codes.h:433
+#, fuzzy
+#| msgid "Syntax error"
+msgid "SQL error"
+msgstr "Errore di sintassi"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr ""
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr ""
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr ""
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr ""
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr ""
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr ""
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr ""
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr ""
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr ""
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr ""
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr ""
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr ""
+
+#: src/err-codes.h:447
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "SQL database lock protocol error"
+msgstr "Violazione del protocollo"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr ""
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr ""
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr ""
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr ""
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr ""
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr ""
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr ""
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr ""
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr ""
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr ""
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr ""
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr ""
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "Errore di sistema senza errno"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Errore di sistema sconosciuto"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Fine del file"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Codice di errore sconosciuto"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+#, fuzzy
+msgid "argument not expected"
+msgstr "scrittura della chiave segreta in `%s'\n"
+
+#: src/argparse.c:496
+#, fuzzy
+msgid "read error"
+msgstr "errore durante la lettura del file"
+
+#: src/argparse.c:498
+#, fuzzy
+msgid "keyword too long"
+msgstr "riga troppo lunga\n"
+
+#: src/argparse.c:500
+#, fuzzy
+msgid "missing argument"
+msgstr "argomento non valido"
+
+#: src/argparse.c:502
+#, fuzzy
+#| msgid "invalid armor"
+msgid "invalid argument"
+msgstr "armatura non valida"
+
+#: src/argparse.c:504
+#, fuzzy
+msgid "invalid command"
+msgstr "comandi in conflitto\n"
+
+#: src/argparse.c:506
+#, fuzzy
+msgid "invalid alias definition"
+msgstr "opzioni di importazione non valide\n"
+
+#: src/argparse.c:508 src/argparse.c:545
+#, fuzzy
+#| msgid "Configuration error"
+msgid "permission error"
+msgstr "Errore di configurazione"
+
+# ??? (Md)
+#: src/argparse.c:510 src/argparse.c:543
+#, fuzzy
+msgid "out of core"
+msgstr "non esaminato"
+
+#: src/argparse.c:514 src/argparse.c:549
+#, fuzzy
+msgid "invalid meta command"
+msgstr "comandi in conflitto\n"
+
+#: src/argparse.c:516 src/argparse.c:551
+#, fuzzy
+#| msgid "Unknown command"
+msgid "unknown meta command"
+msgstr "Comando sconosciuto"
+
+#: src/argparse.c:518 src/argparse.c:553
+#, fuzzy
+#| msgid "Unexpected IPC command"
+msgid "unexpected meta command"
+msgstr "Comando IPC inaspettato"
+
+#: src/argparse.c:520
+#, fuzzy
+msgid "invalid option"
+msgstr "opzioni di importazione non valide\n"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:532
+#, fuzzy, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "opzioni di importazione non valide\n"
+
+#: src/argparse.c:534
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Uso: %s GPG-ERROR [...]\n"
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr ""
+
+#: src/argparse.c:537
+#, fuzzy, c-format
+msgid "invalid command \"%.50s\"\n"
+msgstr "Comando non valido  (prova \"help\")\n"
 
-#: src/gpg-error.c:633
+#: src/argparse.c:539
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: avviso: impossibile riconoscere %s\n"
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:555
+#, fuzzy, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr "opzioni di importazione non valide\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr ""
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr ""
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "avviso: impossibile riconoscere %s\n"
+
+# ??? (Md)
+#, fuzzy
+#~ msgid "out of core\n"
+#~ msgstr "non esaminato"
+
+#~ msgid "Usage: %s GPG-ERROR [...]\n"
+#~ msgstr "Uso: %s GPG-ERROR [...]\n"
 
 #, fuzzy
 #~| msgid "Resources exhausted"
index 6921498..53242d6 100644 (file)
Binary files a/po/ja.gmo and b/po/ja.gmo differ
index 1b9d9dd..2dbac29 100644 (file)
--- a/po/ja.po
+++ b/po/ja.po
@@ -3,13 +3,13 @@
 # This file is distributed under the same license as the libgpg-error package.
 # Yasuaki Taniguchi <yasuakit@gmail.com>, 2010.
 # Takeshi Hamasaki <hmatrjp@users.sourceforge.jp>, 2012.
-# NIIBE Yutaka <gniibe@fsij.org>, 2014, 2015, 2016.
+# NIIBE Yutaka <gniibe@fsij.org>, 2014, 2015, 2016, 2017, 2019, 2020.
 msgid ""
 msgstr ""
-"Project-Id-Version: libgpg-error 1.26\n"
+"Project-Id-Version: libgpg-error 1.39\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2016-12-22 08:12+0900\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:26+0100\n"
 "Last-Translator: NIIBE Yutaka <gniibe@fsij.org>\n"
 "Language-Team: none\n"
 "Language: ja\n"
@@ -83,30 +83,34 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
+msgid "TPM2d"
+msgstr "TPM2d"
+
+#: src/err-sources.h:45
 msgid "TLS"
 msgstr "TLS"
 
-#: src/err-sources.h:45
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "指定なしのソース"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "ユーザ定義ソース 1"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "ユーザ定義ソース 2"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "ユーザ定義ソース 3"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "ユーザ定義ソース 4"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "不明なソース"
 
@@ -164,7 +168,7 @@ msgstr "無効な暗号アルゴリズムです"
 
 #: src/err-codes.h:41
 msgid "Cannot open keyring"
-msgstr ""
+msgstr "鍵リングが開けません"
 
 #: src/err-codes.h:42
 msgid "Invalid packet"
@@ -884,7 +888,7 @@ msgstr "誤った暗号コンテクストです"
 
 #: src/err-codes.h:221
 msgid "Bad crypto context"
-msgstr "間違ったな暗号コンテクストです"
+msgstr "誤った暗号コンテクストです"
 
 #: src/err-codes.h:222
 msgid "Conflict in the crypto context"
@@ -968,7 +972,7 @@ msgstr "S式に間違った8進キャラクタがあります"
 
 #: src/err-codes.h:242
 msgid "All subkeys are expired or revoked"
-msgstr ""
+msgstr "すべての副鍵が期限切れか失効しています"
 
 #: src/err-codes.h:243
 msgid "Database is corrupted"
@@ -1223,540 +1227,770 @@ msgid "Unknown IPC inquire"
 msgstr "不明なIPC問い合わせです"
 
 #: src/err-codes.h:306
-#, fuzzy
-#| msgid "No crypto engine"
 msgid "Crypto engine too old"
-msgstr "暗号エンジンがありません"
+msgstr "暗号エンジンが古すぎます"
 
 #: src/err-codes.h:307
 msgid "Screen or window too small"
-msgstr ""
+msgstr "スクリーンまたはウィンドウが小さすぎます"
 
 #: src/err-codes.h:308
 msgid "Screen or window too large"
-msgstr ""
+msgstr "スクリーンまたはウィンドウが大きすぎます"
 
 #: src/err-codes.h:309
 msgid "Required environment variable not set"
-msgstr ""
+msgstr "必要な環境変数が設定されていません"
 
 #: src/err-codes.h:310
-#, fuzzy
-#| msgid "Already exists (LDAP)"
 msgid "User ID already exists"
-msgstr "既に存在します (LDAP)"
+msgstr "User IDが既に存在します"
 
 #: src/err-codes.h:311
-#, fuzzy
-#| msgid "Already exists (LDAP)"
 msgid "Name already exists"
-msgstr "既に存在します (LDAP)"
+msgstr "名前が既に存在します"
 
 #: src/err-codes.h:312
-#, fuzzy
-#| msgid "Duplicated value"
 msgid "Duplicated name"
-msgstr "é\87\8dè¤\87ã\81\97ã\81\9få\80¤です"
+msgstr "é\87\8dè¤\87ã\81\97ã\81\9få\90\8då\89\8dです"
 
 #: src/err-codes.h:313
-#, fuzzy
-#| msgid "Certificate too young"
 msgid "Object is too young"
-msgstr "証明書が若すぎます"
+msgstr "オブジェクトが若すぎます"
 
 #: src/err-codes.h:314
-#, fuzzy
-#| msgid "Provided object is too short"
 msgid "Object is too old"
-msgstr "与えられたオブジェクトが小さすぎます"
+msgstr "オブジェクトが古すぎます"
 
 #: src/err-codes.h:315
-#, fuzzy
-#| msgid "Unknown name"
 msgid "Unknown flag"
-msgstr "不明な名前です"
+msgstr "不明なフラグです"
 
 #: src/err-codes.h:316
-#, fuzzy
-#| msgid "Invalid operation code"
 msgid "Invalid execution order"
-msgstr "無効な操作コードです"
+msgstr "無効な実効順です"
 
 #: src/err-codes.h:317
 msgid "Already fetched"
-msgstr ""
+msgstr "すでにフェッチされてます"
 
 #: src/err-codes.h:318
 msgid "Try again later"
-msgstr ""
+msgstr "後で再度試してください"
 
 #: src/err-codes.h:319
-#, fuzzy
-#| msgid "No name"
 msgid "Wrong name"
-msgstr "名前がありません"
+msgstr "間違った名前です"
 
 #: src/err-codes.h:320
-msgid "System bug detected"
-msgstr ""
+msgid "Not authenticated"
+msgstr "認証されてません"
 
 #: src/err-codes.h:321
-#, fuzzy
-#| msgid "Unknown system error"
-msgid "Unknown DNS error"
-msgstr "不明なシステムエラー"
+msgid "Bad authentication"
+msgstr "誤った認証です"
 
 #: src/err-codes.h:322
-#, fuzzy
-#| msgid "Invalid OID string"
-msgid "Invalid DNS section"
-msgstr "無効な OID 文字列です"
+msgid "No Keybox daemon running"
+msgstr "Keyboxデーモンが動いていません"
 
 #: src/err-codes.h:323
-#, fuzzy
-#| msgid "Invalid S-expression"
-msgid "Invalid textual address form"
-msgstr "無効な S-式です"
+msgid "Keybox daemon error"
+msgstr "Keyboxデーモンエラーです"
 
 #: src/err-codes.h:324
-#, fuzzy
-#| msgid "Missing issuer certificate"
-msgid "Missing DNS query packet"
-msgstr "発行元証明書がありません"
+msgid "Service is not running"
+msgstr "サービスが動いていません"
 
 #: src/err-codes.h:325
-msgid "Missing DNS answer packet"
-msgstr ""
+msgid "Service error"
+msgstr "サービスエラーです"
 
 #: src/err-codes.h:326
-msgid "Connection closed in DNS"
-msgstr ""
+msgid "System bug detected"
+msgstr "システムのバグが検出されました"
 
 #: src/err-codes.h:327
-#, fuzzy
-#| msgid "Decryption failed"
-msgid "Verification failed in DNS"
-msgstr "復号に失敗しました"
+msgid "Unknown DNS error"
+msgstr "不明なDNSエラー"
 
 #: src/err-codes.h:328
-#, fuzzy
-#| msgid "Timeout"
-msgid "DNS Timeout"
-msgstr "タイムアウトです"
+msgid "Invalid DNS section"
+msgstr "無効な DNS セクションです"
 
 #: src/err-codes.h:329
+msgid "Invalid textual address form"
+msgstr "無効なテクストのアドレス形式です"
+
+#: src/err-codes.h:330
+msgid "Missing DNS query packet"
+msgstr "DNSクエリのパケットがありません"
+
+#: src/err-codes.h:331
+msgid "Missing DNS answer packet"
+msgstr "DNSの返答パケットが欠如しています"
+
+#: src/err-codes.h:332
+msgid "Connection closed in DNS"
+msgstr "DNSの接続が閉じられました"
+
+#: src/err-codes.h:333
+msgid "Verification failed in DNS"
+msgstr "DNSで検証に失敗しました"
+
+#: src/err-codes.h:334
+msgid "DNS Timeout"
+msgstr "DNSタイムアウトです"
+
+#: src/err-codes.h:335
 msgid "General LDAP error"
 msgstr "一般LDAPエラーです"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 msgid "General LDAP attribute error"
 msgstr "一般LDAP属性エラーです"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 msgid "General LDAP name error"
 msgstr "一般LDAPエラーです"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 msgid "General LDAP security error"
 msgstr "一般Assuanエラーです"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 msgid "General LDAP service error"
 msgstr "一般LDAPサーバエラーです"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 msgid "General LDAP update error"
 msgstr "一般LDAP更新エラーです"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr "実験的LDAPエラーコード"
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 msgid "Private LDAP error code"
 msgstr "プライベートLDAPエラーコード"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 msgid "Other general LDAP error"
 msgstr "その他の一般LDAPエラーです"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 msgid "LDAP connecting failed (X)"
 msgstr "LDAP接続が失敗しました (X)"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 msgid "LDAP referral limit exceeded"
 msgstr "LDAP参照制限を越えました"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr "LDAPクライアントのループ"
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 msgid "No LDAP results returned"
 msgstr "LDAPの結果が返されませんでした"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 msgid "LDAP control not found"
 msgstr "LDAP制御が見つかりませんでした"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 msgid "Not supported by LDAP"
 msgstr "LDAPでサポートされていません"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 msgid "LDAP connect error"
 msgstr "LDAP connectエラーです"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr "LDAPでメモリがなくなりました"
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr "LDAPルーチンに対する不正なパラメータです"
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 msgid "User cancelled LDAP operation"
 msgstr "ユーザがLDAP操作をキャンセルしました"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 msgid "Bad LDAP search filter"
 msgstr "誤ったLDAP検索フィルタです"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 msgid "Unknown LDAP authentication method"
 msgstr "不明のLDAP認証方式です"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 msgid "Timeout in LDAP"
 msgstr "LDAPでタイムアウトです"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 msgid "LDAP decoding error"
 msgstr "LDAPデコードのエラー"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 msgid "LDAP encoding error"
 msgstr "LDAPエンコードのエラー"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 msgid "LDAP local error"
 msgstr "LDAPローカルエラー"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 msgid "Cannot contact LDAP server"
 msgstr "LDAPサーバに連絡できません"
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 msgid "LDAP success"
 msgstr "LDAP成功です"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 msgid "LDAP operations error"
 msgstr "LDAP操作エラーです"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 msgid "LDAP protocol error"
-msgstr "LDAPプロトコル違反"
+msgstr "LDAPプロトコルエラー"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr "LDAPで時間制限を越えました"
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr "LDAPでサイズ制限を越えました"
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr "LDAP比較 偽"
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr "LDAP比較 真"
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 msgid "LDAP authentication method not supported"
 msgstr "LDAP認証方式はサポートされません"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
 msgstr "強いLDAP認証が必要です"
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 msgid "Partial LDAP results+referral received"
 msgstr "部分的LDAP結果/参照を受信しました"
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 msgid "LDAP referral"
 msgstr "LDAP参照"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr "管理LDAP制限を越えました"
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr "クリティカルなLDAP拡張が利用可能ではありません"
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 msgid "Confidentiality required by LDAP"
 msgstr "LDAPにより秘匿性が必要です"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr "LDAP SASLバインドが進んでいます"
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr "そのようなLDAP属性がありません"
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 msgid "Undefined LDAP attribute type"
 msgstr "未定義のLDAP属性型です"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 msgid "Inappropriate matching in LDAP"
 msgstr "LDAPの不適切なマッチングです"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 msgid "Constraint violation in LDAP"
 msgstr "LDAP制約違反です"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr "LDAP型あるいは値が存在します"
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 msgid "Invalid syntax in LDAP"
 msgstr "LDAPの無効な構文です"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 msgid "No such LDAP object"
 msgstr "そのようなLDAPオブジェクトはありません"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 msgid "LDAP alias problem"
 msgstr "LDAPエイリアスの問題です"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 msgid "Invalid DN syntax in LDAP"
 msgstr "LDAPの無効なDN構文状態です"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr "LDAPエントリがリーフです"
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 msgid "LDAP alias dereferencing problem"
 msgstr "LDAPエイリアスのデレファレンス問題です"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr "LDAPプロキシの認証失敗です(X)"
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 msgid "Inappropriate LDAP authentication"
 msgstr "不適切なLDAP認証です"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 msgid "Invalid LDAP credentials"
 msgstr "無効なLDAPクレデンシャルです"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr "LDAPの不十分なアクセスです"
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr "LDAPサーバがビジーです"
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 msgid "LDAP server is unavailable"
 msgstr "LDAPサーバが利用可能ではありません"
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr "LDAPサーバが実行を進めたくありません"
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr "LDAPでループが検出されました"
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 msgid "LDAP naming violation"
 msgstr "LDAP名前違反です"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 msgid "LDAP object class violation"
 msgstr "LDAPオブジェクトクラス違反です"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "LDAP操作は非リーフには許されません"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 msgid "LDAP operation not allowed on RDN"
 msgstr "LDAP操作はRDNには許されません"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr "既に存在します (LDAP)"
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr "LDAPオブジェクト・クラスを修正できません"
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 msgid "LDAP results too large"
 msgstr "LDAP結果が大きすぎます"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 msgid "LDAP operation affects multiple DSAs"
 msgstr "LDAP操作は複数のDSAに関与します"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr "バーチャルLDAPリストviewエラー"
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 msgid "Other LDAP error"
 msgstr "その他のLDAPエラーです"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 msgid "Resources exhausted in LCUP"
 msgstr "LCUPで資源を使い果たしました"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 msgid "Security violation in LCUP"
 msgstr "LCUPのセキュリティ違反"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 msgid "Invalid data in LCUP"
 msgstr "LCUPの無効なデータです"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 msgid "Unsupported scheme in LCUP"
 msgstr "LCUPのサポートされていないスキームです"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 msgid "Reload required in LCUP"
 msgstr "LCUPでリロードが必要です"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 msgid "LDAP cancelled"
 msgstr "LDAPがキャンセルされました"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 msgid "No LDAP operation to cancel"
 msgstr "キャンセルするLDAP操作がありません"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 msgid "Too late to cancel LDAP"
 msgstr "LDAPをキャンセルするには遅すぎます"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 msgid "Cannot cancel LDAP"
 msgstr "LDAPをキャンセルできません"
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 msgid "LDAP assertion failed"
 msgstr "LDAPアサーションに失敗しました"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr "LDAPでプロキシの認証が拒否されました"
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "ユーザ定義エラーコード 1"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "ユーザ定義エラーコード 2"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "ユーザ定義エラーコード 3"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "ユーザ定義エラーコード 4"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "ユーザ定義エラーコード 5"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "ユーザ定義エラーコード 6"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "ユーザ定義エラーコード 7"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "ユーザ定義エラーコード 8"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "ユーザ定義エラーコード 9"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "ユーザ定義エラーコード 10"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "ユーザ定義エラーコード 11"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "ユーザ定義エラーコード 12"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "ユーザ定義エラーコード 13"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "ユーザ定義エラーコード 14"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "ユーザ定義エラーコード 15"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "ユーザ定義エラーコード 16"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+msgid "SQL success"
+msgstr "SQL 成功です"
+
+#: src/err-codes.h:433
+msgid "SQL error"
+msgstr "SQLエラーです"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr "SQLライブラリの内部論理エラー"
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr "アクセス許可が拒否されました (SQL)"
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr "SQL中止が要求されました"
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr "SQLデータベースがロックされています"
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr "データベースでSQLテーブルがロックされています"
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr "SQLライブラリがコアを使い果たしました"
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr "読み出しのみのSQLデータベースに書き込もうとしました"
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr "割り込みでSQL操作が終了しました"
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr "SQL操作中にI/Oエラー"
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr "SQLデータベースのディスクイメージが壊れています"
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr "SQLファイルコントロールに不明のオペコードです"
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr "SQLデータベースがいっぱいで挿入が失敗しました"
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr "SQLデータベースをオープンできません"
+
+#: src/err-codes.h:447
+msgid "SQL database lock protocol error"
+msgstr "SQLデータベース・ロック・プロトコルエラー"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr "(内部SQLコード: empty)"
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr "SQLデータベースのスキーマが変更されました"
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr "文字列かブロブがサイズ上限を超えました (SQL)"
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr "制約の違反のため SQL 中止です"
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr "データ型の不一致 (SQL)"
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr "SQLライブラリが誤って使われました"
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr "SQLライブラリがサポートされていないOSの機能を使います"
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr "認証が拒否されました (SQL)"
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr "(使われていないSQLコード: format)"
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr "SQLのバインド・パラメータが範囲外です"
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr "SQLデータベース・ファイルではないファイルがオープンされました"
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr "SQLロガーからの通知"
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr "SQLロガーからの警告"
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr "SQLで別の行が準備できています"
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr "SQL実行が終わりました"
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "errno が無いシステムエラー"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "不明なシステムエラー"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "ファイル終端"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "不明なエラーコード"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+msgid "argument not expected"
+msgstr "引数は期待されていません"
+
+#: src/argparse.c:496
+msgid "read error"
+msgstr "読み込みエラー"
+
+#: src/argparse.c:498
+msgid "keyword too long"
+msgstr "キーワードが長すぎます"
+
+#: src/argparse.c:500
+msgid "missing argument"
+msgstr "引数がありません"
+
+#: src/argparse.c:502
+msgid "invalid argument"
+msgstr "無効な引数"
+
+#: src/argparse.c:504
+msgid "invalid command"
+msgstr "無効なコマンド"
+
+#: src/argparse.c:506
+msgid "invalid alias definition"
+msgstr "無効なエイリアス定義です"
+
+#: src/argparse.c:508 src/argparse.c:545
+msgid "permission error"
+msgstr "許可エラーです"
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr "メモリがありません"
+
+#: src/argparse.c:514 src/argparse.c:549
+msgid "invalid meta command"
+msgstr "無効なメタコマンド"
+
+#: src/argparse.c:516 src/argparse.c:551
+msgid "unknown meta command"
+msgstr "未知のメタコマンドです"
+
+#: src/argparse.c:518 src/argparse.c:553
+msgid "unexpected meta command"
+msgstr "予期しないメタコマンドです"
+
+#: src/argparse.c:520
+msgid "invalid option"
+msgstr "無効なオプション"
+
+#: src/argparse.c:530
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "使用法: %s GPG-ERROR [...]\n"
+msgid "missing argument for option \"%.50s\"\n"
+msgstr "オプション\"%.50s\"に引数がありません\n"
 
-#: src/gpg-error.c:633
+#: src/argparse.c:532
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: 警告: %s を認識できませんでした\n"
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "オプション\"%.50s\"には無効な引数です\n"
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr "オプション\"%.50s\"は引数をとりません\n"
+
+#: src/argparse.c:537
+#, c-format
+msgid "invalid command \"%.50s\"\n"
+msgstr "無効なコマンド \"%.50s\"\n"
+
+#: src/argparse.c:539
+#, c-format
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr "オプション\"%.50s\"はあいまいです\n"
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr "コマンド\"%.50s\"はあいまいです\n"
+
+#: src/argparse.c:555
+#, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr "無効なオプション \"%.50s\"\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr "注: デフォルトオプションファイル '%s' がありません\n"
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr "オプションを'%s'から読みます\n"
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr "オプションファイル '%s': %s\n"
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr "注: グローバルコンフィグのため、オプション \"--%s\" を無視します\n"
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr "バグは<https://bugs.gnupg.org>に報告してください。\n"
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "警告: %s を認識できませんでした\n"
+
+#~ msgid "out of core\n"
+#~ msgstr "メモリがありません\n"
+
+#~ msgid "Usage: %s GPG-ERROR [...]\n"
+#~ msgstr "使用法: %s GPG-ERROR [...]\n"
 
 #~ msgid "Keyring open"
 #~ msgstr "鍵リングオープン"
index f76480e..52a1e39 100644 (file)
@@ -1,14 +1,14 @@
 # SOME DESCRIPTIVE TITLE.
 # Copyright (C) YEAR g10 Code GmbH
-# This file is distributed under the same license as the PACKAGE package.
+# This file is distributed under the same license as the libgpg-error package.
 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
 #
 #, fuzzy
 msgid ""
 msgstr ""
-"Project-Id-Version: libgpg-error 1.27\n"
+"Project-Id-Version: libgpg-error 1.43\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -82,30 +82,34 @@ msgid "Assuan"
 msgstr ""
 
 #: src/err-sources.h:44
-msgid "TLS"
+msgid "TPM2d"
 msgstr ""
 
 #: src/err-sources.h:45
-msgid "Any source"
+msgid "TLS"
 msgstr ""
 
 #: src/err-sources.h:46
-msgid "User defined source 1"
+msgid "Any source"
 msgstr ""
 
 #: src/err-sources.h:47
-msgid "User defined source 2"
+msgid "User defined source 1"
 msgstr ""
 
 #: src/err-sources.h:48
-msgid "User defined source 3"
+msgid "User defined source 2"
 msgstr ""
 
 #: src/err-sources.h:49
-msgid "User defined source 4"
+msgid "User defined source 3"
 msgstr ""
 
 #: src/err-sources.h:50
+msgid "User defined source 4"
+msgstr ""
+
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr ""
 
@@ -1278,451 +1282,705 @@ msgid "Wrong name"
 msgstr ""
 
 #: src/err-codes.h:320
-msgid "System bug detected"
+msgid "Not authenticated"
 msgstr ""
 
 #: src/err-codes.h:321
-msgid "Unknown DNS error"
+msgid "Bad authentication"
 msgstr ""
 
 #: src/err-codes.h:322
-msgid "Invalid DNS section"
+msgid "No Keybox daemon running"
 msgstr ""
 
 #: src/err-codes.h:323
-msgid "Invalid textual address form"
+msgid "Keybox daemon error"
 msgstr ""
 
 #: src/err-codes.h:324
-msgid "Missing DNS query packet"
+msgid "Service is not running"
 msgstr ""
 
 #: src/err-codes.h:325
-msgid "Missing DNS answer packet"
+msgid "Service error"
 msgstr ""
 
 #: src/err-codes.h:326
-msgid "Connection closed in DNS"
+msgid "System bug detected"
 msgstr ""
 
 #: src/err-codes.h:327
-msgid "Verification failed in DNS"
+msgid "Unknown DNS error"
 msgstr ""
 
 #: src/err-codes.h:328
-msgid "DNS Timeout"
+msgid "Invalid DNS section"
 msgstr ""
 
 #: src/err-codes.h:329
-msgid "General LDAP error"
+msgid "Invalid textual address form"
 msgstr ""
 
 #: src/err-codes.h:330
-msgid "General LDAP attribute error"
+msgid "Missing DNS query packet"
 msgstr ""
 
 #: src/err-codes.h:331
-msgid "General LDAP name error"
+msgid "Missing DNS answer packet"
 msgstr ""
 
 #: src/err-codes.h:332
-msgid "General LDAP security error"
+msgid "Connection closed in DNS"
 msgstr ""
 
 #: src/err-codes.h:333
-msgid "General LDAP service error"
+msgid "Verification failed in DNS"
 msgstr ""
 
 #: src/err-codes.h:334
-msgid "General LDAP update error"
+msgid "DNS Timeout"
 msgstr ""
 
 #: src/err-codes.h:335
-msgid "Experimental LDAP error code"
+msgid "General LDAP error"
 msgstr ""
 
 #: src/err-codes.h:336
-msgid "Private LDAP error code"
+msgid "General LDAP attribute error"
 msgstr ""
 
 #: src/err-codes.h:337
-msgid "Other general LDAP error"
+msgid "General LDAP name error"
 msgstr ""
 
 #: src/err-codes.h:338
-msgid "LDAP connecting failed (X)"
+msgid "General LDAP security error"
 msgstr ""
 
 #: src/err-codes.h:339
-msgid "LDAP referral limit exceeded"
+msgid "General LDAP service error"
 msgstr ""
 
 #: src/err-codes.h:340
-msgid "LDAP client loop"
+msgid "General LDAP update error"
 msgstr ""
 
 #: src/err-codes.h:341
-msgid "No LDAP results returned"
+msgid "Experimental LDAP error code"
 msgstr ""
 
 #: src/err-codes.h:342
-msgid "LDAP control not found"
+msgid "Private LDAP error code"
 msgstr ""
 
 #: src/err-codes.h:343
-msgid "Not supported by LDAP"
+msgid "Other general LDAP error"
 msgstr ""
 
 #: src/err-codes.h:344
-msgid "LDAP connect error"
+msgid "LDAP connecting failed (X)"
 msgstr ""
 
 #: src/err-codes.h:345
-msgid "Out of memory in LDAP"
+msgid "LDAP referral limit exceeded"
 msgstr ""
 
 #: src/err-codes.h:346
-msgid "Bad parameter to an LDAP routine"
+msgid "LDAP client loop"
 msgstr ""
 
 #: src/err-codes.h:347
-msgid "User cancelled LDAP operation"
+msgid "No LDAP results returned"
 msgstr ""
 
 #: src/err-codes.h:348
-msgid "Bad LDAP search filter"
+msgid "LDAP control not found"
 msgstr ""
 
 #: src/err-codes.h:349
-msgid "Unknown LDAP authentication method"
+msgid "Not supported by LDAP"
 msgstr ""
 
 #: src/err-codes.h:350
-msgid "Timeout in LDAP"
+msgid "LDAP connect error"
 msgstr ""
 
 #: src/err-codes.h:351
-msgid "LDAP decoding error"
+msgid "Out of memory in LDAP"
 msgstr ""
 
 #: src/err-codes.h:352
-msgid "LDAP encoding error"
+msgid "Bad parameter to an LDAP routine"
 msgstr ""
 
 #: src/err-codes.h:353
-msgid "LDAP local error"
+msgid "User cancelled LDAP operation"
 msgstr ""
 
 #: src/err-codes.h:354
-msgid "Cannot contact LDAP server"
+msgid "Bad LDAP search filter"
 msgstr ""
 
 #: src/err-codes.h:355
-msgid "LDAP success"
+msgid "Unknown LDAP authentication method"
 msgstr ""
 
 #: src/err-codes.h:356
-msgid "LDAP operations error"
+msgid "Timeout in LDAP"
 msgstr ""
 
 #: src/err-codes.h:357
-msgid "LDAP protocol error"
+msgid "LDAP decoding error"
 msgstr ""
 
 #: src/err-codes.h:358
-msgid "Time limit exceeded in LDAP"
+msgid "LDAP encoding error"
 msgstr ""
 
 #: src/err-codes.h:359
-msgid "Size limit exceeded in LDAP"
+msgid "LDAP local error"
 msgstr ""
 
 #: src/err-codes.h:360
-msgid "LDAP compare false"
+msgid "Cannot contact LDAP server"
 msgstr ""
 
 #: src/err-codes.h:361
-msgid "LDAP compare true"
+msgid "LDAP success"
 msgstr ""
 
 #: src/err-codes.h:362
-msgid "LDAP authentication method not supported"
+msgid "LDAP operations error"
 msgstr ""
 
 #: src/err-codes.h:363
-msgid "Strong(er) LDAP authentication required"
+msgid "LDAP protocol error"
 msgstr ""
 
 #: src/err-codes.h:364
-msgid "Partial LDAP results+referral received"
+msgid "Time limit exceeded in LDAP"
 msgstr ""
 
 #: src/err-codes.h:365
-msgid "LDAP referral"
+msgid "Size limit exceeded in LDAP"
 msgstr ""
 
 #: src/err-codes.h:366
-msgid "Administrative LDAP limit exceeded"
+msgid "LDAP compare false"
 msgstr ""
 
 #: src/err-codes.h:367
-msgid "Critical LDAP extension is unavailable"
+msgid "LDAP compare true"
 msgstr ""
 
 #: src/err-codes.h:368
-msgid "Confidentiality required by LDAP"
+msgid "LDAP authentication method not supported"
 msgstr ""
 
 #: src/err-codes.h:369
-msgid "LDAP SASL bind in progress"
+msgid "Strong(er) LDAP authentication required"
 msgstr ""
 
 #: src/err-codes.h:370
-msgid "No such LDAP attribute"
+msgid "Partial LDAP results+referral received"
 msgstr ""
 
 #: src/err-codes.h:371
-msgid "Undefined LDAP attribute type"
+msgid "LDAP referral"
 msgstr ""
 
 #: src/err-codes.h:372
-msgid "Inappropriate matching in LDAP"
+msgid "Administrative LDAP limit exceeded"
 msgstr ""
 
 #: src/err-codes.h:373
-msgid "Constraint violation in LDAP"
+msgid "Critical LDAP extension is unavailable"
 msgstr ""
 
 #: src/err-codes.h:374
-msgid "LDAP type or value exists"
+msgid "Confidentiality required by LDAP"
 msgstr ""
 
 #: src/err-codes.h:375
-msgid "Invalid syntax in LDAP"
+msgid "LDAP SASL bind in progress"
 msgstr ""
 
 #: src/err-codes.h:376
-msgid "No such LDAP object"
+msgid "No such LDAP attribute"
 msgstr ""
 
 #: src/err-codes.h:377
-msgid "LDAP alias problem"
+msgid "Undefined LDAP attribute type"
 msgstr ""
 
 #: src/err-codes.h:378
-msgid "Invalid DN syntax in LDAP"
+msgid "Inappropriate matching in LDAP"
 msgstr ""
 
 #: src/err-codes.h:379
-msgid "LDAP entry is a leaf"
+msgid "Constraint violation in LDAP"
 msgstr ""
 
 #: src/err-codes.h:380
-msgid "LDAP alias dereferencing problem"
+msgid "LDAP type or value exists"
 msgstr ""
 
 #: src/err-codes.h:381
-msgid "LDAP proxy authorization failure (X)"
+msgid "Invalid syntax in LDAP"
 msgstr ""
 
 #: src/err-codes.h:382
-msgid "Inappropriate LDAP authentication"
+msgid "No such LDAP object"
 msgstr ""
 
 #: src/err-codes.h:383
-msgid "Invalid LDAP credentials"
+msgid "LDAP alias problem"
 msgstr ""
 
 #: src/err-codes.h:384
-msgid "Insufficient access for LDAP"
+msgid "Invalid DN syntax in LDAP"
 msgstr ""
 
 #: src/err-codes.h:385
-msgid "LDAP server is busy"
+msgid "LDAP entry is a leaf"
 msgstr ""
 
 #: src/err-codes.h:386
-msgid "LDAP server is unavailable"
+msgid "LDAP alias dereferencing problem"
 msgstr ""
 
 #: src/err-codes.h:387
-msgid "LDAP server is unwilling to perform"
+msgid "LDAP proxy authorization failure (X)"
 msgstr ""
 
 #: src/err-codes.h:388
-msgid "Loop detected by LDAP"
+msgid "Inappropriate LDAP authentication"
 msgstr ""
 
 #: src/err-codes.h:389
-msgid "LDAP naming violation"
+msgid "Invalid LDAP credentials"
 msgstr ""
 
 #: src/err-codes.h:390
-msgid "LDAP object class violation"
+msgid "Insufficient access for LDAP"
 msgstr ""
 
 #: src/err-codes.h:391
-msgid "LDAP operation not allowed on non-leaf"
+msgid "LDAP server is busy"
 msgstr ""
 
 #: src/err-codes.h:392
-msgid "LDAP operation not allowed on RDN"
+msgid "LDAP server is unavailable"
 msgstr ""
 
 #: src/err-codes.h:393
-msgid "Already exists (LDAP)"
+msgid "LDAP server is unwilling to perform"
 msgstr ""
 
 #: src/err-codes.h:394
-msgid "Cannot modify LDAP object class"
+msgid "Loop detected by LDAP"
 msgstr ""
 
 #: src/err-codes.h:395
-msgid "LDAP results too large"
+msgid "LDAP naming violation"
 msgstr ""
 
 #: src/err-codes.h:396
-msgid "LDAP operation affects multiple DSAs"
+msgid "LDAP object class violation"
 msgstr ""
 
 #: src/err-codes.h:397
-msgid "Virtual LDAP list view error"
+msgid "LDAP operation not allowed on non-leaf"
 msgstr ""
 
 #: src/err-codes.h:398
-msgid "Other LDAP error"
+msgid "LDAP operation not allowed on RDN"
 msgstr ""
 
 #: src/err-codes.h:399
-msgid "Resources exhausted in LCUP"
+msgid "Already exists (LDAP)"
 msgstr ""
 
 #: src/err-codes.h:400
-msgid "Security violation in LCUP"
+msgid "Cannot modify LDAP object class"
 msgstr ""
 
 #: src/err-codes.h:401
-msgid "Invalid data in LCUP"
+msgid "LDAP results too large"
 msgstr ""
 
 #: src/err-codes.h:402
-msgid "Unsupported scheme in LCUP"
+msgid "LDAP operation affects multiple DSAs"
 msgstr ""
 
 #: src/err-codes.h:403
-msgid "Reload required in LCUP"
+msgid "Virtual LDAP list view error"
 msgstr ""
 
 #: src/err-codes.h:404
-msgid "LDAP cancelled"
+msgid "Other LDAP error"
 msgstr ""
 
 #: src/err-codes.h:405
-msgid "No LDAP operation to cancel"
+msgid "Resources exhausted in LCUP"
 msgstr ""
 
 #: src/err-codes.h:406
-msgid "Too late to cancel LDAP"
+msgid "Security violation in LCUP"
 msgstr ""
 
 #: src/err-codes.h:407
-msgid "Cannot cancel LDAP"
+msgid "Invalid data in LCUP"
 msgstr ""
 
 #: src/err-codes.h:408
-msgid "LDAP assertion failed"
+msgid "Unsupported scheme in LCUP"
 msgstr ""
 
 #: src/err-codes.h:409
-msgid "Proxied authorization denied by LDAP"
+msgid "Reload required in LCUP"
 msgstr ""
 
 #: src/err-codes.h:410
-msgid "User defined error code 1"
+msgid "LDAP cancelled"
 msgstr ""
 
 #: src/err-codes.h:411
-msgid "User defined error code 2"
+msgid "No LDAP operation to cancel"
 msgstr ""
 
 #: src/err-codes.h:412
-msgid "User defined error code 3"
+msgid "Too late to cancel LDAP"
 msgstr ""
 
 #: src/err-codes.h:413
-msgid "User defined error code 4"
+msgid "Cannot cancel LDAP"
 msgstr ""
 
 #: src/err-codes.h:414
-msgid "User defined error code 5"
+msgid "LDAP assertion failed"
 msgstr ""
 
 #: src/err-codes.h:415
-msgid "User defined error code 6"
+msgid "Proxied authorization denied by LDAP"
 msgstr ""
 
 #: src/err-codes.h:416
-msgid "User defined error code 7"
+msgid "User defined error code 1"
 msgstr ""
 
 #: src/err-codes.h:417
-msgid "User defined error code 8"
+msgid "User defined error code 2"
 msgstr ""
 
 #: src/err-codes.h:418
-msgid "User defined error code 9"
+msgid "User defined error code 3"
 msgstr ""
 
 #: src/err-codes.h:419
-msgid "User defined error code 10"
+msgid "User defined error code 4"
 msgstr ""
 
 #: src/err-codes.h:420
-msgid "User defined error code 11"
+msgid "User defined error code 5"
 msgstr ""
 
 #: src/err-codes.h:421
-msgid "User defined error code 12"
+msgid "User defined error code 6"
 msgstr ""
 
 #: src/err-codes.h:422
-msgid "User defined error code 13"
+msgid "User defined error code 7"
 msgstr ""
 
 #: src/err-codes.h:423
-msgid "User defined error code 14"
+msgid "User defined error code 8"
 msgstr ""
 
 #: src/err-codes.h:424
-msgid "User defined error code 15"
+msgid "User defined error code 9"
 msgstr ""
 
 #: src/err-codes.h:425
-msgid "User defined error code 16"
+msgid "User defined error code 10"
 msgstr ""
 
 #: src/err-codes.h:426
-msgid "System error w/o errno"
+msgid "User defined error code 11"
 msgstr ""
 
 #: src/err-codes.h:427
-msgid "Unknown system error"
+msgid "User defined error code 12"
 msgstr ""
 
 #: src/err-codes.h:428
-msgid "End of file"
+msgid "User defined error code 13"
 msgstr ""
 
 #: src/err-codes.h:429
+msgid "User defined error code 14"
+msgstr ""
+
+#: src/err-codes.h:430
+msgid "User defined error code 15"
+msgstr ""
+
+#: src/err-codes.h:431
+msgid "User defined error code 16"
+msgstr ""
+
+#: src/err-codes.h:432
+msgid "SQL success"
+msgstr ""
+
+#: src/err-codes.h:433
+msgid "SQL error"
+msgstr ""
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr ""
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr ""
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr ""
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr ""
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr ""
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr ""
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr ""
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr ""
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr ""
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr ""
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr ""
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr ""
+
+#: src/err-codes.h:447
+msgid "SQL database lock protocol error"
+msgstr ""
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr ""
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr ""
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr ""
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr ""
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr ""
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr ""
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr ""
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr ""
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr ""
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr ""
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr ""
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr ""
+
+#: src/err-codes.h:463
+msgid "System error w/o errno"
+msgstr ""
+
+#: src/err-codes.h:464
+msgid "Unknown system error"
+msgstr ""
+
+#: src/err-codes.h:465
+msgid "End of file"
+msgstr ""
+
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr ""
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+msgid "argument not expected"
+msgstr ""
+
+#: src/argparse.c:496
+msgid "read error"
+msgstr ""
+
+#: src/argparse.c:498
+msgid "keyword too long"
+msgstr ""
+
+#: src/argparse.c:500
+msgid "missing argument"
+msgstr ""
+
+#: src/argparse.c:502
+msgid "invalid argument"
+msgstr ""
+
+#: src/argparse.c:504
+msgid "invalid command"
+msgstr ""
+
+#: src/argparse.c:506
+msgid "invalid alias definition"
+msgstr ""
+
+#: src/argparse.c:508 src/argparse.c:545
+msgid "permission error"
+msgstr ""
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr ""
+
+#: src/argparse.c:514 src/argparse.c:549
+msgid "invalid meta command"
+msgstr ""
+
+#: src/argparse.c:516 src/argparse.c:551
+msgid "unknown meta command"
+msgstr ""
+
+#: src/argparse.c:518 src/argparse.c:553
+msgid "unexpected meta command"
+msgstr ""
+
+#: src/argparse.c:520
+msgid "invalid option"
+msgstr ""
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:532
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr ""
+
+#: src/argparse.c:537
+#, c-format
+msgid "invalid command \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:539
+#, c-format
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:555
+#, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr ""
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
 msgstr ""
 
-#: src/gpg-error.c:633
+#: src/gpg-error.c:762
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
+msgid "warning: could not recognize %s\n"
 msgstr ""
index 8a32eb1..d60ec67 100644 (file)
Binary files a/po/nl.gmo and b/po/nl.gmo differ
index 58e9683..5b8546b 100644 (file)
--- a/po/nl.po
+++ b/po/nl.po
@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libgpg-error 1.10\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2014-11-17 00:16+0100\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:27+0100\n"
 "Last-Translator: Freek de Kruijf <f.de.kruijf@gmail.com>\n"
 "Language-Team: Dutch <vertaling@vrijschrift.org>\n"
 "Language: nl\n"
@@ -83,30 +83,34 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
+msgid "TPM2d"
+msgstr "TPM2d"
+
+#: src/err-sources.h:45
 msgid "TLS"
 msgstr "TLS"
 
-#: src/err-sources.h:45
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "Elke bron"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "Gebruikergedefinieerde bron 1"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "Gebruikergedefinieerde bron 2"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "Gebruikergedefinieerde bron 3"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "Gebruikergedefinieerde bron 4"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Onbekende bron"
 
@@ -1303,580 +1307,878 @@ msgid "Wrong name"
 msgstr "Onbekende naam"
 
 #: src/err-codes.h:320
+#, fuzzy
+#| msgid "Not enabled"
+msgid "Not authenticated"
+msgstr "Niet ingeschakeld"
+
+#: src/err-codes.h:321
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Bad authentication"
+msgstr "Niet ondersteunde bescherming"
+
+#: src/err-codes.h:322
+#, fuzzy
+#| msgid "No agent running"
+msgid "No Keybox daemon running"
+msgstr "Er draait geen agent"
+
+#: src/err-codes.h:323
+#, fuzzy
+#| msgid "SmartCard daemon error"
+msgid "Keybox daemon error"
+msgstr "SmartCard-daemon-fout"
+
+#: src/err-codes.h:324
+msgid "Service is not running"
+msgstr ""
+
+#: src/err-codes.h:325
+#, fuzzy
+#| msgid "Keyserver error"
+msgid "Service error"
+msgstr "Fout in sleutelserver"
+
+#: src/err-codes.h:326
 msgid "System bug detected"
 msgstr ""
 
-#: src/err-codes.h:321
+#: src/err-codes.h:327
 #, fuzzy
 #| msgid "Unknown system error"
 msgid "Unknown DNS error"
 msgstr "Onbekende systeemfout"
 
-#: src/err-codes.h:322
+#: src/err-codes.h:328
 #, fuzzy
 #| msgid "Invalid OID string"
 msgid "Invalid DNS section"
 msgstr "Ongeldige OID-tekenreeks"
 
-#: src/err-codes.h:323
+#: src/err-codes.h:329
 #, fuzzy
 #| msgid "Invalid S-expression"
 msgid "Invalid textual address form"
 msgstr "Ongeldige S-expressie"
 
-#: src/err-codes.h:324
+#: src/err-codes.h:330
 #, fuzzy
 #| msgid "Missing issuer certificate"
 msgid "Missing DNS query packet"
 msgstr "Ontbrekend certificaat van uitgever"
 
-#: src/err-codes.h:325
+#: src/err-codes.h:331
 msgid "Missing DNS answer packet"
 msgstr ""
 
-#: src/err-codes.h:326
+#: src/err-codes.h:332
 msgid "Connection closed in DNS"
 msgstr ""
 
-#: src/err-codes.h:327
+#: src/err-codes.h:333
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "Verification failed in DNS"
 msgstr "Ontcijfering is mislukt"
 
-#: src/err-codes.h:328
+#: src/err-codes.h:334
 #, fuzzy
 #| msgid "Timeout"
 msgid "DNS Timeout"
 msgstr "Tijdslimiet"
 
-#: src/err-codes.h:329
+#: src/err-codes.h:335
 #, fuzzy
 #| msgid "General IPC error"
 msgid "General LDAP error"
 msgstr "Algemene IPC-fout"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP attribute error"
 msgstr "Algemene fout"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP name error"
 msgstr "Algemene fout"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP security error"
 msgstr "Algemene Assuan-fout"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP service error"
 msgstr "Algemene fout"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP update error"
 msgstr "Algemene Assuan-fout"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr ""
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 #, fuzzy
 #| msgid "IPC write error"
 msgid "Private LDAP error code"
 msgstr "IPC-schrijffout"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other general LDAP error"
 msgstr "Algemene IPC-fout"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 #, fuzzy
 #| msgid "IPC connect call failed"
 msgid "LDAP connecting failed (X)"
 msgstr "IPC verbindingsoproep is mislukt"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral limit exceeded"
 msgstr "Algemene fout"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr ""
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 #, fuzzy
 #| msgid "Card reset required"
 msgid "No LDAP results returned"
 msgstr "Reset van kaart vereist"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 #, fuzzy
 #| msgid "Element not found"
 msgid "LDAP control not found"
 msgstr "Element niet gevonden"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 #, fuzzy
 #| msgid "Not supported"
 msgid "Not supported by LDAP"
 msgstr "Niet ondersteund"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 #, fuzzy
 #| msgid "Unexpected error"
 msgid "LDAP connect error"
 msgstr "Onverwachte fout"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr ""
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr ""
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 #, fuzzy
 #| msgid "Unsupported operation"
 msgid "User cancelled LDAP operation"
 msgstr "Niet-ondersteunde operatie"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 #, fuzzy
 #| msgid "Bad certificate"
 msgid "Bad LDAP search filter"
 msgstr "Fout certificaat"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "Unknown LDAP authentication method"
 msgstr "Onbekende extensie"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 #, fuzzy
 #| msgid "Timeout"
 msgid "Timeout in LDAP"
 msgstr "Tijdslimiet"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP decoding error"
 msgstr "dirmngr-fout"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP encoding error"
 msgstr "dirmngr-fout"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 #, fuzzy
 #| msgid "IPC read error"
 msgid "LDAP local error"
 msgstr "IPC-leesfout"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot contact LDAP server"
 msgstr "Geen IPC-server"
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP success"
 msgstr "Succes"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 #, fuzzy
 #| msgid "Configuration error"
 msgid "LDAP operations error"
 msgstr "Configuratiefout"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP protocol error"
 msgstr "In strijd met protocol"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr ""
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr ""
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "LDAP authentication method not supported"
 msgstr "Onbekende extensie"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
 msgstr ""
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 #, fuzzy
 #| msgid "Fatal alert message received"
 msgid "Partial LDAP results+referral received"
 msgstr "Een alarmeringsbericht over iets fataal ontvangen "
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral"
 msgstr "Algemene fout"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr ""
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr ""
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Confidentiality required by LDAP"
 msgstr "Reset van kaart vereist"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr ""
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr ""
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 #, fuzzy
 #| msgid "Invalid attribute"
 msgid "Undefined LDAP attribute type"
 msgstr "Ongeldig attribuut"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate matching in LDAP"
 msgstr "Niet ondersteunde bescherming"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Constraint violation in LDAP"
 msgstr "In strijd met protocol"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr ""
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid syntax in LDAP"
 msgstr "Ongeldige status"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 #, fuzzy
 #| msgid "No CMS object"
 msgid "No such LDAP object"
 msgstr "Geen CMS-object"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 #, fuzzy
 #| msgid "Hardware problem"
 msgid "LDAP alias problem"
 msgstr "Hardwareprobleem"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid DN syntax in LDAP"
 msgstr "Ongeldige status"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr ""
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 #, fuzzy
 #| msgid "Encoding problem"
 msgid "LDAP alias dereferencing problem"
 msgstr "Coderingsprobleem"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr ""
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate LDAP authentication"
 msgstr "Niet ondersteunde bescherming"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 #, fuzzy
 #| msgid "Invalid card"
 msgid "Invalid LDAP credentials"
 msgstr "Ongeldige kaart"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr ""
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr ""
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 #, fuzzy
 #| msgid "No keyserver available"
 msgid "LDAP server is unavailable"
 msgstr "Geen sleutelserver beschikbaar"
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr ""
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr ""
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 #, fuzzy
 #| msgid "Missing action"
 msgid "LDAP naming violation"
 msgstr "Ontbrekende actie"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP object class violation"
 msgstr "In strijd met protocol"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 #, fuzzy
 #| msgid "Operation not yet finished"
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "Bewerking is nog niet beëindigd"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation not allowed on RDN"
 msgstr "Bewerking geannuleerd"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr ""
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr ""
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 #, fuzzy
 #| msgid "Line too long"
 msgid "LDAP results too large"
 msgstr "Regel te lang"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation affects multiple DSAs"
 msgstr "Bewerking geannuleerd"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr ""
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other LDAP error"
 msgstr "Algemene IPC-fout"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 #, fuzzy
 #| msgid "Resources exhausted"
 msgid "Resources exhausted in LCUP"
 msgstr "Hulpbronnen uitgeput"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Security violation in LCUP"
 msgstr "In strijd met protocol"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid data in LCUP"
 msgstr "Ongeldige status"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 #, fuzzy
 #| msgid "Unsupported certificate"
 msgid "Unsupported scheme in LCUP"
 msgstr "Niet ondersteund certificaat"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Reload required in LCUP"
 msgstr "Reset van kaart vereist"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP cancelled"
 msgstr "Succes"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 #, fuzzy
 #| msgid "Not operational"
 msgid "No LDAP operation to cancel"
 msgstr "Niet in werking"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 #, fuzzy
 #| msgid "Not operational"
 msgid "Too late to cancel LDAP"
 msgstr "Niet in werking"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot cancel LDAP"
 msgstr "Geen IPC-server"
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "LDAP assertion failed"
 msgstr "Ontcijfering is mislukt"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr ""
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "Gebruikergedefinieerde foutcode 1"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "Gebruikergedefinieerde foutcode 2"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "Gebruikergedefinieerde foutcode 3"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "Gebruikergedefinieerde foutcode 4"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "Gebruikergedefinieerde foutcode 5"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "Gebruikergedefinieerde foutcode 6"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "Gebruikergedefinieerde foutcode 7"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "Gebruikergedefinieerde foutcode 8"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "Gebruikergedefinieerde foutcode 9"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "Gebruikergedefinieerde foutcode 10"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "Gebruikergedefinieerde foutcode 11"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "Gebruikergedefinieerde foutcode 12"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "Gebruikergedefinieerde foutcode 13"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "Gebruikergedefinieerde foutcode 14"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "Gebruikergedefinieerde foutcode 15"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "Gebruikergedefinieerde foutcode 16"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+#, fuzzy
+#| msgid "Success"
+msgid "SQL success"
+msgstr "Succes"
+
+#: src/err-codes.h:433
+#, fuzzy
+#| msgid "Syntax error"
+msgid "SQL error"
+msgstr "Syntaxfout"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr ""
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr ""
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr ""
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr ""
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr ""
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr ""
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr ""
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr ""
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr ""
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr ""
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr ""
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr ""
+
+#: src/err-codes.h:447
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "SQL database lock protocol error"
+msgstr "In strijd met protocol"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr ""
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr ""
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr ""
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr ""
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr ""
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr ""
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr ""
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr ""
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr ""
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr ""
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr ""
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr ""
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "Systeemfout zonder foutnr."
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Onbekende systeemfout"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Einde van bestand"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Onbekende foutcode"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "argument not expected"
+msgstr "Gegevens niet versleuteld"
+
+#: src/argparse.c:496
+#, fuzzy
+#| msgid "IPC read error"
+msgid "read error"
+msgstr "IPC-leesfout"
+
+#: src/argparse.c:498
+#, fuzzy
+#| msgid "Line too long"
+msgid "keyword too long"
+msgstr "Regel te lang"
+
+#: src/argparse.c:500
+#, fuzzy
+#| msgid "Missing value"
+msgid "missing argument"
+msgstr "Ontbrekende waarde"
+
+#: src/argparse.c:502
+#, fuzzy
+#| msgid "Invalid argument"
+msgid "invalid argument"
+msgstr "Ongeldig argument"
+
+#: src/argparse.c:504
+#, fuzzy
+#| msgid "Invalid card"
+msgid "invalid command"
+msgstr "Ongeldige kaart"
+
+#: src/argparse.c:506
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "invalid alias definition"
+msgstr "Ongeldige OID-tekenreeks"
+
+#: src/argparse.c:508 src/argparse.c:545
+#, fuzzy
+#| msgid "Configuration error"
+msgid "permission error"
+msgstr "Configuratiefout"
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr ""
+
+#: src/argparse.c:514 src/argparse.c:549
+#, fuzzy
+#| msgid "Invalid card"
+msgid "invalid meta command"
+msgstr "Ongeldige kaart"
+
+#: src/argparse.c:516 src/argparse.c:551
+#, fuzzy
+#| msgid "Unknown command"
+msgid "unknown meta command"
+msgstr "Onbekend commando"
+
+#: src/argparse.c:518 src/argparse.c:553
+#, fuzzy
+#| msgid "Unexpected IPC command"
+msgid "unexpected meta command"
+msgstr "Onverwacht IPC-commando"
+
+#: src/argparse.c:520
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "invalid option"
+msgstr "Ongeldige bewerkingscode"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:532
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Gebruik: %s GPG-ERROR [...]\n"
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr ""
 
-#: src/gpg-error.c:633
+#: src/argparse.c:537
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: waarschuwing: kon %s niet herkennen\n"
+msgid "invalid command \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:539
+#, c-format
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:555
+#, fuzzy, c-format
+#| msgid "Invalid operation code"
+msgid "invalid option \"%.50s\"\n"
+msgstr "Ongeldige bewerkingscode"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr ""
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr ""
+
+#: src/gpg-error.c:762
+#, fuzzy, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "waarschuwing: kon %s niet herkennen\n"
+
+#~ msgid "Usage: %s GPG-ERROR [...]\n"
+#~ msgstr "Gebruik: %s GPG-ERROR [...]\n"
 
 #, fuzzy
 #~| msgid "Resources exhausted"
index 8be78a2..d9ef305 100644 (file)
Binary files a/po/pl.gmo and b/po/pl.gmo differ
index 25f7b3b..a7ce38a 100644 (file)
--- a/po/pl.po
+++ b/po/pl.po
@@ -1,14 +1,14 @@
 # Polish translation for libgpg-error.
 # Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
 # This file is distributed under the same license as the libgpg-error package.
-# Jakub Bogusz <qboosh@pld-linux.org>, 2004-2016.
+# Jakub Bogusz <qboosh@pld-linux.org>, 2004-2020.
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: libgpg-error 1.22\n"
+"Project-Id-Version: libgpg-error 1.38\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2016-05-11 18:02+0200\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:42+0100\n"
 "Last-Translator: Jakub Bogusz <qboosh@pld-linux.org>\n"
 "Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
 "Language: pl\n"
@@ -81,30 +81,34 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
+msgid "TPM2d"
+msgstr "TPM2d"
+
+#: src/err-sources.h:45
 msgid "TLS"
 msgstr "TLS"
 
-#: src/err-sources.h:45
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "Dowolne źródło"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "Zdefiniowane przez użytkownika źródło 1"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "Zdefiniowane przez użytkownika źródło 2"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "Zdefiniowane przez użytkownika źródło 3"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "Zdefiniowane przez użytkownika źródło 4"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Nieznane źródło"
 
@@ -966,7 +970,7 @@ msgstr "Błędny znak ósemkowy w S-wyrażeniu"
 
 #: src/err-codes.h:242
 msgid "All subkeys are expired or revoked"
-msgstr ""
+msgstr "Wszystkie podklucze wygasły lub zostały anulowane"
 
 #: src/err-codes.h:243
 msgid "Database is corrupted"
@@ -1221,537 +1225,763 @@ msgid "Unknown IPC inquire"
 msgstr "Nieznane zapytanie IPC"
 
 #: src/err-codes.h:306
-#, fuzzy
-#| msgid "No crypto engine"
 msgid "Crypto engine too old"
-msgstr "Brak silnika kryptograficznego"
+msgstr "Silnik kryptograficzny zbyt stary"
 
 #: src/err-codes.h:307
 msgid "Screen or window too small"
-msgstr ""
+msgstr "Ekran lub okno zbyt małe"
 
 #: src/err-codes.h:308
 msgid "Screen or window too large"
-msgstr ""
+msgstr "Ekran lub okno zbyt duże"
 
 #: src/err-codes.h:309
 msgid "Required environment variable not set"
-msgstr ""
+msgstr "Wymagana zmienna środowiskowa nie jest ustawiona"
 
 #: src/err-codes.h:310
-#, fuzzy
-#| msgid "Already exists (LDAP)"
 msgid "User ID already exists"
-msgstr "Już istnieje (LDAP)"
+msgstr "Identyfikator użytkownika już istnieje"
 
 #: src/err-codes.h:311
-#, fuzzy
-#| msgid "Already exists (LDAP)"
 msgid "Name already exists"
-msgstr "Już istnieje (LDAP)"
+msgstr "Nazwa już istnieje"
 
 #: src/err-codes.h:312
-#, fuzzy
-#| msgid "Duplicated value"
 msgid "Duplicated name"
-msgstr "Powtórzona wartość"
+msgstr "Powtórzona nazwa"
 
 #: src/err-codes.h:313
-#, fuzzy
-#| msgid "Certificate too young"
 msgid "Object is too young"
-msgstr "Certyfikat zbyt młody"
+msgstr "Obiekt zbyt młody"
 
 #: src/err-codes.h:314
-#, fuzzy
-#| msgid "Provided object is too short"
 msgid "Object is too old"
-msgstr "Dostarczony obiekt jest zbyt mały"
+msgstr "Obiekt zbyt stary"
 
 #: src/err-codes.h:315
-#, fuzzy
-#| msgid "Unknown name"
 msgid "Unknown flag"
-msgstr "Nieznana nazwa"
+msgstr "Nieznana flaga"
 
 #: src/err-codes.h:316
-#, fuzzy
-#| msgid "Invalid operation code"
 msgid "Invalid execution order"
-msgstr "Niepoprawny kod operacji"
+msgstr "Błędna kolejność wykonywania"
 
 #: src/err-codes.h:317
 msgid "Already fetched"
-msgstr ""
+msgstr "Już pobrano"
 
 #: src/err-codes.h:318
 msgid "Try again later"
-msgstr ""
+msgstr "Proszę spróbować później"
 
 #: src/err-codes.h:319
-#, fuzzy
-#| msgid "No name"
 msgid "Wrong name"
-msgstr "Brak nazwy"
+msgstr "Zła nazwa"
 
 #: src/err-codes.h:320
-msgid "System bug detected"
-msgstr ""
+msgid "Not authenticated"
+msgstr "Brak uwierzytelnienia"
 
 #: src/err-codes.h:321
-#, fuzzy
-#| msgid "Unknown system error"
-msgid "Unknown DNS error"
-msgstr "Nieznany błąd systemu"
+msgid "Bad authentication"
+msgstr "Niewłaściwe uwierzytelnienie"
 
 #: src/err-codes.h:322
-#, fuzzy
-#| msgid "Invalid OID string"
-msgid "Invalid DNS section"
-msgstr "Niepoprawny łańcuch OID"
+msgid "No Keybox daemon running"
+msgstr "Demon Keybox nie uruchomiony"
 
 #: src/err-codes.h:323
-#, fuzzy
-#| msgid "Invalid S-expression"
-msgid "Invalid textual address form"
-msgstr "Niepoprawne S-wyrażenie"
+msgid "Keybox daemon error"
+msgstr "Błąd demona Keybox"
 
 #: src/err-codes.h:324
-#, fuzzy
-#| msgid "Missing issuer certificate"
-msgid "Missing DNS query packet"
-msgstr "Brak certyfikatu wystawcy"
+msgid "Service is not running"
+msgstr "Usługa nie jest uruchomiona"
 
 #: src/err-codes.h:325
-msgid "Missing DNS answer packet"
-msgstr ""
+msgid "Service error"
+msgstr "Błąd usługi"
 
 #: src/err-codes.h:326
-msgid "Connection closed in DNS"
-msgstr ""
+msgid "System bug detected"
+msgstr "Wykryto błąd systemu"
 
 #: src/err-codes.h:327
-#, fuzzy
-#| msgid "Decryption failed"
-msgid "Verification failed in DNS"
-msgstr "Odszyfrowywanie nie powiodło się"
+msgid "Unknown DNS error"
+msgstr "Nieznany błąd DNS"
 
 #: src/err-codes.h:328
-#, fuzzy
-#| msgid "Timeout"
-msgid "DNS Timeout"
-msgstr "Upłynął limit czasu"
+msgid "Invalid DNS section"
+msgstr "Błędna sekcja DNS"
 
 #: src/err-codes.h:329
+msgid "Invalid textual address form"
+msgstr "Błędna postać tekstowa adresu"
+
+#: src/err-codes.h:330
+msgid "Missing DNS query packet"
+msgstr "Brak pakietu zapytania DNS"
+
+#: src/err-codes.h:331
+msgid "Missing DNS answer packet"
+msgstr "Brak pakietu odpowiedzi DNS"
+
+#: src/err-codes.h:332
+msgid "Connection closed in DNS"
+msgstr "Połączenie zamknięte przez DNS"
+
+#: src/err-codes.h:333
+msgid "Verification failed in DNS"
+msgstr "Weryfikacja przez DNS nie powiodła się"
+
+#: src/err-codes.h:334
+msgid "DNS Timeout"
+msgstr "Upłynął limit czasu DNS"
+
+#: src/err-codes.h:335
 msgid "General LDAP error"
 msgstr "Błąd ogólny LDAP"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 msgid "General LDAP attribute error"
 msgstr "Błąd ogólny atrybutu LDAP"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 msgid "General LDAP name error"
 msgstr "Błąd ogólny nazwy LDAP"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 msgid "General LDAP security error"
 msgstr "Błąd ogólny bezpieczeństwa LDAP"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 msgid "General LDAP service error"
 msgstr "Błąd ogólny usługi LDAP"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 msgid "General LDAP update error"
 msgstr "Błąd ogólny aktualizacji LDAP"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr "Eksperymentalny kod błędu LDAP"
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 msgid "Private LDAP error code"
 msgstr "Prywatny kod błędu LDAP"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 msgid "Other general LDAP error"
 msgstr "Inny błąd ogólny LDAP"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 msgid "LDAP connecting failed (X)"
 msgstr "Połączenie z LDAP nie powiodło się (X)"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 msgid "LDAP referral limit exceeded"
 msgstr "Przekroczony limit odniesień LDAP"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr "Pętla klienta LDAP"
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 msgid "No LDAP results returned"
 msgstr "Nie zwrócono wyników LDAP"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 msgid "LDAP control not found"
 msgstr "Nie znaleziono sterowania LDAP"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 msgid "Not supported by LDAP"
 msgstr "Nie obsługiwane przez LDAP"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 msgid "LDAP connect error"
 msgstr "Błąd połączenia z LDAP"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr "Brak pamięci w LDAP"
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr "Błędny parametr procedury LDAP"
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 msgid "User cancelled LDAP operation"
 msgstr "Operacja LDAP anulowana przez użytkownika"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 msgid "Bad LDAP search filter"
 msgstr "Błędny filtr wyszukiwania LDAP"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 msgid "Unknown LDAP authentication method"
 msgstr "Nieznana metoda uwierzytelnienia LDAP"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 msgid "Timeout in LDAP"
 msgstr "Limit czasu w LDAP"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 msgid "LDAP decoding error"
 msgstr "Błąd dekodowania LDAP"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 msgid "LDAP encoding error"
 msgstr "Błąd kodowania LDAP"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 msgid "LDAP local error"
 msgstr "Błąd lokalny LDAP"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 msgid "Cannot contact LDAP server"
 msgstr "Nie można połączyć się z serwerem LDAP"
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 msgid "LDAP success"
 msgstr "Sukces LDAP"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 msgid "LDAP operations error"
 msgstr "Błąd operacji LDAP"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 msgid "LDAP protocol error"
 msgstr "Błąd protokołu LDAP"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr "Przekroczony limit czasu w LDAP"
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr "Przekroczony limit rozmiaru w LDAP"
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr "Porównanie LDAP fałszywe"
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr "Porównanie LDAP prawdziwe"
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 msgid "LDAP authentication method not supported"
 msgstr "Nieobsługiwana metoda uwierzytelnienia LDAP"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
 msgstr "Wymagana silniejsze uwierzytelnienie LDAP"
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 msgid "Partial LDAP results+referral received"
 msgstr "Otrzymano częściowe wyniki+odniesienie LDAP"
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 msgid "LDAP referral"
 msgstr "Odniesienie LDAP"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr "Przekroczony limit administracyjny LDAP"
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr "Krytyczne rozszerzenie LDAP jest niedostępne"
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 msgid "Confidentiality required by LDAP"
 msgstr "Zaufanie wymagane przez LDAP"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr "Wiązanie LDAP SASL w trakcie"
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr "Nie ma takiego atrybutu LDAP"
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 msgid "Undefined LDAP attribute type"
 msgstr "Niezdefiniowany typ atrybutu LDAP"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 msgid "Inappropriate matching in LDAP"
 msgstr "Niewłaściwe dopasowanie w LDAP"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 msgid "Constraint violation in LDAP"
 msgstr "Naruszenie ograniczenia w LDAP"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr "Typ lub wartość LDAP istnieje"
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 msgid "Invalid syntax in LDAP"
 msgstr "Błędna składnia w LDAP"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 msgid "No such LDAP object"
 msgstr "Nie ma takiego obiektu LDAP"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 msgid "LDAP alias problem"
 msgstr "Problem z aliasem LDAP"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 msgid "Invalid DN syntax in LDAP"
 msgstr "Błędna składnia DN w LDAP"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr "Wpis LDAP jest liściem"
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 msgid "LDAP alias dereferencing problem"
 msgstr "Problem z rozwinięciem aliasu LDAP"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr "Błąd autoryzacji do proxy LDAP (X)"
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 msgid "Inappropriate LDAP authentication"
 msgstr "Niewłaściwe uwierzytelnienie LDAP"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 msgid "Invalid LDAP credentials"
 msgstr "Błędne dane uwierzytelniające LDAP"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr "Niewystarczający dostęp dla LDAP"
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr "Serwer LDAP jest zajęty"
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 msgid "LDAP server is unavailable"
 msgstr "Serwer LDAP jest niedostępny"
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr "Serwer LDAP nie zamierza wykonać żądania"
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr "Pętla wykryta przez LDAP"
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 msgid "LDAP naming violation"
 msgstr "Naruszenie nazw LDAP"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 msgid "LDAP object class violation"
 msgstr "Naruszenie klasy obiektu LDAP"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "Operacja LDAP nie jest dozwolona na nie-liściu"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 msgid "LDAP operation not allowed on RDN"
 msgstr "Operacja LDAP nie jest dozwolona na RDN"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr "Już istnieje (LDAP)"
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr "Nie można zmodyfikować klasy obiektu LDAP"
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 msgid "LDAP results too large"
 msgstr "Wyniki LDAP zbyt duże"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 msgid "LDAP operation affects multiple DSAs"
 msgstr "Operacja LDAP obejmuje wiele DSA"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr "Błąd widoku wirtualnej listy LDAP"
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 msgid "Other LDAP error"
 msgstr "Inny błąd LDAP"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 msgid "Resources exhausted in LCUP"
 msgstr "Zasoby wyczerpane w LCUP"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 msgid "Security violation in LCUP"
 msgstr "Naruszenie bezpieczeństwa w LCUP"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 msgid "Invalid data in LCUP"
 msgstr "Błędne dane w LCUP"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 msgid "Unsupported scheme in LCUP"
 msgstr "Nieobsługiwany schemat w LCUP"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 msgid "Reload required in LCUP"
 msgstr "Wymagane przeładowanie w LCUP"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 msgid "LDAP cancelled"
 msgstr "LDAP anulowane"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 msgid "No LDAP operation to cancel"
 msgstr "Brak operacji LDAP do anulowania"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 msgid "Too late to cancel LDAP"
 msgstr "Za późno na anulowanie LDAP"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 msgid "Cannot cancel LDAP"
 msgstr "Nie można anulować LDAP"
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 msgid "LDAP assertion failed"
 msgstr "Zapewnienie LDAP nie powiodło się"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr "Autoryzacja przez proxy odrzucona przez LDAP"
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "Zdefiniowany przez użytkownika kod błędu 1"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "Zdefiniowany przez użytkownika kod błędu 2"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "Zdefiniowany przez użytkownika kod błędu 3"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "Zdefiniowany przez użytkownika kod błędu 4"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "Zdefiniowany przez użytkownika kod błędu 5"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "Zdefiniowany przez użytkownika kod błędu 6"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "Zdefiniowany przez użytkownika kod błędu 7"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "Zdefiniowany przez użytkownika kod błędu 8"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "Zdefiniowany przez użytkownika kod błędu 9"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "Zdefiniowany przez użytkownika kod błędu 10"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "Zdefiniowany przez użytkownika kod błędu 11"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "Zdefiniowany przez użytkownika kod błędu 12"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "Zdefiniowany przez użytkownika kod błędu 13"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "Zdefiniowany przez użytkownika kod błędu 14"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "Zdefiniowany przez użytkownika kod błędu 15"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "Zdefiniowany przez użytkownika kod błędu 16"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+msgid "SQL success"
+msgstr "Sukces SQL"
+
+#: src/err-codes.h:433
+msgid "SQL error"
+msgstr "Błąd SQL"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr "Wewnętrzny błąd logiczny w bibliotece SQL"
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr "Brak uprawnień (SQL)"
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr "Zapytanie SQL przerwane na żądanie"
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr "Plik bazy danych SQL jest zablokowany"
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr "Tabela SQL w bazie danych jest zablokowana"
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr "Pamięć wyczerpana w bibliotece SQL"
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr "Próba zapisu do bazy danych SQL tylko do odczytu"
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr "Operacja SQL zakończona przez przerwanie"
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr "Błąd we/wy podczas operacji SQL"
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr "Obraz dysku bazy danych SQL jest uszkodzony"
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr "Nieznany kod operacji w pliku sterującym SQL"
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr "Wstawianie nie powiodło się, ponieważ baza danych SQL jest pełna"
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr "Nie udało się otworzyć pliku bazy danych SQL"
+
+#: src/err-codes.h:447
+msgid "SQL database lock protocol error"
+msgstr "Błąd protokołu blokowania bazy danych SQL"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr "(wewnętrzny kod SQL: pusty)"
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr "Schemat bazy danych SQL uległ zmianie"
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr "Łańcuch lub blok danych przekracza limit rozmiaru (SQL)"
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr "Operacja SQL przerwana z powodu naruszenia ograniczeń"
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr "Niezgodność typów danych (SQL)"
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr "Biblioteka SQL użyta niepoprawnie"
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr ""
+"Biblioteka SQL wykorzystuje nie obsługiwane funkcje systemu operacyjnego"
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr "Autoryzacja odrzucona (SQL)"
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr "(nie używany kod SQL: format)"
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr "Parametr dowiązania SQL spoza zakresu"
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr "Otwarty plik nie jest bazą danych SQL"
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr "Powiadomienia z loggera SQL"
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr "Ostrzeżenia z loggera SQL"
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr "Baza SQL ma gotowy kolejny wiersz"
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr "Baza SQL zakończyła wykonywanie"
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "Błąd systemowy bez errno"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Nieznany błąd systemu"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Koniec pliku"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Nieznany kod błędu"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+msgid "argument not expected"
+msgstr "nieoczekiwany argument"
+
+#: src/argparse.c:496
+msgid "read error"
+msgstr "błąd odczytu"
+
+#: src/argparse.c:498
+msgid "keyword too long"
+msgstr "słowo kluczowe zbyt długie"
+
+#: src/argparse.c:500
+msgid "missing argument"
+msgstr "brak argumentu"
+
+#: src/argparse.c:502
+msgid "invalid argument"
+msgstr "nłędny argument"
+
+#: src/argparse.c:504
+msgid "invalid command"
+msgstr "błędne polecenie"
+
+#: src/argparse.c:506
+msgid "invalid alias definition"
+msgstr "błędna definicja aliasu"
+
+#: src/argparse.c:508 src/argparse.c:545
+msgid "permission error"
+msgstr "błąd uprawnień"
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr "brak pamięci"
+
+#: src/argparse.c:514 src/argparse.c:549
+msgid "invalid meta command"
+msgstr "błędne polecenie meta"
+
+#: src/argparse.c:516 src/argparse.c:551
+msgid "unknown meta command"
+msgstr "nieznane polecenie meta"
+
+#: src/argparse.c:518 src/argparse.c:553
+msgid "unexpected meta command"
+msgstr "nieoczekiwane polecenie meta"
+
+#: src/argparse.c:520
+msgid "invalid option"
+msgstr "błędna opcja"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr "brak argumentu dla opcji ,,%.50s''\n"
+
+#: src/argparse.c:532
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Składnia: %s BŁĄD-GPG [...]\n"
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "błędny argumentu dla opcji ,,%.50s''\n"
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr "opcja ,,%.50s'' nie może mieć argumentów\n"
+
+#: src/argparse.c:537
+#, c-format
+msgid "invalid command \"%.50s\"\n"
+msgstr "błędne polecenie ,,%.50s''\n"
+
+#: src/argparse.c:539
+#, c-format
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr "opcja ,,%.50s'' jest niejednoznaczna\n"
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr "polecenie ,,%.50s'' jest niejednoznaczne\n"
+
+#: src/argparse.c:555
+#, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr "błędna opcja ,,%.50s''\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr "Uwaga: brak domyślnego pliku opcji ,,%s''\n"
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr "odczyt opcji z ,,%s''\n"
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr "plik opcji ,,%s'': %s\n"
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+"Uwaga: ignorowanie opcji ,,--%s'' ze względu na konfigurację globalną\n"
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr "Błędy prosimy zgłaszać pod <https://bugs.gnupg.org>.\n"
 
-#: src/gpg-error.c:633
+#: src/gpg-error.c:762
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: uwaga: nie rozpoznano %s\n"
+msgid "warning: could not recognize %s\n"
+msgstr "uwaga: nie rozpoznano %s\n"
index f14c3cc..998a446 100644 (file)
Binary files a/po/pt.gmo and b/po/pt.gmo differ
index 540abb7..cc09dc7 100644 (file)
--- a/po/pt.po
+++ b/po/pt.po
@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libgpg-error 1.17\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2014-11-24 02:32+0000\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:42+0100\n"
 "Last-Translator: Paulo Tomé <paulo.jorge.tome@gmail.com>\n"
 "Language-Team: Portuguese <traduz@debian.pt.org>\n"
 "Language: pt\n"
@@ -83,30 +83,34 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
+msgid "TPM2d"
+msgstr "TPM2d"
+
+#: src/err-sources.h:45
 msgid "TLS"
 msgstr "TLS"
 
-#: src/err-sources.h:45
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "Qualquer fonte"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "Fonte definida pelo utilizador 1"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "Fonte definida pelo utilizador 2"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "Fonte definida pelo utilizador 3"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "Fonte definida pelo utilizador 4"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Fonte não conhecida"
 
@@ -1303,580 +1307,874 @@ msgid "Wrong name"
 msgstr "Nome desconhecido"
 
 #: src/err-codes.h:320
+#, fuzzy
+#| msgid "Not enabled"
+msgid "Not authenticated"
+msgstr "Não habilitado"
+
+#: src/err-codes.h:321
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Bad authentication"
+msgstr "Protecção não suportada"
+
+#: src/err-codes.h:322
+#, fuzzy
+#| msgid "No agent running"
+msgid "No Keybox daemon running"
+msgstr "Nenhum agente em execução"
+
+#: src/err-codes.h:323
+#, fuzzy
+#| msgid "SmartCard daemon error"
+msgid "Keybox daemon error"
+msgstr "Erro no demónio de SmartCard"
+
+#: src/err-codes.h:324
+msgid "Service is not running"
+msgstr ""
+
+#: src/err-codes.h:325
+#, fuzzy
+#| msgid "Keyserver error"
+msgid "Service error"
+msgstr "Erro no servidor de chaves"
+
+#: src/err-codes.h:326
 msgid "System bug detected"
 msgstr ""
 
-#: src/err-codes.h:321
+#: src/err-codes.h:327
 #, fuzzy
 #| msgid "Unknown system error"
 msgid "Unknown DNS error"
 msgstr "Erro de sistema desconhecido"
 
-#: src/err-codes.h:322
+#: src/err-codes.h:328
 #, fuzzy
 #| msgid "Invalid OID string"
 msgid "Invalid DNS section"
 msgstr "Sequência OID inválida"
 
-#: src/err-codes.h:323
+#: src/err-codes.h:329
 #, fuzzy
 #| msgid "Invalid S-expression"
 msgid "Invalid textual address form"
 msgstr "Expressão simbólica inválida"
 
-#: src/err-codes.h:324
+#: src/err-codes.h:330
 #, fuzzy
 #| msgid "Missing issuer certificate"
 msgid "Missing DNS query packet"
 msgstr "Certificado do emissor em falta"
 
-#: src/err-codes.h:325
+#: src/err-codes.h:331
 msgid "Missing DNS answer packet"
 msgstr ""
 
-#: src/err-codes.h:326
+#: src/err-codes.h:332
 msgid "Connection closed in DNS"
 msgstr ""
 
-#: src/err-codes.h:327
+#: src/err-codes.h:333
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "Verification failed in DNS"
 msgstr "Desencriptação falhada"
 
-#: src/err-codes.h:328
+#: src/err-codes.h:334
 #, fuzzy
 #| msgid "Timeout"
 msgid "DNS Timeout"
 msgstr "Tempo limite"
 
-#: src/err-codes.h:329
+#: src/err-codes.h:335
 #, fuzzy
 #| msgid "General IPC error"
 msgid "General LDAP error"
 msgstr "Erro genérico de IPC"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP attribute error"
 msgstr "Erro genérico"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP name error"
 msgstr "Erro genérico"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP security error"
 msgstr "Erro Assuan genérico"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP service error"
 msgstr "Erro genérico"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP update error"
 msgstr "Erro Assuan genérico"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr ""
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 #, fuzzy
 #| msgid "IPC write error"
 msgid "Private LDAP error code"
 msgstr "Erro de escrita de IPC"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other general LDAP error"
 msgstr "Erro genérico de IPC"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 #, fuzzy
 #| msgid "IPC connect call failed"
 msgid "LDAP connecting failed (X)"
 msgstr "Chamada de conexão de IPC falhada"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral limit exceeded"
 msgstr "Erro genérico"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr ""
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 #, fuzzy
 #| msgid "Card reset required"
 msgid "No LDAP results returned"
 msgstr "Reinicialização de cartão necessária"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 #, fuzzy
 #| msgid "Element not found"
 msgid "LDAP control not found"
 msgstr "Elemento não encontrado"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 #, fuzzy
 #| msgid "Not supported"
 msgid "Not supported by LDAP"
 msgstr "Não suportado"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 #, fuzzy
 #| msgid "Unexpected error"
 msgid "LDAP connect error"
 msgstr "Erro inesperado"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr ""
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr ""
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 #, fuzzy
 #| msgid "Unsupported operation"
 msgid "User cancelled LDAP operation"
 msgstr "Operação não suportada"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 #, fuzzy
 #| msgid "Bad certificate"
 msgid "Bad LDAP search filter"
 msgstr "Certificado errado"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "Unknown LDAP authentication method"
 msgstr "Extensão desconhecida"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 #, fuzzy
 #| msgid "Timeout"
 msgid "Timeout in LDAP"
 msgstr "Tempo limite"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP decoding error"
 msgstr "Erro no dirmngr"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP encoding error"
 msgstr "Erro no dirmngr"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 #, fuzzy
 #| msgid "IPC read error"
 msgid "LDAP local error"
 msgstr "Erro de leitura de IPC"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot contact LDAP server"
 msgstr "Não é um servidor IPC"
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP success"
 msgstr "Sucesso"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 #, fuzzy
 #| msgid "Configuration error"
 msgid "LDAP operations error"
 msgstr "Erro de configuração"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP protocol error"
 msgstr "Violação de protocolo"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr ""
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr ""
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "LDAP authentication method not supported"
 msgstr "Extensão desconhecida"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
 msgstr ""
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 #, fuzzy
 #| msgid "Fatal alert message received"
 msgid "Partial LDAP results+referral received"
 msgstr "Mensagem de alerta fatal recebida"
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral"
 msgstr "Erro genérico"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr ""
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr ""
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Confidentiality required by LDAP"
 msgstr "Reinicialização de cartão necessária"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr ""
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr ""
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 #, fuzzy
 #| msgid "Invalid attribute"
 msgid "Undefined LDAP attribute type"
 msgstr "Atributo inválido"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate matching in LDAP"
 msgstr "Protecção não suportada"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Constraint violation in LDAP"
 msgstr "Violação de protocolo"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr ""
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid syntax in LDAP"
 msgstr "Estado inválido"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 #, fuzzy
 #| msgid "No CMS object"
 msgid "No such LDAP object"
 msgstr "Sem objecto CMS"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 #, fuzzy
 #| msgid "Hardware problem"
 msgid "LDAP alias problem"
 msgstr "Problema de hardware"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid DN syntax in LDAP"
 msgstr "Estado inválido"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr ""
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 #, fuzzy
 #| msgid "Encoding problem"
 msgid "LDAP alias dereferencing problem"
 msgstr "Problema de codificação"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr ""
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate LDAP authentication"
 msgstr "Protecção não suportada"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 #, fuzzy
 #| msgid "Invalid card"
 msgid "Invalid LDAP credentials"
 msgstr "Cartão inválido"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr ""
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr ""
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 #, fuzzy
 #| msgid "No keyserver available"
 msgid "LDAP server is unavailable"
 msgstr "Sem servidor de chaves disponível"
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr ""
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr ""
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 #, fuzzy
 #| msgid "Missing action"
 msgid "LDAP naming violation"
 msgstr "Acção em falta"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP object class violation"
 msgstr "Violação de protocolo"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 #, fuzzy
 #| msgid "Operation not yet finished"
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "Operação ainda não completada"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation not allowed on RDN"
 msgstr "Operação cancelada"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr ""
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr ""
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 #, fuzzy
 #| msgid "Line too long"
 msgid "LDAP results too large"
 msgstr "Linha demasiado longa"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation affects multiple DSAs"
 msgstr "Operação cancelada"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr ""
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other LDAP error"
 msgstr "Erro genérico de IPC"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 #, fuzzy
 #| msgid "Resources exhausted"
 msgid "Resources exhausted in LCUP"
 msgstr "Recursos esgotados"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Security violation in LCUP"
 msgstr "Violação de protocolo"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid data in LCUP"
 msgstr "Estado inválido"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 #, fuzzy
 #| msgid "Unsupported certificate"
 msgid "Unsupported scheme in LCUP"
 msgstr "Certificado não suportado"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Reload required in LCUP"
 msgstr "Reinicialização de cartão necessária"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP cancelled"
 msgstr "Sucesso"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 #, fuzzy
 #| msgid "Not operational"
 msgid "No LDAP operation to cancel"
 msgstr "Não operacional"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 #, fuzzy
 #| msgid "Not operational"
 msgid "Too late to cancel LDAP"
 msgstr "Não operacional"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot cancel LDAP"
 msgstr "Não é um servidor IPC"
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "LDAP assertion failed"
 msgstr "Desencriptação falhada"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr ""
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "Código de erro definido pelo utilizador 1"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "Código de erro definido pelo utilizador 2"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "Código de erro definido pelo utilizador 3"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "Código de erro definido pelo utilizador 4"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "Código de erro definido pelo utilizador 5"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "Código de erro definido pelo utilizador 6"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "Código de erro definido pelo utilizador 7"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "Código de erro definido pelo utilizador 8"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "Código de erro definido pelo utilizador 9"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "Código de erro definido pelo utilizador 10"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "Código de erro definido pelo utilizador 11"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "Código de erro definido pelo utilizador 12"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "Código de erro definido pelo utilizador 13"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "Código de erro definido pelo utilizador 14"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "Código de erro definido pelo utilizador 15"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "Código de erro definido pelo utilizador 16"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+#, fuzzy
+#| msgid "Success"
+msgid "SQL success"
+msgstr "Sucesso"
+
+#: src/err-codes.h:433
+#, fuzzy
+#| msgid "Syntax error"
+msgid "SQL error"
+msgstr "Erro de sintaxe"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr ""
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr ""
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr ""
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr ""
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr ""
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr ""
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr ""
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr ""
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr ""
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr ""
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr ""
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr ""
+
+#: src/err-codes.h:447
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "SQL database lock protocol error"
+msgstr "Violação de protocolo"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr ""
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr ""
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr ""
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr ""
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr ""
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr ""
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr ""
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr ""
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr ""
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr ""
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr ""
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr ""
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "Erro de sistema sem errno"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Erro de sistema desconhecido"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Fim do ficheiro"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Código de erro desconhecido"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+#, fuzzy
+msgid "argument not expected"
+msgstr "a escrever chave privada para `%s'\n"
+
+#: src/argparse.c:496
+#, fuzzy
+msgid "read error"
+msgstr "erro de leitura"
+
+#: src/argparse.c:498
+#, fuzzy
+msgid "keyword too long"
+msgstr "frase secreta demasiado longa\n"
+
+#: src/argparse.c:500
+#, fuzzy
+msgid "missing argument"
+msgstr "argumento inválido"
+
+#: src/argparse.c:502
+#, fuzzy
+#| msgid "invalid armor"
+msgid "invalid argument"
+msgstr "armadura inválida"
+
+#: src/argparse.c:504
+#, fuzzy
+msgid "invalid command"
+msgstr "comandos em conflito\n"
+
+#: src/argparse.c:506
+#, fuzzy
+msgid "invalid alias definition"
+msgstr "opções de importação inválidas\n"
+
+#: src/argparse.c:508 src/argparse.c:545
+#, fuzzy
+#| msgid "Configuration error"
+msgid "permission error"
+msgstr "Erro de configuração"
+
+#: src/argparse.c:510 src/argparse.c:543
+#, fuzzy
+msgid "out of core"
+msgstr "não processado"
+
+#: src/argparse.c:514 src/argparse.c:549
+#, fuzzy
+msgid "invalid meta command"
+msgstr "comandos em conflito\n"
+
+#: src/argparse.c:516 src/argparse.c:551
+#, fuzzy
+#| msgid "Unknown command"
+msgid "unknown meta command"
+msgstr "Comando desconhecido"
+
+#: src/argparse.c:518 src/argparse.c:553
+#, fuzzy
+#| msgid "Unexpected IPC command"
+msgid "unexpected meta command"
+msgstr "Comando IPC inesperado"
+
+#: src/argparse.c:520
+#, fuzzy
+msgid "invalid option"
+msgstr "opções de importação inválidas\n"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:532
+#, fuzzy, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "opções de importação inválidas\n"
+
+#: src/argparse.c:534
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Utilização: %s GPG-ERROR [...]\n"
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr ""
+
+#: src/argparse.c:537
+#, fuzzy, c-format
+msgid "invalid command \"%.50s\"\n"
+msgstr "Comando inválido (tente \"help\")\n"
 
-#: src/gpg-error.c:633
+#: src/argparse.c:539
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: aviso: não consegui reconhecer %s\n"
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:555
+#, fuzzy, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr "opções de importação inválidas\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr ""
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr ""
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "aviso: não consegui reconhecer %s\n"
+
+#, fuzzy
+#~ msgid "out of core\n"
+#~ msgstr "não processado"
+
+#~ msgid "Usage: %s GPG-ERROR [...]\n"
+#~ msgstr "Utilização: %s GPG-ERROR [...]\n"
 
 #, fuzzy
 #~| msgid "Resources exhausted"
index 3ca1ae5..945ae69 100644 (file)
Binary files a/po/ro.gmo and b/po/ro.gmo differ
index fcc3459..2dc6c9d 100644 (file)
--- a/po/ro.po
+++ b/po/ro.po
@@ -9,8 +9,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libgpg-error 1.1\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2013-02-23 20:10+0100\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:42+0100\n"
 "Last-Translator: Laurentiu Buzdugan <lbuz@rolix.org>\n"
 "Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n"
 "Language: ro\n"
@@ -84,31 +84,35 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
-msgid "TLS"
-msgstr ""
+msgid "TPM2d"
+msgstr "TPM2d"
 
 #: src/err-sources.h:45
+msgid "TLS"
+msgstr "TLS"
+
+#: src/err-sources.h:46
 #, fuzzy
 msgid "Any source"
 msgstr "Sursă necunoscută"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "Sursă definită de utilizator 1"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "Sursă definită de utilizator 2"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "Sursă definită de utilizator 3"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "Sursă definită de utilizator 4"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Sursă necunoscută"
 
@@ -1376,559 +1380,850 @@ msgid "Wrong name"
 msgstr "Nume necunoscut"
 
 #: src/err-codes.h:320
+#, fuzzy
+msgid "Not authenticated"
+msgstr "Neforţat(ă)"
+
+#: src/err-codes.h:321
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Bad authentication"
+msgstr "Protecţie nesuportată"
+
+#: src/err-codes.h:322
+#, fuzzy
+#| msgid "No agent running"
+msgid "No Keybox daemon running"
+msgstr "Nu rulează nici un agent"
+
+#: src/err-codes.h:323
+#, fuzzy
+#| msgid "SmartCard daemon error"
+msgid "Keybox daemon error"
+msgstr "Eroare daemon SmartCard"
+
+#: src/err-codes.h:324
+msgid "Service is not running"
+msgstr ""
+
+#: src/err-codes.h:325
+#, fuzzy
+#| msgid "Keyserver error"
+msgid "Service error"
+msgstr "Eroare server de chei"
+
+#: src/err-codes.h:326
 msgid "System bug detected"
 msgstr ""
 
-#: src/err-codes.h:321
+#: src/err-codes.h:327
 #, fuzzy
 #| msgid "Unknown system error"
 msgid "Unknown DNS error"
 msgstr "Eroare de sistem necunoscută"
 
-#: src/err-codes.h:322
+#: src/err-codes.h:328
 #, fuzzy
 #| msgid "Invalid OID string"
 msgid "Invalid DNS section"
 msgstr "Şir OID invalid"
 
-#: src/err-codes.h:323
+#: src/err-codes.h:329
 #, fuzzy
 #| msgid "Invalid S-expression"
 msgid "Invalid textual address form"
 msgstr "Expresie-S invalidă"
 
-#: src/err-codes.h:324
+#: src/err-codes.h:330
 #, fuzzy
 msgid "Missing DNS query packet"
 msgstr "Certificat lipsă"
 
-#: src/err-codes.h:325
+#: src/err-codes.h:331
 msgid "Missing DNS answer packet"
 msgstr ""
 
-#: src/err-codes.h:326
+#: src/err-codes.h:332
 msgid "Connection closed in DNS"
 msgstr ""
 
-#: src/err-codes.h:327
+#: src/err-codes.h:333
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "Verification failed in DNS"
 msgstr "Decriptarea a eşuat"
 
-#: src/err-codes.h:328
+#: src/err-codes.h:334
 #, fuzzy
 #| msgid "Timeout"
 msgid "DNS Timeout"
 msgstr "Pauză"
 
-#: src/err-codes.h:329
+#: src/err-codes.h:335
 #, fuzzy
 msgid "General LDAP error"
 msgstr "Eroare generală"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP attribute error"
 msgstr "Eroare generală"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP name error"
 msgstr "Eroare generală"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 #, fuzzy
 msgid "General LDAP security error"
 msgstr "Eroare generală"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP service error"
 msgstr "Eroare generală"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 #, fuzzy
 msgid "General LDAP update error"
 msgstr "Eroare generală"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr ""
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 #, fuzzy
 msgid "Private LDAP error code"
 msgstr "Eroare card"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 #, fuzzy
 msgid "Other general LDAP error"
 msgstr "Eroare generală"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "LDAP connecting failed (X)"
 msgstr "Decriptarea a eşuat"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral limit exceeded"
 msgstr "Eroare generală"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr ""
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 #, fuzzy
 #| msgid "Card reset required"
 msgid "No LDAP results returned"
 msgstr "Este necesară resetarea cardului"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 #, fuzzy
 #| msgid "Element not found"
 msgid "LDAP control not found"
 msgstr "Elementul nu a fost găsit"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 #, fuzzy
 #| msgid "Not supported"
 msgid "Not supported by LDAP"
 msgstr "Nu este suportat(ă)"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 #, fuzzy
 #| msgid "Unexpected error"
 msgid "LDAP connect error"
 msgstr "Eroare neaşteptată"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr ""
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr ""
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 #, fuzzy
 #| msgid "Unsupported operation"
 msgid "User cancelled LDAP operation"
 msgstr "Operaţie nesuportată"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 #, fuzzy
 #| msgid "Bad certificate"
 msgid "Bad LDAP search filter"
 msgstr "Certificat incorect"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 #, fuzzy
 msgid "Unknown LDAP authentication method"
 msgstr "Expresie-S necunoscută"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 #, fuzzy
 #| msgid "Timeout"
 msgid "Timeout in LDAP"
 msgstr "Pauză"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP decoding error"
 msgstr "eroare dirmngr"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP encoding error"
 msgstr "eroare dirmngr"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 #, fuzzy
 msgid "LDAP local error"
 msgstr "Eroare card"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 msgid "Cannot contact LDAP server"
 msgstr ""
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP success"
 msgstr "Succes"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 #, fuzzy
 #| msgid "Configuration error"
 msgid "LDAP operations error"
 msgstr "Eroare de configurare"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP protocol error"
 msgstr "Violare de protocol"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr ""
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr ""
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 #, fuzzy
 msgid "LDAP authentication method not supported"
 msgstr "Expresie-S necunoscută"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
 msgstr ""
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 msgid "Partial LDAP results+referral received"
 msgstr ""
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral"
 msgstr "Eroare generală"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr ""
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr ""
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Confidentiality required by LDAP"
 msgstr "Este necesară resetarea cardului"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr ""
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr ""
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 #, fuzzy
 #| msgid "Invalid attribute"
 msgid "Undefined LDAP attribute type"
 msgstr "Argument invalid"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate matching in LDAP"
 msgstr "Protecţie nesuportată"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Constraint violation in LDAP"
 msgstr "Violare de protocol"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr ""
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid syntax in LDAP"
 msgstr "Stare invalidă"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 #, fuzzy
 #| msgid "No CMS object"
 msgid "No such LDAP object"
 msgstr "Nici un obiect CMS"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 #, fuzzy
 #| msgid "Hardware problem"
 msgid "LDAP alias problem"
 msgstr "Problemă hardware"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid DN syntax in LDAP"
 msgstr "Stare invalidă"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr ""
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 #, fuzzy
 #| msgid "Encoding problem"
 msgid "LDAP alias dereferencing problem"
 msgstr "Problemă de encodare"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr ""
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate LDAP authentication"
 msgstr "Protecţie nesuportată"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 #, fuzzy
 #| msgid "Invalid card"
 msgid "Invalid LDAP credentials"
 msgstr "Card invalid"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr ""
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr ""
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 msgid "LDAP server is unavailable"
 msgstr ""
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr ""
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr ""
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 #, fuzzy
 #| msgid "Missing action"
 msgid "LDAP naming violation"
 msgstr "Acţiune lipsă"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP object class violation"
 msgstr "Violare de protocol"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 #, fuzzy
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "Operaţiune anulată"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation not allowed on RDN"
 msgstr "Operaţiune anulată"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr ""
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr ""
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 #, fuzzy
 #| msgid "Line too long"
 msgid "LDAP results too large"
 msgstr "Linie prea lungă"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation affects multiple DSAs"
 msgstr "Operaţiune anulată"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr ""
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 #, fuzzy
 msgid "Other LDAP error"
 msgstr "Eroare generală"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 #, fuzzy
 #| msgid "Resources exhausted"
 msgid "Resources exhausted in LCUP"
 msgstr "Resurse epuizate"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Security violation in LCUP"
 msgstr "Violare de protocol"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid data in LCUP"
 msgstr "Stare invalidă"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 #, fuzzy
 #| msgid "Unsupported certificate"
 msgid "Unsupported scheme in LCUP"
 msgstr "Certificat nesuportat"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Reload required in LCUP"
 msgstr "Este necesară resetarea cardului"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP cancelled"
 msgstr "Succes"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 #, fuzzy
 msgid "No LDAP operation to cancel"
 msgstr "Operaţie nesuportată"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 #, fuzzy
 msgid "Too late to cancel LDAP"
 msgstr "Operaţie nesuportată"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 msgid "Cannot cancel LDAP"
 msgstr ""
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "LDAP assertion failed"
 msgstr "Decriptarea a eşuat"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr ""
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "Cod de eroare definit de utilizator 1"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "Cod de eroare definit de utilizator 2"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "Cod de eroare definit de utilizator 3"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "Cod de eroare definit de utilizator 4"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "Cod de eroare definit de utilizator 5"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "Cod de eroare definit de utilizator 6"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "Cod de eroare definit de utilizator 7"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "Cod de eroare definit de utilizator 8"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "Cod de eroare definit de utilizator 9"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "Cod de eroare definit de utilizator 10"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "Cod de eroare definit de utilizator 11"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "Cod de eroare definit de utilizator 12"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "Cod de eroare definit de utilizator 13"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "Cod de eroare definit de utilizator 14"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "Cod de eroare definit de utilizator 15"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "Cod de eroare definit de utilizator 16"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+#, fuzzy
+#| msgid "Success"
+msgid "SQL success"
+msgstr "Succes"
+
+#: src/err-codes.h:433
+#, fuzzy
+#| msgid "Syntax error"
+msgid "SQL error"
+msgstr "Eroare de sintaxă"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr ""
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr ""
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr ""
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr ""
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr ""
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr ""
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr ""
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr ""
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr ""
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr ""
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr ""
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr ""
+
+#: src/err-codes.h:447
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "SQL database lock protocol error"
+msgstr "Violare de protocol"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr ""
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr ""
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr ""
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr ""
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr ""
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr ""
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr ""
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr ""
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr ""
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr ""
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr ""
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr ""
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr ""
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Eroare de sistem necunoscută"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Sfârşit de fişier"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Cod de eroare necunoscut"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+#, fuzzy
+msgid "argument not expected"
+msgstr "Nu sunt permise comenzi administrare\n"
+
+#: src/argparse.c:496
+#, fuzzy
+msgid "read error"
+msgstr "eroare citire fişier"
+
+#: src/argparse.c:498
+#, fuzzy
+msgid "keyword too long"
+msgstr "linie prea lungă"
+
+#: src/argparse.c:500
+#, fuzzy
+msgid "missing argument"
+msgstr "argument invalid"
+
+#: src/argparse.c:502
+#, fuzzy
+#| msgid "invalid armor"
+msgid "invalid argument"
+msgstr "armură invalidă"
+
+#: src/argparse.c:504
+#, fuzzy
+msgid "invalid command"
+msgstr "Comandă numai-administrare\n"
+
+#: src/argparse.c:506
+#, fuzzy
+msgid "invalid alias definition"
+msgstr "opţiuni enumerare invalide\n"
+
+#: src/argparse.c:508 src/argparse.c:545
+#, fuzzy
+#| msgid "Configuration error"
+msgid "permission error"
+msgstr "Eroare de configurare"
+
+#: src/argparse.c:510 src/argparse.c:543
+#, fuzzy
+msgid "out of core"
+msgstr "neforţat(ă)"
+
+#: src/argparse.c:514 src/argparse.c:549
+#, fuzzy
+msgid "invalid meta command"
+msgstr "Comandă numai-administrare\n"
+
+#: src/argparse.c:516 src/argparse.c:551
+#, fuzzy
+msgid "unknown meta command"
+msgstr "Cod de eroare necunoscut"
+
+#: src/argparse.c:518 src/argparse.c:553
+#, fuzzy
+msgid "unexpected meta command"
+msgstr "Etichetă neaşteptată"
+
+#: src/argparse.c:520
+#, fuzzy
+msgid "invalid option"
+msgstr "opţiuni enumerare invalide\n"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:532
+#, fuzzy, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "opţiuni enumerare invalide\n"
+
+#: src/argparse.c:534
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Folosire: %s EROARE-GPG [...]\n"
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr ""
+
+#: src/argparse.c:537
+#, fuzzy, c-format
+msgid "invalid command \"%.50s\"\n"
+msgstr "Comandă invalidă  (încercaţi \"ajutor\")\n"
 
-#: src/gpg-error.c:633
+#: src/argparse.c:539
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: avertisment: nu am putut recunoaşte %s\n"
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:555
+#, fuzzy, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr "opţiuni enumerare invalide\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr ""
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr ""
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "avertisment: nu am putut recunoaşte %s\n"
+
+#, fuzzy
+#~ msgid "out of core\n"
+#~ msgstr "neforţat(ă)"
+
+#~ msgid "Usage: %s GPG-ERROR [...]\n"
+#~ msgstr "Folosire: %s EROARE-GPG [...]\n"
 
 #, fuzzy
 #~| msgid "Resources exhausted"
index 0fd2d56..2aca631 100644 (file)
Binary files a/po/ru.gmo and b/po/ru.gmo differ
index a9e3753..23f404b 100644 (file)
--- a/po/ru.po
+++ b/po/ru.po
@@ -1,14 +1,14 @@
 # Russian translation for libgpg-error.
-# Copyright (C) 2015 Free Software Foundation, Inc.
+# Copyright (C) 2021 Free Software Foundation, Inc.
 # This file is distributed under the same license as the original package.
-# Ineiev <ineiev@gnu.org>, 2014, 2015
+# Ineiev <ineiev@gnu.org>, 2014, 2015, 2018, 2019, 2020, 2021
 #
 msgid ""
 msgstr ""
 "Project-Id-Version: libgpg-error\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2015-09-27 12:04+0000\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-10-12 10:43+0100\n"
 "Last-Translator: Ineiev <ineiev@gnu.org>\n"
 "Language-Team: Russian <gnupg-ru@gnupg.org>\n"
 "Language: ru\n"
@@ -38,7 +38,7 @@ msgstr "Агент GPG"
 
 #: src/err-sources.h:33
 msgid "Pinentry"
-msgstr "Ð\92вод PIN"
+msgstr "Ð\9fÑ\80огÑ\80амма Ð²Ð²Ð¾Ð´Ð° Ð¿Ð°Ñ\80олÑ\8f"
 
 #: src/err-sources.h:34
 msgid "SCD"
@@ -81,30 +81,34 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
+msgid "TPM2d"
+msgstr ""
+
+#: src/err-sources.h:45
 msgid "TLS"
 msgstr "TLS"
 
-#: src/err-sources.h:45
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "Любой источник"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "Пользовательский источник 1"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "Пользовательский источник 2"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "Пользовательский источник 3"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "Пользовательский источник 4"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Неизвестный источник"
 
@@ -130,7 +134,7 @@ msgstr "Недопустимый алгоритм шифрования с отк
 
 #: src/err-codes.h:33
 msgid "Invalid digest algorithm"
-msgstr "Недопустимая хэш-функция"
+msgstr "Недопустимая хеш-функция"
 
 #: src/err-codes.h:34
 msgid "Bad public key"
@@ -138,7 +142,7 @@ msgstr "Плохой открытый ключ"
 
 #: src/err-codes.h:35
 msgid "Bad secret key"
-msgstr "Плохой закрытый ключ"
+msgstr "Плохой секретный ключ"
 
 #: src/err-codes.h:36
 msgid "Bad signature"
@@ -162,7 +166,7 @@ msgstr "Недопустимый алгоритм симметричного ш
 
 #: src/err-codes.h:41
 msgid "Cannot open keyring"
-msgstr "ТаблиÑ\86а ÐºÐ»Ñ\8eÑ\87ей Ð¾Ñ\82кÑ\80Ñ\8bÑ\82а"
+msgstr "ТаблиÑ\86а ÐºÐ»Ñ\8eÑ\87ей Ð½Ðµ Ð¾Ñ\82кÑ\80Ñ\8bваеÑ\82Ñ\81Ñ\8f"
 
 #: src/err-codes.h:42
 msgid "Invalid packet"
@@ -170,19 +174,19 @@ msgstr "Недопустимый пакет"
 
 #: src/err-codes.h:43
 msgid "Invalid armor"
-msgstr "Недопустимый текстовый формат"
+msgstr "Недопустимая текстовая оболочка"
 
 #: src/err-codes.h:44
 msgid "No user ID"
-msgstr "Нет ID пользователя"
+msgstr "Нет идентификатора пользователя"
 
 #: src/err-codes.h:45
 msgid "No secret key"
-msgstr "Нет закрытого ключа"
+msgstr "Нет секретного ключа"
 
 #: src/err-codes.h:46
 msgid "Wrong secret key used"
-msgstr "Использован неверный закрытый ключ"
+msgstr "Использован неверный секретный ключ"
 
 #: src/err-codes.h:47
 msgid "Bad session key"
@@ -258,7 +262,7 @@ msgstr "Плохой сертификат"
 
 #: src/err-codes.h:65
 msgid "Invalid user ID"
-msgstr "Недопустимый ID пользователя"
+msgstr "Недопустимый идентификатор пользователя"
 
 #: src/err-codes.h:66
 msgid "Unexpected error"
@@ -326,7 +330,7 @@ msgstr "Непригодный открытый ключ"
 
 #: src/err-codes.h:82
 msgid "Unusable secret key"
-msgstr "Непригодный закрытый ключ"
+msgstr "Непригодный секретный ключ"
 
 #: src/err-codes.h:83
 msgid "Invalid value"
@@ -334,7 +338,7 @@ msgstr "Недопустимое значение"
 
 #: src/err-codes.h:84
 msgid "Bad certificate chain"
-msgstr "Ð\9fлоÑ\85аÑ\8f Ñ\81еÑ\80Ñ\82иÑ\84икаÑ\82наÑ\8f Ñ\86епÑ\8c"
+msgstr "Ð\9fлоÑ\85аÑ\8f Ñ\86епÑ\8c Ñ\81еÑ\80Ñ\82иÑ\84икаÑ\82ов"
 
 #: src/err-codes.h:85
 msgid "Missing certificate"
@@ -358,7 +362,7 @@ msgstr "Недопустимый код операции"
 
 #: src/err-codes.h:90
 msgid "Timeout"
-msgstr "Ð\9bимиÑ\82 Ð²Ñ\80емени"
+msgstr "Ð\92Ñ\80емÑ\8f Ð¸Ñ\81Ñ\87еÑ\80пано"
 
 #: src/err-codes.h:91
 msgid "Internal error"
@@ -450,15 +454,15 @@ msgstr "Алгоритм не поддерживается"
 
 #: src/err-codes.h:113
 msgid "No pinentry"
-msgstr "Ð\9dеÑ\82 Ð¼Ð¾Ð´Ñ\83лÑ\8f Ð²Ð²Ð¾Ð´Ð° PIN"
+msgstr "Ð\9dеÑ\82 Ð¿Ñ\80огÑ\80аммÑ\8b Ð²Ð²Ð¾Ð´Ð° Ð¿Ð°Ñ\80олÑ\8f"
 
 #: src/err-codes.h:114
 msgid "pinentry error"
-msgstr "оÑ\88ибка Ð²Ð²Ð¾Ð´Ð° PIN"
+msgstr "оÑ\88ибка Ð¿Ñ\80и Ð²Ð²Ð¾Ð´Ðµ Ð¿Ð°Ñ\80олÑ\8f"
 
 #: src/err-codes.h:115
 msgid "Bad PIN"
-msgstr "Плохой PIN"
+msgstr "Плохой пароль"
 
 #: src/err-codes.h:116
 msgid "Invalid name"
@@ -490,7 +494,7 @@ msgstr "Сертификат отозван"
 
 #: src/err-codes.h:123
 msgid "No CRL known"
-msgstr "СпиÑ\81ок Ð¾Ñ\82озваннÑ\8bÑ\85 Ñ\81еÑ\80Ñ\82иÑ\84икаÑ\82ов Ð½ÐµÐ¸Ð·Ð²ÐµÑ\81Ñ\82ен"
+msgstr "Ð\9eÑ\82Ñ\81Ñ\83Ñ\82Ñ\81Ñ\82вÑ\83еÑ\82 Ñ\81пиÑ\81ок Ð¾Ñ\82озваннÑ\8bÑ\85 Ñ\81еÑ\80Ñ\82иÑ\84икаÑ\82ов"
 
 #: src/err-codes.h:124
 msgid "CRL too old"
@@ -550,7 +554,7 @@ msgstr "Требуется перезапуск карты"
 
 #: src/err-codes.h:138
 msgid "Card removed"
-msgstr "Карта удалена"
+msgstr "Карта вынута"
 
 #: src/err-codes.h:139
 msgid "Invalid card"
@@ -574,7 +578,7 @@ msgstr "Ошибка конфигурации"
 
 #: src/err-codes.h:144
 msgid "No policy match"
-msgstr "Ð\9fÑ\80облема Ñ\81 Ð¿Ñ\80авилами"
+msgstr "Ð\9dеÑ\82 Ñ\81ооÑ\82веÑ\82Ñ\81Ñ\82вÑ\83Ñ\8eÑ\89его Ð¿Ñ\80авила"
 
 #: src/err-codes.h:145
 msgid "Invalid index"
@@ -586,11 +590,11 @@ msgstr "Недопустимый идентификатор"
 
 #: src/err-codes.h:147
 msgid "No SmartCard daemon"
-msgstr "Нет демона смарткарт"
+msgstr "Нет демона криптографических карт"
 
 #: src/err-codes.h:148
 msgid "SmartCard daemon error"
-msgstr "Ошибка демона смарткарт"
+msgstr "Ошибка демона криптографических карт"
 
 #: src/err-codes.h:149
 msgid "Unsupported protocol"
@@ -618,7 +622,7 @@ msgstr "Ничего не найдено"
 
 #: src/err-codes.h:155
 msgid "Wrong blob type"
-msgstr "Ð\9aÑ\83Ñ\81ок неподходящего типа"
+msgstr "Ð\94аннÑ\8bе неподходящего типа"
 
 #: src/err-codes.h:156
 msgid "Missing value"
@@ -718,7 +722,7 @@ msgstr "Открытый ключ не доверенный"
 
 #: src/err-codes.h:180
 msgid "Decryption failed"
-msgstr "Сбой Ñ\80аÑ\81Ñ\88иÑ\84Ñ\80овки"
+msgstr "Сбой Ñ\80аÑ\81Ñ\88иÑ\84Ñ\80ованиÑ\8f"
 
 #: src/err-codes.h:181
 msgid "Key expired"
@@ -894,7 +898,7 @@ msgstr "Открытый ключ поврежден"
 
 #: src/err-codes.h:224
 msgid "Broken secret key"
-msgstr "Ð\97акÑ\80Ñ\8bÑ\82ый ключ поврежден"
+msgstr "СекÑ\80еÑ\82ный ключ поврежден"
 
 #: src/err-codes.h:225
 msgid "Invalid MAC algorithm"
@@ -950,7 +954,7 @@ msgstr "Непарные квадратные скобки"
 
 #: src/err-codes.h:238
 msgid "Unexpected reserved punctuation in S-expression"
-msgstr "Неожиданная зарезервированная пунктуации в S-выражении"
+msgstr "Неожиданная зарезервированная пунктуация в S-выражении"
 
 #: src/err-codes.h:239
 msgid "Bad hexadecimal character in S-expression"
@@ -958,7 +962,7 @@ msgstr "Плохой шестнадцатеричный символ в S-выр
 
 #: src/err-codes.h:240
 msgid "Odd hexadecimal numbers in S-expression"
-msgstr "ШеÑ\81Ñ\82надÑ\86аÑ\82еÑ\80иÑ\87нÑ\8bе Ñ\87иÑ\81ла Ð½ÐµÑ\87еÑ\82ной Ð´Ð»Ð¸Ð½Ñ\8b в S-выражении"
+msgstr "Ð\9dеÑ\87еÑ\82нÑ\8bе Ñ\88еÑ\81Ñ\82надÑ\86аÑ\82еÑ\80иÑ\87нÑ\8bе Ñ\87иÑ\81ла в S-выражении"
 
 #: src/err-codes.h:241
 msgid "Bad octal character in S-expression"
@@ -966,29 +970,23 @@ msgstr "Плохой восьмеричный символ в S-выражени
 
 #: src/err-codes.h:242
 msgid "All subkeys are expired or revoked"
-msgstr ""
+msgstr "Все подключи просрочены или отозваны"
 
 #: src/err-codes.h:243
-#, fuzzy
-#| msgid "Data not encrypted"
 msgid "Database is corrupted"
-msgstr "Ð\94аннÑ\8bе Ð½Ðµ Ð·Ð°Ñ\88иÑ\84Ñ\80ованÑ\8b"
+msgstr "Ð\91аза Ð´Ð°Ð½Ð½Ñ\8bÑ\85 Ð¿Ð¾Ð²Ñ\80еждена"
 
 #: src/err-codes.h:244
 msgid "Server indicated a failure"
-msgstr ""
+msgstr "Сервер указал на сбой"
 
 #: src/err-codes.h:245
-#, fuzzy
-#| msgid "Unknown name"
 msgid "No name"
-msgstr "Неизвестное имя"
+msgstr "Нет имени"
 
 #: src/err-codes.h:246
-#, fuzzy
-#| msgid "No public key"
 msgid "No key"
-msgstr "Ð\9dеÑ\82 Ð¾Ñ\82кÑ\80Ñ\8bÑ\82ого ÐºÐ»Ñ\8eÑ\87а"
+msgstr "Нет ключа"
 
 #: src/err-codes.h:247
 msgid "Legacy key"
@@ -1004,11 +1002,11 @@ msgstr "Слишком длинный запрос"
 
 #: src/err-codes.h:250
 msgid "Object is in termination state"
-msgstr "Ð\9eбÑ\8aекÑ\82 Ð¿Ñ\80екÑ\80аÑ\89аеÑ\82 Ñ\80абоÑ\82Ñ\83"
+msgstr "Ð\9eбÑ\8aекÑ\82 Ð² Ñ\81Ñ\82адии Ð·Ð°Ð²ÐµÑ\80Ñ\88ениÑ\8f"
 
 #: src/err-codes.h:251
 msgid "No certificate chain"
-msgstr "Ð\9dеÑ\82 Ñ\81еÑ\80Ñ\82иÑ\84икаÑ\82ной Ñ\86епи"
+msgstr "Ð\9dеÑ\82 Ñ\86епи Ñ\81еÑ\80Ñ\82иÑ\84икаÑ\82ов"
 
 #: src/err-codes.h:252
 msgid "Certificate is too large"
@@ -1068,11 +1066,11 @@ msgstr "Плохое сертификатное сообщение при уст
 
 #: src/err-codes.h:266
 msgid "Bad certificate request message in handshake"
-msgstr "Плохое сообщение-запрос сертификата при установлении связи"
+msgstr "Плохое сообщение запроса сертификата при установлении связи"
 
 #: src/err-codes.h:267
 msgid "Bad certificate verify message in handshake"
-msgstr "Плохое сообщение-проверка сертификата при установлении связи"
+msgstr "Плохое сообщение проверки сертификата при установлении связи"
 
 #: src/err-codes.h:268
 msgid "Bad change cipher message in handshake"
@@ -1124,11 +1122,11 @@ msgstr "Недопустимый объект блокировки"
 
 #: src/err-codes.h:280
 msgid "True"
-msgstr ""
+msgstr "Истина"
 
 #: src/err-codes.h:281
 msgid "False"
-msgstr ""
+msgstr "Ложь"
 
 #: src/err-codes.h:282
 msgid "General IPC error"
@@ -1227,537 +1225,782 @@ msgid "Unknown IPC inquire"
 msgstr "Неизвестный запрос IPC"
 
 #: src/err-codes.h:306
-#, fuzzy
-#| msgid "No crypto engine"
 msgid "Crypto engine too old"
-msgstr "Ð\9dеÑ\82 ÐºÑ\80ипÑ\82омеÑ\85анизма"
+msgstr "Ð\9aÑ\80ипÑ\82омеÑ\85анизм Ñ\81лиÑ\88ком Ñ\81Ñ\82аÑ\80"
 
 #: src/err-codes.h:307
 msgid "Screen or window too small"
-msgstr ""
+msgstr "Экран или окно слишком мало"
 
 #: src/err-codes.h:308
 msgid "Screen or window too large"
-msgstr ""
+msgstr "Экран или окно слишком велико"
 
 #: src/err-codes.h:309
 msgid "Required environment variable not set"
-msgstr ""
+msgstr "Требуемая переменная среды не установлена"
 
 #: src/err-codes.h:310
-#, fuzzy
-#| msgid "Already exists (LDAP)"
 msgid "User ID already exists"
-msgstr "Уже ÐµÑ\81Ñ\82Ñ\8c (LDAP)"
+msgstr "Ð\98денÑ\82иÑ\84икаÑ\82оÑ\80 Ð¿Ð¾Ð»Ñ\8cзоваÑ\82елÑ\8f Ñ\83же Ñ\81Ñ\83Ñ\89еÑ\81Ñ\82вÑ\83еÑ\82"
 
 #: src/err-codes.h:311
-#, fuzzy
-#| msgid "Already exists (LDAP)"
 msgid "Name already exists"
-msgstr "Уже ÐµÑ\81Ñ\82Ñ\8c (LDAP)"
+msgstr "Ð\98мÑ\8f Ñ\83же Ñ\81Ñ\83Ñ\89еÑ\81Ñ\82вÑ\83еÑ\82"
 
 #: src/err-codes.h:312
-#, fuzzy
-#| msgid "Duplicated value"
 msgid "Duplicated name"
-msgstr "Ð\92елиÑ\87ина Ð¿Ñ\80одÑ\83блиÑ\80ована"
+msgstr "Ð\98мÑ\8f Ð¿Ñ\80одÑ\83блиÑ\80овано"
 
 #: src/err-codes.h:313
-#, fuzzy
-#| msgid "Certificate too young"
 msgid "Object is too young"
-msgstr "СеÑ\80Ñ\82иÑ\84икаÑ\82 Ñ\81лиÑ\88ком Ð½Ð¾Ð²Ñ\8bй"
+msgstr "Ð\9eбÑ\8aекÑ\82 Ñ\81лиÑ\88ком Ð½Ð¾Ð²"
 
 #: src/err-codes.h:314
-#, fuzzy
-#| msgid "Provided object is too short"
 msgid "Object is too old"
-msgstr "Ð\92веденнÑ\8bй Ð¾Ð±Ñ\8aекÑ\82 Ñ\81лиÑ\88ком Ð¼Ð°Ð»"
+msgstr "Ð\9eбÑ\8aекÑ\82 Ñ\81лиÑ\88ком Ñ\81Ñ\82аÑ\80"
 
 #: src/err-codes.h:315
-#, fuzzy
-#| msgid "Unknown name"
 msgid "Unknown flag"
-msgstr "Неизвестное имя"
+msgstr "Неизвестный признак"
 
 #: src/err-codes.h:316
-#, fuzzy
-#| msgid "Invalid operation code"
 msgid "Invalid execution order"
-msgstr "Ð\9dедопÑ\83Ñ\81Ñ\82имÑ\8bй ÐºÐ¾Ð´ Ð¾Ð¿ÐµÑ\80аÑ\86ии"
+msgstr "Ð\9dедопÑ\83Ñ\81Ñ\82имÑ\8bй Ð¿Ð¾Ñ\80Ñ\8fдок Ð²Ñ\8bполнениÑ\8f"
 
 #: src/err-codes.h:317
 msgid "Already fetched"
-msgstr ""
+msgstr "Уже доставлено"
 
 #: src/err-codes.h:318
 msgid "Try again later"
-msgstr ""
+msgstr "Повторите попытку позднее"
 
 #: src/err-codes.h:319
 #, fuzzy
-#| msgid "Unknown name"
+#| msgid "No name"
 msgid "Wrong name"
-msgstr "Неизвестное имя"
+msgstr "Нет имени"
 
 #: src/err-codes.h:320
-msgid "System bug detected"
-msgstr ""
+#, fuzzy
+#| msgid "Not enabled"
+msgid "Not authenticated"
+msgstr "Отключено"
 
 #: src/err-codes.h:321
 #, fuzzy
-#| msgid "Unknown system error"
-msgid "Unknown DNS error"
-msgstr "Ð\9dеизвеÑ\81Ñ\82наÑ\8f Ñ\81иÑ\81Ñ\82емнаÑ\8f Ð¾Ñ\88ибка"
+#| msgid "Inappropriate LDAP authentication"
+msgid "Bad authentication"
+msgstr "Ð\9dеподÑ\85одÑ\8fÑ\89ее Ñ\83доÑ\81Ñ\82овеÑ\80ение LDAP"
 
 #: src/err-codes.h:322
 #, fuzzy
-#| msgid "Invalid OID string"
-msgid "Invalid DNS section"
-msgstr "Ð\9dедопÑ\83Ñ\81Ñ\82имаÑ\8f Ñ\81Ñ\82Ñ\80ока OID"
+#| msgid "No agent running"
+msgid "No Keybox daemon running"
+msgstr "Ð\90генÑ\82 Ð½Ðµ Ñ\80абоÑ\82аеÑ\82"
 
 #: src/err-codes.h:323
 #, fuzzy
-#| msgid "Invalid S-expression"
-msgid "Invalid textual address form"
-msgstr "Ð\9dедопÑ\83Ñ\81Ñ\82имое S-вÑ\8bÑ\80ажение"
+#| msgid "SmartCard daemon error"
+msgid "Keybox daemon error"
+msgstr "Ð\9eÑ\88ибка Ð´ÐµÐ¼Ð¾Ð½Ð° ÐºÑ\80ипÑ\82огÑ\80аÑ\84иÑ\87еÑ\81киÑ\85 ÐºÐ°Ñ\80Ñ\82"
 
 #: src/err-codes.h:324
+msgid "Service is not running"
+msgstr ""
+
+#: src/err-codes.h:325
 #, fuzzy
-#| msgid "Missing issuer certificate"
+#| msgid "Keyserver error"
+msgid "Service error"
+msgstr "Ошибка сервера ключей"
+
+#: src/err-codes.h:326
+msgid "System bug detected"
+msgstr "Обнаружена ошибка в системе"
+
+#: src/err-codes.h:327
+msgid "Unknown DNS error"
+msgstr "Неизвестная ошибка DNS"
+
+#: src/err-codes.h:328
+msgid "Invalid DNS section"
+msgstr "Недопустимый раздел DNS"
+
+#: src/err-codes.h:329
+msgid "Invalid textual address form"
+msgstr "Недопустимая текстуальная форма адреса"
+
+#: src/err-codes.h:330
 msgid "Missing DNS query packet"
-msgstr "Не хватает сертификата издателя"
+msgstr "Не хватает пакета запроса DNS"
 
-#: src/err-codes.h:325
+#: src/err-codes.h:331
 msgid "Missing DNS answer packet"
-msgstr ""
+msgstr "Не хватает ответного пакета DNS"
 
-#: src/err-codes.h:326
+#: src/err-codes.h:332
 msgid "Connection closed in DNS"
-msgstr ""
+msgstr "В DNS прервано соединение"
 
-#: src/err-codes.h:327
-#, fuzzy
-#| msgid "Decryption failed"
+#: src/err-codes.h:333
 msgid "Verification failed in DNS"
-msgstr "Сбой расшифровки"
+msgstr "Сбой проверки в DNS"
 
-#: src/err-codes.h:328
-#, fuzzy
-#| msgid "Timeout"
+#: src/err-codes.h:334
 msgid "DNS Timeout"
-msgstr "Лимит времени"
+msgstr "Лимит времени DNS"
 
-#: src/err-codes.h:329
+#: src/err-codes.h:335
 msgid "General LDAP error"
 msgstr "Общая ошибка LDAP"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 msgid "General LDAP attribute error"
 msgstr "Общая ошибка в атрибуте LDAP"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 msgid "General LDAP name error"
 msgstr "Общая ошибка в имени LDAP"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 msgid "General LDAP security error"
 msgstr "Общая ошибка безопасности LDAP"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 msgid "General LDAP service error"
 msgstr "Общая ошибка службы LDAP"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 msgid "General LDAP update error"
 msgstr "Общая ошибка обновления LDAP"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr "Экспериментальный код ошибки LDAP"
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 msgid "Private LDAP error code"
 msgstr "Внутренний код ошибки LDAP"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 msgid "Other general LDAP error"
 msgstr "Другая общая ошибка LDAP"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 msgid "LDAP connecting failed (X)"
 msgstr "Отказ соединения LDAP (X)"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 msgid "LDAP referral limit exceeded"
-msgstr "Ð\98Ñ\81Ñ\87еÑ\80пан Ð»Ð¸Ð¼Ð¸Ñ\82 ссылок LDAP"
+msgstr "СлиÑ\88ком Ð¼Ð½Ð¾Ð³Ð¾ ссылок LDAP"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr "Цикл клиента LDAP"
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 msgid "No LDAP results returned"
 msgstr "Нет результатов LDAP"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 msgid "LDAP control not found"
 msgstr "Элемент управления LDAP не найден"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 msgid "Not supported by LDAP"
 msgstr "Не поддерживается функцией LDAP"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 msgid "LDAP connect error"
 msgstr "Ошибка соединения LDAP"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr "Исчерпана память в LDAP"
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr "Неверный параметр процедуры LDAP"
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 msgid "User cancelled LDAP operation"
 msgstr "Пользователь отменил операцию LDAP"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 msgid "Bad LDAP search filter"
 msgstr "Плохой фильтр поиска LDAP"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 msgid "Unknown LDAP authentication method"
-msgstr "Неизвестный метод аутентификации LDAP"
+msgstr "Неизвестный метод удостоверения LDAP"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 msgid "Timeout in LDAP"
 msgstr "Лимит времени в LDAP"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 msgid "LDAP decoding error"
 msgstr "Ошибка декодирования LDAP"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 msgid "LDAP encoding error"
 msgstr "Ошибка кодирования LDAP"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 msgid "LDAP local error"
 msgstr "Локальная ошибка LDAP"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 msgid "Cannot contact LDAP server"
 msgstr "Не удалось связаться с сервером LDAP"
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 msgid "LDAP success"
 msgstr "Успешное выполнение LDAP"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 msgid "LDAP operations error"
 msgstr "Ошибка операций LDAP"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 msgid "LDAP protocol error"
 msgstr "Ошибка протокола LDAP"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr "Исчерпан лимит времени в LDAP"
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr "Исчерпан лимит размера в LDAP"
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr "Сравнение LDAP: ложь"
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr "Сравнение LDAP: истина"
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 msgid "LDAP authentication method not supported"
-msgstr "Метод аутентификации LDAP не поддерживается"
+msgstr "Метод удостоверения LDAP не поддерживается"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
-msgstr "ТÑ\80ебÑ\83еÑ\82Ñ\81Ñ\8f (более) Ñ\81илÑ\8cнаÑ\8f Ð°Ñ\83Ñ\82енÑ\82иÑ\84икаÑ\86иÑ\8f LDAP"
+msgstr "ТÑ\80ебÑ\83еÑ\82Ñ\81Ñ\8f (более) Ñ\81илÑ\8cное Ñ\83доÑ\81Ñ\82овеÑ\80ение LDAP"
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 msgid "Partial LDAP results+referral received"
 msgstr "Получены частичные результаты LDAP со ссылкой"
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 msgid "LDAP referral"
 msgstr "Ссылка LDAP"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr "Исчерпан административный лимит LDAP"
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr "Недоступно критичное расширение LDAP"
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 msgid "Confidentiality required by LDAP"
 msgstr "Конфиденциальность, требуемая LDAP"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr "Выполняется связка SASL LDAP"
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr "Такого атрибута LDAP нет"
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 msgid "Undefined LDAP attribute type"
 msgstr "Неопределенный тип атрибута LDAP"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 msgid "Inappropriate matching in LDAP"
 msgstr "Неподходящее соответствие в LDAP"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 msgid "Constraint violation in LDAP"
 msgstr "Нарушение ограничений в LDAP"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr "Тип или значение LDAP существует"
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 msgid "Invalid syntax in LDAP"
 msgstr "Ошибка синтаксиса в LDAP"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 msgid "No such LDAP object"
 msgstr "Такого объекта LDAP нет"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 msgid "LDAP alias problem"
 msgstr "Проблема синонима LDAP"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 msgid "Invalid DN syntax in LDAP"
 msgstr "Ошибка синтаксиса DN в LDAP"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr "Элемент LDAP - лист"
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 msgid "LDAP alias dereferencing problem"
 msgstr "Проблема разыменования синонима LDAP"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr "Отказ авторизации промежуточного сервера (X)"
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 msgid "Inappropriate LDAP authentication"
-msgstr "Ð\9dеподÑ\85одÑ\8fÑ\89аÑ\8f Ð°Ñ\83Ñ\82енÑ\82иÑ\84икаÑ\86иÑ\8f LDAP"
+msgstr "Ð\9dеподÑ\85одÑ\8fÑ\89ее Ñ\83доÑ\81Ñ\82овеÑ\80ение LDAP"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 msgid "Invalid LDAP credentials"
-msgstr "Неверная верительная грамота LDAP"
+msgstr "Неверные верительные данные LDAP"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr "Недостаточный доступ для LDAP"
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr "Сервер LDAP занят"
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 msgid "LDAP server is unavailable"
 msgstr "Сервер LDAP недоступен"
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr "Сервер LDAP отказывается работать"
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr "Функцией LDAP обнаружен цикл"
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 msgid "LDAP naming violation"
 msgstr "Нарушение в именах LDAP"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 msgid "LDAP object class violation"
 msgstr "Нарушение в классе объекта LDAP"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "Операция LDAP допустима только для листов"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 msgid "LDAP operation not allowed on RDN"
 msgstr "Операция LDAP над RDN не разрешена"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr "Уже есть (LDAP)"
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr "Невозможно изменить класс объекта LDAP"
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 msgid "LDAP results too large"
 msgstr "Слишком большой объем результатов LDAP"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 msgid "LDAP operation affects multiple DSAs"
 msgstr "Операция LDAP влияет на многие DSA"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr "Ошибка просмотра виртуального списка LDAP"
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 msgid "Other LDAP error"
 msgstr "Другая ошибка LDAP"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 msgid "Resources exhausted in LCUP"
 msgstr "Нехватка ресурсов в LCUP"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 msgid "Security violation in LCUP"
 msgstr "Нарушение безопасности в LCUP"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 msgid "Invalid data in LCUP"
 msgstr "Недопустимые данные в LCUP"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 msgid "Unsupported scheme in LCUP"
 msgstr "Схема не поддерживается в LCUP"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 msgid "Reload required in LCUP"
 msgstr "Требуется перезапуск в LCUP"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 msgid "LDAP cancelled"
 msgstr "Отбой LDAP"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 msgid "No LDAP operation to cancel"
-msgstr "Нет операции LDAP, которую можно было бы отменить"
+msgstr "Нет операции LDAP для отмены"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 msgid "Too late to cancel LDAP"
 msgstr "Отменять LDAP слишком поздно"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 msgid "Cannot cancel LDAP"
 msgstr "Не удается отменить LDAP"
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 msgid "LDAP assertion failed"
-msgstr "Ð\9eÑ\82каз Ð² Ñ\83Ñ\81Ñ\82ановке LDAP"
+msgstr "Ð\9dе Ð²Ñ\8bполнено Ñ\83Ñ\81ловие Ð² LDAP"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr "LDAP отказал в опосредованной авторизации"
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "Пользовательский код ошибки 1"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "Пользовательский код ошибки 2"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "Пользовательский код ошибки 3"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "Пользовательский код ошибки 4"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "Пользовательский код ошибки 5"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "Пользовательский код ошибки 6"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "Пользовательский код ошибки 7"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "Пользовательский код ошибки 8"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "Пользовательский код ошибки 9"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "Пользовательский код ошибки 10"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "Пользовательский код ошибки 11"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "Пользовательский код ошибки 12"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "Пользовательский код ошибки 13"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "Пользовательский код ошибки 14"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "Пользовательский код ошибки 15"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "Пользовательский код ошибки 16"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+#, fuzzy
+#| msgid "LDAP success"
+msgid "SQL success"
+msgstr "Успешное выполнение LDAP"
+
+#: src/err-codes.h:433
+#, fuzzy
+#| msgid "Syntax error"
+msgid "SQL error"
+msgstr "Синтаксическая ошибка"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr ""
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr ""
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr ""
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr ""
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr ""
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr ""
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr ""
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr ""
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr ""
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr ""
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr ""
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr ""
+
+#: src/err-codes.h:447
+#, fuzzy
+#| msgid "LDAP protocol error"
+msgid "SQL database lock protocol error"
+msgstr "Ошибка протокола LDAP"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr ""
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr ""
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr ""
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr ""
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr ""
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr ""
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr ""
+
+#: src/err-codes.h:455
+#, fuzzy
+#| msgid "Proxied authorization denied by LDAP"
+msgid "Authorization denied (SQL)"
+msgstr "LDAP отказал в опосредованной авторизации"
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr ""
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr ""
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr ""
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr ""
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr ""
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "Системная ошибка без номера"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Неизвестная системная ошибка"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Конец файла"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Неизвестный код ошибки"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+msgid "argument not expected"
+msgstr "неожиданный параметр"
+
+#: src/argparse.c:496
+msgid "read error"
+msgstr "ошибка чтения"
+
+#: src/argparse.c:498
+msgid "keyword too long"
+msgstr "слишком длинное ключевое слово"
+
+#: src/argparse.c:500
+msgid "missing argument"
+msgstr "пропущен аргумент"
+
+#: src/argparse.c:502
+msgid "invalid argument"
+msgstr "недопустимый аргумент"
+
+#: src/argparse.c:504
+msgid "invalid command"
+msgstr "недопустимая команда"
+
+#: src/argparse.c:506
+msgid "invalid alias definition"
+msgstr "недопустимое определение синонима"
+
+#: src/argparse.c:508 src/argparse.c:545
+msgid "permission error"
+msgstr "ошибка допуска"
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr "нехватка выделенной памяти"
+
+#: src/argparse.c:514 src/argparse.c:549
+msgid "invalid meta command"
+msgstr "недопустимая метакоманда"
+
+#: src/argparse.c:516 src/argparse.c:551
+msgid "unknown meta command"
+msgstr "неизвестная метакоманда"
+
+#: src/argparse.c:518 src/argparse.c:553
+msgid "unexpected meta command"
+msgstr "неожиданная метакоманда"
+
+#: src/argparse.c:520
+msgid "invalid option"
+msgstr "недопустимый параметр"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr "не хватает аргумента для параметра \"%.50s\"\n"
+
+#: src/argparse.c:532
+#, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "недопустимый аргумент для параметра \"%.50s\"\n"
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr "у параметра \"%.50s\" не должно быть аргумента\n"
+
+#: src/argparse.c:537
+#, c-format
+msgid "invalid command \"%.50s\"\n"
+msgstr "недопустимая команда \"%.50s\"\n"
+
+#: src/argparse.c:539
+#, c-format
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr "параметр \"%.50s\" неоднозначен\n"
+
+#: src/argparse.c:541
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Вызов: %s GPG-ERROR [...]\n"
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr "команда \"%.50s\" неоднозначна\n"
+
+#: src/argparse.c:555
+#, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr "недопустимый параметр \"%.50s\"\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr "Замечание: нет файла параметров по умолчанию '%s'\n"
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr "чтение параметров из '%s'\n"
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr "файл параметров '%s': %s\n"
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+"Замечание: параметр \"--%s\" игнорируется согласно глобальной конфигурации\n"
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr "Об ошибках сообщайте по адресу <https://bugs.gnupg.org>.\n"
 
-#: src/gpg-error.c:633
+#: src/gpg-error.c:762
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: внимание: не распознано %s\n"
+msgid "warning: could not recognize %s\n"
+msgstr "внимание: не распознано %s\n"
index bfd4759..0749c2c 100644 (file)
Binary files a/po/sr.gmo and b/po/sr.gmo differ
index 08c57a2..c25d23a 100644 (file)
--- a/po/sr.po
+++ b/po/sr.po
@@ -6,8 +6,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libgpg-error-1.7\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2014-11-03 11:42+0200\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:43+0100\n"
 "Last-Translator: Мирослав Николић <miroslavnikolic@rocketmail.com>\n"
 "Language-Team: Serbian <(nothing)>\n"
 "Language: sr\n"
@@ -75,37 +75,41 @@ msgstr "Клеопатра"
 
 #: src/err-sources.h:42
 msgid "G13"
-msgstr ""
+msgstr "G13"
 
 #: src/err-sources.h:43
 msgid "Assuan"
-msgstr ""
+msgstr "Assuan"
 
 #: src/err-sources.h:44
-msgid "TLS"
-msgstr ""
+msgid "TPM2d"
+msgstr "TPM2d"
 
 #: src/err-sources.h:45
+msgid "TLS"
+msgstr "TLS"
+
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "Било који извор"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "1. корисников извор"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "2. корисников извор"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "3. корисников извор"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "4. корисников извор"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Непознат извор"
 
@@ -1362,576 +1366,874 @@ msgid "Wrong name"
 msgstr "Непознат назив"
 
 #: src/err-codes.h:320
+#, fuzzy
+#| msgid "Not locked"
+msgid "Not authenticated"
+msgstr "Није закључано"
+
+#: src/err-codes.h:321
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Bad authentication"
+msgstr "Неподржана заштита"
+
+#: src/err-codes.h:322
+#, fuzzy
+#| msgid "No agent running"
+msgid "No Keybox daemon running"
+msgstr "Нема покренутог агента"
+
+#: src/err-codes.h:323
+#, fuzzy
+#| msgid "SmartCard daemon error"
+msgid "Keybox daemon error"
+msgstr "Грешка позадинца паметне картице"
+
+#: src/err-codes.h:324
+msgid "Service is not running"
+msgstr ""
+
+#: src/err-codes.h:325
+#, fuzzy
+#| msgid "Keyserver error"
+msgid "Service error"
+msgstr "Грешка сервера кључа"
+
+#: src/err-codes.h:326
 msgid "System bug detected"
 msgstr ""
 
-#: src/err-codes.h:321
+#: src/err-codes.h:327
 #, fuzzy
 #| msgid "Unknown system error"
 msgid "Unknown DNS error"
 msgstr "Непозната грешка система"
 
-#: src/err-codes.h:322
+#: src/err-codes.h:328
 #, fuzzy
 #| msgid "Invalid OID string"
 msgid "Invalid DNS section"
 msgstr "Неисправна ОИД ниска"
 
-#: src/err-codes.h:323
+#: src/err-codes.h:329
 #, fuzzy
 #| msgid "Invalid S-expression"
 msgid "Invalid textual address form"
 msgstr "Неисправан С-израз"
 
-#: src/err-codes.h:324
+#: src/err-codes.h:330
 #, fuzzy
 #| msgid "Missing certificate"
 msgid "Missing DNS query packet"
 msgstr "Недостаје уверење"
 
-#: src/err-codes.h:325
+#: src/err-codes.h:331
 msgid "Missing DNS answer packet"
 msgstr ""
 
-#: src/err-codes.h:326
+#: src/err-codes.h:332
 msgid "Connection closed in DNS"
 msgstr ""
 
-#: src/err-codes.h:327
+#: src/err-codes.h:333
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "Verification failed in DNS"
 msgstr "Дешифровање није успело"
 
-#: src/err-codes.h:328
+#: src/err-codes.h:334
 #, fuzzy
 #| msgid "Timeout"
 msgid "DNS Timeout"
 msgstr "Време је истекло"
 
-#: src/err-codes.h:329
+#: src/err-codes.h:335
 #, fuzzy
 #| msgid "General IPC error"
 msgid "General LDAP error"
 msgstr "Општа грешка ИПЦ-а"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP attribute error"
 msgstr "Општа грешка"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP name error"
 msgstr "Општа грешка"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP security error"
 msgstr "Општа грешка Асуана"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP service error"
 msgstr "Општа грешка"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP update error"
 msgstr "Општа грешка Асуана"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr ""
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 #, fuzzy
 #| msgid "IPC write error"
 msgid "Private LDAP error code"
 msgstr "Грешка писања ИПЦ-а"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other general LDAP error"
 msgstr "Општа грешка ИПЦ-а"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 #, fuzzy
 #| msgid "IPC connect call failed"
 msgid "LDAP connecting failed (X)"
 msgstr "Повезивање позива ИПЦ-а није успело"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral limit exceeded"
 msgstr "Општа грешка"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr ""
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 #, fuzzy
 #| msgid "Card reset required"
 msgid "No LDAP results returned"
 msgstr "Потребно је поновно постављање картице"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 #, fuzzy
 #| msgid "Element not found"
 msgid "LDAP control not found"
 msgstr "Нисам пронашао елемент"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 #, fuzzy
 #| msgid "Not supported"
 msgid "Not supported by LDAP"
 msgstr "Није подржано"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 #, fuzzy
 #| msgid "Unexpected error"
 msgid "LDAP connect error"
 msgstr "Неочекивана грешка"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr ""
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr ""
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 #, fuzzy
 #| msgid "Unsupported operation"
 msgid "User cancelled LDAP operation"
 msgstr "Неподржана радња"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 #, fuzzy
 #| msgid "Bad certificate"
 msgid "Bad LDAP search filter"
 msgstr "Лош уверење"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "Unknown LDAP authentication method"
 msgstr "Непознато проширење"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 #, fuzzy
 #| msgid "Timeout"
 msgid "Timeout in LDAP"
 msgstr "Време је истекло"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP decoding error"
 msgstr "грешка управника директоријумом"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP encoding error"
 msgstr "грешка управника директоријумом"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 #, fuzzy
 #| msgid "IPC read error"
 msgid "LDAP local error"
 msgstr "Грешка читања ИПЦ-а"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot contact LDAP server"
 msgstr "Није ИПЦ сервер"
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP success"
 msgstr "Успешно"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 #, fuzzy
 #| msgid "Configuration error"
 msgid "LDAP operations error"
 msgstr "Грешка подешавања"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP protocol error"
 msgstr "Кршење протокола"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr ""
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr ""
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "LDAP authentication method not supported"
 msgstr "Непознато проширење"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
 msgstr ""
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 msgid "Partial LDAP results+referral received"
 msgstr ""
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral"
 msgstr "Општа грешка"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr ""
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr ""
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Confidentiality required by LDAP"
 msgstr "Потребно је поновно постављање картице"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr ""
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr ""
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 #, fuzzy
 #| msgid "Invalid attribute"
 msgid "Undefined LDAP attribute type"
 msgstr "Неисправна особина"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate matching in LDAP"
 msgstr "Неподржана заштита"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Constraint violation in LDAP"
 msgstr "Кршење протокола"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr ""
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid syntax in LDAP"
 msgstr "Неисправно стање"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 #, fuzzy
 #| msgid "No CMS object"
 msgid "No such LDAP object"
 msgstr "Није ЦМС предмет"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 #, fuzzy
 #| msgid "Hardware problem"
 msgid "LDAP alias problem"
 msgstr "Хардверски проблем"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid DN syntax in LDAP"
 msgstr "Неисправно стање"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr ""
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 #, fuzzy
 #| msgid "Encoding problem"
 msgid "LDAP alias dereferencing problem"
 msgstr "Проблем кодирања"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr ""
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate LDAP authentication"
 msgstr "Неподржана заштита"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 #, fuzzy
 #| msgid "Invalid card"
 msgid "Invalid LDAP credentials"
 msgstr "Неисправна картица"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr ""
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr ""
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 msgid "LDAP server is unavailable"
 msgstr ""
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr ""
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr ""
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 #, fuzzy
 #| msgid "Missing action"
 msgid "LDAP naming violation"
 msgstr "Недостаје радња"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP object class violation"
 msgstr "Кршење протокола"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 #, fuzzy
 #| msgid "Operation not yet finished"
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "Радња није још завршена"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation not allowed on RDN"
 msgstr "Радња је отказана"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr ""
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr ""
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 #, fuzzy
 #| msgid "Line too long"
 msgid "LDAP results too large"
 msgstr "Ред је предуг"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation affects multiple DSAs"
 msgstr "Радња је отказана"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr ""
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other LDAP error"
 msgstr "Општа грешка ИПЦ-а"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 #, fuzzy
 #| msgid "Resources exhausted"
 msgid "Resources exhausted in LCUP"
 msgstr "Изворишта су истрошена"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Security violation in LCUP"
 msgstr "Кршење протокола"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid data in LCUP"
 msgstr "Неисправно стање"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 #, fuzzy
 #| msgid "Unsupported certificate"
 msgid "Unsupported scheme in LCUP"
 msgstr "Неподржано уверење"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Reload required in LCUP"
 msgstr "Потребно је поновно постављање картице"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP cancelled"
 msgstr "Успешно"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 #, fuzzy
 #| msgid "Not operational"
 msgid "No LDAP operation to cancel"
 msgstr "Није делотворно"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 #, fuzzy
 #| msgid "Not operational"
 msgid "Too late to cancel LDAP"
 msgstr "Није делотворно"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot cancel LDAP"
 msgstr "Није ИПЦ сервер"
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "LDAP assertion failed"
 msgstr "Дешифровање није успело"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr ""
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "1. код грешке који је одредио корисник"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "2. код грешке који је одредио корисник"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "3. код грешке који је одредио корисник"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "4. код грешке који је одредио корисник"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "5. код грешке који је одредио корисник"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "6. код грешке који је одредио корисник"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "7. код грешке који је одредио корисник"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "8. код грешке који је одредио корисник"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "9. код грешке који је одредио корисник"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "10. код грешке који је одредио корисник"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "11. код грешке који је одредио корисник"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "12. код грешке који је одредио корисник"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "13. код грешке који је одредио корисник"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "14. код грешке који је одредио корисник"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "15. код грешке који је одредио корисник"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "16. код грешке који је одредио корисник"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+#, fuzzy
+#| msgid "Success"
+msgid "SQL success"
+msgstr "Успешно"
+
+#: src/err-codes.h:433
+#, fuzzy
+#| msgid "Syntax error"
+msgid "SQL error"
+msgstr "Садржајна грешка"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr ""
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr ""
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr ""
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr ""
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr ""
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr ""
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr ""
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr ""
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr ""
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr ""
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr ""
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr ""
+
+#: src/err-codes.h:447
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "SQL database lock protocol error"
+msgstr "Кршење протокола"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr ""
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr ""
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr ""
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr ""
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr ""
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr ""
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr ""
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr ""
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr ""
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr ""
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr ""
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr ""
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "Број в/о грешке системске грешке"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Непозната грешка система"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Крај датотеке"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Непознат код грешке"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "argument not expected"
+msgstr "Подаци нису шифровани"
+
+#: src/argparse.c:496
+#, fuzzy
+#| msgid "IPC read error"
+msgid "read error"
+msgstr "Грешка читања ИПЦ-а"
+
+#: src/argparse.c:498
+#, fuzzy
+#| msgid "Line too long"
+msgid "keyword too long"
+msgstr "Ред је предуг"
+
+#: src/argparse.c:500
+#, fuzzy
+#| msgid "Missing value"
+msgid "missing argument"
+msgstr "Недостаје вредност"
+
+#: src/argparse.c:502
+#, fuzzy
+#| msgid "Invalid argument"
+msgid "invalid argument"
+msgstr "Неисправан аргумент"
+
+#: src/argparse.c:504
+#, fuzzy
+#| msgid "Invalid card"
+msgid "invalid command"
+msgstr "Неисправна картица"
+
+#: src/argparse.c:506
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "invalid alias definition"
+msgstr "Неисправна ОИД ниска"
+
+#: src/argparse.c:508 src/argparse.c:545
+#, fuzzy
+#| msgid "Configuration error"
+msgid "permission error"
+msgstr "Грешка подешавања"
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr ""
+
+#: src/argparse.c:514 src/argparse.c:549
+#, fuzzy
+#| msgid "Invalid card"
+msgid "invalid meta command"
+msgstr "Неисправна картица"
+
+#: src/argparse.c:516 src/argparse.c:551
+#, fuzzy
+#| msgid "Unknown command"
+msgid "unknown meta command"
+msgstr "Непозната наредба"
+
+#: src/argparse.c:518 src/argparse.c:553
+#, fuzzy
+#| msgid "Unexpected IPC command"
+msgid "unexpected meta command"
+msgstr "Неочекивана ИПЦ наредба"
+
+#: src/argparse.c:520
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "invalid option"
+msgstr "Неисправна шифра радње"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:532
+#, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr ""
+
+#: src/argparse.c:537
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Употреба: %s GPG-ERROR [...]\n"
+msgid "invalid command \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:539
+#, c-format
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:555
+#, fuzzy, c-format
+#| msgid "Invalid operation code"
+msgid "invalid option \"%.50s\"\n"
+msgstr "Неисправна шифра радње"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr ""
 
-#: src/gpg-error.c:633
+#: src/argparse.c:2296 src/argparse.c:2389
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: упозорење: не могу да препознам „%s“\n"
+msgid "reading options from '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr ""
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr ""
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "упозорење: не могу да препознам „%s“\n"
+
+#~ msgid "Usage: %s GPG-ERROR [...]\n"
+#~ msgstr "Употреба: %s GPG-ERROR [...]\n"
 
 #, fuzzy
 #~| msgid "Resources exhausted"
index a239c6e..6d2930e 100644 (file)
Binary files a/po/sv.gmo and b/po/sv.gmo differ
index 6493b36..95b35a5 100644 (file)
--- a/po/sv.po
+++ b/po/sv.po
@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libgpg-error 1.7\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2013-02-23 20:10+0100\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:43+0100\n"
 "Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
 "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
 "Language: sv\n"
@@ -81,30 +81,34 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
-msgid "TLS"
-msgstr ""
+msgid "TPM2d"
+msgstr "TPM2d"
 
 #: src/err-sources.h:45
+msgid "TLS"
+msgstr "TLS"
+
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "Alla källor"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "Användardefinierad källa 1"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "Användardefinierad källa 2"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "Användardefinierad källa 3"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "Användardefinierad källa 4"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Okänd källa"
 
@@ -1351,575 +1355,861 @@ msgid "Wrong name"
 msgstr "Okänt namn"
 
 #: src/err-codes.h:320
+#, fuzzy
+msgid "Not authenticated"
+msgstr "Inte låst"
+
+#: src/err-codes.h:321
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Bad authentication"
+msgstr "Skyddet stöds inte"
+
+#: src/err-codes.h:322
+#, fuzzy
+#| msgid "No agent running"
+msgid "No Keybox daemon running"
+msgstr "Ingen agent kör"
+
+#: src/err-codes.h:323
+#, fuzzy
+#| msgid "SmartCard daemon error"
+msgid "Keybox daemon error"
+msgstr "Fel i SmartCard-demon"
+
+#: src/err-codes.h:324
+msgid "Service is not running"
+msgstr ""
+
+#: src/err-codes.h:325
+#, fuzzy
+#| msgid "Keyserver error"
+msgid "Service error"
+msgstr "Fel i nyckelserver"
+
+#: src/err-codes.h:326
 msgid "System bug detected"
 msgstr ""
 
-#: src/err-codes.h:321
+#: src/err-codes.h:327
 #, fuzzy
 #| msgid "Unknown system error"
 msgid "Unknown DNS error"
 msgstr "Okänt systemfel"
 
-#: src/err-codes.h:322
+#: src/err-codes.h:328
 #, fuzzy
 #| msgid "Invalid OID string"
 msgid "Invalid DNS section"
 msgstr "Ogiltig OID-sträng"
 
-#: src/err-codes.h:323
+#: src/err-codes.h:329
 #, fuzzy
 #| msgid "Invalid S-expression"
 msgid "Invalid textual address form"
 msgstr "Ogiltigt S-uttryck"
 
-#: src/err-codes.h:324
+#: src/err-codes.h:330
 #, fuzzy
 msgid "Missing DNS query packet"
 msgstr "Saknar certifikat"
 
-#: src/err-codes.h:325
+#: src/err-codes.h:331
 msgid "Missing DNS answer packet"
 msgstr ""
 
-#: src/err-codes.h:326
+#: src/err-codes.h:332
 msgid "Connection closed in DNS"
 msgstr ""
 
-#: src/err-codes.h:327
+#: src/err-codes.h:333
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "Verification failed in DNS"
 msgstr "Dekryptering misslyckades"
 
-#: src/err-codes.h:328
+#: src/err-codes.h:334
 #, fuzzy
 #| msgid "Timeout"
 msgid "DNS Timeout"
 msgstr "Tidsgräns"
 
-#: src/err-codes.h:329
+#: src/err-codes.h:335
 #, fuzzy
 #| msgid "General IPC error"
 msgid "General LDAP error"
 msgstr "Allmänt IPC-fel"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP attribute error"
 msgstr "Allmänt fel"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP name error"
 msgstr "Allmänt fel"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP security error"
 msgstr "Allmänt Assuan-fel"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP service error"
 msgstr "Allmänt fel"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP update error"
 msgstr "Allmänt Assuan-fel"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr ""
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 #, fuzzy
 #| msgid "IPC write error"
 msgid "Private LDAP error code"
 msgstr "IPC-skrivfel"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other general LDAP error"
 msgstr "Allmänt IPC-fel"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 #, fuzzy
 #| msgid "IPC connect call failed"
 msgid "LDAP connecting failed (X)"
 msgstr "IPC-anslutningsanrop misslyckades"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral limit exceeded"
 msgstr "Allmänt fel"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr ""
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 #, fuzzy
 #| msgid "Card reset required"
 msgid "No LDAP results returned"
 msgstr "Nollställning av kort krävs"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 #, fuzzy
 #| msgid "Element not found"
 msgid "LDAP control not found"
 msgstr "Elementet hittades inte"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 #, fuzzy
 #| msgid "Not supported"
 msgid "Not supported by LDAP"
 msgstr "Stöds inte"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 #, fuzzy
 #| msgid "Unexpected error"
 msgid "LDAP connect error"
 msgstr "Oväntat fel"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr ""
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr ""
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 #, fuzzy
 #| msgid "Unsupported operation"
 msgid "User cancelled LDAP operation"
 msgstr "Åtgärden stöds inte"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 #, fuzzy
 #| msgid "Bad certificate"
 msgid "Bad LDAP search filter"
 msgstr "Felaktigt certifikat"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "Unknown LDAP authentication method"
 msgstr "Okänd utökning"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 #, fuzzy
 #| msgid "Timeout"
 msgid "Timeout in LDAP"
 msgstr "Tidsgräns"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP decoding error"
 msgstr "dirmngr-fel"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP encoding error"
 msgstr "dirmngr-fel"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 #, fuzzy
 #| msgid "IPC read error"
 msgid "LDAP local error"
 msgstr "IPC-läsfel"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot contact LDAP server"
 msgstr "Inte en IPC-server"
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP success"
 msgstr "Lyckades"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 #, fuzzy
 #| msgid "Configuration error"
 msgid "LDAP operations error"
 msgstr "Konfigurationsfel"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP protocol error"
 msgstr "Protokollöverträdelse"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr ""
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr ""
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "LDAP authentication method not supported"
 msgstr "Okänd utökning"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
 msgstr ""
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 msgid "Partial LDAP results+referral received"
 msgstr ""
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral"
 msgstr "Allmänt fel"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr ""
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr ""
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Confidentiality required by LDAP"
 msgstr "Nollställning av kort krävs"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr ""
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr ""
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 #, fuzzy
 #| msgid "Invalid attribute"
 msgid "Undefined LDAP attribute type"
 msgstr "Ogiltigt attribut"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate matching in LDAP"
 msgstr "Skyddet stöds inte"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Constraint violation in LDAP"
 msgstr "Protokollöverträdelse"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr ""
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid syntax in LDAP"
 msgstr "Ogiltigt tillstånd"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 #, fuzzy
 #| msgid "No CMS object"
 msgid "No such LDAP object"
 msgstr "Inget CMS-objekt"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 #, fuzzy
 #| msgid "Hardware problem"
 msgid "LDAP alias problem"
 msgstr "Hårdvaruproblem"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid DN syntax in LDAP"
 msgstr "Ogiltigt tillstånd"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr ""
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 #, fuzzy
 #| msgid "Encoding problem"
 msgid "LDAP alias dereferencing problem"
 msgstr "Kodningsproblem"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr ""
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate LDAP authentication"
 msgstr "Skyddet stöds inte"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 #, fuzzy
 #| msgid "Invalid card"
 msgid "Invalid LDAP credentials"
 msgstr "Ogiltigt kort"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr ""
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr ""
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 msgid "LDAP server is unavailable"
 msgstr ""
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr ""
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr ""
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 #, fuzzy
 #| msgid "Missing action"
 msgid "LDAP naming violation"
 msgstr "Saknar åtgärd"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP object class violation"
 msgstr "Protokollöverträdelse"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 #, fuzzy
 #| msgid "Operation not yet finished"
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "Åtgärden är ännu inte färdig"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation not allowed on RDN"
 msgstr "Åtgärden avbröts"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr ""
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr ""
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 #, fuzzy
 #| msgid "Line too long"
 msgid "LDAP results too large"
 msgstr "Raden är för lång"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation affects multiple DSAs"
 msgstr "Åtgärden avbröts"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr ""
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other LDAP error"
 msgstr "Allmänt IPC-fel"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 #, fuzzy
 #| msgid "Resources exhausted"
 msgid "Resources exhausted in LCUP"
 msgstr "Resurser överansträngda"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Security violation in LCUP"
 msgstr "Protokollöverträdelse"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid data in LCUP"
 msgstr "Ogiltigt tillstånd"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 #, fuzzy
 #| msgid "Unsupported certificate"
 msgid "Unsupported scheme in LCUP"
 msgstr "Certifikatet stöds inte"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Reload required in LCUP"
 msgstr "Nollställning av kort krävs"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP cancelled"
 msgstr "Lyckades"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 #, fuzzy
 #| msgid "Not operational"
 msgid "No LDAP operation to cancel"
 msgstr "Fungerar inte"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 #, fuzzy
 #| msgid "Not operational"
 msgid "Too late to cancel LDAP"
 msgstr "Fungerar inte"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot cancel LDAP"
 msgstr "Inte en IPC-server"
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "LDAP assertion failed"
 msgstr "Dekryptering misslyckades"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr ""
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "Användardefinierad felkod 1"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "Användardefinierad felkod 2"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "Användardefinierad felkod 3"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "Användardefinierad felkod 4"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "Användardefinierad felkod 5"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "Användardefinierad felkod 6"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "Användardefinierad felkod 7"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "Användardefinierad felkod 8"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "Användardefinierad felkod 9"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "Användardefinierad felkod 10"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "Användardefinierad felkod 11"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "Användardefinierad felkod 12"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "Användardefinierad felkod 13"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "Användardefinierad felkod 14"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "Användardefinierad felkod 15"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "Användardefinierad felkod 16"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+#, fuzzy
+#| msgid "Success"
+msgid "SQL success"
+msgstr "Lyckades"
+
+#: src/err-codes.h:433
+#, fuzzy
+#| msgid "Syntax error"
+msgid "SQL error"
+msgstr "Syntaxfel"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr ""
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr ""
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr ""
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr ""
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr ""
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr ""
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr ""
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr ""
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr ""
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr ""
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr ""
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr ""
+
+#: src/err-codes.h:447
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "SQL database lock protocol error"
+msgstr "Protokollöverträdelse"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr ""
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr ""
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr ""
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr ""
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr ""
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr ""
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr ""
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr ""
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr ""
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr ""
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr ""
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr ""
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "Systemfel utan felnummer"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Okänt systemfel"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Slut på fil"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Okänd felkod"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+msgid "argument not expected"
+msgstr "argument förväntades inte"
+
+#: src/argparse.c:496
+msgid "read error"
+msgstr "läsfel"
+
+#: src/argparse.c:498
+msgid "keyword too long"
+msgstr "nyckelordet är för långt"
+
+#: src/argparse.c:500
+msgid "missing argument"
+msgstr "argument saknas"
+
+#: src/argparse.c:502
+#, fuzzy
+#| msgid "invalid value\n"
+msgid "invalid argument"
+msgstr "ogiltigt värde\n"
+
+#: src/argparse.c:504
+msgid "invalid command"
+msgstr "ogiltigt kommando"
+
+#: src/argparse.c:506
+msgid "invalid alias definition"
+msgstr "ogiltig aliasdefinition"
+
+#: src/argparse.c:508 src/argparse.c:545
+#, fuzzy
+#| msgid "Configuration error"
+msgid "permission error"
+msgstr "Konfigurationsfel"
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr "slut på minne"
+
+#: src/argparse.c:514 src/argparse.c:549
+#, fuzzy
+#| msgid "invalid command"
+msgid "invalid meta command"
+msgstr "ogiltigt kommando"
+
+#: src/argparse.c:516 src/argparse.c:551
+#, fuzzy
+#| msgid "Unknown command"
+msgid "unknown meta command"
+msgstr "Okänt kommando"
+
+#: src/argparse.c:518 src/argparse.c:553
+#, fuzzy
+#| msgid "Unexpected IPC command"
+msgid "unexpected meta command"
+msgstr "Oväntat IPC-kommando"
+
+#: src/argparse.c:520
+msgid "invalid option"
+msgstr "ogiltig flagga"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr "argument för flaggan \"%.50s\" saknas\n"
+
+#: src/argparse.c:532
+#, fuzzy, c-format
+#| msgid "missing argument for option \"%.50s\"\n"
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "argument för flaggan \"%.50s\" saknas\n"
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr "flaggan \"%.50s\" förväntar sig inte ett argument\n"
+
+#: src/argparse.c:537
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Användning: %s GPG-ERROR [...]\n"
+msgid "invalid command \"%.50s\"\n"
+msgstr "ogiltigt kommando \"%.50s\"\n"
 
-#: src/gpg-error.c:633
+#: src/argparse.c:539
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: varning: kände inte igen %s\n"
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr "flagga \"%.50s\" är tvetydig\n"
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr "kommandot \"%.50s\" är tvetydigt\n"
+
+#: src/argparse.c:555
+#, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr "ogiltig flagga \"%.50s\"\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr ""
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr ""
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "varning: kände inte igen %s\n"
+
+#~ msgid "out of core\n"
+#~ msgstr "slut på minne\n"
+
+#~ msgid "Usage: %s GPG-ERROR [...]\n"
+#~ msgstr "Användning: %s GPG-ERROR [...]\n"
 
 #, fuzzy
 #~| msgid "Resources exhausted"
index 55526d8..e5e0a42 100644 (file)
Binary files a/po/uk.gmo and b/po/uk.gmo differ
index 4b879ac..208a13d 100644 (file)
--- a/po/uk.po
+++ b/po/uk.po
@@ -2,13 +2,13 @@
 # Copyright (C) 2012 Free Software Foundation, Inc.
 # This file is distributed under the same license as the libgpg-error package.
 #
-# Yuri Chornoivan <yurchor@ukr.net>, 2012, 2014, 2015.
+# Yuri Chornoivan <yurchor@ukr.net>, 2012, 2014, 2015, 2018, 2020.
 msgid ""
 msgstr ""
 "Project-Id-Version: libgpg-error 1.7\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2015-07-12 16:21+0300\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:44+0100\n"
 "Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
 "Language-Team: Ukrainian <translation-team-uk@lists.sourceforge.net>\n"
 "Language: uk\n"
@@ -16,7 +16,7 @@ msgstr ""
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Lokalize 1.5\n"
+"X-Generator: Lokalize 20.03.70\n"
 
 #: src/err-sources.h:28
 msgid "Unspecified source"
@@ -83,30 +83,34 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
+msgid "TPM2d"
+msgstr "TPM2d"
+
+#: src/err-sources.h:45
 msgid "TLS"
 msgstr "TLS"
 
-#: src/err-sources.h:45
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "Будь-яке джерело"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "Визначене користувачем джерело 1"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "Визначене користувачем джерело 2"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "Визначене користувачем джерело 3"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "Визначене користувачем джерело 4"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Невідоме джерело"
 
@@ -968,29 +972,23 @@ msgstr "Помилковий вісімковий символ у S-виразі
 
 #: src/err-codes.h:242
 msgid "All subkeys are expired or revoked"
-msgstr ""
+msgstr "Строк дії усіх підключів вичерпано або їх відкликано"
 
 #: src/err-codes.h:243
-#, fuzzy
-#| msgid "Data not encrypted"
 msgid "Database is corrupted"
-msgstr "Ð\94анÑ\96 Ð½Ðµ Ð·Ð°Ñ\88иÑ\84Ñ\80овано"
+msgstr "Ð\91азÑ\83 Ð´Ð°Ð½Ð¸Ñ\85 Ð¿Ð¾Ñ\88коджено"
 
 #: src/err-codes.h:244
 msgid "Server indicated a failure"
-msgstr ""
+msgstr "Сервер сигналізує про помилку"
 
 #: src/err-codes.h:245
-#, fuzzy
-#| msgid "Unknown name"
 msgid "No name"
-msgstr "Ð\9dевÑ\96дома Ð½Ð°Ð·Ð²Ð°"
+msgstr "Ð\9dемаÑ\94 Ð½Ð°Ð·Ð²Ð¸"
 
 #: src/err-codes.h:246
-#, fuzzy
-#| msgid "No public key"
 msgid "No key"
-msgstr "Ð\9dемаÑ\94 Ð²Ñ\96дкÑ\80иÑ\82ого ÐºÐ»Ñ\8eÑ\87а"
+msgstr "Немає ключа"
 
 #: src/err-codes.h:247
 msgid "Legacy key"
@@ -1135,11 +1133,11 @@ msgstr "Некоректний об’єкт блокування"
 
 #: src/err-codes.h:280
 msgid "True"
-msgstr ""
+msgstr "Так"
 
 #: src/err-codes.h:281
 msgid "False"
-msgstr ""
+msgstr "Ні"
 
 #: src/err-codes.h:282
 msgid "General IPC error"
@@ -1238,557 +1236,772 @@ msgid "Unknown IPC inquire"
 msgstr "Невідомий запит IPC"
 
 #: src/err-codes.h:306
-#, fuzzy
-#| msgid "No crypto engine"
 msgid "Crypto engine too old"
-msgstr "Ð\9dемаÑ\94 Ñ\80Ñ\83Ñ\88Ñ\96Ñ\8f Ñ\88иÑ\84Ñ\80Ñ\83ваннÑ\8f"
+msgstr "РÑ\83Ñ\88Ñ\96й Ñ\88иÑ\84Ñ\80Ñ\83ваннÑ\8f Ñ\94 Ð½Ð°Ð´Ñ\82о Ñ\81Ñ\82аÑ\80им"
 
 #: src/err-codes.h:307
 msgid "Screen or window too small"
-msgstr ""
+msgstr "Екран або вікно є надто малим"
 
 #: src/err-codes.h:308
 msgid "Screen or window too large"
-msgstr ""
+msgstr "Екран або вікно є надто великим"
 
 #: src/err-codes.h:309
 msgid "Required environment variable not set"
-msgstr ""
+msgstr "Не встановлено обов'язкової змінної середовища"
 
 #: src/err-codes.h:310
-#, fuzzy
-#| msgid "Already exists (LDAP)"
 msgid "User ID already exists"
-msgstr "Ð\92же Ñ\96Ñ\81нÑ\83Ñ\94 (LDAP)"
+msgstr "Ð\86денÑ\82иÑ\84Ñ\96каÑ\82оÑ\80 ÐºÐ¾Ñ\80иÑ\81Ñ\82Ñ\83ваÑ\87а Ð²Ð¶Ðµ Ñ\96Ñ\81нÑ\83Ñ\94"
 
 #: src/err-codes.h:311
-#, fuzzy
-#| msgid "Already exists (LDAP)"
 msgid "Name already exists"
-msgstr "Ð\92же Ñ\96Ñ\81нÑ\83Ñ\94 (LDAP)"
+msgstr "Ð\9dазва Ð²Ð¶Ðµ Ñ\96Ñ\81нÑ\83Ñ\94"
 
 #: src/err-codes.h:312
-#, fuzzy
-#| msgid "Duplicated value"
 msgid "Duplicated name"
-msgstr "Ð\94Ñ\83блÑ\8eваннÑ\8f Ð·Ð½Ð°Ñ\87еннÑ\8f"
+msgstr "Ð\94Ñ\83блÑ\8eваннÑ\8f Ð½Ð°Ð·Ð²Ð¸"
 
 #: src/err-codes.h:313
-#, fuzzy
-#| msgid "Certificate too young"
 msgid "Object is too young"
-msgstr "СеÑ\80Ñ\82иÑ\84Ñ\96кат є надто новим"
+msgstr "Ð\9eб'Ñ\94кт є надто новим"
 
 #: src/err-codes.h:314
-#, fuzzy
-#| msgid "Provided object is too short"
 msgid "Object is too old"
-msgstr "Ð\9dаданий Ð¾Ð±â\80\99Ñ\94кÑ\82 Ñ\94 Ð½Ð°Ð´Ñ\82о ÐºÐ¾Ñ\80оÑ\82ким"
+msgstr "Ð\9eб'Ñ\94кÑ\82 Ñ\94 Ð½Ð°Ð´Ñ\82о Ñ\81Ñ\82аÑ\80им"
 
 #: src/err-codes.h:315
-#, fuzzy
-#| msgid "Unknown name"
 msgid "Unknown flag"
-msgstr "Ð\9dевÑ\96дома Ð½Ð°Ð·Ð²Ð°"
+msgstr "Ð\9dевÑ\96домий Ð¿Ñ\80апоÑ\80еÑ\86Ñ\8c"
 
 #: src/err-codes.h:316
-#, fuzzy
-#| msgid "Invalid operation code"
 msgid "Invalid execution order"
-msgstr "Ð\9dекоÑ\80екÑ\82ний ÐºÐ¾Ð´ Ð´Ñ\96Ñ\97"
+msgstr "Ð\9dекоÑ\80екÑ\82на Ð¿Ð¾Ñ\81лÑ\96довнÑ\96Ñ\81Ñ\82Ñ\8c Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ\8f"
 
 #: src/err-codes.h:317
 msgid "Already fetched"
-msgstr ""
+msgstr "Вже отримано"
 
 #: src/err-codes.h:318
 msgid "Try again later"
-msgstr ""
+msgstr "Повторіть спробу пізніше"
 
 #: src/err-codes.h:319
-#, fuzzy
-#| msgid "Unknown name"
 msgid "Wrong name"
-msgstr "Ð\9dевÑ\96дома назва"
+msgstr "Ð\9fомилкова назва"
 
 #: src/err-codes.h:320
-msgid "System bug detected"
-msgstr ""
+msgid "Not authenticated"
+msgstr "Розпізнавання не пройдено"
 
 #: src/err-codes.h:321
-#, fuzzy
-#| msgid "Unknown system error"
-msgid "Unknown DNS error"
-msgstr "Невідома системна помилка"
+msgid "Bad authentication"
+msgstr "Помилка розпізнавання"
 
 #: src/err-codes.h:322
-#, fuzzy
-#| msgid "Invalid OID string"
-msgid "Invalid DNS section"
-msgstr "Некоректний рядок OID"
+msgid "No Keybox daemon running"
+msgstr "Фонову службу Keybox не запущено"
 
 #: src/err-codes.h:323
-#, fuzzy
-#| msgid "Invalid S-expression"
-msgid "Invalid textual address form"
-msgstr "Некоректний S-вираз"
+msgid "Keybox daemon error"
+msgstr "Помилка фонової служби Keybox"
 
 #: src/err-codes.h:324
-#, fuzzy
-#| msgid "Missing issuer certificate"
-msgid "Missing DNS query packet"
-msgstr "Не вистачає сертифіката видавця"
+msgid "Service is not running"
+msgstr "Службу не запущено"
 
 #: src/err-codes.h:325
-msgid "Missing DNS answer packet"
-msgstr ""
+msgid "Service error"
+msgstr "Помилка служби"
 
 #: src/err-codes.h:326
-msgid "Connection closed in DNS"
-msgstr ""
+msgid "System bug detected"
+msgstr "Виявлено ваду у системі"
 
 #: src/err-codes.h:327
-#, fuzzy
-#| msgid "Decryption failed"
-msgid "Verification failed in DNS"
-msgstr "Спроба розшифрування зазнала невдачі"
+msgid "Unknown DNS error"
+msgstr "Невідома помилка DNS"
 
 #: src/err-codes.h:328
-#, fuzzy
-#| msgid "Timeout"
-msgid "DNS Timeout"
-msgstr "Час очікування"
+msgid "Invalid DNS section"
+msgstr "Некоректний розділ DNS"
 
 #: src/err-codes.h:329
+msgid "Invalid textual address form"
+msgstr "Некоректний текстовий формат адреси"
+
+#: src/err-codes.h:330
+msgid "Missing DNS query packet"
+msgstr "Не вистачає пакета запиту до DNS"
+
+#: src/err-codes.h:331
+msgid "Missing DNS answer packet"
+msgstr "Не вистачає пакета із відповіддю DNS"
+
+#: src/err-codes.h:332
+msgid "Connection closed in DNS"
+msgstr "З'єднання закрито у DNS"
+
+#: src/err-codes.h:333
+msgid "Verification failed in DNS"
+msgstr "Не пройдено перевірку на DNS"
+
+#: src/err-codes.h:334
+msgid "DNS Timeout"
+msgstr "Перевищено час очікування на DNS"
+
+#: src/err-codes.h:335
 msgid "General LDAP error"
 msgstr "Загальна помилка LDAP"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 msgid "General LDAP attribute error"
 msgstr "Загальна помилка атрибута LDAP"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 msgid "General LDAP name error"
 msgstr "Загальна помилка назви LDAP"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 msgid "General LDAP security error"
 msgstr "Загальна помилка захисту LDAP"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 msgid "General LDAP service error"
 msgstr "Загальна помилка служби LDAP"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 msgid "General LDAP update error"
 msgstr "Загальна помилка оновлення LDAP"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr "Експериментальний код помилки LDAP"
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 msgid "Private LDAP error code"
 msgstr "Код конфіденційної помилки LDAP"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 msgid "Other general LDAP error"
 msgstr "Інша загальна помилка LDAP"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 msgid "LDAP connecting failed (X)"
 msgstr "Не вдалося з’єднатися із LDAP (X)"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 msgid "LDAP referral limit exceeded"
 msgstr "Перевищення обмежень щодо спрямовування у LDAP"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr "Циклічний клієнт LDAP"
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 msgid "No LDAP results returned"
 msgstr "Не повернуто результатів LDAP"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 msgid "LDAP control not found"
 msgstr "Не знайдено керування LDAP"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 msgid "Not supported by LDAP"
 msgstr "Не підтримується LDAP"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 msgid "LDAP connect error"
 msgstr "Помилка з’єднання LDAP"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr "Не вистачає пам’яті у LDAP"
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr "Помилковий параметр підпрограми LDAP"
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 msgid "User cancelled LDAP operation"
 msgstr "Дію LDAP скасовано користувачем"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 msgid "Bad LDAP search filter"
 msgstr "Помилковий фільтр пошуку LDAP"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 msgid "Unknown LDAP authentication method"
 msgstr "Невідомий спосіб розпізнавання LDAP"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 msgid "Timeout in LDAP"
 msgstr "Перевищення часу очікування у LDAP"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 msgid "LDAP decoding error"
 msgstr "Помилка декодування LDAP"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 msgid "LDAP encoding error"
 msgstr "Помилка кодування LDAP"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 msgid "LDAP local error"
 msgstr "Локальна помилка LDAP"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 msgid "Cannot contact LDAP server"
 msgstr "Не вдалося встановити зв’язок із сервером LDAP"
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 msgid "LDAP success"
 msgstr "Успіх LDAP"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 msgid "LDAP operations error"
 msgstr "Помилка дій LDAP"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 msgid "LDAP protocol error"
 msgstr "Помилка протоколу LDAP"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr "Перевищено час очікування у LDAP"
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr "Перевищено обмеження на розмір у LDAP"
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr "Порівняння LDAP: не збігаються"
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr "Порівняння LDAP: збігаються"
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 msgid "LDAP authentication method not supported"
 msgstr "Підтримки методу розпізнавання LDAP не передбачено"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
 msgstr "Потрібен потужніший спосіб розпізнавання LDAP"
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 msgid "Partial LDAP results+referral received"
 msgstr "Отримано часткові результати і спрямування LDAP"
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 msgid "LDAP referral"
 msgstr "Спрямування LDAP"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr "Перевищено адміністративне обмеження LDAP"
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr "Недоступне критичне розширення LDAP"
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 msgid "Confidentiality required by LDAP"
 msgstr "Конфіденційно потрібне LDAP"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr "Виконуємо прив’язування SASL LDAP"
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr "Немає такого атрибута LDAP"
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 msgid "Undefined LDAP attribute type"
 msgstr "Невизначний тип атрибута LDAP"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 msgid "Inappropriate matching in LDAP"
 msgstr "Неприйнятна відповідність у LDAP"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 msgid "Constraint violation in LDAP"
 msgstr "Порушення обмежень у LDAP"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr "Тип або значення LDAP існує"
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 msgid "Invalid syntax in LDAP"
 msgstr "Некоректний синтаксис у LDAP"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 msgid "No such LDAP object"
 msgstr "Немає такого об’єкта LDAP"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 msgid "LDAP alias problem"
 msgstr "Проблема псевдоніма LDAP"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 msgid "Invalid DN syntax in LDAP"
 msgstr "Некоректний синтаксис DN у LDAP"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr "Запис LDAP є листком"
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 msgid "LDAP alias dereferencing problem"
 msgstr "Проблемі з скасування прив’язки псевдоніма LDAP"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr "Помилка уповноваження проксі LDAP (X)"
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 msgid "Inappropriate LDAP authentication"
 msgstr "Неприйнятне розпізнавання LDAP"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 msgid "Invalid LDAP credentials"
 msgstr "Некоректні реєстраційні дані LDAP"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr "Недостатні права доступу до LDAP"
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr "Сервер LDAP зайнято виконанням завдання"
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 msgid "LDAP server is unavailable"
 msgstr "Сервер LDAP недоступний"
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr "Сервер LDAP не бажає працювати"
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr "LDAP виявлено цикл"
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 msgid "LDAP naming violation"
 msgstr "Порушення іменування LDAP"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 msgid "LDAP object class violation"
 msgstr "Порушення класу об’єктів LDAP"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "Дію LDAP не дозволено для об’єктів, які не є листками"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 msgid "LDAP operation not allowed on RDN"
 msgstr "Дію LDAP не дозволено над RDN"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr "Вже існує (LDAP)"
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr "Не вдалося змінити клас об’єкта LDAP"
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 msgid "LDAP results too large"
 msgstr "Результати LDAP є надто великими"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 msgid "LDAP operation affects multiple DSAs"
 msgstr "Дія LDAP стосується декількох DSA"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr "Помилка перегляду списку віртуальної LDAP"
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 msgid "Other LDAP error"
 msgstr "Інша помилка LDAP"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 msgid "Resources exhausted in LCUP"
 msgstr "Вичерпано ресурси у LCUP"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 msgid "Security violation in LCUP"
 msgstr "Порушення захисту у LCUP"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 msgid "Invalid data in LCUP"
 msgstr "Некоректні дані у LCUP"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 msgid "Unsupported scheme in LCUP"
 msgstr "Непідтримувана схема у LCUP"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 msgid "Reload required in LCUP"
 msgstr "Потрібне перезавантаження у LCUP"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 msgid "LDAP cancelled"
 msgstr "LDAP скасовано"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 msgid "No LDAP operation to cancel"
 msgstr "Немає дії LDAP для скасовування"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 msgid "Too late to cancel LDAP"
 msgstr "Запізно для скасовування LDAP"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 msgid "Cannot cancel LDAP"
 msgstr "Не вдалося скасувати LDAP"
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 msgid "LDAP assertion failed"
 msgstr "Помилка оцінки LDAP"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr "Уповноваження за допомогою проксі заборонено LDAP"
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "Визначений користувачем код помилки 1"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "Визначений користувачем код помилки 2"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "Визначений користувачем код помилки 3"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "Визначений користувачем код помилки 4"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "Визначений користувачем код помилки 5"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "Визначений користувачем код помилки 6"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "Визначений користувачем код помилки 7"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "Визначений користувачем код помилки 8"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "Визначений користувачем код помилки 9"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "Визначений користувачем код помилки 10"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "Визначений користувачем код помилки 11"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "Визначений користувачем код помилки 12"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "Визначений користувачем код помилки 13"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "Визначений користувачем код помилки 14"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "Визначений користувачем код помилки 15"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "Визначений користувачем код помилки 16"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+msgid "SQL success"
+msgstr "Успіх SQL"
+
+#: src/err-codes.h:433
+msgid "SQL error"
+msgstr "Помилка SQL"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr "Внутрішня помилка логіки у бібліотеці SQL"
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr "Заборонено доступ за правами (SQL)"
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr "Надійшов запит на переривання роботи SQL"
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr "Файл бази даних SQL заблоковано"
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr "Таблицю SQL у базі даних заблоковано"
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr "Вихід за межі області пам'яті у бібліотеці SQL"
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr "Спроба запису до придатної лише до читання бази даних SQL"
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr "SQL operation terminated by interrupt"
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr "Помилка введення-виведення під час виконання дії SQL"
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr "Образ диска бази даних SQL має помилкове форматування"
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr "Невідомий код дії у керування файлами SQL"
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr "Не вдалося вставити запис, оскільки базу даних SQL переповнено"
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr "Не вдалося відкрити файл бази даних SQL"
+
+#: src/err-codes.h:447
+msgid "SQL database lock protocol error"
+msgstr "Помилка протоколу блокування бази даних SQL"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr "(внутрішній код SQL: порожньо)"
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr "Змінено структуру бази даних SQL"
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr "Перевищення обмеження на розмір рядка або двійкового об'єкта (SQL)"
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr "Переривання роботи SQL через перевищення обмежень"
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr "Невідповідність типів даних (SQL)"
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr "Неправильне використання бібліотеки SQL"
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr "Бібліотека SQL намагається використати непідтримувані можливості ОС"
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr "Відмовлено в уповноваженні (SQL)"
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr "(невикористаний код SQL: формат)"
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr "Параметр прив'язки SQL має значення поза межами припустимого діапазону"
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr "Відкрито файл, який не є файлом бази даних SQL"
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr "Сповіщення від засобу журналювання SQL"
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr "Попередження від засобу журналювання SQL"
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr "У SQL готовий ще один рядок"
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr "Виконання коду SQL завершено"
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "Системна помилка без номера"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Невідома системна помилка"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Кінець файла"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Помилка з невідомим кодом"
 
-#: src/gpg-error.c:450
-#, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Користування: %s ПОМИЛКА-GPG [...]\n"
+#: src/argparse.c:494
+msgid "argument not expected"
+msgstr "неочікуваний аргумент"
 
-#: src/gpg-error.c:633
-#, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: попередження: не вдалося розпізнати %s\n"
+#: src/argparse.c:496
+msgid "read error"
+msgstr "помилка читання"
+
+#: src/argparse.c:498
+msgid "keyword too long"
+msgstr "занадто довге ключове слово"
+
+#: src/argparse.c:500
+msgid "missing argument"
+msgstr "не вистачає аргументу"
 
+#: src/argparse.c:502
+msgid "invalid argument"
+msgstr "некоректний аргумент"
+
+#: src/argparse.c:504
+msgid "invalid command"
+msgstr "некоректна команда"
+
+#: src/argparse.c:506
+msgid "invalid alias definition"
+msgstr "некоректне визначення замінника"
+
+#: src/argparse.c:508 src/argparse.c:545
 #, fuzzy
-#~| msgid "Resources exhausted"
-#~ msgid "LCUP Resources exhausted"
-#~ msgstr "Вичерпано ресурси"
+#| msgid "LDAP operations error"
+msgid "permission error"
+msgstr "Помилка дій LDAP"
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr "вихід за межі області пам’яті"
 
+#: src/argparse.c:514 src/argparse.c:549
 #, fuzzy
-#~| msgid "Invalid data"
-#~ msgid "LCUP Invalid data"
-#~ msgstr "Некоректні дані"
+#| msgid "invalid command"
+msgid "invalid meta command"
+msgstr "некоректна команда"
 
+#: src/argparse.c:516 src/argparse.c:551
 #, fuzzy
-#~| msgid "General error"
-#~ msgid "LDAP Other general error"
-#~ msgstr "Загальна помилка"
+#| msgid "Unknown command"
+msgid "unknown meta command"
+msgstr "Невідома команда"
 
+#: src/argparse.c:518 src/argparse.c:553
 #, fuzzy
-#~| msgid "dirmngr error"
-#~ msgid "Encoding error"
-#~ msgstr "Помилка dirmngr"
+#| msgid "Unexpected IPC command"
+msgid "unexpected meta command"
+msgstr "Неочікувана команда IPC"
+
+#: src/argparse.c:520
+msgid "invalid option"
+msgstr "некоректний параметр"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr "не вказано аргументу до параметра «%.50s»\n"
+
+#: src/argparse.c:532
+#, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "некоректний аргумент параметра «%.50s»\n"
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr "для параметра «%.50s» аргументи не потрібно вказувати\n"
+
+#: src/argparse.c:537
+#, c-format
+msgid "invalid command \"%.50s\"\n"
+msgstr "некоректна команда «%.50s»\n"
+
+#: src/argparse.c:539
+#, c-format
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr "параметр «%.50s» є неоднозначним\n"
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr "команда «%.50s» є неоднозначною\n"
+
+#: src/argparse.c:555
+#, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr "некоректний параметр «%.50s»\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr ""
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr "Будь ласка, повідомляйте про помилки тут: <https://bugs.gnupg.org>.\n"
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "попередження: не вдалося розпізнати %s\n"
+
+#~ msgid "out of core\n"
+#~ msgstr "вихід за межі області пам’яті\n"
index f5976ca..bf68e9d 100644 (file)
Binary files a/po/vi.gmo and b/po/vi.gmo differ
index 69da804..0d5401d 100644 (file)
--- a/po/vi.po
+++ b/po/vi.po
@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libgpg-error 1.7\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2013-02-23 20:10+0100\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:44+0100\n"
 "Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
 "Language-Team: Vietnamese <vi-VN@googlegroups.com>\n"
 "Language: vi\n"
@@ -83,30 +83,34 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
-msgid "TLS"
-msgstr ""
+msgid "TPM2d"
+msgstr "TPM2d"
 
 #: src/err-sources.h:45
+msgid "TLS"
+msgstr "TLS"
+
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "Bất cứ nguồn nào"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "Nguồn tự xác định 1"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "Nguồn tự xác định 2"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "Nguồn tự xác định 3"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "Nguồn tự xác định 4"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "Nguồn không rõ"
 
@@ -1353,575 +1357,872 @@ msgid "Wrong name"
 msgstr "Tên không rõ"
 
 #: src/err-codes.h:320
+#, fuzzy
+msgid "Not authenticated"
+msgstr "Không phải bị khoá"
+
+#: src/err-codes.h:321
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Bad authentication"
+msgstr "Sự bảo vệ không được hỗ trợ"
+
+#: src/err-codes.h:322
+#, fuzzy
+#| msgid "No agent running"
+msgid "No Keybox daemon running"
+msgstr "Không có tác nhân đang chạy"
+
+#: src/err-codes.h:323
+#, fuzzy
+#| msgid "SmartCard daemon error"
+msgid "Keybox daemon error"
+msgstr "Lỗi trình nền Thẻ Khéo"
+
+#: src/err-codes.h:324
+msgid "Service is not running"
+msgstr ""
+
+#: src/err-codes.h:325
+#, fuzzy
+#| msgid "Keyserver error"
+msgid "Service error"
+msgstr "Lỗi máy phục vụ khoá"
+
+#: src/err-codes.h:326
 msgid "System bug detected"
 msgstr ""
 
-#: src/err-codes.h:321
+#: src/err-codes.h:327
 #, fuzzy
 #| msgid "Unknown system error"
 msgid "Unknown DNS error"
 msgstr "Gặp lỗi hệ thống không rõ"
 
-#: src/err-codes.h:322
+#: src/err-codes.h:328
 #, fuzzy
 #| msgid "Invalid OID string"
 msgid "Invalid DNS section"
 msgstr "Chuỗi OID không hợp lệ"
 
-#: src/err-codes.h:323
+#: src/err-codes.h:329
 #, fuzzy
 #| msgid "Invalid S-expression"
 msgid "Invalid textual address form"
 msgstr "Biểu thức S không hợp lệ"
 
-#: src/err-codes.h:324
+#: src/err-codes.h:330
 #, fuzzy
 msgid "Missing DNS query packet"
 msgstr "Chứng nhận còn thiếu"
 
-#: src/err-codes.h:325
+#: src/err-codes.h:331
 msgid "Missing DNS answer packet"
 msgstr ""
 
-#: src/err-codes.h:326
+#: src/err-codes.h:332
 msgid "Connection closed in DNS"
 msgstr ""
 
-#: src/err-codes.h:327
+#: src/err-codes.h:333
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "Verification failed in DNS"
 msgstr "Lỗi giải mật mã"
 
-#: src/err-codes.h:328
+#: src/err-codes.h:334
 #, fuzzy
 #| msgid "Timeout"
 msgid "DNS Timeout"
 msgstr "Quá giờ"
 
-#: src/err-codes.h:329
+#: src/err-codes.h:335
 #, fuzzy
 #| msgid "General IPC error"
 msgid "General LDAP error"
 msgstr "Lỗi IPC chung"
 
-#: src/err-codes.h:330
+#: src/err-codes.h:336
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP attribute error"
 msgstr "Lỗi chung"
 
-#: src/err-codes.h:331
+#: src/err-codes.h:337
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP name error"
 msgstr "Lỗi chung"
 
-#: src/err-codes.h:332
+#: src/err-codes.h:338
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP security error"
 msgstr "Lỗi Assuan chung"
 
-#: src/err-codes.h:333
+#: src/err-codes.h:339
 #, fuzzy
 #| msgid "General error"
 msgid "General LDAP service error"
 msgstr "Lỗi chung"
 
-#: src/err-codes.h:334
+#: src/err-codes.h:340
 #, fuzzy
 #| msgid "General Assuan error"
 msgid "General LDAP update error"
 msgstr "Lỗi Assuan chung"
 
-#: src/err-codes.h:335
+#: src/err-codes.h:341
 msgid "Experimental LDAP error code"
 msgstr ""
 
-#: src/err-codes.h:336
+#: src/err-codes.h:342
 #, fuzzy
 #| msgid "IPC write error"
 msgid "Private LDAP error code"
 msgstr "Lỗi ghi IPC"
 
-#: src/err-codes.h:337
+#: src/err-codes.h:343
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other general LDAP error"
 msgstr "Lỗi IPC chung"
 
-#: src/err-codes.h:338
+#: src/err-codes.h:344
 #, fuzzy
 #| msgid "IPC connect call failed"
 msgid "LDAP connecting failed (X)"
 msgstr "Lời gọi kết nối IPC bị lỗi"
 
-#: src/err-codes.h:339
+#: src/err-codes.h:345
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral limit exceeded"
 msgstr "Lỗi chung"
 
-#: src/err-codes.h:340
+#: src/err-codes.h:346
 msgid "LDAP client loop"
 msgstr ""
 
-#: src/err-codes.h:341
+#: src/err-codes.h:347
 #, fuzzy
 #| msgid "Card reset required"
 msgid "No LDAP results returned"
 msgstr "Cần thiết lập lại thẻ"
 
-#: src/err-codes.h:342
+#: src/err-codes.h:348
 #, fuzzy
 #| msgid "Element not found"
 msgid "LDAP control not found"
 msgstr "Không tìm thấy phần tử"
 
-#: src/err-codes.h:343
+#: src/err-codes.h:349
 #, fuzzy
 #| msgid "Not supported"
 msgid "Not supported by LDAP"
 msgstr "Không được hỗ trợ"
 
-#: src/err-codes.h:344
+#: src/err-codes.h:350
 #, fuzzy
 #| msgid "Unexpected error"
 msgid "LDAP connect error"
 msgstr "Gặp lỗi bất thường"
 
-#: src/err-codes.h:345
+#: src/err-codes.h:351
 msgid "Out of memory in LDAP"
 msgstr ""
 
-#: src/err-codes.h:346
+#: src/err-codes.h:352
 msgid "Bad parameter to an LDAP routine"
 msgstr ""
 
-#: src/err-codes.h:347
+#: src/err-codes.h:353
 #, fuzzy
 #| msgid "Unsupported operation"
 msgid "User cancelled LDAP operation"
 msgstr "Thao tác không được hỗ trợ"
 
-#: src/err-codes.h:348
+#: src/err-codes.h:354
 #, fuzzy
 #| msgid "Bad certificate"
 msgid "Bad LDAP search filter"
 msgstr "Chứng nhận sai"
 
-#: src/err-codes.h:349
+#: src/err-codes.h:355
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "Unknown LDAP authentication method"
 msgstr "Phần mở rộng không rõ"
 
-#: src/err-codes.h:350
+#: src/err-codes.h:356
 #, fuzzy
 #| msgid "Timeout"
 msgid "Timeout in LDAP"
 msgstr "Quá giờ"
 
-#: src/err-codes.h:351
+#: src/err-codes.h:357
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP decoding error"
 msgstr "Lỗi dirmngr"
 
-#: src/err-codes.h:352
+#: src/err-codes.h:358
 #, fuzzy
 #| msgid "dirmngr error"
 msgid "LDAP encoding error"
 msgstr "Lỗi dirmngr"
 
-#: src/err-codes.h:353
+#: src/err-codes.h:359
 #, fuzzy
 #| msgid "IPC read error"
 msgid "LDAP local error"
 msgstr "Lỗi đọc IPC"
 
-#: src/err-codes.h:354
+#: src/err-codes.h:360
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot contact LDAP server"
 msgstr "Không phải trình phục vụ IPC"
 
-#: src/err-codes.h:355
+#: src/err-codes.h:361
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP success"
 msgstr "Thành công"
 
-#: src/err-codes.h:356
+#: src/err-codes.h:362
 #, fuzzy
 #| msgid "Configuration error"
 msgid "LDAP operations error"
 msgstr "Lỗi cấu hình"
 
-#: src/err-codes.h:357
+#: src/err-codes.h:363
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP protocol error"
 msgstr "Vi phạm giao thức"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
 msgstr ""
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
 msgstr ""
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
 msgstr ""
 
-#: src/err-codes.h:362
+#: src/err-codes.h:368
 #, fuzzy
 #| msgid "Unknown extension"
 msgid "LDAP authentication method not supported"
 msgstr "Phần mở rộng không rõ"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
 msgstr ""
 
-#: src/err-codes.h:364
+#: src/err-codes.h:370
 msgid "Partial LDAP results+referral received"
 msgstr ""
 
-#: src/err-codes.h:365
+#: src/err-codes.h:371
 #, fuzzy
 #| msgid "General error"
 msgid "LDAP referral"
 msgstr "Lỗi chung"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
 msgstr ""
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
 msgstr ""
 
-#: src/err-codes.h:368
+#: src/err-codes.h:374
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Confidentiality required by LDAP"
 msgstr "Cần thiết lập lại thẻ"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
 msgstr ""
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
 msgstr ""
 
-#: src/err-codes.h:371
+#: src/err-codes.h:377
 #, fuzzy
 #| msgid "Invalid attribute"
 msgid "Undefined LDAP attribute type"
 msgstr "Thuộc tính không hợp lệ"
 
-#: src/err-codes.h:372
+#: src/err-codes.h:378
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate matching in LDAP"
 msgstr "Sự bảo vệ không được hỗ trợ"
 
-#: src/err-codes.h:373
+#: src/err-codes.h:379
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Constraint violation in LDAP"
 msgstr "Vi phạm giao thức"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
 msgstr ""
 
-#: src/err-codes.h:375
+#: src/err-codes.h:381
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid syntax in LDAP"
 msgstr "Tình trạng không hợp lệ"
 
-#: src/err-codes.h:376
+#: src/err-codes.h:382
 #, fuzzy
 #| msgid "No CMS object"
 msgid "No such LDAP object"
 msgstr "Không có đối tượng CMS"
 
-#: src/err-codes.h:377
+#: src/err-codes.h:383
 #, fuzzy
 #| msgid "Hardware problem"
 msgid "LDAP alias problem"
 msgstr "Lỗi phần cứng"
 
-#: src/err-codes.h:378
+#: src/err-codes.h:384
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid DN syntax in LDAP"
 msgstr "Tình trạng không hợp lệ"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
 msgstr ""
 
-#: src/err-codes.h:380
+#: src/err-codes.h:386
 #, fuzzy
 #| msgid "Encoding problem"
 msgid "LDAP alias dereferencing problem"
 msgstr "Lỗi mã hoá"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
 msgstr ""
 
-#: src/err-codes.h:382
+#: src/err-codes.h:388
 #, fuzzy
 #| msgid "Unsupported protection"
 msgid "Inappropriate LDAP authentication"
 msgstr "Sự bảo vệ không được hỗ trợ"
 
-#: src/err-codes.h:383
+#: src/err-codes.h:389
 #, fuzzy
 #| msgid "Invalid card"
 msgid "Invalid LDAP credentials"
 msgstr "Thẻ không hợp lệ"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
 msgstr ""
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
 msgstr ""
 
-#: src/err-codes.h:386
+#: src/err-codes.h:392
 msgid "LDAP server is unavailable"
 msgstr ""
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
 msgstr ""
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
 msgstr ""
 
-#: src/err-codes.h:389
+#: src/err-codes.h:395
 #, fuzzy
 #| msgid "Missing action"
 msgid "LDAP naming violation"
 msgstr "Thiếu hành động"
 
-#: src/err-codes.h:390
+#: src/err-codes.h:396
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "LDAP object class violation"
 msgstr "Vi phạm giao thức"
 
-#: src/err-codes.h:391
+#: src/err-codes.h:397
 #, fuzzy
 #| msgid "Operation not yet finished"
 msgid "LDAP operation not allowed on non-leaf"
 msgstr "Thao tác chưa kết thúc"
 
-#: src/err-codes.h:392
+#: src/err-codes.h:398
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation not allowed on RDN"
 msgstr "Thao tác bị hủy bỏ"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
 msgstr ""
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
 msgstr ""
 
-#: src/err-codes.h:395
+#: src/err-codes.h:401
 #, fuzzy
 #| msgid "Line too long"
 msgid "LDAP results too large"
 msgstr "Dòng quá dài"
 
-#: src/err-codes.h:396
+#: src/err-codes.h:402
 #, fuzzy
 #| msgid "Operation cancelled"
 msgid "LDAP operation affects multiple DSAs"
 msgstr "Thao tác bị hủy bỏ"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
 msgstr ""
 
-#: src/err-codes.h:398
+#: src/err-codes.h:404
 #, fuzzy
 #| msgid "General IPC error"
 msgid "Other LDAP error"
 msgstr "Lỗi IPC chung"
 
-#: src/err-codes.h:399
+#: src/err-codes.h:405
 #, fuzzy
 #| msgid "Resources exhausted"
 msgid "Resources exhausted in LCUP"
 msgstr "Cạn tài nguyên"
 
-#: src/err-codes.h:400
+#: src/err-codes.h:406
 #, fuzzy
 #| msgid "Protocol violation"
 msgid "Security violation in LCUP"
 msgstr "Vi phạm giao thức"
 
-#: src/err-codes.h:401
+#: src/err-codes.h:407
 #, fuzzy
 #| msgid "Invalid state"
 msgid "Invalid data in LCUP"
 msgstr "Tình trạng không hợp lệ"
 
-#: src/err-codes.h:402
+#: src/err-codes.h:408
 #, fuzzy
 #| msgid "Unsupported certificate"
 msgid "Unsupported scheme in LCUP"
 msgstr "Chứng nhận không được hỗ trợ"
 
-#: src/err-codes.h:403
+#: src/err-codes.h:409
 #, fuzzy
 #| msgid "Card reset required"
 msgid "Reload required in LCUP"
 msgstr "Cần thiết lập lại thẻ"
 
-#: src/err-codes.h:404
+#: src/err-codes.h:410
 #, fuzzy
 #| msgid "Success"
 msgid "LDAP cancelled"
 msgstr "Thành công"
 
-#: src/err-codes.h:405
+#: src/err-codes.h:411
 #, fuzzy
 #| msgid "Not operational"
 msgid "No LDAP operation to cancel"
 msgstr "Không hoạt động được"
 
-#: src/err-codes.h:406
+#: src/err-codes.h:412
 #, fuzzy
 #| msgid "Not operational"
 msgid "Too late to cancel LDAP"
 msgstr "Không hoạt động được"
 
-#: src/err-codes.h:407
+#: src/err-codes.h:413
 #, fuzzy
 #| msgid "Not an IPC server"
 msgid "Cannot cancel LDAP"
 msgstr "Không phải trình phục vụ IPC"
 
-#: src/err-codes.h:408
+#: src/err-codes.h:414
 #, fuzzy
 #| msgid "Decryption failed"
 msgid "LDAP assertion failed"
 msgstr "Lỗi giải mật mã"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
 msgstr ""
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "Mã lỗi tự xác định 1"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "Mã lỗi tự xác định 2"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "Mã lỗi tự xác định 3"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "Mã lỗi tự xác định 4"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "Mã lỗi tự xác định 5"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "Mã lỗi tự xác định 6"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "Mã lỗi tự xác định 7"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "Mã lỗi tự xác định 8"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "Mã lỗi tự xác định 9"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "Mã lỗi tự xác định 10"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "Mã lỗi tự xác định 11"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "Mã lỗi tự xác định 12"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "Mã lỗi tự xác định 13"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "Mã lỗi tự xác định 14"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "Mã lỗi tự xác định 15"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "Mã lỗi tự xác định 16"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+#, fuzzy
+#| msgid "Success"
+msgid "SQL success"
+msgstr "Thành công"
+
+#: src/err-codes.h:433
+#, fuzzy
+#| msgid "Syntax error"
+msgid "SQL error"
+msgstr "Lỗi cú pháp"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr ""
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr ""
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr ""
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr ""
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr ""
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr ""
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr ""
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr ""
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr ""
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr ""
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr ""
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr ""
+
+#: src/err-codes.h:447
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "SQL database lock protocol error"
+msgstr "Vi phạm giao thức"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr ""
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr ""
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr ""
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr ""
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr ""
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr ""
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr ""
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr ""
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr ""
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr ""
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr ""
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr ""
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr ""
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr ""
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "Lỗi hệ thống không có số thứ tự lỗi"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "Gặp lỗi hệ thống không rõ"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "Kết thúc tập tin"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "Mã lỗi không rõ"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "argument not expected"
+msgstr "Chưa mật mã dữ liệu"
+
+#: src/argparse.c:496
+#, fuzzy
+#| msgid "IPC read error"
+msgid "read error"
+msgstr "Lỗi đọc IPC"
+
+#: src/argparse.c:498
+#, fuzzy
+#| msgid "Line too long"
+msgid "keyword too long"
+msgstr "Dòng quá dài"
+
+#: src/argparse.c:500
+#, fuzzy
+#| msgid "Missing value"
+msgid "missing argument"
+msgstr "Thiếu giá trị"
+
+#: src/argparse.c:502
+#, fuzzy
+#| msgid "Invalid argument"
+msgid "invalid argument"
+msgstr "Đối số không hợp lệ"
+
+#: src/argparse.c:504
+#, fuzzy
+#| msgid "Invalid card"
+msgid "invalid command"
+msgstr "Thẻ không hợp lệ"
+
+#: src/argparse.c:506
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "invalid alias definition"
+msgstr "Chuỗi OID không hợp lệ"
+
+#: src/argparse.c:508 src/argparse.c:545
+#, fuzzy
+#| msgid "Configuration error"
+msgid "permission error"
+msgstr "Lỗi cấu hình"
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr ""
+
+#: src/argparse.c:514 src/argparse.c:549
+#, fuzzy
+#| msgid "Invalid card"
+msgid "invalid meta command"
+msgstr "Thẻ không hợp lệ"
+
+#: src/argparse.c:516 src/argparse.c:551
+#, fuzzy
+#| msgid "Unknown command"
+msgid "unknown meta command"
+msgstr "Lệnh không rõ"
+
+#: src/argparse.c:518 src/argparse.c:553
+#, fuzzy
+#| msgid "Unexpected IPC command"
+msgid "unexpected meta command"
+msgstr "Câu lệnh IPC bất thường"
+
+#: src/argparse.c:520
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "invalid option"
+msgstr "Mã thao tác không hợp lệ"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:532
+#, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr ""
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr ""
+
+#: src/argparse.c:537
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "Sử dụng: %s GPG-ERROR [...]\n"
+msgid "invalid command \"%.50s\"\n"
+msgstr ""
 
-#: src/gpg-error.c:633
+#: src/argparse.c:539
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: cảnh báo : không thể nhận ra %s\n"
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr ""
+
+#: src/argparse.c:555
+#, fuzzy, c-format
+#| msgid "Invalid operation code"
+msgid "invalid option \"%.50s\"\n"
+msgstr "Mã thao tác không hợp lệ"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr ""
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr ""
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr ""
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr ""
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "cảnh báo : không thể nhận ra %s\n"
+
+#~ msgid "Usage: %s GPG-ERROR [...]\n"
+#~ msgstr "Sử dụng: %s GPG-ERROR [...]\n"
 
 #, fuzzy
 #~| msgid "Resources exhausted"
index fb6b1bb..9304154 100644 (file)
Binary files a/po/zh_CN.gmo and b/po/zh_CN.gmo differ
index af5ca56..590a4a4 100644 (file)
@@ -2,21 +2,23 @@
 # Copyright (C) 2009 Free Software Foundation, Inc.
 # This file is distributed under the same license as the libgpg-error package.
 # Aron Xu <happyaron.xu@gmail.com>, 2009.
-#
+# Chinese (simplified) <translation-team-zh-cn@lists.sourceforge.net>, 2009.
+# bobwxc <bobwxc@yeah.net>, 2020.
+# 请注意secret key在此处请译为私钥,密钥泛指key
 msgid ""
 msgstr ""
-"Project-Id-Version: libgpg-error 1.7\n"
+"Project-Id-Version: libgpg-error 1.39\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2013-02-23 20:11+0100\n"
-"Last-Translator: Aron Xu <happyaron.xu@gmail.com>\n"
-"Language-Team: Chinese (simplified) <translation-team-zh-cn@lists."
-"sourceforge.net>\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:44+0100\n"
+"Last-Translator: bobwxc <bobwxc@yeah.net>\n"
+"Language-Team: none\n"
 "Language: zh_CN\n"
 "MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
+"Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=1; plural=0;\n"
+"X-Generator: Poedit 2.2.1\n"
 
 #: src/err-sources.h:28
 msgid "Unspecified source"
@@ -36,11 +38,11 @@ msgstr "GpgSM"
 
 #: src/err-sources.h:32
 msgid "GPG Agent"
-msgstr "GPG 代理"
+msgstr "GPG Agent代理"
 
 #: src/err-sources.h:33
 msgid "Pinentry"
-msgstr ""
+msgstr "Pinentry"
 
 #: src/err-sources.h:34
 msgid "SCD"
@@ -52,7 +54,7 @@ msgstr "GPGME"
 
 #: src/err-sources.h:36
 msgid "Keybox"
-msgstr ""
+msgstr "Keybox钥匙盒"
 
 #: src/err-sources.h:37
 msgid "KSBA"
@@ -60,7 +62,7 @@ msgstr "KSBA"
 
 #: src/err-sources.h:38
 msgid "Dirmngr"
-msgstr ""
+msgstr "Dirmngr"
 
 #: src/err-sources.h:39
 msgid "GSTI"
@@ -72,43 +74,47 @@ msgstr "GPA"
 
 #: src/err-sources.h:41
 msgid "Kleopatra"
-msgstr ""
+msgstr "Kleopatra"
 
 #: src/err-sources.h:42
 msgid "G13"
-msgstr ""
+msgstr "G13"
 
 #: src/err-sources.h:43
 msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
-msgid "TLS"
-msgstr ""
+msgid "TPM2d"
+msgstr "TPM2d"
 
 #: src/err-sources.h:45
+msgid "TLS"
+msgstr "TLS"
+
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "任何来源"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
-msgstr "用户定义的来源1"
+msgstr "用户定义的来源 1"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
-msgstr "用户定义的来源2"
+msgstr "用户定义的来源 2"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
-msgstr "用户定义的来源3"
+msgstr "用户定义的来源 3"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
-msgstr "用户定义的来源4"
+msgstr "用户定义的来源 4"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
-msgstr "æ\9d¥æº\90ä¸\8dæ\98\8e"
+msgstr "æ\9cªç\9f¥æ\9d¥æº\90"
 
 #: src/err-codes.h:28
 msgid "Success"
@@ -116,7 +122,7 @@ msgstr "成功"
 
 #: src/err-codes.h:29
 msgid "General error"
-msgstr "一般错误"
+msgstr "常规错误"
 
 #: src/err-codes.h:30
 msgid "Unknown packet"
@@ -140,7 +146,7 @@ msgstr "损坏的公钥"
 
 #: src/err-codes.h:35
 msgid "Bad secret key"
-msgstr "损坏的钥"
+msgstr "损坏的钥"
 
 #: src/err-codes.h:36
 msgid "Bad signature"
@@ -148,7 +154,7 @@ msgstr "损坏的签名"
 
 #: src/err-codes.h:37
 msgid "No public key"
-msgstr "没有公钥"
+msgstr "缺少公钥"
 
 #: src/err-codes.h:38
 msgid "Checksum error"
@@ -164,7 +170,7 @@ msgstr "无效的密码算法"
 
 #: src/err-codes.h:41
 msgid "Cannot open keyring"
-msgstr ""
+msgstr "无法打开钥匙环"
 
 #: src/err-codes.h:42
 msgid "Invalid packet"
@@ -172,19 +178,19 @@ msgstr "无效的数据包"
 
 #: src/err-codes.h:43
 msgid "Invalid armor"
-msgstr ""
+msgstr "无效的保护壳"
 
 #: src/err-codes.h:44
 msgid "No user ID"
-msgstr "没有用户ID"
+msgstr "缺少用户标识"
 
 #: src/err-codes.h:45
 msgid "No secret key"
-msgstr "没有秘匙"
+msgstr "缺少私钥"
 
 #: src/err-codes.h:46
 msgid "Wrong secret key used"
-msgstr "使用了错误的钥"
+msgstr "使用了错误的钥"
 
 #: src/err-codes.h:47
 msgid "Bad session key"
@@ -232,7 +238,7 @@ msgstr "语法错误"
 
 #: src/err-codes.h:58
 msgid "Bad MPI value"
-msgstr "损坏的MPI 值"
+msgstr "损坏的 MPI 值"
 
 #: src/err-codes.h:59
 msgid "Invalid passphrase"
@@ -240,7 +246,7 @@ msgstr "无效的密码"
 
 #: src/err-codes.h:60
 msgid "Invalid signature class"
-msgstr ""
+msgstr "无效的签名类"
 
 #: src/err-codes.h:61
 msgid "Resources exhausted"
@@ -260,7 +266,7 @@ msgstr "损坏的证书"
 
 #: src/err-codes.h:65
 msgid "Invalid user ID"
-msgstr "无效的用户ID"
+msgstr "无效的用户标识"
 
 #: src/err-codes.h:66
 msgid "Unexpected error"
@@ -278,9 +284,16 @@ msgstr "密钥服务器错误"
 msgid "Wrong public key algorithm"
 msgstr "错误的公开密钥算法"
 
+# 道格拉斯·亚当斯(Douglas Adams 1952年3月11日 -- 2001年5月11日)
+# 生于英国剑桥,英国广播剧作家、音乐家,尤其以《银河系漫游指南》
+# 系列作品出名。这部作品以广播剧起家,后来发展成包括五本书的“三
+# 部曲”,拍成电视连续剧。亚当斯逝世后还拍成电影。亚当斯自称为“极
+# 端无神论者”。在去世以前,他是一位非常受欢迎的演讲者,尤其是在
+# 科技和环保等题材方面。他在49岁时的早逝在科幻和奇幻社群中引起了
+# 极大的哀悼。
 #: src/err-codes.h:70
 msgid "Tribute to D. A."
-msgstr ""
+msgstr "向道格拉斯·亚当斯致敬"
 
 #: src/err-codes.h:71
 msgid "Weak encryption key"
@@ -296,11 +309,11 @@ msgstr "无效的参数"
 
 #: src/err-codes.h:74
 msgid "Syntax error in URI"
-msgstr "以下URI 中语法错误"
+msgstr "以下 URI 中语法错误"
 
 #: src/err-codes.h:75
 msgid "Invalid URI"
-msgstr "无效的URI"
+msgstr "无效的 URI"
 
 #: src/err-codes.h:76
 msgid "Network error"
@@ -328,7 +341,7 @@ msgstr "不可用公钥"
 
 #: src/err-codes.h:82
 msgid "Unusable secret key"
-msgstr "不可用钥"
+msgstr "不可用钥"
 
 #: src/err-codes.h:83
 msgid "Invalid value"
@@ -376,11 +389,11 @@ msgstr "无效的对象"
 
 #: src/err-codes.h:94
 msgid "Provided object is too short"
-msgstr "提供对象太短"
+msgstr "提供对象太短"
 
 #: src/err-codes.h:95
 msgid "Provided object is too large"
-msgstr "提供对象太大"
+msgstr "提供对象太大"
 
 #: src/err-codes.h:96
 msgid "Missing item in object"
@@ -392,7 +405,7 @@ msgstr "未实现"
 
 #: src/err-codes.h:98
 msgid "Conflicting use"
-msgstr ""
+msgstr "冲突的用法"
 
 #: src/err-codes.h:99
 msgid "Invalid cipher mode"
@@ -400,11 +413,11 @@ msgstr "无效的加密模式"
 
 #: src/err-codes.h:100
 msgid "Invalid flag"
-msgstr ""
+msgstr "无效标志"
 
 #: src/err-codes.h:101
 msgid "Invalid handle"
-msgstr ""
+msgstr "无效句柄"
 
 #: src/err-codes.h:102
 msgid "Result truncated"
@@ -423,10 +436,8 @@ msgid "No agent running"
 msgstr "未运行代理"
 
 #: src/err-codes.h:106
-#, fuzzy
-#| msgid "agent error"
 msgid "Agent error"
-msgstr "代理错误"
+msgstr "Agent 代理错误"
 
 #: src/err-codes.h:107
 msgid "Invalid data"
@@ -434,11 +445,11 @@ msgstr "无效的数据"
 
 #: src/err-codes.h:108
 msgid "Unspecific Assuan server fault"
-msgstr ""
+msgstr "不明的 Assuan 服务器错误"
 
 #: src/err-codes.h:109
 msgid "General Assuan error"
-msgstr "一般Assuan 错误"
+msgstr "常规 Assuan 错误"
 
 #: src/err-codes.h:110
 msgid "Invalid session key"
@@ -446,7 +457,7 @@ msgstr "无效的会话密钥"
 
 #: src/err-codes.h:111
 msgid "Invalid S-expression"
-msgstr ""
+msgstr "无效的 S-表达式"
 
 #: src/err-codes.h:112
 msgid "Unsupported algorithm"
@@ -454,15 +465,15 @@ msgstr "不支持的算法"
 
 #: src/err-codes.h:113
 msgid "No pinentry"
-msgstr ""
+msgstr "缺少 pinentry"
 
 #: src/err-codes.h:114
 msgid "pinentry error"
-msgstr ""
+msgstr "pinentry 错误"
 
 #: src/err-codes.h:115
 msgid "Bad PIN"
-msgstr "损坏的PIN"
+msgstr "损坏的 PIN"
 
 #: src/err-codes.h:116
 msgid "Invalid name"
@@ -478,15 +489,15 @@ msgstr "无效的参数"
 
 #: src/err-codes.h:119
 msgid "Wrong card"
-msgstr "错卡"
+msgstr "错误的卡"
 
 #: src/err-codes.h:120
 msgid "No dirmngr"
-msgstr ""
+msgstr "缺少 dirmngr"
 
 #: src/err-codes.h:121
 msgid "dirmngr error"
-msgstr ""
+msgstr "dirmngr 错误"
 
 #: src/err-codes.h:122
 msgid "Certificate revoked"
@@ -494,15 +505,15 @@ msgstr "证书已吊销"
 
 #: src/err-codes.h:123
 msgid "No CRL known"
-msgstr ""
+msgstr "无已知的 CRL"
 
 #: src/err-codes.h:124
 msgid "CRL too old"
-msgstr ""
+msgstr "CRL 过于陈旧"
 
 #: src/err-codes.h:125
 msgid "Line too long"
-msgstr "线太长"
+msgstr "太长"
 
 #: src/err-codes.h:126
 msgid "Not trusted"
@@ -514,7 +525,7 @@ msgstr "操作已取消"
 
 #: src/err-codes.h:128
 msgid "Bad CA certificate"
-msgstr "损坏的CA 证书"
+msgstr "损坏的 CA 证书"
 
 #: src/err-codes.h:129
 msgid "Certificate expired"
@@ -530,7 +541,7 @@ msgstr "不支持的凭证"
 
 #: src/err-codes.h:132
 msgid "Unknown S-expression"
-msgstr ""
+msgstr "未知的 S-表达式"
 
 #: src/err-codes.h:133
 msgid "Unsupported protection"
@@ -542,7 +553,7 @@ msgstr "损坏的保护"
 
 #: src/err-codes.h:135
 msgid "Ambiguous name"
-msgstr ""
+msgstr "名称不明确"
 
 #: src/err-codes.h:136
 msgid "Card error"
@@ -562,11 +573,11 @@ msgstr "无效的卡"
 
 #: src/err-codes.h:140
 msgid "Card not present"
-msgstr ""
+msgstr "卡不存在"
 
 #: src/err-codes.h:141
 msgid "No PKCS15 application"
-msgstr "没有PKCS15 应用程序"
+msgstr "没有 PKCS15 应用程序"
 
 #: src/err-codes.h:142
 msgid "Not confirmed"
@@ -602,7 +613,7 @@ msgstr "不支持的协议"
 
 #: src/err-codes.h:150
 msgid "Bad PIN method"
-msgstr ""
+msgstr "无效的 PIN 方法"
 
 #: src/err-codes.h:151
 msgid "Card not initialized"
@@ -618,11 +629,11 @@ msgstr "错误的密钥用法"
 
 #: src/err-codes.h:154
 msgid "Nothing found"
-msgstr "未å\8f\91ç\8e°"
+msgstr "未æ\89¾å\88°"
 
 #: src/err-codes.h:155
 msgid "Wrong blob type"
-msgstr ""
+msgstr "错误的 blob 类型"
 
 #: src/err-codes.h:156
 msgid "Missing value"
@@ -654,7 +665,7 @@ msgstr "BER 错误"
 
 #: src/err-codes.h:163
 msgid "Invalid BER"
-msgstr "无效的BER"
+msgstr "无效的 BER"
 
 #: src/err-codes.h:164
 msgid "Element not found"
@@ -678,27 +689,27 @@ msgstr "无效的密钥信息"
 
 #: src/err-codes.h:169
 msgid "Unexpected tag"
-msgstr ""
+msgstr "意外的标记"
 
 #: src/err-codes.h:170
 msgid "Not DER encoded"
-msgstr ""
+msgstr "非 DER 编码"
 
 #: src/err-codes.h:171
 msgid "No CMS object"
-msgstr "没有CMS 对象"
+msgstr "没有 CMS 对象"
 
 #: src/err-codes.h:172
 msgid "Invalid CMS object"
-msgstr "无效的CMS 对象"
+msgstr "无效的 CMS 对象"
 
 #: src/err-codes.h:173
 msgid "Unknown CMS object"
-msgstr "未知的CMS 对象"
+msgstr "未知的 CMS 对象"
 
 #: src/err-codes.h:174
 msgid "Unsupported CMS object"
-msgstr "不支持的CMS 对象"
+msgstr "不支持的 CMS 对象"
 
 #: src/err-codes.h:175
 msgid "Unsupported encoding"
@@ -706,7 +717,7 @@ msgstr "不支持的编码"
 
 #: src/err-codes.h:176
 msgid "Unsupported CMS version"
-msgstr "不支持的CMS 版本"
+msgstr "不支持的 CMS 版本"
 
 #: src/err-codes.h:177
 msgid "Unknown algorithm"
@@ -738,7 +749,7 @@ msgstr "编码问题"
 
 #: src/err-codes.h:184
 msgid "Invalid state"
-msgstr "æ\97 æ\95\88ç\9a\84å·\9e"
+msgstr "æ\97 æ\95\88ç\8a¶æ\80\81"
 
 #: src/err-codes.h:185
 msgid "Duplicated value"
@@ -746,7 +757,7 @@ msgstr "重复值"
 
 #: src/err-codes.h:186
 msgid "Missing action"
-msgstr ""
+msgstr "动作缺失"
 
 #: src/err-codes.h:187
 msgid "ASN.1 module not found"
@@ -754,7 +765,7 @@ msgstr "ASN.1 模块未找到"
 
 #: src/err-codes.h:188
 msgid "Invalid OID string"
-msgstr "无效的OID 字符串"
+msgstr "无效的 OID 字符串"
 
 #: src/err-codes.h:189
 msgid "Invalid time"
@@ -762,11 +773,11 @@ msgstr "无效的时间"
 
 #: src/err-codes.h:190
 msgid "Invalid CRL object"
-msgstr "无效的CRL 对象"
+msgstr "无效的 CRL 对象"
 
 #: src/err-codes.h:191
 msgid "Unsupported CRL version"
-msgstr "不支持的CRL 版本"
+msgstr "不支持的 CRL 版本"
 
 #: src/err-codes.h:192
 msgid "Invalid certificate object"
@@ -790,7 +801,7 @@ msgstr "违反协议"
 
 #: src/err-codes.h:197
 msgid "Invalid MAC"
-msgstr "无效的MAC"
+msgstr "无效的 MAC"
 
 #: src/err-codes.h:198
 msgid "Invalid request"
@@ -802,7 +813,7 @@ msgstr "未知的扩展名"
 
 #: src/err-codes.h:200
 msgid "Unknown critical extension"
-msgstr ""
+msgstr "未知的关键扩展"
 
 #: src/err-codes.h:201
 msgid "Locked"
@@ -818,7 +829,7 @@ msgstr "未知命令"
 
 #: src/err-codes.h:204
 msgid "Not operational"
-msgstr ""
+msgstr "不可操作"
 
 #: src/err-codes.h:205
 msgid "No passphrase given"
@@ -826,106 +837,85 @@ msgstr "没有给出密码"
 
 #: src/err-codes.h:206
 msgid "No PIN given"
-msgstr "没有给出PIN"
+msgstr "没有给出 PIN"
 
 #: src/err-codes.h:207
-#, fuzzy
 msgid "Not enabled"
-msgstr "未锁定"
+msgstr "不可用"
 
 #: src/err-codes.h:208
-#, fuzzy
 msgid "No crypto engine"
 msgstr "无效的加密引擎"
 
 #: src/err-codes.h:209
-#, fuzzy
 msgid "Missing key"
-msgstr "缺失值"
+msgstr "密钥缺失"
 
 #: src/err-codes.h:210
-#, fuzzy
 msgid "Too many objects"
-msgstr "没有CMS 对象"
+msgstr "对象过多"
 
 #: src/err-codes.h:211
 msgid "Limit reached"
-msgstr ""
+msgstr "已达极限"
 
 #: src/err-codes.h:212
-#, fuzzy
 msgid "Not initialized"
-msgstr "未初始化"
+msgstr "未初始化"
 
 #: src/err-codes.h:213
-#, fuzzy
 msgid "Missing issuer certificate"
-msgstr "缺失证书"
+msgstr "缺å°\91é¢\81å\8f\91è\80\85证书"
 
 #: src/err-codes.h:214
 msgid "No keyserver available"
-msgstr ""
+msgstr "无可用密钥服务器"
 
 #: src/err-codes.h:215
-#, fuzzy
 msgid "Invalid elliptic curve"
-msgstr "无效的时间"
+msgstr "无效椭圆曲线"
 
 #: src/err-codes.h:216
-#, fuzzy
 msgid "Unknown elliptic curve"
-msgstr "来源不明"
+msgstr "来源不明的椭圆曲线"
 
 #: src/err-codes.h:217
-#, fuzzy
-#| msgid "Duplicated value"
 msgid "Duplicated key"
-msgstr "重复"
+msgstr "重复的密钥"
 
 #: src/err-codes.h:218
 msgid "Ambiguous result"
-msgstr ""
+msgstr "结果不明确"
 
 #: src/err-codes.h:219
-#, fuzzy
 msgid "No crypto context"
-msgstr "无效的加密引擎"
+msgstr "无加密上下文"
 
 #: src/err-codes.h:220
-#, fuzzy
 msgid "Wrong crypto context"
-msgstr "无效的加密引擎"
+msgstr "错误的加密上下文"
 
 #: src/err-codes.h:221
-#, fuzzy
-#| msgid "Invalid crypto engine"
 msgid "Bad crypto context"
-msgstr "无效的加密引擎"
+msgstr "错误的的加密上下文"
 
 #: src/err-codes.h:222
 msgid "Conflict in the crypto context"
-msgstr ""
+msgstr "冲突的加密上下文"
 
 #: src/err-codes.h:223
-#, fuzzy
-#| msgid "No public key"
 msgid "Broken public key"
-msgstr "没æ\9c\89公钥"
+msgstr "æ\8d\9få\9d\8fç\9a\84公钥"
 
 #: src/err-codes.h:224
-#, fuzzy
-#| msgid "No secret key"
 msgid "Broken secret key"
-msgstr "没æ\9c\89ç§\98å\8c\99"
+msgstr "æ\8d\9få\9d\8fç\9a\84ç§\81é\92¥"
 
 #: src/err-codes.h:225
-#, fuzzy
-#| msgid "Invalid digest algorithm"
 msgid "Invalid MAC algorithm"
-msgstr "无效的摘要算法"
+msgstr "无效的 MAC 算法"
 
 #: src/err-codes.h:226
-#, fuzzy
 msgid "Operation fully cancelled"
 msgstr "操作已取消"
 
@@ -939,302 +929,267 @@ msgstr "缓冲区太短"
 
 #: src/err-codes.h:229
 msgid "Invalid length specifier in S-expression"
-msgstr ""
+msgstr "S-表达式的长度标志符无效"
 
 #: src/err-codes.h:230
 msgid "String too long in S-expression"
-msgstr ""
+msgstr "S-表达式的字符串太长"
 
 #: src/err-codes.h:231
 msgid "Unmatched parentheses in S-expression"
-msgstr ""
+msgstr "S-表达式中括号不匹配"
 
 #: src/err-codes.h:232
 msgid "S-expression not canonical"
-msgstr ""
+msgstr "不规范的 S-表达式"
 
 #: src/err-codes.h:233
 msgid "Bad character in S-expression"
-msgstr ""
+msgstr "S-表达式中字符错误"
 
 #: src/err-codes.h:234
 msgid "Bad quotation in S-expression"
-msgstr ""
+msgstr "S-表达式中引号错误"
 
 #: src/err-codes.h:235
 msgid "Zero prefix in S-expression"
-msgstr ""
+msgstr "S-表达式零前缀"
 
 #: src/err-codes.h:236
 msgid "Nested display hints in S-expression"
-msgstr ""
+msgstr "S-表达式嵌套显示提示"
 
 #: src/err-codes.h:237
 msgid "Unmatched display hints"
-msgstr ""
+msgstr "不匹配的嵌套显示提示"
 
 #: src/err-codes.h:238
 msgid "Unexpected reserved punctuation in S-expression"
-msgstr ""
+msgstr "S-表达式中出现意外的保留标点"
 
 #: src/err-codes.h:239
 msgid "Bad hexadecimal character in S-expression"
-msgstr ""
+msgstr "S-表达式中十六进制字符错误"
 
 #: src/err-codes.h:240
 msgid "Odd hexadecimal numbers in S-expression"
-msgstr ""
+msgstr "S-表达式中十六进制数异常"
 
 #: src/err-codes.h:241
 msgid "Bad octal character in S-expression"
-msgstr ""
+msgstr "S-表达式中八进制字符错误"
 
 #: src/err-codes.h:242
 msgid "All subkeys are expired or revoked"
-msgstr ""
+msgstr "所有子密钥均已过期或吊销"
 
 #: src/err-codes.h:243
-#, fuzzy
-#| msgid "Data not encrypted"
 msgid "Database is corrupted"
-msgstr "数据未加密"
+msgstr "数据库已损坏"
 
 #: src/err-codes.h:244
 msgid "Server indicated a failure"
-msgstr ""
+msgstr "服务器故障"
 
 #: src/err-codes.h:245
-#, fuzzy
-#| msgid "Unknown name"
 msgid "No name"
-msgstr "æ\9cªç\9f¥名称"
+msgstr "æ\97 名称"
 
 #: src/err-codes.h:246
-#, fuzzy
-#| msgid "No public key"
 msgid "No key"
-msgstr "没æ\9c\89å\85¬钥"
+msgstr "没æ\9c\89å¯\86钥"
 
 #: src/err-codes.h:247
 msgid "Legacy key"
-msgstr ""
+msgstr "遗留密钥"
 
 #: src/err-codes.h:248
-#, fuzzy
-#| msgid "Buffer too short"
 msgid "Request too short"
-msgstr "缓冲区太短"
+msgstr "请求过短"
 
 #: src/err-codes.h:249
-#, fuzzy
-#| msgid "Line too long"
 msgid "Request too long"
-msgstr "线太长"
+msgstr "请求过长"
 
 #: src/err-codes.h:250
 msgid "Object is in termination state"
-msgstr ""
+msgstr "对象处于终止状态"
 
 #: src/err-codes.h:251
-#, fuzzy
-#| msgid "Bad certificate chain"
 msgid "No certificate chain"
-msgstr "æ\8d\9få\9d\8fç\9a\84证书链"
+msgstr "æ\97 证书链"
 
 #: src/err-codes.h:252
-#, fuzzy
-#| msgid "Certificate too young"
 msgid "Certificate is too large"
-msgstr "证书太新"
+msgstr "证书过大"
 
 #: src/err-codes.h:253
-#, fuzzy
-#| msgid "Invalid card"
 msgid "Invalid record"
-msgstr "无效的卡"
+msgstr "无效记录"
 
 #: src/err-codes.h:254
 msgid "The MAC does not verify"
-msgstr ""
+msgstr "MAC 未经验证"
 
 #: src/err-codes.h:255
-#, fuzzy
-#| msgid "Unexpected error"
 msgid "Unexpected message"
-msgstr "意外é\94\99误"
+msgstr "意外æ¶\88æ\81¯"
 
 #: src/err-codes.h:256
 msgid "Compression or decompression failed"
-msgstr ""
+msgstr "压缩或解压失败"
 
 #: src/err-codes.h:257
 msgid "A counter would wrap"
-msgstr ""
+msgstr "计数器将更新"
 
 #: src/err-codes.h:258
 msgid "Fatal alert message received"
-msgstr ""
+msgstr "收到致命错误消息"
 
 #: src/err-codes.h:259
-#, fuzzy
-#| msgid "Invalid cipher algorithm"
 msgid "No cipher algorithm"
-msgstr "无效的密码算法"
+msgstr "无密码算法"
 
 #: src/err-codes.h:260
-#, fuzzy
 msgid "Missing client certificate"
-msgstr "缺失证书"
+msgstr "缺å°\91客æ\88·ç«¯证书"
 
 #: src/err-codes.h:261
-#, fuzzy
-#| msgid "Certificate revoked"
 msgid "Close notification received"
-msgstr "证书已吊销"
+msgstr "收到关闭通知"
 
 #: src/err-codes.h:262
-#, fuzzy
-#| msgid "Key expired"
 msgid "Ticket expired"
-msgstr "å¯\86é\92¥已过期"
+msgstr "å\87­è¯\81已过期"
 
 #: src/err-codes.h:263
-#, fuzzy
-#| msgid "Bad public key"
 msgid "Bad ticket"
-msgstr "æ\8d\9få\9d\8fç\9a\84å\85¬é\92¥"
+msgstr "æ\8d\9få\9d\8fç\9a\84å\87­è¯\81"
 
 #: src/err-codes.h:264
-#, fuzzy
-#| msgid "Unknown packet"
 msgid "Unknown identity"
-msgstr "未知的包"
+msgstr "未知身份"
 
 #: src/err-codes.h:265
-#, fuzzy
-#| msgid "Bad certificate chain"
 msgid "Bad certificate message in handshake"
-msgstr "æ\8d\9få\9d\8fç\9a\84è¯\81书é\93¾"
+msgstr "æ\8f¡æ\89\8bè¯\81书æ¶\88æ\81¯é\94\99误"
 
 #: src/err-codes.h:266
 msgid "Bad certificate request message in handshake"
-msgstr ""
+msgstr "握手证书请求消息错误"
 
 #: src/err-codes.h:267
 msgid "Bad certificate verify message in handshake"
-msgstr ""
+msgstr "握手证书验证消息错误"
 
 #: src/err-codes.h:268
 msgid "Bad change cipher message in handshake"
-msgstr ""
+msgstr "握手更改密码消息错误"
 
 #: src/err-codes.h:269
 msgid "Bad client hello message in handshake"
-msgstr ""
+msgstr "握手客户端问候消息错误"
 
 #: src/err-codes.h:270
 msgid "Bad server hello message in handshake"
-msgstr ""
+msgstr "握手服务端问候消息错误"
 
 #: src/err-codes.h:271
 msgid "Bad server hello done message in handshake"
-msgstr ""
+msgstr "握手服务端问候完成消息错误"
 
 #: src/err-codes.h:272
 msgid "Bad finished message in handshake"
-msgstr ""
+msgstr "握手完成消息错误"
 
 #: src/err-codes.h:273
 msgid "Bad server key exchange message in handshake"
-msgstr ""
+msgstr "握手服务端密钥交换消息错误"
 
 #: src/err-codes.h:274
 msgid "Bad client key exchange message in handshake"
-msgstr ""
+msgstr "握手客户端密钥交换消息错误"
 
 #: src/err-codes.h:275
 msgid "Bogus string"
-msgstr ""
+msgstr "伪造的字符串"
 
 #: src/err-codes.h:276
 msgid "Forbidden"
-msgstr ""
+msgstr "禁止"
 
 #: src/err-codes.h:277
-#, fuzzy
-#| msgid "Key expired"
 msgid "Key disabled"
-msgstr "密钥已过期"
+msgstr "密钥不可用"
 
 #: src/err-codes.h:278
 msgid "Not possible with a card based key"
-msgstr ""
+msgstr "无法使用基于卡的密钥"
 
 #: src/err-codes.h:279
-#, fuzzy
-#| msgid "Invalid object"
 msgid "Invalid lock object"
-msgstr "无效的对象"
+msgstr "锁定对象无效"
 
 #: src/err-codes.h:280
 msgid "True"
-msgstr ""
+msgstr "正确"
 
 #: src/err-codes.h:281
 msgid "False"
-msgstr ""
+msgstr "错误"
 
 #: src/err-codes.h:282
 msgid "General IPC error"
-msgstr "一般IPC 错误"
+msgstr "常规 IPC 错误"
 
 #: src/err-codes.h:283
 msgid "IPC accept call failed"
-msgstr ""
+msgstr "IPC 接受调用失败"
 
 #: src/err-codes.h:284
 msgid "IPC connect call failed"
-msgstr ""
+msgstr "IPC 连接调用失败"
 
 #: src/err-codes.h:285
 msgid "Invalid IPC response"
-msgstr ""
+msgstr "无效 IPC 响应"
 
 #: src/err-codes.h:286
 msgid "Invalid value passed to IPC"
-msgstr ""
+msgstr "传递给 IPC 的值无效"
 
 #: src/err-codes.h:287
 msgid "Incomplete line passed to IPC"
-msgstr ""
+msgstr "传递给 IPC 的行不完整"
 
 #: src/err-codes.h:288
 msgid "Line passed to IPC too long"
-msgstr ""
+msgstr "传递给 IPC 的行过长"
 
 #: src/err-codes.h:289
 msgid "Nested IPC commands"
-msgstr ""
+msgstr "嵌套的 IPC 命令"
 
 #: src/err-codes.h:290
 msgid "No data callback in IPC"
-msgstr ""
+msgstr "IPC 无数据回调"
 
 #: src/err-codes.h:291
 msgid "No inquire callback in IPC"
-msgstr ""
+msgstr "IPC 无查询回调"
 
 #: src/err-codes.h:292
 msgid "Not an IPC server"
-msgstr "不是IPC 服务器"
+msgstr "不是 IPC 服务器"
 
 #: src/err-codes.h:293
 msgid "Not an IPC client"
-msgstr "不是IPC 客户端"
+msgstr "不是 IPC 客户端"
 
 #: src/err-codes.h:294
 msgid "Problem starting IPC server"
-msgstr ""
+msgstr "启动 IPC 服务器时出现问题"
 
 #: src/err-codes.h:295
 msgid "IPC read error"
@@ -1242,19 +1197,19 @@ msgstr "IPC 读取错误"
 
 #: src/err-codes.h:296
 msgid "IPC write error"
-msgstr "IPC写入 错误"
+msgstr "IPC 写入错误"
 
 #: src/err-codes.h:297
 msgid "Too much data for IPC layer"
-msgstr ""
+msgstr "IPC 层数据过多"
 
 #: src/err-codes.h:298
 msgid "Unexpected IPC command"
-msgstr ""
+msgstr "意外的 IPC 命令"
 
 #: src/err-codes.h:299
 msgid "Unknown IPC command"
-msgstr "未知IPC 命令"
+msgstr "未知 IPC 命令"
 
 #: src/err-codes.h:300
 msgid "IPC syntax error"
@@ -1262,15 +1217,15 @@ msgstr "IPC 语法错误"
 
 #: src/err-codes.h:301
 msgid "IPC call has been cancelled"
-msgstr ""
+msgstr "IPC 调用已取消"
 
 #: src/err-codes.h:302
 msgid "No input source for IPC"
-msgstr ""
+msgstr "IPC 无输入源"
 
 #: src/err-codes.h:303
 msgid "No output source for IPC"
-msgstr ""
+msgstr "IPC 无输出源"
 
 #: src/err-codes.h:304
 msgid "IPC parameter error"
@@ -1278,662 +1233,764 @@ msgstr "IPC 参数错误"
 
 #: src/err-codes.h:305
 msgid "Unknown IPC inquire"
-msgstr ""
+msgstr "未知 IPC 查询"
 
 #: src/err-codes.h:306
-#, fuzzy
 msgid "Crypto engine too old"
-msgstr "无效的加密引擎"
+msgstr "加密引擎太旧"
 
 #: src/err-codes.h:307
 msgid "Screen or window too small"
-msgstr ""
+msgstr "屏幕或窗口过小"
 
 #: src/err-codes.h:308
 msgid "Screen or window too large"
-msgstr ""
+msgstr "屏幕或窗口过大"
 
 #: src/err-codes.h:309
 msgid "Required environment variable not set"
-msgstr ""
+msgstr "未设置所需的环境变量"
 
 #: src/err-codes.h:310
 msgid "User ID already exists"
-msgstr ""
+msgstr "用户标志已存在"
 
 #: src/err-codes.h:311
 msgid "Name already exists"
-msgstr ""
+msgstr "名称已存在"
 
 #: src/err-codes.h:312
-#, fuzzy
-#| msgid "Duplicated value"
 msgid "Duplicated name"
-msgstr "重复"
+msgstr "重复的名称"
 
 #: src/err-codes.h:313
-#, fuzzy
-#| msgid "Certificate too young"
 msgid "Object is too young"
-msgstr "证书太新"
+msgstr "对象太新"
 
 #: src/err-codes.h:314
-#, fuzzy
-#| msgid "Provided object is too short"
 msgid "Object is too old"
-msgstr "提供对象太短"
+msgstr "对象太旧"
 
 #: src/err-codes.h:315
-#, fuzzy
-#| msgid "Unknown name"
 msgid "Unknown flag"
-msgstr "未知名称"
+msgstr "未知标志"
 
 #: src/err-codes.h:316
-#, fuzzy
-#| msgid "Invalid operation code"
 msgid "Invalid execution order"
-msgstr "æ\97 æ\95\88ç\9a\84æ\93\8dä½\9cç \81"
+msgstr "æ\97 æ\95\88ç\9a\84æ\89§è¡\8c顺åº\8f"
 
 #: src/err-codes.h:317
 msgid "Already fetched"
-msgstr ""
+msgstr "已提取"
 
 #: src/err-codes.h:318
 msgid "Try again later"
-msgstr ""
+msgstr "稍后再试"
 
 #: src/err-codes.h:319
-#, fuzzy
-#| msgid "Unknown name"
 msgid "Wrong name"
-msgstr "未知名称"
+msgstr "错误名称"
 
 #: src/err-codes.h:320
-msgid "System bug detected"
-msgstr ""
+msgid "Not authenticated"
+msgstr "未验证"
 
 #: src/err-codes.h:321
-#, fuzzy
-#| msgid "Unknown system error"
-msgid "Unknown DNS error"
-msgstr "未知的系统错误"
+msgid "Bad authentication"
+msgstr "无效验证"
 
 #: src/err-codes.h:322
-#, fuzzy
-#| msgid "Invalid OID string"
-msgid "Invalid DNS section"
-msgstr "无效的OID 字符串"
+msgid "No Keybox daemon running"
+msgstr "无运行的 Keybox 守护进程"
 
 #: src/err-codes.h:323
-msgid "Invalid textual address form"
-msgstr ""
+msgid "Keybox daemon error"
+msgstr "Keybox 守护进程错误"
 
 #: src/err-codes.h:324
-#, fuzzy
-msgid "Missing DNS query packet"
-msgstr "缺失证书"
+msgid "Service is not running"
+msgstr "服务未运行"
 
 #: src/err-codes.h:325
-msgid "Missing DNS answer packet"
-msgstr ""
+msgid "Service error"
+msgstr "服务错误"
 
 #: src/err-codes.h:326
-msgid "Connection closed in DNS"
-msgstr ""
+msgid "System bug detected"
+msgstr "检测到系统错误"
 
 #: src/err-codes.h:327
-#, fuzzy
-#| msgid "Decryption failed"
-msgid "Verification failed in DNS"
-msgstr "解密失败"
+msgid "Unknown DNS error"
+msgstr "未知的 DNS 错误"
 
 #: src/err-codes.h:328
-#, fuzzy
-#| msgid "Timeout"
-msgid "DNS Timeout"
-msgstr "超时"
+msgid "Invalid DNS section"
+msgstr "无效的 DNS 部分"
 
 #: src/err-codes.h:329
-#, fuzzy
-#| msgid "General IPC error"
-msgid "General LDAP error"
-msgstr "一般IPC 错误"
+msgid "Invalid textual address form"
+msgstr "无效的文本地址形式"
 
 #: src/err-codes.h:330
-#, fuzzy
-#| msgid "General error"
-msgid "General LDAP attribute error"
-msgstr "一般错误"
+msgid "Missing DNS query packet"
+msgstr "缺少 DNS 查询数据包"
 
 #: src/err-codes.h:331
-#, fuzzy
-#| msgid "General error"
-msgid "General LDAP name error"
-msgstr "一般错误"
+msgid "Missing DNS answer packet"
+msgstr "缺少 DNS 答应数据包"
 
 #: src/err-codes.h:332
-#, fuzzy
-#| msgid "General Assuan error"
-msgid "General LDAP security error"
-msgstr "一般Assuan 错误"
+msgid "Connection closed in DNS"
+msgstr "DNS 连接关闭"
 
 #: src/err-codes.h:333
-#, fuzzy
-#| msgid "General error"
-msgid "General LDAP service error"
-msgstr "一般错误"
+msgid "Verification failed in DNS"
+msgstr "DNS 验证失败"
 
 #: src/err-codes.h:334
-#, fuzzy
-#| msgid "General Assuan error"
-msgid "General LDAP update error"
-msgstr "一般Assuan 错误"
+msgid "DNS Timeout"
+msgstr "DNS 超时"
 
 #: src/err-codes.h:335
-msgid "Experimental LDAP error code"
-msgstr ""
+msgid "General LDAP error"
+msgstr "常规 LDAP 错误"
 
 #: src/err-codes.h:336
-#, fuzzy
-#| msgid "IPC write error"
-msgid "Private LDAP error code"
-msgstr "IPC写入 错误"
+msgid "General LDAP attribute error"
+msgstr "常规 LDAP 属性错误"
 
 #: src/err-codes.h:337
-#, fuzzy
-#| msgid "General IPC error"
-msgid "Other general LDAP error"
-msgstr "一般IPC 错误"
+msgid "General LDAP name error"
+msgstr "常规 LDAP 名称错误"
 
 #: src/err-codes.h:338
-#, fuzzy
-#| msgid "Decryption failed"
-msgid "LDAP connecting failed (X)"
-msgstr "解密失败"
+msgid "General LDAP security error"
+msgstr "常规 LDAP 安全错误"
 
 #: src/err-codes.h:339
-#, fuzzy
-#| msgid "General error"
-msgid "LDAP referral limit exceeded"
-msgstr "一般错误"
+msgid "General LDAP service error"
+msgstr "常规 LDAP 服务错误"
 
 #: src/err-codes.h:340
-msgid "LDAP client loop"
-msgstr ""
+msgid "General LDAP update error"
+msgstr "常规 LDAP 升级错误"
 
 #: src/err-codes.h:341
-#, fuzzy
-#| msgid "Card reset required"
-msgid "No LDAP results returned"
-msgstr "要求重置卡"
+msgid "Experimental LDAP error code"
+msgstr "实验性 LDAP 错误代码"
 
 #: src/err-codes.h:342
-#, fuzzy
-#| msgid "Element not found"
-msgid "LDAP control not found"
-msgstr "未找到元素"
+msgid "Private LDAP error code"
+msgstr "专用 LDAP 错误代码"
 
 #: src/err-codes.h:343
-#, fuzzy
-#| msgid "Not supported"
-msgid "Not supported by LDAP"
-msgstr "不支持"
+msgid "Other general LDAP error"
+msgstr "其他常规 LDAP 错误"
 
 #: src/err-codes.h:344
-#, fuzzy
-#| msgid "Unexpected error"
-msgid "LDAP connect error"
-msgstr "意外错误"
+msgid "LDAP connecting failed (X)"
+msgstr "LDAP 连接失败(X)"
 
 #: src/err-codes.h:345
-msgid "Out of memory in LDAP"
-msgstr ""
+msgid "LDAP referral limit exceeded"
+msgstr "超过 LDAP 引用限制"
 
 #: src/err-codes.h:346
-msgid "Bad parameter to an LDAP routine"
-msgstr ""
+msgid "LDAP client loop"
+msgstr "LDAP 客户端循环"
 
 #: src/err-codes.h:347
-#, fuzzy
-#| msgid "Unsupported operation"
-msgid "User cancelled LDAP operation"
-msgstr "不支持的操作"
+msgid "No LDAP results returned"
+msgstr "无 LDAP 结果返回"
 
 #: src/err-codes.h:348
-#, fuzzy
-#| msgid "Bad certificate"
-msgid "Bad LDAP search filter"
-msgstr "损坏的证书"
+msgid "LDAP control not found"
+msgstr "未找到 LDAP 控件"
 
 #: src/err-codes.h:349
-#, fuzzy
-#| msgid "Unknown extension"
-msgid "Unknown LDAP authentication method"
-msgstr "未知的扩展名"
+msgid "Not supported by LDAP"
+msgstr "不受 LDAP 支持"
 
 #: src/err-codes.h:350
-#, fuzzy
-#| msgid "Timeout"
-msgid "Timeout in LDAP"
-msgstr "超时"
+msgid "LDAP connect error"
+msgstr "LDAP 连接错误"
 
 #: src/err-codes.h:351
-#, fuzzy
-#| msgid "agent error"
-msgid "LDAP decoding error"
-msgstr "代理错误"
+msgid "Out of memory in LDAP"
+msgstr "LDAP 内存不足"
 
 #: src/err-codes.h:352
-#, fuzzy
-#| msgid "agent error"
-msgid "LDAP encoding error"
-msgstr "代理错误"
+msgid "Bad parameter to an LDAP routine"
+msgstr "LDAP 事务参数错误"
 
 #: src/err-codes.h:353
-#, fuzzy
-#| msgid "IPC read error"
-msgid "LDAP local error"
-msgstr "IPC 读取错误"
+msgid "User cancelled LDAP operation"
+msgstr "用户取消 LDAP 操作"
 
 #: src/err-codes.h:354
-#, fuzzy
-#| msgid "Not an IPC server"
-msgid "Cannot contact LDAP server"
-msgstr "不是IPC 服务器"
+msgid "Bad LDAP search filter"
+msgstr "错误的 LDAP 搜索过滤器"
 
 #: src/err-codes.h:355
-#, fuzzy
-#| msgid "Success"
-msgid "LDAP success"
-msgstr "成功"
+msgid "Unknown LDAP authentication method"
+msgstr "未知的 LDAP 身份验证方法"
 
 #: src/err-codes.h:356
-#, fuzzy
-#| msgid "Configuration error"
-msgid "LDAP operations error"
-msgstr "配置错误"
+msgid "Timeout in LDAP"
+msgstr "LDAP 超时"
 
 #: src/err-codes.h:357
-#, fuzzy
-#| msgid "Protocol violation"
-msgid "LDAP protocol error"
-msgstr "违反协议"
+msgid "LDAP decoding error"
+msgstr "LDAP 解码错误"
 
 #: src/err-codes.h:358
-msgid "Time limit exceeded in LDAP"
-msgstr ""
+msgid "LDAP encoding error"
+msgstr "LDAP 编码错误"
 
 #: src/err-codes.h:359
-msgid "Size limit exceeded in LDAP"
-msgstr ""
+msgid "LDAP local error"
+msgstr "LDAP 本地错误"
 
 #: src/err-codes.h:360
-msgid "LDAP compare false"
-msgstr ""
+msgid "Cannot contact LDAP server"
+msgstr "无法联络 LDAP 服务器"
 
 #: src/err-codes.h:361
-msgid "LDAP compare true"
-msgstr ""
+msgid "LDAP success"
+msgstr "LDAP 成功"
 
 #: src/err-codes.h:362
-#, fuzzy
-#| msgid "Unknown extension"
-msgid "LDAP authentication method not supported"
-msgstr "未知的扩展名"
+msgid "LDAP operations error"
+msgstr "LDAP 操作错误"
 
 #: src/err-codes.h:363
-msgid "Strong(er) LDAP authentication required"
-msgstr ""
+msgid "LDAP protocol error"
+msgstr "LDAP 协议错误"
 
 #: src/err-codes.h:364
-msgid "Partial LDAP results+referral received"
-msgstr ""
+msgid "Time limit exceeded in LDAP"
+msgstr "超过 LDAP 时间限制"
 
 #: src/err-codes.h:365
-#, fuzzy
-#| msgid "General error"
-msgid "LDAP referral"
-msgstr "一般错误"
+msgid "Size limit exceeded in LDAP"
+msgstr "超过 LDAP 大小限制"
 
 #: src/err-codes.h:366
-msgid "Administrative LDAP limit exceeded"
-msgstr ""
+msgid "LDAP compare false"
+msgstr "LDAP 比较错误"
 
 #: src/err-codes.h:367
-msgid "Critical LDAP extension is unavailable"
-msgstr ""
+msgid "LDAP compare true"
+msgstr "LDAP 比较正确"
 
 #: src/err-codes.h:368
-#, fuzzy
-#| msgid "Card reset required"
-msgid "Confidentiality required by LDAP"
-msgstr "要求重置卡"
+msgid "LDAP authentication method not supported"
+msgstr "不支持的 LDAP 身份验证方法"
 
 #: src/err-codes.h:369
-msgid "LDAP SASL bind in progress"
-msgstr ""
+msgid "Strong(er) LDAP authentication required"
+msgstr "需要增强的 LDAP 身份验证"
 
 #: src/err-codes.h:370
-msgid "No such LDAP attribute"
-msgstr ""
+msgid "Partial LDAP results+referral received"
+msgstr "收到部分 LDAP 结果与引用"
 
 #: src/err-codes.h:371
-#, fuzzy
-#| msgid "Invalid attribute"
-msgid "Undefined LDAP attribute type"
-msgstr "无效的属性"
+msgid "LDAP referral"
+msgstr "LDAP 转送"
 
 #: src/err-codes.h:372
-#, fuzzy
-#| msgid "Unsupported protection"
-msgid "Inappropriate matching in LDAP"
-msgstr "不受支持的保护"
+msgid "Administrative LDAP limit exceeded"
+msgstr "超过管理 LDAP 限制"
 
 #: src/err-codes.h:373
-#, fuzzy
-#| msgid "Protocol violation"
-msgid "Constraint violation in LDAP"
-msgstr "违反协议"
+msgid "Critical LDAP extension is unavailable"
+msgstr "关键 LDAP 扩展不可用"
 
 #: src/err-codes.h:374
-msgid "LDAP type or value exists"
-msgstr ""
+msgid "Confidentiality required by LDAP"
+msgstr "LDAP 要求保密"
 
 #: src/err-codes.h:375
-#, fuzzy
-#| msgid "Invalid state"
-msgid "Invalid syntax in LDAP"
-msgstr "无效的州"
+msgid "LDAP SASL bind in progress"
+msgstr "正在进行 LDAP SASL 绑定"
 
 #: src/err-codes.h:376
-#, fuzzy
-#| msgid "No CMS object"
-msgid "No such LDAP object"
-msgstr "没有CMS 对象"
+msgid "No such LDAP attribute"
+msgstr "没有此 LDAP 属性"
 
 #: src/err-codes.h:377
-#, fuzzy
-#| msgid "Hardware problem"
-msgid "LDAP alias problem"
-msgstr "硬件问题"
+msgid "Undefined LDAP attribute type"
+msgstr "未定义的 LDAP 属性类型"
 
 #: src/err-codes.h:378
-#, fuzzy
-#| msgid "Invalid state"
-msgid "Invalid DN syntax in LDAP"
-msgstr "无效的州"
+msgid "Inappropriate matching in LDAP"
+msgstr "LDAP 不当匹配"
 
 #: src/err-codes.h:379
-msgid "LDAP entry is a leaf"
-msgstr ""
+msgid "Constraint violation in LDAP"
+msgstr "LDAP 约束冲突"
 
 #: src/err-codes.h:380
-#, fuzzy
-#| msgid "Encoding problem"
-msgid "LDAP alias dereferencing problem"
-msgstr "编码问题"
+msgid "LDAP type or value exists"
+msgstr "LDAP 类型或值存在"
 
 #: src/err-codes.h:381
-msgid "LDAP proxy authorization failure (X)"
-msgstr ""
+msgid "Invalid syntax in LDAP"
+msgstr "LDAP 语法无效"
 
 #: src/err-codes.h:382
-#, fuzzy
-#| msgid "Unsupported protection"
-msgid "Inappropriate LDAP authentication"
-msgstr "不受支持的保护"
+msgid "No such LDAP object"
+msgstr "无此 LDAP 对象"
 
 #: src/err-codes.h:383
-#, fuzzy
-#| msgid "Invalid card"
-msgid "Invalid LDAP credentials"
-msgstr "无效的卡"
+msgid "LDAP alias problem"
+msgstr "LDAP 别名问题"
 
 #: src/err-codes.h:384
-msgid "Insufficient access for LDAP"
-msgstr ""
+msgid "Invalid DN syntax in LDAP"
+msgstr "LDAP 无效的 DN 语法"
 
 #: src/err-codes.h:385
-msgid "LDAP server is busy"
-msgstr ""
+msgid "LDAP entry is a leaf"
+msgstr "LDAP 叶状入口"
 
 #: src/err-codes.h:386
-msgid "LDAP server is unavailable"
-msgstr ""
+msgid "LDAP alias dereferencing problem"
+msgstr "LDAP 别名引用取消问题"
 
 #: src/err-codes.h:387
-msgid "LDAP server is unwilling to perform"
-msgstr ""
+msgid "LDAP proxy authorization failure (X)"
+msgstr "LDAP 代理授权失败(X)"
 
 #: src/err-codes.h:388
-msgid "Loop detected by LDAP"
-msgstr ""
+msgid "Inappropriate LDAP authentication"
+msgstr "不当 LDAP 身份验证"
 
 #: src/err-codes.h:389
-#, fuzzy
-#| msgid "Protocol violation"
-msgid "LDAP naming violation"
-msgstr "违反协议"
+msgid "Invalid LDAP credentials"
+msgstr "无效 LDAP 凭据"
 
 #: src/err-codes.h:390
-#, fuzzy
-#| msgid "Protocol violation"
-msgid "LDAP object class violation"
-msgstr "违反协议"
+msgid "Insufficient access for LDAP"
+msgstr "无 LDAP 访问权限"
 
 #: src/err-codes.h:391
-#, fuzzy
-#| msgid "Operation not yet finished"
-msgid "LDAP operation not allowed on non-leaf"
-msgstr "操作尚未完成"
+msgid "LDAP server is busy"
+msgstr "LDAP 服务器忙"
 
 #: src/err-codes.h:392
-#, fuzzy
-#| msgid "Operation cancelled"
-msgid "LDAP operation not allowed on RDN"
-msgstr "操作已取消"
+msgid "LDAP server is unavailable"
+msgstr "LDAP 服务器不可用"
 
 #: src/err-codes.h:393
-msgid "Already exists (LDAP)"
-msgstr ""
+msgid "LDAP server is unwilling to perform"
+msgstr "LDAP 服务器拒绝执行"
 
 #: src/err-codes.h:394
-msgid "Cannot modify LDAP object class"
-msgstr ""
+msgid "Loop detected by LDAP"
+msgstr "LDAP 检测到循环"
 
 #: src/err-codes.h:395
-#, fuzzy
-#| msgid "Line too long"
-msgid "LDAP results too large"
-msgstr "线太长"
+msgid "LDAP naming violation"
+msgstr "LDAP 命名冲突"
 
 #: src/err-codes.h:396
-#, fuzzy
-#| msgid "Operation cancelled"
-msgid "LDAP operation affects multiple DSAs"
-msgstr "操作已取消"
+msgid "LDAP object class violation"
+msgstr "LDAP 对象类冲突"
 
 #: src/err-codes.h:397
-msgid "Virtual LDAP list view error"
-msgstr ""
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "不允许在非叶上执行 LDAP 操作"
 
 #: src/err-codes.h:398
-#, fuzzy
-#| msgid "General IPC error"
-msgid "Other LDAP error"
-msgstr "一般IPC 错误"
+msgid "LDAP operation not allowed on RDN"
+msgstr "RDN 上不允许 LDAP 操作"
 
 #: src/err-codes.h:399
-#, fuzzy
-#| msgid "Resources exhausted"
-msgid "Resources exhausted in LCUP"
-msgstr "内存耗尽"
+msgid "Already exists (LDAP)"
+msgstr "已存在(LDAP)"
 
 #: src/err-codes.h:400
-#, fuzzy
-#| msgid "Protocol violation"
-msgid "Security violation in LCUP"
-msgstr "违反协议"
+msgid "Cannot modify LDAP object class"
+msgstr "无法修改 LDAP 对象类"
 
 #: src/err-codes.h:401
-#, fuzzy
-#| msgid "Invalid state"
-msgid "Invalid data in LCUP"
-msgstr "无效的州"
+msgid "LDAP results too large"
+msgstr "LDAP 结果过大"
 
 #: src/err-codes.h:402
-#, fuzzy
-#| msgid "Unsupported certificate"
-msgid "Unsupported scheme in LCUP"
-msgstr "不支持的凭证"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "LDAP 操作影响多个 DSA"
 
 #: src/err-codes.h:403
-#, fuzzy
-#| msgid "Card reset required"
-msgid "Reload required in LCUP"
-msgstr "要求重置卡"
+msgid "Virtual LDAP list view error"
+msgstr "虚拟 LDAP 列表浏览错误"
 
 #: src/err-codes.h:404
-#, fuzzy
-#| msgid "Success"
-msgid "LDAP cancelled"
-msgstr "成功"
+msgid "Other LDAP error"
+msgstr "其他 LDAP 错误"
 
 #: src/err-codes.h:405
-#, fuzzy
-#| msgid "Operation cancelled"
-msgid "No LDAP operation to cancel"
-msgstr "操作已取消"
+msgid "Resources exhausted in LCUP"
+msgstr "LCUP 内存耗尽"
 
 #: src/err-codes.h:406
-#, fuzzy
-#| msgid "Operation cancelled"
-msgid "Too late to cancel LDAP"
-msgstr "操作已取消"
+msgid "Security violation in LCUP"
+msgstr "LCUP 安全冲突"
 
 #: src/err-codes.h:407
-#, fuzzy
-#| msgid "Not an IPC server"
-msgid "Cannot cancel LDAP"
-msgstr "不是IPC 服务器"
+msgid "Invalid data in LCUP"
+msgstr "LCUP 数据无效"
 
 #: src/err-codes.h:408
-#, fuzzy
-#| msgid "Decryption failed"
-msgid "LDAP assertion failed"
-msgstr "解密失败"
+msgid "Unsupported scheme in LCUP"
+msgstr "LCUP 不支持的方案"
 
 #: src/err-codes.h:409
-msgid "Proxied authorization denied by LDAP"
-msgstr ""
+msgid "Reload required in LCUP"
+msgstr "LCUP 需要重新加载"
 
 #: src/err-codes.h:410
-msgid "User defined error code 1"
-msgstr "用户定义的错误代码1"
+msgid "LDAP cancelled"
+msgstr "LDAP 已取消"
 
 #: src/err-codes.h:411
-msgid "User defined error code 2"
-msgstr "用户定义的错误代码2"
+msgid "No LDAP operation to cancel"
+msgstr "没有要取消的 LDAP 操作"
 
 #: src/err-codes.h:412
-msgid "User defined error code 3"
-msgstr "用户定义的错误代码3"
+msgid "Too late to cancel LDAP"
+msgstr "LDAP 已不能取消"
 
 #: src/err-codes.h:413
-msgid "User defined error code 4"
-msgstr "用户定义的错误代码4"
+msgid "Cannot cancel LDAP"
+msgstr "无法取消 LDAP"
 
 #: src/err-codes.h:414
-msgid "User defined error code 5"
-msgstr "用户定义的错误代码5"
+msgid "LDAP assertion failed"
+msgstr "LDAP 断言失败"
 
 #: src/err-codes.h:415
-msgid "User defined error code 6"
-msgstr "用户定义的错误代码6"
+msgid "Proxied authorization denied by LDAP"
+msgstr "LDAP 拒绝代理授权"
 
 #: src/err-codes.h:416
-msgid "User defined error code 7"
-msgstr "用户定义的错误代码7"
+msgid "User defined error code 1"
+msgstr "用户定义的错误代码 1"
 
 #: src/err-codes.h:417
-msgid "User defined error code 8"
-msgstr "用户定义的错误代码8"
+msgid "User defined error code 2"
+msgstr "用户定义的错误代码 2"
 
 #: src/err-codes.h:418
-msgid "User defined error code 9"
-msgstr "用户定义的错误码9"
+msgid "User defined error code 3"
+msgstr "用户定义的错误代码 3"
 
 #: src/err-codes.h:419
-msgid "User defined error code 10"
-msgstr "用户定义的错误代码10"
+msgid "User defined error code 4"
+msgstr "用户定义的错误代码 4"
 
 #: src/err-codes.h:420
-msgid "User defined error code 11"
-msgstr "用户定义的错误代码11"
+msgid "User defined error code 5"
+msgstr "用户定义的错误代码 5"
 
 #: src/err-codes.h:421
-msgid "User defined error code 12"
-msgstr "用户定义的错误代码12"
+msgid "User defined error code 6"
+msgstr "用户定义的错误代码 6"
 
 #: src/err-codes.h:422
-msgid "User defined error code 13"
-msgstr "用户定义的错误代码13"
+msgid "User defined error code 7"
+msgstr "用户定义的错误代码 7"
 
 #: src/err-codes.h:423
-msgid "User defined error code 14"
-msgstr "用户定义的错误代码14"
+msgid "User defined error code 8"
+msgstr "用户定义的错误代码 8"
 
 #: src/err-codes.h:424
-msgid "User defined error code 15"
-msgstr "用户定义的错误代码15"
+msgid "User defined error code 9"
+msgstr "用户定义的错误代码 9"
 
 #: src/err-codes.h:425
-msgid "User defined error code 16"
-msgstr "用户定义的错误代码16"
+msgid "User defined error code 10"
+msgstr "用户定义的错误代码 10"
 
 #: src/err-codes.h:426
-msgid "System error w/o errno"
-msgstr ""
+msgid "User defined error code 11"
+msgstr "用户定义的错误代码 11"
 
 #: src/err-codes.h:427
+msgid "User defined error code 12"
+msgstr "用户定义的错误代码 12"
+
+#: src/err-codes.h:428
+msgid "User defined error code 13"
+msgstr "用户定义的错误代码 13"
+
+#: src/err-codes.h:429
+msgid "User defined error code 14"
+msgstr "用户定义的错误代码 14"
+
+#: src/err-codes.h:430
+msgid "User defined error code 15"
+msgstr "用户定义的错误代码 15"
+
+#: src/err-codes.h:431
+msgid "User defined error code 16"
+msgstr "用户定义的错误代码 16"
+
+#: src/err-codes.h:432
+msgid "SQL success"
+msgstr "SQL 成功"
+
+#: src/err-codes.h:433
+msgid "SQL error"
+msgstr "SQL 错误"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr "SQL 库存在内部逻辑错误"
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr "SQL 无访问权限"
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr "SQL 请求中止"
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr "SQL 数据库文件已锁定"
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr "数据库中的表被锁定"
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr "SQL 库耗尽核心资源"
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr "尝试写入只读 SQL 数据库"
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr "SQL 操作被中断终止"
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr "SQL 操作I/O错误"
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr "SQL 数据库磁盘映像格式错误"
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr "SQL 文件未知操作码"
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr "插入失败,因为 SQL 数据库已满"
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr "无法打开 SQL 数据库文件"
+
+#: src/err-codes.h:447
+msgid "SQL database lock protocol error"
+msgstr "SQL 数据库锁定协议错误"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr "(内部 SQL 代码:empty 空)"
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr "SQL 数据库架构已更改"
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr "SQL 字符串或blob超出大小限制"
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr "SQL 约束冲突导致中止"
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr "SQL 数据类型不匹配"
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr "SQL 库使用错误"
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr "SQL 库使用了不支持的操作系统功能"
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr "SQL 授权拒绝"
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr "(未使用的SQL代码:format 格式)"
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr "SQL 绑定参数越界"
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr "打开的文件不是 SQL 数据库文件"
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr "来自 SQL 日志记录的通知"
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr "来自 SQL 日志记录的警告"
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr "SQL 已准备好另一行"
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr "SQL 已执行完成"
+
+#: src/err-codes.h:463
+msgid "System error w/o errno"
+msgstr "系统错误,无错误号"
+
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "未知的系统错误"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "文件结尾"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "未知的错误代码"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+msgid "argument not expected"
+msgstr "非期望参数"
+
+#: src/argparse.c:496
+msgid "read error"
+msgstr "读取错误"
+
+#: src/argparse.c:498
+msgid "keyword too long"
+msgstr "关键字太长"
+
+#: src/argparse.c:500
+msgid "missing argument"
+msgstr "缺少参数"
+
+#: src/argparse.c:502
+msgid "invalid argument"
+msgstr "无效参数"
+
+#: src/argparse.c:504
+msgid "invalid command"
+msgstr "无效命令"
+
+#: src/argparse.c:506
+msgid "invalid alias definition"
+msgstr "无效别名定义"
+
+#: src/argparse.c:508 src/argparse.c:545
+msgid "permission error"
+msgstr "权限错误"
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr "核心外"
+
+#: src/argparse.c:514 src/argparse.c:549
+msgid "invalid meta command"
+msgstr "无效元命令"
+
+#: src/argparse.c:516 src/argparse.c:551
+msgid "unknown meta command"
+msgstr "未知元命令"
+
+#: src/argparse.c:518 src/argparse.c:553
+msgid "unexpected meta command"
+msgstr "意外元命令"
+
+#: src/argparse.c:520
+msgid "invalid option"
+msgstr "无效的列表选项"
+
+#: src/argparse.c:530
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr ""
+msgid "missing argument for option \"%.50s\"\n"
+msgstr "选项\"%.50s\"缺少参数\n"
+
+#: src/argparse.c:532
+#, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "选项\"%.50s\"参数无效\n"
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr "选项\"%.50s\"参数多余\n"
+
+#: src/argparse.c:537
+#, c-format
+msgid "invalid command \"%.50s\"\n"
+msgstr "无效指令 \"%.50s\"\n"
+
+#: src/argparse.c:539
+#, c-format
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr "选项 \"%.50s\" 不明确\n"
+
+#: src/argparse.c:541
+#, c-format
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr "命令 \"%.50s\" 不明确\n"
+
+#: src/argparse.c:555
+#, c-format
+msgid "invalid option \"%.50s\"\n"
+msgstr "无效的选项 \"%.50s\"\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr "注意:文件 '%s' 中无默认选项\n"
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr "从 '%s' 中读取选项\n"
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr "选项文件 '%s': %s\n"
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr "注意: 由于整体配置,选项 \"--%s\" 被忽视\n"
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr "请向 <https://bugs.gnupg.org> 报告软件错误。\n"
 
-#: src/gpg-error.c:633
+#: src/gpg-error.c:762
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s:警告:无法识别 %s\n"
-
-#, fuzzy
-#~| msgid "Resources exhausted"
-#~ msgid "LCUP Resources exhausted"
-#~ msgstr "内存耗尽"
-
-#, fuzzy
-#~| msgid "Invalid data"
-#~ msgid "LCUP Invalid data"
-#~ msgstr "无效的数据"
-
-#, fuzzy
-#~| msgid "General error"
-#~ msgid "LDAP Other general error"
-#~ msgstr "一般错误"
-
-#, fuzzy
-#~| msgid "Encoding problem"
-#~ msgid "Encoding error"
-#~ msgstr "编码问题"
+msgid "warning: could not recognize %s\n"
+msgstr "警告:无法识别 %s\n"
index 4d664b4..cf73d80 100644 (file)
Binary files a/po/zh_TW.gmo and b/po/zh_TW.gmo differ
index cb57a95..8c2075b 100644 (file)
@@ -1,24 +1,26 @@
 # zh_TW.po - Chinese traditional translations for libgpg-error
 # Copyright (C) 2014 Jedi Lin
 # This file is distributed under the same license as the libngpg-error package.
-# Jedi Lin <Jedi@Jedi.org>, 2014
+# Chinese (traditional) <zh-l10n@linux.org.tw>, 2014.
+# Jedi Lin <Jedi@Jedi.org>, 2014.
 #
+# bobwxc <bobwxc@yeah.net>, 2020.
 msgid ""
 msgstr ""
-"Project-Id-Version: libgpg-error 1.17\n"
+"Project-Id-Version: libgpg-error 1.39\n"
 "Report-Msgid-Bugs-To: translations@gnupg.org\n"
-"POT-Creation-Date: 2017-02-28 15:06+0100\n"
-"PO-Revision-Date: 2014-11-17 21:25+0800\n"
-"Last-Translator: Jedi Lin <Jedi@Jedi.org>\n"
-"Language-Team: Chinese (traditional) <zh-l10n@linux.org.tw>\n"
+"POT-Creation-Date: 2021-11-03 15:01+0100\n"
+"PO-Revision-Date: 2021-03-22 10:45+0100\n"
+"Last-Translator: bobwxc <bobwxc@yeah.net>\n"
+"Language-Team: None\n"
 "Language: zh_TW\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 1.5.7\n"
+"X-Generator: Poedit 2.2.1\n"
 "Plural-Forms: nplurals=1; plural=0;\n"
 "X-Poedit-SourceCharset: UTF-8\n"
-"X-Poedit-Basepath: libgpg-error-1.17\n"
+"X-Poedit-Basepath: libgpg-error-1.39\n"
 
 #: src/err-sources.h:28
 msgid "Unspecified source"
@@ -85,30 +87,34 @@ msgid "Assuan"
 msgstr "Assuan"
 
 #: src/err-sources.h:44
+msgid "TPM2d"
+msgstr "TPM2d"
+
+#: src/err-sources.h:45
 msgid "TLS"
 msgstr "TLS"
 
-#: src/err-sources.h:45
+#: src/err-sources.h:46
 msgid "Any source"
 msgstr "任何來源"
 
-#: src/err-sources.h:46
+#: src/err-sources.h:47
 msgid "User defined source 1"
 msgstr "使用者定義來源 1"
 
-#: src/err-sources.h:47
+#: src/err-sources.h:48
 msgid "User defined source 2"
 msgstr "使用者定義來源 2"
 
-#: src/err-sources.h:48
+#: src/err-sources.h:49
 msgid "User defined source 3"
 msgstr "使用者定義來源 3"
 
-#: src/err-sources.h:49
+#: src/err-sources.h:50
 msgid "User defined source 4"
 msgstr "使用者定義來源 4"
 
-#: src/err-sources.h:50
+#: src/err-sources.h:51
 msgid "Unknown source"
 msgstr "未知的來源"
 
@@ -282,7 +288,7 @@ msgstr "錯誤的公鑰演算法"
 
 #: src/err-codes.h:70
 msgid "Tribute to D. A."
-msgstr "向 D. A. 致意"
+msgstr "向 Douglas Adams 致意"
 
 #: src/err-codes.h:71
 msgid "Weak encryption key"
@@ -370,7 +376,7 @@ msgstr "內部錯誤"
 
 #: src/err-codes.h:92
 msgid "EOF (gcrypt)"
-msgstr "EOF (gcrypt)"
+msgstr "EOF 文件結尾 (gcrypt)"
 
 #: src/err-codes.h:93
 msgid "Invalid object"
@@ -970,49 +976,39 @@ msgstr "S-表示式中有不良的八進制字符"
 
 #: src/err-codes.h:242
 msgid "All subkeys are expired or revoked"
-msgstr ""
+msgstr "所有子金鑰都已過期或吊銷"
 
 #: src/err-codes.h:243
-#, fuzzy
-#| msgid "Data not encrypted"
 msgid "Database is corrupted"
-msgstr "資料未經加密"
+msgstr "資料庫已損壞"
 
 #: src/err-codes.h:244
 msgid "Server indicated a failure"
-msgstr ""
+msgstr "伺服器故障"
 
 #: src/err-codes.h:245
-#, fuzzy
-#| msgid "Unknown name"
 msgid "No name"
-msgstr "無效的名稱"
+msgstr "無名稱"
 
 #: src/err-codes.h:246
-#, fuzzy
-#| msgid "No public key"
 msgid "No key"
-msgstr "沒有鑰"
+msgstr "沒有鑰"
 
 #: src/err-codes.h:247
 msgid "Legacy key"
-msgstr ""
+msgstr "遺留的金鑰"
 
 #: src/err-codes.h:248
-#, fuzzy
-#| msgid "Buffer too short"
 msgid "Request too short"
-msgstr "緩衝區太短"
+msgstr "請求過短"
 
 #: src/err-codes.h:249
-#, fuzzy
-#| msgid "Line too long"
 msgid "Request too long"
-msgstr "列太長"
+msgstr "請求過長"
 
 #: src/err-codes.h:250
 msgid "Object is in termination state"
-msgstr ""
+msgstr "對象處於終止狀態"
 
 #: src/err-codes.h:251
 msgid "No certificate chain"
@@ -1116,7 +1112,7 @@ msgstr "假造的字串"
 
 #: src/err-codes.h:276
 msgid "Forbidden"
-msgstr ""
+msgstr "禁止"
 
 #: src/err-codes.h:277
 msgid "Key disabled"
@@ -1132,11 +1128,11 @@ msgstr "無效的鎖定物件"
 
 #: src/err-codes.h:280
 msgid "True"
-msgstr ""
+msgstr "正確"
 
 #: src/err-codes.h:281
 msgid "False"
-msgstr ""
+msgstr "錯誤"
 
 #: src/err-codes.h:282
 msgid "General IPC error"
@@ -1235,667 +1231,767 @@ msgid "Unknown IPC inquire"
 msgstr "未知的 IPC 查詢"
 
 #: src/err-codes.h:306
-#, fuzzy
-#| msgid "No crypto engine"
 msgid "Crypto engine too old"
-msgstr "沒有密碼法引擎"
+msgstr "加密引擎太舊"
 
 #: src/err-codes.h:307
 msgid "Screen or window too small"
-msgstr ""
+msgstr "螢幕或窗口過小"
 
 #: src/err-codes.h:308
 msgid "Screen or window too large"
-msgstr ""
+msgstr "螢幕或窗口過大"
 
 #: src/err-codes.h:309
 msgid "Required environment variable not set"
-msgstr ""
+msgstr "需要的環境變數未設定"
 
 #: src/err-codes.h:310
 msgid "User ID already exists"
-msgstr ""
+msgstr "用戶 ID 已存在"
 
 #: src/err-codes.h:311
 msgid "Name already exists"
-msgstr ""
+msgstr "名字已存在"
 
 #: src/err-codes.h:312
-#, fuzzy
-#| msgid "Duplicated value"
 msgid "Duplicated name"
-msgstr "é\87\8dè¤\87ç\9a\84å\80¼"
+msgstr "é\87\8dè¤\87ç\9a\84å\90\8d稱"
 
 #: src/err-codes.h:313
-#, fuzzy
-#| msgid "Certificate too young"
 msgid "Object is too young"
-msgstr "憑證太年輕"
+msgstr "對象太新"
 
 #: src/err-codes.h:314
-#, fuzzy
-#| msgid "Provided object is too short"
 msgid "Object is too old"
-msgstr "提供的物件太短"
+msgstr "對象太舊"
 
 #: src/err-codes.h:315
-#, fuzzy
-#| msgid "Unknown name"
 msgid "Unknown flag"
-msgstr "無效的名稱"
+msgstr "未知標誌"
 
 #: src/err-codes.h:316
-#, fuzzy
-#| msgid "Invalid operation code"
 msgid "Invalid execution order"
-msgstr "無效的操作碼"
+msgstr "無效的執行順序"
 
 #: src/err-codes.h:317
 msgid "Already fetched"
-msgstr ""
+msgstr "已經獲得"
 
 #: src/err-codes.h:318
 msgid "Try again later"
-msgstr ""
+msgstr "稍後再試"
 
 #: src/err-codes.h:319
-#, fuzzy
-#| msgid "Unknown name"
 msgid "Wrong name"
-msgstr "無效的名稱"
+msgstr "錯誤名稱"
 
 #: src/err-codes.h:320
-msgid "System bug detected"
-msgstr ""
+msgid "Not authenticated"
+msgstr "未驗證"
 
 #: src/err-codes.h:321
-#, fuzzy
-#| msgid "Unknown system error"
-msgid "Unknown DNS error"
-msgstr "未知的系統錯誤"
+msgid "Bad authentication"
+msgstr "無效驗證"
 
 #: src/err-codes.h:322
-#, fuzzy
-#| msgid "Invalid OID string"
-msgid "Invalid DNS section"
-msgstr "無效的 OID 字串"
+msgid "No Keybox daemon running"
+msgstr "無運行的 Keybox 守護進程"
 
 #: src/err-codes.h:323
-#, fuzzy
-#| msgid "Invalid S-expression"
-msgid "Invalid textual address form"
-msgstr "無效的 S-表示式"
+msgid "Keybox daemon error"
+msgstr "Keybox 守護進程錯誤"
 
 #: src/err-codes.h:324
-#, fuzzy
-#| msgid "Missing issuer certificate"
-msgid "Missing DNS query packet"
-msgstr "遺失發行者憑證"
+msgid "Service is not running"
+msgstr "服務未運行"
 
 #: src/err-codes.h:325
-msgid "Missing DNS answer packet"
-msgstr ""
+msgid "Service error"
+msgstr "服務錯誤"
 
 #: src/err-codes.h:326
-msgid "Connection closed in DNS"
-msgstr ""
+msgid "System bug detected"
+msgstr "系統錯誤"
 
 #: src/err-codes.h:327
-#, fuzzy
-#| msgid "Decryption failed"
-msgid "Verification failed in DNS"
-msgstr "解密失敗"
+msgid "Unknown DNS error"
+msgstr "未知的 DNS 錯誤"
 
 #: src/err-codes.h:328
-#, fuzzy
-#| msgid "Timeout"
-msgid "DNS Timeout"
-msgstr "逾時"
+msgid "Invalid DNS section"
+msgstr "無效的 DNS 部分"
 
 #: src/err-codes.h:329
-#, fuzzy
-#| msgid "General IPC error"
-msgid "General LDAP error"
-msgstr "一般性的 IPC 錯誤"
+msgid "Invalid textual address form"
+msgstr "無效的文本地址形式"
 
 #: src/err-codes.h:330
-#, fuzzy
-#| msgid "General error"
-msgid "General LDAP attribute error"
-msgstr "一般錯誤"
+msgid "Missing DNS query packet"
+msgstr "缺少 DNS 查詢封包"
 
 #: src/err-codes.h:331
-#, fuzzy
-#| msgid "General error"
-msgid "General LDAP name error"
-msgstr "一般錯誤"
+msgid "Missing DNS answer packet"
+msgstr "無 DNS 迴應封包"
 
 #: src/err-codes.h:332
-#, fuzzy
-#| msgid "General Assuan error"
-msgid "General LDAP security error"
-msgstr "一般性的 Assuan 錯誤"
+msgid "Connection closed in DNS"
+msgstr "DNS 連接關閉"
 
 #: src/err-codes.h:333
-#, fuzzy
-#| msgid "General error"
-msgid "General LDAP service error"
-msgstr "一般錯誤"
+msgid "Verification failed in DNS"
+msgstr "DNS 驗證失敗"
 
 #: src/err-codes.h:334
-#, fuzzy
-#| msgid "General Assuan error"
-msgid "General LDAP update error"
-msgstr "一般性的 Assuan 錯誤"
+msgid "DNS Timeout"
+msgstr "DNS 逾時"
 
 #: src/err-codes.h:335
-msgid "Experimental LDAP error code"
-msgstr ""
+msgid "General LDAP error"
+msgstr "一般 LDAP 錯誤"
 
 #: src/err-codes.h:336
-#, fuzzy
-#| msgid "IPC write error"
-msgid "Private LDAP error code"
-msgstr "IPC 寫入錯誤"
+msgid "General LDAP attribute error"
+msgstr "一般 LDAP 屬性錯誤"
 
 #: src/err-codes.h:337
-#, fuzzy
-#| msgid "General IPC error"
-msgid "Other general LDAP error"
-msgstr "一般性的 IPC 錯誤"
+msgid "General LDAP name error"
+msgstr "一般 LDAP 名稱錯誤"
 
 #: src/err-codes.h:338
-#, fuzzy
-#| msgid "IPC connect call failed"
-msgid "LDAP connecting failed (X)"
-msgstr "IPC 連線叫用失敗"
+msgid "General LDAP security error"
+msgstr "一般 LDAP 安全錯誤"
 
 #: src/err-codes.h:339
-#, fuzzy
-#| msgid "General error"
-msgid "LDAP referral limit exceeded"
-msgstr "一般錯誤"
+msgid "General LDAP service error"
+msgstr "一般 LDAP 服務錯誤"
 
 #: src/err-codes.h:340
-msgid "LDAP client loop"
-msgstr ""
+msgid "General LDAP update error"
+msgstr "一般 LDAP 升級錯誤"
 
 #: src/err-codes.h:341
-#, fuzzy
-#| msgid "Card reset required"
-msgid "No LDAP results returned"
-msgstr "卡片需要重設"
+msgid "Experimental LDAP error code"
+msgstr "試驗性 LDAP 錯誤代碼"
 
 #: src/err-codes.h:342
-#, fuzzy
-#| msgid "Element not found"
-msgid "LDAP control not found"
-msgstr "找不到元素"
+msgid "Private LDAP error code"
+msgstr "專用 LDAP 錯誤代碼"
 
 #: src/err-codes.h:343
-#, fuzzy
-#| msgid "Not supported"
-msgid "Not supported by LDAP"
-msgstr "未支援"
+msgid "Other general LDAP error"
+msgstr "其他一般 LDAP 錯誤"
 
 #: src/err-codes.h:344
-#, fuzzy
-#| msgid "Unexpected error"
-msgid "LDAP connect error"
-msgstr "未預期的錯誤"
+msgid "LDAP connecting failed (X)"
+msgstr "LDAP 連接失敗(X)"
 
 #: src/err-codes.h:345
-msgid "Out of memory in LDAP"
-msgstr ""
+msgid "LDAP referral limit exceeded"
+msgstr "超過 LDAP 引用限制"
 
 #: src/err-codes.h:346
-msgid "Bad parameter to an LDAP routine"
-msgstr ""
+msgid "LDAP client loop"
+msgstr "LDAP 客戶端循環"
 
 #: src/err-codes.h:347
-#, fuzzy
-#| msgid "Unsupported operation"
-msgid "User cancelled LDAP operation"
-msgstr "未支援的操作"
+msgid "No LDAP results returned"
+msgstr "無 LDAP 結果返回"
 
 #: src/err-codes.h:348
-#, fuzzy
-#| msgid "Bad certificate"
+msgid "LDAP control not found"
+msgstr "未找到 LDAP 元件"
+
+#: src/err-codes.h:349
+msgid "Not supported by LDAP"
+msgstr "不受 LDAP 支援"
+
+#: src/err-codes.h:350
+msgid "LDAP connect error"
+msgstr "LDAP 連接錯誤"
+
+#: src/err-codes.h:351
+msgid "Out of memory in LDAP"
+msgstr "LDAP 記憶體耗盡"
+
+#: src/err-codes.h:352
+msgid "Bad parameter to an LDAP routine"
+msgstr "LDAP 事務參數錯誤"
+
+#: src/err-codes.h:353
+msgid "User cancelled LDAP operation"
+msgstr "用戶取消 LDAP 操作"
+
+#: src/err-codes.h:354
 msgid "Bad LDAP search filter"
 msgstr "不良的憑證"
 
-#: src/err-codes.h:349
-#, fuzzy
-#| msgid "Unknown extension"
+#: src/err-codes.h:355
 msgid "Unknown LDAP authentication method"
-msgstr "未知的擴充"
+msgstr "未知的 LDAP 身份驗證方法"
 
-#: src/err-codes.h:350
-#, fuzzy
-#| msgid "Timeout"
+#: src/err-codes.h:356
 msgid "Timeout in LDAP"
-msgstr "逾時"
+msgstr "LDAP 逾時"
 
-#: src/err-codes.h:351
-#, fuzzy
-#| msgid "dirmngr error"
+#: src/err-codes.h:357
 msgid "LDAP decoding error"
-msgstr "dirmngr 錯誤"
+msgstr "dirmngr 解碼錯誤"
 
-#: src/err-codes.h:352
-#, fuzzy
-#| msgid "dirmngr error"
+#: src/err-codes.h:358
 msgid "LDAP encoding error"
-msgstr "dirmngr 錯誤"
+msgstr "dirmngr 編碼錯誤"
 
-#: src/err-codes.h:353
-#, fuzzy
-#| msgid "IPC read error"
+#: src/err-codes.h:359
 msgid "LDAP local error"
-msgstr "IPC 讀取錯誤"
+msgstr "LDAP 本地錯誤"
 
-#: src/err-codes.h:354
-#, fuzzy
-#| msgid "Not an IPC server"
+#: src/err-codes.h:360
 msgid "Cannot contact LDAP server"
-msgstr "不是 IPC 伺服器"
+msgstr "無法聯絡 LDAP 伺服器"
 
-#: src/err-codes.h:355
-#, fuzzy
-#| msgid "Success"
+#: src/err-codes.h:361
 msgid "LDAP success"
-msgstr "成功"
+msgstr "LDAP 成功"
 
-#: src/err-codes.h:356
-#, fuzzy
-#| msgid "Configuration error"
+#: src/err-codes.h:362
 msgid "LDAP operations error"
-msgstr "組態錯誤"
+msgstr "LDAP 操作錯誤"
 
-#: src/err-codes.h:357
-#, fuzzy
-#| msgid "Protocol violation"
+#: src/err-codes.h:363
 msgid "LDAP protocol error"
-msgstr "未依協定進行"
+msgstr "LDAP 協定錯誤"
 
-#: src/err-codes.h:358
+#: src/err-codes.h:364
 msgid "Time limit exceeded in LDAP"
-msgstr ""
+msgstr "LDAP 逾時"
 
-#: src/err-codes.h:359
+#: src/err-codes.h:365
 msgid "Size limit exceeded in LDAP"
-msgstr ""
+msgstr "LDAP 大小超限"
 
-#: src/err-codes.h:360
+#: src/err-codes.h:366
 msgid "LDAP compare false"
-msgstr ""
+msgstr "LDAP 比較錯誤"
 
-#: src/err-codes.h:361
+#: src/err-codes.h:367
 msgid "LDAP compare true"
-msgstr ""
+msgstr "LDAP 比較正確"
 
-#: src/err-codes.h:362
-#, fuzzy
-#| msgid "Unknown extension"
+#: src/err-codes.h:368
 msgid "LDAP authentication method not supported"
-msgstr "未知的擴充"
+msgstr "未支援的 LDAP 身份驗證方法"
 
-#: src/err-codes.h:363
+#: src/err-codes.h:369
 msgid "Strong(er) LDAP authentication required"
-msgstr ""
+msgstr "LDAP 需要增強型身份驗證"
 
-#: src/err-codes.h:364
-#, fuzzy
-#| msgid "Fatal alert message received"
+#: src/err-codes.h:370
 msgid "Partial LDAP results+referral received"
-msgstr "已收到嚴重警告訊息"
+msgstr "收到部分 LDAP 結果與引用"
 
-#: src/err-codes.h:365
-#, fuzzy
-#| msgid "General error"
+#: src/err-codes.h:371
 msgid "LDAP referral"
-msgstr "一般錯誤"
+msgstr "LDAP 轉送"
 
-#: src/err-codes.h:366
+#: src/err-codes.h:372
 msgid "Administrative LDAP limit exceeded"
-msgstr ""
+msgstr "超過 LDAP 管理限制"
 
-#: src/err-codes.h:367
+#: src/err-codes.h:373
 msgid "Critical LDAP extension is unavailable"
-msgstr ""
+msgstr "關鍵 LDAP 擴展不可用"
 
-#: src/err-codes.h:368
-#, fuzzy
-#| msgid "Card reset required"
+#: src/err-codes.h:374
 msgid "Confidentiality required by LDAP"
-msgstr "卡片需要重設"
+msgstr "LDAP 要求保密"
 
-#: src/err-codes.h:369
+#: src/err-codes.h:375
 msgid "LDAP SASL bind in progress"
-msgstr ""
+msgstr "正在進行 LDAP SASL 綁定"
 
-#: src/err-codes.h:370
+#: src/err-codes.h:376
 msgid "No such LDAP attribute"
-msgstr ""
+msgstr "沒有此 LDAP 屬性"
 
-#: src/err-codes.h:371
-#, fuzzy
-#| msgid "Invalid attribute"
+#: src/err-codes.h:377
 msgid "Undefined LDAP attribute type"
-msgstr "無效的屬性"
+msgstr "未定義的 LDAP 屬性類型"
 
-#: src/err-codes.h:372
-#, fuzzy
-#| msgid "Unsupported protection"
+#: src/err-codes.h:378
 msgid "Inappropriate matching in LDAP"
-msgstr "未支援的保護"
+msgstr "LDAP 不當匹配"
 
-#: src/err-codes.h:373
-#, fuzzy
-#| msgid "Protocol violation"
+#: src/err-codes.h:379
 msgid "Constraint violation in LDAP"
-msgstr "未依協定進行"
+msgstr "LDAP 約束沖突"
 
-#: src/err-codes.h:374
+#: src/err-codes.h:380
 msgid "LDAP type or value exists"
-msgstr ""
+msgstr "LDAP 類型或值存在"
 
-#: src/err-codes.h:375
-#, fuzzy
-#| msgid "Invalid state"
+#: src/err-codes.h:381
 msgid "Invalid syntax in LDAP"
-msgstr "無效的狀態"
+msgstr "LDAP 語法無效"
 
-#: src/err-codes.h:376
-#, fuzzy
-#| msgid "No CMS object"
+#: src/err-codes.h:382
 msgid "No such LDAP object"
-msgstr "不是 CMS 物件"
+msgstr "無此 LDAP 對象"
 
-#: src/err-codes.h:377
-#, fuzzy
-#| msgid "Hardware problem"
+#: src/err-codes.h:383
 msgid "LDAP alias problem"
-msgstr "硬體問題"
+msgstr "LDAP 別名問題"
 
-#: src/err-codes.h:378
-#, fuzzy
-#| msgid "Invalid state"
+#: src/err-codes.h:384
 msgid "Invalid DN syntax in LDAP"
-msgstr "無效的狀態"
+msgstr "LDAP 無效的 DN 語法"
 
-#: src/err-codes.h:379
+#: src/err-codes.h:385
 msgid "LDAP entry is a leaf"
-msgstr ""
+msgstr "LDAP 葉狀入口"
 
-#: src/err-codes.h:380
-#, fuzzy
-#| msgid "Encoding problem"
+#: src/err-codes.h:386
 msgid "LDAP alias dereferencing problem"
-msgstr "編碼問題"
+msgstr "LDAP 別名引用取消問題"
 
-#: src/err-codes.h:381
+#: src/err-codes.h:387
 msgid "LDAP proxy authorization failure (X)"
-msgstr ""
+msgstr "LDAP 代理授權失敗(X)"
 
-#: src/err-codes.h:382
-#, fuzzy
-#| msgid "Unsupported protection"
+#: src/err-codes.h:388
 msgid "Inappropriate LDAP authentication"
-msgstr "未支援的保護"
+msgstr "不當 LDAP 身份驗證"
 
-#: src/err-codes.h:383
-#, fuzzy
-#| msgid "Invalid card"
+#: src/err-codes.h:389
 msgid "Invalid LDAP credentials"
-msgstr "無效的卡片"
+msgstr "無效 LDAP 憑據"
 
-#: src/err-codes.h:384
+#: src/err-codes.h:390
 msgid "Insufficient access for LDAP"
-msgstr ""
+msgstr "無 LDAP 訪問權限"
 
-#: src/err-codes.h:385
+#: src/err-codes.h:391
 msgid "LDAP server is busy"
-msgstr ""
+msgstr "LDAP 伺服器忙"
 
-#: src/err-codes.h:386
-#, fuzzy
-#| msgid "No keyserver available"
+#: src/err-codes.h:392
 msgid "LDAP server is unavailable"
-msgstr "æ²\92æ\9c\89å\8f¯ç\94¨ç\9a\84é\87\91é\91°ä¼ºæ\9c\8då\99¨"
+msgstr "LDAP ä¼ºæ\9c\8då\99¨ä¸\8då\8f¯ç\94¨"
 
-#: src/err-codes.h:387
+#: src/err-codes.h:393
 msgid "LDAP server is unwilling to perform"
-msgstr ""
+msgstr "LDAP 伺服器拒絕處理"
 
-#: src/err-codes.h:388
+#: src/err-codes.h:394
 msgid "Loop detected by LDAP"
-msgstr ""
+msgstr "LDAP 檢測到循環"
 
-#: src/err-codes.h:389
-#, fuzzy
-#| msgid "Missing action"
+#: src/err-codes.h:395
 msgid "LDAP naming violation"
-msgstr "遺失行動"
+msgstr "LDAP 命名沖突"
 
-#: src/err-codes.h:390
-#, fuzzy
-#| msgid "Protocol violation"
+#: src/err-codes.h:396
 msgid "LDAP object class violation"
-msgstr "未依協定進行"
+msgstr "LDAP 對象類沖突"
 
-#: src/err-codes.h:391
-#, fuzzy
-#| msgid "Operation not yet finished"
+#: src/err-codes.h:397
 msgid "LDAP operation not allowed on non-leaf"
-msgstr "操作尚未完成"
+msgstr "不允許在非葉上執行 LDAP 操作"
 
-#: src/err-codes.h:392
-#, fuzzy
-#| msgid "Operation cancelled"
+#: src/err-codes.h:398
 msgid "LDAP operation not allowed on RDN"
-msgstr "操作已取消"
+msgstr "RDN 上不允許 LDAP 操作"
 
-#: src/err-codes.h:393
+#: src/err-codes.h:399
 msgid "Already exists (LDAP)"
-msgstr ""
+msgstr "LDAP 已經存在"
 
-#: src/err-codes.h:394
+#: src/err-codes.h:400
 msgid "Cannot modify LDAP object class"
-msgstr ""
+msgstr "無法修改 LDAP 對象類"
 
-#: src/err-codes.h:395
-#, fuzzy
-#| msgid "Line too long"
+#: src/err-codes.h:401
 msgid "LDAP results too large"
-msgstr "列太長"
+msgstr "LDAP 結果過大"
 
-#: src/err-codes.h:396
-#, fuzzy
-#| msgid "Operation cancelled"
+#: src/err-codes.h:402
 msgid "LDAP operation affects multiple DSAs"
-msgstr "操作已取消"
+msgstr "LDAP 操作影響多個 DSA"
 
-#: src/err-codes.h:397
+#: src/err-codes.h:403
 msgid "Virtual LDAP list view error"
-msgstr ""
+msgstr "虛擬 LDAP 列表視圖錯誤"
 
-#: src/err-codes.h:398
-#, fuzzy
-#| msgid "General IPC error"
+#: src/err-codes.h:404
 msgid "Other LDAP error"
-msgstr "一般性的 IPC 錯誤"
+msgstr "其他 LDAP 錯誤"
 
-#: src/err-codes.h:399
-#, fuzzy
-#| msgid "Resources exhausted"
+#: src/err-codes.h:405
 msgid "Resources exhausted in LCUP"
-msgstr "資源已耗盡"
+msgstr "LCUP 資源耗盡"
 
-#: src/err-codes.h:400
-#, fuzzy
-#| msgid "Protocol violation"
+#: src/err-codes.h:406
 msgid "Security violation in LCUP"
-msgstr "未依協定進行"
+msgstr "LCUP 安全沖突"
 
-#: src/err-codes.h:401
-#, fuzzy
-#| msgid "Invalid state"
+#: src/err-codes.h:407
 msgid "Invalid data in LCUP"
-msgstr "無效的狀態"
+msgstr "LCUP 數據無效"
 
-#: src/err-codes.h:402
-#, fuzzy
-#| msgid "Unsupported certificate"
+#: src/err-codes.h:408
 msgid "Unsupported scheme in LCUP"
-msgstr "未支援的憑證"
+msgstr "LCUP 未支援的方案"
 
-#: src/err-codes.h:403
-#, fuzzy
-#| msgid "Card reset required"
+#: src/err-codes.h:409
 msgid "Reload required in LCUP"
-msgstr "卡片需要重設"
+msgstr "LCUP 需要重新加載"
 
-#: src/err-codes.h:404
-#, fuzzy
-#| msgid "Success"
+#: src/err-codes.h:410
 msgid "LDAP cancelled"
-msgstr "成功"
+msgstr "LDAP 已取消"
 
-#: src/err-codes.h:405
-#, fuzzy
-#| msgid "Not operational"
+#: src/err-codes.h:411
 msgid "No LDAP operation to cancel"
-msgstr "無法操作"
+msgstr "沒有要取消的 LDAP 操作"
 
-#: src/err-codes.h:406
-#, fuzzy
-#| msgid "Not operational"
+#: src/err-codes.h:412
 msgid "Too late to cancel LDAP"
-msgstr "無法操作"
+msgstr "LDAP 已不能取消"
 
-#: src/err-codes.h:407
-#, fuzzy
-#| msgid "Not an IPC server"
+#: src/err-codes.h:413
 msgid "Cannot cancel LDAP"
-msgstr "不是 IPC 伺服器"
+msgstr "無法取消 LDAP"
 
-#: src/err-codes.h:408
-#, fuzzy
-#| msgid "Decryption failed"
+#: src/err-codes.h:414
 msgid "LDAP assertion failed"
-msgstr "解密失敗"
+msgstr "LDAP 斷言失敗"
 
-#: src/err-codes.h:409
+#: src/err-codes.h:415
 msgid "Proxied authorization denied by LDAP"
-msgstr ""
+msgstr "LDAP 禁止代理驗證"
 
-#: src/err-codes.h:410
+#: src/err-codes.h:416
 msgid "User defined error code 1"
 msgstr "使用者定義錯誤代碼 1"
 
-#: src/err-codes.h:411
+#: src/err-codes.h:417
 msgid "User defined error code 2"
 msgstr "使用者定義錯誤代碼 2"
 
-#: src/err-codes.h:412
+#: src/err-codes.h:418
 msgid "User defined error code 3"
 msgstr "使用者定義錯誤代碼 3"
 
-#: src/err-codes.h:413
+#: src/err-codes.h:419
 msgid "User defined error code 4"
 msgstr "使用者定義錯誤代碼 4"
 
-#: src/err-codes.h:414
+#: src/err-codes.h:420
 msgid "User defined error code 5"
 msgstr "使用者定義錯誤代碼 5"
 
-#: src/err-codes.h:415
+#: src/err-codes.h:421
 msgid "User defined error code 6"
 msgstr "使用者定義錯誤代碼 6"
 
-#: src/err-codes.h:416
+#: src/err-codes.h:422
 msgid "User defined error code 7"
 msgstr "使用者定義錯誤代碼 7"
 
-#: src/err-codes.h:417
+#: src/err-codes.h:423
 msgid "User defined error code 8"
 msgstr "使用者定義錯誤代碼 8"
 
-#: src/err-codes.h:418
+#: src/err-codes.h:424
 msgid "User defined error code 9"
 msgstr "使用者定義錯誤代碼 9"
 
-#: src/err-codes.h:419
+#: src/err-codes.h:425
 msgid "User defined error code 10"
 msgstr "使用者定義錯誤代碼 10"
 
-#: src/err-codes.h:420
+#: src/err-codes.h:426
 msgid "User defined error code 11"
 msgstr "使用者定義錯誤代碼 11"
 
-#: src/err-codes.h:421
+#: src/err-codes.h:427
 msgid "User defined error code 12"
 msgstr "使用者定義錯誤代碼 12"
 
-#: src/err-codes.h:422
+#: src/err-codes.h:428
 msgid "User defined error code 13"
 msgstr "使用者定義錯誤代碼 13"
 
-#: src/err-codes.h:423
+#: src/err-codes.h:429
 msgid "User defined error code 14"
 msgstr "使用者定義錯誤代碼 14"
 
-#: src/err-codes.h:424
+#: src/err-codes.h:430
 msgid "User defined error code 15"
 msgstr "使用者定義錯誤代碼 15"
 
-#: src/err-codes.h:425
+#: src/err-codes.h:431
 msgid "User defined error code 16"
 msgstr "使用者定義錯誤代碼 16"
 
-#: src/err-codes.h:426
+#: src/err-codes.h:432
+msgid "SQL success"
+msgstr "SQL 成功"
+
+#: src/err-codes.h:433
+msgid "SQL error"
+msgstr "SQL 錯誤"
+
+#: src/err-codes.h:434
+msgid "Internal logic error in SQL library"
+msgstr "SQL 庫內部邏輯錯誤"
+
+#: src/err-codes.h:435
+msgid "Access permission denied (SQL)"
+msgstr "SQL 無訪問權限"
+
+#: src/err-codes.h:436
+msgid "SQL abort was requested"
+msgstr "SQL 請求中止"
+
+#: src/err-codes.h:437
+msgid "SQL database file is locked"
+msgstr "SQL 資料庫文件被鎖定"
+
+#: src/err-codes.h:438
+msgid "An SQL table in the database is locked"
+msgstr "資料庫中 SLQ 表被鎖定"
+
+#: src/err-codes.h:439
+msgid "SQL library ran out of core"
+msgstr "SQL 庫耗盡核心資源"
+
+#: src/err-codes.h:440
+msgid "Attempt to write a readonly SQL database"
+msgstr "嘗試寫入唯讀 SQL 資料庫"
+
+#: src/err-codes.h:441
+msgid "SQL operation terminated by interrupt"
+msgstr "SQL 操作被中斷終止"
+
+#: src/err-codes.h:442
+msgid "I/O error during SQL operation"
+msgstr "SQL 操作 I/O 錯誤"
+
+#: src/err-codes.h:443
+msgid "SQL database disk image is malformed"
+msgstr "SQL 資料庫磁碟鏡像格式錯誤"
+
+#: src/err-codes.h:444
+msgid "Unknown opcode in SQL file control"
+msgstr "SQL 文件未知操作碼"
+
+#: src/err-codes.h:445
+msgid "Insertion failed because SQL database is full"
+msgstr "插入失敗,因為 SQL 資料庫已滿"
+
+#: src/err-codes.h:446
+msgid "Unable to open the SQL database file"
+msgstr "無法打開 SQL 資料庫文件"
+
+#: src/err-codes.h:447
+msgid "SQL database lock protocol error"
+msgstr "SQL 資料庫鎖定協定錯誤"
+
+#: src/err-codes.h:448
+msgid "(internal SQL code: empty)"
+msgstr "(內部 SQL 代碼:empty 空)"
+
+#: src/err-codes.h:449
+msgid "SQL database schema changed"
+msgstr "SQL 資料庫架構已更改"
+
+#: src/err-codes.h:450
+msgid "String or blob exceeds size limit (SQL)"
+msgstr "SQL 字串或blob超出大小限制"
+
+#: src/err-codes.h:451
+msgid "SQL abort due to constraint violation"
+msgstr "SQL 約束沖突導致中止"
+
+#: src/err-codes.h:452
+msgid "Data type mismatch (SQL)"
+msgstr "SQL 數據類型不匹配"
+
+#: src/err-codes.h:453
+msgid "SQL library used incorrectly"
+msgstr "SQL 庫使用錯誤"
+
+#: src/err-codes.h:454
+msgid "SQL library uses unsupported OS features"
+msgstr "SQL 庫使用了未支援的操作系統功能"
+
+#: src/err-codes.h:455
+msgid "Authorization denied (SQL)"
+msgstr "SQL 授權拒絕"
+
+#: src/err-codes.h:456
+msgid "(unused SQL code: format)"
+msgstr "(未使用的SQL代碼:format 格式)"
+
+#: src/err-codes.h:457
+msgid "SQL bind parameter out of range"
+msgstr "SQL 綁定参數越界"
+
+#: src/err-codes.h:458
+msgid "File opened that is not an SQL database file"
+msgstr "打開的文件不是 SQL 資料庫文件"
+
+#: src/err-codes.h:459
+msgid "Notifications from SQL logger"
+msgstr "來自 SQL 日誌記錄的通知"
+
+#: src/err-codes.h:460
+msgid "Warnings from SQL logger"
+msgstr "來自 SQL 日誌記錄的警告"
+
+#: src/err-codes.h:461
+msgid "SQL has another row ready"
+msgstr "SQL 已準備好另一行"
+
+#: src/err-codes.h:462
+msgid "SQL has finished executing"
+msgstr "SQL 已執行完成"
+
+#: src/err-codes.h:463
 msgid "System error w/o errno"
 msgstr "系統錯誤但是沒有 errno"
 
-#: src/err-codes.h:427
+#: src/err-codes.h:464
 msgid "Unknown system error"
 msgstr "未知的系統錯誤"
 
-#: src/err-codes.h:428
+#: src/err-codes.h:465
 msgid "End of file"
 msgstr "檔案結尾"
 
-#: src/err-codes.h:429
+#: src/err-codes.h:466
 msgid "Unknown error code"
 msgstr "未知的錯誤代碼"
 
-#: src/gpg-error.c:450
+#: src/argparse.c:494
+msgid "argument not expected"
+msgstr "沒料到有引數"
+
+#: src/argparse.c:496
+msgid "read error"
+msgstr "讀取錯誤"
+
+#: src/argparse.c:498
+msgid "keyword too long"
+msgstr "關鍵字太長"
+
+#: src/argparse.c:500
+msgid "missing argument"
+msgstr "無效的引數"
+
+#: src/argparse.c:502
+msgid "invalid argument"
+msgstr "無效的引數"
+
+#: src/argparse.c:504
+msgid "invalid command"
+msgstr "無效的指令"
+
+#: src/argparse.c:506
+msgid "invalid alias definition"
+msgstr "無效的別名定義"
+
+#: src/argparse.c:508 src/argparse.c:545
+msgid "permission error"
+msgstr "權限錯誤"
+
+#: src/argparse.c:510 src/argparse.c:543
+msgid "out of core"
+msgstr "超出核心"
+
+#: src/argparse.c:514 src/argparse.c:549
+msgid "invalid meta command"
+msgstr "無效元命令"
+
+#: src/argparse.c:516 src/argparse.c:551
+msgid "unknown meta command"
+msgstr "未知元命令"
+
+#: src/argparse.c:518 src/argparse.c:553
+msgid "unexpected meta command"
+msgstr "意外元命令"
+
+#: src/argparse.c:520
+msgid "invalid option"
+msgstr "無效的選項"
+
+#: src/argparse.c:530
+#, c-format
+msgid "missing argument for option \"%.50s\"\n"
+msgstr "\"%.50s\" 選項遺失了引數\n"
+
+#: src/argparse.c:532
+#, c-format
+msgid "invalid argument for option \"%.50s\"\n"
+msgstr "選項 \"%.50s\" 的引數無效\n"
+
+#: src/argparse.c:534
+#, c-format
+msgid "option \"%.50s\" does not expect an argument\n"
+msgstr "\"%.50s\" 選項沒料到會有引數\n"
+
+#: src/argparse.c:537
+#, c-format
+msgid "invalid command \"%.50s\"\n"
+msgstr "無效的指令 \"%.50s\"\n"
+
+#: src/argparse.c:539
+#, c-format
+msgid "option \"%.50s\" is ambiguous\n"
+msgstr "\"%.50s\" 選項不明確\n"
+
+#: src/argparse.c:541
 #, c-format
-msgid "Usage: %s GPG-ERROR [...]\n"
-msgstr "用法: %s GPG-ERROR [...]\n"
+msgid "command \"%.50s\" is ambiguous\n"
+msgstr "\"%.50s\" 指令不明確\n"
 
-#: src/gpg-error.c:633
+#: src/argparse.c:555
 #, c-format
-msgid "%s: warning: could not recognize %s\n"
-msgstr "%s: 警告: 無法辨識 %s\n"
-
-#, fuzzy
-#~| msgid "Resources exhausted"
-#~ msgid "LCUP Resources exhausted"
-#~ msgstr "資源已耗盡"
-
-#, fuzzy
-#~| msgid "Invalid data"
-#~ msgid "LCUP Invalid data"
-#~ msgstr "無效的資料"
-
-#, fuzzy
-#~| msgid "General error"
-#~ msgid "LDAP Other general error"
-#~ msgstr "一般錯誤"
-
-#, fuzzy
-#~| msgid "dirmngr error"
-#~ msgid "Encoding error"
-#~ msgstr "dirmngr 錯誤"
+msgid "invalid option \"%.50s\"\n"
+msgstr "無效的選項 \"%.50s\"\n"
+
+#: src/argparse.c:2286 src/argparse.c:2382
+#, c-format
+msgid "Note: no default option file '%s'\n"
+msgstr "注意:文件 '%s' 中無缺省選項\n"
+
+#: src/argparse.c:2296 src/argparse.c:2389
+#, c-format
+msgid "reading options from '%s'\n"
+msgstr "從 '%s' 中讀取選項\n"
+
+#: src/argparse.c:2374
+#, c-format
+msgid "option file '%s': %s\n"
+msgstr "選項文件 '%s': %s\n"
+
+#: src/argparse.c:2812
+#, c-format
+msgid "Note: ignoring option \"--%s\" due to global config\n"
+msgstr "注意: 由於整體設定,選項 \"--%s\" 被忽視\n"
+
+#: src/gpg-error.c:522
+msgid "Please report bugs to <https://bugs.gnupg.org>.\n"
+msgstr "請向  <https://bugs.gnupg.org> 報告錯誤。\n"
+
+#: src/gpg-error.c:762
+#, c-format
+msgid "warning: could not recognize %s\n"
+msgstr "警告: 無法辨識  %s\n"
+
+#~ msgid "out of core\n"
+#~ msgstr "內存耗盡\n"
+
+#~ msgid "Usage: %s GPG-ERROR [...]\n"
+#~ msgstr "用法: %s GPG-ERROR [...]\n"
index 398ec5e..fc3acc3 100644 (file)
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this program; if not, see <https://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: LGPL-2.1+
 
+
+#
 # We distribute the generated sources err-sources.h and err-codes.h,
 # because they are needed to build the po directory, and they don't
 # depend on the configuration anyway.
-
+#
 
 if HAVE_W32CE_SYSTEM
 gpg_extra_headers = gpg-extra/errno.h
@@ -42,6 +45,7 @@ endif
 # Distributed lock object definitions for cross compilation.
 lock_obj_pub = \
         syscfg/lock-obj-pub.aarch64-unknown-linux-gnu.h     \
+        syscfg/lock-obj-pub.aarch64-unknown-linux-gnu_ilp32.h \
        syscfg/lock-obj-pub.aarch64-apple-darwin.h          \
         syscfg/lock-obj-pub.alpha-unknown-linux-gnu.h       \
         syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h \
@@ -49,12 +53,13 @@ lock_obj_pub = \
        syscfg/lock-obj-pub.arm-apple-darwin.h              \
         syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h        \
        syscfg/lock-obj-pub.i386-apple-darwin.h             \
-        syscfg/lock-obj-pub.i686-pc-gnu.h                   \
-        syscfg/lock-obj-pub.i686-pc-kfreebsd-gnu.h          \
-        syscfg/lock-obj-pub.i686-pc-linux-gnu.h             \
+        syscfg/lock-obj-pub.i686-unknown-gnu.h              \
+        syscfg/lock-obj-pub.i686-unknown-kfreebsd-gnu.h     \
+        syscfg/lock-obj-pub.i686-unknown-linux-gnu.h        \
         syscfg/lock-obj-pub.m68k-unknown-linux-gnu.h        \
         syscfg/lock-obj-pub.mips-unknown-linux-gnu.h        \
         syscfg/lock-obj-pub.mips64el-unknown-linux-gnuabi64.h \
+        syscfg/lock-obj-pub.mips64-unknown-linux-gnuabi64.h \
         syscfg/lock-obj-pub.mipsel-unknown-linux-gnu.h      \
        syscfg/lock-obj-pub.nios2-unknown-linux-gnu.h       \
         syscfg/lock-obj-pub.or1k-unknown-linux-gnu.h        \
@@ -62,54 +67,68 @@ lock_obj_pub = \
         syscfg/lock-obj-pub.powerpc64-unknown-linux-gnu.h   \
        syscfg/lock-obj-pub.powerpc64le-unknown-linux-gnu.h \
        syscfg/lock-obj-pub.powerpc-unknown-linux-gnuspe.h  \
-        syscfg/lock-obj-pub.s390x-ibm-linux-gnu.h           \
+       syscfg/lock-obj-pub.riscv64-unknown-linux-gnu.h     \
+       syscfg/lock-obj-pub.riscv32-unknown-linux-gnu.h     \
+        syscfg/lock-obj-pub.s390x-unknown-linux-gnu.h       \
         syscfg/lock-obj-pub.sh3-unknown-linux-gnu.h         \
         syscfg/lock-obj-pub.sh4-unknown-linux-gnu.h         \
         syscfg/lock-obj-pub.sparc-unknown-linux-gnu.h       \
         syscfg/lock-obj-pub.sparc64-unknown-linux-gnu.h     \
        syscfg/lock-obj-pub.x86_64-apple-darwin.h           \
-        syscfg/lock-obj-pub.x86_64-pc-kfreebsd-gnu.h        \
-        syscfg/lock-obj-pub.x86_64-pc-linux-gnu.h           \
-        syscfg/lock-obj-pub.x86_64-pc-linux-gnux32.h        \
-        syscfg/lock-obj-pub.x86_64-pc-linux-musl.h          \
+        syscfg/lock-obj-pub.x86_64-unknown-kfreebsd-gnu.h   \
+        syscfg/lock-obj-pub.x86_64-unknown-linux-gnu.h      \
+        syscfg/lock-obj-pub.x86_64-unknown-linux-gnux32.h   \
+        syscfg/lock-obj-pub.x86_64-unknown-linux-musl.h     \
        syscfg/lock-obj-pub.tilegx-unknown-linux-gnu.h      \
+       syscfg/lock-obj-pub.ia64-unknown-linux-gnu.h        \
        syscfg/lock-obj-pub.mingw32.h
 
 
 lib_LTLIBRARIES = libgpg-error.la
 nodist_include_HEADERS = gpg-error.h gpgrt.h
+dist_bin_SCRIPTS = gpgrt-config
 bin_SCRIPTS = gpg-error-config
 m4datadir = $(datadir)/aclocal
-m4data_DATA = gpg-error.m4
+m4data_DATA = gpg-error.m4 gpgrt.m4
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = gpg-error.pc
 
 EXTRA_DIST = mkstrtable.awk err-sources.h.in err-codes.h.in \
        mkerrnos.awk errnos.in README \
        mkerrcodes.awk mkerrcodes1.awk mkerrcodes2.awk mkerrcodes.c \
        mkheader.c gpg-error.h.in mkw32errmap.c w32-add.h w32ce-add.h \
-       err-sources.h err-codes.h gpg-error-config.in gpg-error.m4 \
+       err-sources.h err-codes.h gpg-error-config.in gpg-error.m4 gpgrt.m4 \
        gpg-error.vers gpg-error.def.in \
         versioninfo.rc.in gpg-error.w32-manifest.in \
-       $(lock_obj_pub)
+       gpg-error-config-test.sh gpg-error.pc.in \
+       gen-lock-obj.sh $(lock_obj_pub)
 
-BUILT_SOURCES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
+BUILT_SOURCES = $(srcdir)/err-sources.h $(srcdir)/err-codes.h \
+       code-to-errno.h code-from-errno.h \
        err-sources-sym.h err-codes-sym.h errnos-sym.h gpg-error.h gpgrt.h \
        gpg-error.def mkw32errmap.map.c
 
 tmp_files = _mkerrcodes.h _gpg-error.def.h mkw32errmap.tab.h mkw32errmap.map.c
 
-CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
+CLEANFILES = code-to-errno.h code-from-errno.h \
        gpg-error.h gpgrt.h \
-        mkerrcodes mkerrcodes.h gpg-error.def mkw32errmap.tab.h \
+        mkerrcodes$(EXEEXT_FOR_BUILD) mkerrcodes.h gpg-error.def mkw32errmap.tab.h \
        mkw32errmap.map.c err-sources-sym.h err-codes-sym.h errnos-sym.h \
-       gpg-extra/errno.h mkheader $(tmp_files) lock-obj-pub.native.h
+       gpg-extra/errno.h mkheader$(EXEEXT_FOR_BUILD) \
+       gpg-error-config gpg-error-config-test.log \
+       $(tmp_files) lock-obj-pub.native.h
 
+MAINTAINERCLEANFILES = $(srcdir)/err-sources.h $(srcdir)/err-codes.h
+
+TESTS = gpg-error-config-test.sh
 
 #
 # {{{ Begin Windows part
 #
 if HAVE_W32_SYSTEM
 arch_sources = w32-gettext.c w32-lock.c w32-lock-obj.h w32-thread.c \
-              w32-iconv.c w32-estream.c
+              w32-iconv.c w32-estream.c w32-reg.c spawn-w32.c
 RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
             -DLOCALEDIR=\"$(localedir)\" $(AM_CPPFLAGS) $(CPPFLAGS)
 LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
@@ -120,7 +139,6 @@ SUFFIXES = .rc .lo
        $(LTRCCOMPILE) -i "$<" -o "$@"
 
 gpg_error_res = versioninfo.lo
-no_undefined = -no-undefined
 export_symbols = -export-symbols gpg-error.def
 # i686-w64-mingw32.gcc version 4.9.1 takes the long long helper
 # functions from libgcc_s_sjlj-1.dll and not from a static libgcc.  As
@@ -147,9 +165,8 @@ else
 #
 # {{{ Begin Unix part
 #
-arch_sources = posix-lock.c posix-lock-obj.h posix-thread.c
+arch_sources = posix-lock.c posix-lock-obj.h posix-thread.c spawn-posix.c
 gpg_error_res =
-no_undefined =
 export_symbols =
 extra_ltoptions =
 
@@ -163,6 +180,8 @@ endif
 # }}} End Unix part
 #
 
+socklibs = @GPG_ERROR_CONFIG_LIBS_PRIVATE@
+
 if HAVE_LD_VERSION_SCRIPT
   libgpg_error_vers_opt = -Wl,--version-script=$(srcdir)/gpg-error.vers
 else
@@ -170,15 +189,23 @@ else
 endif
 
 libgpg_error_la_LDFLAGS = \
-  $(no_undefined) $(export_symbols) $(libgpg_error_vers_opt) \
+  -no-undefined $(export_symbols) $(libgpg_error_vers_opt) \
   $(extra_ltoptions) -version-info \
   @LIBGPG_ERROR_LT_CURRENT@:@LIBGPG_ERROR_LT_REVISION@:@LIBGPG_ERROR_LT_AGE@
 
 libgpg_error_la_SOURCES = gettext.h $(arch_sources) \
-       gpgrt-int.h init.c init.h version.c lock.h thread.h \
+       gpgrt-int.h protos.h init.c init.h version.c lock.h thread.h \
        estream.c estream-printf.c estream-printf.h \
        strsource.c strerror.c code-to-errno.c code-from-errno.c \
-       visibility.c visibility.h b64dec.c
+       visibility.c visibility.h \
+       sysutils.c \
+       stringutils.c \
+       syscall-clamp.c \
+       logging.c \
+       b64dec.c b64enc.c \
+       argparse.c
+
+
 nodist_libgpg_error_la_SOURCES = gpg-error.h
 
 # libgpg_error_la_DEPENDENCIES = \
@@ -188,12 +215,12 @@ nodist_libgpg_error_la_SOURCES = gpg-error.h
 # without the extra_cppflags because they may include am -idirafter
 # which is not supported by the RC compiler.
 libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags)
-libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(LIBTHREAD)
+libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(socklibs) $(LIBTHREAD)
 
 gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c
 gpg_error_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" \
                      -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags)
-gpg_error_LDADD = ./libgpg-error.la $(LTLIBINTL)
+gpg_error_LDADD = libgpg-error.la $(LTLIBINTL)
 
 # We build err-sources.h and err-codes.h in the source directory.
 # This is needed because gettext does only look into the source
@@ -231,11 +258,11 @@ if HAVE_W32CE_SYSTEM
 mkw32errmap.tab.h: Makefile mkw32errmap.c
        $(CPP) -DRESOLVE_MACROS $(srcdir)/mkw32errmap.c | \
              grep '{&mkw32errmap_marker' >$@
-mkw32errmap.map.c: mkw32errmap
-       ./mkw32errmap --map > $@
-gpg-extra/errno.h: mkw32errmap
+mkw32errmap.map.c: mkw32errmap$(EXEEXT_FOR_BUILD)
+       ./mkw32errmap$(EXEEXT_FOR_BUILD) --map > $@
+gpg-extra/errno.h: mkw32errmap$(EXEEXT_FOR_BUILD)
        -$(MKDIR_P) gpg-extra
-       ./mkw32errmap > $@
+       ./mkw32errmap$(EXEEXT_FOR_BUILD) > $@
 else
 mkw32errmap.map.c:
        echo "/*dummy*/" > $@
@@ -251,27 +278,30 @@ gpg-error.def: Makefile gpg-error.def.in
 
 # It is correct to use $(CC_FOR_BUILD) here.  We want to run the
 # program at build time.
-mkerrcodes: mkerrcodes.c mkerrcodes.h Makefile
-       $(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkerrcodes.c
+mkerrcodes$(EXEEXT_FOR_BUILD): mkerrcodes.c mkerrcodes.h Makefile
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \
+       $(CPPFLAGS_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkerrcodes.c
 
 if HAVE_W32CE_SYSTEM
 # It is correct to use $(CC_FOR_BUILD) here.  We want to run the
 # program at build time.
-mkw32errmap: mkw32errmap.c mkw32errmap.tab.h Makefile
-       $(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkw32errmap.c
+mkw32errmap$(EXEEXT_FOR_BUILD): mkw32errmap.c mkw32errmap.tab.h Makefile
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \
+       $(CPPFLAGS_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkw32errmap.c
 endif
 
-code-from-errno.h: mkerrcodes Makefile
-       ./mkerrcodes | $(AWK) -f $(srcdir)/mkerrcodes2.awk >$@
+code-from-errno.h: mkerrcodes$(EXEEXT_FOR_BUILD) Makefile
+       ./mkerrcodes$(EXEEXT_FOR_BUILD) | $(AWK) -f $(srcdir)/mkerrcodes2.awk >$@
 
 errnos-sym.h: Makefile mkstrtable.awk errnos.in
        $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \
-               -v prefix=GPG_ERR_ -v namespace=errnos_ \
+               -v prefix=GPG_ERR_ -v pkg_namespace=errnos_ \
                $(srcdir)/errnos.in >$@
 
 
-mkheader: mkheader.c Makefile
-       $(CC_FOR_BUILD) -g -O0 -I. -I$(srcdir) -o $@ $(srcdir)/mkheader.c
+mkheader$(EXEEXT_FOR_BUILD): mkheader.c Makefile
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \
+       $(CPPFLAGS_FOR_BUILD) -g -I. -I$(srcdir) -o $@ $(srcdir)/mkheader.c
 
 parts_of_gpg_error_h =                 \
        gpg-error.h.in          \
@@ -287,25 +317,46 @@ parts_of_gpg_error_h =            \
 if FORCE_USE_SYSCFG
 pre_mkheader_cmds = if test -f lock-obj-pub.native.h; \
                     then rm lock-obj-pub.native.h; fi
+mkheader_opts = --cross
 else
+if HAVE_GENERATED_LOCK_OBJ_H
+# lock-obj-pub.native.h is generated at configure time
 pre_mkheader_cmds = :
+mkheader_opts =
+parts_of_gpg_error_h += ./lock-obj-pub.native.h
+else
+pre_mkheader_cmds = :
+mkheader_opts =
 parts_of_gpg_error_h += ./lock-obj-pub.native.h
 
 ./lock-obj-pub.native.h: Makefile gen-posix-lock-obj$(EXEEXT) posix-lock-obj.h
        ./gen-posix-lock-obj >$@
 endif
+endif
 
 # We also depend on versioninfo.rc because that is build by
 # config.status and thus has up-to-date version numbers.
-gpg-error.h: Makefile mkheader $(parts_of_gpg_error_h) \
+gpg-error.h: Makefile mkheader$(EXEEXT_FOR_BUILD) $(parts_of_gpg_error_h) \
              versioninfo.rc ../config.h
        $(pre_mkheader_cmds)
-       ./mkheader $(host_os) $(host_triplet)  $(srcdir)/gpg-error.h.in \
+       ./mkheader$(EXEEXT_FOR_BUILD) $(mkheader_opts)       \
+                   $(host_triplet)  $(srcdir)/gpg-error.h.in \
                    ../config.h $(PACKAGE_VERSION) $(VERSION_NUMBER) >$@
 
 gpgrt.h: gpg-error.h
        cp gpg-error.h gpgrt.h
 
+gpg-error-config: gpgrt-config gpg-error-config-old
+       @echo $(ECHO_N) "Confirm gpg-error-config works... $(ECHO_C)"
+       @if ./gpg-error-config-test.sh --old-new; then \
+         echo "good";                                         \
+       else                                                   \
+         echo "no";                                           \
+         echo "***  Please report to <https://bugs.gnupg.org> with gpg-error-config-test.log"; \
+         exit 1; \
+       fi
+       cp gpg-error-config-old $@
+
 install-data-local:
 if HAVE_W32CE_SYSTEM
        -$(MKDIR_P) "$(DESTDIR)$(includedir)/gpg-extra"
index e02b683..8a6f1b4 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this program; if not, see <https://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: LGPL-2.1+
 
+#
 # We distribute the generated sources err-sources.h and err-codes.h,
 # because they are needed to build the po directory, and they don't
 # depend on the configuration anyway.
+#
 
 
 
 
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -110,32 +123,39 @@ bin_PROGRAMS = gpg-error$(EXEEXT)
 @HAVE_W32_SYSTEM_FALSE@libgpg_error_la_DEPENDENCIES =  \
 @HAVE_W32_SYSTEM_FALSE@        $(am__DEPENDENCIES_1) \
 @HAVE_W32_SYSTEM_FALSE@        $(am__DEPENDENCIES_2) \
+@HAVE_W32_SYSTEM_FALSE@        $(am__DEPENDENCIES_2) \
 @HAVE_W32_SYSTEM_FALSE@        $(am__DEPENDENCIES_2)
-@FORCE_USE_SYSCFG_FALSE@am__append_1 = ./lock-obj-pub.native.h
+@FORCE_USE_SYSCFG_FALSE@@HAVE_GENERATED_LOCK_OBJ_H_TRUE@am__append_1 = ./lock-obj-pub.native.h
+@FORCE_USE_SYSCFG_FALSE@@HAVE_GENERATED_LOCK_OBJ_H_FALSE@am__append_2 = ./lock-obj-pub.native.h
 subdir = src
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-       $(srcdir)/versioninfo.rc.in \
-       $(srcdir)/gpg-error.w32-manifest.in \
-       $(srcdir)/gpg-error-config.in $(top_srcdir)/build-aux/depcomp \
-       README
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/autobuild.m4 \
-       $(top_srcdir)/m4/estream.m4 $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/ax_cc_for_build.m4 \
+       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/estream.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gnupg-misc.m4 \
        $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
        $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/lock.m4 \
        $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
        $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
        $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/threadlib.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
+       $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(dist_bin_SCRIPTS) \
+       $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES = versioninfo.rc gpg-error.w32-manifest \
-       gpg-error-config
+       gpg-error.pc gpg-error-config-old gpgrt-config \
+       gpg-error-config-test.sh
 CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" \
+       "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \
+       "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdir)" \
+       "$(DESTDIR)$(includedir)"
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -163,32 +183,38 @@ am__uninstall_files_from_dir = { \
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
-       "$(DESTDIR)$(bindir)" "$(DESTDIR)$(m4datadir)" \
-       "$(DESTDIR)$(includedir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
 @HAVE_W32_SYSTEM_TRUE@am__DEPENDENCIES_1 = versioninfo.lo
 am__DEPENDENCIES_2 =
 am__libgpg_error_la_SOURCES_DIST = gettext.h posix-lock.c \
-       posix-lock-obj.h posix-thread.c w32-gettext.c w32-lock.c \
-       w32-lock-obj.h w32-thread.c w32-iconv.c w32-estream.c \
-       gpgrt-int.h init.c init.h version.c lock.h thread.h estream.c \
+       posix-lock-obj.h posix-thread.c spawn-posix.c w32-gettext.c \
+       w32-lock.c w32-lock-obj.h w32-thread.c w32-iconv.c \
+       w32-estream.c w32-reg.c spawn-w32.c gpgrt-int.h protos.h \
+       init.c init.h version.c lock.h thread.h estream.c \
        estream-printf.c estream-printf.h strsource.c strerror.c \
        code-to-errno.c code-from-errno.c visibility.c visibility.h \
-       b64dec.c
+       sysutils.c stringutils.c syscall-clamp.c logging.c b64dec.c \
+       b64enc.c argparse.c
 @HAVE_W32_SYSTEM_FALSE@am__objects_1 = libgpg_error_la-posix-lock.lo \
-@HAVE_W32_SYSTEM_FALSE@        libgpg_error_la-posix-thread.lo
+@HAVE_W32_SYSTEM_FALSE@        libgpg_error_la-posix-thread.lo \
+@HAVE_W32_SYSTEM_FALSE@        libgpg_error_la-spawn-posix.lo
 @HAVE_W32_SYSTEM_TRUE@am__objects_1 = libgpg_error_la-w32-gettext.lo \
 @HAVE_W32_SYSTEM_TRUE@ libgpg_error_la-w32-lock.lo \
 @HAVE_W32_SYSTEM_TRUE@ libgpg_error_la-w32-thread.lo \
 @HAVE_W32_SYSTEM_TRUE@ libgpg_error_la-w32-iconv.lo \
-@HAVE_W32_SYSTEM_TRUE@ libgpg_error_la-w32-estream.lo
+@HAVE_W32_SYSTEM_TRUE@ libgpg_error_la-w32-estream.lo \
+@HAVE_W32_SYSTEM_TRUE@ libgpg_error_la-w32-reg.lo \
+@HAVE_W32_SYSTEM_TRUE@ libgpg_error_la-spawn-w32.lo
 am_libgpg_error_la_OBJECTS = $(am__objects_1) libgpg_error_la-init.lo \
        libgpg_error_la-version.lo libgpg_error_la-estream.lo \
        libgpg_error_la-estream-printf.lo libgpg_error_la-strsource.lo \
        libgpg_error_la-strerror.lo libgpg_error_la-code-to-errno.lo \
        libgpg_error_la-code-from-errno.lo \
-       libgpg_error_la-visibility.lo libgpg_error_la-b64dec.lo
+       libgpg_error_la-visibility.lo libgpg_error_la-sysutils.lo \
+       libgpg_error_la-stringutils.lo \
+       libgpg_error_la-syscall-clamp.lo libgpg_error_la-logging.lo \
+       libgpg_error_la-b64dec.lo libgpg_error_la-b64enc.lo \
+       libgpg_error_la-argparse.lo
 nodist_libgpg_error_la_OBJECTS =
 libgpg_error_la_OBJECTS = $(am_libgpg_error_la_OBJECTS) \
        $(nodist_libgpg_error_la_OBJECTS)
@@ -200,7 +226,6 @@ libgpg_error_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
        $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
        $(AM_CFLAGS) $(CFLAGS) $(libgpg_error_la_LDFLAGS) $(LDFLAGS) \
        -o $@
-PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
 gen_posix_lock_obj_SOURCES = gen-posix-lock-obj.c
 gen_posix_lock_obj_OBJECTS = gen-posix-lock-obj.$(OBJEXT)
 gen_posix_lock_obj_LDADD = $(LDADD)
@@ -210,8 +235,8 @@ gen_w32_lock_obj_LDADD = $(LDADD)
 am_gpg_error_OBJECTS = gpg_error-strsource-sym.$(OBJEXT) \
        gpg_error-strerror-sym.$(OBJEXT) gpg_error-gpg-error.$(OBJEXT)
 gpg_error_OBJECTS = $(am_gpg_error_OBJECTS)
-gpg_error_DEPENDENCIES = ./libgpg-error.la $(am__DEPENDENCIES_2)
-SCRIPTS = $(bin_SCRIPTS)
+gpg_error_DEPENDENCIES = libgpg-error.la $(am__DEPENDENCIES_2)
+SCRIPTS = $(bin_SCRIPTS) $(dist_bin_SCRIPTS)
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -226,7 +251,38 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/gen-posix-lock-obj.Po \
+       ./$(DEPDIR)/gen-w32-lock-obj.Po \
+       ./$(DEPDIR)/gpg_error-gpg-error.Po \
+       ./$(DEPDIR)/gpg_error-strerror-sym.Po \
+       ./$(DEPDIR)/gpg_error-strsource-sym.Po \
+       ./$(DEPDIR)/libgpg_error_la-argparse.Plo \
+       ./$(DEPDIR)/libgpg_error_la-b64dec.Plo \
+       ./$(DEPDIR)/libgpg_error_la-b64enc.Plo \
+       ./$(DEPDIR)/libgpg_error_la-code-from-errno.Plo \
+       ./$(DEPDIR)/libgpg_error_la-code-to-errno.Plo \
+       ./$(DEPDIR)/libgpg_error_la-estream-printf.Plo \
+       ./$(DEPDIR)/libgpg_error_la-estream.Plo \
+       ./$(DEPDIR)/libgpg_error_la-init.Plo \
+       ./$(DEPDIR)/libgpg_error_la-logging.Plo \
+       ./$(DEPDIR)/libgpg_error_la-posix-lock.Plo \
+       ./$(DEPDIR)/libgpg_error_la-posix-thread.Plo \
+       ./$(DEPDIR)/libgpg_error_la-spawn-posix.Plo \
+       ./$(DEPDIR)/libgpg_error_la-spawn-w32.Plo \
+       ./$(DEPDIR)/libgpg_error_la-strerror.Plo \
+       ./$(DEPDIR)/libgpg_error_la-stringutils.Plo \
+       ./$(DEPDIR)/libgpg_error_la-strsource.Plo \
+       ./$(DEPDIR)/libgpg_error_la-syscall-clamp.Plo \
+       ./$(DEPDIR)/libgpg_error_la-sysutils.Plo \
+       ./$(DEPDIR)/libgpg_error_la-version.Plo \
+       ./$(DEPDIR)/libgpg_error_la-visibility.Plo \
+       ./$(DEPDIR)/libgpg_error_la-w32-estream.Plo \
+       ./$(DEPDIR)/libgpg_error_la-w32-gettext.Plo \
+       ./$(DEPDIR)/libgpg_error_la-w32-iconv.Plo \
+       ./$(DEPDIR)/libgpg_error_la-w32-lock.Plo \
+       ./$(DEPDIR)/libgpg_error_la-w32-reg.Plo \
+       ./$(DEPDIR)/libgpg_error_la-w32-thread.Plo
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -255,7 +311,7 @@ am__can_run_installinfo = \
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
-DATA = $(m4data_DATA)
+DATA = $(m4data_DATA) $(pkgconfig_DATA)
 HEADERS = $(nodist_include_HEADERS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
@@ -276,6 +332,34 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red='\e[0;31m'; \
+    grn='\e[0;32m'; \
+    lgn='\e[1;32m'; \
+    blu='\e[1;34m'; \
+    mgn='\e[0;35m'; \
+    brg='\e[1m'; \
+    std='\e[m'; \
+  fi; \
+}
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+       $(srcdir)/gpg-error-config-test.sh.in \
+       $(srcdir)/gpg-error-config.in $(srcdir)/gpg-error.pc.in \
+       $(srcdir)/gpg-error.w32-manifest.in $(srcdir)/gpgrt-config.in \
+       $(srcdir)/versioninfo.rc.in $(top_srcdir)/build-aux/depcomp \
+       README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -307,18 +391,20 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
 FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GPG_ERROR_CONFIG_CFLAGS = @GPG_ERROR_CONFIG_CFLAGS@
 GPG_ERROR_CONFIG_HOST = @GPG_ERROR_CONFIG_HOST@
-GPG_ERROR_CONFIG_ISUBDIRAFTER = @GPG_ERROR_CONFIG_ISUBDIRAFTER@
 GPG_ERROR_CONFIG_LIBS = @GPG_ERROR_CONFIG_LIBS@
+GPG_ERROR_CONFIG_LIBS_PRIVATE = @GPG_ERROR_CONFIG_LIBS_PRIVATE@
 GPG_ERROR_CONFIG_MT_CFLAGS = @GPG_ERROR_CONFIG_MT_CFLAGS@
 GPG_ERROR_CONFIG_MT_LIBS = @GPG_ERROR_CONFIG_MT_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
+INSTALLSHELLPATH = @INSTALLSHELLPATH@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -326,6 +412,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
+LDADD_FOR_TESTS_KLUDGE = @LDADD_FOR_TESTS_KLUDGE@
 LDFLAGS = @LDFLAGS@
 LIBGPG_ERROR_LT_AGE = @LIBGPG_ERROR_LT_AGE@
 LIBGPG_ERROR_LT_CURRENT = @LIBGPG_ERROR_LT_CURRENT@
@@ -334,9 +421,14 @@ LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBREADLINE = @LIBREADLINE@
 LIBS = @LIBS@
+LIBSTDTHREAD = @LIBSTDTHREAD@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
+LIB_NETWORK = @LIB_NETWORK@
 LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
 LIPO = @LIPO@
 LN_S = @LN_S@
@@ -423,6 +515,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -439,6 +532,7 @@ top_srcdir = @top_srcdir@
 # Distributed lock object definitions for cross compilation.
 lock_obj_pub = \
         syscfg/lock-obj-pub.aarch64-unknown-linux-gnu.h     \
+        syscfg/lock-obj-pub.aarch64-unknown-linux-gnu_ilp32.h \
        syscfg/lock-obj-pub.aarch64-apple-darwin.h          \
         syscfg/lock-obj-pub.alpha-unknown-linux-gnu.h       \
         syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h \
@@ -446,12 +540,13 @@ lock_obj_pub = \
        syscfg/lock-obj-pub.arm-apple-darwin.h              \
         syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h        \
        syscfg/lock-obj-pub.i386-apple-darwin.h             \
-        syscfg/lock-obj-pub.i686-pc-gnu.h                   \
-        syscfg/lock-obj-pub.i686-pc-kfreebsd-gnu.h          \
-        syscfg/lock-obj-pub.i686-pc-linux-gnu.h             \
+        syscfg/lock-obj-pub.i686-unknown-gnu.h              \
+        syscfg/lock-obj-pub.i686-unknown-kfreebsd-gnu.h     \
+        syscfg/lock-obj-pub.i686-unknown-linux-gnu.h        \
         syscfg/lock-obj-pub.m68k-unknown-linux-gnu.h        \
         syscfg/lock-obj-pub.mips-unknown-linux-gnu.h        \
         syscfg/lock-obj-pub.mips64el-unknown-linux-gnuabi64.h \
+        syscfg/lock-obj-pub.mips64-unknown-linux-gnuabi64.h \
         syscfg/lock-obj-pub.mipsel-unknown-linux-gnu.h      \
        syscfg/lock-obj-pub.nios2-unknown-linux-gnu.h       \
         syscfg/lock-obj-pub.or1k-unknown-linux-gnu.h        \
@@ -459,44 +554,56 @@ lock_obj_pub = \
         syscfg/lock-obj-pub.powerpc64-unknown-linux-gnu.h   \
        syscfg/lock-obj-pub.powerpc64le-unknown-linux-gnu.h \
        syscfg/lock-obj-pub.powerpc-unknown-linux-gnuspe.h  \
-        syscfg/lock-obj-pub.s390x-ibm-linux-gnu.h           \
+       syscfg/lock-obj-pub.riscv64-unknown-linux-gnu.h     \
+       syscfg/lock-obj-pub.riscv32-unknown-linux-gnu.h     \
+        syscfg/lock-obj-pub.s390x-unknown-linux-gnu.h       \
         syscfg/lock-obj-pub.sh3-unknown-linux-gnu.h         \
         syscfg/lock-obj-pub.sh4-unknown-linux-gnu.h         \
         syscfg/lock-obj-pub.sparc-unknown-linux-gnu.h       \
         syscfg/lock-obj-pub.sparc64-unknown-linux-gnu.h     \
        syscfg/lock-obj-pub.x86_64-apple-darwin.h           \
-        syscfg/lock-obj-pub.x86_64-pc-kfreebsd-gnu.h        \
-        syscfg/lock-obj-pub.x86_64-pc-linux-gnu.h           \
-        syscfg/lock-obj-pub.x86_64-pc-linux-gnux32.h        \
-        syscfg/lock-obj-pub.x86_64-pc-linux-musl.h          \
+        syscfg/lock-obj-pub.x86_64-unknown-kfreebsd-gnu.h   \
+        syscfg/lock-obj-pub.x86_64-unknown-linux-gnu.h      \
+        syscfg/lock-obj-pub.x86_64-unknown-linux-gnux32.h   \
+        syscfg/lock-obj-pub.x86_64-unknown-linux-musl.h     \
        syscfg/lock-obj-pub.tilegx-unknown-linux-gnu.h      \
+       syscfg/lock-obj-pub.ia64-unknown-linux-gnu.h        \
        syscfg/lock-obj-pub.mingw32.h
 
 lib_LTLIBRARIES = libgpg-error.la
 nodist_include_HEADERS = gpg-error.h gpgrt.h
+dist_bin_SCRIPTS = gpgrt-config
 bin_SCRIPTS = gpg-error-config
 m4datadir = $(datadir)/aclocal
-m4data_DATA = gpg-error.m4
+m4data_DATA = gpg-error.m4 gpgrt.m4
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = gpg-error.pc
 EXTRA_DIST = mkstrtable.awk err-sources.h.in err-codes.h.in \
        mkerrnos.awk errnos.in README \
        mkerrcodes.awk mkerrcodes1.awk mkerrcodes2.awk mkerrcodes.c \
        mkheader.c gpg-error.h.in mkw32errmap.c w32-add.h w32ce-add.h \
-       err-sources.h err-codes.h gpg-error-config.in gpg-error.m4 \
+       err-sources.h err-codes.h gpg-error-config.in gpg-error.m4 gpgrt.m4 \
        gpg-error.vers gpg-error.def.in \
         versioninfo.rc.in gpg-error.w32-manifest.in \
-       $(lock_obj_pub)
+       gpg-error-config-test.sh gpg-error.pc.in \
+       gen-lock-obj.sh $(lock_obj_pub)
 
-BUILT_SOURCES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
+BUILT_SOURCES = $(srcdir)/err-sources.h $(srcdir)/err-codes.h \
+       code-to-errno.h code-from-errno.h \
        err-sources-sym.h err-codes-sym.h errnos-sym.h gpg-error.h gpgrt.h \
        gpg-error.def mkw32errmap.map.c
 
 tmp_files = _mkerrcodes.h _gpg-error.def.h mkw32errmap.tab.h mkw32errmap.map.c
-CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
+CLEANFILES = code-to-errno.h code-from-errno.h \
        gpg-error.h gpgrt.h \
-        mkerrcodes mkerrcodes.h gpg-error.def mkw32errmap.tab.h \
+        mkerrcodes$(EXEEXT_FOR_BUILD) mkerrcodes.h gpg-error.def mkw32errmap.tab.h \
        mkw32errmap.map.c err-sources-sym.h err-codes-sym.h errnos-sym.h \
-       gpg-extra/errno.h mkheader $(tmp_files) lock-obj-pub.native.h
+       gpg-extra/errno.h mkheader$(EXEEXT_FOR_BUILD) \
+       gpg-error-config gpg-error-config-test.log \
+       $(tmp_files) lock-obj-pub.native.h
 
+MAINTAINERCLEANFILES = $(srcdir)/err-sources.h $(srcdir)/err-codes.h
+TESTS = gpg-error-config-test.sh
 
 #
 # }}} End Windows part
@@ -504,13 +611,13 @@ CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
 #
 # {{{ Begin Unix part
 #
-@HAVE_W32_SYSTEM_FALSE@arch_sources = posix-lock.c posix-lock-obj.h posix-thread.c
+@HAVE_W32_SYSTEM_FALSE@arch_sources = posix-lock.c posix-lock-obj.h posix-thread.c spawn-posix.c
 
 #
 # {{{ Begin Windows part
 #
 @HAVE_W32_SYSTEM_TRUE@arch_sources = w32-gettext.c w32-lock.c w32-lock-obj.h w32-thread.c \
-@HAVE_W32_SYSTEM_TRUE@        w32-iconv.c w32-estream.c
+@HAVE_W32_SYSTEM_TRUE@        w32-iconv.c w32-estream.c w32-reg.c spawn-w32.c
 
 @HAVE_W32_SYSTEM_TRUE@RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 @HAVE_W32_SYSTEM_TRUE@            -DLOCALEDIR=\"$(localedir)\" $(AM_CPPFLAGS) $(CPPFLAGS)
@@ -519,8 +626,6 @@ CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
 @HAVE_W32_SYSTEM_TRUE@SUFFIXES = .rc .lo
 @HAVE_W32_SYSTEM_FALSE@gpg_error_res = 
 @HAVE_W32_SYSTEM_TRUE@gpg_error_res = versioninfo.lo
-@HAVE_W32_SYSTEM_FALSE@no_undefined = 
-@HAVE_W32_SYSTEM_TRUE@no_undefined = -no-undefined
 @HAVE_W32_SYSTEM_FALSE@export_symbols = 
 @HAVE_W32_SYSTEM_TRUE@export_symbols = -export-symbols gpg-error.def
 @HAVE_W32_SYSTEM_FALSE@extra_ltoptions = 
@@ -532,22 +637,29 @@ CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
 @HAVE_W32_SYSTEM_TRUE@libgpg_error_la_DEPENDENCIES = $(gpg_error_res) gpg-error.def
 @HAVE_W32_SYSTEM_FALSE@intllibs = @LTLIBINTL@
 @HAVE_W32_SYSTEM_TRUE@intllibs = 
-@HAVE_LD_VERSION_SCRIPT_FALSE@libgpg_error_vers_opt = 
 
 #
 # }}} End Unix part
 #
+socklibs = @GPG_ERROR_CONFIG_LIBS_PRIVATE@
+@HAVE_LD_VERSION_SCRIPT_FALSE@libgpg_error_vers_opt = 
 @HAVE_LD_VERSION_SCRIPT_TRUE@libgpg_error_vers_opt = -Wl,--version-script=$(srcdir)/gpg-error.vers
 libgpg_error_la_LDFLAGS = \
-  $(no_undefined) $(export_symbols) $(libgpg_error_vers_opt) \
+  -no-undefined $(export_symbols) $(libgpg_error_vers_opt) \
   $(extra_ltoptions) -version-info \
   @LIBGPG_ERROR_LT_CURRENT@:@LIBGPG_ERROR_LT_REVISION@:@LIBGPG_ERROR_LT_AGE@
 
 libgpg_error_la_SOURCES = gettext.h $(arch_sources) \
-       gpgrt-int.h init.c init.h version.c lock.h thread.h \
+       gpgrt-int.h protos.h init.c init.h version.c lock.h thread.h \
        estream.c estream-printf.c estream-printf.h \
        strsource.c strerror.c code-to-errno.c code-from-errno.c \
-       visibility.c visibility.h b64dec.c
+       visibility.c visibility.h \
+       sysutils.c \
+       stringutils.c \
+       syscall-clamp.c \
+       logging.c \
+       b64dec.c b64enc.c \
+       argparse.c
 
 nodist_libgpg_error_la_SOURCES = gpg-error.h
 
@@ -558,22 +670,27 @@ nodist_libgpg_error_la_SOURCES = gpg-error.h
 # without the extra_cppflags because they may include am -idirafter
 # which is not supported by the RC compiler.
 libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags)
-libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(LIBTHREAD)
+libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(socklibs) $(LIBTHREAD)
 gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c
 gpg_error_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" \
                      -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags)
 
-gpg_error_LDADD = ./libgpg-error.la $(LTLIBINTL)
+gpg_error_LDADD = libgpg-error.la $(LTLIBINTL)
 parts_of_gpg_error_h = gpg-error.h.in err-sources.h.in err-codes.h.in \
        errnos.in w32-add.h w32ce-add.h $(lock_obj_pub) \
-       $(am__append_1)
-@FORCE_USE_SYSCFG_FALSE@pre_mkheader_cmds = :
+       $(am__append_1) $(am__append_2)
+@FORCE_USE_SYSCFG_FALSE@@HAVE_GENERATED_LOCK_OBJ_H_FALSE@pre_mkheader_cmds = :
+# lock-obj-pub.native.h is generated at configure time
+@FORCE_USE_SYSCFG_FALSE@@HAVE_GENERATED_LOCK_OBJ_H_TRUE@pre_mkheader_cmds = :
 
 # If we are cross-compiling or building on Windows we better make sure
 # that no stale native lock include file will be found by mkheader.
 @FORCE_USE_SYSCFG_TRUE@pre_mkheader_cmds = if test -f lock-obj-pub.native.h; \
 @FORCE_USE_SYSCFG_TRUE@                    then rm lock-obj-pub.native.h; fi
 
+@FORCE_USE_SYSCFG_FALSE@@HAVE_GENERATED_LOCK_OBJ_H_FALSE@mkheader_opts = 
+@FORCE_USE_SYSCFG_FALSE@@HAVE_GENERATED_LOCK_OBJ_H_TRUE@mkheader_opts = 
+@FORCE_USE_SYSCFG_TRUE@mkheader_opts = --cross
 all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -591,14 +708,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --gnu src/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -613,46 +729,14 @@ versioninfo.rc: $(top_builddir)/config.status $(srcdir)/versioninfo.rc.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 gpg-error.w32-manifest: $(top_builddir)/config.status $(srcdir)/gpg-error.w32-manifest.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-gpg-error-config: $(top_builddir)/config.status $(srcdir)/gpg-error-config.in
+gpg-error.pc: $(top_builddir)/config.status $(srcdir)/gpg-error.pc.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+gpg-error-config-old: $(top_builddir)/config.status $(srcdir)/gpg-error-config.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+gpgrt-config: $(top_builddir)/config.status $(srcdir)/gpgrt-config.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+gpg-error-config-test.sh: $(top_builddir)/config.status $(srcdir)/gpg-error-config-test.sh.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
-       @$(NORMAL_INSTALL)
-       @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-       list2=; for p in $$list; do \
-         if test -f $$p; then \
-           list2="$$list2 $$p"; \
-         else :; fi; \
-       done; \
-       test -z "$$list2" || { \
-         echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
-         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
-         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
-       }
-
-uninstall-libLTLIBRARIES:
-       @$(NORMAL_UNINSTALL)
-       @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
-       for p in $$list; do \
-         $(am__strip_dir) \
-         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
-         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
-       done
-
-clean-libLTLIBRARIES:
-       -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-       @list='$(lib_LTLIBRARIES)'; \
-       locs=`for p in $$list; do echo $$p; done | \
-             sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-             sort -u`; \
-       test -z "$$locs" || { \
-         echo rm -f $${locs}; \
-         rm -f $${locs}; \
-       }
-
-libgpg-error.la: $(libgpg_error_la_OBJECTS) $(libgpg_error_la_DEPENDENCIES) $(EXTRA_libgpg_error_la_DEPENDENCIES) 
-       $(AM_V_CCLD)$(libgpg_error_la_LINK) -rpath $(libdir) $(libgpg_error_la_OBJECTS) $(libgpg_error_la_LIBADD) $(LIBS)
 install-binPROGRAMS: $(bin_PROGRAMS)
        @$(NORMAL_INSTALL)
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
@@ -712,6 +796,44 @@ clean-noinstPROGRAMS:
        echo " rm -f" $$list; \
        rm -f $$list
 
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+       list2=; for p in $$list; do \
+         if test -f $$p; then \
+           list2="$$list2 $$p"; \
+         else :; fi; \
+       done; \
+       test -z "$$list2" || { \
+         echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+       }
+
+uninstall-libLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+       for p in $$list; do \
+         $(am__strip_dir) \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+       done
+
+clean-libLTLIBRARIES:
+       -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+       @list='$(lib_LTLIBRARIES)'; \
+       locs=`for p in $$list; do echo $$p; done | \
+             sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+             sort -u`; \
+       test -z "$$locs" || { \
+         echo rm -f $${locs}; \
+         rm -f $${locs}; \
+       }
+
+libgpg-error.la: $(libgpg_error_la_OBJECTS) $(libgpg_error_la_DEPENDENCIES) $(EXTRA_libgpg_error_la_DEPENDENCIES) 
+       $(AM_V_CCLD)$(libgpg_error_la_LINK) -rpath $(libdir) $(libgpg_error_la_OBJECTS) $(libgpg_error_la_LIBADD) $(LIBS)
+
 gen-posix-lock-obj$(EXEEXT): $(gen_posix_lock_obj_OBJECTS) $(gen_posix_lock_obj_DEPENDENCIES) $(EXTRA_gen_posix_lock_obj_DEPENDENCIES) 
        @rm -f gen-posix-lock-obj$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(gen_posix_lock_obj_OBJECTS) $(gen_posix_lock_obj_LDADD) $(LIBS)
@@ -758,6 +880,41 @@ uninstall-binSCRIPTS:
        files=`for p in $$list; do echo "$$p"; done | \
               sed -e 's,.*/,,;$(transform)'`; \
        dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
+install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
+       @$(NORMAL_INSTALL)
+       @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n' \
+           -e 'h;s|.*|.|' \
+           -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+             if (++n[d] == $(am__install_max)) { \
+               print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+           else { print "f", d "/" $$4, $$1 } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+            test -z "$$files" || { \
+              echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+              $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+            } \
+       ; done
+
+uninstall-dist_binSCRIPTS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+       files=`for p in $$list; do echo "$$p"; done | \
+              sed -e 's,.*/,,;$(transform)'`; \
+       dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -765,28 +922,43 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen-posix-lock-obj.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen-w32-lock-obj.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpg_error-gpg-error.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpg_error-strerror-sym.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpg_error-strsource-sym.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-b64dec.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-code-from-errno.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-code-to-errno.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-estream-printf.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-estream.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-init.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-posix-lock.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-posix-thread.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-strerror.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-strsource.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-version.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-visibility.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-w32-estream.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-w32-gettext.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-w32-iconv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-w32-lock.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-w32-thread.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen-posix-lock-obj.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen-w32-lock-obj.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpg_error-gpg-error.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpg_error-strerror-sym.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpg_error-strsource-sym.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-argparse.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-b64dec.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-b64enc.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-code-from-errno.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-code-to-errno.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-estream-printf.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-estream.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-init.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-logging.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-posix-lock.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-posix-thread.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-spawn-posix.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-spawn-w32.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-strerror.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-stringutils.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-strsource.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-syscall-clamp.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-sysutils.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-version.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-visibility.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-w32-estream.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-w32-gettext.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-w32-iconv.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-w32-lock.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-w32-reg.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpg_error_la-w32-thread.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -823,6 +995,13 @@ libgpg_error_la-posix-thread.lo: posix-thread.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgpg_error_la-posix-thread.lo `test -f 'posix-thread.c' || echo '$(srcdir)/'`posix-thread.c
 
+libgpg_error_la-spawn-posix.lo: spawn-posix.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgpg_error_la-spawn-posix.lo -MD -MP -MF $(DEPDIR)/libgpg_error_la-spawn-posix.Tpo -c -o libgpg_error_la-spawn-posix.lo `test -f 'spawn-posix.c' || echo '$(srcdir)/'`spawn-posix.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/libgpg_error_la-spawn-posix.Tpo $(DEPDIR)/libgpg_error_la-spawn-posix.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='spawn-posix.c' object='libgpg_error_la-spawn-posix.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgpg_error_la-spawn-posix.lo `test -f 'spawn-posix.c' || echo '$(srcdir)/'`spawn-posix.c
+
 libgpg_error_la-w32-gettext.lo: w32-gettext.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgpg_error_la-w32-gettext.lo -MD -MP -MF $(DEPDIR)/libgpg_error_la-w32-gettext.Tpo -c -o libgpg_error_la-w32-gettext.lo `test -f 'w32-gettext.c' || echo '$(srcdir)/'`w32-gettext.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/libgpg_error_la-w32-gettext.Tpo $(DEPDIR)/libgpg_error_la-w32-gettext.Plo
@@ -858,6 +1037,20 @@ libgpg_error_la-w32-estream.lo: w32-estream.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgpg_error_la-w32-estream.lo `test -f 'w32-estream.c' || echo '$(srcdir)/'`w32-estream.c
 
+libgpg_error_la-w32-reg.lo: w32-reg.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgpg_error_la-w32-reg.lo -MD -MP -MF $(DEPDIR)/libgpg_error_la-w32-reg.Tpo -c -o libgpg_error_la-w32-reg.lo `test -f 'w32-reg.c' || echo '$(srcdir)/'`w32-reg.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/libgpg_error_la-w32-reg.Tpo $(DEPDIR)/libgpg_error_la-w32-reg.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='w32-reg.c' object='libgpg_error_la-w32-reg.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgpg_error_la-w32-reg.lo `test -f 'w32-reg.c' || echo '$(srcdir)/'`w32-reg.c
+
+libgpg_error_la-spawn-w32.lo: spawn-w32.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgpg_error_la-spawn-w32.lo -MD -MP -MF $(DEPDIR)/libgpg_error_la-spawn-w32.Tpo -c -o libgpg_error_la-spawn-w32.lo `test -f 'spawn-w32.c' || echo '$(srcdir)/'`spawn-w32.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/libgpg_error_la-spawn-w32.Tpo $(DEPDIR)/libgpg_error_la-spawn-w32.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='spawn-w32.c' object='libgpg_error_la-spawn-w32.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgpg_error_la-spawn-w32.lo `test -f 'spawn-w32.c' || echo '$(srcdir)/'`spawn-w32.c
+
 libgpg_error_la-init.lo: init.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgpg_error_la-init.lo -MD -MP -MF $(DEPDIR)/libgpg_error_la-init.Tpo -c -o libgpg_error_la-init.lo `test -f 'init.c' || echo '$(srcdir)/'`init.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/libgpg_error_la-init.Tpo $(DEPDIR)/libgpg_error_la-init.Plo
@@ -921,6 +1114,34 @@ libgpg_error_la-visibility.lo: visibility.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgpg_error_la-visibility.lo `test -f 'visibility.c' || echo '$(srcdir)/'`visibility.c
 
+libgpg_error_la-sysutils.lo: sysutils.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgpg_error_la-sysutils.lo -MD -MP -MF $(DEPDIR)/libgpg_error_la-sysutils.Tpo -c -o libgpg_error_la-sysutils.lo `test -f 'sysutils.c' || echo '$(srcdir)/'`sysutils.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/libgpg_error_la-sysutils.Tpo $(DEPDIR)/libgpg_error_la-sysutils.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sysutils.c' object='libgpg_error_la-sysutils.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgpg_error_la-sysutils.lo `test -f 'sysutils.c' || echo '$(srcdir)/'`sysutils.c
+
+libgpg_error_la-stringutils.lo: stringutils.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgpg_error_la-stringutils.lo -MD -MP -MF $(DEPDIR)/libgpg_error_la-stringutils.Tpo -c -o libgpg_error_la-stringutils.lo `test -f 'stringutils.c' || echo '$(srcdir)/'`stringutils.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/libgpg_error_la-stringutils.Tpo $(DEPDIR)/libgpg_error_la-stringutils.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='stringutils.c' object='libgpg_error_la-stringutils.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgpg_error_la-stringutils.lo `test -f 'stringutils.c' || echo '$(srcdir)/'`stringutils.c
+
+libgpg_error_la-syscall-clamp.lo: syscall-clamp.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgpg_error_la-syscall-clamp.lo -MD -MP -MF $(DEPDIR)/libgpg_error_la-syscall-clamp.Tpo -c -o libgpg_error_la-syscall-clamp.lo `test -f 'syscall-clamp.c' || echo '$(srcdir)/'`syscall-clamp.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/libgpg_error_la-syscall-clamp.Tpo $(DEPDIR)/libgpg_error_la-syscall-clamp.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='syscall-clamp.c' object='libgpg_error_la-syscall-clamp.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgpg_error_la-syscall-clamp.lo `test -f 'syscall-clamp.c' || echo '$(srcdir)/'`syscall-clamp.c
+
+libgpg_error_la-logging.lo: logging.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgpg_error_la-logging.lo -MD -MP -MF $(DEPDIR)/libgpg_error_la-logging.Tpo -c -o libgpg_error_la-logging.lo `test -f 'logging.c' || echo '$(srcdir)/'`logging.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/libgpg_error_la-logging.Tpo $(DEPDIR)/libgpg_error_la-logging.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='logging.c' object='libgpg_error_la-logging.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgpg_error_la-logging.lo `test -f 'logging.c' || echo '$(srcdir)/'`logging.c
+
 libgpg_error_la-b64dec.lo: b64dec.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgpg_error_la-b64dec.lo -MD -MP -MF $(DEPDIR)/libgpg_error_la-b64dec.Tpo -c -o libgpg_error_la-b64dec.lo `test -f 'b64dec.c' || echo '$(srcdir)/'`b64dec.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/libgpg_error_la-b64dec.Tpo $(DEPDIR)/libgpg_error_la-b64dec.Plo
@@ -928,6 +1149,20 @@ libgpg_error_la-b64dec.lo: b64dec.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgpg_error_la-b64dec.lo `test -f 'b64dec.c' || echo '$(srcdir)/'`b64dec.c
 
+libgpg_error_la-b64enc.lo: b64enc.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgpg_error_la-b64enc.lo -MD -MP -MF $(DEPDIR)/libgpg_error_la-b64enc.Tpo -c -o libgpg_error_la-b64enc.lo `test -f 'b64enc.c' || echo '$(srcdir)/'`b64enc.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/libgpg_error_la-b64enc.Tpo $(DEPDIR)/libgpg_error_la-b64enc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='b64enc.c' object='libgpg_error_la-b64enc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgpg_error_la-b64enc.lo `test -f 'b64enc.c' || echo '$(srcdir)/'`b64enc.c
+
+libgpg_error_la-argparse.lo: argparse.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgpg_error_la-argparse.lo -MD -MP -MF $(DEPDIR)/libgpg_error_la-argparse.Tpo -c -o libgpg_error_la-argparse.lo `test -f 'argparse.c' || echo '$(srcdir)/'`argparse.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/libgpg_error_la-argparse.Tpo $(DEPDIR)/libgpg_error_la-argparse.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='argparse.c' object='libgpg_error_la-argparse.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgpg_error_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgpg_error_la-argparse.lo `test -f 'argparse.c' || echo '$(srcdir)/'`argparse.c
+
 gpg_error-strsource-sym.o: strsource-sym.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gpg_error_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gpg_error-strsource-sym.o -MD -MP -MF $(DEPDIR)/gpg_error-strsource-sym.Tpo -c -o gpg_error-strsource-sym.o `test -f 'strsource-sym.c' || echo '$(srcdir)/'`strsource-sym.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/gpg_error-strsource-sym.Tpo $(DEPDIR)/gpg_error-strsource-sym.Po
@@ -996,6 +1231,27 @@ uninstall-m4dataDATA:
        @list='$(m4data_DATA)'; test -n "$(m4datadir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
        dir='$(DESTDIR)$(m4datadir)'; $(am__uninstall_files_from_dir)
+install-pkgconfigDATA: $(pkgconfig_DATA)
+       @$(NORMAL_INSTALL)
+       @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
+       done
+
+uninstall-pkgconfigDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
 install-nodist_includeHEADERS: $(nodist_include_HEADERS)
        @$(NORMAL_INSTALL)
        @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
@@ -1070,7 +1326,103 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+check-TESTS: $(TESTS)
+       @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+       srcdir=$(srcdir); export srcdir; \
+       list=' $(TESTS) '; \
+       $(am__tty_colors); \
+       if test -n "$$list"; then \
+         for tst in $$list; do \
+           if test -f ./$$tst; then dir=./; \
+           elif test -f $$tst; then dir=; \
+           else dir="$(srcdir)/"; fi; \
+           if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
+             all=`expr $$all + 1`; \
+             case " $(XFAIL_TESTS) " in \
+             *[\ \     ]$$tst[\ \      ]*) \
+               xpass=`expr $$xpass + 1`; \
+               failed=`expr $$failed + 1`; \
+               col=$$red; res=XPASS; \
+             ;; \
+             *) \
+               col=$$grn; res=PASS; \
+             ;; \
+             esac; \
+           elif test $$? -ne 77; then \
+             all=`expr $$all + 1`; \
+             case " $(XFAIL_TESTS) " in \
+             *[\ \     ]$$tst[\ \      ]*) \
+               xfail=`expr $$xfail + 1`; \
+               col=$$lgn; res=XFAIL; \
+             ;; \
+             *) \
+               failed=`expr $$failed + 1`; \
+               col=$$red; res=FAIL; \
+             ;; \
+             esac; \
+           else \
+             skip=`expr $$skip + 1`; \
+             col=$$blu; res=SKIP; \
+           fi; \
+           echo "$${col}$$res$${std}: $$tst"; \
+         done; \
+         if test "$$all" -eq 1; then \
+           tests="test"; \
+           All=""; \
+         else \
+           tests="tests"; \
+           All="All "; \
+         fi; \
+         if test "$$failed" -eq 0; then \
+           if test "$$xfail" -eq 0; then \
+             banner="$$All$$all $$tests passed"; \
+           else \
+             if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+             banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+           fi; \
+         else \
+           if test "$$xpass" -eq 0; then \
+             banner="$$failed of $$all $$tests failed"; \
+           else \
+             if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+             banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+           fi; \
+         fi; \
+         dashes="$$banner"; \
+         skipped=""; \
+         if test "$$skip" -ne 0; then \
+           if test "$$skip" -eq 1; then \
+             skipped="($$skip test was not run)"; \
+           else \
+             skipped="($$skip tests were not run)"; \
+           fi; \
+           test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+             dashes="$$skipped"; \
+         fi; \
+         report=""; \
+         if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+           report="Please report to $(PACKAGE_BUGREPORT)"; \
+           test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+             dashes="$$report"; \
+         fi; \
+         dashes=`echo "$$dashes" | sed s/./=/g`; \
+         if test "$$failed" -eq 0; then \
+           col="$$grn"; \
+         else \
+           col="$$red"; \
+         fi; \
+         echo "$${col}$$dashes$${std}"; \
+         echo "$${col}$$banner$${std}"; \
+         test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+         test -z "$$report" || echo "$${col}$$report$${std}"; \
+         echo "$${col}$$dashes$${std}"; \
+         test "$$failed" -eq 0; \
+       else :; fi
+
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -1101,19 +1453,21 @@ distdir: $(DISTFILES)
          fi; \
        done
 check-am: all-am
+       $(MAKE) $(AM_MAKEFLAGS) check-TESTS
 check: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) \
+all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(DATA) \
                $(HEADERS)
 install-binPROGRAMS: install-libLTLIBRARIES
 
 installdirs:
-       for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(includedir)"; do \
+       for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
+install-exec: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-exec-am
 install-data: install-data-am
 uninstall: uninstall-am
 
@@ -1144,13 +1498,44 @@ maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
        -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
 clean: clean-am
 
 clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
        clean-libtool clean-noinstPROGRAMS mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/gen-posix-lock-obj.Po
+       -rm -f ./$(DEPDIR)/gen-w32-lock-obj.Po
+       -rm -f ./$(DEPDIR)/gpg_error-gpg-error.Po
+       -rm -f ./$(DEPDIR)/gpg_error-strerror-sym.Po
+       -rm -f ./$(DEPDIR)/gpg_error-strsource-sym.Po
+       -rm -f ./$(DEPDIR)/libgpg_error_la-argparse.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-b64dec.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-b64enc.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-code-from-errno.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-code-to-errno.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-estream-printf.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-estream.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-init.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-logging.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-posix-lock.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-posix-thread.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-spawn-posix.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-spawn-w32.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-strerror.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-stringutils.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-strsource.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-syscall-clamp.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-sysutils.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-version.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-visibility.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-w32-estream.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-w32-gettext.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-w32-iconv.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-w32-lock.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-w32-reg.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-w32-thread.Plo
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -1168,14 +1553,14 @@ info: info-am
 info-am:
 
 install-data-am: install-data-local install-m4dataDATA \
-       install-nodist_includeHEADERS
+       install-nodist_includeHEADERS install-pkgconfigDATA
 
 install-dvi: install-dvi-am
 
 install-dvi-am:
 
 install-exec-am: install-binPROGRAMS install-binSCRIPTS \
-       install-libLTLIBRARIES
+       install-dist_binSCRIPTS install-libLTLIBRARIES
 
 install-html: install-html-am
 
@@ -1198,7 +1583,37 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/gen-posix-lock-obj.Po
+       -rm -f ./$(DEPDIR)/gen-w32-lock-obj.Po
+       -rm -f ./$(DEPDIR)/gpg_error-gpg-error.Po
+       -rm -f ./$(DEPDIR)/gpg_error-strerror-sym.Po
+       -rm -f ./$(DEPDIR)/gpg_error-strsource-sym.Po
+       -rm -f ./$(DEPDIR)/libgpg_error_la-argparse.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-b64dec.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-b64enc.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-code-from-errno.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-code-to-errno.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-estream-printf.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-estream.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-init.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-logging.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-posix-lock.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-posix-thread.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-spawn-posix.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-spawn-w32.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-strerror.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-stringutils.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-strsource.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-syscall-clamp.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-sysutils.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-version.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-visibility.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-w32-estream.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-w32-gettext.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-w32-iconv.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-w32-lock.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-w32-reg.Plo
+       -rm -f ./$(DEPDIR)/libgpg_error_la-w32-thread.Plo
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -1216,29 +1631,35 @@ ps: ps-am
 ps-am:
 
 uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
-       uninstall-libLTLIBRARIES uninstall-m4dataDATA \
-       uninstall-nodist_includeHEADERS
-
-.MAKE: all check install install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
-       clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
-       clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \
-       ctags-am distclean distclean-compile distclean-generic \
-       distclean-libtool distclean-tags distdir dvi dvi-am html \
-       html-am info info-am install install-am install-binPROGRAMS \
-       install-binSCRIPTS install-data install-data-am \
-       install-data-local install-dvi install-dvi-am install-exec \
-       install-exec-am install-html install-html-am install-info \
-       install-info-am install-libLTLIBRARIES install-m4dataDATA \
-       install-man install-nodist_includeHEADERS install-pdf \
-       install-pdf-am install-ps install-ps-am install-strip \
+       uninstall-dist_binSCRIPTS uninstall-libLTLIBRARIES \
+       uninstall-m4dataDATA uninstall-nodist_includeHEADERS \
+       uninstall-pkgconfigDATA
+
+.MAKE: all check check-am install install-am install-exec \
+       install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \
+       check-am clean clean-binPROGRAMS clean-generic \
+       clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \
+       cscopelist-am ctags ctags-am distclean distclean-compile \
+       distclean-generic distclean-libtool distclean-tags distdir dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-binPROGRAMS install-binSCRIPTS install-data \
+       install-data-am install-data-local install-dist_binSCRIPTS \
+       install-dvi install-dvi-am install-exec install-exec-am \
+       install-html install-html-am install-info install-info-am \
+       install-libLTLIBRARIES install-m4dataDATA install-man \
+       install-nodist_includeHEADERS install-pdf install-pdf-am \
+       install-pkgconfigDATA install-ps install-ps-am install-strip \
        installcheck installcheck-am installdirs maintainer-clean \
        maintainer-clean-generic mostlyclean mostlyclean-compile \
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
-       uninstall-binSCRIPTS uninstall-libLTLIBRARIES \
-       uninstall-m4dataDATA uninstall-nodist_includeHEADERS
+       uninstall-binSCRIPTS uninstall-dist_binSCRIPTS \
+       uninstall-libLTLIBRARIES uninstall-m4dataDATA \
+       uninstall-nodist_includeHEADERS uninstall-pkgconfigDATA
+
+.PRECIOUS: Makefile
 
 
 @HAVE_W32_SYSTEM_TRUE@.rc.lo:
@@ -1291,11 +1712,11 @@ mkerrcodes.h: Makefile mkerrcodes.awk $(gpg_extra_headers)
 @HAVE_W32CE_SYSTEM_TRUE@mkw32errmap.tab.h: Makefile mkw32errmap.c
 @HAVE_W32CE_SYSTEM_TRUE@       $(CPP) -DRESOLVE_MACROS $(srcdir)/mkw32errmap.c | \
 @HAVE_W32CE_SYSTEM_TRUE@             grep '{&mkw32errmap_marker' >$@
-@HAVE_W32CE_SYSTEM_TRUE@mkw32errmap.map.c: mkw32errmap
-@HAVE_W32CE_SYSTEM_TRUE@       ./mkw32errmap --map > $@
-@HAVE_W32CE_SYSTEM_TRUE@gpg-extra/errno.h: mkw32errmap
+@HAVE_W32CE_SYSTEM_TRUE@mkw32errmap.map.c: mkw32errmap$(EXEEXT_FOR_BUILD)
+@HAVE_W32CE_SYSTEM_TRUE@       ./mkw32errmap$(EXEEXT_FOR_BUILD) --map > $@
+@HAVE_W32CE_SYSTEM_TRUE@gpg-extra/errno.h: mkw32errmap$(EXEEXT_FOR_BUILD)
 @HAVE_W32CE_SYSTEM_TRUE@       -$(MKDIR_P) gpg-extra
-@HAVE_W32CE_SYSTEM_TRUE@       ./mkw32errmap > $@
+@HAVE_W32CE_SYSTEM_TRUE@       ./mkw32errmap$(EXEEXT_FOR_BUILD) > $@
 @HAVE_W32CE_SYSTEM_FALSE@mkw32errmap.map.c:
 @HAVE_W32CE_SYSTEM_FALSE@      echo "/*dummy*/" > $@
 
@@ -1309,39 +1730,54 @@ gpg-error.def: Makefile gpg-error.def.in
 
 # It is correct to use $(CC_FOR_BUILD) here.  We want to run the
 # program at build time.
-mkerrcodes: mkerrcodes.c mkerrcodes.h Makefile
-       $(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkerrcodes.c
+mkerrcodes$(EXEEXT_FOR_BUILD): mkerrcodes.c mkerrcodes.h Makefile
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \
+       $(CPPFLAGS_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkerrcodes.c
 
 # It is correct to use $(CC_FOR_BUILD) here.  We want to run the
 # program at build time.
-@HAVE_W32CE_SYSTEM_TRUE@mkw32errmap: mkw32errmap.c mkw32errmap.tab.h Makefile
-@HAVE_W32CE_SYSTEM_TRUE@       $(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkw32errmap.c
+@HAVE_W32CE_SYSTEM_TRUE@mkw32errmap$(EXEEXT_FOR_BUILD): mkw32errmap.c mkw32errmap.tab.h Makefile
+@HAVE_W32CE_SYSTEM_TRUE@       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \
+@HAVE_W32CE_SYSTEM_TRUE@       $(CPPFLAGS_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkw32errmap.c
 
-code-from-errno.h: mkerrcodes Makefile
-       ./mkerrcodes | $(AWK) -f $(srcdir)/mkerrcodes2.awk >$@
+code-from-errno.h: mkerrcodes$(EXEEXT_FOR_BUILD) Makefile
+       ./mkerrcodes$(EXEEXT_FOR_BUILD) | $(AWK) -f $(srcdir)/mkerrcodes2.awk >$@
 
 errnos-sym.h: Makefile mkstrtable.awk errnos.in
        $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \
-               -v prefix=GPG_ERR_ -v namespace=errnos_ \
+               -v prefix=GPG_ERR_ -v pkg_namespace=errnos_ \
                $(srcdir)/errnos.in >$@
 
-mkheader: mkheader.c Makefile
-       $(CC_FOR_BUILD) -g -O0 -I. -I$(srcdir) -o $@ $(srcdir)/mkheader.c
+mkheader$(EXEEXT_FOR_BUILD): mkheader.c Makefile
+       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \
+       $(CPPFLAGS_FOR_BUILD) -g -I. -I$(srcdir) -o $@ $(srcdir)/mkheader.c
 
-@FORCE_USE_SYSCFG_FALSE@./lock-obj-pub.native.h: Makefile gen-posix-lock-obj$(EXEEXT) posix-lock-obj.h
-@FORCE_USE_SYSCFG_FALSE@       ./gen-posix-lock-obj >$@
+@FORCE_USE_SYSCFG_FALSE@@HAVE_GENERATED_LOCK_OBJ_H_FALSE@./lock-obj-pub.native.h: Makefile gen-posix-lock-obj$(EXEEXT) posix-lock-obj.h
+@FORCE_USE_SYSCFG_FALSE@@HAVE_GENERATED_LOCK_OBJ_H_FALSE@      ./gen-posix-lock-obj >$@
 
 # We also depend on versioninfo.rc because that is build by
 # config.status and thus has up-to-date version numbers.
-gpg-error.h: Makefile mkheader $(parts_of_gpg_error_h) \
+gpg-error.h: Makefile mkheader$(EXEEXT_FOR_BUILD) $(parts_of_gpg_error_h) \
              versioninfo.rc ../config.h
        $(pre_mkheader_cmds)
-       ./mkheader $(host_os) $(host_triplet)  $(srcdir)/gpg-error.h.in \
+       ./mkheader$(EXEEXT_FOR_BUILD) $(mkheader_opts)       \
+                   $(host_triplet)  $(srcdir)/gpg-error.h.in \
                    ../config.h $(PACKAGE_VERSION) $(VERSION_NUMBER) >$@
 
 gpgrt.h: gpg-error.h
        cp gpg-error.h gpgrt.h
 
+gpg-error-config: gpgrt-config gpg-error-config-old
+       @echo $(ECHO_N) "Confirm gpg-error-config works... $(ECHO_C)"
+       @if ./gpg-error-config-test.sh --old-new; then \
+         echo "good";                                         \
+       else                                                   \
+         echo "no";                                           \
+         echo "***  Please report to <https://bugs.gnupg.org> with gpg-error-config-test.log"; \
+         exit 1; \
+       fi
+       cp gpg-error-config-old $@
+
 install-data-local:
 @HAVE_W32CE_SYSTEM_TRUE@       -$(MKDIR_P) "$(DESTDIR)$(includedir)/gpg-extra"
 @HAVE_W32CE_SYSTEM_TRUE@       $(INSTALL_DATA) gpg-extra/errno.h \
diff --git a/src/argparse.c b/src/argparse.c
new file mode 100644 (file)
index 0000000..a144881
--- /dev/null
@@ -0,0 +1,3446 @@
+/* argparse.c - Argument Parser for option handling
+ * Copyright (C) 1997-2001, 2006-2008, 2013-2017 Werner Koch
+ * Copyright (C) 1998-2001, 2006-2008, 2012 Free Software Foundation, Inc.
+ * Copyright (C) 2015-2021 g10 Code GmbH
+ *
+ * This file is part of Libgpg-error.
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ * This file was originally a part of GnuPG.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <stdarg.h>
+#include <limits.h>
+#include <errno.h>
+#include <unistd.h>
+#include <time.h>
+
+#include "gpgrt-int.h"
+
+#ifdef HAVE_W32_SYSTEM
+# define PATHSEP_C ';'
+# define DIRSEP_C  '\\'
+#else
+# define PATHSEP_C ':'
+# define DIRSEP_C  '/'
+#endif
+
+
+/* The malloced configuration directories or NULL.  */
+static struct
+{
+  char *user;
+  char *sys;
+} confdir;
+
+
+/* Hidden argparse flag used to mark the object as initialized.  */
+#define ARGPARSE_FLAG__INITIALIZED  (1u << ((8*SIZEOF_INT)-1))
+
+/* Special short options which are auto-inserterd.  Must fit into an
+ * unsigned short.  */
+#define ARGPARSE_SHORTOPT_HELP 32768
+#define ARGPARSE_SHORTOPT_VERSION 32769
+#define ARGPARSE_SHORTOPT_WARRANTY 32770
+#define ARGPARSE_SHORTOPT_DUMP_OPTIONS 32771
+#define ARGPARSE_SHORTOPT_DUMP_OPTTBL 32772
+
+
+/* The states for the gpgrt_argparser machinery.  */
+enum argparser_states
+  {
+   STATE_init = 0,
+   STATE_open_sys,
+   STATE_open_user,
+   STATE_open_cmdline,
+   STATE_read_sys,
+   STATE_read_user,
+   STATE_read_cmdline,
+   STATE_finished
+  };
+
+
+/* Object to store variables.  */
+struct variable_s
+{
+  struct variable_s *next;
+  char *value;  /* Malloced value - always a string.  NULL is not set.  */
+  char name[1]; /* Name of the variable.  */
+};
+typedef struct variable_s *variable_t;
+
+
+/* An internal object used to store the user provided option table and
+ * some meta information.  */
+typedef struct
+{
+  unsigned short short_opt;
+  unsigned short ordinal;     /* (for --help)  */
+  unsigned int   flags;
+  const char    *long_opt;    /* Points into the user provided table. */
+  const char    *description; /* Points into the user provided table. */
+  unsigned int   forced:1;    /* Forced to use the sysconf value.  */
+  unsigned int   ignore:1;    /* Ignore this option everywhere but in
+                               * the sysconf file.  */
+  unsigned int   explicit_ignore:1; /* Ignore was explicitly set.  */
+} opttable_t;
+
+
+/* Internal object of the public gpgrt_argparse_t object.  */
+struct _gpgrt_argparse_internal_s
+{
+  int idx;   /* Note that this is saved and restored in _gpgrt_argparser. */
+  int inarg;                       /* (index into args) */
+  unsigned int verbose:1;          /* Print diagnostics.                */
+  unsigned int stopped:1;          /* Option processing has stopped.    */
+  unsigned int in_sysconf:1;       /* Processing global config file.    */
+  unsigned int mark_forced:1;      /* Mark options as forced.           */
+  unsigned int mark_ignore:1;      /* Mark options as to be ignored.    */
+  unsigned int explicit_ignore:1;  /* Option has explicitly been set
+                                    * to ignore or unignore.  */
+  unsigned int ignore_all_seen:1;  /* [ignore-all] has been seen.       */
+  unsigned int user_seen:1;        /* A [user] has been seen.           */
+  unsigned int user_wildcard:1;    /* A [user *] has been seen.         */
+  unsigned int user_any_active:1;  /* Any user section was active.      */
+  unsigned int user_active:1;      /* User section active.              */
+  unsigned int expand:1;           /* Expand vars in option values.     */
+  unsigned int explicit_confopt:1; /* A conffile option has been given. */
+  char *explicit_conffile;         /* Malloced name of an explicit
+                                    * conffile. */
+  unsigned char if_cond;           /* Current if block index.           */
+  unsigned char if_active[7];      /* If state Indexed by IF_COND - 1.  */
+  variable_t vartbl;               /* List of variables.                */
+  char *username;                  /* Malloced current user name.       */
+  unsigned int opt_flags;          /* Current option flags.             */
+  enum argparser_states state;     /* State of the gpgrt_argparser.     */
+  const char *last;
+  void *aliases;
+  const void *cur_alias;
+  void *iio_list;
+  estream_t conffp;
+  char *confname;
+  opttable_t *opts;            /* Malloced option table.  */
+  unsigned int nopts;          /* Number of items in OPTS.  */
+};
+
+
+typedef struct alias_def_s *ALIAS_DEF;
+struct alias_def_s {
+    ALIAS_DEF next;
+    char *name;   /* malloced buffer with name, \0, value */
+    const char *value; /* ptr into name */
+};
+
+
+/* Object to store the names for the --ignore-invalid-option option.
+   This is a simple linked list.  */
+typedef struct iio_item_def_s *IIO_ITEM_DEF;
+struct iio_item_def_s
+{
+  IIO_ITEM_DEF next;
+  char name[1];      /* String with the long option name.  */
+};
+
+
+/* The almost always needed user handler for strusage.  */
+static const char *(*strusage_handler)( int ) = NULL;
+/* Optional handler to write strings.  See _gpgrt_set_usage_outfnc.  */
+static int (*custom_outfnc) (int, const char *);
+/* Optional handler to map strings.  See _gpgrt_set_fixed_string_mapper.  */
+static const char *(*fixed_string_mapper)(const char*);
+
+static int  set_opt_arg (gpgrt_argparse_t *arg, unsigned int flags, char *s);
+static void show_help (opttable_t *opts, unsigned int nopts,unsigned int flags);
+static void show_version (void);
+static void dump_option_table (gpgrt_argparse_t *arg);
+static int writestrings (int is_error, const char *string,
+                         ...) GPGRT_ATTR_SENTINEL(0);
+static int arg_parse (gpgrt_argparse_t *arg, gpgrt_opt_t *opts, int no_init);
+
+
+
+\f
+
+/* Return true if the native charset is utf-8.  */
+static int
+is_native_utf8 (void)
+{
+  static char result;
+
+  if (!result)
+    {
+      const char *p = _gpgrt_strusage (8);
+      if (!p || !*p || !strcmp (p, "utf-8"))
+        result = 1;
+      result |= 128;
+    }
+
+  return (result & 1);
+}
+
+
+static char *
+trim_spaces (char *str)
+{
+  char *string, *p, *mark;
+
+  string = str;
+  /* Find first non space character. */
+  for (p=string; *p && isspace (*(unsigned char*)p) ; p++)
+    ;
+  /* Move characters. */
+  for ((mark = NULL); (*string = *p); string++, p++)
+    if (isspace (*(unsigned char*)p))
+      {
+        if (!mark)
+          mark = string;
+      }
+    else
+      mark = NULL;
+  if (mark)
+    *mark = '\0' ;  /* Remove trailing spaces. */
+
+  return str ;
+}
+
+
+static const char *
+map_fixed_string (const char *string)
+{
+  return fixed_string_mapper? fixed_string_mapper (string) : string;
+}
+
+
+/* Write STRING and all following const char * arguments either to
+   stdout or, if IS_ERROR is set, to stderr.  The list of strings must
+   be terminated by a NULL.  */
+static int
+writestrings (int is_error, const char *string, ...)
+{
+  va_list arg_ptr;
+  const char *s;
+  int count = 0;
+
+  if (string)
+    {
+      s = string;
+      va_start (arg_ptr, string);
+      do
+        {
+          if (custom_outfnc)
+            custom_outfnc (is_error? 2:1, s);
+          else
+            _gpgrt_fputs (s, is_error? es_stderr : es_stdout);
+          count += strlen (s);
+        }
+      while ((s = va_arg (arg_ptr, const char *)));
+      va_end (arg_ptr);
+    }
+  return count;
+}
+
+
+static void
+flushstrings (int is_error)
+{
+  if (custom_outfnc)
+    custom_outfnc (is_error? 2:1, NULL);
+  else
+    _gpgrt_fflush (is_error? es_stderr : es_stdout);
+}
+
+
+static void
+deinitialize (gpgrt_argparse_t *arg)
+{
+  if (arg->internal)
+    {
+      variable_t v = arg->internal->vartbl;
+      variable_t vn;
+      while (v)
+        {
+          vn = v->next;
+          xfree (v->value);
+          xfree (v);
+          v = vn;
+        }
+      xfree (arg->internal->username);
+      xfree (arg->internal->explicit_conffile);
+      xfree (arg->internal->opts);
+      xfree (arg->internal);
+      arg->internal = NULL;
+    }
+
+  arg->flags &= ARGPARSE_FLAG__INITIALIZED;
+  arg->lineno = 0;
+  arg->err = 0;
+}
+
+/* Our own exit handler to clean up used memory.  */
+static void
+my_exit (gpgrt_argparse_t *arg, int code)
+{
+  deinitialize (arg);
+  exit (code);
+}
+
+
+static gpg_err_code_t
+initialize (gpgrt_argparse_t *arg, gpgrt_opt_t *opts, estream_t fp)
+{
+  /* We use a dedicated flag to detect whether *ARG has been
+   * initialized.  This is because the old version of that struct, as
+   * used in GnuPG, had no requirement to zero out all fields of the
+   * object and existing code still sets only argc,argv and flags.  */
+  if (!(arg->flags & ARGPARSE_FLAG__INITIALIZED)
+      || (arg->flags & ARGPARSE_FLAG_RESET)
+      || !arg->internal)
+    {
+      /* Allocate internal data.  */
+      if (!(arg->flags & ARGPARSE_FLAG__INITIALIZED) || !arg->internal)
+        {
+          arg->internal = xtrymalloc (sizeof *arg->internal);
+          if (!arg->internal)
+            return _gpg_err_code_from_syserror ();
+          arg->flags |= ARGPARSE_FLAG__INITIALIZED; /* Mark as initialized.  */
+        }
+      else if (arg->internal->opts)
+        xfree (arg->internal->opts);
+      arg->internal->opts = NULL;
+      arg->internal->nopts = 0;
+
+      /* Initialize this instance. */
+      arg->internal->idx = 0;
+      arg->internal->last = NULL;
+      arg->internal->inarg = 0;
+      arg->internal->stopped = 0;
+      arg->internal->in_sysconf = 0;
+      arg->internal->user_seen = 0;
+      arg->internal->user_wildcard = 0;
+      arg->internal->user_any_active = 0;
+      arg->internal->user_active = 0;
+      arg->internal->if_cond = 0;
+      arg->internal->vartbl = NULL;
+      arg->internal->username = NULL;
+      arg->internal->mark_forced = 0;
+      arg->internal->mark_ignore = 0;
+      arg->internal->explicit_ignore = 0;
+      arg->internal->ignore_all_seen = 0;
+      arg->internal->expand = 0;
+      arg->internal->explicit_confopt = 0;
+      arg->internal->explicit_conffile = NULL;
+      arg->internal->opt_flags = 0;
+      arg->internal->state = STATE_init;
+      arg->internal->aliases = NULL;
+      arg->internal->cur_alias = NULL;
+      arg->internal->iio_list = NULL;
+      arg->internal->conffp = NULL;
+      arg->internal->confname = NULL;
+
+      /* Clear the copy of the option list.  */
+      /* Clear the error indicator.  */
+      arg->err = 0;
+
+      /* Usually an option file will be parsed from the start.
+       * However, we do not open the stream and thus we have no way to
+       * know the current lineno.  Using this flag we can allow the
+       * user to provide a lineno which we don't reset.  */
+      if (fp || arg->internal->conffp || !(arg->flags & ARGPARSE_FLAG_NOLINENO))
+        arg->lineno = 0;
+
+      /* Need to clear the reset request.  */
+      arg->flags &= ~ARGPARSE_FLAG_RESET;
+
+      /* Check initial args.  */
+      if ( *arg->argc < 0 )
+        _gpgrt_log_bug ("invalid argument passed to gpgrt_argparse\n");
+
+    }
+
+  /* Create an array with pointers to the provided list of options.
+   * Keeping a copy is useful to sort that array and thus do a binary
+   * search and to allow for extra space at the end to insert the
+   * hidden options.  An ARGPARSE_FLAG_RESET can be used to reinit
+   * this array.  */
+  if (!arg->internal->opts)
+    {
+      int seen_help = 0;
+      int seen_version = 0;
+      int seen_warranty = 0;
+      int seen_dump_options = 0;
+      int seen_dump_option_table = 0;
+      int i;
+
+      for (i=0; opts[i].short_opt; i++)
+        {
+          if (opts[i].long_opt)
+            {
+              if (!strcmp(opts[i].long_opt, "help"))
+                seen_help = 1;
+              else if (!strcmp(opts[i].long_opt, "version"))
+                seen_version = 1;
+              else if (!strcmp(opts[i].long_opt, "warranty"))
+                seen_warranty = 1;
+              else if (!strcmp(opts[i].long_opt, "dump-options"))
+                seen_dump_options = 1;
+              else if (!strcmp(opts[i].long_opt, "dump-option-table"))
+                seen_dump_option_table = 1;
+            }
+        }
+      i += 5; /* The number of the above internal options.  */
+      i++;    /* End of list marker.  */
+      arg->internal->opts = xtrycalloc (i, sizeof *arg->internal->opts);
+      if (!arg->internal->opts)
+        return _gpg_err_code_from_syserror ();
+      for(i=0; opts[i].short_opt; i++)
+        {
+          arg->internal->opts[i].short_opt   = opts[i].short_opt;
+          arg->internal->opts[i].flags       = opts[i].flags;
+          arg->internal->opts[i].long_opt    = opts[i].long_opt;
+          arg->internal->opts[i].description = opts[i].description;
+          arg->internal->opts[i].ordinal = i;
+        }
+
+      if (!seen_help)
+        {
+          arg->internal->opts[i].short_opt   = ARGPARSE_SHORTOPT_HELP;
+          arg->internal->opts[i].flags       = ARGPARSE_TYPE_NONE;
+          arg->internal->opts[i].long_opt    = "help";
+          arg->internal->opts[i].description = "@";
+          arg->internal->opts[i].ordinal = i;
+          i++;
+        }
+      if (!seen_version)
+        {
+          arg->internal->opts[i].short_opt   = ARGPARSE_SHORTOPT_VERSION;
+          arg->internal->opts[i].flags       = ARGPARSE_TYPE_NONE;
+          arg->internal->opts[i].long_opt    = "version";
+          arg->internal->opts[i].description = "@";
+          arg->internal->opts[i].ordinal = i;
+          i++;
+        }
+
+      if (!seen_warranty)
+        {
+          arg->internal->opts[i].short_opt   = ARGPARSE_SHORTOPT_WARRANTY;
+          arg->internal->opts[i].flags       = ARGPARSE_TYPE_NONE;
+          arg->internal->opts[i].long_opt    = "warranty";
+          arg->internal->opts[i].description = "@";
+          arg->internal->opts[i].ordinal = i;
+          i++;
+        }
+
+      if (!seen_dump_option_table)
+        {
+          arg->internal->opts[i].short_opt   = ARGPARSE_SHORTOPT_DUMP_OPTTBL;
+          arg->internal->opts[i].flags       = ARGPARSE_TYPE_NONE;
+          arg->internal->opts[i].long_opt    = "dump-option-table";
+          arg->internal->opts[i].description = "@";
+          arg->internal->opts[i].ordinal = i;
+          i++;
+        }
+
+      if (!seen_dump_options)
+        {
+          arg->internal->opts[i].short_opt   = ARGPARSE_SHORTOPT_DUMP_OPTIONS;
+          arg->internal->opts[i].flags       = ARGPARSE_TYPE_NONE;
+          arg->internal->opts[i].long_opt    = "dump-options";
+          arg->internal->opts[i].description = "@";
+          arg->internal->opts[i].ordinal = i;
+          i++;
+        }
+      /* Take care: When adding new options remember to increase the
+       * size of the array.  */
+
+      arg->internal->opts[i].short_opt = 0;
+
+      /* Note that we do not count the end marker but keep it in the
+       * table anyway as an extra item.  */
+      arg->internal->nopts = i;
+    }
+
+  if (arg->err)
+    {
+      /* Last option was erroneous.  */
+      const char *s;
+
+      if (!fp && arg->internal->conffp)
+        fp = arg->internal->conffp;
+
+      if (fp)
+        {
+          if ( arg->r_opt == ARGPARSE_UNEXPECTED_ARG )
+            s = _("argument not expected");
+          else if ( arg->r_opt == ARGPARSE_READ_ERROR )
+            s = _("read error");
+          else if ( arg->r_opt == ARGPARSE_KEYWORD_TOO_LONG )
+            s = _("keyword too long");
+          else if ( arg->r_opt == ARGPARSE_MISSING_ARG )
+            s = _("missing argument");
+          else if ( arg->r_opt == ARGPARSE_INVALID_ARG )
+            s = _("invalid argument");
+          else if ( arg->r_opt == ARGPARSE_INVALID_COMMAND )
+            s = _("invalid command");
+          else if ( arg->r_opt == ARGPARSE_INVALID_ALIAS )
+            s = _("invalid alias definition");
+          else if ( arg->r_opt == ARGPARSE_PERMISSION_ERROR )
+            s = _("permission error");
+          else if ( arg->r_opt == ARGPARSE_OUT_OF_CORE )
+            s = _("out of core");
+          else if ( arg->r_opt == ARGPARSE_NO_CONFFILE )
+            s = NULL;  /* Error has already been printed.  */
+          else if ( arg->r_opt == ARGPARSE_INVALID_META )
+            s = _("invalid meta command");
+          else if ( arg->r_opt == ARGPARSE_UNKNOWN_META )
+            s = _("unknown meta command");
+          else if ( arg->r_opt == ARGPARSE_UNEXPECTED_META )
+            s = _("unexpected meta command");
+          else
+            s = _("invalid option");
+          if (s)
+            _gpgrt_log_error ("%s:%u: %s\n",
+                              _gpgrt_fname_get (fp), arg->lineno, s);
+       }
+      else
+        {
+          s = arg->internal->last? arg->internal->last:"[??]";
+
+          if ( arg->r_opt == ARGPARSE_MISSING_ARG )
+            _gpgrt_log_error (_("missing argument for option \"%.50s\"\n"), s);
+          else if ( arg->r_opt == ARGPARSE_INVALID_ARG )
+            _gpgrt_log_error (_("invalid argument for option \"%.50s\"\n"), s);
+          else if ( arg->r_opt == ARGPARSE_UNEXPECTED_ARG )
+            _gpgrt_log_error (_("option \"%.50s\" does not expect "
+                                "an argument\n"), s);
+          else if ( arg->r_opt == ARGPARSE_INVALID_COMMAND )
+            _gpgrt_log_error (_("invalid command \"%.50s\"\n"), s);
+          else if ( arg->r_opt == ARGPARSE_AMBIGUOUS_OPTION )
+            _gpgrt_log_error (_("option \"%.50s\" is ambiguous\n"), s);
+          else if ( arg->r_opt == ARGPARSE_AMBIGUOUS_COMMAND )
+            _gpgrt_log_error (_("command \"%.50s\" is ambiguous\n"),s );
+          else if ( arg->r_opt == ARGPARSE_OUT_OF_CORE )
+            _gpgrt_log_error ("%s\n", _("out of core"));
+          else if ( arg->r_opt == ARGPARSE_PERMISSION_ERROR )
+            _gpgrt_log_error ("%s\n", _("permission error"));
+          else if ( arg->r_opt == ARGPARSE_NO_CONFFILE)
+            ;  /* Error has already been printed.  */
+          else if ( arg->r_opt == ARGPARSE_INVALID_META )
+            _gpgrt_log_error ("%s\n", _("invalid meta command"));
+          else if ( arg->r_opt == ARGPARSE_UNKNOWN_META )
+            _gpgrt_log_error ("%s\n", _("unknown meta command"));
+          else if ( arg->r_opt == ARGPARSE_UNEXPECTED_META )
+            _gpgrt_log_error ("%s\n",_("unexpected meta command"));
+          else
+            _gpgrt_log_error (_("invalid option \"%.50s\"\n"), s);
+       }
+      if (arg->err != ARGPARSE_PRINT_WARNING)
+        my_exit (arg, 2);
+      arg->err = 0;
+    }
+
+  /* Zero out the return value union.  */
+  arg->r.ret_str = NULL;
+  arg->r.ret_long = 0;
+
+  return 0;
+}
+
+
+static void
+store_alias( gpgrt_argparse_t *arg, char *name, char *value )
+{
+    /* TODO: replace this dummy function with a rea one
+     * and fix the probelms IRIX has with (ALIAS_DEV)arg..
+     * used as lvalue
+     */
+  (void)arg;
+  (void)name;
+  (void)value;
+#if 0
+    ALIAS_DEF a = xmalloc( sizeof *a );
+    a->name = name;
+    a->value = value;
+    a->next = (ALIAS_DEF)arg->internal->aliases;
+    (ALIAS_DEF)arg->internal->aliases = a;
+#endif
+}
+
+
+/* Return true if KEYWORD is in the ignore-invalid-option list.  */
+static int
+ignore_invalid_option_p (gpgrt_argparse_t *arg, const char *keyword)
+{
+  IIO_ITEM_DEF item = arg->internal->iio_list;
+
+  for (; item; item = item->next)
+    if (!strcmp (item->name, keyword))
+      return 1;
+  return 0;
+}
+
+
+/* Add the keywords up to the next LF to the list of to be ignored
+   options.  After returning FP will either be at EOF or the next
+   character read wll be the first of a new line.  The function
+   returns 0 on success or true on malloc failure.  */
+static int
+ignore_invalid_option_add (gpgrt_argparse_t *arg, estream_t fp)
+{
+  IIO_ITEM_DEF item;
+  int c;
+  char name[100];
+  int namelen = 0;
+  int ready = 0;
+  enum { skipWS, collectNAME, skipNAME, addNAME} state = skipWS;
+
+  while (!ready)
+    {
+      c = _gpgrt_fgetc (fp);
+      if (c == '\n')
+        ready = 1;
+      else if (c == EOF)
+        {
+          c = '\n';
+          ready = 1;
+        }
+    again:
+      switch (state)
+        {
+        case skipWS:
+          if (!isascii (c) || !isspace(c))
+            {
+              namelen = 0;
+              state = collectNAME;
+              goto again;
+            }
+          break;
+
+        case collectNAME:
+          if (isspace (c))
+            {
+              state = addNAME;
+              goto again;
+            }
+          else if (namelen < DIM(name)-1)
+            name[namelen++] = c;
+          else /* Too long.  */
+            state = skipNAME;
+          break;
+
+        case skipNAME:
+          if (isspace (c))
+            {
+              state = skipWS;
+              goto again;
+            }
+          break;
+
+        case addNAME:
+          name[namelen] = 0;
+          if (!ignore_invalid_option_p (arg, name))
+            {
+              item = xtrymalloc (sizeof *item + namelen);
+              if (!item)
+                return 1;
+              strcpy (item->name, name);
+              item->next = (IIO_ITEM_DEF)arg->internal->iio_list;
+              arg->internal->iio_list = item;
+            }
+          state = skipWS;
+          goto again;
+        }
+    }
+  return 0;
+}
+
+
+/* Clear the entire ignore-invalid-option list.  */
+static void
+ignore_invalid_option_clear (gpgrt_argparse_t *arg)
+{
+  IIO_ITEM_DEF item, tmpitem;
+
+  for (item = arg->internal->iio_list; item; item = tmpitem)
+    {
+      tmpitem = item->next;
+      xfree (item);
+    }
+  arg->internal->iio_list = NULL;
+}
+
+
+/* Make sure the username field is filled.  Return 0 on success.  */
+static int
+assure_username (gpgrt_argparse_t *arg)
+{
+  if (!arg->internal->username)
+    {
+      arg->internal->username = _gpgrt_getusername ();
+      if (!arg->internal->username)
+        {
+          _gpgrt_log_error ("%s:%u: error getting current user's name: %s\n",
+                            arg->internal->confname, arg->lineno,
+                            _gpg_strerror (gpg_error_from_syserror ()));
+          /* Not necessary the correct error code but given that we
+           * either have a malloc error or some internal system error,
+           * it is the best we can do.  */
+          return ARGPARSE_PERMISSION_ERROR;
+        }
+    }
+  return 0;
+}
+
+
+/* Return the value of the variable NAME from the context ARG.  May
+ * return NULL.  NUMBUF needs to be caller provided buffer used by
+ * this function to return numeric values as string.  */
+static const char *
+get_var (gpgrt_argparse_t *arg, const char *name,
+         char *numbuf, size_t numbufsize)
+{
+  if (!name || !*name)
+    return NULL;
+  if (arg)
+    {
+      if (name[0] == '_') /* system variables.  */
+        {
+          name++;
+          if (!*name)
+            return " "; /* Just a space.  */
+          else if (!strcmp (name, "verbose"))
+            return arg->internal->verbose ? "1":"";
+          else if (!strcmp (name, "user"))
+            {
+              assure_username (arg);
+              return arg->internal->username;
+            }
+          else if (!strcmp (name, "file"))
+            return arg->internal->confname;
+          else if (!strcmp (name, "line"))
+            {
+              snprintf (numbuf, numbufsize, "%u", arg->lineno);
+              return numbuf;
+            }
+          else if (!strcmp (name, "epoch"))
+            {
+              snprintf (numbuf, numbufsize, "%lu",  (unsigned long)time (NULL));
+              return numbuf;
+            }
+          else if (!strcmp (name, "windows"))
+#if HAVE_W32_SYSTEM
+            return "1";
+#else
+            return "";
+#endif
+          else if (!strcmp (name, "version"))
+            return _gpgrt_strusage (13);
+          else if (!strcmp (name, "pgm"))
+            return _gpgrt_strusage (11);
+          else if (!strcmp (name, "gpgrtversion"))
+            return PACKAGE_VERSION;
+          else if (!strncmp (name, "strusage", 8 ))
+            return _gpgrt_strusage (atoi (name+8));
+          else
+            return NULL;  /* Unknown system variable.  */
+        }
+      else
+        {
+          variable_t v;
+          for (v = arg->internal->vartbl; v; v = v->next)
+            if (!strcmp (v->name, name))
+              return v->value;
+          return NULL; /* Unknown variable.  */
+        }
+    }
+  else
+    return getenv (name);
+}
+
+
+/* Substitute environment variables in STRING and return a new string.
+ * ARG is the context; if ARG is NULL the environment variable with
+ * the same name is looked up.  On error the function returns NULL.  */
+static char *
+substitute_vars (gpgrt_argparse_t *arg, const char *string)
+{
+  char *line, *p, *pend;
+  const char *value;
+  size_t valuelen, n;
+  char *result = NULL;
+  char numbuf[35];
+
+  result = line = xtrystrdup (string);
+  if (!result)
+    return NULL; /* Ooops */
+
+  while (*line)
+    {
+      p = strchr (line, '$');
+      if (!p)
+        goto leave; /* No or no more variables.  */
+
+      if (p[1] == '$') /* Escaped dollar sign. */
+        {
+          memmove (p, p+1, strlen (p+1)+1);
+          line = p + 1;
+          continue;
+        }
+
+      if (p[1] == '{')
+        {
+          int count = 0;
+
+          for (pend=p+2; *pend; pend++)
+            {
+              if (*pend == '{')
+                count++;
+              else if (*pend == '}')
+                {
+                  if (--count < 0)
+                    break;
+                }
+            }
+          if (!*pend)
+            goto leave; /* Unclosed - don't substitute.  */
+        }
+      else
+        {
+          for (pend = p+1; (*pend && isascii (*p)
+                            && (isalnum (*pend) || *pend == '_')); pend++)
+            ;
+        }
+
+      if (p[1] == '{' && *pend == '}')
+        {
+          int save = *pend;
+          *pend = 0;
+          value = get_var (arg, p+2, numbuf, sizeof numbuf);
+          *pend++ = save;
+        }
+      else
+        {
+          int save = *pend;
+          *pend = 0;
+          value = get_var (arg, p+1, numbuf, sizeof numbuf);
+          *pend = save;
+        }
+
+      if (!value)
+        value = "";
+      valuelen = strlen (value);
+      if (valuelen <= pend - p)
+        {
+          memcpy (p, value, valuelen);
+          p += valuelen;
+          n = pend - p;
+          if (n)
+            memmove (p, p+n, strlen (p+n)+1);
+          line = p;
+        }
+      else
+        {
+          char *src = result;
+          char *dst;
+
+          dst = xtrymalloc (strlen (src) + valuelen + 1);
+          if (!dst)
+            {
+              xfree (result);
+              return NULL;
+            }
+          n = p - src;
+          memcpy (dst, src, n);
+          memcpy (dst + n, value, valuelen);
+          n += valuelen;
+          strcpy (dst + n, pend);
+          line = dst + n;
+          xfree (result);
+          result = dst;
+        }
+    }
+
+ leave:
+  return result;
+}
+
+
+/* Set variable NAME to VALUE or clear it if VALUE is NULL. */
+static int
+set_variable (gpgrt_argparse_t *arg, const char *name, const char *value,
+              int subst)
+{
+  char *string;
+  variable_t v;
+
+  if (value)
+    {
+      if (subst)
+        string = substitute_vars (arg, value);
+      else
+        string = xtrystrdup (value);
+      if (!string)
+        return ARGPARSE_OUT_OF_CORE;
+    }
+  else
+    string = NULL;
+
+  for (v = arg->internal->vartbl; v; v = v->next)
+    if (!strcmp (v->name, name))
+      break;
+  if (!v)
+    {
+      v = xtrymalloc (sizeof *v + strlen (name));
+      if (!v)
+        {
+          xfree (string);
+          return ARGPARSE_OUT_OF_CORE;
+        }
+      strcpy (v->name, name);
+      v->next = arg->internal->vartbl;
+      arg->internal->vartbl = v;
+    }
+  else
+    xfree (v->value);
+  v->value = string;
+
+  return 0;
+}
+
+
+/* Implementation of the "user" command.  ARG is the context.  ARGS is
+ * a non-empty string which this function is allowed to modify.  */
+static int
+handle_meta_user (gpgrt_argparse_t *arg, unsigned int alternate, char *args)
+{
+  int rc;
+
+  (void)alternate;
+
+  rc = assure_username (arg);
+  if (rc)
+    return rc;
+
+  arg->internal->user_seen = 1;
+  if (*args == '*' && !args[1])
+    {
+      arg->internal->user_wildcard = 1;
+      arg->internal->user_active = !arg->internal->user_any_active;
+    }
+  else if (arg->internal->user_wildcard)
+    {
+      /* All other user statements are ignored after a wildcard.  */
+      arg->internal->user_active = 0;
+    }
+  else if (!strcasecmp (args, arg->internal->username))
+    {
+      arg->internal->user_any_active = 1;
+      arg->internal->user_active = 1;
+    }
+  else
+    {
+      arg->internal->user_active = 0;
+    }
+
+  return 0;
+}
+
+
+/* Implementation of the "if" command.  ARG is the context.  ARGS is a
+ * non-empty string which this function is allowed to modify.  If
+ * ALTERNATE is set no args are expected but the last if shall be
+ * closed.  Note that an some meta commands do an implicit "fi" but
+ * print a warning.  Command syntax (two forms):
+ *   [if<ws>STRING<ws>]
+ *   [if<ws>STRING<ws>OP<ws>STRING2<ws>]
+ * The abbreviated first form is an alias for
+ *    [if<ws>STRING<ws>-n]
+ * STRING2 may contains spaces but STRING1 may not.  Both are
+ * expanded.  Examples:
+ *   [if $name ]
+ *   [if $name = Scottie ]
+ *   [if $name = $foo ]
+ * Supported operators are
+ *   =   The full string must match
+ *   <>  The full string must not match
+ *   =~  String 1 must have String2 as a substring.
+ *   !~  String 1 must not have String2 as a substring.
+ *   -le String1 must be less or equal than String2.
+ *   -lt String1 must be less than String2.
+ *   -gt String1 must be greater than String2.
+ *   -ge String1 must be greater or equal than String2.
+ *   -v3le Version string1 must be less or equal than version string2.
+ *   -v3lt Version string1 must be less than version string2.
+ *   -v3gt Version string1 must be greater than version string2.
+ *   -v3ge version string1 must be greater or equal than version string2.
+ *   ==  The numerical values must match
+ *   !=  The numerical values must not match
+ *   <=  The numerical values must be LE than the value.
+ *   <   The numerical values must be LT than the value.
+ *   >=  The numerical values must be GT than the value.
+ *   >=  The numerical values must be GE than the value.
+ *   -n  True if value is not empty (STRING2 not allowed).
+ *   -z  True if value is empty (STRING2 not allowed).
+ */
+static int
+handle_meta_if (gpgrt_argparse_t *arg, unsigned int alternate, char *args)
+{
+  int rc;
+  char *str1 = args;
+  char *op = NULL;
+  char *str2 = NULL;
+  char *p;
+  unsigned int idx;
+  int result;
+  int active;
+
+  idx = arg->internal->if_cond;
+
+  active = (idx && arg->internal->if_active[idx-1]);
+
+  if (alternate) /* command [fi] or [else] */
+    {
+      if (!idx)
+        _gpgrt_log_info ("%s:%u: not in a conditional block; \"%s\" ignored\n",
+                         arg->internal->confname, arg->lineno,
+                         alternate == 1? "fi":"else");
+      else
+        {
+          if (alternate == 1) /* [fi] */
+            arg->internal->if_cond--;
+          else if (!active) /* [else] in an inactive branch */
+            arg->internal->if_active[idx-1] = 0;
+          else /* [else] */
+            arg->internal->if_active[idx-1] = !arg->internal->if_active[idx-1];
+        }
+      return 0;
+    }
+  if (idx == sizeof (arg->internal->if_active) )
+    {
+      _gpgrt_log_info ("%s:%u: too deeply nested condition\n",
+                       arg->internal->confname, arg->lineno);
+      return ARGPARSE_UNEXPECTED_META;
+    }
+
+  if (idx && !active)
+    {
+      /* Not an active branch and thus no need to evaluate the [if].  */
+      arg->internal->if_cond++;
+      arg->internal->if_active[arg->internal->if_cond-1] = 0;
+      return 0;
+    }
+
+  for (p = str1; *p && !(isascii (*p) && isspace (*p)); p++)
+    ;
+  if (*p)
+    {
+      *p++ = 0;
+      for (; *p && isascii (*p) && isspace (*p); p++)
+        ;
+      op = p;
+      for (; *p && !(isascii (*p) && isspace (*p)); p++)
+        ;
+      if (*p)
+        {
+          *p++ = 0;
+          for (; *p && isascii (*p) && isspace (*p); p++)
+            ;
+          if (*p)
+            str2 = p;
+        }
+    }
+
+  str1 = substitute_vars (arg, str1);
+  if (!str1)
+    return ARGPARSE_OUT_OF_CORE;
+  if (str2)
+    {
+      str2 = substitute_vars (arg, str2);
+      if (!str2)
+        {
+          xfree (str1);
+          return ARGPARSE_OUT_OF_CORE;
+        }
+    }
+  if (!op || !*op)
+    op = "-n";
+
+  /* Check for second expression.  */
+  if (!strcmp (op, "-n") || !strcmp (op, "-z"))
+    {
+      if (str2)
+        {
+          rc = ARGPARSE_INVALID_META;
+          goto leave;
+        }
+    }
+  else if (!str2)
+    {
+      rc = ARGPARSE_INVALID_META;
+      goto leave;
+    }
+
+  /* Evaluate */
+  result = 0;
+  if (!strcmp (op, "-n"))
+    {
+      if (*str1)
+        result = 1;
+    }
+  else if (!strcmp (op, "-z"))
+    {
+      if (!*str1)
+        result = 1;
+    }
+  else if (!strcmp (op, "="))
+    result = !strcmp (str1, str2);
+  else if (!strcmp (op, "<>"))
+    result = !!strcmp (str1, str2);
+  else if (!strcmp (op, "=~"))
+    result = !!strstr (str1, str2);
+  else if (!strcmp (op, "!~"))
+    result = !strstr (str1, str2);
+  else if (!strcmp (op, "-le"))
+    result = (strcmp (str1, str2) <= 0);
+  else if (!strcmp (op, "-lt"))
+    result = (strcmp (str1, str2) < 0);
+  else if (!strcmp (op, "-gt"))
+    result = (strcmp (str1, str2) > 0);
+  else if (!strcmp (op, "-ge"))
+    result = (strcmp (str1, str2) >= 0);
+  else if (!strncmp (op, "-v3", 3) || !strncmp (op, "-v2", 3))
+    {
+      /* This is for a major.minor[.micro] version numbering scheme with
+       * ignored patchlevel.  */
+      result = _gpgrt_cmp_version (str1, str2, op[2] == '3'? 13 : 12);
+      if (!strcmp (op+3, "le"))
+        result = (result <= 0);
+      else if (!strcmp (op+3, "lt"))
+        result = (result < 0);
+      else if (!strcmp (op+3, "gt"))
+        result = (result > 0);
+      else if (!strcmp (op+3, "ge"))
+        result = (result >= 0);
+      else
+        {
+          rc = ARGPARSE_INVALID_META;
+          goto leave;
+        }
+    }
+  else
+    {
+      long num1, num2;
+
+      num1 = strtol (str1, NULL, 0);
+      num2 = strtol (str2, NULL, 0);
+
+      if (!strcmp (op, "=="))
+        result = (num1 == num2);
+      else if (!strcmp (op, "!="))
+        result = (num1 != num2);
+      else if (!strcmp (op, "<="))
+        result = (num1 <= num2);
+      else if (!strcmp (op, "<"))
+        result = (num1 < num2);
+      else if (!strcmp (op, ">"))
+        result = (num1 > num2);
+      else if (!strcmp (op, ">="))
+        result = (num1 >= num2);
+      else
+        {
+          rc = ARGPARSE_INVALID_META;
+          goto leave;
+        }
+    }
+
+  arg->internal->if_cond++;
+  arg->internal->if_active[arg->internal->if_cond-1] = result;
+  rc = 0;
+
+ leave:
+  xfree (str1);
+  xfree (str2);
+  return rc;
+}
+
+
+/* Implementation of the "let" command.  ARG is the context.  ARGS is
+ * a non-empty string which this function is allowed to modify.  If
+ * ALTERNATE is set the named variable (with name "*" all variables)
+ * are cleared.  Command syntax:
+ *   [let<ws>NAME<ws>VALUE_STRING<ws>]
+ * For example
+ *   [let user  Montgomery Scott  ]
+ *   [let foo   The name of the user is: "$user".$_ ]
+ * sets the variable "user" to
+ *   ->The name of the user is: "Montgomery Scott". <-
+ *
+ * NAME needs to start with a letter; names starting with an
+ * underscore are reserved.  Note the use of $_ which is substituted
+ * by a space.  This is needed for leading or trailing spaces.
+ */
+static int
+handle_meta_let (gpgrt_argparse_t *arg, unsigned int alternate, char *args)
+{
+  char *name = args;
+  char *value;
+  int rc;
+  variable_t v;
+
+  for (value = name; *value && !(isascii (*value) && isspace (*value)); value++)
+    ;
+  if (*value)
+    {
+      *value++ = 0;
+      trim_spaces (value);
+    }
+
+  if (!isascii (*name) || !isalpha (*name))
+    return 0; /* Ignore setting a system or invalid variable.  */
+
+  if (alternate)
+    value = NULL;
+
+  if (name[0] == '*' && !name[1])  /* Clear all variables.  */
+    {
+      if (!alternate)
+        rc = 0; /* Ignore setting variable name "*".  */
+      else
+        {
+          for (v = arg->internal->vartbl; v; v = v->next)
+            {
+              xfree (v->value);
+              v->value = NULL;
+            }
+          rc = 0;
+        }
+    }
+  else /* Set variable or clear if VALUE is NULL.  */
+    rc = set_variable (arg, name, value, 1);
+
+  return rc;
+}
+
+
+/* Implementation of the "getenv" and, if ALTERNATE is set, the
+ * "getreg" command.  ARG is the context.  ARGS is a non-empty string
+ * with the name of the variable and of the envvar/registry-entry.
+ * The syntax is similar to [let].  "getenv" reads from the
+ * environment; "getreg" reads from the Windows registry.  */
+static int
+handle_meta_getenv (gpgrt_argparse_t *arg, unsigned int alternate, char *args)
+{
+  char *name = args;
+  char *varname;
+  const char *s;
+  int rc;
+#ifdef HAVE_W32_SYSTEM
+  char *helpbuf = NULL;
+#endif
+
+  for (varname = name;
+       *varname && !(isascii (*varname) && isspace (*varname));
+       varname++)
+    ;
+  if (*varname)
+    {
+      *varname++ = 0;
+      trim_spaces (varname);
+    }
+
+  if (!isascii (*name) || !isalpha (*name))
+    return 0; /* Ignore setting a system or invalid variable.  */
+
+  if (!*varname)
+    return 0; /* Ignore empty environment names.  */
+
+  if (alternate)
+    {
+#ifdef HAVE_W32_SYSTEM
+      s = helpbuf = _gpgrt_w32_reg_get_string (varname);
+#else
+      s = "";
+#endif
+    }
+  else
+    s = getenv (varname);
+
+  /* Set/clear the variable but do not substitute.  */
+  rc = set_variable (arg, name, s, 0);
+#ifdef HAVE_W32_SYSTEM
+  xfree (helpbuf);
+#endif
+  return rc;
+}
+
+
+/* Implementation of the "force" command.  ARG is the context.  A
+ * value of 0 for ALTERNATE is "force", a value of 1 requests an
+ * unforce".  ARGS is the empty string and not used.  */
+static int
+handle_meta_force (gpgrt_argparse_t *arg, unsigned int alternate, char *args)
+{
+  (void)args;
+
+  arg->internal->mark_forced = alternate? 0 : 1;
+
+  return 0;
+}
+
+
+/* Implementation of the "ignore" command.  ARG is the context.  A
+ * value of 0 for ALTERNATE is a plain "ignore", a value of 1 request
+ * an "unignore, a value of 2 requests an "ignore-all".  ARGS is the
+ * empty string and not used.  */
+static int
+handle_meta_ignore (gpgrt_argparse_t *arg, unsigned int alternate, char *args)
+{
+  (void)args;
+
+  if (!alternate)
+    {
+      arg->internal->mark_ignore = 1;
+      arg->internal->explicit_ignore = 1;
+    }
+  else if (alternate == 1)
+    {
+      arg->internal->mark_ignore = 0;
+      arg->internal->explicit_ignore = 1;
+    }
+  else
+    arg->internal->ignore_all_seen = 1;
+
+  return 0;
+}
+
+
+/* Implementation of the "echo" command.  ARG is the context.  If
+ * ALTERNATE is true the filename is not printed.  ARGS is the string
+ * to log.  */
+static int
+handle_meta_echo (gpgrt_argparse_t *arg, unsigned int alternate, char *args)
+{
+  char *string;
+
+  string = substitute_vars (arg, args);
+  if (!string)
+    return ARGPARSE_OUT_OF_CORE;
+
+  if (alternate)
+    _gpgrt_log_info ("%s\n", string);
+  else
+    _gpgrt_log_info ("%s:%u: %s\n",
+                     arg->internal->confname, arg->lineno, string);
+  return 0;
+}
+
+
+/* Implementation of the "verbose" command.  ARG is the context.  If
+ * ALTERNATE is true the verbosity is disabled.  ARGS is not used.  */
+static int
+handle_meta_verbose (gpgrt_argparse_t *arg, unsigned int alternate, char *args)
+{
+  (void)args;
+
+  if (alternate)
+    arg->internal->verbose = 0;
+  else
+    arg->internal->verbose = 1;
+  return 0;
+}
+
+
+/* Implementation of the "expand" command.  ARG is the context.  If
+ * ALTERNATE is true expand is reset.  ARGS is not used.  */
+static int
+handle_meta_expand (gpgrt_argparse_t *arg, unsigned int alternate, char *args)
+{
+  (void)args;
+
+  if (alternate)
+    arg->internal->expand = 0;
+  else
+    arg->internal->expand = 1;
+  return 0;
+}
+
+/* Handle a meta command.  KEYWORD has the content inside the brackets
+ * with leading and trailing spaces removed.  The function may modify
+ * KEYWORD.  On success 0 is returned, on error an ARGPARSE_ error
+ * code is returned.  */
+static int
+handle_metacmd (gpgrt_argparse_t *arg, char *keyword)
+{
+  static struct {
+    const char *name;          /* Name of the command.                   */
+    unsigned short alternate;  /* Use alternate version of the command.  */
+    unsigned short needarg:1;  /* Command requires an argument.          */
+    unsigned short always:1;   /* Command allowed in all conf files.     */
+    unsigned short noskip:1;   /* Even done in non-active [user] mode.   */
+    int (*func)(gpgrt_argparse_t *arg,
+                unsigned int alternate, char *args); /*handler*/
+  } cmds[] =
+      {{ "user",        0, 1, 0, 1, handle_meta_user },
+       { "if",          0, 1, 1, 0, handle_meta_if },
+       { "fi",          1, 0, 1, 0, handle_meta_if },
+       { "else",        2, 0, 1, 0, handle_meta_if },
+       { "let",         0, 1, 1, 0, handle_meta_let },
+       { "-let",        1, 1, 1, 0, handle_meta_let },
+       { "getenv",      0, 1, 1, 0, handle_meta_getenv },
+       { "getreg",      1, 1, 1, 0, handle_meta_getenv },
+       { "force",       0, 0, 0, 0, handle_meta_force },
+       { "+force",      0, 0, 0, 0, handle_meta_force },
+       { "-force",      1, 0, 0, 0, handle_meta_force },
+       { "ignore",      0, 0, 0, 0, handle_meta_ignore },
+       { "+ignore",     0, 0, 0, 0, handle_meta_ignore },
+       { "-ignore",     1, 0, 0, 0, handle_meta_ignore },
+       { "ignore-all",  2, 0, 0, 0, handle_meta_ignore },
+       { "+ignore-all", 2, 0, 0, 0, handle_meta_ignore },
+       { "expand",      0, 0, 1, 0, handle_meta_expand },
+       { "+expand",     0, 0, 1, 0, handle_meta_expand },
+       { "-expand",     1, 0, 1, 0, handle_meta_expand },
+       { "verbose",     0, 0, 1, 1, handle_meta_verbose },
+       { "+verbose",    0, 0, 1, 1, handle_meta_verbose },
+       { "-verbose",    1, 0, 1, 1, handle_meta_verbose },
+       { "echo",        0, 1, 1, 1, handle_meta_echo },
+       { "-echo",       1, 1, 1, 1, handle_meta_echo },
+       { "info",        0, 1, 1, 0, handle_meta_echo },
+       { "-info",       1, 1, 1, 0, handle_meta_echo }
+      };
+  char *rest;
+  int i;
+
+  for (rest = keyword; *rest && !(isascii (*rest) && isspace (*rest)); rest++)
+    ;
+  if (*rest)
+    {
+      *rest++ = 0;
+      trim_spaces (rest);
+    }
+
+  for (i=0; i < DIM (cmds); i++)
+    if (!strcmp (cmds[i].name, keyword))
+      break;
+  if (!(i < DIM (cmds)))
+    return ARGPARSE_UNKNOWN_META;
+  if (cmds[i].needarg && !*rest)
+    return ARGPARSE_MISSING_ARG;
+  if (!cmds[i].needarg && *rest)
+    return ARGPARSE_UNEXPECTED_ARG;
+  if (!arg->internal->in_sysconf && !cmds[i].always)
+    return ARGPARSE_UNEXPECTED_META;
+
+  if (!cmds[i].noskip
+      && arg->internal->in_sysconf
+      && arg->internal->user_seen
+      && !arg->internal->user_active)
+    {
+      return 0; /* Skip this meta command.  */
+    }
+
+  /* Skip meta commands if they are in an active if-block.  But don't
+   * skip the [if], [else], and [fi]. */
+  if (arg->internal->if_cond
+      && !arg->internal->if_active[arg->internal->if_cond - 1]
+      && cmds[i].func != handle_meta_if)
+    {
+      return 0;
+    }
+
+  return cmds[i].func (arg, cmds[i].alternate, rest);
+}
+
+
+/* Helper for _gpgrt_argparse.  */
+static void
+prepare_arg_return (gpgrt_argparse_t *arg, opttable_t *opts,
+                    int idx, int in_alias, int set_ignore)
+{
+  /* No argument found at the end of the line.  */
+  if (in_alias)
+    arg->r_opt = ARGPARSE_MISSING_ARG;
+  else if (!(opts[idx].flags & ARGPARSE_TYPE_MASK))
+    arg->r_type = ARGPARSE_TYPE_NONE; /* Does not take an arg. */
+  else if ((opts[idx].flags & ARGPARSE_OPT_OPTIONAL))
+    arg->r_type = ARGPARSE_TYPE_NONE; /* No optional argument. */
+  else if (!(opts[idx].ignore && !opts[idx].forced) && !set_ignore)
+    arg->r_opt = ARGPARSE_MISSING_ARG;
+
+  /* If the caller wants us to return the attributes or
+   * ignored options, or these flags in.  */
+  if ((arg->flags & ARGPARSE_FLAG_WITHATTR))
+    {
+      if (opts[idx].ignore)
+        arg->r_type |= ARGPARSE_ATTR_IGNORE;
+      if (opts[idx].forced)
+        arg->r_type |= ARGPARSE_ATTR_FORCE;
+      if (set_ignore)
+        arg->r_type |= ARGPARSE_OPT_IGNORE;
+    }
+}
+
+
+/****************
+ * Get options from a file.
+ * Lines starting with '#' are comment lines.
+ * Syntax is simply a keyword and the argument.
+ * Valid keywords are all keywords from the long_opt list without
+ * the leading dashes. The special keywords "help", "warranty" and "version"
+ * are not valid here.
+ * The special keyword "alias" may be used to store alias definitions,
+ * which are later expanded like long options.
+ * The option
+ *   ignore-invalid-option OPTIONNAMEs
+ * is recognized and updates a list of option which should be ignored if they
+ * are not defined.
+ * Caller must free returned strings.
+ * If called with FP set to NULL command line args are parse instead.
+ *
+ * Q: Should we allow the syntax
+ *     keyword = value
+ *    and accept for boolean options a value of 1/0, yes/no or true/false?
+ * Note: Abbreviation of options is here not allowed.
+ */
+int
+_gpgrt_argparse (estream_t fp, gpgrt_argparse_t *arg, gpgrt_opt_t *opts_orig)
+{
+  enum { Ainit,
+         Acomment,     /* In a comment line.           */
+         Acopykeyword, /* Collecting a keyword.        */
+         Awaitarg,     /* Wait for an argument.        */
+         Acopyarg,     /* Copy the argument.           */
+         Akeyword_eol, /* Got keyword at end of line.  */
+         Akeyword_spc, /* Got keyword at space.        */
+         Acopymetacmd, /* Copy a meta command.         */
+         Askipmetacmd, /* Skip spaces after metacmd.   */
+         Askipmetacmd2,/* Skip comment after metacmd.  */
+         Ametacmd,     /* Process the metacmd.         */
+         Askipandleave /* Skip the rest of the line and then leave.  */
+  } state;
+  opttable_t *opts;
+  unsigned int nopts;
+  int i, c;
+  int idx = 0;
+  char keyword[100];
+  char *buffer = NULL;
+  size_t buflen = 0;
+  int in_alias=0;
+  int set_ignore = 0;
+  int unread_buf[3];  /* We use an int so that we can store EOF.  */
+  int unread_buf_count = 0;
+
+  if (arg && !opts_orig)
+    {
+      deinitialize (arg);
+      return 0;
+    }
+
+  if (!fp) /* Divert to arg_parse() in this case.  */
+    return arg_parse (arg, opts_orig, 0);
+
+  if (initialize (arg, opts_orig, fp))
+    return (arg->r_opt = ARGPARSE_OUT_OF_CORE);
+
+  opts = arg->internal->opts;
+  nopts = arg->internal->nopts;
+
+  /* If the LINENO is zero we assume that we are at the start of a
+   * file and we skip over a possible Byte Order Mark.  */
+  if (!arg->lineno)
+    {
+      unread_buf[0] = _gpgrt_fgetc (fp);
+      unread_buf[1] = _gpgrt_fgetc (fp);
+      unread_buf[2] = _gpgrt_fgetc (fp);
+      if (unread_buf[0] != 0xef
+          || unread_buf[1] != 0xbb
+          || unread_buf[2] != 0xbf)
+        unread_buf_count = 3;
+    }
+
+  arg->internal->opt_flags = 0;
+
+  /* _gpgrt_log_debug ("loop: if=%d/%d\n", arg->internal->if_cond, */
+  /*                   arg->internal->if_cond? */
+  /*                   arg->internal->if_active[arg->internal->if_cond-1]:-1);*/
+
+  /* Find the next keyword.  */
+  state = Ainit;
+  i = 0;
+  for (;;)
+    {
+    nextstate:
+      /* Before scanning the next char handle the keyword seen states.  */
+      if (state == Akeyword_eol || state == Akeyword_spc)
+        {
+          /* We are either at the end of a line or right after a
+           * keyword.  In the latter case we need to find the keyword
+           * so that we can decide whether an argument is required.  */
+
+          /* Check the keyword.  */
+          for (idx=0; idx < nopts; idx++ )
+            {
+              if (opts[idx].long_opt && !strcmp (opts[idx].long_opt, keyword))
+                break;
+            }
+          arg->r_opt = opts[idx].short_opt;
+          if (!(idx < nopts))
+            {
+              /* The option (keyword) is not known - check for
+               * internal keywords before returning an error.  */
+              if (state == Akeyword_spc && !strcmp (keyword, "alias"))
+                {
+                  in_alias = 1;
+                  state = Awaitarg;
+                }
+              else if (!strcmp (keyword, "ignore-invalid-option"))
+                {
+                  /* We might have keywords as argument - add them to
+                   * the list of ignored keywords.  Note that we
+                   * ignore empty argument lists and thus do not to
+                   * call the function in the Akeyword_eol state. */
+                  if (state == Akeyword_spc)
+                    {
+                      if (ignore_invalid_option_add (arg, fp))
+                        {
+                          arg->r_opt = ARGPARSE_OUT_OF_CORE;
+                          goto leave;
+                        }
+                      arg->lineno++;
+                    }
+                  state = Ainit;
+                  i = 0;
+                }
+              else if (ignore_invalid_option_p (arg, keyword))
+                {
+                  /* This invalid option is already in the iio list.  */
+                  state = state == Akeyword_eol? Ainit : Acomment;
+                  i = 0;
+                }
+              else
+                {
+                  arg->r_opt = ((opts[idx].flags & ARGPARSE_OPT_COMMAND)
+                                ? ARGPARSE_INVALID_COMMAND
+                                : ARGPARSE_INVALID_OPTION);
+                  if (state == Akeyword_spc)
+                    state = Askipandleave;
+                  else
+                    goto leave;
+                }
+            }
+          else if (state != Akeyword_spc
+                   && arg->internal->in_sysconf
+                   && arg->internal->user_seen
+                   && !arg->internal->user_active)
+            {
+              /* We are in a [user] meta command and it is not active.
+               * Skip the command.  */
+              state = state == Akeyword_eol? Ainit : Acomment;
+              i = 0;
+            }
+          else if (state != Akeyword_spc
+                   && (opts[idx].flags & ARGPARSE_OPT_IGNORE))
+            {
+              /* Known option is configured to be ignored.  Start from
+               * scratch (new line) or process like a comment.  */
+              state = state == Akeyword_eol? Ainit : Acomment;
+              i = 0;
+            }
+          else /* Known option */
+            {
+              set_ignore = 0;
+
+              if (arg->internal->in_sysconf)
+                {
+                  /* Set the current forced and ignored attributes.  */
+                  if (arg->internal->mark_forced)
+                    opts[idx].forced = 1;
+                  if (arg->internal->mark_ignore)
+                    opts[idx].ignore = 1;
+                  if (arg->internal->explicit_ignore)
+                    opts[idx].explicit_ignore = 1;
+
+                  if (opts[idx].ignore && !opts[idx].forced)
+                    {
+                      if (arg->internal->verbose)
+                        _gpgrt_log_info ("%s:%u: ignoring option \"--%s\"\n",
+                                         arg->internal->confname,
+                                         arg->lineno,
+                                         opts[idx].long_opt);
+                      if ((arg->flags & ARGPARSE_FLAG_WITHATTR))
+                        set_ignore = 1;
+                      else
+                        {
+                          state = state == Akeyword_eol? Ainit : Acomment;
+                          i = 0;
+                          goto nextstate;  /* Ignore this one.  */
+                        }
+                    }
+                }
+              else /* Non-sysconf file  */
+                {  /* Act upon the forced and ignored attributes.  */
+                  if (opts[idx].ignore || opts[idx].forced)
+                    {
+                      if (arg->internal->verbose)
+                        _gpgrt_log_info ("%s:%u: ignoring option \"--%s\""
+                                         " due to attributes:%s%s\n",
+                                         arg->internal->confname,
+                                         arg->lineno,
+                                         opts[idx].long_opt,
+                                         opts[idx].forced? " forced":"",
+                                         opts[idx].ignore? " ignore":"");
+                      if ((arg->flags & ARGPARSE_FLAG_WITHATTR))
+                        set_ignore = 1;
+                      else
+                        {
+                          state = state == Akeyword_eol? Ainit : Acomment;
+                          i = 0;
+                          goto nextstate;  /* Ignore this one.  */
+                        }
+                    }
+                }
+
+              if (state == Akeyword_spc)
+                {
+                  /* If we shall ignore but not set the option we skip
+                   * the argument.  Otherwise we would need to use a
+                   * made-up but not used args in the conf file. */
+                  if (set_ignore || (opts[idx].ignore && !opts[idx].forced))
+                    {
+                      prepare_arg_return (arg, opts, idx, 0, set_ignore);
+                      set_ignore = 0;
+                      state = Askipandleave;
+                    }
+                  else
+                    state = Awaitarg;
+                }
+              else
+                {
+                  prepare_arg_return (arg, opts, idx, 0, set_ignore);
+                  set_ignore = 0;
+                  goto leave;
+                }
+
+            }
+        } /* (end state Akeyword_eol/Akeyword_spc) */
+      else if (state == Ametacmd)
+        {
+          /* We are at the end of a line.  */
+          gpgrt_assert (*keyword == '[');
+          trim_spaces (keyword+1);
+          if (!keyword[1])
+            {
+              arg->r_opt = ARGPARSE_INVALID_META; /* Empty.  */
+              goto leave;
+            }
+          c = handle_metacmd (arg, keyword+1);
+          if (c)
+            {
+              arg->r_opt = c;   /* Return error.  */
+              goto leave;
+            }
+          state = Ainit;
+          i = 0;
+        }
+
+      /* Get the next character from the line.  */
+      if (unread_buf_count)
+        c = unread_buf[3 - unread_buf_count--];
+      else
+        c = _gpgrt_fgetc (fp);
+
+      if (c == '\n' || c== EOF )
+        { /* Handle end of line.  */
+          if ( c != EOF )
+            arg->lineno++;
+          if (state == Askipandleave)
+            goto leave;
+          else if (state == Acopykeyword)
+            {
+              keyword[i] = 0;
+              state = Akeyword_eol;
+              goto nextstate;
+           }
+          else if (state == Acopymetacmd)
+            {
+              arg->r_opt = ARGPARSE_INVALID_META;  /* "]" missing */
+              goto leave;
+           }
+          else if (state == Askipmetacmd || state == Askipmetacmd2)
+            {
+              state = Ametacmd;
+              goto nextstate;
+            }
+          else if (state == Awaitarg)
+            {
+              /* No argument found at the end of the line.  */
+              prepare_arg_return (arg, opts, idx, in_alias, set_ignore);
+              set_ignore = 0;
+              goto leave;
+           }
+          else if (state == Acopyarg)
+            {
+              /* Has an argument at the end of a line. */
+              if (in_alias)
+                {
+                  if (!buffer)
+                    arg->r_opt = ARGPARSE_UNEXPECTED_ARG;
+                  else
+                    {
+                      char *p;
+
+                      buffer[i] = 0;
+                      p = strpbrk (buffer, " \t");
+                      if (p)
+                        {
+                          *p++ = 0;
+                          trim_spaces (p);
+                       }
+                      if (!p || !*p)
+                        {
+                          xfree (buffer);
+                          arg->r_opt = ARGPARSE_INVALID_ALIAS;
+                        }
+                      else
+                        {
+                          store_alias (arg, buffer, p);
+                        }
+                   }
+               }
+              else if (!(opts[idx].flags & ARGPARSE_TYPE_MASK))
+                arg->r_opt = ARGPARSE_UNEXPECTED_ARG;
+              else
+                {
+                  char *p;
+
+                  if (!buffer)
+                    {
+                      keyword[i] = 0;
+                      buffer = xtrystrdup (keyword);
+                      if (!buffer)
+                        arg->r_opt = ARGPARSE_OUT_OF_CORE;
+                   }
+                  else
+                    buffer[i] = 0;
+
+                  if (buffer)
+                    {
+                      trim_spaces (buffer);
+                      p = buffer;
+                      if (*p == '"')
+                        {
+                          /* Remove quotes. */
+                          p++;
+                          if (*p && p[strlen(p)-1] == '\"' )
+                            p[strlen(p)-1] = 0;
+                        }
+
+                      if (arg->internal->expand && strchr (p, '$'))
+                        {
+                          p = substitute_vars (arg, p);
+                          if (!p)
+                            {
+                              xfree (buffer);
+                              buffer = NULL;
+                              arg->r_opt =  ARGPARSE_OUT_OF_CORE;
+                            }
+                          else
+                            {
+                              xfree (buffer);
+                              buffer = p;
+                            }
+                        }
+
+                      if (!set_opt_arg (arg, opts[idx].flags, p))
+                        xfree (buffer);
+                      else
+                        gpgrt_annotate_leaked_object (buffer);
+                    }
+                }
+              goto leave;
+            }
+          else if (c == EOF)
+            {
+              ignore_invalid_option_clear (arg);
+              if (_gpgrt_ferror (fp))
+                arg->r_opt = ARGPARSE_READ_ERROR;
+              else
+                arg->r_opt = 0; /* EOF. */
+              goto leave;
+            }
+          state = Ainit;
+          i = 0;
+        } /* (end handle end of line) */
+      else if (state == Askipandleave)
+        ; /* Skip. */
+      else if (state == Ainit && isascii (c) && isspace(c))
+        ; /* Skip leading white space.  */
+      else if (state == Ainit && c == '#' )
+        state = Acomment;      /* Start of a comment.  */
+      else if (state == Ainit && c != '['
+               && arg->internal->if_cond
+               && !arg->internal->if_active[arg->internal->if_cond - 1])
+        {
+          /* A regular line in a non-active if-block.  We treat it the
+           * same as a comment.  Note that we can't do this with meta
+           * command because we need to detect the [fi].  */
+          state = Acomment;
+        }
+      else if (state == Acomment || state == Askipmetacmd2)
+        ; /* Skip comments. */
+      else if (state == Askipmetacmd)
+        {
+          if (c == '#')
+            state = Askipmetacmd2;
+          else if (!(isascii (c) && isspace(c)))
+            {
+              arg->r_opt = ARGPARSE_INVALID_META;
+              state = Askipandleave;
+            }
+        }
+      else if (state == Acopykeyword && isascii (c) && isspace(c))
+        {
+          keyword[i] = 0;
+          state = Akeyword_spc;
+          goto nextstate;
+        }
+      else if (state == Acopymetacmd && c == ']')
+        {
+          keyword[i] = 0;
+          state = Askipmetacmd;
+          goto nextstate;
+        }
+      else if (state == Awaitarg)
+        {
+          /* Skip leading spaces of the argument.  */
+          if (!isascii (c) || !isspace(c))
+            {
+              i = 0;
+              keyword[i++] = c;
+              state = Acopyarg;
+            }
+        }
+      else if (state == Acopyarg)
+        {
+          /* Collect the argument. */
+          if (buffer)
+            {
+              if (i < buflen-1)
+                buffer[i++] = c;
+              else
+                {
+                  char *tmp;
+                  size_t tmplen = buflen + 50;
+
+                  tmp = xtryrealloc (buffer, tmplen);
+                  if (tmp)
+                    {
+                      buflen = tmplen;
+                      buffer = tmp;
+                      buffer[i++] = c;
+                    }
+                  else
+                    {
+                      xfree (buffer);
+                      arg->r_opt = ARGPARSE_OUT_OF_CORE;
+                      goto leave;
+                    }
+                }
+            }
+          else if (i < DIM(keyword)-1)
+            keyword[i++] = c;
+          else
+            {
+              size_t tmplen = DIM(keyword) + 50;
+              buffer = xtrymalloc (tmplen);
+              if (buffer)
+                {
+                  buflen = tmplen;
+                  memcpy(buffer, keyword, i);
+                  buffer[i++] = c;
+                }
+              else
+                {
+                  arg->r_opt = ARGPARSE_OUT_OF_CORE;
+                  goto leave;
+                }
+            }
+        }
+      else if (i >= DIM(keyword)-1)
+        {
+          arg->r_opt = ARGPARSE_KEYWORD_TOO_LONG;
+          state = Askipandleave; /* Skip rest of line and leave.  */
+        }
+      else if (!i)
+        {
+          state = c == '[' ? Acopymetacmd : Acopykeyword;
+          keyword[i++] = c;
+        }
+      else
+        {
+          keyword[i++] = c;
+        }
+    }
+
+ leave:
+  return arg->r_opt;
+}
+
+
+/* Return true if the list of options OPTS has any option marked with
+ * ARGPARSE_OPT_CONFFILE.  */
+static int
+any_opt_conffile (opttable_t *opts, unsigned int nopts)
+{
+  int i;
+
+  for (i=0; i < nopts; i++ )
+    if ((opts[i].flags & ARGPARSE_OPT_CONFFILE))
+      return 1;
+  return 0;
+}
+
+
+/* Return true if FNAME is an absoluete filename.  */
+static int
+is_absfname (const char *fname)
+{
+  const char *s;
+
+#ifdef HAVE_W32_SYSTEM
+  s = strchr (fname, ':');
+  if (s)
+    s++;
+  else
+    s = fname;
+#else
+  s = fname;
+#endif
+
+  return (*s == '/'
+#ifdef HAVE_W32_SYSTEM
+          || *s == DIRSEP_C
+#endif
+          );
+}
+
+
+/* If FNAME specifies two files of the form
+ *   NAME1:/NAME2    (Unix)
+ * or
+ *   NAME1;[x:]/NAME2  (Windows)
+ * return a pointer to the delimiter or NULL if there is none.
+ */
+static const char *
+is_twopartfname (const char *fname)
+{
+  const char *s;
+
+  if ((s = strchr (fname, PATHSEP_C)) && is_absfname (s+1) && s != fname)
+    return s;
+  return NULL;
+}
+
+
+/* Try to use a version-ed config file name.  A version-ed config file
+ * name is one which has the packages version number appended.  For
+ * example if the standard config file name is "foo.conf" and the
+ * version of the foo program is 1.2.3-beta1 the following config
+ * files are tried in order until one is readable:
+ *
+ *   foo.conf-1.2.3-beta1
+ *   foo.conf-1.2.3
+ *   foo.conf-1.2
+ *   foo.conf-1
+ *   foo.conf
+ *
+ * The argument CONFIGNAME should already be expanded.  On success a
+ * newly allocated file name is returned.  On error NULL is returned.
+ */
+static char *
+try_versioned_conffile (const char *configname)
+{
+  const char *version = _gpgrt_strusage (13);
+  char *name;
+  char *dash, *endp;
+
+  if (!version || !*version)
+    return NULL; /* No program version known. */
+
+  name = _gpgrt_strconcat (configname, "-", version, NULL);
+  if (!name)
+    return NULL;  /* Oops: Out of core - ignore.  */
+  dash = name + strlen (configname);
+
+  endp = dash + strlen (dash) - 1;
+  while (endp > dash)
+    {
+      if (!_gpgrt_access (name, R_OK))
+        {
+          return name;
+        }
+      for (; endp > dash; endp--)
+        {
+          if (*endp == '-' || *endp == '.')
+            {
+              *endp = 0;
+              break;
+            }
+        }
+    }
+
+  _gpgrt_free (name);
+  return NULL;
+}
+
+
+/* This function is called after a sysconf file has been read.  */
+static void
+finish_read_sys (gpgrt_argparse_t *arg)
+{
+  opttable_t *opts = arg->internal->opts;
+  unsigned int nopts = arg->internal->nopts;
+  int i;
+
+  if (arg->internal->ignore_all_seen)
+    {
+      /* [ignore-all] was used: Set all options which have not
+       * explictly been set as ignore or not ignore to ignore.  */
+      for (i = 0; i < nopts; i++)
+        {
+          if (!opts[i].explicit_ignore)
+            opts[i].ignore = 1;
+        }
+    }
+
+  /* Reset all flags which pertain only to sysconf files.  */
+  arg->internal->in_sysconf = 0;
+  arg->internal->user_active = 0;
+  arg->internal->mark_forced = 0;
+  arg->internal->mark_ignore = 0;
+  arg->internal->explicit_ignore = 0;
+  arg->internal->ignore_all_seen = 0;
+}
+
+
+/* The full arg parser which handles option files and command line
+ * arguments.  The behaviour depends on the combinations of CONFNAME
+ * and the ARGPARSE_FLAG_xxx values:
+ *
+ * | CONFNAME | SYS | USER | Action             |
+ * |----------+-----+------+--------------------|
+ * | NULL     |   - |    - | cmdline            |
+ * | string   |   0 |    1 | user, cmdline      |
+ * | string   |   1 |    0 | sys, cmdline       |
+ * | string   |   1 |    1 | sys, user, cmdline |
+ *
+ * Note that if an option has been flagged with ARGPARSE_OPT_CONFFILE
+ * and a type of ARGPARSE_TYPE_STRING that option is not returned but
+ * the specified configuration file is processed directly; if
+ * ARGPARSE_TYPE_NONE is used no user configuration files are
+ * processed and from the system configuration files only those which
+ * are immutable are processed.  The string values for CONFNAME shall
+ * not include a directory part because that is taken from the values
+ * set by gpgrt_set_confdir.  However, if CONFNAME is a twopart
+ * filename delimited by a colon (semicolon on Windows) with the
+ * second part being an absolute filename, the first part is used for
+ * the SYS file and the the entire second part for the USER file.
+ */
+int
+_gpgrt_argparser (gpgrt_argparse_t *arg, gpgrt_opt_t *opts,
+                  const char *confname)
+{
+  /* First check whether releasing the resources has been requested.  */
+  if (arg && !opts)
+    {
+      deinitialize (arg);
+      return 0;
+    }
+
+  /* Make sure that the internal data object is ready and also print
+   * warnings or errors from the last iteration.  */
+  if (initialize (arg, opts, NULL))
+    return (arg->r_opt = ARGPARSE_OUT_OF_CORE);
+
+ next_state:
+  switch (arg->internal->state)
+    {
+    case STATE_init:
+      if (arg->argc && arg->argv && *arg->argc
+          && any_opt_conffile (arg->internal->opts, arg->internal->nopts))
+        {
+          /* The list of option allow for conf files
+           * (e.g. gpg's "--option FILE" and "--no-options")
+           * Now check whether one was really given on the command
+           * line.  Note that we don't need to run this code if no
+           * argument array was provided. */
+          int  save_argc = *arg->argc;
+          char **save_argv = *arg->argv;
+          unsigned int save_flags = arg->flags;
+          int save_idx = arg->internal->idx;
+          int any_no_conffile = 0;
+
+          arg->flags = (ARGPARSE_FLAG_KEEP | ARGPARSE_FLAG_NOVERSION
+                        | ARGPARSE_FLAG__INITIALIZED);
+          while (arg_parse (arg, opts, 1))
+            {
+              if ((arg->internal->opt_flags & ARGPARSE_OPT_CONFFILE))
+                {
+                  arg->internal->explicit_confopt = 1;
+                  if ((arg->r_type & ARGPARSE_TYPE_MASK) == ARGPARSE_TYPE_STRING
+                      && !arg->internal->explicit_conffile)
+                    {
+                      /* Store the first conffile name.  All further
+                       * conf file options are not handled.  */
+                      arg->internal->explicit_conffile
+                        = xtrystrdup (arg->r.ret_str);
+                      if (!arg->internal->explicit_conffile)
+                        return (arg->r_opt = ARGPARSE_OUT_OF_CORE);
+
+                    }
+                  else if ((arg->r_type & ARGPARSE_TYPE_MASK)
+                            == ARGPARSE_TYPE_NONE)
+                    any_no_conffile = 1;
+                }
+            }
+          if (any_no_conffile)
+            {
+              /* A NoConffile option overrides any other conf file option.  */
+              xfree (arg->internal->explicit_conffile);
+              arg->internal->explicit_conffile = NULL;
+            }
+          /* Restore parser.  */
+          *arg->argc = save_argc;
+          *arg->argv = save_argv;
+          arg->flags = save_flags;
+          arg->internal->idx = save_idx;
+        }
+
+      if (confname && *confname)
+        {
+          if ((arg->flags & ARGPARSE_FLAG_SYS))
+            arg->internal->state = STATE_open_sys;
+          else if ((arg->flags & ARGPARSE_FLAG_USER))
+            arg->internal->state = STATE_open_user;
+          else
+            return (arg->r_opt = ARGPARSE_INVALID_ARG);
+        }
+      else
+        arg->internal->state = STATE_open_cmdline;
+      goto next_state;
+
+    case STATE_open_sys:
+      {
+        /* If it is a two part name take the first part.  */
+        const char *s;
+        char *tmpname = NULL;
+
+        if ((s = is_twopartfname (confname)))
+          {
+            tmpname = xtrymalloc (s - confname + 1);
+            if (!tmpname)
+              return (arg->r_opt = ARGPARSE_OUT_OF_CORE);
+            memcpy (tmpname, confname, s-confname);
+            tmpname[s-confname] = 0;
+            s = tmpname;
+          }
+        else
+          s = confname;
+        xfree (arg->internal->confname);
+        arg->internal->confname = _gpgrt_fnameconcat
+          (confdir.sys? confdir.sys : "/etc", s, NULL);
+        _gpgrt_free (tmpname);
+        if (!arg->internal->confname)
+          return (arg->r_opt = ARGPARSE_OUT_OF_CORE);
+      }
+      arg->lineno = 0;
+      arg->internal->idx = 0;
+      arg->internal->verbose = 0;
+      arg->internal->expand = 0;
+      arg->internal->stopped = 0;
+      arg->internal->inarg = 0;
+      _gpgrt_fclose (arg->internal->conffp);
+      arg->internal->conffp = _gpgrt_fopen (arg->internal->confname, "r");
+      if (!arg->internal->conffp)
+        {
+          if ((arg->flags & ARGPARSE_FLAG_VERBOSE) || arg->internal->verbose)
+            _gpgrt_log_info (_("Note: no default option file '%s'\n"),
+                             arg->internal->confname);
+          if ((arg->flags & ARGPARSE_FLAG_USER))
+            arg->internal->state = STATE_open_user;
+          else
+            arg->internal->state = STATE_open_cmdline;
+          goto next_state;
+        }
+
+      if ((arg->flags & ARGPARSE_FLAG_VERBOSE) || arg->internal->verbose)
+        _gpgrt_log_info (_("reading options from '%s'\n"),
+                         arg->internal->confname);
+      arg->internal->state = STATE_read_sys;
+      arg->internal->in_sysconf = 1;
+      arg->r.ret_str = xtrystrdup (arg->internal->confname);
+      if (!arg->r.ret_str)
+        arg->r_opt = ARGPARSE_OUT_OF_CORE;
+      else
+        {
+          gpgrt_annotate_leaked_object (arg->r.ret_str);
+          arg->r_opt = ARGPARSE_CONFFILE;
+          arg->r_type = ARGPARSE_TYPE_STRING;
+        }
+      break;
+
+    case STATE_open_user:
+      if (arg->internal->explicit_confopt
+          && arg->internal->explicit_conffile)
+        {
+          /* An explict option to use a specific configuration file
+           * has been given - use that one.  */
+          xfree (arg->internal->confname);
+          arg->internal->confname
+            = xtrystrdup (arg->internal->explicit_conffile);
+          if (!arg->internal->confname)
+            return (arg->r_opt = ARGPARSE_OUT_OF_CORE);
+        }
+      else if (arg->internal->explicit_confopt)
+        {
+          /* An explict option not to use a configuration file has
+           * been given - leap direct to command line reading.  */
+          arg->internal->state = STATE_open_cmdline;
+          goto next_state;
+        }
+      else
+        {
+          /* Use the standard configure file.  If it is a two part
+           * name take the second part.  If it is the standard name
+           * and ARGPARSE_FLAG_USERVERS is set try versioned config
+           * files. */
+          const char *s;
+          char *nconf;
+
+          xfree (arg->internal->confname);
+          if ((s = is_twopartfname (confname)))
+            {
+              arg->internal->confname = _gpgrt_fnameconcat (s + 1, NULL);
+              if (!arg->internal->confname)
+                return (arg->r_opt = ARGPARSE_OUT_OF_CORE);
+            }
+          else
+            {
+              arg->internal->confname = _gpgrt_fnameconcat
+                (confdir.user? confdir.user : "~/.config", confname, NULL);
+              if (!arg->internal->confname)
+                return (arg->r_opt = ARGPARSE_OUT_OF_CORE);
+              if ((arg->flags & ARGPARSE_FLAG_USERVERS)
+                  && (nconf = try_versioned_conffile (arg->internal->confname)))
+                {
+                  xfree (arg->internal->confname);
+                  arg->internal->confname = nconf;
+                }
+            }
+        }
+      arg->lineno = 0;
+      arg->internal->idx = 0;
+      arg->internal->verbose = 0;
+      arg->internal->expand = 0;
+      arg->internal->stopped = 0;
+      arg->internal->inarg = 0;
+      arg->internal->in_sysconf = 0;
+      _gpgrt_fclose (arg->internal->conffp);
+      arg->internal->conffp = _gpgrt_fopen (arg->internal->confname, "r");
+      if (!arg->internal->conffp)
+        {
+          arg->internal->state = STATE_open_cmdline;
+          if (arg->internal->explicit_confopt)
+            {
+              _gpgrt_log_error (_("option file '%s': %s\n"),
+                                arg->internal->confname, strerror (errno));
+              return (arg->r_opt = ARGPARSE_NO_CONFFILE);
+            }
+          else
+            {
+              if ((arg->flags & ARGPARSE_FLAG_VERBOSE)
+                  || arg->internal->verbose)
+                _gpgrt_log_info (_("Note: no default option file '%s'\n"),
+                                 arg->internal->confname);
+              goto next_state;
+            }
+        }
+
+      if ((arg->flags & ARGPARSE_FLAG_VERBOSE) || arg->internal->verbose)
+        _gpgrt_log_info (_("reading options from '%s'\n"),
+                         arg->internal->confname);
+      arg->internal->state = STATE_read_user;
+      arg->r.ret_str = xtrystrdup (arg->internal->confname);
+      if (!arg->r.ret_str)
+        arg->r_opt = ARGPARSE_OUT_OF_CORE;
+      else
+        {
+          gpgrt_annotate_leaked_object (arg->r.ret_str);
+          arg->r_opt = ARGPARSE_CONFFILE;
+          arg->r_type = ARGPARSE_TYPE_STRING;
+        }
+      break;
+
+    case STATE_open_cmdline:
+      _gpgrt_fclose (arg->internal->conffp);
+      arg->internal->conffp = NULL;
+      xfree (arg->internal->confname);
+      arg->internal->confname = NULL;
+      arg->internal->idx = 0;
+      arg->internal->verbose = 0;
+      arg->internal->expand = 0;
+      arg->internal->stopped = 0;
+      arg->internal->inarg = 0;
+      arg->internal->in_sysconf = 0;
+      if (!arg->argc || !arg->argv || !*arg->argv)
+        {
+          /* No or empty argument vector - don't bother to parse things.  */
+          arg->internal->state = STATE_finished;
+          goto next_state;
+        }
+      arg->r_opt = ARGPARSE_CONFFILE;
+      arg->r_type = ARGPARSE_TYPE_NONE;
+      arg->r.ret_str = NULL;
+      arg->internal->state = STATE_read_cmdline;
+      break;
+
+    case STATE_read_sys:
+     arg->r_opt = _gpgrt_argparse (arg->internal->conffp, arg, opts);
+      if (!arg->r_opt)
+        {
+          finish_read_sys (arg);
+          arg->internal->state = STATE_open_user;
+          goto next_state;
+        }
+      if ((arg->internal->opt_flags & ARGPARSE_OPT_CONFFILE))
+        goto next_state;  /* Already handled - again.  */
+      break;
+
+    case STATE_read_user:
+      arg->r_opt = _gpgrt_argparse (arg->internal->conffp, arg, opts);
+      if (!arg->r_opt)
+        {
+          arg->internal->state = STATE_open_cmdline;
+          goto next_state;
+        }
+      if ((arg->internal->opt_flags & ARGPARSE_OPT_CONFFILE))
+        goto next_state;  /* Already handled - again.  */
+      break;
+
+    case STATE_read_cmdline:
+      arg->r_opt = arg_parse (arg, opts, 1);
+      if (!arg->r_opt)
+        {
+          arg->internal->state = STATE_finished;
+          goto next_state;
+        }
+      if ((arg->internal->opt_flags & ARGPARSE_OPT_CONFFILE))
+        goto next_state;  /* Already handled - again.  */
+      break;
+
+    case STATE_finished:
+      arg->r_opt = 0;
+      break;
+    }
+
+  return arg->r_opt;
+}
+
+
+/* Given the list of options in ARG and a keyword, return the index of
+ * the long option matching KEYWORD.  On error -1 is returned for not
+ * found or -2 for ambigious keyword.  */
+static int
+find_long_option (gpgrt_argparse_t *arg, const char *keyword)
+{
+  int i;
+  size_t n;
+  opttable_t *opts   = arg->internal->opts;
+  unsigned int nopts = arg->internal->nopts;
+
+  /* Would be better if we can do a binary search, but it is not
+   * possible to reorder our option table because we would mess up our
+   * help strings.  What we can do is: Build an option lookup table
+   * when this function is first invoked.  The latter has already been
+   * done. */
+  if (!*keyword)
+    return -1;
+  for (i=0; i < nopts; i++ )
+    if (opts[i].long_opt && !strcmp (opts[i].long_opt, keyword))
+      return i;
+#if 0
+  {
+    ALIAS_DEF a;
+    /* see whether it is an alias */
+    for (a = args->internal->aliases; a; a = a->next)
+      {
+        if (!strcmp( a->name, keyword))
+          {
+            /* todo: must parse the alias here */
+            args->internal->cur_alias = a;
+            return -3; /* alias available */
+          }
+      }
+  }
+#endif
+  /* Not found.  See whether it is an abbreviation.  Aliases may not
+   * be abbreviated, though. */
+  n = strlen (keyword);
+  for (i=0; i < nopts; i++)
+    {
+      if (opts[i].long_opt && !strncmp (opts[i].long_opt, keyword, n))
+        {
+          int j;
+          for (j=i+1; j < nopts; j++)
+            {
+              if (opts[j].long_opt
+                  && !strncmp (opts[j].long_opt, keyword, n)
+                  && !(opts[j].short_opt == opts[i].short_opt
+                       && opts[j].flags == opts[i].flags ) )
+                return -2;  /* Abbreviation is ambiguous.  */
+           }
+          return i;
+       }
+    }
+  return -1;  /* Not found.  */
+}
+
+
+/* The option parser for command line options.  */
+static int
+arg_parse (gpgrt_argparse_t *arg, gpgrt_opt_t *opts_orig, int no_init)
+{
+  int idx;
+  opttable_t *opts;
+  unsigned int nopts;
+  int argc;
+  char **argv;
+  char *s, *s2;
+  int i;
+
+  if (no_init)
+    ;
+  else if (initialize (arg, opts_orig, NULL))
+    return (arg->r_opt = ARGPARSE_OUT_OF_CORE);
+
+  opts = arg->internal->opts;
+  nopts = arg->internal->nopts;
+  argc = *arg->argc;
+  argv = *arg->argv;
+  idx = arg->internal->idx;
+
+  if (!idx && argc && !(arg->flags & ARGPARSE_FLAG_ARG0))
+    {
+      /* Skip the first argument.  */
+      argc--; argv++; idx++;
+    }
+
+ next_one:
+  if (!argc || (s = *argv) == NULL)
+    {
+      /* No more args.  */
+      arg->r_opt = 0;
+      goto leave; /* Ready. */
+    }
+
+  arg->internal->last = s;
+  arg->internal->opt_flags = 0;
+
+  if (arg->internal->stopped && (arg->flags & ARGPARSE_FLAG_ALL))
+    {
+      arg->r_opt = ARGPARSE_IS_ARG;  /* Not an option but an argument.  */
+      arg->r_type = ARGPARSE_TYPE_STRING;
+      arg->r.ret_str = s;
+      argc--; argv++; idx++; /* set to next one */
+    }
+  else if (arg->internal->stopped)
+    {
+      arg->r_opt = 0;
+      goto leave; /* Ready.  */
+    }
+  else if ( *s == '-' && s[1] == '-' )
+    {
+      /* Long option.  */
+      char *argpos;
+
+      arg->internal->inarg = 0;
+      if (!s[2] && !(arg->flags & ARGPARSE_FLAG_NOSTOP))
+        {
+          /* Stop option processing.  */
+          arg->internal->stopped = 1;
+          arg->flags |= ARGPARSE_FLAG_STOP_SEEN;
+          argc--; argv++; idx++;
+          goto next_one;
+       }
+
+      argpos = strchr( s+2, '=' );
+      if ( argpos )
+        *argpos = 0;
+      i = find_long_option (arg, s+2);
+      if ( argpos )
+        *argpos = '=';
+
+      if (i > 0 && opts[i].short_opt == ARGPARSE_SHORTOPT_HELP)
+        {
+          show_help (opts, nopts, arg->flags);
+          my_exit (arg, 0);
+        }
+      else if (i > 0 && opts[i].short_opt == ARGPARSE_SHORTOPT_VERSION)
+        {
+          if (!(arg->flags & ARGPARSE_FLAG_NOVERSION))
+            {
+              show_version ();
+              my_exit (arg, 0);
+            }
+       }
+      else if (i > 0 && opts[i].short_opt == ARGPARSE_SHORTOPT_WARRANTY)
+        {
+          writestrings (0, _gpgrt_strusage (16), "\n", NULL);
+          my_exit (arg, 0);
+       }
+      else if (i > 0 && opts[i].short_opt == ARGPARSE_SHORTOPT_DUMP_OPTTBL)
+        dump_option_table (arg);
+      else if (i > 0 && opts[i].short_opt == ARGPARSE_SHORTOPT_DUMP_OPTIONS)
+        {
+          for (i=0; i < nopts; i++ )
+            {
+              if (opts[i].long_opt && !(opts[i].flags & ARGPARSE_OPT_IGNORE))
+                writestrings (0, "--", opts[i].long_opt, "\n", NULL);
+           }
+          my_exit (arg, 0);
+       }
+
+      if ( i == -2 )
+        arg->r_opt = ARGPARSE_AMBIGUOUS_OPTION;
+      else if ( i == -1 )
+        {
+          arg->r_opt = ARGPARSE_INVALID_OPTION;
+          arg->r.ret_str = s+2;
+       }
+      else
+        arg->r_opt = opts[i].short_opt;
+
+      if ( i < 0 )
+        ;
+      else if ( (opts[i].flags & ARGPARSE_TYPE_MASK) )
+        {
+          if ( argpos )
+            {
+              s2 = argpos+1;
+              if ( !*s2 )
+                s2 = NULL;
+           }
+          else
+            s2 = argv[1];
+
+          if ( !s2 && (opts[i].flags & ARGPARSE_OPT_OPTIONAL) )
+            {
+              arg->r_type = ARGPARSE_TYPE_NONE; /* Argument is optional.  */
+           }
+          else if ( !s2 )
+            {
+              arg->r_opt = ARGPARSE_MISSING_ARG;
+           }
+          else if ( !argpos && *s2 == '-'
+                    && (opts[i].flags & ARGPARSE_OPT_OPTIONAL) )
+            {
+              /* The argument is optional and the next seems to be an
+                 option.  We do not check this possible option but
+                 assume no argument */
+              arg->r_type = ARGPARSE_TYPE_NONE;
+           }
+          else
+            {
+              set_opt_arg (arg, opts[i].flags, s2);
+              if ( !argpos )
+                {
+                  argc--; argv++; idx++; /* Skip one.  */
+               }
+           }
+       }
+      else
+        {
+          /* Does not take an argument. */
+          if ( argpos )
+            arg->r_type = ARGPARSE_UNEXPECTED_ARG;
+          else
+            {
+              arg->internal->opt_flags = opts[i].flags;
+              arg->r_type = ARGPARSE_TYPE_NONE;
+            }
+       }
+      argc--; argv++; idx++; /* Set to next one.  */
+    }
+  else if ( (*s == '-' && s[1]) || arg->internal->inarg )
+    {
+      /* Short option.  */
+      int dash_kludge = 0;
+
+      i = 0;
+      if ( !arg->internal->inarg )
+        {
+          arg->internal->inarg++;
+          if ( (arg->flags & ARGPARSE_FLAG_ONEDASH) )
+            {
+              for (i=0; i < nopts; i++ )
+                if ( opts[i].long_opt && !strcmp (opts[i].long_opt, s+1))
+                  {
+                    dash_kludge = 1;
+                    break;
+                  }
+            }
+        }
+      s += arg->internal->inarg;
+
+      if (!dash_kludge )
+        {
+          for (i=0; i < nopts; i++ )
+            if ( opts[i].short_opt == *s )
+              break;
+        }
+
+      if ( !opts[i].short_opt && ( *s == 'h' || *s == '?' ) )
+        {
+          show_help (opts, nopts, arg->flags);
+          my_exit (arg, 0);
+        }
+
+      arg->r_opt = opts[i].short_opt;
+      if (!opts[i].short_opt )
+        {
+          arg->r_opt = (opts[i].flags & ARGPARSE_OPT_COMMAND)?
+            ARGPARSE_INVALID_COMMAND:ARGPARSE_INVALID_OPTION;
+          arg->internal->inarg++; /* Point to the next arg.  */
+          arg->r.ret_str = s;
+        }
+      else if ( (opts[i].flags & ARGPARSE_TYPE_MASK) )
+        {
+          if ( s[1] && !dash_kludge )
+            {
+              s2 = s+1;
+              set_opt_arg (arg, opts[i].flags, s2);
+            }
+          else
+            {
+              s2 = argv[1];
+              if ( !s2 && (opts[i].flags & ARGPARSE_OPT_OPTIONAL) )
+                {
+                  arg->r_type = ARGPARSE_TYPE_NONE;
+                  arg->internal->opt_flags = opts[i].flags;
+                }
+              else if ( !s2 )
+                {
+                  arg->r_opt = ARGPARSE_MISSING_ARG;
+                }
+              else if ( *s2 == '-' && s2[1]
+                        && (opts[i].flags & ARGPARSE_OPT_OPTIONAL) )
+                {
+                  /* The argument is optional and the next seems to
+                     be an option.  We do not check this possible
+                     option but assume no argument.  */
+                  arg->r_type = ARGPARSE_TYPE_NONE;
+                  arg->internal->opt_flags = opts[i].flags;
+                }
+              else
+                {
+                  set_opt_arg (arg, opts[i].flags, s2);
+                  argc--; argv++; idx++; /* Skip one.  */
+                }
+            }
+          s = "x"; /* This is so that !s[1] yields false.  */
+        }
+      else
+        {
+          /* Does not take an argument.  */
+          arg->r_type = ARGPARSE_TYPE_NONE;
+          arg->internal->opt_flags = opts[i].flags;
+          arg->internal->inarg++; /* Point to the next arg.  */
+        }
+      if ( !s[1] || dash_kludge )
+        {
+          /* No more concatenated short options.  */
+          arg->internal->inarg = 0;
+          argc--; argv++; idx++;
+        }
+    }
+  else if ( arg->flags & ARGPARSE_FLAG_MIXED )
+    {
+      arg->r_opt = ARGPARSE_IS_ARG;
+      arg->r_type = ARGPARSE_TYPE_STRING;
+      arg->r.ret_str = s;
+      argc--; argv++; idx++; /* Set to next one.  */
+    }
+  else
+    {
+      arg->internal->stopped = 1; /* Stop option processing.  */
+      goto next_one;
+    }
+
+  if (arg->r_opt > 0 && i >= 0 && i < nopts
+      && ((opts[i].ignore && opts[i].explicit_ignore) || opts[i].forced))
+    {
+
+      if ((arg->flags & ARGPARSE_FLAG_WITHATTR))
+        {
+          if (opts[i].ignore)
+            arg->r_type |= ARGPARSE_ATTR_IGNORE;
+          if (opts[i].forced)
+            arg->r_type |= ARGPARSE_ATTR_FORCE;
+          arg->r_type |= ARGPARSE_OPT_IGNORE;
+        }
+      else
+        {
+          _gpgrt_log_info (_("Note: ignoring option \"--%s\""
+                             " due to global config\n"),
+                           opts[i].long_opt);
+          goto next_one;  /* Skip ignored/forced option.  */
+        }
+    }
+
+ leave:
+  *arg->argc = argc;
+  *arg->argv = argv;
+  arg->internal->idx = idx;
+  return arg->r_opt;
+}
+
+
+/* Returns: -1 on error, 0 for an integer type and 1 for a non integer
+   type argument.  */
+static int
+set_opt_arg (gpgrt_argparse_t *arg, unsigned flags, char *s)
+{
+  int base = (flags & ARGPARSE_OPT_PREFIX)? 0 : 10;
+  long l;
+
+  arg->internal->opt_flags = flags;
+  switch ( (arg->r_type = (flags & ARGPARSE_TYPE_MASK)) )
+    {
+    case ARGPARSE_TYPE_LONG:
+    case ARGPARSE_TYPE_INT:
+      errno = 0;
+      l = strtol (s, NULL, base);
+      if ((l == LONG_MIN || l == LONG_MAX) && errno == ERANGE)
+        {
+          arg->r_opt = ARGPARSE_INVALID_ARG;
+          return -1;
+        }
+      if (arg->r_type == ARGPARSE_TYPE_LONG)
+        arg->r.ret_long = l;
+      else if ( (l < 0 && l < INT_MIN) || l > INT_MAX )
+        {
+          arg->r_opt = ARGPARSE_INVALID_ARG;
+          return -1;
+        }
+      else
+        arg->r.ret_int = (int)l;
+      return 0;
+
+    case ARGPARSE_TYPE_ULONG:
+      while (isascii (*s) && isspace(*s))
+        s++;
+      if (*s == '-')
+        {
+          arg->r.ret_ulong = 0;
+          arg->r_opt = ARGPARSE_INVALID_ARG;
+          return -1;
+        }
+      errno = 0;
+      arg->r.ret_ulong = strtoul (s, NULL, base);
+      if (arg->r.ret_ulong == ULONG_MAX && errno == ERANGE)
+        {
+          arg->r_opt = ARGPARSE_INVALID_ARG;
+          return -1;
+        }
+      return 0;
+
+    case ARGPARSE_TYPE_STRING:
+    default:
+      arg->r.ret_str = s;
+      return 1;
+    }
+}
+
+
+/* Return the length of the option O.  This needs to consider the
+ * description as well as the option name.  */
+static size_t
+long_opt_strlen (opttable_t *o)
+{
+  size_t n = strlen (o->long_opt);
+
+  if ( o->description && *o->description == '|' )
+    {
+      const char *s;
+      int is_utf8 = is_native_utf8 ();
+
+      s=o->description+1;
+      if ( *s != '=' )
+        n++;
+      /* For a (mostly) correct length calculation we exclude
+       * continuation bytes (10xxxxxx) if we are on a native utf8
+       * terminal. */
+      for (; *s && *s != '|'; s++ )
+        if ( is_utf8 && (*s&0xc0) != 0x80 )
+          n++;
+    }
+  return n;
+}
+
+
+
+/* Qsort compare for show_help.  */
+static int
+cmp_ordtbl (const void *a_v, const void *b_v)
+{
+  const unsigned short *a = a_v;
+  const unsigned short *b = b_v;
+
+  return *a - *b;
+}
+
+
+/****************
+ * Print formatted help. The description string has some special
+ * meanings:
+ *  - A description string which is "@" suppresses help output for
+ *    this option
+ *  - a description which starts with a '@' and is followed by
+ *    any other characters is printed as is; this may be used for examples
+ *    and such.  This is a legacy methiod, moder codes uses the flags
+ *    ARGPARSE_OPT_VERBATIM or ARGPARSE_OPT_HEADER.
+ *  - A description which starts with a '|' outputs the string between this
+ *    bar and the next one as arguments of the long option.
+ */
+static void
+show_help (opttable_t *opts, unsigned int nopts, unsigned int flags)
+{
+  const char *s;
+  char tmp[2];
+  unsigned int *ordtbl = NULL;
+
+  show_version ();
+  writestrings (0, "\n", NULL);
+  s = _gpgrt_strusage (42);
+  if (s && *s == '1')
+    {
+      s = _gpgrt_strusage (40);
+      writestrings (1, s, NULL);
+      if (*s && s[strlen(s)] != '\n')
+        writestrings (1, "\n", NULL);
+    }
+  s = _gpgrt_strusage(41);
+  writestrings (0, s, "\n", NULL);
+  if ( nopts )
+    {
+      /* Auto format the option description.  */
+      int i,j,indent;
+      const char *last_header = NULL;
+
+      ordtbl = xtrycalloc (nopts, sizeof *ordtbl);
+      if (!ordtbl)
+        {
+          writestrings (1, "\nOoops: Out of memory whilst printing the help.\n",
+                        NULL);
+          goto leave;
+        }
+
+      /* Get max. length of long options.  */
+      for (i=indent=0; i < nopts; i++ )
+        {
+          if ( opts[i].long_opt )
+            if ( !opts[i].description || *opts[i].description != '@' )
+              if ( (j=long_opt_strlen(opts+i)) > indent && j < 35 )
+                indent = j;
+          ordtbl[i] = opts[i].ordinal;
+       }
+
+      qsort (ordtbl, nopts, sizeof *ordtbl, cmp_ordtbl);
+
+      /* The first option needs to have a description; if not do not
+       * print the help at all.  */
+      if (!opts[ordtbl[0]].description)
+        goto leave;
+
+      /* Example: " -v, --verbose   Viele Sachen ausgeben" */
+      indent += 10;
+      if ( *opts[ordtbl[0]].description != '@'
+           && !(opts[ordtbl[0]].flags
+                & (ARGPARSE_OPT_VERBATIM|ARGPARSE_OPT_HEADER)))
+        writestrings (0, "Options:", "\n", NULL);
+      for (i=0; i < nopts; i++ )
+        {
+          s = map_fixed_string (_( opts[ordtbl[i]].description ));
+          if ( s && *s== '@' && !s[1] ) /* Hide this line.  */
+            continue;
+          if ( s && (opts[ordtbl[i]].flags & ARGPARSE_OPT_HEADER))
+            {
+              /* We delay printing until we have found one real output
+               * line.  This avoids having a header above an empty
+               * section.  */
+              last_header = s;
+              continue;
+           }
+          if (last_header)
+            {
+              if (*last_header)
+                writestrings (0, "\n", last_header, ":\n", NULL);
+              last_header = NULL;
+            }
+          if ( s && (opts[ordtbl[i]].flags & ARGPARSE_OPT_VERBATIM))
+            {
+              writestrings (0, s, NULL);
+              continue;
+           }
+          if ( s && *s == '@' )  /* Unindented legacy comment only line.  */
+            {
+              for (s++; *s; s++ )
+                {
+                  if ( *s == '\n' )
+                    {
+                      if( s[1] )
+                        writestrings (0, "\n", NULL);
+                   }
+                  else
+                    {
+                      tmp[0] = *s;
+                      tmp[1] = 0;
+                      writestrings (0, tmp, NULL);
+                    }
+                }
+              writestrings (0, "\n", NULL);
+              continue;
+           }
+
+          j = 3;
+          if ( opts[ordtbl[i]].short_opt < 256 )
+            {
+              tmp[0] = opts[ordtbl[i]].short_opt;
+              tmp[1] = 0;
+              writestrings (0, " -", tmp, NULL );
+              if ( !opts[ordtbl[i]].long_opt )
+                {
+                  if (s && *s == '|' )
+                    {
+                      writestrings (0, " ", NULL); j++;
+                      for (s++ ; *s && *s != '|'; s++, j++ )
+                        {
+                          tmp[0] = *s;
+                          tmp[1] = 0;
+                          writestrings (0, tmp, NULL);
+                        }
+                      if ( *s )
+                        s++;
+                   }
+               }
+           }
+          else
+            writestrings (0, "   ", NULL);
+          if ( opts[ordtbl[i]].long_opt )
+            {
+              tmp[0] = opts[ordtbl[i]].short_opt < 256?',':' ';
+              tmp[1] = 0;
+              j += writestrings (0, tmp, " --", opts[ordtbl[i]].long_opt, NULL);
+              if (s && *s == '|' )
+                {
+                  if ( *++s != '=' )
+                    {
+                      writestrings (0, " ", NULL);
+                      j++;
+                   }
+                  for ( ; *s && *s != '|'; s++, j++ )
+                    {
+                      tmp[0] = *s;
+                      tmp[1] = 0;
+                      writestrings (0, tmp, NULL);
+                    }
+                  if ( *s )
+                    s++;
+               }
+              writestrings (0, "   ", NULL);
+              j += 3;
+           }
+          for (;j < indent; j++ )
+            writestrings (0, " ", NULL);
+          if ( s )
+            {
+              if ( *s && j > indent )
+                {
+                  writestrings (0, "\n", NULL);
+                  for (j=0;j < indent; j++ )
+                    writestrings (0, " ", NULL);
+               }
+              for (; *s; s++ )
+                {
+                  if ( *s == '\n' )
+                    {
+                      if ( s[1] )
+                        {
+                          writestrings (0, "\n", NULL);
+                          for (j=0; j < indent; j++ )
+                            writestrings (0, " ", NULL);
+                       }
+                   }
+                  else
+                    {
+                      tmp[0] = *s;
+                      tmp[1] = 0;
+                      writestrings (0, tmp, NULL);
+                    }
+               }
+           }
+          writestrings (0, "\n", NULL);
+       }
+       if ( (flags & ARGPARSE_FLAG_ONEDASH) )
+          writestrings (0, "\n(A single dash may be used "
+                        "instead of the double ones)\n", NULL);
+    }
+  if ( (s=_gpgrt_strusage(19)) )
+    {
+      writestrings (0, "\n", NULL);
+      writestrings (0, s, NULL);
+    }
+
+ leave:
+  flushstrings (0);
+  xfree (ordtbl);
+}
+
+
+static void
+show_version ()
+{
+  const char *s;
+  int i;
+
+  /* Version line.  */
+  writestrings (0, _gpgrt_strusage (11), NULL);
+  if ((s=_gpgrt_strusage (12)))
+    writestrings (0, " (", s, ")", NULL);
+  writestrings (0, " ", _gpgrt_strusage (13), "\n", NULL);
+  /* Additional version lines. */
+  for (i=20; i < 30; i++)
+    if ((s=_gpgrt_strusage (i)))
+      writestrings (0, s, "\n", NULL);
+  /* Copyright string.  */
+  if ((s=_gpgrt_strusage (14)))
+    writestrings (0, s, "\n", NULL);
+  /* Licence string.  */
+  if( (s=_gpgrt_strusage (10)) )
+    writestrings (0, s, "\n", NULL);
+  /* Copying conditions. */
+  if ( (s=_gpgrt_strusage(15)) )
+    writestrings (0, s, NULL);
+  /* Thanks. */
+  if ((s=_gpgrt_strusage(18)))
+    writestrings (0, s, NULL);
+  /* Additional program info. */
+  for (i=30; i < 40; i++ )
+    if ( (s=_gpgrt_strusage (i)) )
+      writestrings (0, s, NULL);
+  flushstrings (0);
+}
+
+
+/* Print the table of options with flags etc.  */
+static void
+dump_option_table (gpgrt_argparse_t *arg)
+{
+  opttable_t *opts;
+  unsigned int nopts;
+  const char *s;
+  char tmp[50];
+  unsigned int *ordtbl = NULL;
+  int i;
+
+  opts = arg->internal->opts;
+  nopts = arg->internal->nopts;
+  if (!nopts)
+    return;
+
+  ordtbl = xtrycalloc (nopts, sizeof *ordtbl);
+  if (!ordtbl)
+    {
+      writestrings (1, "\nOoops: Out of memory whilst dumping the table.\n",
+                    NULL);
+      flushstrings (1);
+      my_exit (arg, 2);
+    }
+  for (i=0; i < nopts; i++ )
+    ordtbl[i] = opts[i].ordinal;
+  qsort (ordtbl, nopts, sizeof *ordtbl, cmp_ordtbl);
+  for (i=0; i < nopts; i++ )
+    {
+      if (!opts[ordtbl[i]].long_opt)
+        continue;
+      writestrings (0, opts[ordtbl[i]].long_opt, ":", NULL);
+      snprintf (tmp, sizeof tmp, "%u:%u:",
+                opts[ordtbl[i]].short_opt,
+                opts[ordtbl[i]].flags);
+      writestrings (0, tmp, NULL);
+      s = opts[ordtbl[i]].description;
+      if (s)
+        {
+          for (; *s; s++)
+            {
+              if (*s == '%' || *s == ':' || *s == '\n')
+                snprintf (tmp, sizeof tmp, "%%%02X", *s);
+              else
+                {
+                  tmp[0] = *s;
+                  tmp[1] = 0;
+                }
+              writestrings (0, tmp, NULL);
+            }
+        }
+      writestrings (0, ":\n", NULL);
+    }
+
+  flushstrings (0);
+  xfree (ordtbl);
+  my_exit (arg, 0);
+}
+
+
+void
+_gpgrt_usage (int level)
+{
+  const char *p;
+
+  if (!level)
+    {
+      writestrings (1, _gpgrt_strusage(11), " ", _gpgrt_strusage(13), "; ",
+                    _gpgrt_strusage (14), "\n", NULL);
+      flushstrings (1);
+    }
+  else if (level == 1)
+    {
+      p = _gpgrt_strusage (40);
+      writestrings (1, p, NULL);
+      if (*p && p[strlen(p)] != '\n')
+        writestrings (1, "\n", NULL);
+      exit (2);
+    }
+  else if (level == 2)
+    {
+      p = _gpgrt_strusage (42);
+      if (p && *p == '1')
+        {
+          p = _gpgrt_strusage (40);
+          writestrings (1, p, NULL);
+          if (*p && p[strlen(p)] != '\n')
+            writestrings (1, "\n", NULL);
+        }
+      writestrings (0, _gpgrt_strusage(41), "\n", NULL);
+      exit (0);
+    }
+}
+
+/* Level
+ *     0: Print copyright string to stderr
+ *     1: Print a short usage hint to stderr and terminate
+ *     2: Print a long usage hint to stdout and terminate
+ *     8: Return NULL for UTF-8 or string with the native charset.
+ *     9: Return the SPDX License tag.
+ *    10: Return license info string
+ *    11: Return the name of the program
+ *    12: Return optional name of package which includes this program.
+ *    13: version  string
+ *    14: copyright string
+ *    15: Short copying conditions (with LFs)
+ *    16: Long copying conditions (with LFs)
+ *    17: Optional printable OS name
+ *    18: Optional thanks list (with LFs)
+ *    19: Bug report info
+ *20..29: Additional lib version strings.
+ *30..39: Additional program info (with LFs)
+ *    40: short usage note (with LF)
+ *    41: long usage note (with LF)
+ *    42: Flag string:
+ *          First char is '1':
+ *             The short usage notes needs to be printed
+ *             before the long usage note.
+ *    95: Application flag string
+ *          First character is '1':
+ *             On Windows enable argument globbing
+ */
+const char *
+_gpgrt_strusage (int level)
+{
+  const char *p = strusage_handler? strusage_handler(level) : NULL;
+  const char *tmp;
+
+  if ( p )
+    return map_fixed_string (p);
+
+  switch ( level )
+    {
+
+    case 8: break; /* Default to utf-8.  */
+    case 9:
+      p = "GPL-3.0-or-later"; /* Suggested license.  */
+      break;
+
+    case 10:
+      tmp = _gpgrt_strusage (9);
+      if (tmp && !strcmp (tmp, "GPL-2.0-or-later"))
+        p = ("License GNU GPL-2.0-or-later <https://gnu.org/licenses/>");
+      else if (tmp && !strcmp (tmp, "LGPL-2.1-or-later"))
+        p = ("License GNU LGPL-2.1-or-later <https://gnu.org/licenses/>");
+      else /* Default to GPLv3+.  */
+        p = ("License GNU GPL-3.0-or-later <https://gnu.org/licenses/gpl.html>");
+      break;
+    case 11: p = "foo"; break;
+    case 13: p = "0.0"; break;
+    case 14: p = "Copyright (C) YEAR NAME"; break;
+    case 15: p =
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n";
+      break;
+    case 16:
+      tmp = _gpgrt_strusage (9);
+      if (tmp && !strcmp (tmp, "GPL-2.0-or-later"))
+        p =
+"This is free software; you can redistribute it and/or modify\n"
+"it under the terms of the GNU General Public License as published by\n"
+"the Free Software Foundation; either version 2 of the License, or\n"
+"(at your option) any later version.\n\n"
+"It is distributed in the hope that it will be useful,\n"
+"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
+"GNU General Public License for more details.\n\n"
+"You should have received a copy of the GNU General Public License\n"
+"along with this software.  If not, see <https://gnu.org/licenses/>.\n";
+      else if (tmp && !strcmp (tmp, "LGPL-2.1-or-later"))
+        p =
+"This is free software; you can redistribute it and/or modify\n"
+"it under the terms of the GNU Lesser General Public License as\n"
+"published by the Free Software Foundation; either version 2.1 of\n"
+"the License, or (at your option) any later version.\n\n"
+"It is distributed in the hope that it will be useful,\n"
+"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
+"GNU Lesser General Public License for more details.\n\n"
+"You should have received a copy of the GNU Lesser General Public License\n"
+"along with this software.  If not, see <https://gnu.org/licenses/>.\n";
+      else /* Default */
+        p =
+"This is free software; you can redistribute it and/or modify\n"
+"it under the terms of the GNU General Public License as published by\n"
+"the Free Software Foundation; either version 3 of the License, or\n"
+"(at your option) any later version.\n\n"
+"It is distributed in the hope that it will be useful,\n"
+"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
+"GNU General Public License for more details.\n\n"
+"You should have received a copy of the GNU General Public License\n"
+"along with this software.  If not, see <https://gnu.org/licenses/>.\n";
+      break;
+    case 40: /* short and long usage */
+    case 41: p = ""; break;
+    }
+
+  return p;
+}
+
+
+/* Set the usage handler.  This function is basically a constructor.  */
+void
+_gpgrt_set_strusage (const char *(*f)(int) )
+{
+  strusage_handler = f;
+}
+
+
+/* Set a function to write strings which is then used instead of
+ * estream.  The first arg of that function is MODE and the second the
+ * STRING to write.  A mode of 1 is used for writing to stdout and a
+ * mode of 2 to write to stderr.  Other modes are reserved and should
+ * not output anything.  A NULL for STRING requests a flush.  */
+void
+_gpgrt_set_usage_outfnc (int (*f)(int, const char *))
+{
+  custom_outfnc = f;
+}
+
+
+/* Register function F as a string mapper which takes a string as
+ * argument, replaces known "@FOO@" style macros and returns a new
+ * fixed string.  Warning: The input STRING must have been allocated
+ * statically.  */
+void
+_gpgrt_set_fixed_string_mapper (const char *(*f)(const char*))
+{
+  fixed_string_mapper = f;
+}
+
+
+/* Register a configuration directory for use by the argparse
+ * functions.  The defined values for WHAT are:
+ *
+ *   GPGRT_CONFDIR_SYS   The systems's configuration dir.
+ *                       The default is /etc
+ *
+ *   GPGRT_CONFDIR_USER  The user's configuration directory.
+ *                       The default is $HOME.
+ *
+ * A trailing slash is ignored; to have the function lookup
+ * configuration files in the current directory, use ".".  There is no
+ * error return; more configuraion values may be added in future
+ * revisions of this library.
+ */
+void
+_gpgrt_set_confdir (int what, const char *name)
+{
+  char *buf, *p;
+
+  if (what == GPGRT_CONFDIR_SYS)
+    {
+      _gpgrt_free (confdir.sys);
+      buf = confdir.sys = _gpgrt_strdup (name);
+    }
+  else if (what == GPGRT_CONFDIR_USER)
+    {
+      _gpgrt_free (confdir.user);
+      buf = confdir.user = _gpgrt_strdup (name);
+    }
+  else
+    return;
+
+  if (!buf)
+    _gpgrt_log_fatal ("out of core in %s\n", __func__);
+#ifdef HAVE_W32_SYSTEM
+  for (p=buf; *p; p++)
+    if (*p == '\\')
+      *p = '/';
+#endif
+  /* Strip trailing slashes unless buf is "/" or any other single char
+   * string.  */
+  if (*buf)
+    {
+      for (p=buf + strlen (buf)-1; p > buf; p--)
+        if (*p == '/')
+          *p = 0;
+        else
+          break;
+    }
+}
index d846a6a..868d985 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2008, 2011 Free Software Foundation, Inc.
  * Copyright (C) 2008, 2011, 2016 g10 Code GmbH
  *
- * This file is part of GnuPG.
+ * This file is part of Libgpg-error.
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as
  *
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ * This file was originally a part of GnuPG.
  */
 
 #include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <assert.h>
 
 #include "gpgrt-int.h"
 
-struct _gpgrt_b64state
-{
-  int idx;
-  int quad_count;
-  char *title;
-  unsigned char radbuf[4];
-  int stop_seen:1;
-  int invalid_encoding:1;
-  gpg_error_t lasterr;
-};
 
 /* The reverse base-64 list used for base-64 decoding. */
 static unsigned char const asctobin[128] =
@@ -79,15 +71,15 @@ _gpgrt_b64dec_start (const char *title)
 
   if (title)
     {
-      t = strdup (title);
+      t = xtrystrdup (title);
       if (!t)
         return NULL;
     }
 
-  state = calloc (1, sizeof (struct _gpgrt_b64state));
+  state = xtrycalloc (1, sizeof (struct _gpgrt_b64state));
   if (!state)
     {
-      free (t);
+      xfree (t);
       return NULL;
     }
 
@@ -99,13 +91,15 @@ _gpgrt_b64dec_start (const char *title)
   else
     state->idx = s_b64_0;
 
+  state->using_decoder = 1;
+
   return state;
 }
 
 
 /* Do in-place decoding of base-64 data of LENGTH in BUFFER.  Stores the
    new length of the buffer at R_NBYTES. */
-gpg_error_t
+gpg_err_code_t
 _gpgrt_b64dec_proc (gpgrt_b64state_t state, void *buffer, size_t length,
                     size_t *r_nbytes)
 {
@@ -120,8 +114,8 @@ _gpgrt_b64dec_proc (gpgrt_b64state_t state, void *buffer, size_t length,
   if (state->stop_seen)
     {
       *r_nbytes = 0;
-      state->lasterr = gpg_error (GPG_ERR_EOF);
-      free (state->title);
+      state->lasterr = GPG_ERR_EOF;
+      xfree (state->title);
       state->title = NULL;
       return state->lasterr;
     }
@@ -140,6 +134,7 @@ _gpgrt_b64dec_proc (gpgrt_b64state_t state, void *buffer, size_t length,
           break;
         case s_init:
           ds = s_lfseen;
+          /* Fall through */
         case s_lfseen:
           if (*s != "-----BEGIN "[pos])
             {
@@ -246,7 +241,7 @@ _gpgrt_b64dec_proc (gpgrt_b64state_t state, void *buffer, size_t length,
             state->stop_seen = 1;
           break;
         default:
-          assert (!"invalid state");
+          gpgrt_assert (!"invalid state");
         }
     }
 
@@ -261,19 +256,24 @@ _gpgrt_b64dec_proc (gpgrt_b64state_t state, void *buffer, size_t length,
 
 /* Return an error code in case an encoding error has been found
    during decoding. */
-gpg_error_t
+gpg_err_code_t
 _gpgrt_b64dec_finish (gpgrt_b64state_t state)
 {
   gpg_error_t err;
 
-  if (state->lasterr)
+  if (!state)
+    return 0;  /* Already released.  */
+
+  if (!state->using_decoder)
+    err = GPG_ERR_CONFLICT;  /* State was allocated for the encoder.  */
+  else if (state->lasterr)
     err = state->lasterr;
   else
     {
-      free (state->title);
-      err = state->invalid_encoding? gpg_error(GPG_ERR_BAD_DATA): 0;
+      xfree (state->title);
+      err = state->invalid_encoding? GPG_ERR_BAD_DATA : 0;
     }
-  free (state);
+  xfree (state);
 
   return err;
 }
diff --git a/src/b64enc.c b/src/b64enc.c
new file mode 100644 (file)
index 0000000..571f4ec
--- /dev/null
@@ -0,0 +1,386 @@
+/* b64enc.c - Simple Base64 encoder.
+ * Copyright (C) 2001, 2003, 2004, 2008, 2010,
+ *               2011 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2003, 2004, 2008, 2010,
+ *               2011, 2018 g10 Code GmbH
+ *
+ * This file is part of Libgpg-error.
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ * This file was originally a part of GnuPG.
+ */
+
+#include <config.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include "gpgrt-int.h"
+
+
+#define B64ENC_DID_HEADER   1
+#define B64ENC_DID_TRAILER  2
+#define B64ENC_NO_LINEFEEDS 16
+#define B64ENC_USE_PGPCRC   32
+
+/* The base-64 character list */
+static unsigned char const bintoasc[64] = ("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                                           "abcdefghijklmnopqrstuvwxyz"
+                                           "0123456789+/");
+
+/* Stuff required to create the OpenPGP CRC.  This crc_table has been
+   created using this code:
+
+   #include <stdio.h>
+   #include <stdint.h>
+
+   #define CRCPOLY 0x864CFB
+
+   int
+   main (void)
+   {
+     int i, j;
+     uint32_t t;
+     uint32_t crc_table[256];
+
+     crc_table[0] = 0;
+     for (i=j=0; j < 128; j++ )
+       {
+         t = crc_table[j];
+         if ( (t & 0x00800000) )
+           {
+             t <<= 1;
+             crc_table[i++] = t ^ CRCPOLY;
+             crc_table[i++] = t;
+       }
+         else
+           {
+             t <<= 1;
+             crc_table[i++] = t;
+             crc_table[i++] = t ^ CRCPOLY;
+           }
+       }
+
+     puts ("static const u32 crc_table[256] = {");
+     for (i=j=0; i < 256; i++)
+       {
+         printf ("%s 0x%08lx", j? "":" ", (unsigned long)crc_table[i]);
+         if (i != 255)
+           {
+             putchar (',');
+             if ( ++j > 5)
+               {
+                 j = 0;
+                 putchar ('\n');
+               }
+           }
+       }
+     puts ("\n};");
+     return 0;
+   }
+*/
+#define CRCINIT 0xB704CE
+static const uint32_t crc_table[256] = {
+  0x00000000, 0x00864cfb, 0x018ad50d, 0x010c99f6, 0x0393e6e1, 0x0315aa1a,
+  0x021933ec, 0x029f7f17, 0x07a18139, 0x0727cdc2, 0x062b5434, 0x06ad18cf,
+  0x043267d8, 0x04b42b23, 0x05b8b2d5, 0x053efe2e, 0x0fc54e89, 0x0f430272,
+  0x0e4f9b84, 0x0ec9d77f, 0x0c56a868, 0x0cd0e493, 0x0ddc7d65, 0x0d5a319e,
+  0x0864cfb0, 0x08e2834b, 0x09ee1abd, 0x09685646, 0x0bf72951, 0x0b7165aa,
+  0x0a7dfc5c, 0x0afbb0a7, 0x1f0cd1e9, 0x1f8a9d12, 0x1e8604e4, 0x1e00481f,
+  0x1c9f3708, 0x1c197bf3, 0x1d15e205, 0x1d93aefe, 0x18ad50d0, 0x182b1c2b,
+  0x192785dd, 0x19a1c926, 0x1b3eb631, 0x1bb8faca, 0x1ab4633c, 0x1a322fc7,
+  0x10c99f60, 0x104fd39b, 0x11434a6d, 0x11c50696, 0x135a7981, 0x13dc357a,
+  0x12d0ac8c, 0x1256e077, 0x17681e59, 0x17ee52a2, 0x16e2cb54, 0x166487af,
+  0x14fbf8b8, 0x147db443, 0x15712db5, 0x15f7614e, 0x3e19a3d2, 0x3e9fef29,
+  0x3f9376df, 0x3f153a24, 0x3d8a4533, 0x3d0c09c8, 0x3c00903e, 0x3c86dcc5,
+  0x39b822eb, 0x393e6e10, 0x3832f7e6, 0x38b4bb1d, 0x3a2bc40a, 0x3aad88f1,
+  0x3ba11107, 0x3b275dfc, 0x31dced5b, 0x315aa1a0, 0x30563856, 0x30d074ad,
+  0x324f0bba, 0x32c94741, 0x33c5deb7, 0x3343924c, 0x367d6c62, 0x36fb2099,
+  0x37f7b96f, 0x3771f594, 0x35ee8a83, 0x3568c678, 0x34645f8e, 0x34e21375,
+  0x2115723b, 0x21933ec0, 0x209fa736, 0x2019ebcd, 0x228694da, 0x2200d821,
+  0x230c41d7, 0x238a0d2c, 0x26b4f302, 0x2632bff9, 0x273e260f, 0x27b86af4,
+  0x252715e3, 0x25a15918, 0x24adc0ee, 0x242b8c15, 0x2ed03cb2, 0x2e567049,
+  0x2f5ae9bf, 0x2fdca544, 0x2d43da53, 0x2dc596a8, 0x2cc90f5e, 0x2c4f43a5,
+  0x2971bd8b, 0x29f7f170, 0x28fb6886, 0x287d247d, 0x2ae25b6a, 0x2a641791,
+  0x2b688e67, 0x2beec29c, 0x7c3347a4, 0x7cb50b5f, 0x7db992a9, 0x7d3fde52,
+  0x7fa0a145, 0x7f26edbe, 0x7e2a7448, 0x7eac38b3, 0x7b92c69d, 0x7b148a66,
+  0x7a181390, 0x7a9e5f6b, 0x7801207c, 0x78876c87, 0x798bf571, 0x790db98a,
+  0x73f6092d, 0x737045d6, 0x727cdc20, 0x72fa90db, 0x7065efcc, 0x70e3a337,
+  0x71ef3ac1, 0x7169763a, 0x74578814, 0x74d1c4ef, 0x75dd5d19, 0x755b11e2,
+  0x77c46ef5, 0x7742220e, 0x764ebbf8, 0x76c8f703, 0x633f964d, 0x63b9dab6,
+  0x62b54340, 0x62330fbb, 0x60ac70ac, 0x602a3c57, 0x6126a5a1, 0x61a0e95a,
+  0x649e1774, 0x64185b8f, 0x6514c279, 0x65928e82, 0x670df195, 0x678bbd6e,
+  0x66872498, 0x66016863, 0x6cfad8c4, 0x6c7c943f, 0x6d700dc9, 0x6df64132,
+  0x6f693e25, 0x6fef72de, 0x6ee3eb28, 0x6e65a7d3, 0x6b5b59fd, 0x6bdd1506,
+  0x6ad18cf0, 0x6a57c00b, 0x68c8bf1c, 0x684ef3e7, 0x69426a11, 0x69c426ea,
+  0x422ae476, 0x42aca88d, 0x43a0317b, 0x43267d80, 0x41b90297, 0x413f4e6c,
+  0x4033d79a, 0x40b59b61, 0x458b654f, 0x450d29b4, 0x4401b042, 0x4487fcb9,
+  0x461883ae, 0x469ecf55, 0x479256a3, 0x47141a58, 0x4defaaff, 0x4d69e604,
+  0x4c657ff2, 0x4ce33309, 0x4e7c4c1e, 0x4efa00e5, 0x4ff69913, 0x4f70d5e8,
+  0x4a4e2bc6, 0x4ac8673d, 0x4bc4fecb, 0x4b42b230, 0x49ddcd27, 0x495b81dc,
+  0x4857182a, 0x48d154d1, 0x5d26359f, 0x5da07964, 0x5cace092, 0x5c2aac69,
+  0x5eb5d37e, 0x5e339f85, 0x5f3f0673, 0x5fb94a88, 0x5a87b4a6, 0x5a01f85d,
+  0x5b0d61ab, 0x5b8b2d50, 0x59145247, 0x59921ebc, 0x589e874a, 0x5818cbb1,
+  0x52e37b16, 0x526537ed, 0x5369ae1b, 0x53efe2e0, 0x51709df7, 0x51f6d10c,
+  0x50fa48fa, 0x507c0401, 0x5542fa2f, 0x55c4b6d4, 0x54c82f22, 0x544e63d9,
+  0x56d11cce, 0x56575035, 0x575bc9c3, 0x57dd8538
+};
+
+
+/* Prepare for Base-64 writing to STREAM.  If TITLE is not NULL and
+ * not an empty string, that string will be used as the title for the
+ * armor lines, with TITLE being an empty string, we don't write the
+ * header lines and furthermore even don't write any linefeeds.  If
+ * TITLE starts with "PGP " the OpenPGP CRC checksum will be written
+ * as well.  With TITLE being NULL, we merely don't write header but
+ * make sure that lines are not too long.  Note, that we don't write
+ * anything unless at least one byte is written using b64enc_write.
+ * On success an enoder object is returned which needs to be released
+ * using _gpgrt_b64dec_finish.  On error NULL is returned an ERRNO is
+ * set.
+ */
+gpgrt_b64state_t
+_gpgrt_b64enc_start (estream_t stream, const char *title)
+{
+  gpgrt_b64state_t state;
+
+  state = xtrycalloc (1, sizeof *state);
+  if (!state)
+    return NULL;
+
+  state->stream = stream;
+  if (title && !*title)
+    state->flags |= B64ENC_NO_LINEFEEDS;
+  else if (title)
+    {
+      if (!strncmp (title, "PGP ", 4))
+        {
+          state->flags |= B64ENC_USE_PGPCRC;
+          state->crc = CRCINIT;
+        }
+      state->title = xtrystrdup (title);
+      if (!state->title)
+        {
+          xfree (state);
+          return NULL;
+        }
+    }
+
+  return state;
+}
+
+
+/* Write NBYTES from BUFFER to the Base 64 stream identified by STATE.
+ * With BUFFER and NBYTES being 0, merely do a fflush on the stream.
+ */
+gpg_err_code_t
+_gpgrt_b64enc_write (gpgrt_b64state_t state, const void *buffer, size_t nbytes)
+{
+  unsigned char radbuf[4];
+  int idx, quad_count;
+  const unsigned char *p;
+
+  if (state->lasterr)
+    return state->lasterr;
+
+  if (!nbytes)
+    {
+      if (buffer)
+        if (_gpgrt_fflush (state->stream))
+          goto write_error;
+      return 0;
+    }
+
+  if (!(state->flags & B64ENC_DID_HEADER))
+    {
+      if (state->title)
+        {
+          if ( _gpgrt_fputs ("-----BEGIN ", state->stream) == EOF
+               || _gpgrt_fputs (state->title, state->stream) == EOF
+               || _gpgrt_fputs ("-----\n", state->stream) == EOF)
+            goto write_error;
+          if ( (state->flags & B64ENC_USE_PGPCRC)
+               && _gpgrt_fputs ("\n", state->stream) == EOF)
+            goto write_error;
+        }
+
+      state->flags |= B64ENC_DID_HEADER;
+    }
+
+  idx = state->idx;
+  quad_count = state->quad_count;
+  gpgrt_assert (idx < 4);
+  memcpy (radbuf, state->radbuf, idx);
+
+  if ( (state->flags & B64ENC_USE_PGPCRC) )
+    {
+      size_t n;
+      uint32_t crc = state->crc;
+
+      for (p=buffer, n=nbytes; n; p++, n-- )
+        crc = ((uint32_t)crc << 8) ^ crc_table[((crc >> 16)&0xff) ^ *p];
+      state->crc = (crc & 0x00ffffff);
+    }
+
+  for (p=buffer; nbytes; p++, nbytes--)
+    {
+      radbuf[idx++] = *p;
+      if (idx > 2)
+        {
+          char tmp[4];
+
+          tmp[0] = bintoasc[(*radbuf >> 2) & 077];
+          tmp[1] = bintoasc[(((*radbuf<<4)&060)|((radbuf[1] >> 4)&017))&077];
+          tmp[2] = bintoasc[(((radbuf[1]<<2)&074)|((radbuf[2]>>6)&03))&077];
+          tmp[3] = bintoasc[radbuf[2]&077];
+          for (idx=0; idx < 4; idx++)
+            _gpgrt_fputc (tmp[idx], state->stream);
+          idx = 0;
+          if (_gpgrt_ferror (state->stream))
+            goto write_error;
+
+          if (++quad_count >= (64/4))
+            {
+              quad_count = 0;
+              if (!(state->flags & B64ENC_NO_LINEFEEDS)
+                  && _gpgrt_fputs ("\n", state->stream) == EOF)
+                goto write_error;
+            }
+        }
+    }
+  memcpy (state->radbuf, radbuf, idx);
+  state->idx = idx;
+  state->quad_count = quad_count;
+  return 0;
+
+ write_error:
+  state->lasterr = _gpg_err_code_from_syserror ();
+  if (state->title)
+    {
+      xfree (state->title);
+      state->title = NULL;
+    }
+  return state->lasterr;
+}
+
+
+gpg_err_code_t
+_gpgrt_b64enc_finish (gpgrt_b64state_t state)
+{
+  gpg_err_code_t err = 0;
+  unsigned char radbuf[4];
+  int idx, quad_count;
+  char tmp[4];
+
+  if (!state)
+    return 0;  /* Already released.  */
+
+  if (state->using_decoder)
+    {
+      err = GPG_ERR_CONFLICT;  /* State was created for the decoder.  */
+      goto cleanup;
+    }
+
+  if (state->lasterr)
+    {
+      err = state->lasterr;
+      goto cleanup;
+    }
+
+  if (!(state->flags & B64ENC_DID_HEADER))
+    goto cleanup;
+
+  /* Flush the base64 encoding */
+  idx = state->idx;
+  quad_count = state->quad_count;
+  gpgrt_assert (idx < 4);
+  memcpy (radbuf, state->radbuf, idx);
+
+  if (idx)
+    {
+      tmp[0] = bintoasc[(*radbuf>>2)&077];
+      if (idx == 1)
+        {
+          tmp[1] = bintoasc[((*radbuf << 4) & 060) & 077];
+          tmp[2] = '=';
+          tmp[3] = '=';
+        }
+      else
+        {
+          tmp[1] = bintoasc[(((*radbuf<<4)&060)|((radbuf[1]>>4)&017))&077];
+          tmp[2] = bintoasc[((radbuf[1] << 2) & 074) & 077];
+          tmp[3] = '=';
+        }
+      for (idx=0; idx < 4; idx++)
+        _gpgrt_fputc (tmp[idx], state->stream);
+      if (_gpgrt_ferror (state->stream))
+        goto write_error;
+
+      if (++quad_count >= (64/4))
+        {
+          quad_count = 0;
+          if (!(state->flags & B64ENC_NO_LINEFEEDS)
+              && _gpgrt_fputs ("\n", state->stream) == EOF)
+            goto write_error;
+        }
+    }
+
+  /* Finish the last line and write the trailer. */
+  if (quad_count
+      && !(state->flags & B64ENC_NO_LINEFEEDS)
+      && _gpgrt_fputs ("\n", state->stream) == EOF)
+    goto write_error;
+
+  if ( (state->flags & B64ENC_USE_PGPCRC) )
+    {
+      /* Write the CRC.  */
+      _gpgrt_fputs ("=", state->stream);
+      radbuf[0] = state->crc >>16;
+      radbuf[1] = state->crc >> 8;
+      radbuf[2] = state->crc;
+      tmp[0] = bintoasc[(*radbuf>>2)&077];
+      tmp[1] = bintoasc[(((*radbuf<<4)&060)|((radbuf[1]>>4)&017))&077];
+      tmp[2] = bintoasc[(((radbuf[1]<<2)&074)|((radbuf[2]>>6)&03))&077];
+      tmp[3] = bintoasc[radbuf[2]&077];
+      for (idx=0; idx < 4; idx++)
+        _gpgrt_fputc (tmp[idx], state->stream);
+      if (_gpgrt_ferror (state->stream))
+        goto write_error;
+
+      if (!(state->flags & B64ENC_NO_LINEFEEDS)
+          && _gpgrt_fputs ("\n", state->stream) == EOF)
+        goto write_error;
+    }
+
+  if (state->title)
+    {
+      if ( _gpgrt_fputs ("-----END ", state->stream) == EOF
+           || _gpgrt_fputs (state->title, state->stream) == EOF
+           || _gpgrt_fputs ("-----\n", state->stream) == EOF)
+        goto write_error;
+    }
+
+ cleanup:
+  xfree (state->title);
+  xfree (state);
+  return err;
+
+ write_error:
+  err = gpg_error_from_syserror ();
+  goto cleanup;
+}
index 5249b08..c4786c9 100644 (file)
@@ -317,6 +317,12 @@ static const char msgstr[] =
   gettext_noop ("Already fetched") "\0"
   gettext_noop ("Try again later") "\0"
   gettext_noop ("Wrong name") "\0"
+  gettext_noop ("Not authenticated") "\0"
+  gettext_noop ("Bad authentication") "\0"
+  gettext_noop ("No Keybox daemon running") "\0"
+  gettext_noop ("Keybox daemon error") "\0"
+  gettext_noop ("Service is not running") "\0"
+  gettext_noop ("Service error") "\0"
   gettext_noop ("System bug detected") "\0"
   gettext_noop ("Unknown DNS error") "\0"
   gettext_noop ("Invalid DNS section") "\0"
@@ -423,6 +429,37 @@ static const char msgstr[] =
   gettext_noop ("User defined error code 14") "\0"
   gettext_noop ("User defined error code 15") "\0"
   gettext_noop ("User defined error code 16") "\0"
+  gettext_noop ("SQL success") "\0"
+  gettext_noop ("SQL error") "\0"
+  gettext_noop ("Internal logic error in SQL library") "\0"
+  gettext_noop ("Access permission denied (SQL)") "\0"
+  gettext_noop ("SQL abort was requested") "\0"
+  gettext_noop ("SQL database file is locked") "\0"
+  gettext_noop ("An SQL table in the database is locked") "\0"
+  gettext_noop ("SQL library ran out of core") "\0"
+  gettext_noop ("Attempt to write a readonly SQL database") "\0"
+  gettext_noop ("SQL operation terminated by interrupt") "\0"
+  gettext_noop ("I/O error during SQL operation") "\0"
+  gettext_noop ("SQL database disk image is malformed") "\0"
+  gettext_noop ("Unknown opcode in SQL file control") "\0"
+  gettext_noop ("Insertion failed because SQL database is full") "\0"
+  gettext_noop ("Unable to open the SQL database file") "\0"
+  gettext_noop ("SQL database lock protocol error") "\0"
+  gettext_noop ("(internal SQL code: empty)") "\0"
+  gettext_noop ("SQL database schema changed") "\0"
+  gettext_noop ("String or blob exceeds size limit (SQL)") "\0"
+  gettext_noop ("SQL abort due to constraint violation") "\0"
+  gettext_noop ("Data type mismatch (SQL)") "\0"
+  gettext_noop ("SQL library used incorrectly") "\0"
+  gettext_noop ("SQL library uses unsupported OS features") "\0"
+  gettext_noop ("Authorization denied (SQL)") "\0"
+  gettext_noop ("(unused SQL code: format)") "\0"
+  gettext_noop ("SQL bind parameter out of range") "\0"
+  gettext_noop ("File opened that is not an SQL database file") "\0"
+  gettext_noop ("Notifications from SQL logger") "\0"
+  gettext_noop ("Warnings from SQL logger") "\0"
+  gettext_noop ("SQL has another row ready") "\0"
+  gettext_noop ("SQL has finished executing") "\0"
   gettext_noop ("System error w/o errno") "\0"
   gettext_noop ("Unknown system error") "\0"
   gettext_noop ("End of file") "\0"
@@ -723,115 +760,152 @@ static const int msgidx[] =
     5780,
     5796,
     5807,
-    5827,
-    5845,
-    5865,
-    5894,
-    5919,
-    5945,
-    5970,
-    5997,
-    6009,
-    6028,
-    6057,
-    6081,
-    6109,
-    6136,
-    6162,
-    6191,
-    6215,
-    6240,
-    6267,
-    6296,
-    6313,
-    6338,
-    6361,
-    6383,
-    6402,
-    6424,
+    5825,
+    5844,
+    5869,
+    5889,
+    5912,
+    5926,
+    5946,
+    5964,
+    5984,
+    6013,
+    6038,
+    6064,
+    6089,
+    6116,
+    6128,
+    6147,
+    6176,
+    6200,
+    6228,
+    6255,
+    6281,
+    6310,
+    6334,
+    6359,
+    6386,
+    6415,
+    6432,
     6457,
-    6487,
-    6510,
-    6545,
-    6561,
-    6581,
-    6601,
-    6618,
-    6645,
-    6658,
+    6480,
+    6502,
+    6521,
+    6543,
+    6576,
+    6606,
+    6629,
+    6664,
     6680,
     6700,
-    6728,
-    6756,
-    6775,
-    6793,
-    6834,
-    6874,
-    6913,
-    6927,
-    6962,
-    7001,
-    7034,
-    7061,
-    7084,
-    7114,
-    7145,
-    7174,
-    7200,
-    7223,
-    7243,
-    7262,
-    7288,
-    7309,
+    6720,
+    6737,
+    6764,
+    6777,
+    6799,
+    6819,
+    6847,
+    6875,
+    6894,
+    6912,
+    6953,
+    6993,
+    7032,
+    7046,
+    7081,
+    7120,
+    7153,
+    7180,
+    7203,
+    7233,
+    7264,
+    7293,
+    7319,
     7342,
-    7379,
-    7413,
-    7438,
-    7467,
-    7487,
-    7514,
-    7550,
-    7572,
-    7594,
-    7622,
-    7661,
-    7695,
-    7717,
-    7749,
-    7772,
-    7809,
-    7838,
-    7855,
-    7883,
-    7910,
-    7931,
-    7958,
-    7982,
-    7997,
-    8025,
-    8049,
-    8068,
-    8090,
-    8127,
-    8153,
-    8179,
-    8205,
-    8231,
-    8257,
-    8283,
-    8309,
-    8335,
-    8361,
-    8388,
-    8415,
-    8442,
-    8469,
-    8496,
-    8523,
-    8550,
-    8573,
-    8594,
-    8606
+    7362,
+    7381,
+    7407,
+    7428,
+    7461,
+    7498,
+    7532,
+    7557,
+    7586,
+    7606,
+    7633,
+    7669,
+    7691,
+    7713,
+    7741,
+    7780,
+    7814,
+    7836,
+    7868,
+    7891,
+    7928,
+    7957,
+    7974,
+    8002,
+    8029,
+    8050,
+    8077,
+    8101,
+    8116,
+    8144,
+    8168,
+    8187,
+    8209,
+    8246,
+    8272,
+    8298,
+    8324,
+    8350,
+    8376,
+    8402,
+    8428,
+    8454,
+    8480,
+    8507,
+    8534,
+    8561,
+    8588,
+    8615,
+    8642,
+    8669,
+    8681,
+    8691,
+    8727,
+    8758,
+    8782,
+    8810,
+    8849,
+    8877,
+    8918,
+    8956,
+    8987,
+    9024,
+    9059,
+    9105,
+    9142,
+    9175,
+    9202,
+    9230,
+    9270,
+    9308,
+    9333,
+    9362,
+    9403,
+    9430,
+    9456,
+    9488,
+    9533,
+    9563,
+    9588,
+    9614,
+    9641,
+    9664,
+    9685,
+    9697
   };
 
 static GPG_ERR_INLINE int
@@ -841,20 +915,22 @@ msgidxof (int code)
   : ((code >= 0) && (code <= 213)) ? (code - 0)
   : ((code >= 217) && (code <= 271)) ? (code - 3)
   : ((code >= 273) && (code <= 281)) ? (code - 4)
-  : ((code >= 300) && (code <= 313)) ? (code - 22)
-  : ((code >= 666) && (code <= 666)) ? (code - 374)
-  : ((code >= 711) && (code <= 718)) ? (code - 418)
-  : ((code >= 721) && (code <= 729)) ? (code - 420)
-  : ((code >= 750) && (code <= 752)) ? (code - 440)
-  : ((code >= 754) && (code <= 782)) ? (code - 441)
-  : ((code >= 784) && (code <= 789)) ? (code - 442)
-  : ((code >= 800) && (code <= 804)) ? (code - 452)
-  : ((code >= 815) && (code <= 822)) ? (code - 462)
-  : ((code >= 832) && (code <= 839)) ? (code - 471)
-  : ((code >= 844) && (code <= 844)) ? (code - 475)
-  : ((code >= 848) && (code <= 848)) ? (code - 478)
-  : ((code >= 881) && (code <= 891)) ? (code - 510)
-  : ((code >= 1024) && (code <= 1039)) ? (code - 642)
-  : ((code >= 16381) && (code <= 16383)) ? (code - 15983)
-  : 16384 - 15983);
+  : ((code >= 300) && (code <= 319)) ? (code - 22)
+  : ((code >= 666) && (code <= 666)) ? (code - 368)
+  : ((code >= 711) && (code <= 718)) ? (code - 412)
+  : ((code >= 721) && (code <= 729)) ? (code - 414)
+  : ((code >= 750) && (code <= 752)) ? (code - 434)
+  : ((code >= 754) && (code <= 782)) ? (code - 435)
+  : ((code >= 784) && (code <= 789)) ? (code - 436)
+  : ((code >= 800) && (code <= 804)) ? (code - 446)
+  : ((code >= 815) && (code <= 822)) ? (code - 456)
+  : ((code >= 832) && (code <= 839)) ? (code - 465)
+  : ((code >= 844) && (code <= 844)) ? (code - 469)
+  : ((code >= 848) && (code <= 848)) ? (code - 472)
+  : ((code >= 881) && (code <= 891)) ? (code - 504)
+  : ((code >= 1024) && (code <= 1039)) ? (code - 636)
+  : ((code >= 1500) && (code <= 1528)) ? (code - 1096)
+  : ((code >= 1600) && (code <= 1601)) ? (code - 1167)
+  : ((code >= 16381) && (code <= 16383)) ? (code - 15946)
+  : 16384 - 15946);
 }
index 2667d71..c65775f 100644 (file)
 311    GPG_ERR_ALREADY_FETCHED         Already fetched
 312    GPG_ERR_TRY_LATER               Try again later
 313    GPG_ERR_WRONG_NAME              Wrong name
+314    GPG_ERR_NO_AUTH                 Not authenticated
+315    GPG_ERR_BAD_AUTH                Bad authentication
+316    GPG_ERR_NO_KEYBOXD              No Keybox daemon running
+317    GPG_ERR_KEYBOXD                 Keybox daemon error
+318    GPG_ERR_NO_SERVICE              Service is not running
+319    GPG_ERR_SERVICE                 Service error
 # This range is free for use.
 
 666    GPG_ERR_SYSTEM_BUG              System bug detected
 1038   GPG_ERR_USER_15                 User defined error code 15
 1039   GPG_ERR_USER_16                 User defined error code 16
 
-# 1040 to 16380 are free to be used.
+# 1040 to 1499 are free to be used.
+
+# 1500 to 1755 are mapped SQLite primary error codes.
+1500   GPG_ERR_SQL_OK          SQL success
+1501   GPG_ERR_SQL_ERROR       SQL error
+1502   GPG_ERR_SQL_INTERNAL    Internal logic error in SQL library
+1503   GPG_ERR_SQL_PERM        Access permission denied (SQL)
+1504   GPG_ERR_SQL_ABORT       SQL abort was requested
+1505   GPG_ERR_SQL_BUSY        SQL database file is locked
+1506   GPG_ERR_SQL_LOCKED      An SQL table in the database is locked
+1507   GPG_ERR_SQL_NOMEM       SQL library ran out of core
+1508   GPG_ERR_SQL_READONLY    Attempt to write a readonly SQL database
+1509   GPG_ERR_SQL_INTERRUPT   SQL operation terminated by interrupt
+1510   GPG_ERR_SQL_IOERR       I/O error during SQL operation
+1511   GPG_ERR_SQL_CORRUPT     SQL database disk image is malformed
+1512   GPG_ERR_SQL_NOTFOUND    Unknown opcode in SQL file control
+1513   GPG_ERR_SQL_FULL        Insertion failed because SQL database is full
+1514   GPG_ERR_SQL_CANTOPEN    Unable to open the SQL database file
+1515   GPG_ERR_SQL_PROTOCOL    SQL database lock protocol error
+1516   GPG_ERR_SQL_EMPTY       (internal SQL code: empty)
+1517   GPG_ERR_SQL_SCHEMA      SQL database schema changed
+1518   GPG_ERR_SQL_TOOBIG      String or blob exceeds size limit (SQL)
+1519   GPG_ERR_SQL_CONSTRAINT  SQL abort due to constraint violation
+1520   GPG_ERR_SQL_MISMATCH    Data type mismatch (SQL)
+1521   GPG_ERR_SQL_MISUSE      SQL library used incorrectly
+1522   GPG_ERR_SQL_NOLFS       SQL library uses unsupported OS features
+1523   GPG_ERR_SQL_AUTH        Authorization denied (SQL)
+1524   GPG_ERR_SQL_FORMAT      (unused SQL code: format)
+1525   GPG_ERR_SQL_RANGE       SQL bind parameter out of range
+1526   GPG_ERR_SQL_NOTADB      File opened that is not an SQL database file
+1527   GPG_ERR_SQL_NOTICE      Notifications from SQL logger
+1528   GPG_ERR_SQL_WARNING     Warnings from SQL logger
+
+# 1529 to 1599 are reserved for newer SQLite primary error codes.
+
+1600   GPG_ERR_SQL_ROW         SQL has another row ready
+1601   GPG_ERR_SQL_DONE        SQL has finished executing
+
+# 1602 to 1755 are reserved for newer SQLite primary error codes.
+
+# 1756 to 16380 are free to be used.
 
 16381  GPG_ERR_MISSING_ERRNO           System error w/o errno
 16382  GPG_ERR_UNKNOWN_ERRNO           Unknown system error
index 5160fd7..08be48d 100644 (file)
@@ -41,6 +41,7 @@ static const char msgstr[] =
   gettext_noop ("Kleopatra") "\0"
   gettext_noop ("G13") "\0"
   gettext_noop ("Assuan") "\0"
+  gettext_noop ("TPM2d") "\0"
   gettext_noop ("TLS") "\0"
   gettext_noop ("Any source") "\0"
   gettext_noop ("User defined source 1") "\0"
@@ -68,20 +69,20 @@ static const int msgidx[] =
     106,
     110,
     117,
-    121,
-    132,
-    154,
-    176,
-    198,
-    220
+    123,
+    127,
+    138,
+    160,
+    182,
+    204,
+    226
   };
 
 static GPG_ERR_INLINE int
 msgidxof (int code)
 {
   return (0 ? 0
-  : ((code >= 0) && (code <= 15)) ? (code - 0)
-  : ((code >= 17) && (code <= 17)) ? (code - 1)
-  : ((code >= 31) && (code <= 35)) ? (code - 14)
-  : 36 - 14);
+  : ((code >= 0) && (code <= 17)) ? (code - 0)
+  : ((code >= 31) && (code <= 35)) ? (code - 13)
+  : 36 - 13);
 }
index 13ca454..f6e3f1d 100644 (file)
 13     GPG_ERR_SOURCE_KLEO             Kleopatra
 14     GPG_ERR_SOURCE_G13              G13
 15     GPG_ERR_SOURCE_ASSUAN           Assuan
-
+16     GPG_ERR_SOURCE_TPM2D            TPM2d
 17     GPG_ERR_SOURCE_TLS              TLS
 
-# 15 to 30 are free to be used.
+# 18 to 30 are free to be used.
 
 31     GPG_ERR_SOURCE_ANY              Any source
 32     GPG_ERR_SOURCE_USER_1           User defined source 1
index f1cbcde..fe25657 100644 (file)
     AC_CHECK_TYPES([ptrdiff_t])      defines HAVE_PTRDIFF_T
     AC_CHECK_SIZEOF([unsigned long]) defines SIZEOF_UNSIGNED_LONG
     AC_CHECK_SIZEOF([void *])        defines SIZEOF_VOID_P
-                                             HAVE_LANGINFO_THOUSANDS_SEP
+                                             HAVE_LANGINFO_THOUSEP
 
     Note that the file estream.m4 provides the autoconf macro
     ESTREAM_PRINTF_INIT which runs all required checks.
     See estream-printf.h for ways to tune this code.
 
   Missing stuff:  wchar and wint_t
-                  thousands_sep in pr_float.
+                  thousep in pr_float.
 
 */
 
 #include <stdarg.h>
 #include <errno.h>
 #include <stddef.h>
-#include <assert.h>
 #if defined(HAVE_INTMAX_T) || defined(HAVE_UINTMAX_T)
 # ifdef HAVE_STDINT_H
 #  include <stdint.h>
 # endif
 #endif
-#ifdef HAVE_LANGINFO_THOUSANDS_SEP
+#ifdef HAVE_LANGINFO_THOUSEP
 #include <langinfo.h>
 #endif
 #ifdef HAVE_W32CE_SYSTEM
@@ -936,8 +935,8 @@ pr_integer (estream_printf_out_t outfnc, void *outfncarg,
     {
       int grouping = -1;
       const char * grouping_string =
-#ifdef HAVE_LANGINFO_THOUSANDS_SEP
-        nl_langinfo(THOUSANDS_SEP);
+#ifdef HAVE_LANGINFO_THOUSEP
+        nl_langinfo(THOUSEP);
 #else
         "'";
 #endif
@@ -1196,7 +1195,8 @@ pr_char (estream_printf_out_t outfnc, void *outfncarg,
 /* "s" formatting.  */
 static int
 pr_string (estream_printf_out_t outfnc, void *outfncarg,
-            argspec_t arg, value_t value, size_t *nbytes)
+           argspec_t arg, value_t value, size_t *nbytes,
+           gpgrt_string_filter_t sf, void *sfvalue, int string_no)
 {
   int rc;
   size_t n;
@@ -1204,7 +1204,11 @@ pr_string (estream_printf_out_t outfnc, void *outfncarg,
 
   if (arg->vt != VALTYPE_STRING)
     return -1;
-  string = value.a_string;
+  if (sf)
+    string = sf (value.a_string, string_no, sfvalue);
+  else
+    string = value.a_string;
+
   if (!string)
     string = "(null)";
   if (arg->precision >= 0)
@@ -1222,12 +1226,12 @@ pr_string (estream_printf_out_t outfnc, void *outfncarg,
     {
       rc = pad_out (outfnc, outfncarg, ' ', arg->width - n, nbytes);
       if (rc)
-        return rc;
+        goto leave;
     }
 
   rc = outfnc (outfncarg, string, n);
   if (rc)
-    return rc;
+    goto leave;
   *nbytes += n;
 
   if ((arg->flags & FLAG_LEFT_JUST)
@@ -1235,10 +1239,16 @@ pr_string (estream_printf_out_t outfnc, void *outfncarg,
     {
       rc = pad_out (outfnc, outfncarg, ' ', arg->width - n, nbytes);
       if (rc)
-        return rc;
+        goto leave;
     }
 
-  return 0;
+  rc = 0;
+
+ leave:
+  if (sf) /* Tell the filter to release resources.  */
+    sf (value.a_string, -1, sfvalue);
+
+  return rc;
 }
 
 
@@ -1337,14 +1347,18 @@ pr_bytes_so_far (estream_printf_out_t outfnc, void *outfncarg,
 
 
 /* Run the actual formatting.  OUTFNC and OUTFNCARG are the output
-   functions.  FORMAT is format string ARGSPECS is the parsed format
-   string, ARGSPECS_LEN the number of items in ARGSPECS.  VALUETABLE
-   holds the values and may be directly addressed using the position
-   arguments given by ARGSPECS.  MYERRNO is used for the "%m"
-   conversion. NBYTES well be updated to reflect the number of bytes
-   send to the output function. */
+ * functions.  FORMAT is format string ARGSPECS is the parsed format
+ * string, ARGSPECS_LEN the number of items in ARGSPECS.
+ * STRING_FILTER is an optional function to filter string (%s) args;
+ * it is called with the original string and the count of already
+ * processed %s arguments.  Its return value will be used instead of
+ * the original string.  VALUETABLE holds the values and may be
+ * directly addressed using the position arguments given by ARGSPECS.
+ * MYERRNO is used for the "%m" conversion. NBYTES well be updated to
+ * reflect the number of bytes send to the output function. */
 static int
 do_format (estream_printf_out_t outfnc, void *outfncarg,
+           gpgrt_string_filter_t sf, void *sfvalue,
            const char *format, argspec_t argspecs, size_t argspecs_len,
            valueitem_t valuetable, int myerrno, size_t *nbytes)
 {
@@ -1354,6 +1368,7 @@ do_format (estream_printf_out_t outfnc, void *outfncarg,
   int argidx = 0; /* Only used for assertion.  */
   size_t n;
   value_t value;
+  int string_no = 0;  /* Number of processed "%s" args.  */
 
   s = format;
   while ( *s )
@@ -1388,13 +1403,13 @@ do_format (estream_printf_out_t outfnc, void *outfncarg,
       s += arg->length;
       format = s;
 
-      assert (argidx < argspecs_len);
+      gpgrt_assert (argidx < argspecs_len);
       argidx++;
 
       /* Apply indirect field width and precision values.  */
       if (arg->width == STAR_FIELD_VALUE)
         {
-          assert (valuetable[arg->width_pos-1].vt == VALTYPE_INT);
+          gpgrt_assert (valuetable[arg->width_pos-1].vt == VALTYPE_INT);
           arg->width = valuetable[arg->width_pos-1].value.a_int;
           if (arg->width < 0)
             {
@@ -1404,7 +1419,7 @@ do_format (estream_printf_out_t outfnc, void *outfncarg,
         }
       if (arg->precision == STAR_FIELD_VALUE)
         {
-          assert (valuetable[arg->precision_pos-1].vt == VALTYPE_INT);
+          gpgrt_assert (valuetable[arg->precision_pos-1].vt == VALTYPE_INT);
           arg->precision = valuetable[arg->precision_pos-1].value.a_int;
           if (arg->precision < 0)
             arg->precision = NO_FIELD_VALUE;
@@ -1414,13 +1429,13 @@ do_format (estream_printf_out_t outfnc, void *outfncarg,
         value.a_string = strerror (myerrno);
       else
         {
-          assert (arg->vt == valuetable[arg->arg_pos-1].vt);
+          gpgrt_assert (arg->vt == valuetable[arg->arg_pos-1].vt);
           value = valuetable[arg->arg_pos-1].value;
         }
 
       switch (arg->conspec)
         {
-        case CONSPEC_UNKNOWN: assert (!"bug"); break;
+        case CONSPEC_UNKNOWN: gpgrt_assert (!"bug"); break;
 
         case CONSPEC_DECIMAL:
         case CONSPEC_UNSIGNED:
@@ -1443,8 +1458,12 @@ do_format (estream_printf_out_t outfnc, void *outfncarg,
           rc = pr_char (outfnc, outfncarg, arg, value, nbytes);
           break;
         case CONSPEC_STRING:
+          rc = pr_string (outfnc, outfncarg, arg, value, nbytes,
+                          sf, sfvalue, string_no++);
+          break;
         case CONSPEC_STRERROR:
-          rc = pr_string (outfnc, outfncarg, arg, value, nbytes);
+          rc = pr_string (outfnc, outfncarg, arg, value, nbytes,
+                          NULL, NULL, 0);
           break;
         case CONSPEC_POINTER:
           rc = pr_pointer (outfnc, outfncarg, arg, value, nbytes);
@@ -1478,6 +1497,7 @@ do_format (estream_printf_out_t outfnc, void *outfncarg,
 int
 _gpgrt_estream_format (estream_printf_out_t outfnc,
                        void *outfncarg,
+                       gpgrt_string_filter_t sf, void *sfvalue,
                        const char *format, va_list vaargs)
 {
   /* Buffer to hold the argspecs and a pointer to it.*/
@@ -1489,10 +1509,10 @@ _gpgrt_estream_format (estream_printf_out_t outfnc,
   struct valueitem_s valuetable_buffer[DEFAULT_MAX_VALUES];
   valueitem_t valuetable = valuetable_buffer;
 
-  int rc;     /* Return code. */
+  int rc;        /* Return code. */
   size_t argidx; /* Used to index the argspecs array.  */
   size_t validx; /* Used to index the valuetable.  */
-  int max_pos;/* Highest argument position.  */
+  int max_pos;   /* Highest argument position.  */
 
   size_t nbytes = 0; /* Keep track of the number of bytes passed to
                         the output function.  */
@@ -1565,7 +1585,11 @@ _gpgrt_estream_format (estream_printf_out_t outfnc,
   else
     {
       for (validx=0; validx < DIM(valuetable_buffer); validx++)
-        valuetable[validx].vt = VALTYPE_UNSUPPORTED;
+        {
+          valuetable[validx].vt = VALTYPE_UNSUPPORTED;
+          memset (&valuetable[validx].value, 0,
+                  sizeof valuetable[validx].value);
+        }
     }
   for (argidx=0; argidx < argspecs_len; argidx++)
     {
@@ -1602,7 +1626,7 @@ _gpgrt_estream_format (estream_printf_out_t outfnc,
 /*     fprintf (stderr, "%2d: vt=%d\n", validx, valuetable[validx].vt); */
 
   /* Everything has been collected, go ahead with the formatting.  */
-  rc = do_format (outfnc, outfncarg, format,
+  rc = do_format (outfnc, outfncarg, sf, sfvalue, format,
                   argspecs, argspecs_len, valuetable, myerrno, &nbytes);
 
   goto leave;
@@ -1642,7 +1666,8 @@ _gpgrt_estream_printf (const char *format, ...)
   va_list arg_ptr;
 
   va_start (arg_ptr, format);
-  rc = _gpgrt_estream_format (plain_stdio_out, stderr, format, arg_ptr);
+  rc = _gpgrt_estream_format (plain_stdio_out, stderr, NULL, NULL,
+                              format, arg_ptr);
   va_end (arg_ptr);
 
   return rc;
@@ -1656,7 +1681,8 @@ _gpgrt_estream_fprintf (FILE *fp, const char *format, ...)
   va_list arg_ptr;
 
   va_start (arg_ptr, format);
-  rc = _gpgrt_estream_format (plain_stdio_out, fp, format, arg_ptr);
+  rc = _gpgrt_estream_format (plain_stdio_out, fp, NULL, NULL,
+                              format, arg_ptr);
   va_end (arg_ptr);
 
   return rc;
@@ -1666,7 +1692,8 @@ _gpgrt_estream_fprintf (FILE *fp, const char *format, ...)
 int
 _gpgrt_estream_vfprintf (FILE *fp, const char *format, va_list arg_ptr)
 {
-  return _gpgrt_estream_format (plain_stdio_out, fp, format, arg_ptr);
+  return _gpgrt_estream_format (plain_stdio_out, fp, NULL, NULL,
+                                format, arg_ptr);
 }
 
 
@@ -1721,7 +1748,8 @@ _gpgrt_estream_vsnprintf (char *buf, size_t bufsize,
   parm.count = 0;
   parm.used = 0;
   parm.buffer = bufsize?buf:NULL;
-  rc = _gpgrt_estream_format (fixed_buffer_out, &parm, format, arg_ptr);
+  rc = _gpgrt_estream_format (fixed_buffer_out, &parm, NULL, NULL,
+                              format, arg_ptr);
   if (!rc)
     rc = fixed_buffer_out (&parm, "", 1); /* Print terminating Nul.  */
   if (rc == -1)
@@ -1816,7 +1844,8 @@ _gpgrt_estream_vasprintf (char **bufp, const char *format, va_list arg_ptr)
       return -1;
     }
 
-  rc = _gpgrt_estream_format (dynamic_buffer_out, &parm, format, arg_ptr);
+  rc = _gpgrt_estream_format (dynamic_buffer_out, &parm, NULL, NULL,
+                              format, arg_ptr);
   if (!rc)
     rc = dynamic_buffer_out (&parm, "", 1); /* Print terminating Nul.  */
   /* Fixme: Should we shrink the resulting buffer?  */
@@ -1833,7 +1862,7 @@ _gpgrt_estream_vasprintf (char **bufp, const char *format, va_list arg_ptr)
       *bufp = NULL;
       return -1;
     }
-  assert (parm.used);   /* We have at least the terminating Nul.  */
+  gpgrt_assert (parm.used);   /* We have at least the terminating Nul.  */
   *bufp = parm.buffer;
   return parm.used - 1; /* Do not include that Nul. */
 }
index ae303a7..69c7052 100644 (file)
@@ -124,8 +124,10 @@ typedef int (*estream_printf_out_t)
      (void *outfncarg,  const char *buf, size_t buflen);
 
 int _gpgrt_estream_format (estream_printf_out_t outfnc, void *outfncarg,
+                           char *(*string_filter)(const char *s,int n,void*st),
+                           void *string_filter_state,
                            const char *format, va_list vaargs)
-     _ESTREAM_GCC_A_PRINTF(3,0);
+     _ESTREAM_GCC_A_PRINTF(5,0);
 int _gpgrt_estream_printf (const char *format, ...)
      _ESTREAM_GCC_A_PRINTF(1,2);
 int _gpgrt_estream_fprintf (FILE *fp, const char *format, ... )
index 9f227a6..f75e052 100644 (file)
 #include <fcntl.h>
 #include <errno.h>
 #include <stddef.h>
-#include <assert.h>
 #ifdef HAVE_W32_SYSTEM
 # ifdef HAVE_WINSOCK2_H
 #  include <winsock2.h>
 # endif
 # include <windows.h>
+#else
+# ifdef HAVE_POLL_H
+#  include <poll.h>
+# endif
 #endif
 
 /* Enable tracing.  The value is the module name to be printed.  */
@@ -151,11 +154,7 @@ int _setmode (int handle, int mode);
 # define _set_errno(a)  do { errno = (a); } while (0)
 #endif
 
-#ifdef HAVE_W32_SYSTEM
-# define IS_INVALID_FD(a)    ((void*)(a) == (void*)(-1)) /* ?? FIXME.  */
-#else
-# define IS_INVALID_FD(a)    ((a) == -1)
-#endif
+#define IS_INVALID_FD(a)    ((a) == -1)
 
 /* Calculate array dimension.  */
 #ifndef DIM
@@ -201,14 +200,6 @@ GPGRT_LOCK_DEFINE (estream_list_lock);
 
 
 /*
- * Functions called before and after blocking syscalls.
- * gpgrt_set_syscall_clamp is used to set them.
- */
-static void (*pre_syscall_func)(void);
-static void (*post_syscall_func)(void);
-
-
-/*
  * Error code replacements.
  */
 #ifndef EOPNOTSUPP
@@ -247,7 +238,8 @@ mem_free (void *p)
 
 /*
  * A Windows helper function to map a W32 API error code to a standard
- * system error code.
+ * system error code.  That actually belong into sysutils but to allow
+ * standalone use of estream we keep it here.
  */
 #ifdef HAVE_W32_SYSTEM
 static int
@@ -265,11 +257,19 @@ map_w32_to_errno (DWORD w32_err)
       return ENOENT;
 
     case ERROR_ACCESS_DENIED:
-      return EPERM;
+      return EPERM;  /* ReactOS uses EACCES ("Permission denied") and
+                      * is likely right because they used an
+                      * undocumented function to associate the error
+                      * codes.  However we have always used EPERM
+                      * ("Operation not permitted", e.g. function is
+                      * required to be called by root) and we better
+                      * stick to that to avoid surprising bugs. */
 
     case ERROR_INVALID_HANDLE:
+      return EBADF;
+
     case ERROR_INVALID_BLOCK:
-      return EINVAL;
+      return ENOMEM;
 
     case ERROR_NOT_ENOUGH_MEMORY:
       return ENOMEM;
@@ -277,10 +277,90 @@ map_w32_to_errno (DWORD w32_err)
     case ERROR_NO_DATA:
       return EPIPE;
 
+    case ERROR_ALREADY_EXISTS:
+      return EEXIST;
+
+      /* This mapping has been taken from reactOS.  */
+    case ERROR_TOO_MANY_OPEN_FILES: return EMFILE;
+    case ERROR_ARENA_TRASHED: return ENOMEM;
+    case ERROR_BAD_ENVIRONMENT: return E2BIG;
+    case ERROR_BAD_FORMAT: return ENOEXEC;
+    case ERROR_INVALID_DRIVE: return ENOENT;
+    case ERROR_CURRENT_DIRECTORY: return EACCES;
+    case ERROR_NOT_SAME_DEVICE: return EXDEV;
+    case ERROR_NO_MORE_FILES: return ENOENT;
+    case ERROR_WRITE_PROTECT: return EACCES;
+    case ERROR_BAD_UNIT: return EACCES;
+    case ERROR_NOT_READY: return EACCES;
+    case ERROR_BAD_COMMAND: return EACCES;
+    case ERROR_CRC: return EACCES;
+    case ERROR_BAD_LENGTH: return EACCES;
+    case ERROR_SEEK: return EACCES;
+    case ERROR_NOT_DOS_DISK: return EACCES;
+    case ERROR_SECTOR_NOT_FOUND: return EACCES;
+    case ERROR_OUT_OF_PAPER: return EACCES;
+    case ERROR_WRITE_FAULT: return EACCES;
+    case ERROR_READ_FAULT: return EACCES;
+    case ERROR_GEN_FAILURE: return EACCES;
+    case ERROR_SHARING_VIOLATION: return EACCES;
+    case ERROR_LOCK_VIOLATION: return EACCES;
+    case ERROR_WRONG_DISK: return EACCES;
+    case ERROR_SHARING_BUFFER_EXCEEDED: return EACCES;
+    case ERROR_BAD_NETPATH: return ENOENT;
+    case ERROR_NETWORK_ACCESS_DENIED: return EACCES;
+    case ERROR_BAD_NET_NAME: return ENOENT;
+    case ERROR_FILE_EXISTS: return EEXIST;
+    case ERROR_CANNOT_MAKE: return EACCES;
+    case ERROR_FAIL_I24: return EACCES;
+    case ERROR_NO_PROC_SLOTS: return EAGAIN;
+    case ERROR_DRIVE_LOCKED: return EACCES;
+    case ERROR_BROKEN_PIPE: return EPIPE;
+    case ERROR_DISK_FULL: return ENOSPC;
+    case ERROR_INVALID_TARGET_HANDLE: return EBADF;
+    case ERROR_WAIT_NO_CHILDREN: return ECHILD;
+    case ERROR_CHILD_NOT_COMPLETE: return ECHILD;
+    case ERROR_DIRECT_ACCESS_HANDLE: return EBADF;
+    case ERROR_SEEK_ON_DEVICE: return EACCES;
+    case ERROR_DIR_NOT_EMPTY: return ENOTEMPTY;
+    case ERROR_NOT_LOCKED: return EACCES;
+    case ERROR_BAD_PATHNAME: return ENOENT;
+    case ERROR_MAX_THRDS_REACHED: return EAGAIN;
+    case ERROR_LOCK_FAILED: return EACCES;
+    case ERROR_INVALID_STARTING_CODESEG: return ENOEXEC;
+    case ERROR_INVALID_STACKSEG: return ENOEXEC;
+    case ERROR_INVALID_MODULETYPE: return ENOEXEC;
+    case ERROR_INVALID_EXE_SIGNATURE: return ENOEXEC;
+    case ERROR_EXE_MARKED_INVALID: return ENOEXEC;
+    case ERROR_BAD_EXE_FORMAT: return ENOEXEC;
+    case ERROR_ITERATED_DATA_EXCEEDS_64k: return ENOEXEC;
+    case ERROR_INVALID_MINALLOCSIZE: return ENOEXEC;
+    case ERROR_DYNLINK_FROM_INVALID_RING: return ENOEXEC;
+    case ERROR_IOPL_NOT_ENABLED: return ENOEXEC;
+    case ERROR_INVALID_SEGDPL: return ENOEXEC;
+    case ERROR_AUTODATASEG_EXCEEDS_64k: return ENOEXEC;
+    case ERROR_RING2SEG_MUST_BE_MOVABLE: return ENOEXEC;
+    case ERROR_RELOC_CHAIN_XEEDS_SEGLIM: return ENOEXEC;
+    case ERROR_INFLOOP_IN_RELOC_CHAIN: return ENOEXEC;
+    case ERROR_FILENAME_EXCED_RANGE: return ENOENT;
+    case ERROR_NESTING_NOT_ALLOWED: return EAGAIN;
+    case ERROR_NOT_ENOUGH_QUOTA: return ENOMEM;
+
     default:
       return EIO;
     }
 }
+
+/* Wrapper to be used by other modules to set ERRNO from the Windows
+ * error.  EC may be -1 to get the last error.  */
+void
+_gpgrt_w32_set_errno (int ec)
+{
+  if (ec == -1)
+    ec = GetLastError ();
+  _set_errno (map_w32_to_errno (ec));
+}
+
+
 #endif /*HAVE_W32_SYSTEM*/
 
 /*
@@ -459,17 +539,25 @@ do_list_add (estream_t stream, int with_locked_list)
 static void
 do_list_remove (estream_t stream, int with_locked_list)
 {
-  estream_list_t item;
+  estream_list_t item, item_prev = NULL;
 
   if (!with_locked_list)
     lock_list ();
 
   for (item = estream_list; item; item = item->next)
     if (item->stream == stream)
-      {
-        item->stream = NULL;
-        break;
-      }
+      break;
+    else
+      item_prev = item;
+
+  if (item)
+    {
+      if (item_prev)
+        item_prev->next = item->next;
+      else
+        estream_list = item->next;
+      mem_free (item);
+    }
 
   if (!with_locked_list)
     unlock_list ();
@@ -478,7 +566,7 @@ do_list_remove (estream_t stream, int with_locked_list)
 
 \f
 /*
- * The atexit handler for this estream module.
+ * The atexit handler for the entire gpgrt.
  */
 static void
 do_deinit (void)
@@ -495,10 +583,7 @@ do_deinit (void)
      we keep the list and let the OS clean it up at process end.  */
 
   /* Reset the syscall clamp.  */
-  pre_syscall_func = NULL;
-  post_syscall_func = NULL;
-  _gpgrt_thread_set_syscall_clamp (NULL, NULL);
-  _gpgrt_lock_set_lock_clamp (NULL, NULL);
+  _gpgrt_set_syscall_clamp (NULL, NULL);
 }
 
 
@@ -518,37 +603,6 @@ _gpgrt_estream_init (void)
   return 0;
 }
 
-/*
- * Register the syscall clamp.  These two functions are called
- * immediately before and after a possible blocking system call.  This
- * should be used before any I/O happens.  The function is commonly
- * used with the nPth library:
- *
- *    gpgrt_set_syscall_clamp (npth_unprotect, npth_protect);
- *
- * These functions may not modify ERRNO.
- */
-void
-_gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void))
-{
-  pre_syscall_func = pre;
-  post_syscall_func = post;
-  _gpgrt_thread_set_syscall_clamp (pre, post);
-  _gpgrt_lock_set_lock_clamp (pre, post);
-}
-
-/*
- * Return the current sycall clamp functions.  This can be used by
- * other libraries which have blocking functions.
- */
-void
-_gpgrt_get_syscall_clamp (void (**r_pre)(void), void (**r_post)(void))
-{
-  *r_pre  = pre_syscall_func;
-  *r_post = post_syscall_func;
-}
-
-
 \f
 /*
  * Implementation of memory based I/O.
@@ -682,7 +736,7 @@ func_mem_write (void *cookie, const void *buffer, size_t size)
       mem_cookie->offset = mem_cookie->data_len;
     }
 
-  assert (mem_cookie->memory_size >= mem_cookie->offset);
+  gpgrt_assert (mem_cookie->memory_size >= mem_cookie->offset);
   nleft = mem_cookie->memory_size - mem_cookie->offset;
 
   /* If we are not allowed to grow the buffer, limit the size to the
@@ -727,7 +781,7 @@ func_mem_write (void *cookie, const void *buffer, size_t size)
           return -1;
         }
 
-      assert (mem_cookie->func_realloc);
+      gpgrt_assert (mem_cookie->func_realloc);
       newbuf = mem_cookie->func_realloc (mem_cookie->memory, newsize);
       if (!newbuf)
         return -1;
@@ -735,10 +789,10 @@ func_mem_write (void *cookie, const void *buffer, size_t size)
       mem_cookie->memory = newbuf;
       mem_cookie->memory_size = newsize;
 
-      assert (mem_cookie->memory_size >= mem_cookie->offset);
+      gpgrt_assert (mem_cookie->memory_size >= mem_cookie->offset);
       nleft = mem_cookie->memory_size - mem_cookie->offset;
 
-      assert (size <= nleft);
+      gpgrt_assert (size <= nleft);
     }
 
   memcpy (mem_cookie->memory + mem_cookie->offset, buffer, size);
@@ -805,7 +859,7 @@ func_mem_seek (void *cookie, gpgrt_off_t *offset, int whence)
           return -1;
         }
 
-      assert (mem_cookie->func_realloc);
+      gpgrt_assert (mem_cookie->func_realloc);
       newbuf = mem_cookie->func_realloc (mem_cookie->memory, newsize);
       if (!newbuf)
         return -1;
@@ -849,6 +903,14 @@ func_mem_ioctl (void *cookie, int cmd, void *ptr, size_t *len)
       mem_cookie->offset = 0;
       ret = 0;
     }
+  else if (cmd == COOKIE_IOCTL_TRUNCATE)
+    {
+      gpgrt_off_t length = *(gpgrt_off_t *)ptr;
+
+      ret = func_mem_seek (cookie, &length, SEEK_SET);
+      if (ret != -1)
+        mem_cookie->data_len = mem_cookie->offset;
+    }
   else
     {
       _set_errno (EINVAL);
@@ -958,15 +1020,13 @@ func_fd_read (void *cookie, void *buffer, size_t size)
     }
   else
     {
-      if (pre_syscall_func)
-        pre_syscall_func ();
+      _gpgrt_pre_syscall ();
       do
         {
           bytes_read = read (file_cookie->fd, buffer, size);
         }
       while (bytes_read == -1 && errno == EINTR);
-      if (post_syscall_func)
-        post_syscall_func ();
+      _gpgrt_post_syscall ();
     }
 
   trace_errno (bytes_read == -1, ("leave: bytes_read=%d", (int)bytes_read));
@@ -992,15 +1052,13 @@ func_fd_write (void *cookie, const void *buffer, size_t size)
     }
   else if (buffer)
     {
-      if (pre_syscall_func)
-        pre_syscall_func ();
+      _gpgrt_pre_syscall ();
       do
         {
           bytes_written = write (file_cookie->fd, buffer, size);
         }
       while (bytes_written == -1 && errno == EINTR);
-      if (post_syscall_func)
-        post_syscall_func ();
+      _gpgrt_post_syscall ();
     }
   else
     bytes_written = size; /* Note that for a flush SIZE should be 0.  */
@@ -1028,11 +1086,9 @@ func_fd_seek (void *cookie, gpgrt_off_t *offset, int whence)
     }
   else
     {
-      if (pre_syscall_func)
-        pre_syscall_func ();
+      _gpgrt_pre_syscall ();
       offset_new = lseek (file_cookie->fd, *offset, whence);
-      if (post_syscall_func)
-        post_syscall_func ();
+      _gpgrt_post_syscall ();
       if (offset_new == -1)
         err = -1;
       else
@@ -1203,8 +1259,8 @@ func_w32_read (void *cookie, void *buffer, size_t size)
     }
   else
     {
-      if (pre_syscall_func && !w32_cookie->no_syscall_clamp)
-        pre_syscall_func ();
+      if (!w32_cookie->no_syscall_clamp)
+        _gpgrt_pre_syscall ();
       do
         {
           DWORD nread, ec;
@@ -1226,8 +1282,8 @@ func_w32_read (void *cookie, void *buffer, size_t size)
             bytes_read = (int)nread;
         }
       while (bytes_read == -1 && errno == EINTR);
-      if (post_syscall_func && !w32_cookie->no_syscall_clamp)
-        post_syscall_func ();
+      if (!w32_cookie->no_syscall_clamp)
+        _gpgrt_post_syscall ();
     }
 
   trace_errno (bytes_read==-1,("leave: bytes_read=%d", (int)bytes_read));
@@ -1256,8 +1312,8 @@ func_w32_write (void *cookie, const void *buffer, size_t size)
     }
   else if (buffer)
     {
-      if (pre_syscall_func && !w32_cookie->no_syscall_clamp)
-        pre_syscall_func ();
+      if (!w32_cookie->no_syscall_clamp)
+        _gpgrt_pre_syscall ();
       do
         {
           DWORD nwritten;
@@ -1274,8 +1330,8 @@ func_w32_write (void *cookie, const void *buffer, size_t size)
            bytes_written = (int)nwritten;
         }
       while (bytes_written == -1 && errno == EINTR);
-      if (post_syscall_func && !w32_cookie->no_syscall_clamp)
-        post_syscall_func ();
+      if (!w32_cookie->no_syscall_clamp)
+        _gpgrt_post_syscall ();
     }
   else
     bytes_written = size; /* Note that for a flush SIZE should be 0.  */
@@ -1325,17 +1381,16 @@ func_w32_seek (void *cookie, gpgrt_off_t *offset, int whence)
 #ifdef HAVE_W32CE_SYSTEM
 # warning need to use SetFilePointer
 #else
-  if (pre_syscall_func && !w32_cookie->no_syscall_clamp)
-    pre_syscall_func ();
+  if (!w32_cookie->no_syscall_clamp)
+    _gpgrt_pre_syscall ();
   if (!SetFilePointerEx (w32_cookie->hd, distance, &newoff, method))
     {
       _set_errno (map_w32_to_errno (GetLastError ()));
-      if (post_syscall_func)
-        post_syscall_func ();
+      _gpgrt_post_syscall ();
       return -1;
     }
-  if (post_syscall_func && !w32_cookie->no_syscall_clamp)
-    post_syscall_func ();
+  if (!w32_cookie->no_syscall_clamp)
+    _gpgrt_post_syscall ();
 #endif
   /* Note that gpgrt_off_t is always 64 bit.  */
   *offset = (gpgrt_off_t)newoff.QuadPart;
@@ -1460,11 +1515,9 @@ func_fp_read (void *cookie, void *buffer, size_t size)
 
   if (file_cookie->fp)
     {
-      if (pre_syscall_func)
-        pre_syscall_func ();
+      _gpgrt_pre_syscall ();
       bytes_read = fread (buffer, 1, size, file_cookie->fp);
-      if (post_syscall_func)
-        post_syscall_func ();
+      _gpgrt_post_syscall ();
     }
   else
     bytes_read = 0;
@@ -1485,8 +1538,7 @@ func_fp_write (void *cookie, const void *buffer, size_t size)
 
   if (file_cookie->fp)
     {
-      if (pre_syscall_func)
-        pre_syscall_func ();
+      _gpgrt_pre_syscall ();
       if (buffer)
         {
 #ifdef HAVE_W32_SYSTEM
@@ -1514,8 +1566,7 @@ func_fp_write (void *cookie, const void *buffer, size_t size)
         bytes_written = size;
 
       fflush (file_cookie->fp);
-      if (post_syscall_func)
-        post_syscall_func ();
+      _gpgrt_post_syscall ();
     }
   else
     bytes_written = size; /* Successfully written to the bit bucket.  */
@@ -1541,20 +1592,17 @@ func_fp_seek (void *cookie, gpgrt_off_t *offset, int whence)
       return -1;
     }
 
-  if (pre_syscall_func)
-    pre_syscall_func ();
+  _gpgrt_pre_syscall ();
   if ( fseek (file_cookie->fp, (long int)*offset, whence) )
     {
       /* fprintf (stderr, "\nfseek failed: errno=%d (%s)\n", */
       /*          errno,strerror (errno)); */
-      if (post_syscall_func)
-        post_syscall_func ();
+      _gpgrt_post_syscall ();
       return -1;
     }
 
   offset_new = ftell (file_cookie->fp);
-  if (post_syscall_func)
-    post_syscall_func ();
+  _gpgrt_post_syscall ();
   if (offset_new == -1)
     {
       /* fprintf (stderr, "\nftell failed: errno=%d (%s)\n",  */
@@ -1579,11 +1627,9 @@ func_fp_destroy (void *cookie)
     {
       if (fp_cookie->fp)
         {
-          if (pre_syscall_func)
-            pre_syscall_func ();
+          _gpgrt_pre_syscall ();
           fflush (fp_cookie->fp);
-          if (post_syscall_func)
-            post_syscall_func ();
+          _gpgrt_post_syscall ();
           err = fp_cookie->no_close? 0 : fclose (fp_cookie->fp);
         }
       else
@@ -1621,6 +1667,18 @@ static struct cookie_io_functions_s estream_functions_fp =
  * operations ares handled by file descriptor based I/O.
  */
 
+#ifdef HAVE_W32_SYSTEM
+static int
+any8bitchar (const char *string)
+{
+  if (string)
+    for ( ; *string; string++)
+      if ((*string & 0x80))
+        return 1;
+  return 0;
+}
+#endif /*HAVE_W32_SYSTEM*/
+
 /* Create function for objects identified by a file name.  */
 static int
 func_file_create (void **cookie, int *filedes,
@@ -1639,7 +1697,25 @@ func_file_create (void **cookie, int *filedes,
       goto out;
     }
 
+#ifdef HAVE_W32_SYSTEM
+  if (any8bitchar (path))
+    {
+      wchar_t *wpath;
+
+      wpath = _gpgrt_utf8_to_wchar (path);
+      if (!wpath)
+        fd = -1;
+      else
+        {
+          fd = _wopen (wpath, modeflags, cmode);
+          _gpgrt_free_wchar (wpath);
+        }
+    }
+  else  /* Avoid unnecessary conversion.  */
+    fd = open (path, modeflags, cmode);
+#else
   fd = open (path, modeflags, cmode);
+#endif
   if (fd == -1)
     {
       err = -1;
@@ -1686,7 +1762,7 @@ func_file_create (void **cookie, int *filedes,
  *    allowed to leave out trailing dashes.  If this keyword parameter
  *    is not given the default mode for creating files is "-rw-rw-r--"
  *    (664).  Note that the system still applies the current umask to
- *    the mode when crating a file.  Example:
+ *    the mode when creating a file.  Example:
  *
  *       "wb,mode=-rw-r--"
  *
@@ -1922,7 +1998,7 @@ flush_stream (estream_t stream)
   gpgrt_cookie_write_function_t func_write = stream->intern->func_write;
   int err;
 
-  assert (stream->flags.writing);
+  gpgrt_assert (stream->flags.writing);
 
   if (stream->data_offset)
     {
@@ -1975,14 +2051,15 @@ flush_stream (estream_t stream)
          stream->intern->offset += stream->data_offset;
          stream->data_offset = 0;
          stream->data_flushed = 0;
-
-         /* Propagate flush event.  */
-         (*func_write) (stream->intern->cookie, NULL, 0);
        }
     }
   else
     err = 0;
 
+  /* Always propagate flush event in case gpgrt_fflush was called
+   * explictly to do flush buffers in caller's cookie functions.  */
+  (*func_write) (stream->intern->cookie, NULL, 0);
+
  out:
 
   if (err && errno != EAGAIN)
@@ -2002,7 +2079,7 @@ flush_stream (estream_t stream)
 static void
 es_empty (estream_t stream)
 {
-  assert (!stream->flags.writing);
+  gpgrt_assert (!stream->flags.writing);
   stream->data_len = 0;
   stream->data_offset = 0;
   stream->unread_data_len = 0;
@@ -2209,10 +2286,11 @@ create_stream (estream_t *r_stream, void *cookie, es_syshd_t *syshd,
 
 
 /*
- * Deinitialize a stream object and destroy it.
+ * Deinitialize a stream object and destroy it.  With CANCEL_MODE set
+ * try to cancel as much as possible (see _gpgrt_fcancel).
  */
 static int
-do_close (estream_t stream, int with_locked_list)
+do_close (estream_t stream, int cancel_mode, int with_locked_list)
 {
   int err;
 
@@ -2221,6 +2299,11 @@ do_close (estream_t stream, int with_locked_list)
   if (stream)
     {
       do_list_remove (stream, with_locked_list);
+      if (cancel_mode)
+        {
+          stream->flags.writing = 0;
+          es_empty (stream);
+        }
       while (stream->intern->onclose)
         {
           notify_list_t tmp = stream->intern->onclose->next;
@@ -2233,6 +2316,8 @@ do_close (estream_t stream, int with_locked_list)
         }
       err = deinit_stream_obj (stream);
       destroy_stream_lock (stream);
+      if (stream->intern->deallocate_buffer)
+        mem_free (stream->buffer);
       mem_free (stream->intern);
       mem_free (stream);
     }
@@ -2983,7 +3068,7 @@ doreadline (estream_t _GPGRT__RESTRICT stream, size_t max_length,
  out:
 
   if (line_stream)
-    do_close (line_stream, 0);
+    do_close (line_stream, 0, 0);
   else if (line_stream_cookie)
     func_mem_destroy (line_stream_cookie);
 
@@ -3016,12 +3101,13 @@ print_writer (void *outfncarg, const char *buf, size_t buflen)
 /* The core of our printf function.  This is called in locked state. */
 static int
 do_print_stream (estream_t _GPGRT__RESTRICT stream,
+                 gpgrt_string_filter_t sf, void *sfvalue,
                  const char *_GPGRT__RESTRICT format, va_list ap)
 {
   int rc;
 
   stream->intern->print_ntotal = 0;
-  rc = _gpgrt_estream_format (print_writer, stream, format, ap);
+  rc = _gpgrt_estream_format (print_writer, stream, sf, sfvalue, format, ap);
   if (rc)
     return -1;
   return (int)stream->intern->print_ntotal;
@@ -3288,7 +3374,7 @@ _gpgrt_fopencookie (void *_GPGRT__RESTRICT cookie,
   estream_t stream;
   int err;
   es_syshd_t syshd;
-  struct cookie_io_functions_s io_functions = { functions, NULL, };
+  struct cookie_io_functions_s io_functions = { functions, NULL };
 
   stream = NULL;
   modeflags = 0;
@@ -3589,7 +3675,7 @@ _gpgrt__get_std_stream (int fd)
             {
               fprintf (stderr, "fatal: error creating a dummy estream"
                        " for %d: %s\n", fd, strerror (errno));
-              abort();
+              _gpgrt_abort();
             }
         }
 
@@ -3656,7 +3742,7 @@ _gpgrt_freopen (const char *_GPGRT__RESTRICT path,
          if (create_called)
            func_fd_destroy (cookie);
 
-         do_close (stream, 0);
+         do_close (stream, 0, 0);
          stream = NULL;
        }
       else
@@ -3671,7 +3757,7 @@ _gpgrt_freopen (const char *_GPGRT__RESTRICT path,
       /* FIXME?  We don't support re-opening at the moment.  */
       _set_errno (EINVAL);
       deinit_stream_obj (stream);
-      do_close (stream, 0);
+      do_close (stream, 0, 0);
       stream = NULL;
     }
 
@@ -3684,7 +3770,22 @@ _gpgrt_fclose (estream_t stream)
 {
   int err;
 
-  err = do_close (stream, 0);
+  err = do_close (stream, 0, 0);
+
+  return err;
+}
+
+
+/* gpgrt_fcancel does the same as gpgrt_fclose but tries to avoid
+ * flushing out any data still held in internal buffers.  It may or
+ * may not remove a new file created for that stream by the open
+ * function.  */
+int
+_gpgrt_fcancel (estream_t stream)
+{
+  int err;
+
+  err = do_close (stream, 1, 0);
 
   return err;
 }
@@ -3737,7 +3838,7 @@ _gpgrt_fclose_snatch (estream_t stream, void **r_buffer, size_t *r_buflen)
         *r_buflen = buflen;
     }
 
-  err = do_close (stream, 0);
+  err = do_close (stream, 0, 0);
 
  leave:
   if (err && r_buffer)
@@ -3765,8 +3866,10 @@ _gpgrt_fclose_snatch (estream_t stream, void **r_buffer, size_t *r_buflen)
 
    FIXME: Unregister is not thread safe.
 
-   The notification will be called right before the stream is closed.
-   It may not call any estream function for STREAM, neither direct nor
+   The notification will be called right before the stream is
+   closed. If gpgrt_fcancel is used, the cancellation of internal
+   buffers is done before the notifications.  The notification handler
+   may not call any estream function for STREAM, neither direct nor
    indirectly. */
 int
 _gpgrt_onclose (estream_t stream, int mode,
@@ -4069,6 +4172,29 @@ _gpgrt_rewind (estream_t stream)
 
 
 int
+_gpgrt_ftruncate (estream_t stream, gpgrt_off_t length)
+{
+  cookie_ioctl_function_t func_ioctl;
+  int ret;
+
+  lock_stream (stream);
+  func_ioctl = stream->intern->func_ioctl;
+  if (!func_ioctl)
+    {
+      _set_errno (EOPNOTSUPP);
+      ret = -1;
+    }
+  else
+    {
+      ret = func_ioctl (stream->intern->cookie, COOKIE_IOCTL_TRUNCATE,
+                        &length, NULL);
+    }
+  unlock_stream (stream);
+  return ret;
+}
+
+
+int
 _gpgrt__getc_underflow (estream_t stream)
 {
   int err;
@@ -4179,7 +4305,7 @@ _gpgrt_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
 {
   size_t ret, bytes;
 
-  if (size * nitems)
+  if (size && nitems)
     {
       lock_stream (stream);
       es_readn (stream, ptr, size * nitems, &bytes);
@@ -4200,7 +4326,7 @@ _gpgrt_fwrite (const void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
 {
   size_t ret, bytes;
 
-  if (size * nitems)
+  if (size && nitems)
     {
       lock_stream (stream);
       es_writen (stream, ptr, size * nitems, &bytes);
@@ -4343,7 +4469,7 @@ _gpgrt_getline (char *_GPGRT__RESTRICT *_GPGRT__RESTRICT lineptr,
 
    If a line has been truncated, the file pointer is moved forward to
    the end of the line so that the next read starts with the next
-   line.  Note that MAX_LENGTH must be re-initialzied in this case.
+   line.  Note that MAX_LENGTH must be re-initialized in this case.
 
    The caller initially needs to provide the address of a variable,
    initialized to NULL, at ADDR_OF_BUFFER and don't change this value
@@ -4455,22 +4581,24 @@ _gpgrt_read_line (estream_t stream,
 
 int
 _gpgrt_vfprintf_unlocked (estream_t _GPGRT__RESTRICT stream,
+                          gpgrt_string_filter_t sf, void *sfvalue,
                           const char *_GPGRT__RESTRICT format,
                           va_list ap)
 {
-  return do_print_stream (stream, format, ap);
+  return do_print_stream (stream, sf, sfvalue, format, ap);
 }
 
 
 int
 _gpgrt_vfprintf (estream_t _GPGRT__RESTRICT stream,
+                 gpgrt_string_filter_t sf, void *sfvalue,
                  const char *_GPGRT__RESTRICT format,
                  va_list ap)
 {
   int ret;
 
   lock_stream (stream);
-  ret = do_print_stream (stream, format, ap);
+  ret = do_print_stream (stream, sf, sfvalue, format, ap);
   unlock_stream (stream);
 
   return ret;
@@ -4485,7 +4613,7 @@ _gpgrt_fprintf_unlocked (estream_t _GPGRT__RESTRICT stream,
 
   va_list ap;
   va_start (ap, format);
-  ret = do_print_stream (stream, format, ap);
+  ret = do_print_stream (stream, NULL, NULL, format, ap);
   va_end (ap);
 
   return ret;
@@ -4501,7 +4629,7 @@ _gpgrt_fprintf (estream_t _GPGRT__RESTRICT stream,
   va_list ap;
   va_start (ap, format);
   lock_stream (stream);
-  ret = do_print_stream (stream, format, ap);
+  ret = do_print_stream (stream, NULL, NULL, format, ap);
   unlock_stream (stream);
   va_end (ap);
 
@@ -4573,7 +4701,7 @@ tmpfd (void)
 #ifdef HAVE_W32CE_SYSTEM
           int fd = (int)file;
 #else
-          int fd = _open_osfhandle ((long)file, 0);
+          int fd = _open_osfhandle ((intptr_t)file, 0);
           if (fd == -1)
             {
               CloseHandle (file);
@@ -4791,9 +4919,14 @@ _gpgrt_poll (gpgrt_poll_t *fds, unsigned int nfds, int timeout)
   int count = 0;
   int idx;
 #ifndef HAVE_W32_SYSTEM
+# ifdef HAVE_POLL_H
+  struct pollfd *poll_fds = NULL;
+  nfds_t poll_nfds;
+# else
   fd_set readfds, writefds, exceptfds;
   int any_readfd, any_writefd, any_exceptfd;
   int max_fd;
+#endif
   int fd, ret, any;
 #endif /*HAVE_W32_SYSTEM*/
 
@@ -4843,15 +4976,49 @@ _gpgrt_poll (gpgrt_poll_t *fds, unsigned int nfds, int timeout)
     }
 
   if (count)
-    goto leave;  /* Early return without waiting.  */
+    goto leave;
 
   /* Now do the real select.  */
 #ifdef HAVE_W32_SYSTEM
 
+  _gpgrt_pre_syscall ();
   count = _gpgrt_w32_poll (fds, nfds, timeout);
+  _gpgrt_post_syscall ();
 
 #else /*!HAVE_W32_SYSTEM*/
+# ifdef HAVE_POLL_H
+  poll_fds = xtrymalloc (sizeof (*poll_fds)*nfds);
+  if (!poll_fds)
+    {
+      count = -1;
+      goto leave;
+    }
+  poll_nfds = 0;
+  for (item = fds, idx = 0; idx < nfds; item++, idx++)
+    {
+      if (item->ignore)
+        continue;
+      fd = _gpgrt_fileno (item->stream);
+      if (fd == -1)
+        continue;  /* Stream does not support polling.  */
 
+      if (item->want_read || item->want_write || item->want_oob)
+        {
+          poll_fds[poll_nfds].fd = fd;
+          poll_fds[poll_nfds].events = ((item->want_read ? POLLIN : 0)
+                                        |(item->want_write ? POLLOUT : 0)
+                                        |(item->want_oob ? POLLPRI : 0));
+          poll_fds[poll_nfds].revents = 0;
+          poll_nfds++;
+        }
+    }
+
+  _gpgrt_pre_syscall ();
+  do
+    ret = poll (poll_fds, poll_nfds, timeout);
+  while (ret == -1 && (errno == EINTR || errno == EAGAIN));
+  _gpgrt_post_syscall ();
+# else /* !HAVE_POLL_H */
   any_readfd = any_writefd = any_exceptfd = 0;
   max_fd = 0;
   for (item = fds, idx = 0; idx < nfds; item++, idx++)
@@ -4897,8 +5064,7 @@ _gpgrt_poll (gpgrt_poll_t *fds, unsigned int nfds, int timeout)
         }
     }
 
-  if (pre_syscall_func)
-    pre_syscall_func ();
+  _gpgrt_pre_syscall ();
   do
     {
       struct timeval timeout_val;
@@ -4912,12 +5078,16 @@ _gpgrt_poll (gpgrt_poll_t *fds, unsigned int nfds, int timeout)
                     timeout == -1 ? NULL : &timeout_val);
     }
   while (ret == -1 && errno == EINTR);
-  if (post_syscall_func)
-    post_syscall_func ();
+  _gpgrt_post_syscall ();
+# endif
 
   if (ret == -1)
     {
+# ifdef HAVE_POLL_H
+      trace_errno (1, ("poll failed: "));
+# else
       trace_errno (1, ("select failed: "));
+# endif
       count = -1;
       goto leave;
     }
@@ -4929,6 +5099,48 @@ _gpgrt_poll (gpgrt_poll_t *fds, unsigned int nfds, int timeout)
       goto leave;
     }
 
+# ifdef HAVE_POLL_H
+  poll_nfds = 0;
+  for (item = fds, idx = 0; idx < nfds; item++, idx++)
+    {
+      if (item->ignore)
+        continue;
+      fd = _gpgrt_fileno (item->stream);
+      if (fd == -1)
+        {
+          item->got_err = 1;  /* Stream does not support polling.  */
+          count++;
+          continue;
+        }
+
+      any = 0;
+      if (item->stream->intern->indicators.hup)
+        {
+          item->got_hup = 1;
+          any = 1;
+        }
+      if (item->want_read && (poll_fds[poll_nfds].revents & (POLLIN|POLLHUP)))
+        {
+          item->got_read = 1;
+          any = 1;
+        }
+      if (item->want_write && (poll_fds[poll_nfds].revents & POLLOUT))
+        {
+          item->got_write = 1;
+          any = 1;
+        }
+      if (item->want_oob && (poll_fds[poll_nfds].revents & ~(POLLIN|POLLOUT)))
+        {
+          item->got_oob = 1;
+          any = 1;
+        }
+
+      if (item->want_read || item->want_write || item->want_oob)
+        poll_nfds++;
+      if (any)
+        count++;
+    }
+# else
   for (item = fds, idx = 0; idx < nfds; item++, idx++)
     {
       if (item->ignore)
@@ -4966,9 +5178,15 @@ _gpgrt_poll (gpgrt_poll_t *fds, unsigned int nfds, int timeout)
       if (any)
         count++;
     }
+# endif
 #endif /*!HAVE_W32_SYSTEM*/
 
  leave:
+#ifndef HAVE_W32_SYSTEM
+# ifdef HAVE_POLL_H
+  xfree (poll_fds);
+# endif
+#endif
 #ifdef ENABLE_TRACING
   trace (("leave: count=%d", count));
   if (count > 0)
diff --git a/src/gen-lock-obj.sh b/src/gen-lock-obj.sh
new file mode 100755 (executable)
index 0000000..014667f
--- /dev/null
@@ -0,0 +1,136 @@
+#! /bin/sh
+#
+# gen-lock-obj.sh - Build tool to construct the lock object.
+#
+# Copyright (C) 2020, 2021  g10 Code GmbH
+#
+# This file is part of libgpg-error.
+#
+# libgpg-error is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# libgpg-error 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, see <https://www.gnu.org/licenses/>.
+#
+
+#
+# Following variables should be defined to invoke this script
+#
+#   CC
+#   OBJDUMP
+#   AWK
+#   ac_ext
+#   ac_object
+#   host
+#   LOCK_ABI_VERSION
+#
+# An example:
+#
+# LOCK_ABI_VERSION=1 host=x86_64-pc-linux-gnu host_alias=x86_64-linux-gnu \
+#     CC=$host_alias-gcc OBJDUMP=$host_alias-objdump ac_ext=c ac_objext=o \
+#     AWK=gawk ./gen-lock-obj.sh
+#
+
+if test -n "`echo -n`"; then
+    ECHO_C='\c'
+    ECHO_N=''
+else
+    ECHO_C=''
+    ECHO_N='-n'
+fi
+
+if test "$1" = --disable-threads; then
+    cat <<EOF
+## lock-obj-pub.$host.h - NO LOCK SUPPORT
+## File created by gen-lock-obj.sh - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+/* Dummy object - no locking available.  */
+typedef struct
+{
+  long _vers;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {-1}
+EOF
+else
+AWK_VERSION_OUTPUT=$($AWK 'BEGIN { print PROCINFO["version"] }')
+if test -n "$AWK_VERSION_OUTPUT"; then
+    # It's GNU awk, which supports PROCINFO.
+    AWK_OPTION=--non-decimal-data
+fi
+
+cat <<'EOF' >conftest.$ac_ext
+#include <pthread.h>
+pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
+EOF
+
+if $CC -c conftest.$ac_ext; then :
+  ac_mtx_size=$($OBJDUMP -j .bss -t conftest.$ac_objext \
+         | $AWK $AWK_OPTION '
+/mtx$/ { mtx_size = int("0x" $5) }
+END { print mtx_size }')
+else
+    echo "Can't determine mutex size"
+    exit 1
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+cat <<EOF
+## lock-obj-pub.$host.h
+## File created by gen-lock-obj.sh - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+  long _vers;
+  union {
+    volatile char _priv[$ac_mtx_size];
+    long _x_align;
+    long *_xp_align;
+  } u;
+} gpgrt_lock_t;
+
+EOF
+
+# FIXME: Support different alignment conditions of:
+#
+#     USE_16BYTE_ALIGNMENT
+#     USE_DOUBLE_FOR_ALIGNMENT
+#     USE_LONG_DOUBLE_FOR_ALIGNMENT
+#
+
+echo ${ECHO_N} "#define GPGRT_LOCK_INITIALIZER {$LOCK_ABI_VERSION,{{${ECHO_C}"
+
+i=0
+while test "$i" -lt $ac_mtx_size; do
+    if test "$i" -ne 0 -a "$(( $i % 8 ))" -eq 0; then
+        echo ' \'
+        echo ${ECHO_N} "                                    ${ECHO_C}"
+    fi
+    echo ${ECHO_N} "0${ECHO_C}"
+    if test "$i" -lt $(($ac_mtx_size - 1)); then
+        echo ${ECHO_N} ",${ECHO_C}"
+    fi
+    i=$(( i + 1 ))
+done
+echo '}}}'
+fi
+
+cat <<'EOF'
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
+EOF
+
+exit 0
diff --git a/src/gpg-error-config-test.sh b/src/gpg-error-config-test.sh
new file mode 100755 (executable)
index 0000000..081358c
--- /dev/null
@@ -0,0 +1,98 @@
+#!/bin/sh
+
+srcdir=${0%/*}
+
+PKG_CONFIG_PATH="."
+
+export PKG_CONFIG_PATH
+
+if [ "$1" = --old-new ]; then
+    PKG_CONFIG_CMD=./gpg-error-config-old
+    # Old gpg-error-config never supports PKG_CONFIG_SYSROOT_DIR
+    unset PKG_CONFIG_SYSROOT_DIR
+else
+    pkg_config_min_version=0.29
+    PKG_CONFIG_SYSROOT_DIR="/var/example-target"
+    export PKG_CONFIG_SYSROOT_DIR
+    PKG_CONFIG_CMD="pkg-config gpg-error"
+    check_ver=$( ($PKG_CONFIG_CMD --version; echo $pkg_config_min_version) | \
+                 sort -t '.' -n -k1,1 -k2,2 -k3,3 | sed 1q )
+    if [ $check_ver != $pkg_config_min_version ]; then
+       exit 77                 # Skip tests, because it's too old
+    fi
+    if ! $PKG_CONFIG_CMD --exists >/dev/null; then
+       exit 77                 # Skip tests
+    fi
+fi
+
+test_failed=""
+
+failure () {
+    (
+       echo "Test result: $*"
+       echo "====================: $PKG_CONFIG_CMD"
+       echo "$OUTPUT_OLD"
+       echo "====================: gpgrt-config"
+       echo "$OUTPUT_NEW"
+       echo "===================="
+    ) >> gpg-error-config-test.log
+    test_failed=yes
+}
+
+rm -f gpg-error-config-test.log
+
+OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --libs))
+OUTPUT_NEW=$($srcdir/gpgrt-config --libs)
+[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --libs
+
+OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --cflags))
+OUTPUT_NEW=$($srcdir/gpgrt-config --cflags)
+[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --cflags
+
+OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --cflags --libs))
+OUTPUT_NEW=$($srcdir/gpgrt-config --cflags --libs)
+[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --cflags --libs
+
+if [ "$PKG_CONFIG_CMD" = ./gpg-error-config-old ]; then
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --version))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --version)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --version
+
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --mt --libs))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --mt --libs)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --mt --libs
+
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --mt --cflags))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --mt --cflags)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --mt --cflags
+
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --cflags --libs))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --cflags --libs)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --cflags --libs
+
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --mt --cflags --libs))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --mt --cflags --libs)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --mt --cflags --libs
+
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --variable=mtcflags))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --variable=mtcflags)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --variable=mtcflags
+
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --variable=mtlibs))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --variable=mtlibs)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --variable=mtlibs
+
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --variable=host))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --variable=host)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --variable=host
+fi
+
+if [ -n "$test_failed" ]; then
+    OUTPUT_OLD=$($PKG_CONFIG_CMD --version)
+    OUTPUT_NEW=$($srcdir/gpgrt-config --version)
+    failure --version
+
+    exit 99
+fi
+
+exit 0
diff --git a/src/gpg-error-config-test.sh.in b/src/gpg-error-config-test.sh.in
new file mode 100644 (file)
index 0000000..b888aa2
--- /dev/null
@@ -0,0 +1,98 @@
+#!@INSTALLSHELLPATH@
+
+srcdir=${0%/*}
+
+PKG_CONFIG_PATH="."
+
+export PKG_CONFIG_PATH
+
+if [ "$1" = --old-new ]; then
+    PKG_CONFIG_CMD=./gpg-error-config-old
+    # Old gpg-error-config never supports PKG_CONFIG_SYSROOT_DIR
+    unset PKG_CONFIG_SYSROOT_DIR
+else
+    pkg_config_min_version=0.29
+    PKG_CONFIG_SYSROOT_DIR="/var/example-target"
+    export PKG_CONFIG_SYSROOT_DIR
+    PKG_CONFIG_CMD="pkg-config gpg-error"
+    check_ver=$( ($PKG_CONFIG_CMD --version; echo $pkg_config_min_version) | \
+                 sort -t '.' -n -k1,1 -k2,2 -k3,3 | sed 1q )
+    if [ $check_ver != $pkg_config_min_version ]; then
+       exit 77                 # Skip tests, because it's too old
+    fi
+    if ! $PKG_CONFIG_CMD --exists >/dev/null; then
+       exit 77                 # Skip tests
+    fi
+fi
+
+test_failed=""
+
+failure () {
+    (
+       echo "Test result: $*"
+       echo "====================: $PKG_CONFIG_CMD"
+       echo "$OUTPUT_OLD"
+       echo "====================: gpgrt-config"
+       echo "$OUTPUT_NEW"
+       echo "===================="
+    ) >> gpg-error-config-test.log
+    test_failed=yes
+}
+
+rm -f gpg-error-config-test.log
+
+OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --libs))
+OUTPUT_NEW=$($srcdir/gpgrt-config --libs)
+[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --libs
+
+OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --cflags))
+OUTPUT_NEW=$($srcdir/gpgrt-config --cflags)
+[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --cflags
+
+OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --cflags --libs))
+OUTPUT_NEW=$($srcdir/gpgrt-config --cflags --libs)
+[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --cflags --libs
+
+if [ "$PKG_CONFIG_CMD" = ./gpg-error-config-old ]; then
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --version))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --version)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --version
+
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --mt --libs))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --mt --libs)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --mt --libs
+
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --mt --cflags))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --mt --cflags)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --mt --cflags
+
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --cflags --libs))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --cflags --libs)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --cflags --libs
+
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --mt --cflags --libs))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --mt --cflags --libs)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --mt --cflags --libs
+
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --variable=mtcflags))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --variable=mtcflags)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --variable=mtcflags
+
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --variable=mtlibs))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --variable=mtlibs)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --variable=mtlibs
+
+    OUTPUT_OLD=$(echo $($PKG_CONFIG_CMD --variable=host))
+    OUTPUT_NEW=$($srcdir/gpgrt-config --variable=host)
+    [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --variable=host
+fi
+
+if [ -n "$test_failed" ]; then
+    OUTPUT_OLD=$($PKG_CONFIG_CMD --version)
+    OUTPUT_NEW=$($srcdir/gpgrt-config --version)
+    failure --version
+
+    exit 99
+fi
+
+exit 0
index bc1c583..3b45928 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@INSTALLSHELLPATH@
 # Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
 #
 # This file is free software; as a special exception the author gives
@@ -8,13 +8,18 @@
 # This file is distributed in the hope that it will be useful, but
 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
+# SPDX-License-Identifier: FSFULLR
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 includedir=@includedir@
 libdir=@libdir@
-isubdirafter="@GPG_ERROR_CONFIG_ISUBDIRAFTER@"
+
+if echo "$0" | grep gpg-error-config 2>/dev/null >/dev/null; then
+  myname="gpg-error-config"
+else
+  myname="gpgrt-config"
+fi
 
 output=""
 mt=no
@@ -22,7 +27,7 @@ mt=no
 usage()
 {
     cat <<EOF
-Usage: gpg-error-config [OPTIONS]
+Usage: $myname [OPTIONS]
 Options:
         [--mt]       (must be the first option)
        [--prefix]
@@ -58,31 +63,27 @@ while test $# -gt 0; do
         --exec-prefix)
            output="$output $exec_prefix"
            ;;
-        --version)
+        --modversion|--version)
             echo "@PACKAGE_VERSION@"
            exit 0
            ;;
+       --variable=*)
+           case "${1#*=}" in
+               prefix) echo "$prefix" ;;
+               exec_prefix) echo "$exec_prefix" ;;
+               host) echo "@GPG_ERROR_CONFIG_HOST@" ;;
+               mtcflags) echo "@GPG_ERROR_CONFIG_MT_CFLAGS@" ;;
+               mtlibs) echo "@GPG_ERROR_CONFIG_MT_LIBS@";;
+           esac
+           exit 0
+           ;;
         --cflags)
-           if test "x$includedir" != "x/usr/include" -a "x$includedir" != "x/include"; then
-               output="$output -I$includedir"
-           fi
-            # Note: -idirafter is a gcc extension.  It is only used on
-            #       systems where gcc is the only compiler we support.
-            for i in $isubdirafter; do
-                output="$output -idirafter ${includedir}/${i}"
-            done
            output="$output @GPG_ERROR_CONFIG_CFLAGS@"
             if test $mt = yes ; then
                 output="$output @GPG_ERROR_CONFIG_MT_CFLAGS@"
             fi
            ;;
        --libs)
-           case "$libdir" in
-               /usr/lib|/usr/lib64|/lib|/lib64) ;;
-               *)
-                   output="$output -L$libdir"
-                   ;;
-           esac
            output="$output @GPG_ERROR_CONFIG_LIBS@"
             if test $mt = yes ; then
                 output="$output @GPG_ERROR_CONFIG_MT_LIBS@"
index f890883..4e8bd8b 100644 (file)
@@ -168,6 +168,10 @@ const char *gpg_strerror_sym (gpg_error_t err);
 const char *gpg_strsource_sym (gpg_error_t err);
 
 \f
+/* Parse string STR assuming it is either a single number N or in the
+ * form K.N to denote an error source code K and and error code N.
+ * Returns false on error (e.g. invalid number) or true for valid
+ * codes; if true is returned a full error code is stored at ERR.  */
 static int
 get_err_from_number (char *str, gpg_error_t *err)
 {
@@ -199,6 +203,15 @@ get_err_from_number (char *str, gpg_error_t *err)
 }
 
 
+/* Helper function to parse a symbol either with a "GPG_ERR_SOURCE_"
+ * or "GPG_ERR_" prefix.  If the symbol is not available false is
+ * return; else the symbols value is ORed into the value at ERR
+ * (shifted for a GPG_ERR_SOURCE_) and true returned.  HAVE_SOURCE and
+ * HAVE_CODE are expected to be addresses where a 0 is stored; a 1 is
+ * stored at the respective address to mark whether a code or source
+ * value was found.  If one of those state variables already point to
+ * a true value the function will return 0 and not change the value at
+ * ERR.  */
 static int
 get_err_from_symbol_one (char *str, gpg_error_t *err,
                         int *have_source, int *have_code)
@@ -251,6 +264,11 @@ get_err_from_symbol_one (char *str, gpg_error_t *err,
 }
 
 
+/* Parse string STR assuming it is either a single symbol C or in the
+ * form S.C to denote an error source symbold S and and error code
+ * symbold C.  Returns false on error (e.g. invalid number) or true
+ * for valid codes; if true is returned a full error code is stored at
+ * ERR.  */
 static int
 get_err_from_symbol (char *str, gpg_error_t *err)
 {
@@ -286,6 +304,44 @@ get_err_from_symbol (char *str, gpg_error_t *err)
 }
 
 
+/* Parse string STR assuming it partial code symbol and store its
+ * value at ERR and return true.  */
+static int
+get_err_from_codesymbol (char *str, gpg_error_t *err)
+{
+  static const char code_prefix[] = "GPG_ERR_";
+  gpg_err_code_t code;
+
+  *err = 0;
+
+  /* Skip an optional prefix.  */
+  if (!strncasecmp (code_prefix, str, sizeof (code_prefix) - 1))
+    str += sizeof (code_prefix) - 1;
+
+  for (code = 0; code < GPG_ERR_CODE_DIM; code++)
+    {
+      const char *code_sym = gpg_strerror_sym (code);
+      if (code_sym
+          && !strcasecmp (str, code_sym + sizeof (code_prefix) - 1))
+        {
+          *err |= code;
+          return 1;
+        }
+    }
+  return 0;
+}
+
+
+/* Helper function to parse a string which maps back to a source or
+ * code value.  If no source or code for the symbold is available
+ * false is return; else the source or code value is ORed into the
+ * value at ERR (shifted for a GPG_ERR_SOURCE_) and true returned.
+ * The match is first tried on source values and then on code values.
+ * HAVE_SOURCE and HAVE_CODE are expected to be addresses where a 0 is
+ * stored; a 1 is stored at the respective address to mark whether a
+ * code or source value was found.  If one of those state variables
+ * already point to a true value the function will return 0 and not
+ * change the value at ERR.  */
 static int
 get_err_from_str_one (char *str, gpg_error_t *err,
                      int *have_source, int *have_code)
@@ -325,6 +381,11 @@ get_err_from_str_one (char *str, gpg_error_t *err,
 }
 
 
+/* Parse string STR assuming it is either a single desription string C
+ * or in the form S.C to denote an error source descrition S and and
+ * error code description C.  Returns false on error (e.g. invalid
+ * symbol) or true for valid codes; if true is returned a full error
+ * code is stored at ERR.  */
 static int
 get_err_from_str (char *str, gpg_error_t *err)
 {
@@ -336,10 +397,13 @@ get_err_from_str (char *str, gpg_error_t *err)
   char saved_char = 0; /* (avoid warning) */
 
   *err = 0;
+  /* First match on the entire string to handle the case that it is
+   * code description with spaces.  */
   ret = get_err_from_str_one (str, err, &have_source, &have_code);
   if (ret)
     return ret;
 
+  /* Then figure out whether the first string is a simple word.  */
   while (*str2 && ((*str2 >= 'A' && *str2 <= 'Z')
                   || (*str2 >= 'a' && *str2 <= 'z')
                   || (*str2 >= '0' && *str2 <= '9')
@@ -442,26 +506,36 @@ print_desc (const char *symbol)
 
 \f
 
-static int
-show_usage (const char *name)
+static const char *
+my_strusage (int level)
 {
-  if (name)
+  const char *p;
+
+  switch (level)
     {
-      fprintf (stderr, _("Usage: %s GPG-ERROR [...]\n"),
-               strrchr (name,'/')? (strrchr (name, '/')+1): name);
-      exit (1);
+    case  9: p = "LGPL-2.1-or-later"; break;
+
+    case 11: p = "gpg-error"; break;
+    case 12: p = PACKAGE_NAME; break;
+    case 13: p = PACKAGE_VERSION; break;
+    case 14: p = "Copyright (C) 2019 g10 Code GmbH"; break;
+    case 19: p = _("Please report bugs to <https://bugs.gnupg.org>.\n"); break;
+
+    case 1:
+    case 40:
+      p = ("Usage: gpg-error [options] error-numbers");
+      break;
+    case 41:
+      p = ("Map error numbers to strings and vice versa.\n");
+      break;
+
+    case 42:
+      p = "1"; /* Flag: print 40 as part of 41. */
+      break;
+
+    default: p = NULL; break;
     }
-
-  fputs ("gpg-error (" PACKAGE_NAME ") " PACKAGE_VERSION "\n", stdout);
-  fputs ("Options:\n"
-         "  --version      Print version\n"
-         "  --lib-version  Print library version\n"
-         "  --help         Print this help\n"
-         "  --list         Print all error codes\n"
-         "  --defines      Print all error codes as #define lines\n"
-         "  --desc         Print with error description\n"
-         , stdout);
-  exit (0);
+  return p;
 }
 
 
@@ -469,74 +543,122 @@ show_usage (const char *name)
 int
 main (int argc, char *argv[])
 {
-  const char *pgmname = argv[0];
-  int last_argc = -1;
+  enum { CMD_DEFAULT     = 0,
+         CMD_LIB_VERSION = 501,
+         CMD_LIST,
+         CMD_DEFINES,
+         CMD_LOCALE,
+         OPT_DESC
+  };
+  static gpgrt_opt_t opts[] = {
+    ARGPARSE_c (CMD_LIB_VERSION, "lib-version",
+                "Print library version"),
+    ARGPARSE_c (CMD_LIST, "list",
+                "Print all error codes"),
+    ARGPARSE_c (CMD_DEFINES, "defines",
+                "Print all error codes as #define lines"),
+#if HAVE_W32_SYSTEM
+    ARGPARSE_c (CMD_LOCALE, "locale",
+                "Return the locale used for gettext"),
+#else
+    ARGPARSE_c (CMD_LOCALE, "locale",
+                "@"),
+#endif
+    ARGPARSE_s_n (OPT_DESC, "desc",
+                  "Print with error description"),
+    ARGPARSE_end()
+  };
+  gpgrt_argparse_t pargs = { &argc, &argv };
+
   int i;
+  int libversion = 0;
   int listmode = 0;
+  int localemode = 0;
   int desc = 0;
+  const char *s, *s2;
   const char *source_sym;
   const char *error_sym;
   gpg_error_t err;
 
   gpgrt_init ();
   i18n_init ();
+  gpgrt_set_strusage (my_strusage);
+  gpgrt_log_set_prefix (gpgrt_strusage (11), GPGRT_LOG_WITH_PREFIX);
 
 
-  if (argc)
+  while (gpgrt_argparse (NULL, &pargs, opts))
     {
-      argc--; argv++;
-    }
-  while (argc && last_argc != argc )
-    {
-      last_argc = argc;
-      if (!strcmp (*argv, "--"))
-        {
-          argc--; argv++;
-          break;
-        }
-      else if (!strcmp (*argv, "--version"))
+      switch (pargs.r_opt)
         {
-          fputs ("gpg-error (" PACKAGE_NAME ") " PACKAGE_VERSION "\n", stdout);
-          exit (0);
+        case CMD_LIB_VERSION: libversion = 1; break;
+        case CMD_LIST:       listmode = 1; break;
+        case CMD_DEFINES:    listmode = 2; break;
+        case CMD_LOCALE:     localemode = 1; break;
+        case OPT_DESC:       desc = 1; break;
+        default: pargs.err = ARGPARSE_PRINT_WARNING; break;
         }
-      else if (!strcmp (*argv, "--help"))
-        {
-          show_usage (NULL);
-        }
-      else if (!strcmp (*argv, "--lib-version"))
-        {
-          argc--; argv++;
-          printf ("Version from header: %s (0x%06x)\n",
-                  GPG_ERROR_VERSION, GPG_ERROR_VERSION_NUMBER);
-          printf ("Version from binary: %s\n", gpg_error_check_version (NULL));
-          printf ("Copyright blurb ...:%s\n",
-                  gpg_error_check_version ("\x01\x01"));
-          exit (0);
-        }
-      else if (!strcmp (*argv, "--list"))
-        {
-          listmode = 1;
-          argc--; argv++;
-        }
-      else if (!strcmp (*argv, "--defines"))
+    }
+  gpgrt_argparse (NULL, &pargs, NULL);  /* Free internal memory.  */
+
+  if (libversion)
+    {
+      if (argc)
+        gpgrt_usage (1);
+    }
+  else if (localemode)
+    {
+      if (argc > 1)
+        gpgrt_usage (1);
+    }
+  else if ((argc && listmode) || (!argc && !listmode))
+    gpgrt_usage (1);
+
+
+  if (libversion)
+    {
+      argc--; argv++;
+      printf ("Version from header: %s (0x%06x)\n",
+              GPG_ERROR_VERSION, GPG_ERROR_VERSION_NUMBER);
+      printf ("Version from binary: %s\n", gpg_error_check_version (NULL));
+      s = gpg_error_check_version ("\x01\x01");
+      while (*s && *s == '\n')
+        s++;
+      fputs ("Copyright blurb ...: ", stdout);
+      for (; *s; s++)
         {
-          listmode = 2;
-          argc--; argv++;
+          if (*s == '\n')
+            {
+              for (s2=s+1; *s2 == '\n'; s2++)
+                ;
+              if (!*s2)
+                break;  /* Cut off trailing LFs.  */
+              fputs ("\n                     ", stdout);
+            }
+          else
+            putc (*s, stdout);
         }
-      else if (!strcmp (*argv, "--desc"))
+      putc ('\n', stdout);
+    }
+  else if (localemode)
+    {
+#if HAVE_W32_SYSTEM
+      if (argc)
         {
-          desc = 1;
-          argc--; argv++;
+          /* Warning: What we do here is not allowed because
+           * gpgrt_w32_override_locale needs to be called as early as
+           * possible.  However for this very purpose it is okay.  */
+          if (**argv >= '0' && **argv <= '9')
+            gpgrt_w32_override_locale (NULL, strtoul (*argv, NULL, 0));
+          else
+            gpgrt_w32_override_locale (*argv, 0);
         }
-      else if (!strncmp (*argv, "--", 2))
-        show_usage (pgmname);
-    }
-
-  if ((argc && listmode) || (!argc && !listmode))
-    show_usage (pgmname);
-
 
-  if (listmode == 1)
+      printf ("%s\n", gettext_localename ());
+#else
+      log_info ("this command is only useful on Windows\n");
+#endif
+    }
+  else if (listmode == 1)
     {
       for (i=0; i <  GPG_ERR_SOURCE_DIM; i++)
         {
@@ -615,8 +737,15 @@ main (int argc, char *argv[])
     {
       for (i=0; i < argc; i++)
         {
+          /* First check the arg is a number N or K.N,
+           * then check the arg for CODESYM or SOURCESYM.CODESYM,
+           * then check the arg for CODESYM or CODESYM w/o GPG_ERR_ prefix,
+           * then check the arg for code description
+           *                     or symbol dot code description.
+           */
           if (get_err_from_number (argv[i], &err)
               || get_err_from_symbol (argv[i], &err)
+              || get_err_from_codesymbol (argv[i], &err)
               || get_err_from_str (argv[i], &err))
             {
               source_sym = gpg_strsource_sym (err);
@@ -630,8 +759,7 @@ main (int argc, char *argv[])
                 print_desc (error_sym);
             }
           else
-            fprintf (stderr, _("%s: warning: could not recognize %s\n"),
-                     argv[0], argv[i]);
+            log_error (_("warning: could not recognize %s\n"), argv[i]);
         }
     }
 
index ad65f8c..769be1b 100644 (file)
@@ -15,6 +15,7 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1+
  *
  * Note: This file should be updated manually and the ordinals shall
  * never be changed.  Also check gpg-error.vers and visibility.h.
@@ -156,4 +157,89 @@ EXPORTS
  gpgrt_b64dec_proc            @114
  gpgrt_b64dec_finish          @115
 
+ gpgrt_get_errorcount         @116
+ gpgrt_inc_errorcount         @117
+ gpgrt_log_set_sink           @118
+ gpgrt_log_set_socket_dir_cb  @119
+ gpgrt_log_set_pid_suffix_cb  @120
+ gpgrt_log_set_prefix         @121
+ gpgrt_log_get_prefix         @122
+ gpgrt_log_test_fd            @123
+ gpgrt_log_get_fd             @124
+ gpgrt_log_get_stream         @125
+ gpgrt_log                    @126
+ gpgrt_logv                   @127
+ gpgrt_logv_prefix            @128
+ gpgrt_log_string             @129
+ gpgrt_log_bug                @130
+ gpgrt_log_fatal              @131
+ gpgrt_log_error              @132
+ gpgrt_log_info               @133
+ gpgrt_log_debug              @134
+ gpgrt_log_debug_string       @135
+ gpgrt_log_printf             @136
+ gpgrt_log_printhex           @137
+ gpgrt_log_clock              @138
+ gpgrt_log_flush              @139
+ _gpgrt_log_assert            @140
+
+ gpgrt_realloc                @141
+ gpgrt_malloc                 @142
+ gpgrt_calloc                 @143
+ gpgrt_strdup                 @144
+ gpgrt_strconcat              @145
+
+ gpgrt_w32_reg_query_string   @146
+
+ gpgrt_getenv                 @147
+ gpgrt_setenv                 @148
+ gpgrt_mkdir                  @149
+ gpgrt_chdir                  @150
+ gpgrt_getcwd                 @151
+
+;; API not yet finished for:
+;; gpgrt_make_pipe              @152
+;; gpgrt_spawn_process          @153
+;; gpgrt_spawn_process_fd       @154
+;; gpgrt_spawn_process_detached @155
+;; gpgrt_wait_process           @156
+;; gpgrt_wait_processes         @157
+;; gpgrt_kill_process           @158
+;; gpgrt_release_process        @159
+
+ gpgrt_argparse               @160
+ gpgrt_usage                  @161
+ gpgrt_strusage               @162
+ gpgrt_set_strusage           @163
+ gpgrt_set_usage_outfnc       @164
+ gpgrt_set_fixed_string_mapper  @165
+
+ gpgrt_b64enc_start           @166
+ gpgrt_b64enc_write           @167
+ gpgrt_b64enc_finish          @168
+
+ gpgrt_cmp_version            @169
+
+ gpgrt_ftruncate              @170
+ gpgrt_fprintf_sf             @171
+ gpgrt_fprintf_sf_unlocked    @172
+
+ gpgrt_w32_override_locale    @173
+
+ gpgrt_add_emergency_cleanup  @174
+ gpgrt_abort                  @175
+
+ gpgrt_set_confdir            @176
+ gpgrt_argparser              @177
+
+ gpgrt_fnameconcat            @178
+ gpgrt_absfnameconcat         @179
+
+ gpgrt_reallocarray           @180
+ gpgrt_fclose                 @181
+
+ gpgrt_fcancel                @182
+
+ gpgrt_access                 @183
+
 ;; end of file with public symbols for Windows.
index 988898e..d2c3b8d 100644 (file)
@@ -1,7 +1,7 @@
-/* gpg-error.h or gpgrt.h - Public interface to libgpg-error.   -*- c -*-
- * Copyright (C) 2003-2004, 2010, 2013-2017 g10 Code GmbH
+/* gpg-error.h or gpgrt.h - Common code for GnuPG and others.    -*- c -*-
+ * Copyright (C) 2001-2020 g10 Code GmbH
  *
- * This file is part of libgpg-error.
+ * This file is part of libgpg-error (aka libgpgrt).
  *
  * libgpg-error is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1+
  *
  * @configure_input@
  */
 
+/* The GnuPG project consists of many components.  Error codes are
+ * exchanged between all components.  The common error codes and their
+ * user-presentable descriptions are kept into a shared library to
+ * allow adding new error codes and components without recompiling any
+ * of the other components.  In addition to error codes this library
+ * also features several other groups of functions which are common to
+ * all GnuPG components.  They may be used by independet project as
+ * well.  The interfaces will not change in a backward incompatible way.
+ *
+ * An error code together with an error source build up an error
+ * value.  As the error value is been passed from one component to
+ * another, it preserves the information about the source and nature
+ * of the error.
+ *
+ * A component of the GnuPG project can define the following macros to
+ * tune the behaviour of the library:
+ *
+ * GPG_ERR_SOURCE_DEFAULT: Define to an error source of type
+ * gpg_err_source_t to make that source the default for gpg_error().
+ * Otherwise GPG_ERR_SOURCE_UNKNOWN is used as default.
+ *
+ * GPG_ERR_ENABLE_GETTEXT_MACROS: Define to provide macros to map the
+ * internal gettext API to standard names.  This has only an effect on
+ * Windows platforms.
+ *
+ * GPGRT_ENABLE_ES_MACROS: Define to provide "es_" macros for the
+ * estream functions.
+ *
+ * GPGRT_ENABLE_LOG_MACROS: Define to provide short versions of the
+ * log functions.
+ *
+ * GPGRT_ENABLE_ARGPARSE_MACROS: Needs to be defined to provide the
+ * mandatory macros of the argparse interface.
+ */
+
 #ifndef GPG_ERROR_H
 #define GPG_ERROR_H 1
 #ifndef GPGRT_H
@@ -56,44 +92,17 @@ extern "C" {
 #endif
 #endif /* __cplusplus */
 
-/* The GnuPG project consists of many components.  Error codes are
-   exchanged between all components.  The common error codes and their
-   user-presentable descriptions are kept into a shared library to
-   allow adding new error codes and components without recompiling any
-   of the other components.  The interface will not change in a
-   backward incompatible way.
-
-   An error code together with an error source build up an error
-   value.  As the error value is been passed from one component to
-   another, it preserver the information about the source and nature
-   of the error.
-
-   A component of the GnuPG project can define the following macros to
-   tune the behaviour of the library:
-
-   GPG_ERR_SOURCE_DEFAULT: Define to an error source of type
-   gpg_err_source_t to make that source the default for gpg_error().
-   Otherwise GPG_ERR_SOURCE_UNKNOWN is used as default.
-
-   GPG_ERR_ENABLE_GETTEXT_MACROS: Define to provide macros to map the
-   internal gettext API to standard names.  This has only an effect on
-   Windows platforms.
-
-   GPGRT_ENABLE_ES_MACROS: Define to provide "es_" macros for the
-   estream functions.
-
-   In addition to the error codes, Libgpg-error also provides a set of
-   functions used by most GnuPG components.  */
 
 \f
 /* The error source type gpg_err_source_t.
-
-   Where as the Poo out of a welle small
-   Taketh his firste springing and his sours.
-                                       --Chaucer.  */
+ *
+ * Where as the Poo out of a welle small
+ * Taketh his firste springing and his sours.
+ *                                     --Chaucer.
+ */
 
 /* Only use free slots, never change or reorder the existing
  entries.  */
* entries.  */
 typedef enum
   {
 @include:err-sources@
@@ -105,7 +114,7 @@ typedef enum
 /* The error code type gpg_err_code_t.  */
 
 /* Only use free slots, never change or reorder the existing
  entries.  */
* entries.  */
 typedef enum
   {
 @include:err-codes@
@@ -120,13 +129,13 @@ typedef enum
 /* The error value type gpg_error_t.  */
 
 /* We would really like to use bit-fields in a struct, but using
  structs as return values can cause binary compatibility issues, in
  particular if you want to do it efficiently (also see
  -freg-struct-return option to GCC).  */
* structs as return values can cause binary compatibility issues, in
* particular if you want to do it efficiently (also see
* -freg-struct-return option to GCC).  */
 typedef unsigned int gpg_error_t;
 
 /* We use the lowest 16 bits of gpg_error_t for error codes.  The 16th
  bit indicates system errors.  */
* bit indicates system errors.  */
 #define GPG_ERR_CODE_MASK      (GPG_ERR_CODE_DIM - 1)
 
 /* Bits 17 to 24 are reserved.  */
@@ -136,11 +145,13 @@ typedef unsigned int gpg_error_t;
 #define GPG_ERR_SOURCE_SHIFT   24
 
 /* The highest bit is reserved.  It shouldn't be used to prevent
  potential negative numbers when transmitting error values as
  text.  */
* potential negative numbers when transmitting error values as
* text.  */
 
 \f
-/* GCC feature test.  */
+/*
+ * GCC feature test.
+ */
 #if __GNUC__
 # define _GPG_ERR_GCC_VERSION (__GNUC__ * 10000 \
                                + __GNUC_MINOR__ * 100 \
@@ -167,7 +178,7 @@ typedef unsigned int gpg_error_t;
 
 /* The noreturn attribute.  */
 #if _GPG_ERR_GCC_VERSION >= 20500
-# define GPGRT_ATTR_NORETURN   __attribute__ ((noreturn))
+# define GPGRT_ATTR_NORETURN   __attribute__ ((__noreturn__))
 #else
 # define GPGRT_ATTR_NORETURN
 #endif
@@ -177,12 +188,12 @@ typedef unsigned int gpg_error_t;
 # define GPGRT_ATTR_PRINTF(f, a) \
                     __attribute__ ((format(__gnu_printf__,f,a)))
 # define GPGRT_ATTR_NR_PRINTF(f, a) \
-                    __attribute__ ((noreturn, format(__gnu_printf__,f,a)))
+                    __attribute__ ((__noreturn__, format(__gnu_printf__,f,a)))
 #elif _GPG_ERR_GCC_VERSION >= 20500
 # define GPGRT_ATTR_PRINTF(f, a) \
                     __attribute__ ((format(printf,f,a)))
 # define GPGRT_ATTR_NR_PRINTF(f, a) \
-                    __attribute__ ((noreturn, format(printf,f,a)))
+                    __attribute__ ((__noreturn__, format(printf,f,a)))
 #else
 # define GPGRT_ATTR_PRINTF(f, a)
 # define GPGRT_ATTR_NR_PRINTF(f, a)
@@ -201,9 +212,9 @@ typedef unsigned int gpg_error_t;
 #endif
 
 /* The used and unused attributes.
  I am not sure since when the unused attribute is really supported.
  In any case it it only needed for gcc versions which print a
  warning.  Thus let us require gcc >= 3.5.  */
* I am not sure since when the unused attribute is really supported.
* In any case it it only needed for gcc versions which print a
* warning.  Thus let us require gcc >= 3.5.  */
 #if _GPG_ERR_GCC_VERSION >= 40000
 # define GPGRT_ATTR_USED  __attribute__ ((used))
 #else
@@ -283,7 +294,9 @@ gpgrt_annotate_leaked_object (const void *p)
 }
 
 \f
-/* Initialization function.  */
+/*
+ * Initialization function.
+ */
 
 /* Initialize the library.  This function should be run early.  */
 gpg_error_t gpg_err_init (void) _GPG_ERR_CONSTRUCTOR;
@@ -311,12 +324,20 @@ void gpgrt_get_syscall_clamp (void (**r_pre)(void), void (**r_post)(void));
 /* Register a custom malloc/realloc/free function.  */
 void gpgrt_set_alloc_func  (void *(*f)(void *a, size_t n));
 
+/* Register an emergency cleanup handler.  */
+void gpgrt_add_emergency_cleanup (void (*f)(void));
+
+/* Wrapper around abort to make sure emergency cleanups are run.  */
+void gpgrt_abort (void) GPGRT_ATTR_NORETURN;
+
 
 \f
-/* Constructor and accessor functions.  */
+/*
+ * Constructor and accessor functions.
+ */
 
 /* Construct an error value from an error code and source.  Within a
  subsystem, use gpg_error.  */
* subsystem, use gpg_error.  */
 static GPG_ERR_INLINE gpg_error_t
 gpg_err_make (gpg_err_source_t source, gpg_err_code_t code)
 {
@@ -327,7 +348,7 @@ gpg_err_make (gpg_err_source_t source, gpg_err_code_t code)
 
 
 /* The user should define GPG_ERR_SOURCE_DEFAULT before including this
  file to specify a default source for gpg_error.  */
* file to specify a default source for gpg_error.  */
 #ifndef GPG_ERR_SOURCE_DEFAULT
 #define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_UNKNOWN
 #endif
@@ -359,44 +380,51 @@ gpg_err_source (gpg_error_t err)
 /* String functions.  */
 
 /* Return a pointer to a string containing a description of the error
  code in the error value ERR.  This function is not thread-safe.  */
* code in the error value ERR.  This function is not thread-safe.  */
 const char *gpg_strerror (gpg_error_t err);
 
 /* Return the error string for ERR in the user-supplied buffer BUF of
  size BUFLEN.  This function is, in contrast to gpg_strerror,
  thread-safe if a thread-safe strerror_r() function is provided by
  the system.  If the function succeeds, 0 is returned and BUF
  contains the string describing the error.  If the buffer was not
  large enough, ERANGE is returned and BUF contains as much of the
  beginning of the error string as fits into the buffer.  */
* size BUFLEN.  This function is, in contrast to gpg_strerror,
* thread-safe if a thread-safe strerror_r() function is provided by
* the system.  If the function succeeds, 0 is returned and BUF
* contains the string describing the error.  If the buffer was not
* large enough, ERANGE is returned and BUF contains as much of the
* beginning of the error string as fits into the buffer.  */
 int gpg_strerror_r (gpg_error_t err, char *buf, size_t buflen);
 
 /* Return a pointer to a string containing a description of the error
  source in the error value ERR.  */
* source in the error value ERR.  */
 const char *gpg_strsource (gpg_error_t err);
 
 \f
-/* Mapping of system errors (errno).  */
+/*
+ * Mapping of system errors (errno).
+ */
 
 /* Retrieve the error code for the system error ERR.  This returns
  GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
  this). */
* GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
* this). */
 gpg_err_code_t gpg_err_code_from_errno (int err);
 
-
 /* Retrieve the system error for the error code CODE.  This returns 0
  if CODE is not a system error code.  */
* if CODE is not a system error code.  */
 int gpg_err_code_to_errno (gpg_err_code_t code);
 
-
 /* Retrieve the error code directly from the ERRNO variable.  This
  returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped
  (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */
* returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped
* (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */
 gpg_err_code_t gpg_err_code_from_syserror (void);
 
+/* Mapper for SQLite primary error codes.  */
+static GPG_ERR_INLINE gpg_error_t
+gpg_err_code_from_sqlite (int sqlres)
+{
+  return sqlres? GPG_ERR_SQL_OK + (sqlres & 0xff) : 0;
+}
+
 
 /* Set the ERRNO variable.  This function is the preferred way to set
  ERRNO due to peculiarities on WindowsCE.  */
* ERRNO due to peculiarities on WindowsCE.  */
 void gpg_err_set_errno (int err);
 
 /* Return or check the version.  Both functions are identical.  */
@@ -404,6 +432,7 @@ const char *gpgrt_check_version (const char *req_version);
 const char *gpg_error_check_version (const char *req_version);
 
 /* System specific type definitions.  */
+@define:pid_t@
 @define:gpgrt_ssize_t@
 @define:gpgrt_off_t@
 
@@ -432,7 +461,49 @@ gpg_error_from_syserror (void)
 
 
 \f
-/* Lock functions.  */
+/*
+ * Malloc and friends
+ */
+
+void *gpgrt_realloc (void *a, size_t n);
+void *gpgrt_reallocarray (void *a, size_t oldnmemb, size_t nmemb, size_t size);
+void *gpgrt_malloc (size_t n);
+void *gpgrt_calloc (size_t n, size_t m);
+char *gpgrt_strdup (const char *string);
+char *gpgrt_strconcat (const char *s1, ...) GPGRT_ATTR_SENTINEL(0);
+void gpgrt_free (void *a);
+
+
+/*
+ * System specific function wrappers.
+ */
+
+/* A getenv replacement which mallocs the returned string.  */
+char *gpgrt_getenv (const char *name);
+
+/* A setenv and a unsetenv replacement.*/
+gpg_err_code_t gpgrt_setenv (const char *name,
+                             const char *value, int overwrite);
+#define gpgrt_unsetenv(n) gpgrt_setenv ((n), NULL, 1)
+
+/* A wrapper around mkdir using a string for the mode.  */
+gpg_err_code_t gpgrt_mkdir (const char *name, const char *modestr);
+
+/* A simple wrapper around chdir.  */
+gpg_err_code_t gpgrt_chdir (const char *name);
+
+/* Return the current WD as a malloced string.  */
+char *gpgrt_getcwd (void);
+
+/* A wrapper around access to handle UTF-8 on Windows.  */
+gpg_err_code_t gpgrt_access (const char *fname, int mode);
+
+
+
+\f
+/*
+ * Lock functions.
+ */
 
 @include:lock-obj@
 
@@ -449,14 +520,18 @@ gpg_err_code_t gpgrt_lock_destroy (gpgrt_lock_t *lockhd);
 
 
 \f
-/* Thread functions.  */
+/*
+ * Thread functions.
+ */
 
 gpg_err_code_t gpgrt_yield (void);
 
 
 
 \f
-/* Estream */
+/*
+ * Estream
+ */
 
 /* The definition of this struct is entirely private.  You must not
    use it for anything.  It is only here so some functions can be
@@ -586,6 +661,11 @@ typedef struct _gpgrt_poll_s gpgrt_poll_t;
 typedef struct _gpgrt_poll_s es_poll_t;
 #endif
 
+/* The type of the string filter function as used by fprintf_sf et al.  */
+typedef char *(*gpgrt_string_filter_t) (const char *s, int n, void *opaque);
+
+
+
 gpgrt_stream_t gpgrt_fopen (const char *_GPGRT__RESTRICT path,
                             const char *_GPGRT__RESTRICT mode);
 gpgrt_stream_t gpgrt_mopen (void *_GPGRT__RESTRICT data,
@@ -612,6 +692,7 @@ gpgrt_stream_t gpgrt_fopencookie (void *_GPGRT__RESTRICT cookie,
                                   const char *_GPGRT__RESTRICT mode,
                                   gpgrt_cookie_io_functions_t functions);
 int gpgrt_fclose (gpgrt_stream_t stream);
+int gpgrt_fcancel (gpgrt_stream_t stream);
 int gpgrt_fclose_snatch (gpgrt_stream_t stream,
                          void **r_buffer, size_t *r_buflen);
 int gpgrt_onclose (gpgrt_stream_t stream, int mode,
@@ -654,6 +735,7 @@ int _gpgrt_pending_unlocked (gpgrt_stream_t stream); /* (private) */
 int gpgrt_fflush (gpgrt_stream_t stream);
 int gpgrt_fseek (gpgrt_stream_t stream, long int offset, int whence);
 int gpgrt_fseeko (gpgrt_stream_t stream, gpgrt_off_t offset, int whence);
+int gpgrt_ftruncate (gpgrt_stream_t stream, gpgrt_off_t length);
 long int gpgrt_ftell (gpgrt_stream_t stream);
 gpgrt_off_t gpgrt_ftello (gpgrt_stream_t stream);
 void gpgrt_rewind (gpgrt_stream_t stream);
@@ -700,8 +782,8 @@ int gpgrt_write_hexstring (gpgrt_stream_t _GPGRT__RESTRICT stream,
 
 size_t gpgrt_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
                     gpgrt_stream_t _GPGRT__RESTRICT stream);
-size_t gpgrt_fwrite (const void *_GPGRT__RESTRICT ptr, size_t size, size_t memb,
-                     gpgrt_stream_t _GPGRT__RESTRICT stream);
+size_t gpgrt_fwrite (const void *_GPGRT__RESTRICT ptr, size_t size,
+                     size_t nitems, gpgrt_stream_t _GPGRT__RESTRICT stream);
 
 char *gpgrt_fgets (char *_GPGRT__RESTRICT s, int n,
                    gpgrt_stream_t _GPGRT__RESTRICT stream);
@@ -716,7 +798,6 @@ int gpgrt_fputs_unlocked (const char *_GPGRT__RESTRICT s,
 @api_ssize_t@ gpgrt_read_line (gpgrt_stream_t stream,
                          char **addr_of_buffer, size_t *length_of_buffer,
                          size_t *max_length);
-void gpgrt_free (void *a);
 
 int gpgrt_fprintf (gpgrt_stream_t _GPGRT__RESTRICT stream,
                    const char *_GPGRT__RESTRICT format, ...)
@@ -725,6 +806,15 @@ int gpgrt_fprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream,
                             const char *_GPGRT__RESTRICT format, ...)
                             GPGRT_ATTR_PRINTF(2,3);
 
+int gpgrt_fprintf_sf (gpgrt_stream_t _GPGRT__RESTRICT stream,
+                      gpgrt_string_filter_t sf, void *sfvalue,
+                      const char *_GPGRT__RESTRICT format,
+                      ...) GPGRT_ATTR_PRINTF(4,5);
+int gpgrt_fprintf_sf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream,
+                               gpgrt_string_filter_t sf, void *sfvalue,
+                               const char *_GPGRT__RESTRICT format,
+                               ...) GPGRT_ATTR_PRINTF(4,5);
+
 int gpgrt_printf (const char *_GPGRT__RESTRICT format, ...)
                   GPGRT_ATTR_PRINTF(1,2);
 int gpgrt_printf_unlocked (const char *_GPGRT__RESTRICT format, ...)
@@ -811,6 +901,7 @@ int gpgrt_vsnprintf (char *buf,size_t bufsize,
 # define es_fflush            gpgrt_fflush
 # define es_fseek             gpgrt_fseek
 # define es_fseeko            gpgrt_fseeko
+# define es_ftruncate         gpgrt_ftruncate
 # define es_ftell             gpgrt_ftell
 # define es_ftello            gpgrt_ftello
 # define es_rewind            gpgrt_rewind
@@ -855,16 +946,430 @@ int gpgrt_vsnprintf (char *buf,size_t bufsize,
 # define es_bsprintf          gpgrt_bsprintf
 # define es_vbsprintf         gpgrt_vbsprintf
 #endif /*GPGRT_ENABLE_ES_MACROS*/
+
+
 \f
-/* Base64 decode functions.  */
+/*
+ * Base64 encode and decode functions.
+ */
 
 struct _gpgrt_b64state;
 typedef struct _gpgrt_b64state *gpgrt_b64state_t;
 
+gpgrt_b64state_t gpgrt_b64enc_start (gpgrt_stream_t stream, const char *title);
+gpg_err_code_t   gpgrt_b64enc_write (gpgrt_b64state_t state,
+                                     const void *buffer, size_t nbytes);
+gpg_err_code_t   gpgrt_b64enc_finish (gpgrt_b64state_t state);
+
 gpgrt_b64state_t gpgrt_b64dec_start (const char *title);
-gpg_error_t gpgrt_b64dec_proc (gpgrt_b64state_t state,
-                               void *buffer, size_t length, size_t *r_nbytes);
-gpg_error_t gpgrt_b64dec_finish (gpgrt_b64state_t state);
+gpg_error_t      gpgrt_b64dec_proc (gpgrt_b64state_t state,
+                                    void *buffer, size_t length,
+                                    size_t *r_nbytes);
+gpg_error_t      gpgrt_b64dec_finish (gpgrt_b64state_t state);
+
+
+\f
+/*
+ * Logging functions
+ */
+
+/* Flag values for gpgrt_log_set_prefix. */
+#define GPGRT_LOG_WITH_PREFIX  1
+#define GPGRT_LOG_WITH_TIME    2
+#define GPGRT_LOG_WITH_PID     4
+#define GPGRT_LOG_RUN_DETACHED 256
+#define GPGRT_LOG_NO_REGISTRY  512
+
+/* Log levels as used by gpgrt_log.  */
+enum gpgrt_log_levels
+  {
+    GPGRT_LOGLVL_BEGIN,
+    GPGRT_LOGLVL_CONT,
+    GPGRT_LOGLVL_INFO,
+    GPGRT_LOGLVL_WARN,
+    GPGRT_LOGLVL_ERROR,
+    GPGRT_LOGLVL_FATAL,
+    GPGRT_LOGLVL_BUG,
+    GPGRT_LOGLVL_DEBUG
+  };
+
+
+/* The next 4 functions are not thread-safe - call them early.  */
+void gpgrt_log_set_sink (const char *name, gpgrt_stream_t stream, int fd);
+void gpgrt_log_set_socket_dir_cb (const char *(*fnc)(void));
+void gpgrt_log_set_pid_suffix_cb (int (*cb)(unsigned long *r_value));
+void gpgrt_log_set_prefix (const char *text, unsigned int flags);
+
+int  gpgrt_get_errorcount (int clear);
+void gpgrt_inc_errorcount (void);
+const char *gpgrt_log_get_prefix (unsigned int *flags);
+int  gpgrt_log_test_fd (int fd);
+int  gpgrt_log_get_fd (void);
+gpgrt_stream_t gpgrt_log_get_stream (void);
+
+void gpgrt_log (int level, const char *fmt, ...) GPGRT_ATTR_PRINTF(2,3);
+void gpgrt_logv (int level, const char *fmt, va_list arg_ptr);
+void gpgrt_logv_prefix (int level, const char *prefix,
+                              const char *fmt, va_list arg_ptr);
+void gpgrt_log_string (int level, const char *string);
+void gpgrt_log_bug (const char *fmt, ...)    GPGRT_ATTR_NR_PRINTF(1,2);
+void gpgrt_log_fatal (const char *fmt, ...)  GPGRT_ATTR_NR_PRINTF(1,2);
+void gpgrt_log_error (const char *fmt, ...)  GPGRT_ATTR_PRINTF(1,2);
+void gpgrt_log_info (const char *fmt, ...)   GPGRT_ATTR_PRINTF(1,2);
+void gpgrt_log_debug (const char *fmt, ...)  GPGRT_ATTR_PRINTF(1,2);
+void gpgrt_log_debug_string (const char *string,
+                             const char *fmt, ...) GPGRT_ATTR_PRINTF(2,3);
+void gpgrt_log_printf (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2);
+void gpgrt_log_printhex (const void *buffer, size_t length,
+                         const char *fmt, ...) GPGRT_ATTR_PRINTF(3,4);
+void gpgrt_log_clock (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2);
+void gpgrt_log_flush (void);
+void _gpgrt_log_assert (const char *expr, const char *file, int line,
+                        const char *func) GPGRT_ATTR_NORETURN;
+
+#ifdef GPGRT_HAVE_MACRO_FUNCTION
+# define gpgrt_assert(expr)                                     \
+  ((expr)                                                       \
+   ? (void) 0                                                   \
+   : _gpgrt_log_assert (#expr, __FILE__, __LINE__, __FUNCTION__))
+#else /*!GPGRT_HAVE_MACRO_FUNCTION*/
+# define gpgrt_assert(expr)                                     \
+  ((expr)                                                       \
+   ? (void) 0                                                   \
+   : _gpgrt_log_assert (#expr, __FILE__, __LINE__, NULL))
+#endif /*!GPGRT_HAVE_MACRO_FUNCTION*/
+
+#ifdef GPGRT_ENABLE_LOG_MACROS
+# define log_get_errorcount      gpgrt_get_errorcount
+# define log_inc_errorcount      gpgrt_inc_errorcount
+# define log_set_file(a)         gpgrt_log_set_sink ((a), NULL, -1)
+# define log_set_fd(a)           gpgrt_log_set_sink (NULL, NULL, (a))
+# define log_set_stream(a)       gpgrt_log_set_sink (NULL, (a), -1)
+# define log_set_socket_dir_cb   gpgrt_log_set_socket_dir_cb
+# define log_set_pid_suffix_cb   gpgrt_log_set_pid_suffix_cb
+# define log_set_prefix          gpgrt_log_set_prefix
+# define log_get_prefix          gpgrt_log_get_prefix
+# define log_test_fd             gpgrt_log_test_fd
+# define log_get_fd              gpgrt_log_get_fd
+# define log_get_stream          gpgrt_log_get_stream
+# define log_log                 gpgrt_log
+# define log_logv                gpgrt_logv
+# define log_logv_prefix         gpgrt_logv_prefix
+# define log_string              gpgrt_log_string
+# define log_bug                 gpgrt_log_bug
+# define log_fatal               gpgrt_log_fatal
+# define log_error               gpgrt_log_error
+# define log_info                gpgrt_log_info
+# define log_debug               gpgrt_log_debug
+# define log_debug_string        gpgrt_log_debug_string
+# define log_printf              gpgrt_log_printf
+# define log_printhex            gpgrt_log_printhex
+# define log_clock               gpgrt_log_clock
+# define log_flush               gpgrt_log_flush
+# ifdef GPGRT_HAVE_MACRO_FUNCTION
+#  define log_assert(expr)                                      \
+  ((expr)                                                       \
+   ? (void) 0                                                   \
+   : _gpgrt_log_assert (#expr, __FILE__, __LINE__, __FUNCTION__))
+# else /*!GPGRT_HAVE_MACRO_FUNCTION*/
+#  define log_assert(expr)                                      \
+  ((expr)                                                       \
+   ? (void) 0                                                   \
+   : _gpgrt_log_assert (#expr, __FILE__, __LINE__, NULL))
+# endif /*!GPGRT_HAVE_MACRO_FUNCTION*/
+
+#endif /*GPGRT_ENABLE_LOG_MACROS*/
+
+\f
+/*
+ * Spawn functions  (Not yet available)
+ */
+#define GPGRT_SPAWN_NONBLOCK   16 /* Set the streams to non-blocking.      */
+#define GPGRT_SPAWN_RUN_ASFW   64 /* Use AllowSetForegroundWindow on W32.  */
+#define GPGRT_SPAWN_DETACHED  128 /* Start the process in the background.  */
+
+#if 0
+
+/* Function and convenience macros to create pipes.  */
+gpg_err_code_t gpgrt_make_pipe (int filedes[2], gpgrt_stream_t *r_fp,
+                                int direction, int nonblock);
+#define gpgrt_create_pipe(a)              gpgrt_make_pipe ((a),NULL,  0,  0);
+#define gpgrt_create_inbound_pipe(a,b,c)  gpgrt_make_pipe ((a), (b), -1,(c));
+#define gpgrt_create_outbound_pipe(a,b,c) gpgrt_make_pipe ((a), (b),  1,(c));
+
+
+/* Fork and exec PGMNAME.  */
+gpg_err_code_t gpgrt_spawn_process (const char *pgmname, const char *argv[],
+                                    int *execpt, void (*preexec)(void),
+                                    unsigned int flags,
+                                    gpgrt_stream_t *r_infp,
+                                    gpgrt_stream_t *r_outfp,
+                                    gpgrt_stream_t *r_errfp,
+                                    pid_t *pid);
+
+/* Fork and exec PGNNAME and connect the process to the given FDs.  */
+gpg_err_code_t gpgrt_spawn_process_fd (const char *pgmname, const char *argv[],
+                                       int infd, int outfd, int errfd,
+                                       pid_t *pid);
+
+/* Fork and exec PGMNAME as a detached process.  */
+gpg_err_code_t gpgrt_spawn_process_detached (const char *pgmname,
+                                             const char *argv[],
+                                             const char *envp[] );
+
+/* Wait for a single process.  */
+gpg_err_code_t gpgrt_wait_process (const char *pgmname, pid_t pid, int hang,
+                                int *r_exitcode);
+
+/* Wait for a multiple processes.  */
+gpg_err_code_t gpgrt_wait_processes (const char **pgmnames, pid_t *pids,
+                                     size_t count, int hang, int *r_exitcodes);
+
+/* Kill the process identified by PID.  */
+void gpgrt_kill_process (pid_t pid);
+
+/* Release process resources identified by PID.  */
+void gpgrt_release_process (pid_t pid);
+
+#endif /*0*/
+
+
+\f
+/*
+ * Option parsing.
+ */
+
+struct _gpgrt_argparse_internal_s;
+typedef struct
+{
+  int  *argc;        /* Pointer to ARGC (value subject to change). */
+  char ***argv;              /* Pointer to ARGV (value subject to change). */
+  unsigned int flags; /* Global flags.  May be set prior to calling the
+                         parser.  The parser may change the value.  */
+  int err;            /* Print error description for last option.
+                         Either 0,  ARGPARSE_PRINT_WARNING or
+                         ARGPARSE_PRINT_ERROR.  */
+  unsigned int lineno;/* The current line number.  */
+  int r_opt;         /* Returns option code. */
+  int r_type;        /* Returns type of option value.  */
+  union {
+    int   ret_int;
+    long  ret_long;
+    unsigned long ret_ulong;
+    char *ret_str;
+  } r;               /* Return values */
+
+  struct _gpgrt_argparse_internal_s *internal;
+} gpgrt_argparse_t;
+
+
+typedef struct
+{
+  int          short_opt;
+  const char  *long_opt;
+  unsigned int flags;
+  const char  *description; /* Optional description. */
+} gpgrt_opt_t;
+
+
+#ifdef GPGRT_ENABLE_ARGPARSE_MACROS
+
+/* Global flags for (gpgrt_argparse_t).flags.  */
+#define ARGPARSE_FLAG_KEEP        1  /* Do not remove options form argv.     */
+#define ARGPARSE_FLAG_ALL         2  /* Do not stop at last option but return
+                                        remaining args with R_OPT set to -1. */
+#define ARGPARSE_FLAG_MIXED       4  /* Assume options and args are mixed.   */
+#define ARGPARSE_FLAG_NOSTOP      8  /* Do not stop processing at "--".      */
+#define ARGPARSE_FLAG_ARG0       16  /* Do not skip the first arg.           */
+#define ARGPARSE_FLAG_ONEDASH    32  /* Allow long options with one dash.    */
+#define ARGPARSE_FLAG_NOVERSION  64  /* No output for "--version".           */
+#define ARGPARSE_FLAG_RESET     128  /* Request to reset the internal state. */
+#define ARGPARSE_FLAG_STOP_SEEN 256  /* Set to true if a "--" has been seen. */
+#define ARGPARSE_FLAG_NOLINENO  512  /* Do not zero the lineno field.        */
+#define ARGPARSE_FLAG_SYS      1024  /* Use system config file.              */
+#define ARGPARSE_FLAG_USER     2048  /* Use user config file.                */
+#define ARGPARSE_FLAG_VERBOSE  4096  /* Print additional argparser info.     */
+#define ARGPARSE_FLAG_USERVERS 8192  /* Try version-ed user config files.    */
+#define ARGPARSE_FLAG_WITHATTR 16384 /* Return attribute bits.               */
+
+/* Constants for (gpgrt_argparse_t).err.  */
+#define ARGPARSE_PRINT_WARNING  1    /* Print a diagnostic.                  */
+#define ARGPARSE_PRINT_ERROR    2    /* Print a diagnostic and call exit.    */
+
+/* Special return values of gpgrt_argparse.  */
+#define ARGPARSE_IS_ARG            (-1)
+#define ARGPARSE_INVALID_OPTION    (-2)
+#define ARGPARSE_MISSING_ARG       (-3)
+#define ARGPARSE_KEYWORD_TOO_LONG  (-4)
+#define ARGPARSE_READ_ERROR        (-5)
+#define ARGPARSE_UNEXPECTED_ARG    (-6)
+#define ARGPARSE_INVALID_COMMAND   (-7)
+#define ARGPARSE_AMBIGUOUS_OPTION  (-8)
+#define ARGPARSE_AMBIGUOUS_COMMAND (-9)
+#define ARGPARSE_INVALID_ALIAS     (-10)
+#define ARGPARSE_OUT_OF_CORE       (-11)
+#define ARGPARSE_INVALID_ARG       (-12)
+#define ARGPARSE_PERMISSION_ERROR  (-13)
+#define ARGPARSE_NO_CONFFILE       (-14)
+#define ARGPARSE_CONFFILE          (-15)
+#define ARGPARSE_INVALID_META      (-16)
+#define ARGPARSE_UNKNOWN_META      (-17)
+#define ARGPARSE_UNEXPECTED_META   (-18)
+
+/* Flags for the option descriptor (gpgrt_opt_t)->flags.  Note that a
+ * TYPE constant may be or-ed with the OPT constants but when used as
+ * return value in r_type these OPT constants are normally not
+ * included.  However with ARGPARSE_FLAG_WITHATTR used and an option
+ * would normally not be returned, it is returned but
+ * ARGPARSE_OPT_IGNORE is then set; further ARPARSE_ATTR_* are set.
+ */
+#define ARGPARSE_TYPE_MASK   0x0007  /* Mask for the type bits.           */
+#define ARGPARSE_TYPE_NONE        0  /* Does not take an argument.        */
+#define ARGPARSE_TYPE_INT         1  /* Takes an int argument.            */
+#define ARGPARSE_TYPE_STRING      2  /* Takes a string argument.          */
+#define ARGPARSE_TYPE_LONG        3  /* Takes a long argument.            */
+#define ARGPARSE_TYPE_ULONG       4  /* Takes an unsigned long argument.  */
+#define ARGPARSE_OPT_OPTIONAL (1<<3) /* Argument is optional.             */
+#define ARGPARSE_OPT_PREFIX   (1<<4) /* Allow 0x etc. prefixed values.    */
+#define ARGPARSE_OPT_IGNORE   (1<<6) /* Ignore command or option.         */
+#define ARGPARSE_OPT_COMMAND  (1<<7) /* The argument is a command.        */
+#define ARGPARSE_OPT_CONFFILE (1<<8) /* The value is a conffile.          */
+#define ARGPARSE_OPT_HEADER   (1<<9) /* The value is printed as a header. */
+#define ARGPARSE_OPT_VERBATIM (1<<10)/* The value is printed verbatim.    */
+#define ARGPARSE_ATTR_FORCE   (1<<14)/* Attribute force is set.           */
+#define ARGPARSE_ATTR_IGNORE  (1<<15)/* Attribute ignore is set.          */
+
+/* A set of macros to make option definitions easier to read.  */
+#define ARGPARSE_x(s,l,t,f,d) \
+     { (s), (l), ARGPARSE_TYPE_ ## t | (f), (d) }
+
+#define ARGPARSE_s(s,l,t,d) \
+     { (s), (l), ARGPARSE_TYPE_ ## t, (d) }
+#define ARGPARSE_s_n(s,l,d) \
+     { (s), (l), ARGPARSE_TYPE_NONE, (d) }
+#define ARGPARSE_s_i(s,l,d) \
+     { (s), (l), ARGPARSE_TYPE_INT, (d) }
+#define ARGPARSE_s_s(s,l,d) \
+     { (s), (l), ARGPARSE_TYPE_STRING, (d) }
+#define ARGPARSE_s_l(s,l,d) \
+     { (s), (l), ARGPARSE_TYPE_LONG, (d) }
+#define ARGPARSE_s_u(s,l,d) \
+     { (s), (l), ARGPARSE_TYPE_ULONG, (d) }
+
+#define ARGPARSE_o(s,l,t,d) \
+     { (s), (l), (ARGPARSE_TYPE_ ## t  | ARGPARSE_OPT_OPTIONAL), (d) }
+#define ARGPARSE_o_n(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_NONE   | ARGPARSE_OPT_OPTIONAL), (d) }
+#define ARGPARSE_o_i(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_INT    | ARGPARSE_OPT_OPTIONAL), (d) }
+#define ARGPARSE_o_s(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_STRING | ARGPARSE_OPT_OPTIONAL), (d) }
+#define ARGPARSE_o_l(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_LONG   | ARGPARSE_OPT_OPTIONAL), (d) }
+#define ARGPARSE_o_u(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_ULONG  | ARGPARSE_OPT_OPTIONAL), (d) }
+
+#define ARGPARSE_p(s,l,t,d) \
+     { (s), (l), (ARGPARSE_TYPE_ ## t  | ARGPARSE_OPT_PREFIX), (d) }
+#define ARGPARSE_p_n(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_NONE   | ARGPARSE_OPT_PREFIX), (d) }
+#define ARGPARSE_p_i(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_INT    | ARGPARSE_OPT_PREFIX), (d) }
+#define ARGPARSE_p_s(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_STRING | ARGPARSE_OPT_PREFIX), (d) }
+#define ARGPARSE_p_l(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_LONG   | ARGPARSE_OPT_PREFIX), (d) }
+#define ARGPARSE_p_u(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_ULONG  | ARGPARSE_OPT_PREFIX), (d) }
+
+#define ARGPARSE_op(s,l,t,d) \
+     { (s), (l), (ARGPARSE_TYPE_ ## t \
+                  | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) }
+#define ARGPARSE_op_n(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_NONE \
+                  | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) }
+#define ARGPARSE_op_i(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_INT \
+                  | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) }
+#define ARGPARSE_op_s(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_STRING \
+                  | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) }
+#define ARGPARSE_op_l(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_LONG \
+                  | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) }
+#define ARGPARSE_op_u(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_ULONG \
+                  | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) }
+
+#define ARGPARSE_c(s,l,d) \
+     { (s), (l), (ARGPARSE_TYPE_NONE | ARGPARSE_OPT_COMMAND), (d) }
+
+#define ARGPARSE_conffile(s,l,d) \
+  { (s), (l), (ARGPARSE_TYPE_STRING|ARGPARSE_OPT_CONFFILE), (d) }
+
+#define ARGPARSE_noconffile(s,l,d) \
+  { (s), (l), (ARGPARSE_TYPE_NONE|ARGPARSE_OPT_CONFFILE), (d) }
+
+/* This macro is for stub or obsolete options.  */
+#define ARGPARSE_ignore(s,l)                    \
+  { (s), (l), (ARGPARSE_OPT_IGNORE), "@" }
+
+/* This is a legacy version of ARGPARSE_verbatim which really does
+ * verbatim printing.  */
+#define ARGPARSE_group(s,d) \
+  { (s), NULL, 0, (d) }
+
+/* Verbatim print the string D in the help output.  It does not make
+ * use of the "@" hack as ARGPARSE_group does.  */
+#define ARGPARSE_verbatim(d) \
+  { 1, NULL, (ARGPARSE_OPT_VERBATIM), (d) }
+
+/* Same as ARGPARSE_verbatim but also print a colon and a LF.  N can
+ * be used give a symbolic name to the header.  Nothing is printed if
+ * D is the empty string.  */
+#define ARGPARSE_header(n,d) \
+  { 1, (n), (ARGPARSE_OPT_HEADER), (d) }
+
+/* Mark the end of the list (mandatory).  */
+#define ARGPARSE_end() \
+  { 0, NULL, 0, NULL }
+
+#endif /* GPGRT_ENABLE_ARGPARSE_MACROS */
+
+/* Values used for gpgrt_set_confdir.  */
+#define GPGRT_CONFDIR_USER 1   /* The user's configuration dir.    */
+#define GPGRT_CONFDIR_SYS  2   /* The systems's configuration dir. */
+
+/* Take care: gpgrt_argparse keeps state in ARG and requires that
+ * either ARGPARSE_FLAG_RESET is used after OPTS has been changed or
+ * gpgrt_argparse (NULL, ARG, NULL) is called first.  */
+int gpgrt_argparse (gpgrt_stream_t fp,
+                    gpgrt_argparse_t *arg, gpgrt_opt_t *opts);
+int gpgrt_argparser (gpgrt_argparse_t *arg, gpgrt_opt_t *opts,
+                     const char *confname);
+void gpgrt_usage (int level);
+const char *gpgrt_strusage (int level);
+void gpgrt_set_strusage (const char *(*f)(int));
+void gpgrt_set_usage_outfnc (int (*f)(int, const char *));
+void gpgrt_set_fixed_string_mapper (const char *(*f)(const char*));
+void gpgrt_set_confdir (int what, const char *name);
+
+\f
+/*
+ * Various helper functions
+ */
+
+/* Compare arbitrary version strings.  For the standard m.n.o version
+ * numbering scheme a LEVEL of 3 is suitable; see the manual.  */
+int gpgrt_cmp_version (const char *a, const char *b, int level);
+
+/* Construct a filename from the NULL terminated list of parts.  Tilde
+ * expansion is done for the first argument.  The caller must release
+ * the result using gpgrt_free; on error ERRNO is set and NULL
+ * returned.  The second function returns an absolute filename.  */
+char *gpgrt_fnameconcat (const char *first, ...) GPGRT_ATTR_SENTINEL(0);
+char *gpgrt_absfnameconcat (const char *first, ...) GPGRT_ATTR_SENTINEL(0);
+
 
 #ifdef __cplusplus
 }
index 60c88d8..56a5d07 100644 (file)
@@ -1,5 +1,6 @@
 # gpg-error.m4 - autoconf macro to detect libgpg-error.
-# Copyright (C) 2002, 2003, 2004, 2011, 2014 g10 Code GmbH
+# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018, 2020, 2021
+#               g10 Code GmbH
 #
 # This file is free software; as a special exception the author gives
 # unlimited permission to copy and/or distribute it, with or without
@@ -9,7 +10,7 @@
 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 #
-# Last-changed: 2014-10-02
+# Last-changed: 2021-03-31
 
 
 dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION,
@@ -31,7 +32,7 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
   dnl since that is consistent with how our three siblings use the directory/
   dnl package name in --with-$dir_name-prefix=PFX.
   AC_ARG_WITH(libgpg-error-prefix,
-              AC_HELP_STRING([--with-libgpg-error-prefix=PFX],
+              AS_HELP_STRING([--with-libgpg-error-prefix=PFX],
                              [prefix where GPG Error is installed (optional)]),
               [gpg_error_config_prefix="$withval"])
 
@@ -61,16 +62,89 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
   fi
 
   AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no)
-  min_gpg_error_version=ifelse([$1], ,0.0,$1)
-  AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version)
+  min_gpg_error_version=ifelse([$1], ,1.33,$1)
   ok=no
-  if test "$GPG_ERROR_CONFIG" != "no" \
-     && test -f "$GPG_ERROR_CONFIG" ; then
+
+  AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no, [$prefix/bin:$PATH])
+  if test "$GPGRT_CONFIG" != "no"; then
+    # Determine gpgrt_libdir
+    #
+    # Get the prefix of gpgrt-config assuming it's something like:
+    #   <PREFIX>/bin/gpgrt-config
+    gpgrt_prefix=${GPGRT_CONFIG%/*/*}
+    possible_libdir1=${gpgrt_prefix}/lib
+    # Determine by using system libdir-format with CC, it's like:
+    #   Normal style: /usr/lib
+    #   GNU cross style: /usr/<triplet>/lib
+    #   Debian style: /usr/lib/<multiarch-name>
+    #   Fedora/openSUSE style: /usr/lib, /usr/lib32 or /usr/lib64
+    # It is assumed that CC is specified to the one of host on cross build.
+    if libdir_candidates=$(${CC:-cc} -print-search-dirs | \
+          sed -n -e "/^libraries/{s/libraries: =//;s/:/\\
+/g;p;}"); then
+      # From the output of -print-search-dirs, select valid pkgconfig dirs.
+      libdir_candidates=$(for dir in $libdir_candidates; do
+        if p=$(cd $dir 2>/dev/null && pwd); then
+          test -d "$p/pkgconfig" && echo $p;
+        fi
+      done)
+
+      for possible_libdir0 in $libdir_candidates; do
+        # possible_libdir0:
+        #   Fallback candidate, the one of system-installed (by $CC)
+        #   (/usr/<triplet>/lib, /usr/lib/<multiarch-name> or /usr/lib32)
+        # possible_libdir1:
+        #   Another candidate, user-locally-installed
+        #   (<gpgrt_prefix>/lib)
+        # possible_libdir2
+        #   Most preferred
+        #   (<gpgrt_prefix>/<triplet>/lib,
+        #    <gpgrt_prefix>/lib/<multiarch-name> or <gpgrt_prefix>/lib32)
+        if test "${possible_libdir0##*/}" = "lib"; then
+          possible_prefix0=${possible_libdir0%/lib}
+          possible_prefix0_triplet=${possible_prefix0##*/}
+          if test -z "$possible_prefix0_triplet"; then
+            continue
+          fi
+          possible_libdir2=${gpgrt_prefix}/$possible_prefix0_triplet/lib
+        else
+          possible_prefix0=${possible_libdir0%%/lib*}
+          possible_libdir2=${gpgrt_prefix}${possible_libdir0#$possible_prefix0}
+        fi
+        if test -f ${possible_libdir2}/pkgconfig/gpg-error.pc; then
+          gpgrt_libdir=${possible_libdir2}
+        elif test -f ${possible_libdir1}/pkgconfig/gpg-error.pc; then
+          gpgrt_libdir=${possible_libdir1}
+        elif test -f ${possible_libdir0}/pkgconfig/gpg-error.pc; then
+          gpgrt_libdir=${possible_libdir0}
+        fi
+        if test -n "$gpgrt_libdir"; then break; fi
+      done
+    else
+      # When we cannot determine system libdir-format, use this:
+      gpgrt_libdir=${possible_libdir1}
+    fi
+  else
+    unset GPGRT_CONFIG
+  fi
+
+  if test -n "$gpgrt_libdir"; then
+    GPGRT_CONFIG="$GPGRT_CONFIG --libdir=$gpgrt_libdir"
+    if $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then
+      GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error"
+      AC_MSG_NOTICE([Use gpgrt-config with $gpgrt_libdir as gpg-error-config])
+      gpg_error_config_version=`$GPG_ERROR_CONFIG --modversion`
+    else
+      unset GPGRT_CONFIG
+    fi
+  elif test "$GPG_ERROR_CONFIG" != "no"; then
+    gpg_error_config_version=`$GPG_ERROR_CONFIG --version`
+  fi
+  if test "$GPG_ERROR_CONFIG" != "no"; then
     req_major=`echo $min_gpg_error_version | \
                sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
     req_minor=`echo $min_gpg_error_version | \
                sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
-    gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version`
     major=`echo $gpg_error_config_version | \
                sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
     minor=`echo $gpg_error_config_version | \
@@ -85,19 +159,31 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
         fi
     fi
   fi
+  AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version)
   if test $ok = yes; then
-    GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
-    GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs`
-    GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --cflags 2>/dev/null`
-    GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --libs 2>/dev/null`
+    GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG --cflags`
+    GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG --libs`
+    if test -z "$GPGRT_CONFIG"; then
+      GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG --mt --cflags 2>/dev/null`
+      GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG --mt --libs 2>/dev/null`
+    else
+      GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG --variable=mtcflags 2>/dev/null`
+      GPG_ERROR_MT_CFLAGS="$GPG_ERROR_CFLAGS${GPG_ERROR_CFLAGS:+ }$GPG_ERROR_MT_CFLAGS"
+      GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG --variable=mtlibs 2>/dev/null`
+      GPG_ERROR_MT_LIBS="$GPG_ERROR_LIBS${GPG_ERROR_LIBS:+ }$GPG_ERROR_MT_LIBS"
+    fi
     AC_MSG_RESULT([yes ($gpg_error_config_version)])
     ifelse([$2], , :, [$2])
-    gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --host 2>/dev/null || echo none`
+    if test -z "$GPGRT_CONFIG"; then
+      gpg_error_config_host=`$GPG_ERROR_CONFIG --host 2>/dev/null || echo none`
+    else
+      gpg_error_config_host=`$GPG_ERROR_CONFIG --variable=host 2>/dev/null || echo none`
+    fi
     if test x"$gpg_error_config_host" != xnone ; then
       if test x"$gpg_error_config_host" != x"$host" ; then
   AC_MSG_WARN([[
 ***
-*** The config script $GPG_ERROR_CONFIG was
+*** The config script "$GPG_ERROR_CONFIG" was
 *** built for $gpg_error_config_host and thus may not match the
 *** used host $host.
 *** You may want to use the configure option --with-libgpg-error-prefix
diff --git a/src/gpg-error.pc.in b/src/gpg-error.pc.in
new file mode 100644 (file)
index 0000000..970bb6c
--- /dev/null
@@ -0,0 +1,15 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+includedir=@includedir@
+libdir=@libdir@
+host=@GPG_ERROR_CONFIG_HOST@
+mtcflags=@GPG_ERROR_CONFIG_MT_CFLAGS@
+mtlibs=@GPG_ERROR_CONFIG_MT_LIBS@
+
+Name: gpg-error
+Description: GPG Runtime
+Version: @PACKAGE_VERSION@
+Cflags: @GPG_ERROR_CONFIG_CFLAGS@
+Libs: @GPG_ERROR_CONFIG_LIBS@
+Libs.private: @GPG_ERROR_CONFIG_LIBS_PRIVATE@
+URL: https://www.gnupg.org/software/libgpg-error/index.html
index e44128c..aaea22a 100644 (file)
@@ -15,6 +15,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this program; if not, see <https://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: LGPL-2.1+
 #
 # NOTE: When adding new functions, please make sure to add them to
 #       visibility.h and gpg-error.def.in as well.
@@ -54,6 +55,7 @@ GPG_ERROR_1.0 {
     gpgrt_freopen;
     gpgrt_fopencookie;
     gpgrt_fclose;
+    gpgrt_fcancel;
     gpgrt_fclose_snatch;
     gpgrt_onclose;
     gpgrt_fileno;
@@ -130,6 +132,82 @@ GPG_ERROR_1.0 {
     gpgrt_b64dec_proc;
     gpgrt_b64dec_finish;
 
+    gpgrt_get_errorcount;
+    gpgrt_inc_errorcount;
+    gpgrt_log_set_sink;
+    gpgrt_log_set_socket_dir_cb;
+    gpgrt_log_set_pid_suffix_cb;
+    gpgrt_log_set_prefix;
+    gpgrt_log_get_prefix;
+    gpgrt_log_test_fd;
+    gpgrt_log_get_fd;
+    gpgrt_log_get_stream;
+    gpgrt_log;
+    gpgrt_logv;
+    gpgrt_logv_prefix;
+    gpgrt_log_string;
+    gpgrt_log_bug;
+    gpgrt_log_fatal;
+    gpgrt_log_error;
+    gpgrt_log_info;
+    gpgrt_log_debug;
+    gpgrt_log_debug_string;
+    gpgrt_log_printf;
+    gpgrt_log_printhex;
+    gpgrt_log_clock;
+    gpgrt_log_flush;
+    _gpgrt_log_assert;
+
+    gpgrt_realloc;
+    gpgrt_reallocarray;
+    gpgrt_malloc;
+    gpgrt_calloc;
+    gpgrt_strdup;
+    gpgrt_strconcat;
+
+    gpgrt_getenv;
+    gpgrt_setenv;
+    gpgrt_mkdir;
+    gpgrt_chdir;
+    gpgrt_getcwd;
+
+## API not yet finished for:
+#    gpgrt_make_pipe;
+#    gpgrt_spawn_process;
+#    gpgrt_spawn_process_fd;
+#    gpgrt_spawn_process_detached;
+#    gpgrt_wait_process;
+#    gpgrt_wait_processes;
+#    gpgrt_kill_process;
+#    gpgrt_release_process;
+
+    gpgrt_argparse;
+    gpgrt_argparser;
+    gpgrt_usage;
+    gpgrt_strusage;
+    gpgrt_set_strusage;
+    gpgrt_set_usage_outfnc;
+    gpgrt_set_fixed_string_mapper;
+    gpgrt_set_confdir;
+
+    gpgrt_b64enc_start;
+    gpgrt_b64enc_write;
+    gpgrt_b64enc_finish;
+
+    gpgrt_cmp_version;
+
+    gpgrt_ftruncate;
+    gpgrt_fprintf_sf;
+    gpgrt_fprintf_sf_unlocked;
+
+    gpgrt_add_emergency_cleanup;
+    gpgrt_abort;
+
+    gpgrt_fnameconcat;
+    gpgrt_absfnameconcat;
+
+    gpgrt_access;
+
   local:
     *;
 };
diff --git a/src/gpgrt-config b/src/gpgrt-config
new file mode 100755 (executable)
index 0000000..36604d1
--- /dev/null
@@ -0,0 +1,647 @@
+#!/bin/sh
+#                          -*- mode: shell-script; sh-shell: "/bin/sh" -*-
+# Copyright (C) 2018, 2021 g10 Code GmbH
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This file is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# SPDX-License-Identifier: FSFULLR
+
+#### start of functions for this script
+
+#
+# Bourne shell functions for config file in pkg-config style, so that
+# we can share such a config file between pkg-config and script
+#
+
+#
+# get_var: Get the variable value of NAME
+#
+# Variables are recorded in the shell variables named "VAR_<NAME>"
+#
+get_var () {
+    ___name=$1
+
+    eval echo \$VAR_$___name
+}
+
+#
+# get_attr: Get the attribute value of KEY
+#
+# Attributes are recorded in the shell variables named "ATTR_<KEY>"
+#
+get_attr () {
+    ___name=$1
+
+    eval echo \$ATTR_$___name
+}
+
+# variant of get_attr for list (separated by ',')
+get_attr_l () {
+    (IFS=', '; echo "$(get_attr $1)")
+}
+
+# Remove ${varname} part in the beginning of a string.
+remove_var_expr () {
+    ___varname=$1
+    shift
+
+    expr "$*" : "\${$___varname}\\(.*\\)"
+}
+
+# Given a string, substitute variables.
+substitute_vars () {
+    __string="$1"
+    __varname=""
+    __result=""
+
+    while [ -n "$__string" ]; do
+       case "$__string" in
+           \$\$*)
+               __result="$__result\$"
+               __string="${__string#\$\$}"
+               ;;
+           \${*}*)
+               __varname="${__string#\$\{}"
+               __varname="${__varname%%\}*}"
+               __result="$__result$(get_var $__varname)"
+               __string=$(remove_var_expr $__varname $__string)
+               ;;
+           *)
+               __result="$__result$(printf %c "$__string")"
+               __string="${__string#$(printf %c "$__string")}"
+               ;;
+       esac
+    done
+
+    echo "$__result"
+}
+
+#
+# Read a config from stdin
+#
+# Variables:
+# For VAR=VALUE, value is stored in the shell variable VAR_*.
+#
+# Attributes:
+# For KEY: VALUE, value is stored in the shell variable ATTR_*.
+#
+read_config_from_stdin () {
+    _filename=$1
+    _line=""
+    _varname=""
+    _value=""
+    _key=""
+    _reading_attrs=""
+
+    while read _line; do
+       if [ -z "$_line" ]; then
+           _reading_attrs=yes
+           continue
+       elif [ -z "$_reading_attrs" ]; then
+           case "$_line" in
+               *=*)
+                   _varname="${_line%%=*}"
+                   _value="${_line#*=}"
+                   VAR_list="$VAR_list${VAR_list:+ }VAR_$_varname"
+                   read VAR_$_varname <<EOF1
+$(substitute_vars "$_value")
+EOF1
+                   continue
+                   ;;
+               *) _reading_attrs=yes ;;
+           esac
+       fi
+       if [ -n "$_reading_attrs" ]; then
+           case "$_line" in
+               *:\ *)
+                   _key="${_line%%:\ *}"
+                   _value="${_line#*:\ }"
+                   if expr "$_key" : ".*\..*" >/dev/null; then
+                       _key="${_key%.*}_${_key#*.}"
+                   fi
+                   ATTR_list="$ATTR_list${ATTR_list:+ }ATTR_$_key"
+                   read ATTR_$_key <<EOF2
+$(substitute_vars "$_value")
+EOF2
+                   ;;
+               *:|*:\ ) ;;
+               *)
+                   echo "Error reading $_filename: $_line" 1>&2
+                   exit 1
+                   ;;
+           esac
+       fi
+    done
+}
+
+
+find_file_in_path () {
+    _f=$1
+    _p=$2
+    _saved_IFS="$IFS"
+    _arg=""
+    IFS=":"            # On Windows it should be ";"???
+
+    for _arg in $_p; do
+       if [ -r $_arg/$_f ]; then
+           RESULT="$_arg/$_f"
+           IFS="$_saved_IFS"
+           return 0
+       fi
+    done
+    IFS="$_saved_IFS"
+    RESULT=""
+    return 1
+}
+
+read_config_file () {
+    if ! find_file_in_path $1.pc $2; then
+       if [ -z "$want_exists" ]; then
+           echo "Can't find $1.pc" 1>&2
+       fi
+       exit 1
+    fi
+    read_config_from_stdin $RESULT < $RESULT
+}
+
+cleanup_vars_attrs () {
+    eval unset $VAR_list VAR_list
+    eval unset $ATTR_list ATTR_list
+}
+
+not_listed_yet () {
+    ___m=$1
+    ___arg=""
+    shift
+
+    for ___arg; do
+       if [ $___m = $___arg ]; then
+           return 1
+       fi
+    done
+
+    return 0
+}
+
+list_only_once () {
+    __result=""
+    __arg=""
+
+    for __arg; do
+       if not_listed_yet $__arg $__result; then
+           __result="$__result${__result:+ }$__arg"
+       fi
+    done
+
+    echo $__result
+}
+
+list_only_once_for_libs () {
+    __result=""
+    __rev_list=""
+    __arg=""
+
+    # Scan the list and eliminate duplicates for non-"-lxxx"
+    # the resulted list is in reverse order
+    for __arg; do
+       case "$__arg" in
+           -l*)
+               # As-is
+               __rev_list="$__arg${__rev_list:+ }$__rev_list"
+               ;;
+           *)
+               if not_listed_yet $__arg $__rev_list; then
+                   __rev_list="$__arg${__rev_list:+ }$__rev_list"
+               fi
+               ;;
+       esac
+    done
+
+    # Scan again
+    for __arg in $__rev_list; do
+       case "$__arg" in
+           -l*)
+               if not_listed_yet $__arg $__result; then
+                   __result="$__arg${__result:+ }$__result"
+               fi
+               ;;
+           *)
+               # As-is
+               __result="$__arg${__result:+ }$__result"
+               ;;
+       esac
+    done
+
+    echo $__result
+}
+
+arg1_is_same () {
+    [ "$1" = "=" -o "$1" = ">=" -o "$1" = "<=" ]
+}
+
+arg1_is_less () {
+    [ "$1" = "!=" -o "$1" = "<" -o "$1" = "<=" ]
+}
+
+arg1_is_great () {
+    [ "$1" = "!=" -o "$1" = ">" -o "$1" = ">=" ]
+}
+
+#
+# Evaluate comparison between versions in RPM way
+#
+eval_compare_version () {
+    ___str1="$1"
+    ___cmp="$2"
+    ___str2="$3"
+    ___char1=""
+    ___char2=""
+    ___chunk1=""
+    ___chunk2=""
+
+    while [ -n "$___str1" -a -n "$___str2" ]; do
+       # Trim anything that's not alnum or tilde from the front
+       ___str1="$(expr "$___str1" : '[^0-9A-Za-z~]*\(.*\)')"
+       ___str2="$(expr "$___str2" : '[^0-9A-Za-z~]*\(.*\)')"
+
+       # Get the first character
+       ___char1=${___str1%${___str1#?}}
+       ___char2=${___str2%${___str2#?}}
+
+       if [ "$___char1" = ~ -o "$___char2" = ~ ]; then
+           if [ "$___char1" != ~ ]; then
+               arg1_is_great $___cmp
+               return
+           fi
+           if [ "$___char2" != ~ ]; then
+               arg1_is_less $___cmp
+               return
+           fi
+           ___str1=${___str1#~}
+           ___str2=${___str2#~}
+           continue
+       fi
+
+       if [ -z "$___char1" -o -z "$___char2" ]; then
+           break
+       fi
+
+       case "$___char1$___char2" in
+           [0-9][A-Za-z])
+               arg1_is_great $___cmp
+               return
+               ;;
+           [A-Za-z][0-9])
+               arg1_is_less $___cmp
+               return
+               ;;
+           [0-9][0-9])
+               ___chunk1="$(expr "$___str1" : '\([0-9]*\)')"
+               ___chunk2="$(expr "$___str2" : '\([0-9]*\)')"
+               ;;
+           [A-Za-z][A-Za-z])
+               ___chunk1="$(expr "$___str1" : '\([A-Za-z]*\)')"
+               ___chunk2="$(expr "$___str2" : '\([A-Za-z]*\)')"
+               ;;
+       esac
+
+       # Compare chunks numerically if digits, or lexicographically
+       if expr "$___chunk1" "!=" "$___chunk2" >/dev/null; then
+           if expr "$___chunk1" ">" "$___chunk2" >/dev/null; then
+               arg1_is_great $___cmp
+               return
+           else
+               arg1_is_less $___cmp
+               return
+           fi
+       fi
+
+       # Remove the chunk
+       ___str1="${___str1#$___chunk1}"
+       ___str2="${___str2#$___chunk2}"
+    done
+
+    # Either STR1, STR2 or both is empty here
+    if [ -n "$___str1" ]; then
+       case "$___str1" in
+           ~*) arg1_is_less $___cmp ;;
+           *)  arg1_is_great $___cmp ;;
+       esac
+    elif [ -n "$___str2" ]; then
+       case "$___str2" in
+           ~*) arg1_is_great $___cmp ;;
+           *)  arg1_is_less $___cmp ;;
+       esac
+    else
+       arg1_is_same $___cmp
+    fi
+}
+
+#
+# Recursively solve package dependencies
+#
+# Result is in the PKG_LIST variable
+#
+all_required_config_files () {
+    all_list=""
+    new_list=""
+    p=""
+    pkg=""
+    cmp=""
+
+    list=$*
+    while [ -n "$list" ]; do
+       for p in $list; do
+           if [ -z "$pkg" ]; then
+               pkg=$p
+           elif [ -z "$cmp" ]; then
+               case "$p" in
+                   "="|"!="|"<"|">"|"<="|">=") cmp=$p ;;
+                   *)
+                       read_config_file $pkg $PKG_CONFIG_PATH
+                       all_list="$all_list${all_list:+ }$pkg"
+                       new_list="$new_list${new_list:+ }$(get_attr_l Requires)"
+                       if [ -n "$enable_static" ]; then
+                           new_list="$new_list${new_list:+ }$(get_attr_l Requires_private)"
+                       fi
+                       cleanup_vars_attrs
+                       pkg=$p
+                       ;;
+               esac
+           else
+               read_config_file $pkg $PKG_CONFIG_PATH
+               if ! eval_compare_version "$(get_attr Version)" $cmp $p; then
+                   echo "Version mismatch for $pkg $cmp $p: $(get_attr Version)" 1>&2
+                   exit 1
+               fi
+               all_list="$all_list${all_list:+ }$pkg"
+               new_list="$new_list${new_list:+ }$(get_attr_l Requires)"
+               if [ -n "$enable_static" ]; then
+                   new_list="$new_list${new_list:+ }$(get_attr_l Requires_private)"
+               fi
+               cleanup_vars_attrs
+               pkg=""
+               cmp=""
+           fi
+       done
+       if [ -n "$cmp" ]; then
+           echo "No version after comparison operator ($cmp): $pkg" 1>&2
+           exit 1
+       elif [ -n "$pkg" ]; then
+           read_config_file $pkg $PKG_CONFIG_PATH
+           all_list="$all_list${all_list:+ }$pkg"
+           new_list="$new_list${new_list:+ }$(get_attr_l Requires)"
+           if [ -n "$enable_static" ]; then
+               new_list="$new_list${new_list:+ }$(get_attr_l Requires_private)"
+           fi
+           cleanup_vars_attrs
+       fi
+
+       list="$new_list"
+       new_list=""
+    done
+
+    PKG_LIST=$(list_only_once $all_list)
+}
+
+#
+# Modify -I or -L by PKG_CONFIG_SYSROOT_DIR variable
+#
+sysroot () {
+    _opt="$1"
+    _result=""
+    shift
+
+    while [ $# -gt 0 ]; do
+       if [ $1 = $_opt ]; then
+           _result="$_result${_result:+ }$_opt"
+           shift
+           _result="$_result $PKG_CONFIG_SYSROOT_DIR$1"
+       elif expr "x$1" : "^x$_opt" >/dev/null; then
+           _result="$_result${_result:+ }$_opt$PKG_CONFIG_SYSROOT_DIR$(expr "x$1" : "^x$_opt\(.*\)")"
+       else
+           _result="$_result${_result:+ }$1"
+       fi
+       shift
+    done
+    echo "$_result"
+}
+
+# Show usage
+usage () {
+    cat <<EOF
+Usage: gpgrt-config [--libdir=LIBDIR] [OPTIONS] MODULES
+Options:
+       [--exists]
+       [--modversion]
+       [--libs]
+       [--cflags]
+       [--static]
+       [--variable=VARNAME]
+EOF
+    exit $1
+}
+#### end of functions for this script
+
+myname=${0##*/}
+if [ $myname = gpgrt-config ]; then
+  default_module="gpg-error"
+else
+  default_module=${myname%-config}
+fi
+
+# First stage to process --libdir option
+
+libdir=""
+while test $# -gt 0; do
+    case $1 in
+       --libdir=*)
+           libdir=${1#--libdir=}
+           shift
+           ;;
+       *)
+           break
+           ;;
+    esac
+done
+
+if env | grep '^PKG_CONFIG_LIBDIR=$' >/dev/null 2>&1; then
+  # The variable set as empty, we use PKG_CONFIG_PATH in this case,
+  # ignoring --libdir option
+  if [ -z "$PKG_CONFIG_PATH"  ]; then
+    echo "Please have valid PKG_CONFIG_PATH if PKG_CONFIG_LIBDIR is empty" 1>&2
+    exit 1
+  fi
+else
+  if [ -n "$libdir" ]; then
+    # --libdir option is available, it overrides existing PKG_CONFIG_LIBDIR
+    PKG_CONFIG_LIBDIR=$libdir/pkgconfig
+  fi
+  if [ -z "$PKG_CONFIG_LIBDIR" ]; then
+    if [ -z "$PKG_CONFIG_PATH" ]; then
+      echo "Please use --libdir=LIBDIR option or set PKG_CONFIG_LIBDIR" 1>&2
+      echo "Or set PKG_CONFIG_PATH" 1>&2
+      exit 1
+    fi
+  else
+    # PKG_CONFIG_LIBDIR is available here
+    # Modify PKG_CONFIG_PATH, prepending PKG_CONFIG_LIBDIR
+    PKG_CONFIG_PATH="$PKG_CONFIG_LIBDIR${PKG_CONFIG_PATH:+:}$PKG_CONFIG_PATH"
+  fi
+fi
+# PKG_CONFIG_PATH is ready here
+
+#
+
+if test $# -eq 0; then
+    usage 1 1>&2
+fi
+
+
+# Second stage to do the main functionality
+
+module_list=""
+want_var=""
+want_attr=""
+want_cflags=""
+want_libs=""
+want_exists=""
+enable_static=""
+
+cflags=""
+libs=""
+mtcflags=""
+mtlibs=""
+
+output=""
+
+mt="no"
+
+VAR_list=VAR_pc_sysrootdir
+if [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
+    VAR_pc_sysrootdir="/"
+else
+    VAR_pc_sysrootdir="$PKG_CONFIG_SYSROOT_DIR"
+fi
+
+while test $# -gt 0; do
+    case $1 in
+       #### pkg-config incompatible options: begin
+       --prefix)
+           # In future, use --variable=prefix instead.
+           want_var=prefix
+           ;;
+       --exec-prefix)
+           # In future, use --variable=exec_prefix instead.
+           want_var=exec_prefix
+           ;;
+       --version)
+           # In future, use --modversion instead.
+           want_attr=Version
+           ;;
+       --api-version)
+           # In future, use --variable=api_version instead.
+           want_var=api_version
+           ;;
+       --host)
+           # In future, use --variable=host instead.
+           want_var=host
+           ;;
+       --mt)
+           # In future, use --variable=mtcflags or --variable=mtlibs.
+           mt=yes
+           ;;
+       #### pkg-config incompatible options: end
+       --modversion)
+           want_attr=Version
+           ;;
+       --exists)
+           want_exists=yes
+           ;;
+       --cflags)
+           want_cflags=yes
+           ;;
+       --libs)
+           want_libs=yes
+           ;;
+       --static)
+           enable_static=yes
+           ;;
+       --variable=*)
+           want_var=${1#*=}
+           ;;
+       --help)
+           usage 0
+           ;;
+       --*)
+           usage 1 1>&2
+           ;;
+       *)
+           # Modules
+           module_list="$module_list${module_list:+ }$1"
+           ;;
+    esac
+
+    shift
+done
+
+
+if [ -z "$module_list" ]; then
+    module_list=$default_module
+elif expr "$module_list" : "=\|!=\|<\|>\|<=\|>=" >/dev/null; then
+    module_list="$default_module $module_list"
+fi
+
+all_required_config_files $module_list
+
+for p in $PKG_LIST; do
+    read_config_file $p $PKG_CONFIG_PATH
+    # For want_var or want_attr, get it from the first package
+    if [ -n "$want_var" ]; then
+       output="$(get_var $want_var)"
+       break
+    elif [ -n "$want_attr" ]; then
+       output="$(get_attr $want_attr)"
+       break
+    else
+       cflags="$cflags${cflags:+ }$(get_attr Cflags)"
+       libs="$libs${libs:+ }$(get_attr Libs)"
+       if [ -n "$enable_static" ]; then
+           libs="$libs${libs:+ }$(get_attr Libs_private)"
+       fi
+
+       if [ $p = "gpg-error" ]; then
+           mtcflags="$(get_var mtcflags)"
+           mtlibs="$(get_var mtlibs)"
+       fi
+    fi
+    cleanup_vars_attrs
+done
+
+if [ -z "$want_var" -a -z "$want_attr" ]; then
+    if [ -n "$want_cflags" ]; then
+       output="$output${output:+ }$(sysroot -I $(list_only_once $cflags))"
+       # Backward compatibility to old gpg-error-config
+       if [ $mt = yes -a -n "$mtcflags" ]; then
+           output="$output${output:+ }$mtcflags"
+       fi
+    fi
+    if [ -n "$want_libs" ]; then
+       output="$output${output:+ }$(sysroot -L $(list_only_once_for_libs $libs))"
+       # Backward compatibility to old gpg-error-config
+       if [ $mt = yes -a -n "$mtlibs" ]; then
+           output="$output${output:+ }$mtlibs"
+       fi
+    fi
+fi
+
+if [ -z "$want_exists" ]; then
+  echo "$output"
+fi
+
+exit 0
diff --git a/src/gpgrt-config.in b/src/gpgrt-config.in
new file mode 100644 (file)
index 0000000..3aaa243
--- /dev/null
@@ -0,0 +1,647 @@
+#!@INSTALLSHELLPATH@
+#                          -*- mode: shell-script; sh-shell: "/bin/sh" -*-
+# Copyright (C) 2018, 2021 g10 Code GmbH
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This file is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# SPDX-License-Identifier: FSFULLR
+
+#### start of functions for this script
+
+#
+# Bourne shell functions for config file in pkg-config style, so that
+# we can share such a config file between pkg-config and script
+#
+
+#
+# get_var: Get the variable value of NAME
+#
+# Variables are recorded in the shell variables named "VAR_<NAME>"
+#
+get_var () {
+    ___name=$1
+
+    eval echo \$VAR_$___name
+}
+
+#
+# get_attr: Get the attribute value of KEY
+#
+# Attributes are recorded in the shell variables named "ATTR_<KEY>"
+#
+get_attr () {
+    ___name=$1
+
+    eval echo \$ATTR_$___name
+}
+
+# variant of get_attr for list (separated by ',')
+get_attr_l () {
+    (IFS=', '; echo "$(get_attr $1)")
+}
+
+# Remove ${varname} part in the beginning of a string.
+remove_var_expr () {
+    ___varname=$1
+    shift
+
+    expr "$*" : "\${$___varname}\\(.*\\)"
+}
+
+# Given a string, substitute variables.
+substitute_vars () {
+    __string="$1"
+    __varname=""
+    __result=""
+
+    while [ -n "$__string" ]; do
+       case "$__string" in
+           \$\$*)
+               __result="$__result\$"
+               __string="${__string#\$\$}"
+               ;;
+           \${*}*)
+               __varname="${__string#\$\{}"
+               __varname="${__varname%%\}*}"
+               __result="$__result$(get_var $__varname)"
+               __string=$(remove_var_expr $__varname $__string)
+               ;;
+           *)
+               __result="$__result$(printf %c "$__string")"
+               __string="${__string#$(printf %c "$__string")}"
+               ;;
+       esac
+    done
+
+    echo "$__result"
+}
+
+#
+# Read a config from stdin
+#
+# Variables:
+# For VAR=VALUE, value is stored in the shell variable VAR_*.
+#
+# Attributes:
+# For KEY: VALUE, value is stored in the shell variable ATTR_*.
+#
+read_config_from_stdin () {
+    _filename=$1
+    _line=""
+    _varname=""
+    _value=""
+    _key=""
+    _reading_attrs=""
+
+    while read _line; do
+       if [ -z "$_line" ]; then
+           _reading_attrs=yes
+           continue
+       elif [ -z "$_reading_attrs" ]; then
+           case "$_line" in
+               *=*)
+                   _varname="${_line%%=*}"
+                   _value="${_line#*=}"
+                   VAR_list="$VAR_list${VAR_list:+ }VAR_$_varname"
+                   read VAR_$_varname <<EOF1
+$(substitute_vars "$_value")
+EOF1
+                   continue
+                   ;;
+               *) _reading_attrs=yes ;;
+           esac
+       fi
+       if [ -n "$_reading_attrs" ]; then
+           case "$_line" in
+               *:\ *)
+                   _key="${_line%%:\ *}"
+                   _value="${_line#*:\ }"
+                   if expr "$_key" : ".*\..*" >/dev/null; then
+                       _key="${_key%.*}_${_key#*.}"
+                   fi
+                   ATTR_list="$ATTR_list${ATTR_list:+ }ATTR_$_key"
+                   read ATTR_$_key <<EOF2
+$(substitute_vars "$_value")
+EOF2
+                   ;;
+               *:|*:\ ) ;;
+               *)
+                   echo "Error reading $_filename: $_line" 1>&2
+                   exit 1
+                   ;;
+           esac
+       fi
+    done
+}
+
+
+find_file_in_path () {
+    _f=$1
+    _p=$2
+    _saved_IFS="$IFS"
+    _arg=""
+    IFS=":"            # On Windows it should be ";"???
+
+    for _arg in $_p; do
+       if [ -r $_arg/$_f ]; then
+           RESULT="$_arg/$_f"
+           IFS="$_saved_IFS"
+           return 0
+       fi
+    done
+    IFS="$_saved_IFS"
+    RESULT=""
+    return 1
+}
+
+read_config_file () {
+    if ! find_file_in_path $1.pc $2; then
+       if [ -z "$want_exists" ]; then
+           echo "Can't find $1.pc" 1>&2
+       fi
+       exit 1
+    fi
+    read_config_from_stdin $RESULT < $RESULT
+}
+
+cleanup_vars_attrs () {
+    eval unset $VAR_list VAR_list
+    eval unset $ATTR_list ATTR_list
+}
+
+not_listed_yet () {
+    ___m=$1
+    ___arg=""
+    shift
+
+    for ___arg; do
+       if [ $___m = $___arg ]; then
+           return 1
+       fi
+    done
+
+    return 0
+}
+
+list_only_once () {
+    __result=""
+    __arg=""
+
+    for __arg; do
+       if not_listed_yet $__arg $__result; then
+           __result="$__result${__result:+ }$__arg"
+       fi
+    done
+
+    echo $__result
+}
+
+list_only_once_for_libs () {
+    __result=""
+    __rev_list=""
+    __arg=""
+
+    # Scan the list and eliminate duplicates for non-"-lxxx"
+    # the resulted list is in reverse order
+    for __arg; do
+       case "$__arg" in
+           -l*)
+               # As-is
+               __rev_list="$__arg${__rev_list:+ }$__rev_list"
+               ;;
+           *)
+               if not_listed_yet $__arg $__rev_list; then
+                   __rev_list="$__arg${__rev_list:+ }$__rev_list"
+               fi
+               ;;
+       esac
+    done
+
+    # Scan again
+    for __arg in $__rev_list; do
+       case "$__arg" in
+           -l*)
+               if not_listed_yet $__arg $__result; then
+                   __result="$__arg${__result:+ }$__result"
+               fi
+               ;;
+           *)
+               # As-is
+               __result="$__arg${__result:+ }$__result"
+               ;;
+       esac
+    done
+
+    echo $__result
+}
+
+arg1_is_same () {
+    [ "$1" = "=" -o "$1" = ">=" -o "$1" = "<=" ]
+}
+
+arg1_is_less () {
+    [ "$1" = "!=" -o "$1" = "<" -o "$1" = "<=" ]
+}
+
+arg1_is_great () {
+    [ "$1" = "!=" -o "$1" = ">" -o "$1" = ">=" ]
+}
+
+#
+# Evaluate comparison between versions in RPM way
+#
+eval_compare_version () {
+    ___str1="$1"
+    ___cmp="$2"
+    ___str2="$3"
+    ___char1=""
+    ___char2=""
+    ___chunk1=""
+    ___chunk2=""
+
+    while [ -n "$___str1" -a -n "$___str2" ]; do
+       # Trim anything that's not alnum or tilde from the front
+       ___str1="$(expr "$___str1" : '[^0-9A-Za-z~]*\(.*\)')"
+       ___str2="$(expr "$___str2" : '[^0-9A-Za-z~]*\(.*\)')"
+
+       # Get the first character
+       ___char1=${___str1%${___str1#?}}
+       ___char2=${___str2%${___str2#?}}
+
+       if [ "$___char1" = ~ -o "$___char2" = ~ ]; then
+           if [ "$___char1" != ~ ]; then
+               arg1_is_great $___cmp
+               return
+           fi
+           if [ "$___char2" != ~ ]; then
+               arg1_is_less $___cmp
+               return
+           fi
+           ___str1=${___str1#~}
+           ___str2=${___str2#~}
+           continue
+       fi
+
+       if [ -z "$___char1" -o -z "$___char2" ]; then
+           break
+       fi
+
+       case "$___char1$___char2" in
+           [0-9][A-Za-z])
+               arg1_is_great $___cmp
+               return
+               ;;
+           [A-Za-z][0-9])
+               arg1_is_less $___cmp
+               return
+               ;;
+           [0-9][0-9])
+               ___chunk1="$(expr "$___str1" : '\([0-9]*\)')"
+               ___chunk2="$(expr "$___str2" : '\([0-9]*\)')"
+               ;;
+           [A-Za-z][A-Za-z])
+               ___chunk1="$(expr "$___str1" : '\([A-Za-z]*\)')"
+               ___chunk2="$(expr "$___str2" : '\([A-Za-z]*\)')"
+               ;;
+       esac
+
+       # Compare chunks numerically if digits, or lexicographically
+       if expr "$___chunk1" "!=" "$___chunk2" >/dev/null; then
+           if expr "$___chunk1" ">" "$___chunk2" >/dev/null; then
+               arg1_is_great $___cmp
+               return
+           else
+               arg1_is_less $___cmp
+               return
+           fi
+       fi
+
+       # Remove the chunk
+       ___str1="${___str1#$___chunk1}"
+       ___str2="${___str2#$___chunk2}"
+    done
+
+    # Either STR1, STR2 or both is empty here
+    if [ -n "$___str1" ]; then
+       case "$___str1" in
+           ~*) arg1_is_less $___cmp ;;
+           *)  arg1_is_great $___cmp ;;
+       esac
+    elif [ -n "$___str2" ]; then
+       case "$___str2" in
+           ~*) arg1_is_great $___cmp ;;
+           *)  arg1_is_less $___cmp ;;
+       esac
+    else
+       arg1_is_same $___cmp
+    fi
+}
+
+#
+# Recursively solve package dependencies
+#
+# Result is in the PKG_LIST variable
+#
+all_required_config_files () {
+    all_list=""
+    new_list=""
+    p=""
+    pkg=""
+    cmp=""
+
+    list=$*
+    while [ -n "$list" ]; do
+       for p in $list; do
+           if [ -z "$pkg" ]; then
+               pkg=$p
+           elif [ -z "$cmp" ]; then
+               case "$p" in
+                   "="|"!="|"<"|">"|"<="|">=") cmp=$p ;;
+                   *)
+                       read_config_file $pkg $PKG_CONFIG_PATH
+                       all_list="$all_list${all_list:+ }$pkg"
+                       new_list="$new_list${new_list:+ }$(get_attr_l Requires)"
+                       if [ -n "$enable_static" ]; then
+                           new_list="$new_list${new_list:+ }$(get_attr_l Requires_private)"
+                       fi
+                       cleanup_vars_attrs
+                       pkg=$p
+                       ;;
+               esac
+           else
+               read_config_file $pkg $PKG_CONFIG_PATH
+               if ! eval_compare_version "$(get_attr Version)" $cmp $p; then
+                   echo "Version mismatch for $pkg $cmp $p: $(get_attr Version)" 1>&2
+                   exit 1
+               fi
+               all_list="$all_list${all_list:+ }$pkg"
+               new_list="$new_list${new_list:+ }$(get_attr_l Requires)"
+               if [ -n "$enable_static" ]; then
+                   new_list="$new_list${new_list:+ }$(get_attr_l Requires_private)"
+               fi
+               cleanup_vars_attrs
+               pkg=""
+               cmp=""
+           fi
+       done
+       if [ -n "$cmp" ]; then
+           echo "No version after comparison operator ($cmp): $pkg" 1>&2
+           exit 1
+       elif [ -n "$pkg" ]; then
+           read_config_file $pkg $PKG_CONFIG_PATH
+           all_list="$all_list${all_list:+ }$pkg"
+           new_list="$new_list${new_list:+ }$(get_attr_l Requires)"
+           if [ -n "$enable_static" ]; then
+               new_list="$new_list${new_list:+ }$(get_attr_l Requires_private)"
+           fi
+           cleanup_vars_attrs
+       fi
+
+       list="$new_list"
+       new_list=""
+    done
+
+    PKG_LIST=$(list_only_once $all_list)
+}
+
+#
+# Modify -I or -L by PKG_CONFIG_SYSROOT_DIR variable
+#
+sysroot () {
+    _opt="$1"
+    _result=""
+    shift
+
+    while [ $# -gt 0 ]; do
+       if [ $1 = $_opt ]; then
+           _result="$_result${_result:+ }$_opt"
+           shift
+           _result="$_result $PKG_CONFIG_SYSROOT_DIR$1"
+       elif expr "x$1" : "^x$_opt" >/dev/null; then
+           _result="$_result${_result:+ }$_opt$PKG_CONFIG_SYSROOT_DIR$(expr "x$1" : "^x$_opt\(.*\)")"
+       else
+           _result="$_result${_result:+ }$1"
+       fi
+       shift
+    done
+    echo "$_result"
+}
+
+# Show usage
+usage () {
+    cat <<EOF
+Usage: gpgrt-config [--libdir=LIBDIR] [OPTIONS] MODULES
+Options:
+       [--exists]
+       [--modversion]
+       [--libs]
+       [--cflags]
+       [--static]
+       [--variable=VARNAME]
+EOF
+    exit $1
+}
+#### end of functions for this script
+
+myname=${0##*/}
+if [ $myname = gpgrt-config ]; then
+  default_module="gpg-error"
+else
+  default_module=${myname%-config}
+fi
+
+# First stage to process --libdir option
+
+libdir=""
+while test $# -gt 0; do
+    case $1 in
+       --libdir=*)
+           libdir=${1#--libdir=}
+           shift
+           ;;
+       *)
+           break
+           ;;
+    esac
+done
+
+if env | grep '^PKG_CONFIG_LIBDIR=$' >/dev/null 2>&1; then
+  # The variable set as empty, we use PKG_CONFIG_PATH in this case,
+  # ignoring --libdir option
+  if [ -z "$PKG_CONFIG_PATH"  ]; then
+    echo "Please have valid PKG_CONFIG_PATH if PKG_CONFIG_LIBDIR is empty" 1>&2
+    exit 1
+  fi
+else
+  if [ -n "$libdir" ]; then
+    # --libdir option is available, it overrides existing PKG_CONFIG_LIBDIR
+    PKG_CONFIG_LIBDIR=$libdir/pkgconfig
+  fi
+  if [ -z "$PKG_CONFIG_LIBDIR" ]; then
+    if [ -z "$PKG_CONFIG_PATH" ]; then
+      echo "Please use --libdir=LIBDIR option or set PKG_CONFIG_LIBDIR" 1>&2
+      echo "Or set PKG_CONFIG_PATH" 1>&2
+      exit 1
+    fi
+  else
+    # PKG_CONFIG_LIBDIR is available here
+    # Modify PKG_CONFIG_PATH, prepending PKG_CONFIG_LIBDIR
+    PKG_CONFIG_PATH="$PKG_CONFIG_LIBDIR${PKG_CONFIG_PATH:+:}$PKG_CONFIG_PATH"
+  fi
+fi
+# PKG_CONFIG_PATH is ready here
+
+#
+
+if test $# -eq 0; then
+    usage 1 1>&2
+fi
+
+
+# Second stage to do the main functionality
+
+module_list=""
+want_var=""
+want_attr=""
+want_cflags=""
+want_libs=""
+want_exists=""
+enable_static=""
+
+cflags=""
+libs=""
+mtcflags=""
+mtlibs=""
+
+output=""
+
+mt="no"
+
+VAR_list=VAR_pc_sysrootdir
+if [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
+    VAR_pc_sysrootdir="/"
+else
+    VAR_pc_sysrootdir="$PKG_CONFIG_SYSROOT_DIR"
+fi
+
+while test $# -gt 0; do
+    case $1 in
+       #### pkg-config incompatible options: begin
+       --prefix)
+           # In future, use --variable=prefix instead.
+           want_var=prefix
+           ;;
+       --exec-prefix)
+           # In future, use --variable=exec_prefix instead.
+           want_var=exec_prefix
+           ;;
+       --version)
+           # In future, use --modversion instead.
+           want_attr=Version
+           ;;
+       --api-version)
+           # In future, use --variable=api_version instead.
+           want_var=api_version
+           ;;
+       --host)
+           # In future, use --variable=host instead.
+           want_var=host
+           ;;
+       --mt)
+           # In future, use --variable=mtcflags or --variable=mtlibs.
+           mt=yes
+           ;;
+       #### pkg-config incompatible options: end
+       --modversion)
+           want_attr=Version
+           ;;
+       --exists)
+           want_exists=yes
+           ;;
+       --cflags)
+           want_cflags=yes
+           ;;
+       --libs)
+           want_libs=yes
+           ;;
+       --static)
+           enable_static=yes
+           ;;
+       --variable=*)
+           want_var=${1#*=}
+           ;;
+       --help)
+           usage 0
+           ;;
+       --*)
+           usage 1 1>&2
+           ;;
+       *)
+           # Modules
+           module_list="$module_list${module_list:+ }$1"
+           ;;
+    esac
+
+    shift
+done
+
+
+if [ -z "$module_list" ]; then
+    module_list=$default_module
+elif expr "$module_list" : "=\|!=\|<\|>\|<=\|>=" >/dev/null; then
+    module_list="$default_module $module_list"
+fi
+
+all_required_config_files $module_list
+
+for p in $PKG_LIST; do
+    read_config_file $p $PKG_CONFIG_PATH
+    # For want_var or want_attr, get it from the first package
+    if [ -n "$want_var" ]; then
+       output="$(get_var $want_var)"
+       break
+    elif [ -n "$want_attr" ]; then
+       output="$(get_attr $want_attr)"
+       break
+    else
+       cflags="$cflags${cflags:+ }$(get_attr Cflags)"
+       libs="$libs${libs:+ }$(get_attr Libs)"
+       if [ -n "$enable_static" ]; then
+           libs="$libs${libs:+ }$(get_attr Libs_private)"
+       fi
+
+       if [ $p = "gpg-error" ]; then
+           mtcflags="$(get_var mtcflags)"
+           mtlibs="$(get_var mtlibs)"
+       fi
+    fi
+    cleanup_vars_attrs
+done
+
+if [ -z "$want_var" -a -z "$want_attr" ]; then
+    if [ -n "$want_cflags" ]; then
+       output="$output${output:+ }$(sysroot -I $(list_only_once $cflags))"
+       # Backward compatibility to old gpg-error-config
+       if [ $mt = yes -a -n "$mtcflags" ]; then
+           output="$output${output:+ }$mtcflags"
+       fi
+    fi
+    if [ -n "$want_libs" ]; then
+       output="$output${output:+ }$(sysroot -L $(list_only_once_for_libs $libs))"
+       # Backward compatibility to old gpg-error-config
+       if [ $mt = yes -a -n "$mtlibs" ]; then
+           output="$output${output:+ }$mtlibs"
+       fi
+    fi
+fi
+
+if [ -z "$want_exists" ]; then
+  echo "$output"
+fi
+
+exit 0
index 701e1d4..8ca52c6 100644 (file)
@@ -1,5 +1,5 @@
 /* gpgrt-int.h - Internal definitions
- * Copyright (C) 2014 g10 Code GmbH
+ * Copyright (C) 2014, 2017 g10 Code GmbH
  *
  * This file is part of libgpg-error.
  *
@@ -15,6 +15,7 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1+
  */
 
 #ifndef _GPGRT_GPGRT_INT_H
 
 #include "gpg-error.h"
 #include "visibility.h"
+#include "protos.h"
 
-/* Local error function prototypes.  */
+/*
+ * Internal i18n macros.
+ */
+#ifdef ENABLE_NLS
+# ifdef HAVE_W32_SYSTEM
+#  include "gettext.h"
+# else
+#  include <libintl.h>
+# endif
+# define _(a) gettext (a)
+# ifdef gettext_noop
+#  define N_(a) gettext_noop (a)
+# else
+#  define N_(a) (a)
+# endif
+#else  /*!ENABLE_NLS*/
+# define _(a) (a)
+# define N_(a) (a)
+#endif /*!ENABLE_NLS */
+
+
+/*
+ * Hacks mainly required for Slowaris.
+ */
+#ifdef _GPGRT_NEED_AFLOCAL
+# ifndef HAVE_W32_SYSTEM
+#  include <sys/socket.h>
+#  include <sys/un.h>
+# else
+#  ifdef HAVE_WINSOCK2_H
+#   include <winsock2.h>
+#  endif
+# include <windows.h>
+# endif
+
+# ifndef PF_LOCAL
+#  ifdef PF_UNIX
+#   define PF_LOCAL PF_UNIX
+#  else
+#   define PF_LOCAL AF_UNIX
+#  endif
+# endif /*PF_LOCAL*/
+# ifndef AF_LOCAL
+#  define AF_LOCAL AF_UNIX
+# endif /*AF_UNIX*/
+
+/* We used to avoid this macro in GnuPG and inlined the AF_LOCAL name
+ * length computation directly with the little twist of adding 1 extra
+ * byte.  It seems that this was needed once on an old HP/UX box and
+ * there are also rumours that 4.3 Reno and DEC systems need it.  This
+ * one-off buglet did not harm any current system until it came to Mac
+ * OS X where the kernel (as of May 2009) exhibited a strange bug: The
+ * systems basically froze in the connect call if the passed name
+ * contained an invalid directory part.  Ignore the old Unices.  */
+# ifndef SUN_LEN
+#  define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
+                        + strlen ((ptr)->sun_path))
+# endif /*SUN_LEN*/
+#endif /*_GPGRT_NEED_AFLOCAL*/
+
+
+/*
+ * Common helper macros.
+ */
+#ifndef DIM
+# define DIM(array) (sizeof (array) / sizeof (*array))
+#endif
+
+
+\f
+/*
+ * Local error function prototypes.
+ */
 const char *_gpg_strerror (gpg_error_t err);
 int _gpg_strerror_r (gpg_error_t err, char *buf, size_t buflen);
 const char *_gpg_strsource (gpg_error_t err);
@@ -34,11 +108,31 @@ void _gpg_err_set_errno (int err);
 
 gpg_error_t _gpg_err_init (void);
 void _gpg_err_deinit (int mode);
+
+void _gpgrt_add_emergency_cleanup (void (*f)(void));
+void _gpgrt_abort (void) GPGRT_ATTR_NORETURN;
+
 void _gpgrt_set_alloc_func (void *(*f)(void *a, size_t n));
 
 void *_gpgrt_realloc (void *a, size_t n);
+void *_gpgrt_reallocarray (void *a, size_t oldnmemb, size_t nmemb, size_t size);
 void *_gpgrt_malloc (size_t n);
+void *_gpgrt_calloc (size_t n, size_t m);
+char *_gpgrt_strdup (const char *string);
+char *_gpgrt_strconcat (const char *s1, ...) GPGRT_ATTR_SENTINEL(0);
 void _gpgrt_free (void *a);
+/* The next is only to be used by visibility.c.  */
+char *_gpgrt_strconcat_core (const char *s1, va_list arg_ptr);
+
+#define xfree(a)         _gpgrt_free ((a))
+#define xtrymalloc(a)    _gpgrt_malloc ((a))
+#define xtrycalloc(a,b)  _gpgrt_calloc ((a),(b))
+#define xtryrealloc(a,b) _gpgrt_realloc ((a),(b))
+#define xtryreallocarray(a,b,c,d) _gpgrt_reallocarray ((a),(b),(c),(d))
+#define xtrystrdup(a)    _gpgrt_strdup ((a))
+
+void _gpgrt_pre_syscall (void);
+void _gpgrt_post_syscall (void);
 
 const char *_gpg_error_check_version (const char *req_version);
 
@@ -49,7 +143,11 @@ gpg_err_code_t _gpgrt_lock_unlock (gpgrt_lock_t *lockhd);
 gpg_err_code_t _gpgrt_lock_destroy (gpgrt_lock_t *lockhd);
 gpg_err_code_t _gpgrt_yield (void);
 
-/* Trace support.  */
+
+\f
+/*
+ * Tracing
+ */
 
 /* The trace macro is used this way:
  *   trace (("enter - foo=%d bar=%s", foo, bar));
@@ -104,8 +202,10 @@ void _gpgrt_internal_trace_printf (const char *format,
 void _gpgrt_internal_trace_end (void);
 
 
-
-/* Local definitions for estream.  */
+\f
+/*
+ * Local definitions for estream.
+ */
 
 #if HAVE_W32_SYSTEM
 # ifndef  O_NONBLOCK
@@ -115,15 +215,15 @@ void _gpgrt_internal_trace_end (void);
 
 /*
  * A private cookie function to implement an internal IOCTL service.
- * and ist IOCTL numbers.
  */
 typedef int (*cookie_ioctl_function_t) (void *cookie, int cmd,
                                        void *ptr, size_t *len);
 #define COOKIE_IOCTL_SNATCH_BUFFER 1
 #define COOKIE_IOCTL_NONBLOCK      2
+#define COOKIE_IOCTL_TRUNCATE      3
 
 /* An internal variant of gpgrt_cookie_close_function_t with a slot
  for the ioctl function.  */
* for the ioctl function.  */
 struct cookie_io_functions_s
 {
   struct _gpgrt_cookie_io_functions public;
@@ -157,7 +257,13 @@ typedef struct notify_list_s *notify_list_t;
  * Buffer management layer.
  */
 
-#define BUFFER_BLOCK_SIZE  BUFSIZ
+/* BUFSIZ on Windows is 512 but on current Linux it is 8k.  We better
+ * use the 8k for Windows as well.  */
+#ifdef HAVE_W32_SYSTEM
+# define BUFFER_BLOCK_SIZE  8192
+#else
+# define BUFFER_BLOCK_SIZE  BUFSIZ
+#endif
 #define BUFFER_UNREAD_SIZE 16
 
 
@@ -201,7 +307,9 @@ struct _gpgrt_stream_internal
 typedef struct _gpgrt_stream_internal *estream_internal_t;
 
 
-/* Local prototypes for estream.  */
+/*
+ * Local prototypes for estream.
+ */
 int _gpgrt_estream_init (void);
 void _gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void));
 void _gpgrt_get_syscall_clamp (void (**r_pre)(void), void (**r_post)(void));
@@ -232,6 +340,7 @@ gpgrt_stream_t _gpgrt_fopencookie (void *_GPGRT__RESTRICT cookie,
                                    const char *_GPGRT__RESTRICT mode,
                                    gpgrt_cookie_io_functions_t functions);
 int _gpgrt_fclose (gpgrt_stream_t stream);
+int _gpgrt_fcancel (gpgrt_stream_t stream);
 int _gpgrt_fclose_snatch (gpgrt_stream_t stream,
                           void **r_buffer, size_t *r_buflen);
 int _gpgrt_onclose (gpgrt_stream_t stream, int mode,
@@ -243,6 +352,14 @@ int _gpgrt_syshd_unlocked (gpgrt_stream_t stream, gpgrt_syshd_t *syshd);
 
 void _gpgrt__set_std_fd (int no, int fd);
 gpgrt_stream_t _gpgrt__get_std_stream (int fd);
+/* The es_stderr et al macros are pretty common so that we want to use
+ * them too.  This requires that we redefine them.  */
+#undef es_stdin
+#define es_stdin  _gpgrt__get_std_stream (0)
+#undef es_stdout
+#define es_stdout _gpgrt__get_std_stream (1)
+#undef es_stderr
+#define es_stderr _gpgrt__get_std_stream (2)
 
 void _gpgrt_flockfile (gpgrt_stream_t stream);
 int  _gpgrt_ftrylockfile (gpgrt_stream_t stream);
@@ -263,6 +380,7 @@ int _gpgrt_fseeko (gpgrt_stream_t stream, gpgrt_off_t offset, int whence);
 long int _gpgrt_ftell (gpgrt_stream_t stream);
 gpgrt_off_t _gpgrt_ftello (gpgrt_stream_t stream);
 void _gpgrt_rewind (gpgrt_stream_t stream);
+int  _gpgrt_ftruncate (estream_t stream, gpgrt_off_t length);
 
 int _gpgrt_fgetc (gpgrt_stream_t stream);
 int _gpgrt_fputc (int c, gpgrt_stream_t stream);
@@ -331,11 +449,13 @@ int _gpgrt_fprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream,
                              GPGRT_ATTR_PRINTF(2,3);
 
 int _gpgrt_vfprintf (gpgrt_stream_t _GPGRT__RESTRICT stream,
+                     gpgrt_string_filter_t sf, void *sfvalue,
                      const char *_GPGRT__RESTRICT format, va_list ap)
-                     GPGRT_ATTR_PRINTF(2,0);
+                     GPGRT_ATTR_PRINTF(4,0);
 int _gpgrt_vfprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream,
+                              gpgrt_string_filter_t sf, void *sfvalue,
                               const char *_GPGRT__RESTRICT format, va_list ap)
-                              GPGRT_ATTR_PRINTF(2,0);
+                              GPGRT_ATTR_PRINTF(4,0);
 
 int _gpgrt_setvbuf (gpgrt_stream_t _GPGRT__RESTRICT stream,
                     char *_GPGRT__RESTRICT buf, int mode, size_t size);
@@ -357,20 +477,369 @@ const char *_gpgrt_fname_get (gpgrt_stream_t stream);
 
 #include "estream-printf.h"
 
-#if _WIN32
-/* Prototypes for w32-estream.c.  */
-struct cookie_io_functions_s _gpgrt_functions_w32_pollable;
+/* Make sure we always use our snprintf */
+#undef snprintf
+#define snprintf _gpgrt_estream_snprintf
+
+
+#if HAVE_W32_SYSTEM
+/* Prototypes for w32-estream.c. */
+extern struct cookie_io_functions_s _gpgrt_functions_w32_pollable;
 int _gpgrt_w32_pollable_create (void *_GPGRT__RESTRICT *_GPGRT__RESTRICT cookie,
                                 unsigned int modeflags,
                                 struct cookie_io_functions_s next_functions,
                                 void *next_cookie);
 int _gpgrt_w32_poll (gpgrt_poll_t *fds, size_t nfds, int timeout);
-#endif
+#endif /*HAVE_W32_SYSTEM*/
+
+
+\f
+/*
+ * Local prototypes for the encoders.
+ */
+
+struct _gpgrt_b64state
+{
+  int idx;
+  int quad_count;
+  estream_t stream;
+  char *title;
+  unsigned char radbuf[4];
+  unsigned int crc;
+  gpg_err_code_t lasterr;
+  unsigned int flags;
+  unsigned int stop_seen:1;
+  unsigned int invalid_encoding:1;
+  unsigned int using_decoder:1;
+};
+
+gpgrt_b64state_t _gpgrt_b64enc_start (estream_t stream, const char *title);
+gpg_err_code_t   _gpgrt_b64enc_write (gpgrt_b64state_t state,
+                                      const void *buffer, size_t nbytes);
+gpg_err_code_t   _gpgrt_b64enc_finish (gpgrt_b64state_t state);
 
 gpgrt_b64state_t _gpgrt_b64dec_start (const char *title);
-gpg_error_t _gpgrt_b64dec_proc (gpgrt_b64state_t state, void *buffer,
-                                size_t length, size_t *r_nbytes);
-gpg_error_t _gpgrt_b64dec_finish (gpgrt_b64state_t state);
+gpg_err_code_t _gpgrt_b64dec_proc (gpgrt_b64state_t state, void *buffer,
+                                   size_t length, size_t *r_nbytes);
+gpg_err_code_t _gpgrt_b64dec_finish (gpgrt_b64state_t state);
+
+
+\f
+/*
+ * Local prototypes for logging
+ */
+int  _gpgrt_get_errorcount (int clear);
+void _gpgrt_inc_errorcount (void);
+void _gpgrt_log_set_sink (const char *name, estream_t stream, int fd);
+void _gpgrt_log_set_socket_dir_cb (const char *(*fnc)(void));
+void _gpgrt_log_set_pid_suffix_cb (int (*cb)(unsigned long *r_value));
+void _gpgrt_log_set_prefix (const char *text, unsigned int flags);
+const char *_gpgrt_log_get_prefix (unsigned int *flags);
+int  _gpgrt_log_test_fd (int fd);
+int  _gpgrt_log_get_fd (void);
+estream_t _gpgrt_log_get_stream (void);
+
+void _gpgrt_log (int level, const char *fmt, ...) GPGRT_ATTR_PRINTF(2,3);
+void _gpgrt_logv (int level, const char *fmt, va_list arg_ptr);
+void _gpgrt_logv_prefix (int level, const char *prefix,
+                         const char *fmt, va_list arg_ptr);
+
+void _gpgrt_log_string (int level, const char *string);
+
+void _gpgrt_log_bug (const char *fmt, ...)    GPGRT_ATTR_NR_PRINTF(1,2);
+void _gpgrt_log_fatal (const char *fmt, ...)  GPGRT_ATTR_NR_PRINTF(1,2);
+void _gpgrt_log_error (const char *fmt, ...)  GPGRT_ATTR_PRINTF(1,2);
+void _gpgrt_log_info (const char *fmt, ...)   GPGRT_ATTR_PRINTF(1,2);
+void _gpgrt_log_debug (const char *fmt, ...)  GPGRT_ATTR_PRINTF(1,2);
+void _gpgrt_log_debug_string (const char *string, const char *fmt,
+                              ...) GPGRT_ATTR_PRINTF(2,3);
+
+void _gpgrt_log_printf (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2);
+
+void _gpgrt_log_flush (void);
+
+void _gpgrt_logv_printhex (const void *buffer, size_t length,
+                           const char *fmt, va_list arg_ptr);
+void _gpgrt_log_printhex (const void *buffer, size_t length,
+                          const char *fmt, ...) GPGRT_ATTR_PRINTF(3,4);;
+
+void _gpgrt_logv_clock (const char *fmt, va_list arg_ptr);
+void _gpgrt_log_clock (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2);
+
+void _gpgrt__log_assert (const char *expr, const char *file, int line,
+                         const char *func) GPGRT_ATTR_NORETURN;
+
+/* Redefine the assert macro to use our internal function.  */
+#undef gpgrt_assert
+#ifdef GPGRT_HAVE_MACRO_FUNCTION
+#define gpgrt_assert(expr)                                      \
+  ((expr)                                                       \
+   ? (void) 0                                                   \
+   : _gpgrt__log_assert (#expr, __FILE__, __LINE__, __FUNCTION__))
+#else /*!GPGRT_HAVE_MACRO_FUNCTION*/
+/* # define BUG() bug_at( __FILE__ , __LINE__ ) */
+#define gpgrt_assert(expr)                                      \
+  ((expr)                                                       \
+   ? (void) 0                                                   \
+   : _gpgrt__log_assert (#expr, __FILE__, __LINE__, NULL))
+#endif /*!GPGRT_HAVE_MACRO_FUNCTION*/
+
+/* Note: The next function is only to be used by visibility.c.  */
+int _gpgrt_logv_internal (int level, int ignore_arg_ptr,
+                          const char *extrastring,
+                          const char *prefmt, const char *fmt,
+                          va_list arg_ptr);
+
+\f
+/*
+ * Local prototypes for the spawn functions.
+ *
+ * We put the docs here because we have separate implementations in
+ * the files spawn-posix.c and spawn-w32.c
+ */
+
+/* Return the maximum number of currently allowed file descriptors.
+ * Only useful on POSIX systems.  */
+/* int get_max_fds (void); */
+
+
+/* Close all file descriptors starting with descriptor FIRST.  If
+ * EXCEPT is not NULL, it is expected to be a list of file descriptors
+ * which are not to close.  This list shall be sorted in ascending
+ * order with its end marked by -1.  */
+/* void close_all_fds (int first, int *except); */
+
+
+/* Returns an array with all currently open file descriptors.  The end
+ * of the array is marked by -1.  The caller needs to release this
+ * array using the *standard free* and not with xfree.  This allow the
+ * use of this function right at startup even before libgcrypt has
+ * been initialized.  Returns NULL on error and sets ERRNO accordingly.  */
+/* int *get_all_open_fds (void); */
+
+/* Create a pipe.  The DIRECTION parameter gives the type of the created pipe:
+ *   DIRECTION < 0 := Inbound pipe: On Windows the write end is inheritable.
+ *   DIRECTION > 0 := Outbound pipe: On Windows the read end is inheritable.
+ * If R_FP is NULL a standard pipe and no stream is created, DIRECTION
+ * should then be 0.   */
+gpg_err_code_t _gpgrt_make_pipe (int filedes[2], estream_t *r_fp,
+                                 int direction, int nonblock);
+
+/* Convenience macros to create a pipe.  */
+#define _gpgrt_create_pipe(a)              _gpgrt_make_pipe ((a),NULL, 0,    0);
+#define _gpgrt_create_inbound_pipe(a,b,c)  _gpgrt_make_pipe ((a), (b), -1, (c));
+#define _gpgrt_create_outbound_pipe(a,b,c) _gpgrt_make_pipe ((a), (b),  1, (c));
+
+
+/* Fork and exec the program PGMNAME.
+ *
+ * If R_INFP is NULL connect stdin of the new process to /dev/null; if
+ * it is not NULL store the address of a pointer to a new estream
+ * there. If R_OUTFP is NULL connect stdout of the new process to
+ * /dev/null; if it is not NULL store the address of a pointer to a
+ * new estream there.  If R_ERRFP is NULL connect stderr of the new
+ * process to /dev/null; if it is not NULL store the address of a
+ * pointer to a new estream there.  On success the pid of the new
+ * process is stored at PID.  On error -1 is stored at PID and if
+ * R_OUTFP or R_ERRFP are not NULL, NULL is stored there.
+ *
+ * The arguments for the process are expected in the NULL terminated
+ * array ARGV.  The program name itself should not be included there.
+ * If PREEXEC is not NULL, the given function will be called right
+ * before the exec.
+ *
+ * IF EXCEPT is not NULL, it is expected to be an ordered list of file
+ * descriptors, terminated by an entry with the value (-1).  These
+ * file descriptors won't be closed before spawning a new program.
+ *
+ * Returns 0 on success or an error code.  Calling gpgrt_wait_process
+ * and gpgrt_release_process is required if the function succeeded.
+ *
+ * FLAGS is a bit vector:
+ *
+ * GPGRT_SPAWN_NONBLOCK
+ *        If set the two output streams are created in non-blocking
+ *        mode and the input stream is switched to non-blocking mode.
+ *        This is merely a convenience feature because the caller
+ *        could do the same with gpgrt_set_nonblock.  Does not yet
+ *        work for Windows.
+ *
+ * GPGRT_SPAWN_DETACHED
+ *        If set the process will be started as a background process.
+ *        This flag is only useful under W32 (but not W32CE) systems,
+ *        so that no new console is created and pops up a console
+ *        window when starting the server.  Does not work on W32CE.
+ *
+ * GPGRT_SPAWN_RUN_ASFW
+ *        On W32 (but not on W32CE) run AllowSetForegroundWindow for
+ *        the child.  Note that due to unknown problems this actually
+ *        allows SetForegroundWindow for all children of this process.
+ */
+gpg_err_code_t
+_gpgrt_spawn_process (const char *pgmname, const char *argv[],
+                      int *execpt, void (*preexec)(void), unsigned int flags,
+                      estream_t *r_infp,
+                      estream_t *r_outfp,
+                      estream_t *r_errfp,
+                      pid_t *pid);
+
+
+/* Simplified version of gpgrt_spawn_process.  This function forks and
+ * then execs PGMNAME, while connecting INFD to stdin, OUTFD to stdout
+ * and ERRFD to stderr (any of them may be -1 to connect them to
+ * /dev/null).  The arguments for the process are expected in the NULL
+ * terminated array ARGV.  The program name itself should not be
+ * included there.  Calling gpgrt_wait_process and
+ * gpgrt_release_process is required.  Returns 0 on success or an
+ * error code. */
+gpg_err_code_t _gpgrt_spawn_process_fd (const char *pgmname,
+                                        const char *argv[],
+                                        int infd, int outfd, int errfd,
+                                        pid_t *pid);
+
+/* Spawn a new process and immediately detach from it.  The name of
+ * the program to exec is PGMNAME and its arguments are in ARGV (the
+ * programname is automatically passed as first argument).
+ * Environment strings in ENVP are set.  An error is returned if
+ * pgmname is not executable; to make this work it is necessary to
+ * provide an absolute file name.  */
+gpg_err_code_t _gpgrt_spawn_process_detached (const char *pgmname,
+                                              const char *argv[],
+                                              const char *envp[] );
+
+/* If HANG is true, waits for the process identified by PID to exit;
+ * if HANG is false, checks whether the process has terminated.
+ * PGMNAME should be the same as supplied to the spawn function and is
+ * only used for diagnostics.  Return values:
+ *
+ * 0
+ *     The process exited successful.  0 is stored at R_EXITCODE.
+ *
+ * GPG_ERR_GENERAL
+ *     The process exited without success.  The exit code of process
+ *     is then stored at R_EXITCODE.  An exit code of -1 indicates
+ *     that the process terminated abnormally (e.g. due to a signal).
+ *
+ * GPG_ERR_TIMEOUT
+ *     The process is still running (returned only if HANG is false).
+ *
+ * GPG_ERR_INV_VALUE
+ *     An invalid PID has been specified.
+ *
+ * Other error codes may be returned as well.  Unless otherwise noted,
+ * -1 will be stored at R_EXITCODE.  R_EXITCODE may be passed as NULL
+ * if the exit code is not required (in that case an error message will
+ * be printed).  Note that under Windows PID is not the process id but
+ * the handle of the process.  */
+gpg_err_code_t _gpgrt_wait_process (const char *pgmname, pid_t pid, int hang,
+                                    int *r_exitcode);
+
+/* Like _gpgrt_wait_process, but for COUNT processes.  */
+gpg_err_code_t _gpgrt_wait_processes (const char **pgmnames, pid_t *pids,
+                                      size_t count, int hang, int *r_exitcodes);
+
+/* Kill a process; that is send an appropriate signal to the process.
+ * gpgrt_wait_process must be called to actually remove the process
+ * from the system.  An invalid PID is ignored.  */
+void _gpgrt_kill_process (pid_t pid);
+
+/* Release the process identified by PID.  This function is actually
+ * only required for Windows but it does not harm to always call it.
+ * It is a nop if PID is invalid.  */
+void _gpgrt_release_process (pid_t pid);
+
+
+/*
+ * Local prototypes for argparse.
+ */
+int _gpgrt_argparse (estream_t fp, gpgrt_argparse_t *arg, gpgrt_opt_t *opts);
+int _gpgrt_argparser (gpgrt_argparse_t *arg, gpgrt_opt_t *opts,
+                      const char *confname);
+void _gpgrt_usage (int level);
+const char *_gpgrt_strusage (int level);
+void _gpgrt_set_strusage (const char *(*f)(int));
+void _gpgrt_set_usage_outfnc (int (*fnc)(int, const char *));
+void _gpgrt_set_fixed_string_mapper (const char *(*f)(const char*));
+void _gpgrt_set_confdir (int what, const char *name);
+
+
+/*
+ * Various helper functions
+ */
+int _gpgrt_cmp_version (const char *a, const char *b, int level);
+
+
+\f
+/*
+ * Internal platform abstraction functions (sysutils.c)
+ */
+
+/* Return true if FD is valid.  */
+int _gpgrt_fd_valid_p (int fd);
+
+/* A getenv variant which returns a malloced copy.  */
+char *_gpgrt_getenv (const char *name);
+
+/* A setenv variant which can be used for unsetenv by setting VALUE to
+ * NULL and OVERRIDE to true.  */
+gpg_err_code_t _gpgrt_setenv (const char *name,
+                              const char *value, int overwrite);
+
+/* A wrapper around mkdir using a string for the mode (permissions).  */
+gpg_err_code_t _gpgrt_mkdir (const char *name, const char *modestr);
+
+/* A simple wrapper around chdir.  */
+gpg_err_code_t _gpgrt_chdir (const char *name);
+
+/* Return the current WD as a malloced string.  */
+char *_gpgrt_getcwd (void);
+
+/* Wrapper for Windows to allow utf8 file names.  */
+gpg_err_code_t _gpgrt_access (const char *fname, int mode);
+
+/* Return the home directory of user NAME.  */
+char *_gpgrt_getpwdir (const char *name);
+
+/* Return the account name of the current user.  */
+char *_gpgrt_getusername (void);
+
+/* Expand and concat file name parts.  */
+char *_gpgrt_vfnameconcat (int want_abs, const char *first_part,
+                           va_list arg_ptr);
+char *_gpgrt_fnameconcat (const char *first_part,
+                          ... ) GPGRT_ATTR_SENTINEL(0);
+char *_gpgrt_absfnameconcat (const char *first_part,
+                             ... ) GPGRT_ATTR_SENTINEL(0);
+
+\f
+/*
+ * Platform specific functions (Windows)
+ */
+#ifdef HAVE_W32_SYSTEM
+
+char *_gpgrt_w32_reg_query_string (const char *root,
+                                   const char *dir,
+                                   const char *name);
+char *_gpgrt_w32_reg_get_string (const char *key);
+
+
+#endif /*HAVE_W32_SYSTEM*/
+
+/*
+ * Missing functions implemented inline.
+ */
+
+#ifndef HAVE_STPCPY
+static GPG_ERR_INLINE char *
+_gpgrt_stpcpy (char *a, const char *b)
+{
+  while (*b)
+    *a++ = *b++;
+  *a = 0;
+  return a;
+}
+#define stpcpy(a,b) _gpgrt_stpcpy ((a), (b))
+#endif /*!HAVE_STPCPY*/
 
 
 #endif /*_GPGRT_GPGRT_INT_H*/
diff --git a/src/gpgrt.m4 b/src/gpgrt.m4
new file mode 100644 (file)
index 0000000..40fcd1f
--- /dev/null
@@ -0,0 +1,112 @@
+# gpgrt.m4 - autoconf macro to detect libgpgrt
+# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2017, 2018 g10 Code GmbH
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This file is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# SPDX-License-Identifier: FSFULLR
+#
+# Last-changed: 2018-11-13
+# Note: This is a kind of duplicate of gpg-error.m4 which uses the
+# future name of libgpg-error to prepare for a smooth migration in
+# some distant time.
+
+dnl AM_PATH_GPGRT([MINIMUM-VERSION,
+dnl               [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
+dnl
+dnl Test for libgpgrt and define GPGRT_CFLAGS, GPGRT_LIBS,
+dnl GPGRT_MT_CFLAGS, and GPGRT_MT_LIBS.  The _MT_ variants are
+dnl used for programs requiring real multi thread support.
+dnl
+AC_DEFUN([AM_PATH_GPGRT],
+[ AC_REQUIRE([AC_CANONICAL_HOST])
+  if test "$prefix" = NONE ; then
+    prefix_option_expanded=/usr/local
+  else
+    prefix_option_expanded="$prefix"
+  fi
+  if test "$exec_prefix" = NONE ; then
+    exec_prefix_option_expanded=$prefix_option_expanded
+  else
+    exec_prefix_option_expanded=$(prefix=$prefix_option_expanded eval echo $exec_prefix)
+  fi
+  libdir_option_expanded=$(prefix=$prefix_option_expanded exec_prefix=$exec_prefix_option_expanded eval echo $libdir)
+
+  if test -f $libdir_option_expanded/pkgconfig/gpg-error.pc; then
+    gpgrt_libdir=$libdir_option_expanded
+  else
+    if crt1_path=$(${CC:-cc} -print-file-name=crt1.o 2>/dev/null); then
+      if possible_libdir=$(cd ${crt1_path%/*} && pwd 2>/dev/null); then
+        if test -f $possible_libdir/pkgconfig/gpg-error.pc; then
+          gpgrt_libdir=$possible_libdir
+        fi
+      fi
+    fi
+  fi
+
+  if test -n "$gpgrt_libdir"; then
+    AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no)
+    if test "$GPGRT_CONFIG" != "no"; then
+      GPGRT_CONFIG="$GPGRT_CONFIG --libdir=$gpgrt_libdir"
+    fi
+  fi
+  min_gpgrt_version=ifelse([$1], ,1.33,$1)
+  AC_MSG_CHECKING(for GPG Runtime - version >= $min_gpgrt_version)
+  ok=no
+  if test x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no" ; then
+    req_major=`echo $min_gpgrt_version | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+    req_minor=`echo $min_gpgrt_version | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+    gpgrt_config_version=`$GPGRT_CONFIG --version`
+    major=`echo $gpgrt_config_version | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+    minor=`echo $gpgrt_config_version | \
+               sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+    if test "$major" -gt "$req_major"; then
+        ok=yes
+    else
+        if test "$major" -eq "$req_major"; then
+            if test "$minor" -ge "$req_minor"; then
+               ok=yes
+            fi
+        fi
+    fi
+  fi
+  if test $ok = yes; then
+    GPGRT_CFLAGS=`$GPGRT_CONFIG --cflags`
+    GPGRT_LIBS=`$GPGRT_CONFIG --libs`
+    GPGRT_MT_CFLAGS=`$GPGRT_CONFIG --variable=mtcflags 2>/dev/null`
+    GPGRT_MT_CFLAGS="$GPGRT_CFLAGS${GPGRT_CFLAGS:+ }$GPGRT_MT_CFLAGS"
+    GPGRT_MT_LIBS=`$GPGRT_CONFIG --variable=mtlibs 2>/dev/null`
+    GPGRT_MT_LIBS="$GPGRT_LIBS${GPGRT_LIBS:+ }$GPGRT_MT_LIBS"
+    AC_MSG_RESULT([yes ($gpgrt_config_version)])
+    ifelse([$2], , :, [$2])
+    gpgrt_config_host=`$GPGRT_CONFIG --variable=host 2>/dev/null || echo none`
+    if test x"$gpgrt_config_host" != xnone ; then
+      if test x"$gpgrt_config_host" != x"$host" ; then
+  AC_MSG_WARN([[
+***
+*** The config script "$GPGRT_CONFIG" is for $gpgrt_config_host
+*** and thus may not match the used host $host.
+***]])
+        gpg_config_script_warn="$gpg_config_script_warn libgpgrt"
+      fi
+    fi
+  else
+    GPGRT_CFLAGS=""
+    GPGRT_LIBS=""
+    GPGRT_MT_CFLAGS=""
+    GPGRT_MT_LIBS=""
+    AC_MSG_RESULT(no)
+    ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GPGRT_CFLAGS)
+  AC_SUBST(GPGRT_LIBS)
+  AC_SUBST(GPGRT_MT_CFLAGS)
+  AC_SUBST(GPGRT_MT_LIBS)
+])
index a1ee505..2d9f7ab 100644 (file)
@@ -61,6 +61,20 @@ static void drop_locale_dir (char *locale_dir);
 #endif /*!HAVE_W32_SYSTEM*/
 
 
+/* The list of emergency cleanup functions; see _gpgrt_abort and
+ * _gpgrt_add_emergency_cleanup.  */
+struct emergency_cleanup_item_s;
+typedef struct emergency_cleanup_item_s *emergency_cleanup_item_t;
+struct emergency_cleanup_item_s
+{
+  emergency_cleanup_item_t next;
+  void (*func) (void);
+};
+static emergency_cleanup_item_t emergency_cleanup_list;
+
+
+
+
 /* The realloc function as set by gpgrt_set_alloc_func.  */
 static void *(*custom_realloc)(void *a, size_t n);
 
@@ -106,7 +120,7 @@ _gpg_err_init (void)
       if (tls_index == TLS_OUT_OF_INDEXES)
         {
           /* No way to continue - commit suicide.  */
-          abort ();
+          _gpgrt_abort ();
         }
       _gpg_w32__init_gettext_module ();
       real_init ();
@@ -151,6 +165,67 @@ _gpg_err_deinit (int mode)
 }
 
 
+/* Add the emergency cleanup function F to the list of those function.
+ * If the a function with that address has already been registered, it
+ * is not added a second time.  These emergency functions are called
+ * whenever gpgrt_abort is called and at no other place.  Like signal
+ * handles the emergency cleanup functions shall not call any
+ * non-trivial functions and return as soon as possible.  They allow
+ * to cleanup internal states which should not go into a core dumps or
+ * similar.  This is independent of any atexit functions.  We don't
+ * use locks here because in an emergency case we can't use them
+ * anyway.  */
+void
+_gpgrt_add_emergency_cleanup (void (*f)(void))
+{
+  emergency_cleanup_item_t item;
+
+  for (item = emergency_cleanup_list; item; item = item->next)
+    if (item->func == f)
+      return; /* Function has already been registered.  */
+
+  /* We use a standard malloc here.  */
+  item = malloc (sizeof *item);
+  if (item)
+    {
+      item->func = f;
+      item->next = emergency_cleanup_list;
+      emergency_cleanup_list = item;
+    }
+  else
+    _gpgrt_log_fatal ("out of core in gpgrt_add_emergency_cleanup\n");
+}
+
+
+/* Run the emergency handlers.  No locks are used because we are anyway
+ * in an emergency state.  We also can't release any memory.  */
+static void
+run_emergency_cleanup (void)
+{
+  emergency_cleanup_item_t next;
+  void (*f)(void);
+
+  while (emergency_cleanup_list)
+    {
+      next = emergency_cleanup_list->next;
+      f = emergency_cleanup_list->func;
+      emergency_cleanup_list->func = NULL;
+      emergency_cleanup_list = next;
+      if (f)
+        f ();
+    }
+}
+
+
+/* Wrapper around abort to be able to run all emergency cleanup
+ * functions.  */
+void
+_gpgrt_abort (void)
+{
+  run_emergency_cleanup ();
+  abort ();
+}
+
 
 
 /* Register F as allocation function.  This function is used for all
@@ -184,6 +259,55 @@ _gpgrt_realloc (void *a, size_t n)
 }
 
 
+/* This is safe version of realloc useful for reallocing a calloced
+ * array.  There are two ways to call it:  The first example
+ * reallocates the array A to N elements each of SIZE but does not
+ * clear the newly allocated elements:
+ *
+ *  p = gpgrt_reallocarray (a, n, n, nsize);
+ *
+ * Note that when NOLD is larger than N no cleaning is needed anyway.
+ * The second example reallocates an array of size NOLD to N elements
+ * each of SIZE but clear the newly allocated elements:
+ *
+ *  p = gpgrt_reallocarray (a, nold, n, nsize);
+ *
+ * Note that gpgrt_reallocarray (NULL, 0, n, nsize) is equivalent to
+ * _gpgrt_calloc (n, nsize).
+ *
+ */
+void *
+_gpgrt_reallocarray (void *a, size_t oldnmemb, size_t nmemb, size_t size)
+{
+  size_t oldbytes, bytes;
+  char *p;
+
+  bytes = nmemb * size; /* size_t is unsigned so the behavior on overflow
+                         * is defined. */
+  if (size && bytes / size != nmemb)
+    {
+      _gpg_err_set_errno (ENOMEM);
+      return NULL;
+    }
+
+  p = _gpgrt_realloc (a, bytes);
+  if (p && oldnmemb < nmemb)
+    {
+      /* OLDNMEMBS is lower than NMEMB thus the user asked for a
+         calloc.  Clear all newly allocated members.  */
+      oldbytes = oldnmemb * size;
+      if (size && oldbytes / size != oldnmemb)
+        {
+          xfree (p);
+          _gpg_err_set_errno (ENOMEM);
+          return NULL;
+        }
+      memset (p + oldbytes, 0, bytes - oldbytes);
+    }
+  return p;
+}
+
+
 /* The malloc to be used for data returned by the public API.  */
 void *
 _gpgrt_malloc (size_t n)
@@ -194,11 +318,108 @@ _gpgrt_malloc (size_t n)
 }
 
 
+void *
+_gpgrt_calloc (size_t n, size_t m)
+{
+  size_t bytes;
+  void *p;
+
+  bytes = n * m; /* size_t is unsigned so the behavior on overflow is
+                    defined. */
+  if (m && bytes / m != n)
+    {
+      _gpg_err_set_errno (ENOMEM);
+      return NULL;
+    }
+
+  p = _gpgrt_realloc (NULL, bytes);
+  if (p)
+    memset (p, 0, bytes);
+  return p;
+}
+
+
+char *
+_gpgrt_strdup (const char *string)
+{
+  size_t len = strlen (string);
+  char *p;
+
+  p = _gpgrt_realloc (NULL, len + 1);
+  if (p)
+    strcpy (p, string);
+  return p;
+}
+
+
+/* Helper for _gpgrt_strconcat and gpgrt_strconcat.  */
+char *
+_gpgrt_strconcat_core (const char *s1, va_list arg_ptr)
+{
+  const char *argv[48];
+  size_t argc;
+  size_t needed;
+  char *buffer, *p;
+
+  argc = 0;
+  argv[argc++] = s1;
+  needed = strlen (s1);
+  while (((argv[argc] = va_arg (arg_ptr, const char *))))
+    {
+      needed += strlen (argv[argc]);
+      if (argc >= DIM (argv)-1)
+        {
+          _gpg_err_set_errno (EINVAL);
+          return NULL;
+        }
+      argc++;
+    }
+  needed++;
+  buffer = _gpgrt_malloc (needed);
+  if (buffer)
+    {
+      for (p = buffer, argc=0; argv[argc]; argc++)
+        p = stpcpy (p, argv[argc]);
+    }
+  return buffer;
+}
+
+
+char *
+_gpgrt_strconcat (const char *s1, ...)
+{
+  va_list arg_ptr;
+  char *result;
+
+  if (!s1)
+    result = _gpgrt_strdup ("");
+  else
+    {
+      va_start (arg_ptr, s1);
+      result = _gpgrt_strconcat_core (s1, arg_ptr);
+      va_end (arg_ptr);
+    }
+  return result;
+}
+
+
 /* The free to be used for data returned by the public API.  */
 void
 _gpgrt_free (void *a)
 {
+  int save_errno;
+
+  if (!a)
+    return;  /* Shortcut */
+
+  /* In case ERRNO is set we better save it so that the free machinery
+   * may not accidentally change ERRNO.  We restore it only if it was
+   * already set to comply with the usual C semantic for ERRNO.
+   * See also https://dev.gnupg.org/T5393#146261  */
+  save_errno = errno;
   _gpgrt_realloc (a, 0);
+  if (save_errno && save_errno != errno)
+    _gpg_err_set_errno (save_errno);
 }
 
 
@@ -214,8 +435,12 @@ _gpg_err_set_errno (int err)
 
 
 \f
-/* Internal tracing functions.  Except for TARCE_FP we use flockfile
- * and funlockfile to protect their use. */
+/* Internal tracing functions.  Except for TRACE_FP we use flockfile
+ * and funlockfile to protect their use.
+ *
+ * Warning: Take care with the trace functions - they may not use any
+ * of our services, in particular not the syscall clamp mechanism for
+ * reasons explained in w32-stream.c:create_reader.  */
 static FILE *trace_fp;
 static int trace_save_errno;
 static int trace_with_errno;
@@ -414,7 +639,7 @@ get_tls (void)
       if (!tls)
         {
           /* No way to continue - commit suicide.  */
-          abort ();
+          _gpgrt_abort ();
         }
       tls->gt_use_utf8 = 0;
       TlsSetValue (tls_index, tls);
@@ -491,7 +716,7 @@ DllMain (HINSTANCE hinst, DWORD reason, LPVOID reserved)
       /* If we have not constructors (e.g. MSC) we call it here.  */
       _gpg_w32__init_gettext_module ();
 #endif
-      /* falltru.  */
+      /* fallthru.  */
     case DLL_THREAD_ATTACH:
       tls = LocalAlloc (LPTR, sizeof *tls);
       if (!tls)
index b7395db..a830b36 100644 (file)
@@ -20,7 +20,5 @@
 #ifndef LOCK_H
 #define LOCK_H
 
-void _gpgrt_lock_set_lock_clamp (void (*pre)(void), void (*post)(void));
-
 
 #endif /*LOCK_H*/
diff --git a/src/logging.c b/src/logging.c
new file mode 100644 (file)
index 0000000..e4b7e40
--- /dev/null
@@ -0,0 +1,1341 @@
+/* logging.c - Useful logging functions
+ * Copyright (C) 1998-2001, 2003-2006, 2009-2010,
+ *               2017  Free Software Foundation, Inc.
+ * Copyright (C) 1998-1999, 2001-2006, 2008-2017  Werner Koch
+ *
+ * This file is part of Libgpg-error.
+ *
+ * Libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * Libgpg-error 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1+
+ *
+ * This file was originally a part of GnuPG.
+ */
+
+#include <config.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <errno.h>
+#include <time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef HAVE_W32_SYSTEM
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
+# include <windows.h>
+#else /*!HAVE_W32_SYSTEM*/
+# include <sys/socket.h>
+# include <sys/un.h>
+# include <netinet/in.h>
+# include <arpa/inet.h>
+#endif /*!HAVE_W32_SYSTEM*/
+#include <unistd.h>
+#include <fcntl.h>
+/* #include <execinfo.h> */
+
+#define _GPGRT_NEED_AFLOCAL 1
+#include "gpgrt-int.h"
+
+
+#ifdef HAVE_W32_SYSTEM
+# ifndef S_IRWXG
+#  define S_IRGRP S_IRUSR
+#  define S_IWGRP S_IWUSR
+# endif
+# ifndef S_IRWXO
+#  define S_IROTH S_IRUSR
+#  define S_IWOTH S_IWUSR
+# endif
+#endif
+
+
+#ifdef HAVE_W32CE_SYSTEM
+# define isatty(a)  (0)
+#endif
+
+#undef WITH_IPV6
+#if defined (AF_INET6) && defined(PF_INET) \
+    && defined (INET6_ADDRSTRLEN) && defined(HAVE_INET_PTON)
+# define WITH_IPV6 1
+#endif
+
+#ifndef EAFNOSUPPORT
+# define EAFNOSUPPORT EINVAL
+#endif
+#ifndef INADDR_NONE  /* Slowaris is missing that.  */
+#define INADDR_NONE  ((unsigned long)(-1))
+#endif /*INADDR_NONE*/
+
+#ifdef HAVE_W32_SYSTEM
+#define sock_close(a)  closesocket(a)
+#else
+#define sock_close(a)  close(a)
+#endif
+
+
+static estream_t logstream;
+static int log_socket = -1;
+static char prefix_buffer[80];
+static int with_time;
+static int with_prefix;
+static int with_pid;
+#ifdef HAVE_W32_SYSTEM
+static int no_registry;
+#endif
+static int (*get_pid_suffix_cb)(unsigned long *r_value);
+static const char * (*socket_dir_cb)(void);
+static int running_detached;
+static int force_prefixes;
+
+static int missing_lf;
+static int errorcount;
+
+
+/* An object to convey data to the fmt_string_filter.  */
+struct fmt_string_filter_s
+{
+  char *last_result;
+};
+
+
+
+/* Get the error count as maintained by the log fucntions.  With CLEAR
+ * set reset the counter.  */
+int
+_gpgrt_get_errorcount (int clear)
+{
+  int n = errorcount;
+  if (clear)
+    errorcount = 0;
+  return n;
+}
+
+
+/* Increment the error count as maintained by the log functions.  */
+void
+_gpgrt_inc_errorcount (void)
+{
+  /* Protect against counter overflow.  */
+  if (errorcount < 30000)
+    errorcount++;
+}
+
+
+/* The following 3 functions are used by _gpgrt_fopencookie to write logs
+   to a socket.  */
+struct fun_cookie_s
+{
+  int fd;
+  int quiet;
+  int want_socket;
+  int is_socket;
+#ifdef HAVE_W32CE_SYSTEM
+  int use_writefile;
+#endif
+  char name[1];
+};
+
+
+/* Write NBYTES of BUFFER to file descriptor FD. */
+static int
+writen (int fd, const void *buffer, size_t nbytes, int is_socket)
+{
+  const char *buf = buffer;
+  size_t nleft = nbytes;
+  int nwritten;
+#ifndef HAVE_W32_SYSTEM
+  (void)is_socket; /* Not required.  */
+#endif
+
+  while (nleft > 0)
+    {
+#ifdef HAVE_W32_SYSTEM
+      if (is_socket)
+        nwritten = send (fd, buf, nleft, 0);
+      else
+#endif
+        nwritten = write (fd, buf, nleft);
+
+      if (nwritten < 0 && errno == EINTR)
+        continue;
+      if (nwritten < 0)
+        return -1;
+      nleft -= nwritten;
+      buf = buf + nwritten;
+    }
+
+  return 0;
+}
+
+
+/* Returns true if STR represents a valid port number in decimal
+   notation and no garbage is following.  */
+static int
+parse_portno (const char *str, unsigned short *r_port)
+{
+  unsigned int value;
+
+  for (value=0; *str && (*str >= '0' && *str <= '9'); str++)
+    {
+      value = value * 10 + (*str - '0');
+      if (value > 65535)
+        return 0;
+    }
+  if (*str || !value)
+    return 0;
+
+  *r_port = value;
+  return 1;
+}
+
+
+static gpgrt_ssize_t
+fun_writer (void *cookie_arg, const void *buffer, size_t size)
+{
+  struct fun_cookie_s *cookie = cookie_arg;
+
+  /* FIXME: Use only estream with a callback for socket writing.  This
+     avoids the ugly mix of fd and estream code.  */
+
+  /* Note that we always try to reconnect to the socket but print
+     error messages only the first time an error occurred.  If
+     RUNNING_DETACHED is set we don't fall back to stderr and even do
+     not print any error messages.  This is needed because detached
+     processes often close stderr and by writing to file descriptor 2
+     we might send the log message to a file not intended for logging
+     (e.g. a pipe or network connection). */
+  if (cookie->want_socket && cookie->fd == -1)
+    {
+#ifdef WITH_IPV6
+      struct sockaddr_in6 srvr_addr_in6;
+#endif
+      struct sockaddr_in srvr_addr_in;
+#ifndef HAVE_W32_SYSTEM
+      struct sockaddr_un srvr_addr_un;
+#endif
+      const char *name_for_err = "";
+      size_t addrlen;
+      struct sockaddr *srvr_addr = NULL;
+      unsigned short port = 0;
+      int af = AF_LOCAL;
+      int pf = PF_LOCAL;
+      const char *name = cookie->name;
+
+      /* Not yet open or meanwhile closed due to an error. */
+      cookie->is_socket = 0;
+
+      /* Check whether this is a TCP socket or a local socket.  */
+      if (!strncmp (name, "tcp://", 6) && name[6])
+        {
+          name += 6;
+          af = AF_INET;
+          pf = PF_INET;
+        }
+#ifndef HAVE_W32_SYSTEM
+      else if (!strncmp (name, "socket://", 9))
+        name += 9;
+#endif
+
+      if (af == AF_LOCAL)
+        {
+          addrlen = 0;
+#ifndef HAVE_W32_SYSTEM
+          memset (&srvr_addr, 0, sizeof srvr_addr);
+          srvr_addr_un.sun_family = af;
+          if (!*name)
+            {
+              if ((name = socket_dir_cb ()) && *name
+                  && strlen (name) + 7 < sizeof (srvr_addr_un.sun_path)-1)
+                {
+                  strncpy (srvr_addr_un.sun_path,
+                           name, sizeof (srvr_addr_un.sun_path)-1);
+                  strcat (srvr_addr_un.sun_path, "/S.log");
+                  srvr_addr_un.sun_path[sizeof (srvr_addr_un.sun_path)-1] = 0;
+                  srvr_addr = (struct sockaddr *)&srvr_addr_un;
+                  addrlen = SUN_LEN (&srvr_addr_un);
+                  name_for_err = srvr_addr_un.sun_path;
+                }
+            }
+          else
+            {
+              if (strlen (name) < sizeof (srvr_addr_un.sun_path)-1)
+                {
+                  strncpy (srvr_addr_un.sun_path,
+                           name, sizeof (srvr_addr_un.sun_path)-1);
+                  srvr_addr_un.sun_path[sizeof (srvr_addr_un.sun_path)-1] = 0;
+                  srvr_addr = (struct sockaddr *)&srvr_addr_un;
+                  addrlen = SUN_LEN (&srvr_addr_un);
+                }
+            }
+#endif /*!HAVE_W32SYSTEM*/
+        }
+      else
+        {
+          char *addrstr, *p;
+#ifdef HAVE_INET_PTON
+          void *addrbuf = NULL;
+#endif /*HAVE_INET_PTON*/
+
+          addrstr = _gpgrt_malloc (strlen (name) + 1);
+          if (!addrstr)
+            addrlen = 0; /* This indicates an error.  */
+          else if (*name == '[')
+            {
+              /* Check for IPv6 literal address.  */
+              strcpy (addrstr, name+1);
+              p = strchr (addrstr, ']');
+              if (!p || p[1] != ':' || !parse_portno (p+2, &port))
+                {
+                  _gpg_err_set_errno (EINVAL);
+                  addrlen = 0;
+                }
+              else
+                {
+                  *p = 0;
+#ifdef WITH_IPV6
+                  af = AF_INET6;
+                  pf = PF_INET6;
+                  memset (&srvr_addr_in6, 0, sizeof srvr_addr_in6);
+                  srvr_addr_in6.sin6_family = af;
+                  srvr_addr_in6.sin6_port = htons (port);
+#ifdef HAVE_INET_PTON
+                  addrbuf = &srvr_addr_in6.sin6_addr;
+#endif /*HAVE_INET_PTON*/
+                  srvr_addr = (struct sockaddr *)&srvr_addr_in6;
+                  addrlen = sizeof srvr_addr_in6;
+#else
+                  _gpg_err_set_errno (EAFNOSUPPORT);
+                  addrlen = 0;
+#endif
+                }
+            }
+          else
+            {
+              /* Check for IPv4 literal address.  */
+              strcpy (addrstr, name);
+              p = strchr (addrstr, ':');
+              if (!p || !parse_portno (p+1, &port))
+                {
+                  _gpg_err_set_errno (EINVAL);
+                  addrlen = 0;
+                }
+              else
+                {
+                  *p = 0;
+                  memset (&srvr_addr_in, 0, sizeof srvr_addr_in);
+                  srvr_addr_in.sin_family = af;
+                  srvr_addr_in.sin_port = htons (port);
+#ifdef HAVE_INET_PTON
+                  addrbuf = &srvr_addr_in.sin_addr;
+#endif /*HAVE_INET_PTON*/
+                  srvr_addr = (struct sockaddr *)&srvr_addr_in;
+                  addrlen = sizeof srvr_addr_in;
+                }
+            }
+
+          if (addrlen)
+            {
+#ifdef HAVE_INET_PTON
+              if (inet_pton (af, addrstr, addrbuf) != 1)
+                addrlen = 0;
+#else /*!HAVE_INET_PTON*/
+              /* We need to use the old function.  If we are here v6
+                 support isn't enabled anyway and thus we can do fine
+                 without.  Note that Windows has a compatible inet_pton
+                 function named inetPton, but only since Vista.  */
+              srvr_addr_in.sin_addr.s_addr = inet_addr (addrstr);
+              if (srvr_addr_in.sin_addr.s_addr == INADDR_NONE)
+                addrlen = 0;
+#endif /*!HAVE_INET_PTON*/
+            }
+
+          _gpgrt_free (addrstr);
+        }
+
+      cookie->fd = addrlen? socket (pf, SOCK_STREAM, 0) : -1;
+      if (cookie->fd == -1)
+        {
+          if (!cookie->quiet && !running_detached
+              && isatty (_gpgrt_fileno (es_stderr)))
+            _gpgrt_fprintf (es_stderr,
+                            "failed to create socket for logging: %s\n",
+                            strerror (errno));
+        }
+      else
+        {
+          if (connect (cookie->fd, srvr_addr, addrlen) == -1)
+            {
+              if (!cookie->quiet && !running_detached
+                  && isatty (_gpgrt_fileno (es_stderr)))
+                _gpgrt_fprintf (es_stderr, "can't connect to '%s%s': %s\n",
+                                cookie->name, name_for_err, strerror(errno));
+              sock_close (cookie->fd);
+              cookie->fd = -1;
+            }
+        }
+
+      if (cookie->fd == -1)
+        {
+          if (!running_detached)
+            {
+              /* Due to all the problems with apps not running
+                 detached but being called with stderr closed or used
+                 for a different purposes, it does not make sense to
+                 switch to stderr.  We therefore disable it. */
+              if (!cookie->quiet)
+                {
+                  /* fputs ("switching logging to stderr\n", stderr);*/
+                  cookie->quiet = 1;
+                }
+              cookie->fd = -1; /*fileno (stderr);*/
+            }
+        }
+      else /* Connection has been established. */
+        {
+          cookie->quiet = 0;
+          cookie->is_socket = 1;
+        }
+    }
+
+  log_socket = cookie->fd;
+  if (cookie->fd != -1)
+    {
+#ifdef HAVE_W32CE_SYSTEM
+      if (cookie->use_writefile)
+        {
+          DWORD nwritten;
+
+          WriteFile ((HANDLE)cookie->fd, buffer, size, &nwritten, NULL);
+          return (gpgrt_ssize_t)size; /* Okay.  */
+        }
+#endif
+      if (!writen (cookie->fd, buffer, size, cookie->is_socket))
+        return (gpgrt_ssize_t)size; /* Okay. */
+    }
+
+  if (!running_detached && cookie->fd != -1
+      && isatty (_gpgrt_fileno (es_stderr)))
+    {
+      if (*cookie->name)
+        _gpgrt_fprintf (es_stderr, "error writing to '%s': %s\n",
+                        cookie->name, strerror(errno));
+      else
+        _gpgrt_fprintf (es_stderr, "error writing to file descriptor %d: %s\n",
+                        cookie->fd, strerror(errno));
+    }
+  if (cookie->is_socket && cookie->fd != -1)
+    {
+      sock_close (cookie->fd);
+      cookie->fd = -1;
+      log_socket = -1;
+    }
+
+  return (gpgrt_ssize_t)size;
+}
+
+
+static int
+fun_closer (void *cookie_arg)
+{
+  struct fun_cookie_s *cookie = cookie_arg;
+
+  if (cookie->fd != -1 && cookie->fd != 2)
+    sock_close (cookie->fd);
+  _gpgrt_free (cookie);
+  log_socket = -1;
+  return 0;
+}
+
+
+/* Common function to either set the logging to a file or a file
+   descriptor. */
+static void
+set_file_fd (const char *name, int fd, estream_t stream)
+{
+  estream_t fp;
+  int want_socket = 0;
+#ifdef HAVE_W32CE_SYSTEM
+  int use_writefile = 0;
+#endif
+  struct fun_cookie_s *cookie;
+
+  /* Close an open log stream.  */
+  if (logstream)
+    {
+      if (logstream != es_stderr)
+        _gpgrt_fclose (logstream);
+      logstream = NULL;
+    }
+
+  if (stream)
+    {
+      /* We don't use a cookie to log directly to a stream.  */
+      fp = stream;
+      goto leave;
+    }
+
+  /* Figure out what kind of logging we want.  */
+  if (name && !strcmp (name, "-"))
+    {
+      name = NULL;
+      fd = _gpgrt_fileno (es_stderr);
+    }
+
+  if (name && !strncmp (name, "tcp://", 6) && name[6])
+    want_socket = 1;
+#ifndef HAVE_W32_SYSTEM
+  else if (name && !strncmp (name, "socket://", 9))
+    want_socket = 2;
+#endif /*HAVE_W32_SYSTEM*/
+#ifdef HAVE_W32CE_SYSTEM
+  else if (name && !strcmp (name, "GPG2:"))
+    {
+      HANDLE hd;
+
+      ActivateDevice (L"Drivers\\"GNUPG_NAME"_Log", 0);
+      /* Ignore a filename and write the debug output to the GPG2:
+         device.  */
+      hd = CreateFile (L"GPG2:", GENERIC_WRITE,
+                       FILE_SHARE_READ | FILE_SHARE_WRITE,
+                       NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+      fd = (hd == INVALID_HANDLE_VALUE)? -1 : (int)hd;
+      name = NULL;
+      force_prefixes = 1;
+      use_writefile = 1;
+    }
+#endif /*HAVE_W32CE_SYSTEM*/
+
+  /* Setup a new stream.  */
+
+  cookie = _gpgrt_malloc (sizeof *cookie + (name? strlen (name):0));
+  if (!cookie)
+    return; /* oops */
+  strcpy (cookie->name, name? name:"");
+  cookie->quiet = 0;
+  cookie->is_socket = 0;
+  cookie->want_socket = want_socket;
+#ifdef HAVE_W32CE_SYSTEM
+  cookie->use_writefile = use_writefile;
+#endif
+  if (!name)
+    cookie->fd = fd;
+  else if (want_socket)
+    cookie->fd = -1;
+  else
+    {
+      do
+        cookie->fd = open (name, O_WRONLY|O_APPEND|O_CREAT,
+                           (S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR|S_IWGRP|S_IWOTH));
+      while (cookie->fd == -1 && errno == EINTR);
+    }
+  log_socket = cookie->fd;
+
+  {
+    es_cookie_io_functions_t io = { NULL };
+    io.func_write = fun_writer;
+    io.func_close = fun_closer;
+
+    fp = _gpgrt_fopencookie (cookie, "w", io);
+  }
+
+  /* On error default to a stderr based estream.  */
+  if (!fp)
+    fp = es_stderr;
+
+ leave:
+  _gpgrt_setvbuf (fp, NULL, _IOLBF, 0);
+
+  logstream = fp;
+
+  /* We always need to print the prefix and the pid for socket mode,
+     so that the server reading the socket can do something
+     meaningful. */
+  force_prefixes = want_socket;
+
+  missing_lf = 0;
+}
+
+
+/* Set the file to write log to.  The special names NULL and "-" may
+ * be used to select stderr and names formatted like
+ * "socket:///home/foo/mylogs" may be used to write the logging to the
+ * socket "/home/foo/mylogs".  If the connection to the socket fails
+ * or a write error is detected, the function writes to stderr and
+ * tries the next time again to connect the socket.  Calling this
+ * function with (NULL, NULL, -1) sets the default sink.
+ * Warning: This function is not thread-safe.
+ */
+void
+_gpgrt_log_set_sink (const char *name, estream_t stream, int fd)
+{
+  if (name && !stream && fd == -1)
+    set_file_fd (name, -1, NULL);
+  else if (!name && !stream && fd != -1)
+    {
+      if (!_gpgrt_fd_valid_p (fd))
+        _gpgrt_log_fatal ("gpgrt_log_set_sink: fd is invalid: %s\n",
+                     strerror (errno));
+      set_file_fd (NULL, fd, NULL);
+    }
+  else if (!name && stream && fd == -1)
+    {
+      set_file_fd (NULL, -1, stream);
+    }
+  else /* default */
+    set_file_fd ("-", -1, NULL);
+}
+
+
+/* Set a function to retrieve the directory name of a socket if
+ * only "socket://" has been given to log_set_file.
+ * Warning: This function is not thread-safe.  */
+void
+_gpgrt_log_set_socket_dir_cb (const char *(*fnc)(void))
+{
+  socket_dir_cb = fnc;
+}
+
+
+/* Warning: This function is not thread-safe.  */
+void
+_gpgrt_log_set_pid_suffix_cb (int (*cb)(unsigned long *r_value))
+{
+  get_pid_suffix_cb = cb;
+}
+
+
+/* Warning: Changing TEXT is not thread-safe.  Changing only flags
+ * might be thread-safe.  */
+void
+_gpgrt_log_set_prefix (const char *text, unsigned int flags)
+{
+  if (text)
+    {
+      strncpy (prefix_buffer, text, sizeof (prefix_buffer)-1);
+      prefix_buffer[sizeof (prefix_buffer)-1] = 0;
+    }
+
+  with_prefix = (flags & GPGRT_LOG_WITH_PREFIX);
+  with_time = (flags & GPGRT_LOG_WITH_TIME);
+  with_pid  = (flags & GPGRT_LOG_WITH_PID);
+  running_detached = (flags & GPGRT_LOG_RUN_DETACHED);
+#ifdef HAVE_W32_SYSTEM
+  no_registry = (flags & GPGRT_LOG_NO_REGISTRY);
+#endif
+}
+
+
+const char *
+_gpgrt_log_get_prefix (unsigned int *flags)
+{
+  if (flags)
+    {
+      *flags = 0;
+      if (with_prefix)
+        *flags |= GPGRT_LOG_WITH_PREFIX;
+      if (with_time)
+        *flags |= GPGRT_LOG_WITH_TIME;
+      if (with_pid)
+        *flags |= GPGRT_LOG_WITH_PID;
+      if (running_detached)
+        *flags |= GPGRT_LOG_RUN_DETACHED;
+#ifdef HAVE_W32_SYSTEM
+      if (no_registry)
+        *flags |= GPGRT_LOG_NO_REGISTRY;
+#endif
+    }
+  return prefix_buffer;
+}
+
+/* This function returns true if the file descriptor FD is in use for
+ * logging.  This is preferable over a test using log_get_fd in that
+ * it allows the logging code to use more then one file descriptor.  */
+int
+_gpgrt_log_test_fd (int fd)
+{
+  if (logstream)
+    {
+      int tmp = _gpgrt_fileno (logstream);
+      if ( tmp != -1 && tmp == fd)
+        return 1;
+    }
+  if (log_socket != -1 && log_socket == fd)
+    return 1;
+  return 0;
+}
+
+int
+_gpgrt_log_get_fd ()
+{
+  return logstream? _gpgrt_fileno (logstream) : -1;
+}
+
+estream_t
+_gpgrt_log_get_stream ()
+{
+  if (!logstream)
+    {
+      /* Make sure a log stream has been set.  */
+      _gpgrt_log_set_sink (NULL, NULL, -1);
+      if (!logstream)
+        {
+          fputs ("gpgrt fatal: failed to init log stream\n", stderr);
+          _gpgrt_abort ();
+        }
+    }
+  return logstream;
+}
+
+
+/* A filter used with the fprintf_sf function to sanitize the args for
+ * "%s" format specifiers.  */
+static char *
+fmt_string_filter (const char *string, int no, void *opaque)
+{
+  struct fmt_string_filter_s *state = opaque;
+  const unsigned char *p;
+  size_t buflen;
+  char *d;
+  int any;
+
+  if (no == -1)
+    {
+      /* The printf engine asked us to release resources.  */
+      if (state->last_result)
+        {
+          _gpgrt_free (state->last_result);
+          state->last_result = NULL;
+        }
+      return NULL;
+    }
+
+  if (!string)
+    return NULL; /* Nothing to filter - printf handles NULL nicely.  */
+
+  /* Check whether escaping is needed and count needed length. */
+  any = 0;
+  buflen = 1;
+  for (p = (const unsigned char *)string; *p; p++)
+    {
+      switch (*p)
+        {
+        case '\n':
+        case '\r':
+        case '\f':
+        case '\v':
+        case '\b':
+        case '\t':
+        case '\a':
+        case '\\':
+          buflen += 2;
+          any = 1;
+          break;
+        default:
+          if (*p < 0x20 || *p == 0x7f)
+            {
+              buflen += 5;
+              any = 1;
+            }
+          else
+            buflen++;
+        }
+    }
+  if (!any)
+    return (char*)string;  /* Nothing to escape.  */
+
+  /* Create a buffer and escape the input.  */
+  _gpgrt_free (state->last_result);
+  state->last_result = _gpgrt_malloc (buflen);
+  if (!state->last_result)
+    return "[out_of_core_in_format_string_filter]";
+
+  d = state->last_result;
+  for (p = (const unsigned char *)string; *p; p++)
+    {
+      switch (*p)
+        {
+        case '\n': *d++ = '\\'; *d++ = 'n'; break;
+        case '\r': *d++ = '\\'; *d++ = 'r'; break;
+        case '\f': *d++ = '\\'; *d++ = 'f'; break;
+        case '\v': *d++ = '\\'; *d++ = 'v'; break;
+        case '\b': *d++ = '\\'; *d++ = 'b'; break;
+        case '\t': *d++ = '\\'; *d++ = 't'; break;
+        case '\a': *d++ = '\\'; *d++ = 'a'; break;
+        case '\\': *d++ = '\\'; *d++ = '\\'; break;
+
+        default:
+          if (*p < 0x20 || *p == 0x7f)
+            {
+              snprintf (d, 5, "\\x%02x", *p);
+              d += 4;
+            }
+          else
+            *d++ = *p;
+        }
+    }
+  *d = 0;
+  return state->last_result;
+}
+
+
+/* Note: LOGSTREAM is expected to be locked.  */
+static int
+print_prefix (int level, int leading_backspace)
+{
+  int rc;
+  int length = 0;
+
+  if (level != GPGRT_LOGLVL_CONT)
+    { /* Note this does not work for multiple line logging as we would
+       * need to print to a buffer first */
+      if (with_time && !force_prefixes)
+        {
+          struct tm *tp;
+          time_t atime = time (NULL);
+
+          tp = localtime (&atime);
+          rc = _gpgrt_fprintf_unlocked (logstream,
+                                        "%04d-%02d-%02d %02d:%02d:%02d ",
+                               1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday,
+                               tp->tm_hour, tp->tm_min, tp->tm_sec );
+          if (rc > 0)
+            length += rc;
+        }
+      if (with_prefix || force_prefixes)
+        {
+          _gpgrt_fputs_unlocked (prefix_buffer, logstream);
+          length += strlen (prefix_buffer);
+        }
+      if (with_pid || force_prefixes)
+        {
+          unsigned long pidsuf;
+          int pidfmt;
+
+          if (get_pid_suffix_cb && (pidfmt=get_pid_suffix_cb (&pidsuf)))
+            rc = _gpgrt_fprintf_unlocked (logstream,
+                                          pidfmt == 1? "[%u.%lu]":"[%u.%lx]",
+                                          (unsigned int)getpid (), pidsuf);
+          else
+            rc = _gpgrt_fprintf_unlocked (logstream, "[%u]",
+                                          (unsigned int)getpid ());
+          if (rc > 0)
+            length += rc;
+        }
+      if ((!with_time && (with_prefix || with_pid)) || force_prefixes)
+        {
+          _gpgrt_putc_unlocked (':', logstream);
+          length++;
+        }
+      /* A leading backspace suppresses the extra space so that we can
+         correctly output, programname, filename and linenumber. */
+      if (!leading_backspace
+          && (with_time || with_prefix || with_pid || force_prefixes))
+        {
+          _gpgrt_putc_unlocked (' ', logstream);
+          length++;
+        }
+    }
+
+  switch (level)
+    {
+    case GPGRT_LOGLVL_BEGIN: break;
+    case GPGRT_LOGLVL_CONT: break;
+    case GPGRT_LOGLVL_INFO: break;
+    case GPGRT_LOGLVL_WARN: break;
+    case GPGRT_LOGLVL_ERROR: break;
+    case GPGRT_LOGLVL_FATAL:
+      _gpgrt_fputs_unlocked ("Fatal: ", logstream);
+      length += 7;
+      break;
+    case GPGRT_LOGLVL_BUG:
+      _gpgrt_fputs_unlocked ("Ohhhh jeeee: ", logstream);
+      length += 13;
+      break;
+    case GPGRT_LOGLVL_DEBUG:
+      _gpgrt_fputs_unlocked ("DBG: ", logstream);
+      length += 5;
+      break;
+    default:
+      rc = _gpgrt_fprintf_unlocked (logstream,
+                                    "[Unknown log level %d]: ", level);
+      if (rc > 0)
+        length += rc;
+      break;
+    }
+
+  return length;
+}
+
+
+/* Internal worker function.  Exported so that we can use it in
+ * visibility.c.  Returs the number of characters printed or 0 if the
+ * line ends in a LF. */
+int
+_gpgrt_logv_internal (int level, int ignore_arg_ptr, const char *extrastring,
+                      const char *prefmt, const char *fmt, va_list arg_ptr)
+{
+  int leading_backspace = (fmt && *fmt == '\b');
+  int length;
+  int rc;
+
+  if (!logstream)
+    {
+#ifdef HAVE_W32_SYSTEM
+      char *tmp;
+
+      tmp = (no_registry
+             ? NULL
+             : _gpgrt_w32_reg_query_string (NULL, "Software\\\\GNU\\\\GnuPG",
+                                            "DefaultLogFile"));
+      _gpgrt_log_set_sink (tmp && *tmp? tmp : NULL, NULL, -1);
+      _gpgrt_free (tmp);
+#else
+      /* Make sure a log stream has been set.  */
+      _gpgrt_log_set_sink (NULL, NULL, -1);
+#endif
+      if (!logstream)
+        {
+          fputs ("gpgrt fatal: failed to init log stream\n", stderr);
+          _gpgrt_abort ();
+        }
+    }
+
+  _gpgrt_flockfile (logstream);
+  if (missing_lf && level != GPGRT_LOGLVL_CONT)
+    _gpgrt_putc_unlocked ('\n', logstream );
+  missing_lf = 0;
+
+  length = print_prefix (level, leading_backspace);
+  if (leading_backspace)
+    fmt++;
+
+  if (fmt)
+    {
+      if (prefmt)
+        {
+          _gpgrt_fputs_unlocked (prefmt, logstream);
+          length += strlen (prefmt);
+        }
+
+      if (ignore_arg_ptr)
+        { /* This is used by log_string and comes with the extra
+           * feature that after a LF the next line is indent at the
+           * length of the prefix.  Note that we do not yet include
+           * the length of the timestamp and pid in the indent
+           * computation.  */
+          const char *p, *pend;
+
+          for (p = fmt; (pend = strchr (p, '\n')); p = pend+1)
+            {
+              rc = _gpgrt_fprintf_unlocked (logstream, "%*s%.*s",
+                                 (int)((p != fmt
+                                        && (with_prefix || force_prefixes))
+                                       ?strlen (prefix_buffer)+2:0), "",
+                                 (int)(pend - p)+1, p);
+              if (rc > 0)
+                length += rc;
+            }
+          _gpgrt_fputs_unlocked (p, logstream);
+          length += strlen (p);
+        }
+      else
+        {
+          struct fmt_string_filter_s sf = {NULL};
+
+          rc = _gpgrt_vfprintf_unlocked (logstream, fmt_string_filter, &sf,
+                                         fmt, arg_ptr);
+          if (rc > 0)
+            length += rc;
+        }
+
+      if (*fmt && fmt[strlen(fmt)-1] != '\n')
+        missing_lf = 1;
+    }
+
+  /* If we have an EXTRASTRING print it now while we still hold the
+   * lock on the logstream.  */
+  if (extrastring)
+    {
+      int c;
+
+      if (missing_lf)
+        {
+          _gpgrt_putc_unlocked ('\n', logstream);
+          missing_lf = 0;
+          length = 0;
+        }
+      length += print_prefix (level, leading_backspace);
+      _gpgrt_fputs_unlocked (">> ", logstream);
+      length += 3;
+      missing_lf = 1;
+      while ((c = *extrastring++))
+        {
+          missing_lf = 1;
+          if (c == '\\')
+            {
+              _gpgrt_fputs_unlocked ("\\\\", logstream);
+              length += 2;
+            }
+          else if (c == '\r')
+            {
+              _gpgrt_fputs_unlocked ("\\r", logstream);
+              length += 2;
+            }
+          else if (c == '\n')
+            {
+              _gpgrt_fputs_unlocked ("\\n\n", logstream);
+              length = 0;
+              if (*extrastring)
+                {
+                  length += print_prefix (level, leading_backspace);
+                  _gpgrt_fputs_unlocked (">> ", logstream);
+                  length += 3;
+                }
+              else
+                missing_lf = 0;
+            }
+          else
+            {
+              _gpgrt_putc_unlocked (c, logstream);
+              length++;
+            }
+        }
+      if (missing_lf)
+        {
+          _gpgrt_putc_unlocked ('\n', logstream);
+          length = 0;
+          missing_lf = 0;
+        }
+    }
+
+  if (level == GPGRT_LOGLVL_FATAL)
+    {
+      if (missing_lf)
+        _gpgrt_putc_unlocked ('\n', logstream);
+      _gpgrt_funlockfile (logstream);
+      exit (2);
+    }
+  else if (level == GPGRT_LOGLVL_BUG)
+    {
+      if (missing_lf)
+        _gpgrt_putc_unlocked ('\n', logstream );
+      _gpgrt_funlockfile (logstream);
+      /* Using backtrace requires a configure test and to pass
+       * -rdynamic to gcc.  Thus we do not enable it now.  */
+      /* { */
+      /*   void *btbuf[20]; */
+      /*   int btidx, btlen; */
+      /*   char **btstr; */
+
+      /*   btlen = backtrace (btbuf, DIM (btbuf)); */
+      /*   btstr = backtrace_symbols (btbuf, btlen); */
+      /*   if (btstr) */
+      /*     for (btidx=0; btidx < btlen; btidx++) */
+      /*       log_debug ("[%d] %s\n", btidx, btstr[btidx]); */
+      /* } */
+      _gpgrt_abort ();
+    }
+  else
+    _gpgrt_funlockfile (logstream);
+
+  /* Bumb the error counter for log_error.  */
+  if (level == GPGRT_LOGLVL_ERROR)
+    _gpgrt_inc_errorcount ();
+
+  return length;
+}
+
+
+void
+_gpgrt_log (int level, const char *fmt, ...)
+{
+  va_list arg_ptr ;
+
+  va_start (arg_ptr, fmt) ;
+  _gpgrt_logv_internal (level, 0, NULL, NULL, fmt, arg_ptr);
+  va_end (arg_ptr);
+}
+
+
+void
+_gpgrt_logv (int level, const char *fmt, va_list arg_ptr)
+{
+  _gpgrt_logv_internal (level, 0, NULL, NULL, fmt, arg_ptr);
+}
+
+
+/* Same as log_logv but PREFIX is printed immediately before FMT.
+ * Note that PREFIX is an additional string and independent of the
+ * prefix set by gpgrt_log_set_prefix.  */
+void
+_gpgrt_logv_prefix (int level, const char *prefix,
+                    const char *fmt, va_list arg_ptr)
+{
+  _gpgrt_logv_internal (level, 0, NULL, prefix, fmt, arg_ptr);
+}
+
+
+static void
+do_log_ignore_arg (int level, const char *str, ...)
+{
+  va_list arg_ptr;
+  va_start (arg_ptr, str);
+  _gpgrt_logv_internal (level, 1, NULL, NULL, str, arg_ptr);
+  va_end (arg_ptr);
+}
+
+
+/* Log STRING at LEVEL but indent from the second line on by the
+ * length of the prefix.  */
+void
+_gpgrt_log_string (int level, const char *string)
+{
+  /* We need a dummy arg_ptr, but there is no portable way to create
+   * one.  So we call the _gpgrt_logv_internal function through a
+   * variadic wrapper. */
+  do_log_ignore_arg (level, string);
+}
+
+
+void
+_gpgrt_log_info (const char *fmt, ...)
+{
+  va_list arg_ptr ;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv_internal (GPGRT_LOGLVL_INFO, 0, NULL, NULL, fmt, arg_ptr);
+  va_end (arg_ptr);
+}
+
+
+void
+_gpgrt_log_error (const char *fmt, ...)
+{
+  va_list arg_ptr ;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv_internal (GPGRT_LOGLVL_ERROR, 0, NULL, NULL, fmt, arg_ptr);
+  va_end (arg_ptr);
+}
+
+
+void
+_gpgrt_log_fatal (const char *fmt, ...)
+{
+  va_list arg_ptr ;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv_internal (GPGRT_LOGLVL_FATAL, 0, NULL, NULL, fmt, arg_ptr);
+  va_end (arg_ptr);
+  _gpgrt_abort (); /* Never called; just to make the compiler happy.  */
+}
+
+
+void
+_gpgrt_log_bug (const char *fmt, ...)
+{
+  va_list arg_ptr ;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv_internal (GPGRT_LOGLVL_BUG, 0, NULL, NULL, fmt, arg_ptr);
+  va_end (arg_ptr);
+  _gpgrt_abort (); /* Never called; just to make the compiler happy.  */
+}
+
+
+void
+_gpgrt_log_debug (const char *fmt, ...)
+{
+  va_list arg_ptr;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv_internal (GPGRT_LOGLVL_DEBUG, 0, NULL, NULL, fmt, arg_ptr);
+  va_end (arg_ptr);
+}
+
+
+/* The same as log_debug but at the end of the output STRING is
+ * printed with LFs expanded to include the prefix and a final --end--
+ * marker.  */
+void
+_gpgrt_log_debug_string (const char *string, const char *fmt, ...)
+{
+  va_list arg_ptr;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv_internal (GPGRT_LOGLVL_DEBUG, 0, string, NULL, fmt, arg_ptr);
+  va_end (arg_ptr);
+}
+
+
+void
+_gpgrt_log_printf (const char *fmt, ...)
+{
+  va_list arg_ptr;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv_internal (fmt ? GPGRT_LOGLVL_CONT : GPGRT_LOGLVL_BEGIN,
+                        0, NULL, NULL, fmt, arg_ptr);
+  va_end (arg_ptr);
+}
+
+
+/* Flush the log - this is useful to make sure that the trailing
+   linefeed has been printed.  */
+void
+_gpgrt_log_flush (void)
+{
+  do_log_ignore_arg (GPGRT_LOGLVL_CONT, NULL);
+}
+
+
+/* Print a hexdump of (BUFFER,LENGTH).  With FMT passed as NULL print
+ * just the raw dump (in this case ARG_PTR is not used), with FMT
+ * being an empty string, print a trailing linefeed, otherwise print
+ * an entire debug line with the expanded FMT followed by a possible
+ * wrapped hexdump and a final LF.  */
+void
+_gpgrt_logv_printhex (const void *buffer, size_t length,
+                      const char *fmt, va_list arg_ptr)
+{
+  int wrap = 0;
+  int cnt = 0;
+  const unsigned char *p;
+
+  /* FIXME: This printing is not yet protected by _gpgrt_flockfile.  */
+  if (fmt && *fmt)
+    {
+      _gpgrt_logv_internal (GPGRT_LOGLVL_DEBUG, 0, NULL, NULL, fmt, arg_ptr);
+      wrap = 1;
+    }
+
+  if (length)
+    {
+      if (wrap)
+        _gpgrt_log_printf (" ");
+
+      for (p = buffer; length--; p++)
+        {
+          _gpgrt_log_printf ("%02x", *p);
+          if (wrap && ++cnt == 32 && length)
+            {
+              cnt = 0;
+              /* (we indicate continuations with a backslash) */
+              _gpgrt_log_printf (" \\\n");
+              _gpgrt_log_debug ("%s", "");
+              if (fmt && *fmt)
+                _gpgrt_log_printf (" ");
+            }
+        }
+    }
+
+  if (fmt)
+    _gpgrt_log_printf ("\n");
+}
+
+
+/* Print a hexdump of (BUFFER,LENGTH).  With FMT passed as NULL print
+ * just the raw dump, with FMT being an empty string, print a trailing
+ * linefeed, otherwise print an entire debug line with the expanded
+ * FMT followed by the hexdump and a final LF.  */
+void
+_gpgrt_log_printhex (const void *buffer, size_t length,
+                     const char *fmt, ...)
+{
+  va_list arg_ptr;
+
+  if (fmt)
+    {
+      va_start (arg_ptr, fmt);
+      _gpgrt_logv_printhex (buffer, length, fmt, arg_ptr);
+      va_end (arg_ptr);
+    }
+  else
+    {
+      /* va_list is not necessary a pointer and thus we can't use NULL
+       * because that would conflict with platforms using a straight
+       * struct for it (e.g. arm64).  We use a dummy variable instead;
+       * the static is a simple way zero it out so to not get
+       * complains about uninitialized use.  */
+      static va_list dummy_argptr;
+
+      _gpgrt_logv_printhex (buffer, length, NULL, dummy_argptr);
+    }
+}
+
+
+/* Print a microsecond timestamp followed by FMT.  */
+void
+_gpgrt_logv_clock (const char *fmt, va_list arg_ptr)
+{
+#if ENABLE_LOG_CLOCK
+  static unsigned long long initial;
+  struct timespec tv;
+  unsigned long long now;
+  char clockbuf[50];
+
+  if (clock_gettime (CLOCK_REALTIME, &tv))
+    {
+      _gpgrt_log_debug ("error getting the realtime clock value\n");
+      return;
+    }
+  now = tv.tv_sec * 1000000000ull;
+  now += tv.tv_nsec;
+
+  if (!initial)
+    initial = now;
+
+  snprintf (clockbuf, sizeof clockbuf, "[%6llu] ", (now - initial)/1000);
+  _gpgrt_logv_internal (GPGRT_LOGLVL_DEBUG, 0, NULL, clockbuf, fmt, arg_ptr);
+
+#else /*!ENABLE_LOG_CLOCK*/
+
+  /* You may need to link with -ltr to use the above code.  */
+
+  _gpgrt_logv_internal (GPGRT_LOGLVL_DEBUG,
+                        0, NULL, "[no clock] ", fmt, arg_ptr);
+
+#endif  /*!ENABLE_LOG_CLOCK*/
+}
+
+
+/* Print a microsecond timestamp followed by FMT.  */
+void
+_gpgrt_log_clock (const char *fmt, ...)
+{
+  va_list arg_ptr;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv_clock (fmt, arg_ptr);
+  va_end (arg_ptr);
+}
+
+
+void
+_gpgrt__log_assert (const char *expr, const char *file,
+                   int line, const char *func)
+{
+#ifdef GPGRT_HAVE_MACRO_FUNCTION
+  _gpgrt_log (GPGRT_LOGLVL_BUG, "Assertion \"%s\" in %s failed (%s:%d)\n",
+              expr, func, file, line);
+#else /*!GPGRT_HAVE_MACRO_FUNCTION*/
+  _gpgrt_log (GPGRT_LOGLVL_BUG, "Assertion \"%s\" failed (%s:%d)\n",
+           expr, file, line);
+#endif /*!GPGRT_HAVE_MACRO_FUNCTION*/
+  _gpgrt_abort (); /* Never called; just to make the compiler happy.  */
+}
index 46d436c..e9c857c 100644 (file)
@@ -85,7 +85,7 @@ header {
 }
 
 !header {
-  sub (/\#.+/, "");
+  sub (/#.+/, "");
   sub (/[      ]+$/, ""); # Strip trailing space and tab characters.
 
   if (/^$/)
index a771a73..4578e29 100644 (file)
@@ -81,7 +81,7 @@ header {
 }
 
 !header {
-  sub (/\#.+/, "");
+  sub (/#.+/, "");
   sub (/[      ]+$/, ""); # Strip trailing space and tab characters.
 
   if (/^$/)
index ea58503..188f7a4 100644 (file)
@@ -91,7 +91,7 @@ header {
 }
 
 !header {
-  sub (/\#.+/, "");
+  sub (/#.+/, "");
   sub (/[      ]+$/, ""); # Strip trailing space and tab characters.
 
   if (/^$/)
index f79df66..15b1aad 100644 (file)
@@ -83,7 +83,7 @@ header {
 }
 
 !header {
-  sub (/\#.+/, "");
+  sub (/#.+/, "");
   sub (/[      ]+$/, ""); # Strip trailing space and tab characters.
 
   if (/^$/)
index 5aeb1e7..1d2ea20 100644 (file)
 
 #define LINESIZE 1024
 
-static const char *host_os;
-static char *host_triplet;
+static char *host_triplet; /* malloced.  */
+static char *host_os;      /* points into host_triplet.  */
 static char *srcdir;
 static const char *hdr_version;
 static const char *hdr_version_number;
+static int cross_building; /* Command line flag.  */
 
 /* Values take from the supplied config.h.  */
 static int have_stdint_h;
+static int have_sys_types_h;
 static int have_w32_system;
 static int have_w64_system;
 static char *replacement_for_off_type;
@@ -37,6 +39,7 @@ static int use_posix_threads;
 
 /* Various state flags.  */
 static int stdint_h_included;
+static int sys_types_h_included;
 
 
 /* The usual free wrapper.  */
@@ -49,45 +52,67 @@ xfree (void *a)
 
 
 static char *
-xstrdup (const char *string)
+xmalloc (size_t n)
 {
   char *p;
 
-  p = malloc (strlen (string)+1);
+  p = malloc (n);
   if (!p)
     {
       fputs (PGM ": out of core\n", stderr);
       exit (1);
     }
-  strcpy (p, string);
+  return p;
+}
+
+
+static char *
+xstrdup (const char *string)
+{
+  char *p;
+  size_t len = strlen (string) + 1;
+
+  p = xmalloc (len);
+  memcpy (p, string, len);
   return p;
 }
 
 
 /* Return a malloced string with TRIPLET.  If TRIPLET has an alias
-   return that instead.  In general build-aux/config.sub should do the
-   aliasing but some returned triplets are anyway identical and thus we
-   use this function to map it to the canonical form.  */
+ * return that instead.  In general build-aux/config.sub should do the
+ * aliasing but some returned triplets are anyway identical and thus
+ * we use this function to map it to the canonical form.  A pointer to
+ * the OS part of the returned value is stored at R_OS.
+ * NO_VENDOR_HACK is for internal use; caller must call with 0. */
 static char *
-canon_host_triplet (const char *triplet)
+canon_host_triplet (const char *triplet, int no_vendor_hack, char **r_os)
 {
   struct {
     const char *name;
     const char *alias;
   } tbl[] = {
-    {"i486-pc-linux-gnu", "i686-pc-linux-gnu" },
+    {"i486-pc-linux-gnu", "i686-unknown-linux-gnu" },
     {"i586-pc-linux-gnu" },
-    {"i486-pc-gnu", "i686-pc-gnu"},
+    {"i686-pc-linux-gnu" },
+    {"arc-oe-linux-gnu"    }, /* Other CPU but same struct.  */
+    {"arc-oe-linux-uclibc" }, /* and uclibc is also the same.  */
+
+    {"i486-pc-gnu", "i686-unknown-gnu"},
     {"i586-pc-gnu"},
-    {"i486-pc-kfreebsd-gnu", "i686-pc-kfreebsd-gnu"},
+    {"i686-pc-gnu"},
+
+    {"i486-pc-kfreebsd-gnu", "i686-unknown-kfreebsd-gnu"},
     {"i586-pc-kfreebsd-gnu"},
+    {"i686-pc-kfreebsd-gnu"},
 
-    {"x86_64-pc-linux-gnuhardened1", "x86_64-pc-linux-gnu" },
+    {"x86_64-pc-linux-gnuhardened1", "x86_64-unknown-linux-gnu" },
+    {"x86_64-pc-linux-gnu" },
 
     {"powerpc-unknown-linux-gnuspe", "powerpc-unknown-linux-gnu" },
 
     {"arm-unknown-linux-gnueabihf",  "arm-unknown-linux-gnueabi" },
     {"armv7-unknown-linux-gnueabihf"  },
+    {"armv7a-unknown-linux-gnueabihf" },
     {"armv5-unknown-linux-musleabi"   },
     {"armv6-unknown-linux-musleabihf" },
 
@@ -95,6 +120,9 @@ canon_host_triplet (const char *triplet)
   };
   int i;
   const char *lastalias = NULL;
+  const char *s;
+  char *p;
+  char *result;
 
   for (i=0; tbl[i].name; i++)
     {
@@ -104,10 +132,54 @@ canon_host_triplet (const char *triplet)
         {
           if (!lastalias)
             break; /* Ooops: first entry has no alias.  */
-          return xstrdup (lastalias);
+          result = xstrdup (lastalias);
+          goto leave;
+        }
+    }
+  for (i=0, s=triplet; *s; s++)
+    if (*s == '-')
+      i++;
+  if (i > 2 && !no_vendor_hack)
+    {
+      /* We have a 4 part "triplet": CPU-VENDOR-KERNEL-SYSTEM where
+       * the last two parts replace the OS part of a real triplet.
+       * The VENDOR part is then in general useless because
+       * KERNEL-SYSTEM is specific enough.  We now do a second pass by
+       * replacing VENDOR with "unknown".  */
+      char *buf = xmalloc (strlen (triplet) + 7 + 1);
+
+      for (p=buf,s=triplet,i=0; *s; s++)
+        {
+          *p++ = *s;
+          if (*s == '-' && ++i == 1)
+            {
+              memcpy (p, "unknown-",8);
+              p += 8;
+              for (s++; *s != '-'; s++)
+                ;
+            }
         }
+      *p = 0;
+      result = canon_host_triplet (buf, 1, NULL);
+      xfree (buf);
+      goto leave;
+    }
+
+  result = xstrdup (triplet);
+ leave:
+  /* Find the OS part.  */
+  if (r_os)
+    {
+      *r_os = result + strlen (result); /* Default to the empty string.  */
+      for (i=0, p=result; *p; p++)
+        if (*p == '-' && ++i == 2)
+          {
+            *r_os = p+1;
+            break;
+          }
     }
-  return xstrdup (triplet);
+
+  return result;
 }
 
 
@@ -124,7 +196,7 @@ parse_config_h (const char *fname)
   fp = fopen (fname, "r");
   if (!fp)
     {
-      fprintf (stderr, "%s:%d: can't open file: %s",
+      fprintf (stderr, "%s:%d: can't open file: %s\n",
                fname, lnr, strerror (errno));
       return 1;
     }
@@ -150,6 +222,8 @@ parse_config_h (const char *fname)
         continue; /* oops */
       if (!strcmp (p1, "HAVE_STDINT_H"))
         have_stdint_h = 1;
+      else if (!strcmp (p1, "HAVE_SYS_TYPES_H"))
+        have_sys_types_h = 1;
       else if (!strcmp (p1, "HAVE_W32_SYSTEM"))
         have_w32_system = 1;
       else if (!strcmp (p1, "HAVE_W64_SYSTEM"))
@@ -170,6 +244,7 @@ parse_config_h (const char *fname)
     {
       fprintf (stderr, "%s:%d: error reading file: %s\n",
                fname, lnr, strerror (errno));
+      fclose (fp);
       return 1;
     }
 
@@ -473,8 +548,12 @@ write_special (const char *fname, int lnr, const char *tag)
         }
       else
         {
-          fputs ("#include <sys/types.h>\n"
-                 "typedef ssize_t gpgrt_ssize_t;\n", stdout);
+          if (!sys_types_h_included)
+            {
+              fputs ("#include <sys/types.h>\n", stdout);
+              sys_types_h_included = 1;
+            }
+          fputs ("typedef ssize_t gpgrt_ssize_t;\n", stdout);
         }
     }
   else if (!strcmp (tag, "api_ssize_t"))
@@ -484,6 +563,30 @@ write_special (const char *fname, int lnr, const char *tag)
       else
         fputs ("ssize_t", stdout);
     }
+  else if (!strcmp (tag, "define:pid_t"))
+    {
+      if (have_sys_types_h)
+        {
+          if (!sys_types_h_included)
+            {
+              fputs ("#include <sys/types.h>\n", stdout);
+              sys_types_h_included = 1;
+            }
+        }
+      else if (have_w64_system)
+        {
+          if (!stdint_h_included && have_stdint_h)
+            {
+              fputs ("#include <stdint.h>\n", stdout);
+              stdint_h_included = 1;
+            }
+          fputs ("typedef int64_t pid_t\n", stdout);
+        }
+      else
+        {
+          fputs ("typedef int     pid_t\n", stdout);
+        }
+    }
   else if (!strcmp (tag, "include:err-sources"))
     {
       write_sources_or_codes (NULL);
@@ -512,7 +615,11 @@ write_special (const char *fname, int lnr, const char *tag)
     }
   else if (!strcmp (tag, "include:lock-obj"))
     {
-      if (try_include_file (fname, lnr, "./lock-obj-pub.native.h", write_line))
+      /* If we are not cross compiling and the native file exists we
+       * prefer that over one from syscfg.  */
+      if (cross_building
+          || try_include_file (fname, lnr,
+                               "./lock-obj-pub.native.h", write_line))
         include_file (fname, lnr, "syscfg/lock-obj-pub.&.h", write_line);
     }
   else
@@ -525,7 +632,7 @@ write_special (const char *fname, int lnr, const char *tag)
 int
 main (int argc, char **argv)
 {
-  FILE *fp;
+  FILE *fp = NULL;
   char line[LINESIZE];
   int lnr = 0;
   const char *fname, *s;
@@ -537,23 +644,37 @@ main (int argc, char **argv)
     {
       argc--; argv++;
     }
+  if (argc && !strcmp (argv[0], "--cross"))
+    {
+      cross_building = 1;
+      argc--; argv++;
+    }
 
-  if (argc != 6)
+  if (argc == 1)
+    {
+      /* Print just the canonicalized host triplet.  */
+      host_triplet = canon_host_triplet (argv[0], 0, &host_os);
+      printf ("%s\n", host_triplet);
+      goto leave;
+    }
+  else if (argc == 5)
+    ; /* Standard operation.  */
+  else
     {
       fputs ("usage: " PGM
-             " host_os host_triplet template.h config.h"
-             " version version_number\n",
+             " host_triplet template.h config.h version version_number\n"
+             "       " PGM
+             " host_triplet\n",
              stderr);
       return 1;
     }
-  host_os = argv[0];
-  host_triplet_raw = argv[1];
-  fname = argv[2];
-  config_h = argv[3];
-  hdr_version = argv[4];
-  hdr_version_number = argv[5];
+  host_triplet_raw = argv[0];
+  fname = argv[1];
+  config_h = argv[2];
+  hdr_version = argv[3];
+  hdr_version_number = argv[4];
 
-  host_triplet = canon_host_triplet (host_triplet_raw);
+  host_triplet = canon_host_triplet (host_triplet_raw, 0, &host_os);
 
   srcdir = malloc (strlen (fname) + 2 + 1);
   if (!srcdir)
@@ -574,7 +695,7 @@ main (int argc, char **argv)
   fp = fopen (fname, "r");
   if (!fp)
     {
-      fprintf (stderr, "%s:%d: can't open file: %s",
+      fprintf (stderr, "%s:%d: can't open file: %s\n",
                fname, lnr, strerror (errno));
       return 1;
     }
@@ -644,13 +765,15 @@ main (int argc, char **argv)
          "End:\n"
          "*/\n", stdout);
 
+ leave:
   if (ferror (stdout))
     {
       fprintf (stderr, PGM ": error writing to stdout: %s\n", strerror (errno));
       return 1;
     }
 
-  fclose (fp);
+  if (fp)
+    fclose (fp);
 
   xfree (host_triplet);
   return 0;
index c9de9c1..285e45f 100644 (file)
@@ -77,7 +77,7 @@
 #
 # The variable prefix can be used to prepend a string to each message.
 #
-# The variable namespace can be used to prepend a string to each
+# The variable pkg_namespace can be used to prepend a string to each
 # variable and macro name.
 
 BEGIN {
@@ -102,7 +102,7 @@ header {
       print "/* The purpose of this complex string table is to produce";
       print "   optimal code with a minimum of relocations.  */";
       print "";
-      print "static const char " namespace "msgstr[] = ";
+      print "static const char " pkg_namespace "msgstr[] = ";
       header = 0;
     }
   else
@@ -110,7 +110,7 @@ header {
 }
 
 !header {
-  sub (/\#.+/, "");
+  sub (/#.+/, "");
   sub (/[      ]+$/, ""); # Strip trailing space and tab characters.
 
   if (/^$/)
@@ -150,7 +150,7 @@ END {
   else
     print "  gettext_noop (\"" last_msgstr "\");";
   print "";
-  print "static const int " namespace "msgidx[] =";
+  print "static const int " pkg_namespace "msgidx[] =";
   print "  {";
   for (i = 0; i < coded_msgs; i++)
     print "    " pos[i] ",";
@@ -158,7 +158,7 @@ END {
   print "  };";
   print "";
   print "static GPG_ERR_INLINE int";
-  print namespace "msgidxof (int code)";
+  print pkg_namespace "msgidxof (int code)";
   print "{";
   print "  return (0 ? 0";
 
index d251d2f..d0fd07a 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
-#include <assert.h>
 
 #if USE_POSIX_THREADS
 # include <pthread.h>
 #endif
 
-#include "gpg-error.h"
+#include "gpgrt-int.h"
 #include "lock.h"
 #include "posix-lock-obj.h"
 
 
-/*
- * Functions called before and after blocking syscalls.
- * gpgrt_set_syscall_clamp is used to set them.
- */
-static void (*pre_lock_func)(void);
-static void (*post_lock_func)(void);
-
-
 #if USE_POSIX_THREADS
-# if USE_POSIX_THREADS_WEAK
+# if USE_POSIX_THREADS_FROM_LIBC && HAVE_SYS_SINGLE_THREADED_H
+#  include <sys/single_threaded.h>
+#  define use_pthread_p()  !__libc_single_threaded
+# elif USE_POSIX_THREADS_WEAK
    /* On ELF systems it is easy to use pthreads using weak
       references.  Take care not to test the address of a weak
       referenced function we actually use; some GCC versions have a
@@ -98,8 +92,9 @@ use_pthread_p (void)
           void *retval;
           if (pthread_join (thread, &retval) != 0)
             {
-              assert (!"pthread_join");
-              abort ();
+              fputs ("gpgrt fatal: pthread_join in use_pthread_p failed\n",
+                     stderr);
+              _gpgrt_abort ();
             }
           result = 1;
         }
@@ -107,21 +102,10 @@ use_pthread_p (void)
     }
   return result;
 }
-#endif /*PTHREAD_IN_USE_DETECTION_HARD*/
+# endif /*PTHREAD_IN_USE_DETECTION_HARD*/
 #endif /*USE_POSIX_THREADS*/
 
 
-/* Helper to set the clamp functions.  This is called as a helper from
- * _gpgrt_set_syscall_clamp to keep the function pointers local. */
-void
-_gpgrt_lock_set_lock_clamp (void (*pre)(void), void (*post)(void))
-{
-  pre_lock_func = pre;
-  post_lock_func = post;
-}
-
-
-
 static _gpgrt_lock_t *
 get_lock_object (gpgrt_lock_t *lockhd)
 {
@@ -129,13 +113,13 @@ get_lock_object (gpgrt_lock_t *lockhd)
 
   if (lock->vers != LOCK_ABI_VERSION)
     {
-      assert (!"lock ABI version");
-      abort ();
+      fputs ("gpgrt fatal: lock ABI version mismatch\n", stderr);
+      _gpgrt_abort ();
     }
   if (sizeof (gpgrt_lock_t) < sizeof (_gpgrt_lock_t))
     {
-      assert (!"sizeof lock obj");
-      abort ();
+      fputs ("gpgrt fatal: sizeof lock obj\n", stderr);
+      _gpgrt_abort ();
     }
 
   return lock;
@@ -155,8 +139,8 @@ _gpgrt_lock_init (gpgrt_lock_t *lockhd)
     {
       if (sizeof (gpgrt_lock_t) < sizeof (_gpgrt_lock_t))
         {
-          assert (!"sizeof lock obj");
-          abort ();
+          fputs ("gpgrt fatal: sizeof lock obj\n", stderr);
+          _gpgrt_abort ();
         }
       lock->vers = LOCK_ABI_VERSION;
     }
@@ -168,7 +152,7 @@ _gpgrt_lock_init (gpgrt_lock_t *lockhd)
     {
       rc = pthread_mutex_init (&lock->u.mtx, NULL);
       if (rc)
-        rc = gpg_err_code_from_errno (rc);
+        rc = _gpg_err_code_from_errno (rc);
     }
   else
     rc = 0; /* Threads are not used.  */
@@ -189,13 +173,11 @@ _gpgrt_lock_lock (gpgrt_lock_t *lockhd)
 #if USE_POSIX_THREADS
   if (use_pthread_p())
     {
-      if (pre_lock_func)
-        pre_lock_func ();
+      _gpgrt_pre_syscall ();
       rc = pthread_mutex_lock (&lock->u.mtx);
       if (rc)
-        rc = gpg_err_code_from_errno (rc);
-      if (post_lock_func)
-        post_lock_func ();
+        rc = _gpg_err_code_from_errno (rc);
+      _gpgrt_post_syscall ();
     }
   else
     rc = 0; /* Threads are not used.  */
@@ -218,7 +200,7 @@ _gpgrt_lock_trylock (gpgrt_lock_t *lockhd)
     {
       rc = pthread_mutex_trylock (&lock->u.mtx);
       if (rc)
-        rc = gpg_err_code_from_errno (rc);
+        rc = _gpg_err_code_from_errno (rc);
     }
   else
     rc = 0; /* Threads are not used.  */
@@ -241,7 +223,7 @@ _gpgrt_lock_unlock (gpgrt_lock_t *lockhd)
     {
       rc = pthread_mutex_unlock (&lock->u.mtx);
       if (rc)
-        rc = gpg_err_code_from_errno (rc);
+        rc = _gpg_err_code_from_errno (rc);
     }
   else
     rc = 0; /* Threads are not used.  */
@@ -266,7 +248,7 @@ _gpgrt_lock_destroy (gpgrt_lock_t *lockhd)
     {
       rc = pthread_mutex_destroy (&lock->u.mtx);
       if (rc)
-        rc = gpg_err_code_from_errno (rc);
+        rc = _gpg_err_code_from_errno (rc);
       else
         {
           /* Re-init the mutex so that it can be re-used.  */
index 00a43e2..36c81ba 100644 (file)
 # include <thread.h>
 #endif
 
-#include "gpg-error.h"
+#include "gpgrt-int.h"
 
 #include "thread.h"
 
-/*
- * Functions called before and after blocking syscalls.
- * gpgrt_set_syscall_clamp is used to set them.
- */
-static void (*pre_syscall_func)(void);
-static void (*post_syscall_func)(void);
-
-
-/* Helper to set the clamp functions.  This is called as a helper from
- * _gpgrt_set_syscall_clamp to keep the function pointers local. */
-void
-_gpgrt_thread_set_syscall_clamp (void (*pre)(void), void (*post)(void))
-{
-  pre_syscall_func = pre;
-  post_syscall_func = post;
-}
-
 
 
 gpg_err_code_t
@@ -67,20 +50,16 @@ _gpgrt_yield (void)
 {
 #if USE_POSIX_THREADS
 # ifdef _POSIX_PRIORITY_SCHEDULING
-   if (pre_syscall_func)
-     pre_syscall_func ();
-   sched_yield ();
-   if (post_syscall_func)
-     post_syscall_func ();
+  _gpgrt_pre_syscall ();
+  sched_yield ();
+  _gpgrt_post_syscall ();
 # else
-   return GPG_ERR_NOT_SUPPORTED;
+  return GPG_ERR_NOT_SUPPORTED;
 # endif
 #elif USE_SOLARIS_THREADS
-  if (pre_syscall_func)
-    pre_syscall_func ();
+  _gpgrt_pre_syscall ();
   thr_yield ();
-  if (post_syscall_func)
-    post_syscall_func ();
+  _gpgrt_post_syscall ();
 #else
   return GPG_ERR_NOT_SUPPORTED;
 #endif
diff --git a/src/protos.h b/src/protos.h
new file mode 100644 (file)
index 0000000..7cc3489
--- /dev/null
@@ -0,0 +1,31 @@
+/* protos.h - Miscellaneous prototypes
+ * Copyright (C) 2020 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1+
+ */
+
+#ifndef _GPGRT_PROTOS_H
+#define _GPGRT_PROTOS_H
+
+/*-- w32-gettext.c --*/
+wchar_t *_gpgrt_utf8_to_wchar (const char *string);
+void     _gpgrt_free_wchar (wchar_t *wstring);
+char    *_gpgrt_wchar_to_utf8 (const wchar_t *string, size_t length);
+void     _gpgrt_w32_set_errno (int ec);
+
+
+#endif /*_GPGRT_PROTOS_H*/
diff --git a/src/spawn-posix.c b/src/spawn-posix.c
new file mode 100644 (file)
index 0000000..d33bade
--- /dev/null
@@ -0,0 +1,891 @@
+/* exechelp.c - Fork and exec helpers for POSIX
+ * Copyright (C) 2004, 2007-2009, 2010 Free Software Foundation, Inc.
+ * Copyright (C) 2004, 2006-2012, 2014-2017 g10 Code GmbH
+ *
+ * This file is part of Libgpg-error.
+ *
+ * Libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * Libgpg-error 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1+
+ *
+ * This file was originally a part of GnuPG.
+ */
+
+#include <config.h>
+
+#if defined(HAVE_W32_SYSTEM) || defined (HAVE_W32CE_SYSTEM)
+#error This code is only used on POSIX
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <errno.h>
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
+#endif
+#include <unistd.h>
+#include <fcntl.h>
+
+#include <sys/wait.h>
+
+#ifdef HAVE_GETRLIMIT
+#include <sys/time.h>
+#include <sys/resource.h>
+#endif /*HAVE_GETRLIMIT*/
+
+#ifdef HAVE_STAT
+# include <sys/stat.h>
+#endif
+
+#if __linux__
+# include <sys/types.h>
+# include <dirent.h>
+#endif /*__linux__ */
+
+#include "gpgrt-int.h"
+
+
+static void
+out_of_core (int line)
+{
+  _gpgrt_log_fatal ("malloc failed at line %d: %s\n",
+                    line, _gpg_strerror (_gpg_err_code_from_syserror ()));
+  /*NOTREACHED*/
+}
+
+
+/* Return the maximum number of currently allowed open file
+ * descriptors.  Only useful on POSIX systems but returns a value on
+ * other systems too.  */
+static int
+get_max_fds (void)
+{
+  int max_fds = -1;
+#ifdef HAVE_GETRLIMIT
+  struct rlimit rl;
+
+  /* Under Linux we can figure out the highest used file descriptor by
+   * reading /proc/PID/fd.  This is in the common cases much fast than
+   * for example doing 4096 close calls where almost all of them will
+   * fail.  On a system with a limit of 4096 files and only 8 files
+   * open with the highest number being 10, we speedup close_all_fds
+   * from 125ms to 0.4ms including readdir.
+   *
+   * Another option would be to close the file descriptors as returned
+   * from reading that directory - however then we need to snapshot
+   * that list before starting to close them.  */
+#ifdef __linux__
+  {
+    DIR *dir = NULL;
+    struct dirent *dir_entry;
+    const char *s;
+    int x;
+
+    /* FIXME: Check gpgme on how to do this right on Linux.  */
+    dir = opendir ("/proc/self/fd");
+    if (dir)
+      {
+        while ((dir_entry = readdir (dir)))
+          {
+            s = dir_entry->d_name;
+            if ( *s < '0' || *s > '9')
+              continue;
+            x = atoi (s);
+            if (x > max_fds)
+              max_fds = x;
+          }
+        closedir (dir);
+      }
+    if (max_fds != -1)
+      return max_fds + 1;
+    }
+#endif /* __linux__ */
+
+
+# ifdef RLIMIT_NOFILE
+  if (!getrlimit (RLIMIT_NOFILE, &rl))
+    max_fds = rl.rlim_max;
+# endif
+
+# ifdef RLIMIT_OFILE
+  if (max_fds == -1 && !getrlimit (RLIMIT_OFILE, &rl))
+    max_fds = rl.rlim_max;
+
+# endif
+#endif /*HAVE_GETRLIMIT*/
+
+#ifdef _SC_OPEN_MAX
+  if (max_fds == -1)
+    {
+      long int scres = sysconf (_SC_OPEN_MAX);
+      if (scres >= 0)
+        max_fds = scres;
+    }
+#endif
+
+#ifdef _POSIX_OPEN_MAX
+  if (max_fds == -1)
+    max_fds = _POSIX_OPEN_MAX;
+#endif
+
+#ifdef OPEN_MAX
+  if (max_fds == -1)
+    max_fds = OPEN_MAX;
+#endif
+
+  if (max_fds == -1)
+    max_fds = 256;  /* Arbitrary limit.  */
+
+  /* AIX returns INT32_MAX instead of a proper value.  We assume that
+     this is always an error and use an arbitrary limit.  */
+#ifdef INT32_MAX
+  if (max_fds == INT32_MAX)
+    max_fds = 256;
+#endif
+
+  return max_fds;
+}
+
+
+/* Close all file descriptors starting with descriptor FIRST.  If
+ * EXCEPT is not NULL, it is expected to be a list of file descriptors
+ * which shall not be closed.  This list shall be sorted in ascending
+ * order with the end marked by -1.  */
+static void
+close_all_fds (int first, int *except)
+{
+  int max_fd = get_max_fds ();
+  int fd, i, except_start;
+
+  if (except)
+    {
+      except_start = 0;
+      for (fd=first; fd < max_fd; fd++)
+        {
+          for (i=except_start; except[i] != -1; i++)
+            {
+              if (except[i] == fd)
+                {
+                  /* If we found the descriptor in the exception list
+                     we can start the next compare run at the next
+                     index because the exception list is ordered.  */
+                except_start = i + 1;
+                break;
+                }
+            }
+          if (except[i] == -1)
+            close (fd);
+        }
+    }
+  else
+    {
+      for (fd=first; fd < max_fd; fd++)
+        close (fd);
+    }
+
+  _gpg_err_set_errno (0);
+}
+
+
+/* Returns an array with all currently open file descriptors.  The end
+ * of the array is marked by -1.  The caller needs to release this
+ * array using the *standard free* and not with xfree.  This allow the
+ * use of this function right at startup even before libgcrypt has
+ * been initialized.  Returns NULL on error and sets ERRNO
+ * accordingly.
+ *
+ * FIXME: Needs to be adjusted for use here.
+ */
+#if 0
+int *
+get_all_open_fds (void)
+{
+  int *array;
+  size_t narray;
+  int fd, max_fd, idx;
+#ifndef HAVE_STAT
+  array = calloc (1, sizeof *array);
+  if (array)
+    array[0] = -1;
+#else /*HAVE_STAT*/
+  struct stat statbuf;
+
+  max_fd = get_max_fds ();
+  narray = 32;  /* If you change this change also t-exechelp.c.  */
+  array = calloc (narray, sizeof *array);
+  if (!array)
+    return NULL;
+
+  /* Note:  The list we return is ordered.  */
+  for (idx=0, fd=0; fd < max_fd; fd++)
+    if (!(fstat (fd, &statbuf) == -1 && errno == EBADF))
+      {
+        if (idx+1 >= narray)
+          {
+            int *tmp;
+
+            narray += (narray < 256)? 32:256;
+            tmp = realloc (array, narray * sizeof *array);
+            if (!tmp)
+              {
+                free (array);
+                return NULL;
+              }
+            array = tmp;
+          }
+        array[idx++] = fd;
+      }
+  array[idx] = -1;
+#endif /*HAVE_STAT*/
+  return array;
+}
+#endif /*0*/
+
+
+/* The exec core used right after the fork.  This will never return.  */
+static void
+do_exec (const char *pgmname, const char *argv[],
+         int fd_in, int fd_out, int fd_err,
+         int *except, void (*preexec)(void) )
+{
+  char **arg_list;
+  int i, j;
+  int fds[3];
+
+  fds[0] = fd_in;
+  fds[1] = fd_out;
+  fds[2] = fd_err;
+
+  /* Create the command line argument array.  */
+  i = 0;
+  if (argv)
+    while (argv[i])
+      i++;
+  arg_list = xtrycalloc (i+2, sizeof *arg_list);
+  if (!arg_list)
+    out_of_core (__LINE__);
+  arg_list[0] = strrchr (pgmname, '/');
+  if (arg_list[0])
+    arg_list[0]++;
+  else
+    {
+      arg_list[0] = xtrystrdup (pgmname);
+      if (!arg_list[0])
+        out_of_core (__LINE__);
+    }
+  if (argv)
+    for (i=0,j=1; argv[i]; i++, j++)
+      arg_list[j] = (char*)argv[i];
+
+  /* Assign /dev/null to unused FDs. */
+  for (i=0; i <= 2; i++)
+    {
+      if (fds[i] == -1 )
+        {
+          fds[i] = open ("/dev/null", i? O_WRONLY : O_RDONLY);
+          if (fds[i] == -1)
+            _gpgrt_log_fatal ("failed to open '%s': %s\n",
+                              "/dev/null", strerror (errno));
+        }
+    }
+
+  /* Connect the standard files.  */
+  for (i=0; i <= 2; i++)
+    {
+      if (fds[i] != i && dup2 (fds[i], i) == -1)
+        _gpgrt_log_fatal ("dup2 std%s failed: %s\n",
+                          i==0?"in":i==1?"out":"err", strerror (errno));
+    }
+
+  /* Close all other files. */
+  close_all_fds (3, except);
+
+  if (preexec)
+    preexec ();
+  execv (pgmname, arg_list);
+  /* No way to print anything, as we have may have closed all streams. */
+  _exit (127);
+}
+
+
+/* Helper for _gpgrt_make_pipe.  */
+static gpg_err_code_t
+do_create_pipe (int filedes[2])
+{
+  gpg_error_t err = 0;
+
+  _gpgrt_pre_syscall ();
+  if (pipe (filedes) == -1)
+    {
+      err = _gpg_err_code_from_syserror ();
+      filedes[0] = filedes[1] = -1;
+    }
+  _gpgrt_post_syscall ();
+
+  return err;
+}
+
+
+/* Helper for _gpgrt_make_pipe.  */
+static gpg_err_code_t
+do_create_pipe_and_estream (int filedes[2], estream_t *r_fp,
+                            int outbound, int nonblock)
+{
+  gpg_err_code_t err;
+
+  _gpgrt_pre_syscall ();
+  if (pipe (filedes) == -1)
+    {
+      err = _gpg_err_code_from_syserror ();
+      _gpgrt_log_error (_("error creating a pipe: %s\n"), _gpg_strerror (err));
+      filedes[0] = filedes[1] = -1;
+      *r_fp = NULL;
+      return err;
+    }
+  _gpgrt_post_syscall ();
+
+  if (!outbound)
+    *r_fp = _gpgrt_fdopen (filedes[0], nonblock? "r,nonblock" : "r");
+  else
+    *r_fp = _gpgrt_fdopen (filedes[1], nonblock? "w,nonblock" : "w");
+  if (!*r_fp)
+    {
+      err = _gpg_err_code_from_syserror ();
+      _gpgrt_log_error (_("error creating a stream for a pipe: %s\n"),
+                        _gpg_strerror (err));
+      close (filedes[0]);
+      close (filedes[1]);
+      filedes[0] = filedes[1] = -1;
+      return err;
+    }
+  return 0;
+}
+
+
+/* Create a pipe.  The DIRECTION parameter gives the type of the created pipe:
+ *   DIRECTION < 0 := Inbound pipe: On Windows the write end is inheritable.
+ *   DIRECTION > 0 := Outbound pipe: On Windows the read end is inheritable.
+ * If R_FP is NULL a standard pipe and no stream is created, DIRECTION
+ * should then be 0.  */
+gpg_err_code_t
+_gpgrt_make_pipe (int filedes[2], estream_t *r_fp, int direction,
+                  int nonblock)
+{
+  if (r_fp && direction)
+    return do_create_pipe_and_estream (filedes, r_fp,
+                                       (direction > 0), nonblock);
+  else
+    return do_create_pipe (filedes);
+}
+
+
+/* Fork and exec the PGMNAME, see gpgrt-int.h for details.  */
+gpg_err_code_t
+_gpgrt_spawn_process (const char *pgmname, const char *argv[],
+                      int *except, void (*preexec)(void), unsigned int flags,
+                      estream_t *r_infp,
+                      estream_t *r_outfp,
+                      estream_t *r_errfp,
+                      pid_t *pid)
+{
+  gpg_error_t err;
+  int inpipe[2] = {-1, -1};
+  int outpipe[2] = {-1, -1};
+  int errpipe[2] = {-1, -1};
+  estream_t infp = NULL;
+  estream_t outfp = NULL;
+  estream_t errfp = NULL;
+  int nonblock = !!(flags & GPGRT_SPAWN_NONBLOCK);
+
+  if (r_infp)
+    *r_infp = NULL;
+  if (r_outfp)
+    *r_outfp = NULL;
+  if (r_errfp)
+    *r_errfp = NULL;
+  *pid = (pid_t)(-1); /* Always required.  */
+
+  if (r_infp)
+    {
+      err = _gpgrt_create_outbound_pipe (inpipe, &infp, nonblock);
+      if (err)
+        return err;
+    }
+
+  if (r_outfp)
+    {
+      err = _gpgrt_create_inbound_pipe (outpipe, &outfp, nonblock);
+      if (err)
+        {
+          if (infp)
+            _gpgrt_fclose (infp);
+          else if (inpipe[1] != -1)
+            close (inpipe[1]);
+          if (inpipe[0] != -1)
+            close (inpipe[0]);
+
+          return err;
+        }
+    }
+
+  if (r_errfp)
+    {
+      err = _gpgrt_create_inbound_pipe (errpipe, &errfp, nonblock);
+      if (err)
+        {
+          if (infp)
+            _gpgrt_fclose (infp);
+          else if (inpipe[1] != -1)
+            close (inpipe[1]);
+          if (inpipe[0] != -1)
+            close (inpipe[0]);
+
+          if (outfp)
+            _gpgrt_fclose (outfp);
+          else if (outpipe[0] != -1)
+            close (outpipe[0]);
+          if (outpipe[1] != -1)
+            close (outpipe[1]);
+
+          return err;
+        }
+    }
+
+  _gpgrt_pre_syscall ();
+  *pid = fork ();
+  _gpgrt_post_syscall ();
+  if (*pid == (pid_t)(-1))
+    {
+      err = _gpg_err_code_from_syserror ();
+      _gpgrt_log_error (_("error forking process: %s\n"), _gpg_strerror (err));
+
+      if (infp)
+        _gpgrt_fclose (infp);
+      else if (inpipe[1] != -1)
+        close (inpipe[1]);
+      if (inpipe[0] != -1)
+        close (inpipe[0]);
+
+      if (outfp)
+        _gpgrt_fclose (outfp);
+      else if (outpipe[0] != -1)
+        close (outpipe[0]);
+      if (outpipe[1] != -1)
+        close (outpipe[1]);
+
+      if (errfp)
+        _gpgrt_fclose (errfp);
+      else if (errpipe[0] != -1)
+        close (errpipe[0]);
+      if (errpipe[1] != -1)
+        close (errpipe[1]);
+      return err;
+    }
+
+  if (!*pid)
+    {
+      /* This is the child. */
+      /* FIXME: Needs to be done by preexec:
+         gcry_control (GCRYCTL_TERM_SECMEM); */
+      _gpgrt_fclose (infp);
+      _gpgrt_fclose (outfp);
+      _gpgrt_fclose (errfp);
+      do_exec (pgmname, argv, inpipe[0], outpipe[1], errpipe[1],
+               except, preexec);
+      /*NOTREACHED*/
+    }
+
+  /* This is the parent. */
+  if (inpipe[0] != -1)
+    close (inpipe[0]);
+  if (outpipe[1] != -1)
+    close (outpipe[1]);
+  if (errpipe[1] != -1)
+    close (errpipe[1]);
+
+  if (r_infp)
+    *r_infp = infp;
+  if (r_outfp)
+    *r_outfp = outfp;
+  if (r_errfp)
+    *r_errfp = errfp;
+
+  return 0;
+}
+
+
+/* Fork and exec the PGMNAME using FDs, see gpgrt-int.h for details.  */
+gpg_err_code_t
+_gpgrt_spawn_process_fd (const char *pgmname, const char *argv[],
+                         int infd, int outfd, int errfd, pid_t *pid)
+{
+  gpg_error_t err;
+
+  _gpgrt_pre_syscall ();
+  *pid = fork ();
+  _gpgrt_post_syscall ();
+  if (*pid == (pid_t)(-1))
+    {
+      err = _gpg_err_code_from_syserror ();
+      _gpgrt_log_error (_("error forking process: %s\n"), _gpg_strerror (err));
+      return err;
+    }
+
+  if (!*pid)
+    {
+      /* FIXME: We need to add a preexec so that a
+           gcry_control (GCRYCTL_TERM_SECMEM);
+         can be done.  */
+      /* Run child. */
+      do_exec (pgmname, argv, infd, outfd, errfd, NULL, NULL);
+      /*NOTREACHED*/
+    }
+
+  return 0;
+}
+
+
+/* Waiting for child processes.
+ *
+ * waitpid(2) may return information about terminated children that we
+ * did not yet request, and there is no portable way to wait for a
+ * specific set of children.
+ *
+ * As a workaround, we store the results of children for later use.
+ *
+ * XXX: This assumes that PIDs are not reused too quickly.
+ * FIXME: This is not thread-safe.
+ */
+
+struct terminated_child
+{
+  pid_t pid;
+  int exitcode;
+  struct terminated_child *next;
+};
+
+static struct terminated_child *terminated_children;
+
+
+static gpg_err_code_t
+store_result (pid_t pid, int exitcode)
+{
+  struct terminated_child *c;
+
+  c = xtrymalloc (sizeof *c);
+  if (c == NULL)
+    return _gpg_err_code_from_syserror ();
+
+  c->pid = pid;
+  c->exitcode = exitcode;
+  c->next = terminated_children;
+  terminated_children = c;
+
+  return 0;
+}
+
+
+static int
+get_result (pid_t pid, int *r_exitcode)
+{
+  struct terminated_child *c, **prevp;
+
+  for (prevp = &terminated_children, c = terminated_children;
+       c;
+       prevp = &c->next, c = c->next)
+    if (c->pid == pid)
+      {
+        *prevp = c->next;
+        *r_exitcode = c->exitcode;
+        xfree (c);
+        return 1;
+      }
+
+  return 0;
+}
+
+
+/* See gpgrt-int.h for a description.  */
+gpg_err_code_t
+_gpgrt_wait_process (const char *pgmname, pid_t pid, int hang, int *r_exitcode)
+{
+  gpg_err_code_t ec;
+  int i, status;
+
+  if (r_exitcode)
+    *r_exitcode = -1;
+
+  if (pid == (pid_t)(-1))
+    return GPG_ERR_INV_VALUE;
+
+  _gpgrt_pre_syscall ();
+  while ((i=waitpid (pid, &status, hang? 0:WNOHANG)) == (pid_t)(-1)
+        && errno == EINTR);
+  _gpgrt_post_syscall ();
+
+  if (i == (pid_t)(-1))
+    {
+      ec = _gpg_err_code_from_syserror ();
+      _gpgrt_log_error (_("waiting for process %d to terminate failed: %s\n"),
+                        (int)pid, _gpg_strerror (ec));
+    }
+  else if (!i)
+    {
+      ec = GPG_ERR_TIMEOUT; /* Still running.  */
+    }
+  else if (WIFEXITED (status) && WEXITSTATUS (status) == 127)
+    {
+      /* FIXME: This is GnuPG specific.  */
+      _gpgrt_log_error (_("error running '%s': probably not installed\n"),
+                        pgmname);
+      ec = GPG_ERR_CONFIGURATION;
+    }
+  else if (WIFEXITED (status) && WEXITSTATUS (status))
+    {
+      if (!r_exitcode)
+        _gpgrt_log_error (_("error running '%s': exit status %d\n"), pgmname,
+                          WEXITSTATUS (status));
+      else
+        *r_exitcode = WEXITSTATUS (status);
+      ec = GPG_ERR_GENERAL;
+    }
+  else if (!WIFEXITED (status))
+    {
+      _gpgrt_log_error (_("error running '%s': terminated\n"), pgmname);
+      ec = GPG_ERR_GENERAL;
+    }
+  else
+    {
+      if (r_exitcode)
+        *r_exitcode = 0;
+      ec = 0;
+    }
+
+  return ec;
+}
+
+
+/* See gpgrt-int.h for a description.
+ *
+ * FIXME: What about using a poll like data structure for the pids and
+ * their exit codes?  The whole thing is anyway problematic in a
+ * threaded processs because waitpid has no association between PIDS
+ * and threads.
+ */
+gpg_err_code_t
+_gpgrt_wait_processes (const char **pgmnames, pid_t *pids, size_t count,
+                       int hang, int *r_exitcodes)
+{
+  gpg_err_code_t ec = 0;
+  size_t i, left;
+  int *dummy = NULL;
+
+  if (!r_exitcodes)
+    {
+      dummy = r_exitcodes = xtrymalloc (sizeof *r_exitcodes * count);
+      if (!dummy)
+        return _gpg_err_code_from_syserror ();
+    }
+
+  for (i = 0, left = count; i < count; i++)
+    {
+      int status = -1;
+
+      /* Skip invalid PID.  */
+      if (pids[i] == (pid_t)(-1))
+        {
+          r_exitcodes[i] = -1;
+          left -= 1;
+          continue;
+        }
+
+      /* See if there was a previously stored result for this pid.  */
+      if (get_result (pids[i], &status))
+        left -= 1;
+
+      r_exitcodes[i] = status;
+    }
+
+  while (left > 0)
+    {
+      pid_t pid;
+      int status;
+
+      _gpgrt_pre_syscall ();
+      while ((pid = waitpid (-1, &status, hang ? 0 : WNOHANG)) == (pid_t)(-1)
+             && errno == EINTR);
+      _gpgrt_post_syscall ();
+
+      if (pid == (pid_t)(-1))
+        {
+          ec = _gpg_err_code_from_syserror ();
+          _gpgrt_log_error (_("waiting for processes to terminate"
+                              " failed: %s\n"), _gpg_strerror (ec));
+          break;
+        }
+      else if (!pid)
+        {
+          ec = GPG_ERR_TIMEOUT; /* Still running.  */
+          break;
+        }
+      else
+        {
+          for (i = 0; i < count; i++)
+            if (pid == pids[i])
+              break;
+
+          if (i == count)
+            {
+              /* No match, store this result.  */
+              ec = store_result (pid, status);
+              if (ec)
+                break;
+              continue;
+            }
+
+          /* Process PIDS[i] died.  */
+          if (r_exitcodes[i] != (pid_t) -1)
+            {
+              _gpgrt_log_error ("PID %d was reused", (int)pid);
+              ec = GPG_ERR_GENERAL;
+              break;
+            }
+
+          left -= 1;
+          r_exitcodes[i] = status;
+        }
+    }
+
+  for (i = 0; i < count; i++)
+    {
+      if (r_exitcodes[i] == -1)
+        continue;
+
+      if (WIFEXITED (r_exitcodes[i]) && WEXITSTATUS (r_exitcodes[i]) == 127)
+        {
+          _gpgrt_log_error (_("error running '%s': probably not installed\n"),
+                            pgmnames[i]);
+          ec = GPG_ERR_CONFIGURATION;
+        }
+      else if (WIFEXITED (r_exitcodes[i]) && WEXITSTATUS (r_exitcodes[i]))
+        {
+          if (dummy)
+            _gpgrt_log_error (_("error running '%s': exit status %d\n"),
+                              pgmnames[i], WEXITSTATUS (r_exitcodes[i]));
+          else
+            r_exitcodes[i] = WEXITSTATUS (r_exitcodes[i]);
+          ec = GPG_ERR_GENERAL;
+        }
+      else if (!WIFEXITED (r_exitcodes[i]))
+        {
+          _gpgrt_log_error (_("error running '%s': terminated\n"), pgmnames[i]);
+          ec = GPG_ERR_GENERAL;
+        }
+    }
+
+  xfree (dummy);
+  return ec;
+}
+
+
+/* See gpgrt-int.h for a description.  FIXME: We should add a prexec
+ * callback. */
+gpg_err_code_t
+_gpgrt_spawn_process_detached (const char *pgmname, const char *argv[],
+                               const char *envp[] )
+{
+  gpg_err_code_t ec;
+  pid_t pid;
+  int i;
+
+  /* FIXME: Is this GnuPG specific or should we keep it.  */
+  if (getuid() != geteuid())
+    return GPG_ERR_BUG;
+
+  if (access (pgmname, X_OK))
+    return _gpg_err_code_from_syserror ();
+
+  _gpgrt_pre_syscall ();
+  pid = fork ();
+  _gpgrt_post_syscall ();
+  if (pid == (pid_t)(-1))
+    {
+      ec = _gpg_err_code_from_syserror ();
+      _gpgrt_log_error (_("error forking process: %s\n"), _gpg_strerror (ec));
+      return ec;
+    }
+
+  if (!pid)
+    {
+      pid_t pid2;
+
+      /* gcry_control (GCRYCTL_TERM_SECMEM); */
+      if (setsid() == -1 || chdir ("/"))
+        _exit (1);
+
+      pid2 = fork (); /* Double fork to let init take over the new child. */
+      if (pid2 == (pid_t)(-1))
+        _exit (1);
+      if (pid2)
+        _exit (0);  /* Let the parent exit immediately. */
+
+      for (i=0; envp && envp[i]; i++)
+        {
+          char *p = xtrystrdup (envp[i]);
+          if (!p)
+            out_of_core (__LINE__);
+          putenv (p);
+        }
+
+      do_exec (pgmname, argv, -1, -1, -1, NULL, NULL);
+      /*NOTREACHED*/
+    }
+
+  _gpgrt_pre_syscall ();
+  if (waitpid (pid, NULL, 0) == -1)
+    {
+      _gpgrt_post_syscall ();
+      ec = _gpg_err_code_from_syserror ();
+      _gpgrt_log_error ("waitpid failed in gpgrt_spawn_process_detached: %s",
+                        _gpg_strerror (ec));
+      return ec;
+    }
+  else
+    _gpgrt_post_syscall ();
+
+  return 0;
+}
+
+
+/* Kill a process; that is send an appropriate signal to the process.
+ * gnupg_wait_process must be called to actually remove the process
+   from the system.  An invalid PID is ignored.  */
+void
+_gpgrt_kill_process (pid_t pid)
+{
+  if (pid != (pid_t)(-1))
+    {
+      _gpgrt_pre_syscall ();
+      kill (pid, SIGTERM);
+      _gpgrt_post_syscall ();
+    }
+}
+
+
+void
+_gpgrt_release_process (pid_t pid)
+{
+  (void)pid;
+}
diff --git a/src/spawn-w32.c b/src/spawn-w32.c
new file mode 100644 (file)
index 0000000..3ede1f2
--- /dev/null
@@ -0,0 +1,920 @@
+/* spawn-w32.c - Fork and exec helpers for W32.
+ * Copyright (C) 2004, 2007-2009, 2010 Free Software Foundation, Inc.
+ * Copyright (C) 2004, 2006-2012, 2014-2017 g10 Code GmbH
+ *
+ * This file is part of Libgpg-error.
+ *
+ * Libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * Libgpg-error 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1+
+ *
+ * This file was originally a part of GnuPG.
+ */
+
+#include <config.h>
+
+#if !defined(HAVE_W32_SYSTEM) || defined (HAVE_W32CE_SYSTEM)
+#error This code is only used on W32.
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
+#endif
+#include <unistd.h>
+#include <fcntl.h>
+#ifdef HAVE_STAT
+# include <sys/stat.h>
+#endif
+#define WIN32_LEAN_AND_MEAN  /* We only need the OS core stuff.  */
+#include <windows.h>
+
+#include "gpgrt-int.h"
+
+/* Define to 1 do enable debugging.  */
+#define DEBUG_W32_SPAWN 0
+
+
+/* It seems Vista doesn't grok X_OK and so fails access() tests.
+ * Previous versions interpreted X_OK as F_OK anyway, so we'll just
+ * use F_OK directly. */
+#undef X_OK
+#define X_OK F_OK
+
+/* For HANDLE and the internal file descriptor (fd) of this module:
+ * HANDLE can be represented by an intptr_t which should be true for
+ * all systems (HANDLE is defined as void *).  Further, we assume that
+ * -1 denotes an invalid handle.
+ *
+ * Note that a C run-time file descriptor (the exposed one to API) is
+ * always represented by an int.
+ */
+#define fd_to_handle(a)  ((HANDLE)(a))
+#define handle_to_fd(a)  ((intptr_t)(a))
+
+/* For pid_t and HANDLE:
+
+ * We assume that a HANDLE can be represented by an int which should
+ * be true for all i386 systems.
+ *
+ * On 64-bit machine, it is no longer true, as a type, however, as
+ * long as the range of the value in the type HANDLE can be
+ * represented by an int, it works.
+ *
+ * FIXME: Breaking ABI for pid_t will be needed when the value won't
+ * fit within 32-bit range on 64-bit machine.
+ */
+#define pid_to_handle(a) ((HANDLE)(a))
+#define handle_to_pid(a) ((int)(a))
+
+
+/* Return the maximum number of currently allowed open file
+ * descriptors.  Only useful on POSIX systems but returns a value on
+ * other systems too.  */
+int
+get_max_fds (void)
+{
+  int max_fds = -1;
+
+#ifdef OPEN_MAX
+  if (max_fds == -1)
+    max_fds = OPEN_MAX;
+#endif
+
+  if (max_fds == -1)
+    max_fds = 256;  /* Arbitrary limit.  */
+
+  return max_fds;
+}
+
+
+/* Under Windows this is a dummy function.  */
+/* static void */
+/* close_all_fds (int first, int *except) */
+/* { */
+/*   (void)first; */
+/*   (void)except; */
+/* } */
+
+
+/* Returns an array with all currently open file descriptors.  The end
+ * of the array is marked by -1.  The caller needs to release this
+ * array using the *standard free* and not with xfree.  This allow the
+ * use of this function right at startup even before libgcrypt has
+ * been initialized.  Returns NULL on error and sets ERRNO
+ * accordingly.  Note that fstat prints a warning to DebugView for all
+ * invalid fds which is a bit annoying.  We actually do not need this
+ * function in real code (close_all_fds is a dummy anyway) but we keep
+ * it for use by t-exechelp.c.  */
+#if 0
+int *
+get_all_open_fds (void)
+{
+  int *array;
+  size_t narray;
+  int fd, max_fd, idx;
+#ifndef HAVE_STAT
+  array = calloc (1, sizeof *array);
+  if (array)
+    array[0] = -1;
+#else /*HAVE_STAT*/
+  struct stat statbuf;
+
+  max_fd = get_max_fds ();
+  narray = 32;  /* If you change this change also t-exechelp.c.  */
+  array = calloc (narray, sizeof *array);
+  if (!array)
+    return NULL;
+
+  /* Note:  The list we return is ordered.  */
+  for (idx=0, fd=0; fd < max_fd; fd++)
+    if (!(fstat (fd, &statbuf) == -1 && errno == EBADF))
+      {
+        if (idx+1 >= narray)
+          {
+            int *tmp;
+
+            narray += (narray < 256)? 32:256;
+            tmp = realloc (array, narray * sizeof *array);
+            if (!tmp)
+              {
+                free (array);
+                return NULL;
+              }
+            array = tmp;
+          }
+        array[idx++] = fd;
+      }
+  array[idx] = -1;
+#endif /*HAVE_STAT*/
+  return array;
+}
+#endif
+
+
+/* Helper function to build_w32_commandline. */
+static char *
+build_w32_commandline_copy (char *buffer, const char *string)
+{
+  char *p = buffer;
+  const char *s;
+
+  if (!*string) /* Empty string. */
+    p = stpcpy (p, "\"\"");
+  else if (strpbrk (string, " \t\n\v\f\""))
+    {
+      /* Need to do some kind of quoting.  */
+      p = stpcpy (p, "\"");
+      for (s=string; *s; s++)
+        {
+          *p++ = *s;
+          if (*s == '\"')
+            *p++ = *s;
+        }
+      *p++ = '\"';
+      *p = 0;
+    }
+  else
+    p = stpcpy (p, string);
+
+  return p;
+}
+
+
+/* Build a command line for use with W32's CreateProcess.  On success
+ * CMDLINE gets the address of a newly allocated string.  */
+static gpg_err_code_t
+build_w32_commandline (const char *pgmname, const char * const *argv,
+                       char **cmdline)
+{
+  int i, n;
+  const char *s;
+  char *buf, *p;
+
+  *cmdline = NULL;
+  n = 0;
+  s = pgmname;
+  n += strlen (s) + 1 + 2;  /* (1 space, 2 quoting */
+  for (; *s; s++)
+    if (*s == '\"')
+      n++;  /* Need to double inner quotes.  */
+  for (i=0; (s=argv[i]); i++)
+    {
+      n += strlen (s) + 1 + 2;  /* (1 space, 2 quoting */
+      for (; *s; s++)
+        if (*s == '\"')
+          n++;  /* Need to double inner quotes.  */
+    }
+  n++;
+
+  buf = p = xtrymalloc (n);
+  if (!buf)
+    return _gpg_err_code_from_syserror ();
+
+  p = build_w32_commandline_copy (p, pgmname);
+  for (i=0; argv[i]; i++)
+    {
+      *p++ = ' ';
+      p = build_w32_commandline_copy (p, argv[i]);
+    }
+
+  *cmdline= buf;
+  return 0;
+}
+
+
+#define INHERIT_READ   1
+#define INHERIT_WRITE  2
+#define INHERIT_BOTH   (INHERIT_READ|INHERIT_WRITE)
+
+/* Create pipe.  FLAGS indicates which ends are inheritable.  */
+static int
+create_inheritable_pipe (HANDLE filedes[2], int flags)
+{
+  HANDLE r, w;
+  SECURITY_ATTRIBUTES sec_attr;
+
+  memset (&sec_attr, 0, sizeof sec_attr );
+  sec_attr.nLength = sizeof sec_attr;
+  sec_attr.bInheritHandle = TRUE;
+
+  _gpgrt_pre_syscall ();
+  if (!CreatePipe (&r, &w, &sec_attr, 0))
+    {
+      _gpgrt_post_syscall ();
+      return -1;
+    }
+  _gpgrt_post_syscall ();
+
+  if ((flags & INHERIT_READ) == 0)
+    if (! SetHandleInformation (r, HANDLE_FLAG_INHERIT, 0))
+      goto fail;
+
+  if ((flags & INHERIT_WRITE) == 0)
+    if (! SetHandleInformation (w, HANDLE_FLAG_INHERIT, 0))
+      goto fail;
+
+  filedes[0] = r;
+  filedes[1] = w;
+  return 0;
+
+ fail:
+  _gpgrt_log_error ("SetHandleInformation failed: ec=%d\n",
+                    (int)GetLastError ());
+  CloseHandle (r);
+  CloseHandle (w);
+  return -1;
+}
+
+
+static HANDLE
+w32_open_null (int for_write)
+{
+  HANDLE hfile;
+
+  hfile = CreateFileW (L"nul",
+                       for_write? GENERIC_WRITE : GENERIC_READ,
+                       FILE_SHARE_READ | FILE_SHARE_WRITE,
+                       NULL, OPEN_EXISTING, 0, NULL);
+  if (hfile == INVALID_HANDLE_VALUE)
+    _gpgrt_log_debug ("can't open 'nul': ec=%d\n", (int)GetLastError ());
+  return hfile;
+}
+
+
+static gpg_err_code_t
+do_create_pipe_and_estream (int filedes[2],
+                            estream_t *r_fp, int direction, int nonblock)
+{
+  gpg_err_code_t err = 0;
+  int flags;
+  HANDLE fds[2];
+  gpgrt_syshd_t syshd;
+
+  if (direction < 0)
+    flags = INHERIT_WRITE;
+  else if (direction > 0)
+    flags = INHERIT_READ;
+  else
+    flags = INHERIT_BOTH;
+
+  filedes[0] = filedes[1] = -1;
+  err = GPG_ERR_GENERAL;
+  if (!create_inheritable_pipe (fds, flags))
+    {
+      filedes[0] = _open_osfhandle (handle_to_fd (fds[0]), O_RDONLY);
+      if (filedes[0] == -1)
+        {
+          _gpgrt_log_error ("failed to translate osfhandle %p\n", fds[0]);
+          CloseHandle (fds[1]);
+        }
+      else
+        {
+          filedes[1] = _open_osfhandle (handle_to_fd (fds[1]), O_APPEND);
+          if (filedes[1] == -1)
+            {
+              _gpgrt_log_error ("failed to translate osfhandle %p\n", fds[1]);
+              close (filedes[0]);
+              filedes[0] = -1;
+              CloseHandle (fds[1]);
+            }
+          else
+            err = 0;
+        }
+    }
+
+  if (! err && r_fp)
+    {
+      syshd.type = ES_SYSHD_HANDLE;
+      if (direction < 0)
+        {
+          syshd.u.handle = fds[0];
+          *r_fp = _gpgrt_sysopen (&syshd, nonblock? "r,nonblock" : "r");
+        }
+      else
+        {
+          syshd.u.handle = fds[1];
+          *r_fp = _gpgrt_sysopen (&syshd, nonblock? "w,nonblock" : "w");
+        }
+      if (!*r_fp)
+        {
+          err = _gpg_err_code_from_syserror ();
+          _gpgrt_log_error (_("error creating a stream for a pipe: %s\n"),
+                            _gpg_strerror (err));
+          close (filedes[0]);
+          close (filedes[1]);
+          filedes[0] = filedes[1] = -1;
+          return err;
+        }
+    }
+
+  return err;
+}
+
+
+/* Create a pipe.  The DIRECTION parameter gives the type of the created pipe:
+ *   DIRECTION < 0 := Inbound pipe: On Windows the write end is inheritable.
+ *   DIRECTION > 0 := Outbound pipe: On Windows the read end is inheritable.
+ * If R_FP is NULL a standard pipe and no stream is created, DIRECTION
+ * should then be 0.  */
+gpg_err_code_t
+_gpgrt_make_pipe (int filedes[2], estream_t *r_fp, int direction, int nonblock)
+{
+  if (r_fp && direction)
+    return do_create_pipe_and_estream (filedes, r_fp, direction, nonblock);
+  else
+    return do_create_pipe_and_estream (filedes, NULL, 0, 0);
+}
+
+
+/* Fork and exec the PGMNAME, see gpgrt-int.h for details.  */
+gpg_err_code_t
+_gpgrt_spawn_process (const char *pgmname, const char *argv[],
+                      int *except, void (*preexec)(void), unsigned int flags,
+                      estream_t *r_infp, estream_t *r_outfp, estream_t *r_errfp,
+                      pid_t *pid)
+{
+  gpg_err_code_t err;
+  SECURITY_ATTRIBUTES sec_attr;
+  PROCESS_INFORMATION pi =
+    {
+      NULL,      /* Returns process handle.  */
+      0,         /* Returns primary thread handle.  */
+      0,         /* Returns pid.  */
+      0          /* Returns tid.  */
+    };
+  STARTUPINFO si;
+  int cr_flags;
+  char *cmdline;
+  HANDLE inpipe[2]  = {INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE};
+  HANDLE outpipe[2] = {INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE};
+  HANDLE errpipe[2] = {INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE};
+  estream_t infp = NULL;
+  estream_t outfp = NULL;
+  estream_t errfp = NULL;
+  HANDLE nullhd[3] = {INVALID_HANDLE_VALUE,
+                      INVALID_HANDLE_VALUE,
+                      INVALID_HANDLE_VALUE};
+  int i;
+  es_syshd_t syshd;
+  int nonblock = !!(flags & GPGRT_SPAWN_NONBLOCK);
+  int ret;
+
+  (void)except; /* Not yet used.  */
+
+  if (r_infp)
+    *r_infp = NULL;
+  if (r_outfp)
+    *r_outfp = NULL;
+  if (r_errfp)
+    *r_errfp = NULL;
+  *pid = (pid_t)(-1); /* Always required.  */
+
+  if (r_infp)
+    {
+      if (create_inheritable_pipe (inpipe, INHERIT_READ))
+        {
+          err = GPG_ERR_GENERAL;
+          _gpgrt_log_error (_("error creating a pipe: %s\n"),
+                            _gpg_strerror (err));
+          return err;
+        }
+
+      syshd.type = ES_SYSHD_HANDLE;
+      syshd.u.handle = inpipe[1];
+      infp = _gpgrt_sysopen (&syshd, nonblock? "w,nonblock" : "w");
+      if (!infp)
+        {
+          err = _gpg_err_code_from_syserror ();
+          _gpgrt_log_error (_("error creating a stream for a pipe: %s\n"),
+                            _gpg_strerror (err));
+          CloseHandle (inpipe[0]);
+          CloseHandle (inpipe[1]);
+          inpipe[0] = inpipe[1] = INVALID_HANDLE_VALUE;
+          return err;
+        }
+    }
+
+  if (r_outfp)
+    {
+      if (create_inheritable_pipe (outpipe, INHERIT_WRITE))
+        {
+          err = GPG_ERR_GENERAL;
+          _gpgrt_log_error (_("error creating a pipe: %s\n"),
+                            _gpg_strerror (err));
+          return err;
+        }
+
+      syshd.type = ES_SYSHD_HANDLE;
+      syshd.u.handle = outpipe[0];
+      outfp = _gpgrt_sysopen (&syshd, nonblock? "r,nonblock" : "r");
+      if (!outfp)
+        {
+          err = _gpg_err_code_from_syserror ();
+          _gpgrt_log_error (_("error creating a stream for a pipe: %s\n"),
+                            _gpg_strerror (err));
+          CloseHandle (outpipe[0]);
+          CloseHandle (outpipe[1]);
+          outpipe[0] = outpipe[1] = INVALID_HANDLE_VALUE;
+          if (infp)
+            _gpgrt_fclose (infp);
+          else if (inpipe[1] != INVALID_HANDLE_VALUE)
+            CloseHandle (inpipe[1]);
+          if (inpipe[0] != INVALID_HANDLE_VALUE)
+            CloseHandle (inpipe[0]);
+          return err;
+        }
+    }
+
+  if (r_errfp)
+    {
+      if (create_inheritable_pipe (errpipe, INHERIT_WRITE))
+        {
+          err = GPG_ERR_GENERAL;
+          _gpgrt_log_error (_("error creating a pipe: %s\n"),
+                            _gpg_strerror (err));
+          return err;
+        }
+
+      syshd.type = ES_SYSHD_HANDLE;
+      syshd.u.handle = errpipe[0];
+      errfp = _gpgrt_sysopen (&syshd, nonblock? "r,nonblock" : "r");
+      if (!errfp)
+        {
+          err = _gpg_err_code_from_syserror ();
+          _gpgrt_log_error (_("error creating a stream for a pipe: %s\n"),
+                            _gpg_strerror (err));
+          CloseHandle (errpipe[0]);
+          CloseHandle (errpipe[1]);
+          errpipe[0] = errpipe[1] = INVALID_HANDLE_VALUE;
+          if (outfp)
+            _gpgrt_fclose (outfp);
+          else if (outpipe[0] != INVALID_HANDLE_VALUE)
+            CloseHandle (outpipe[0]);
+          if (outpipe[1] != INVALID_HANDLE_VALUE)
+            CloseHandle (outpipe[1]);
+          if (infp)
+            _gpgrt_fclose (infp);
+          else if (inpipe[1] != INVALID_HANDLE_VALUE)
+            CloseHandle (inpipe[1]);
+          if (inpipe[0] != INVALID_HANDLE_VALUE)
+            CloseHandle (inpipe[0]);
+          return err;
+        }
+    }
+
+  /* Prepare security attributes.  */
+  memset (&sec_attr, 0, sizeof sec_attr );
+  sec_attr.nLength = sizeof sec_attr;
+  sec_attr.bInheritHandle = FALSE;
+
+  /* Build the command line.  */
+  err = build_w32_commandline (pgmname, argv, &cmdline);
+  if (err)
+    return err;
+
+  if (inpipe[0] == INVALID_HANDLE_VALUE)
+    nullhd[0] = w32_open_null (0);
+  if (outpipe[1] == INVALID_HANDLE_VALUE)
+    nullhd[1] = w32_open_null (1);
+  if (errpipe[1] == INVALID_HANDLE_VALUE)
+    nullhd[2] = w32_open_null (1);
+
+  /* Start the process.  Note that we can't run the PREEXEC function
+     because this might change our own environment. */
+  (void)preexec;
+
+  memset (&si, 0, sizeof si);
+  si.cb = sizeof (si);
+  si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
+  si.wShowWindow = DEBUG_W32_SPAWN? SW_SHOW : SW_MINIMIZE;
+  si.hStdInput  = inpipe[0]  == INVALID_HANDLE_VALUE? nullhd[0] : inpipe[0];
+  si.hStdOutput = outpipe[1] == INVALID_HANDLE_VALUE? nullhd[1] : outpipe[1];
+  si.hStdError  = errpipe[1] == INVALID_HANDLE_VALUE? nullhd[2] : errpipe[1];
+
+  cr_flags = (CREATE_DEFAULT_ERROR_MODE
+              | ((flags & GPGRT_SPAWN_DETACHED)? DETACHED_PROCESS : 0)
+              | GetPriorityClass (GetCurrentProcess ())
+              | CREATE_SUSPENDED);
+  _gpgrt_log_debug ("CreateProcess, path='%s' cmdline='%s'\n",
+                    pgmname, cmdline);
+  ret = CreateProcess (pgmname,     /* Program to start.  */
+                      cmdline,       /* Command line arguments.  */
+                      &sec_attr,     /* Process security attributes.  */
+                      &sec_attr,     /* Thread security attributes.  */
+                      TRUE,          /* Inherit handles.  */
+                      cr_flags,      /* Creation flags.  */
+                      NULL,          /* Environment.  */
+                      NULL,          /* Use current drive/directory.  */
+                      &si,           /* Startup information. */
+                      &pi            /* Returns process information.  */
+                        );
+  if (!ret)
+    {
+      _gpgrt_log_error ("CreateProcess failed: ec=%d\n", (int)GetLastError ());
+      xfree (cmdline);
+      if (infp)
+        _gpgrt_fclose (infp);
+      else if (inpipe[1] != INVALID_HANDLE_VALUE)
+        CloseHandle (outpipe[1]);
+      if (inpipe[0] != INVALID_HANDLE_VALUE)
+        CloseHandle (inpipe[0]);
+      if (outfp)
+        _gpgrt_fclose (outfp);
+      else if (outpipe[0] != INVALID_HANDLE_VALUE)
+        CloseHandle (outpipe[0]);
+      if (outpipe[1] != INVALID_HANDLE_VALUE)
+        CloseHandle (outpipe[1]);
+      if (errfp)
+        _gpgrt_fclose (errfp);
+      else if (errpipe[0] != INVALID_HANDLE_VALUE)
+        CloseHandle (errpipe[0]);
+      if (errpipe[1] != INVALID_HANDLE_VALUE)
+        CloseHandle (errpipe[1]);
+      return GPG_ERR_GENERAL;
+    }
+  xfree (cmdline);
+  cmdline = NULL;
+
+  /* Close the inherited handles to /dev/null.  */
+  for (i=0; i < DIM (nullhd); i++)
+    if (nullhd[i] != INVALID_HANDLE_VALUE)
+      CloseHandle (nullhd[i]);
+
+  /* Close the inherited ends of the pipes.  */
+  if (inpipe[0] != INVALID_HANDLE_VALUE)
+    CloseHandle (inpipe[0]);
+  if (outpipe[1] != INVALID_HANDLE_VALUE)
+    CloseHandle (outpipe[1]);
+  if (errpipe[1] != INVALID_HANDLE_VALUE)
+    CloseHandle (errpipe[1]);
+
+  _gpgrt_log_debug ("CreateProcess ready: hProcess=%p hThread=%p"
+                    " dwProcessID=%d dwThreadId=%d\n",
+                    pi.hProcess, pi.hThread,
+                    (int) pi.dwProcessId, (int) pi.dwThreadId);
+  _gpgrt_log_debug ("                     outfp=%p errfp=%p\n", outfp, errfp);
+
+  if ((flags & GPGRT_SPAWN_RUN_ASFW))
+    {
+      /* Fixme: For unknown reasons AllowSetForegroundWindow returns
+       * an invalid argument error if we pass it the correct
+       * processID.  As a workaround we use -1 (ASFW_ANY).  */
+      if (!AllowSetForegroundWindow (ASFW_ANY /*pi.dwProcessId*/))
+        _gpgrt_log_info ("AllowSetForegroundWindow() failed: ec=%d\n",
+                         (int)GetLastError ());
+    }
+
+  /* Process has been created suspended; resume it now. */
+  _gpgrt_pre_syscall ();
+  ResumeThread (pi.hThread);
+  CloseHandle (pi.hThread);
+  _gpgrt_post_syscall ();
+
+  if (r_infp)
+    *r_infp = infp;
+  if (r_outfp)
+    *r_outfp = outfp;
+  if (r_errfp)
+    *r_errfp = errfp;
+
+  *pid = handle_to_pid (pi.hProcess);
+  return 0;
+}
+
+
+/* Fork and exec the PGMNAME using FDs, see gpgrt-int.h for details.  */
+gpg_err_code_t
+_gpgrt_spawn_process_fd (const char *pgmname, const char *argv[],
+                         int infd, int outfd, int errfd, pid_t *pid)
+{
+  gpg_err_code_t err;
+  SECURITY_ATTRIBUTES sec_attr;
+  PROCESS_INFORMATION pi = { NULL, 0, 0, 0 };
+  STARTUPINFO si;
+  char *cmdline;
+  int ret, i;
+  HANDLE stdhd[3];
+
+  /* Setup return values.  */
+  *pid = (pid_t)(-1);
+
+  /* Prepare security attributes.  */
+  memset (&sec_attr, 0, sizeof sec_attr );
+  sec_attr.nLength = sizeof sec_attr;
+  sec_attr.bInheritHandle = FALSE;
+
+  /* Build the command line.  */
+  err = build_w32_commandline (pgmname, argv, &cmdline);
+  if (err)
+    return err;
+
+  memset (&si, 0, sizeof si);
+  si.cb = sizeof (si);
+  si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
+  si.wShowWindow = DEBUG_W32_SPAWN? SW_SHOW : SW_MINIMIZE;
+  stdhd[0] = infd  == -1? w32_open_null (0) : INVALID_HANDLE_VALUE;
+  stdhd[1] = outfd == -1? w32_open_null (1) : INVALID_HANDLE_VALUE;
+  stdhd[2] = errfd == -1? w32_open_null (1) : INVALID_HANDLE_VALUE;
+  si.hStdInput  = infd  == -1? stdhd[0] : (void*)_get_osfhandle (infd);
+  si.hStdOutput = outfd == -1? stdhd[1] : (void*)_get_osfhandle (outfd);
+  si.hStdError  = errfd == -1? stdhd[2] : (void*)_get_osfhandle (errfd);
+
+  _gpgrt_log_debug ("CreateProcess, path='%s' cmdline='%s'\n",
+                    pgmname, cmdline);
+  ret = CreateProcess (pgmname,      /* Program to start.  */
+                      cmdline,       /* Command line arguments.  */
+                      &sec_attr,     /* Process security attributes.  */
+                      &sec_attr,     /* Thread security attributes.  */
+                      TRUE,          /* Inherit handles.  */
+                      (CREATE_DEFAULT_ERROR_MODE
+                       | GetPriorityClass (GetCurrentProcess ())
+                       | CREATE_SUSPENDED | DETACHED_PROCESS),
+                      NULL,          /* Environment.  */
+                      NULL,          /* Use current drive/directory.  */
+                      &si,           /* Startup information. */
+                      &pi            /* Returns process information.  */
+                      );
+  if (!ret)
+    {
+      _gpgrt_log_error ("CreateProcess failed: ec=%d\n", (int)GetLastError ());
+      err = GPG_ERR_GENERAL;
+    }
+  else
+    err = 0;
+
+  xfree (cmdline);
+
+  for (i=0; i < 3; i++)
+    if (stdhd[i] != INVALID_HANDLE_VALUE)
+      CloseHandle (stdhd[i]);
+
+  if (err)
+    return err;
+
+  _gpgrt_log_debug ("CreateProcess ready: hProcess=%p hThread=%p"
+                    " dwProcessID=%d dwThreadId=%d\n",
+                    pi.hProcess, pi.hThread,
+                    (int) pi.dwProcessId, (int) pi.dwThreadId);
+
+  /* Process has been created suspended; resume it now. */
+  ResumeThread (pi.hThread);
+  CloseHandle (pi.hThread);
+
+  *pid = handle_to_pid (pi.hProcess);
+  return 0;
+}
+
+
+/* See gpgrt-int.h for a description.  */
+gpg_err_code_t
+_gpgrt_wait_process (const char *pgmname, pid_t pid, int hang, int *r_exitcode)
+{
+  return _gpgrt_wait_processes (&pgmname, &pid, 1, hang, r_exitcode);
+}
+
+
+/* See gpgrt-int.h for a description.  */
+gpg_err_code_t
+_gpgrt_wait_processes (const char **pgmnames, pid_t *pids, size_t count,
+                       int hang, int *r_exitcodes)
+{
+  gpg_err_code_t ec = 0;
+  size_t i;
+  HANDLE *procs;
+  int code;
+
+  procs = xtrycalloc (count, sizeof *procs);
+  if (procs == NULL)
+    return _gpg_err_code_from_syserror ();
+
+  for (i = 0; i < count; i++)
+    {
+      if (r_exitcodes)
+        r_exitcodes[i] = -1;
+
+      if (pids[i] == (pid_t)(-1))
+        return GPG_ERR_INV_VALUE;
+
+      procs[i] = pid_to_handle (pids[i]);
+    }
+
+  _gpgrt_pre_syscall ();
+  code = WaitForMultipleObjects (count, procs, TRUE, hang? INFINITE : 0);
+  _gpgrt_post_syscall ();
+  switch (code)
+    {
+    case WAIT_TIMEOUT:
+      ec = GPG_ERR_TIMEOUT;
+      goto leave;
+
+    case WAIT_FAILED:
+      _gpgrt_log_error (_("waiting for processes to terminate failed: ec=%d\n"),
+                        (int)GetLastError ());
+      ec = GPG_ERR_GENERAL;
+      goto leave;
+
+    case WAIT_OBJECT_0:
+      for (i = 0; i < count; i++)
+        {
+          DWORD exc;
+
+          if (! GetExitCodeProcess (procs[i], &exc))
+            {
+              _gpgrt_log_error (_("error getting exit code of process %d:"
+                                  " ec=%d\n"),
+                                (int) pids[i], (int)GetLastError ());
+              ec = GPG_ERR_GENERAL;
+            }
+          else if (exc)
+            {
+              if (!r_exitcodes)
+                _gpgrt_log_error (_("error running '%s': exit status %d\n"),
+                                  pgmnames[i], (int)exc);
+              else
+                r_exitcodes[i] = (int)exc;
+              ec = GPG_ERR_GENERAL;
+            }
+          else
+            {
+              if (r_exitcodes)
+                r_exitcodes[i] = 0;
+            }
+        }
+      break;
+
+    default:
+      _gpgrt_log_debug ("WaitForMultipleObjects returned unexpected code %d\n",
+                        code);
+      ec = GPG_ERR_GENERAL;
+      break;
+    }
+
+ leave:
+  return ec;
+}
+
+
+/* See gpgrt-int.h for a description.  */
+gpg_err_code_t
+_gpgrt_spawn_process_detached (const char *pgmname, const char *argv[],
+                               const char *envp[] )
+{
+  gpg_err_code_t err;
+  SECURITY_ATTRIBUTES sec_attr;
+  PROCESS_INFORMATION pi =
+    {
+      NULL,      /* Returns process handle.  */
+      0,         /* Returns primary thread handle.  */
+      0,         /* Returns pid.  */
+      0          /* Returns tid.  */
+    };
+  STARTUPINFO si;
+  int cr_flags;
+  char *cmdline;
+  int ret;
+  gpg_err_code_t ec;
+
+  /* We don't use ENVP.  */
+  (void)envp;
+
+  ec = _gpgrt_access (pgmname, X_OK);
+  if (ec)
+    return ec;
+
+  /* Prepare security attributes.  */
+  memset (&sec_attr, 0, sizeof sec_attr );
+  sec_attr.nLength = sizeof sec_attr;
+  sec_attr.bInheritHandle = FALSE;
+
+  /* Build the command line.  */
+  err = build_w32_commandline (pgmname, argv, &cmdline);
+  if (err)
+    return err;
+
+  /* Start the process.  */
+  memset (&si, 0, sizeof si);
+  si.cb = sizeof (si);
+  si.dwFlags = STARTF_USESHOWWINDOW;
+  si.wShowWindow = DEBUG_W32_SPAWN? SW_SHOW : SW_MINIMIZE;
+
+  cr_flags = (CREATE_DEFAULT_ERROR_MODE
+              | GetPriorityClass (GetCurrentProcess ())
+              | CREATE_NEW_PROCESS_GROUP
+              | DETACHED_PROCESS);
+  _gpgrt_log_debug ("CreateProcess(detached), path='%s' cmdline='%s'\n",
+                    pgmname, cmdline);
+  ret = CreateProcess (pgmname,       /* Program to start.  */
+                      cmdline,       /* Command line arguments.  */
+                      &sec_attr,     /* Process security attributes.  */
+                      &sec_attr,     /* Thread security attributes.  */
+                      FALSE,         /* Inherit handles.  */
+                      cr_flags,      /* Creation flags.  */
+                      NULL,          /* Environment.  */
+                      NULL,          /* Use current drive/directory.  */
+                      &si,           /* Startup information. */
+                      &pi            /* Returns process information.  */
+                       );
+  if (!ret)
+    {
+      _gpgrt_log_error ("CreateProcess(detached) failed: ec=%d\n",
+                        (int)GetLastError ());
+      xfree (cmdline);
+      return GPG_ERR_GENERAL;
+    }
+  xfree (cmdline);
+  cmdline = NULL;
+
+  _gpgrt_log_debug ("CreateProcess(detached) ready: hProcess=%p hThread=%p"
+                    " dwProcessID=%d dwThreadId=%d\n",
+                    pi.hProcess, pi.hThread,
+                    (int) pi.dwProcessId, (int) pi.dwThreadId);
+
+  CloseHandle (pi.hThread);
+  CloseHandle (pi.hProcess);
+
+  return 0;
+}
+
+
+/* Kill a process; that is send an appropriate signal to the process.
+   gnupg_wait_process must be called to actually remove the process
+   from the system.  An invalid PID is ignored.  */
+void
+_gpgrt_kill_process (pid_t pid)
+{
+  if (pid != (pid_t) INVALID_HANDLE_VALUE)
+    {
+      HANDLE process = (HANDLE) pid;
+
+      /* Arbitrary error code.  */
+      _gpgrt_pre_syscall ();
+      TerminateProcess (process, 1);
+      _gpgrt_post_syscall ();
+    }
+}
+
+
+void
+_gpgrt_release_process (pid_t pid)
+{
+  if (pid != (pid_t)INVALID_HANDLE_VALUE)
+    {
+      HANDLE process = (HANDLE)pid;
+
+      CloseHandle (process);
+    }
+}
index b0efb3d..fb1bebf 100644 (file)
 #include "gettext.h"
 #include "err-codes.h"
 
+#if defined(ENABLE_NLS) && defined(HAVE_LANGINFO_CODESET)
+#include <langinfo.h>
+#endif
+
 /* Return a pointer to a string containing a description of the error
    code in the error value ERR.  This function is not thread-safe.  */
 const char *
@@ -96,8 +100,16 @@ system_strerror_r (int no, char *buf, size_t buflen)
 }
 
 #endif /* STRERROR_R_CHAR_P */
+#elif defined (HAVE_STRERROR_S)
+/* Now the Windows version.  */
+
+static int
+system_strerror_r (int no, char *buf, size_t buflen)
+{
+  return strerror_s (buf, buflen, no);
+}
 
-#else  /* HAVE_STRERROR_H */
+#else  /* ! HAVE_STRERROR_R && ! HAVE_STRERROR_S */
 /* Without strerror_r(), we can still provide a non-thread-safe
    version.  Maybe we are even lucky and the system's strerror() is
    already thread-safe.  */
@@ -161,9 +173,30 @@ _gpg_strerror_r (gpg_error_t err, char *buf, size_t buflen)
   errstr = dgettext (PACKAGE, msgstr + msgidx[msgidxof (code)]);
   errstr_len = strlen (errstr) + 1;
   cpy_len = errstr_len < buflen ? errstr_len : buflen;
+#if defined(ENABLE_NLS) && defined(HAVE_LANGINFO_CODESET)
+  /* Avoid truncation in the middle of "character" boundary.  */
+  if (buflen && errstr_len > buflen
+      && ((unsigned char)errstr[cpy_len-1] & 0xC0) == 0x80
+      && !strcasecmp (nl_langinfo (CODESET), "UTF-8"))
+    {
+      /* Go back to the boundary */
+      for (; cpy_len; cpy_len--)
+        if (((unsigned char)errstr[cpy_len-1] & 0xC0) != 0x80)
+          break;
+      memcpy (buf, errstr, cpy_len);
+      memset (buf+cpy_len, 0, buflen - cpy_len);
+    }
+  else
+    {
+      memcpy (buf, errstr, cpy_len);
+      if (buflen)
+        buf[buflen - 1] = '\0';
+    }
+#else
   memcpy (buf, errstr, cpy_len);
   if (buflen)
     buf[buflen - 1] = '\0';
+#endif
 
   return cpy_len == errstr_len ? 0 : ERANGE;
 }
diff --git a/src/stringutils.c b/src/stringutils.c
new file mode 100644 (file)
index 0000000..11a31ab
--- /dev/null
@@ -0,0 +1,221 @@
+/* stringutils.c - String helper functions.
+ * Copyright (C) 1997, 2014 Werner Koch
+ * Copyright (C) 2020 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include <config.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <stdarg.h>
+#include <errno.h>
+#ifdef HAVE_STAT
+# include <sys/stat.h>
+#endif
+#include <sys/types.h>
+
+#include "gpgrt-int.h"
+
+
+/* Helper for _gpgrt_fnameconcat.  The additional flag WANT_ABS tells
+ * whether an absolute file name is requested.  */
+char *
+_gpgrt_vfnameconcat (int want_abs, const char *first_part, va_list arg_ptr)
+{
+  const char *argv[32];
+  int argc;
+  size_t n;
+  int skip = 1;  /* Characters to skip from FIRST_PART.  */
+  char *home_buffer = NULL;
+  char *name, *home, *p;
+
+  /* Put all args into an array because we need to scan them twice.  */
+  n = strlen (first_part) + 1;
+  argc = 0;
+  while ((argv[argc] = va_arg (arg_ptr, const char *)))
+    {
+      n += strlen (argv[argc]) + 1;
+      if (argc >= DIM (argv)-1)
+        {
+          _gpg_err_set_errno (EINVAL);
+          return NULL;
+        }
+      argc++;
+    }
+  n++;
+
+  home = NULL;
+  if (*first_part == '~')
+    {
+      if (first_part[1] == '/' || !first_part[1])
+        {
+          /* This is the "~/" or "~" case.  */
+          home_buffer = _gpgrt_getenv ("HOME");
+          if (!home_buffer)
+            home_buffer = _gpgrt_getpwdir (NULL);
+          home = home_buffer;
+          if (home && *home)
+            n += strlen (home);
+        }
+      else
+        {
+          /* This is the "~username/" or "~username" case.  */
+          char *user;
+
+          user = _gpgrt_strdup (first_part+1);
+          if (!user)
+            return NULL;
+
+          p = strchr (user, '/');
+          if (p)
+            *p = 0;
+          skip = 1 + strlen (user);
+
+          home = home_buffer = _gpgrt_getpwdir (user);
+          xfree (user);
+          if (home)
+            n += strlen (home);
+          else
+            skip = 1;
+        }
+    }
+
+  name = xtrymalloc (n);
+  if (!name)
+    {
+      _gpgrt_free (home_buffer);
+      return NULL;
+    }
+
+  if (home)
+    p = stpcpy (stpcpy (name, home), first_part + skip);
+  else
+    p = stpcpy (name, first_part);
+
+  xfree (home_buffer);
+  home_buffer = NULL;
+
+  for (argc=0; argv[argc]; argc++)
+    {
+      /* Avoid a leading double slash if the first part was "/".  */
+      if (!argc && name[0] == '/' && !name[1])
+        p = stpcpy (p, argv[argc]);
+      else
+        p = stpcpy (stpcpy (p, "/"), argv[argc]);
+    }
+
+  if (want_abs)
+    {
+#ifdef HAVE_W32_SYSTEM
+      p = strchr (name, ':');
+      if (p)
+        p++;
+      else
+        p = name;
+#else
+      p = name;
+#endif
+      if (*p != '/'
+#ifdef HAVE_W32_SYSTEM
+          && *p != '\\'
+#endif
+          )
+        {
+          home = _gpgrt_getcwd ();
+          if (!home)
+            {
+              xfree (name);
+              return NULL;
+            }
+
+          n = strlen (home) + 1 + strlen (name) + 1;
+          home_buffer = xtrymalloc (n);
+          if (!home_buffer)
+            {
+              xfree (home);
+              xfree (name);
+              return NULL;
+            }
+
+          if (p == name)
+            p = home_buffer;
+          else /* Windows case.  */
+            {
+              memcpy (home_buffer, p, p - name + 1);
+              p = home_buffer + (p - name + 1);
+            }
+
+          /* Avoid a leading double slash if the cwd is "/".  */
+          if (home[0] == '/' && !home[1])
+            strcpy (stpcpy (p, "/"), name);
+          else
+            strcpy (stpcpy (stpcpy (p, home), "/"), name);
+
+          xfree (home);
+          xfree (name);
+          name = home_buffer;
+          /* Let's do a simple compression to catch the common case of
+           * a trailing "/.".  */
+          n = strlen (name);
+          if (n > 2 && name[n-2] == '/' && name[n-1] == '.')
+            name[n-2] = 0;
+        }
+    }
+
+#ifdef HAVE_W32_SYSTEM
+  for (p=name; *p; p++)
+    if (*p == '\\')
+      *p = '/';
+#endif
+  return name;
+}
+
+
+/* Construct a filename from the NULL terminated list of parts.  Tilde
+ * expansion is done for the first argument.  The caller must release
+ * the result using gpgrt_free; on error ERRNO is set and NULL
+ * returned.  */
+char *
+_gpgrt_fnameconcat (const char *first_part, ... )
+{
+  va_list arg_ptr;
+  char *result;
+
+  va_start (arg_ptr, first_part);
+  result = _gpgrt_vfnameconcat (0, first_part, arg_ptr);
+  va_end (arg_ptr);
+  return result;
+}
+
+
+/* Construct a filename from the NULL terminated list of parts.  Tilde
+ * expansion is done for the first argument.  The caller must release
+ * the result using gpgrt_free; on error ERRNO is set and NULL
+ * returned.  This version returns an absolute filename. */
+char *
+_gpgrt_absfnameconcat (const char *first_part, ... )
+{
+  va_list arg_ptr;
+  char *result;
+
+  va_start (arg_ptr, first_part);
+  result = _gpgrt_vfnameconcat (1, first_part, arg_ptr);
+  va_end (arg_ptr);
+  return result;
+}
diff --git a/src/syscall-clamp.c b/src/syscall-clamp.c
new file mode 100644 (file)
index 0000000..99748f4
--- /dev/null
@@ -0,0 +1,80 @@
+/* syscall-clamp.c - Syscall clamp related stuff
+ * Copyright (C) 2016, 2017 g10 Code GmbH
+ *
+ * This file is part of Libgpg-error.
+ *
+ * Libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * Libgpg-error 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1+
+ */
+
+#include <config.h>
+
+#include "gpgrt-int.h"
+
+/*
+ * Functions called before and after blocking syscalls.
+ * gpgrt_set_syscall_clamp is used to set them.
+ */
+static void (*pre_syscall_func)(void);
+static void (*post_syscall_func)(void);
+
+
+/*
+ * Register the syscall clamp.  These two functions are called
+ * immediately before and after a possible blocking system call.  This
+ * should be used before any I/O happens.  The function is commonly
+ * used with the nPth library:
+ *
+ *    gpgrt_set_syscall_clamp (npth_unprotect, npth_protect);
+ *
+ * These functions may not modify ERRNO.
+ *
+ * Setting the clamp is not thread-safe and should thus be done as
+ * early as possible.
+ */
+void
+_gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void))
+{
+  pre_syscall_func = pre;
+  post_syscall_func = post;
+}
+
+/*
+ * Return the current sycall clamp functions.  This can be used by
+ * other libraries which have blocking functions.
+ */
+void
+_gpgrt_get_syscall_clamp (void (**r_pre)(void), void (**r_post)(void))
+{
+  *r_pre  = pre_syscall_func;
+  *r_post = post_syscall_func;
+}
+
+
+/* Call this function before a blocking system or libc call.  */
+void
+_gpgrt_pre_syscall (void)
+{
+  if (pre_syscall_func)
+    pre_syscall_func ();
+}
+
+
+/* Call this function after a blocking system or libc call.  */
+void
+_gpgrt_post_syscall (void)
+{
+  if (post_syscall_func)
+    post_syscall_func ();
+}
diff --git a/src/syscfg/lock-obj-pub.aarch64-unknown-linux-gnu_ilp32.h b/src/syscfg/lock-obj-pub.aarch64-unknown-linux-gnu_ilp32.h
new file mode 100644 (file)
index 0000000..61239c3
--- /dev/null
@@ -0,0 +1,24 @@
+## lock-obj-pub.aarch64-unknown-linux-gnu_ilp32.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+  long _vers;
+  union {
+    volatile char _priv[32];
+    long _x_align;
+    long *_xp_align;
+  } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.ia64-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.ia64-unknown-linux-gnu.h
new file mode 100644 (file)
index 0000000..7cf980a
--- /dev/null
@@ -0,0 +1,25 @@
+## lock-obj-pub.ia64-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+  long _vers;
+  union {
+    volatile char _priv[40];
+    long _x_align;
+    long *_xp_align;
+  } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.mips64-unknown-linux-gnuabi64.h b/src/syscfg/lock-obj-pub.mips64-unknown-linux-gnuabi64.h
new file mode 100644 (file)
index 0000000..f571c4b
--- /dev/null
@@ -0,0 +1,25 @@
+## lock-obj-pub.mips64-unknown-linux-gnuabi64.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+  long _vers;
+  union {
+    volatile char _priv[40];
+    long _x_align;
+    long *_xp_align;
+  } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.riscv32-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.riscv32-unknown-linux-gnu.h
new file mode 100644 (file)
index 0000000..b5bdaf5
--- /dev/null
@@ -0,0 +1,23 @@
+## lock-obj-pub.riscv32-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+  long _vers;
+  union {
+    volatile char _priv[24];
+    long _x_align;
+    long *_xp_align;
+  } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.riscv64-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.riscv64-unknown-linux-gnu.h
new file mode 100644 (file)
index 0000000..8aab9d6
--- /dev/null
@@ -0,0 +1,25 @@
+## lock-obj-pub.riscv64-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+  long _vers;
+  union {
+    volatile char _priv[40];
+    long _x_align;
+    long *_xp_align;
+  } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0, \
+                                    0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/sysutils.c b/src/sysutils.c
new file mode 100644 (file)
index 0000000..8f70a66
--- /dev/null
@@ -0,0 +1,524 @@
+/* sysutils.c - Platform specific helper functions
+ * Copyright (C) 2017 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1+
+ */
+
+#include <config.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#ifdef HAVE_W32_SYSTEM
+# include <windows.h>
+#endif
+#ifdef HAVE_STAT
+# include <sys/stat.h>
+#endif
+#include <sys/types.h>
+#include <fcntl.h>
+#ifdef HAVE_PWD_H
+# include <pwd.h>
+#endif
+
+#include "gpgrt-int.h"
+
+
+#ifdef HAVE_W32_SYSTEM
+/* Return true if STRING has any 8 bit character.  */
+static int
+any8bitchar (const char *string)
+{
+  if (string)
+    for ( ; *string; string++)
+      if ((*string & 0x80))
+        return 1;
+  return 0;
+}
+#endif /*HAVE_W32_SYSTEM*/
+
+
+/* Return true if FD is valid.  */
+int
+_gpgrt_fd_valid_p (int fd)
+{
+  int d = dup (fd);
+  if (d < 0)
+    return 0;
+  close (d);
+  return 1;
+}
+
+
+/* Our variant of getenv.  The returned string must be freed.  If the
+ * environment variable does not exists NULL is returned and ERRNO set
+ * to 0.  */
+char *
+_gpgrt_getenv (const char *name)
+{
+  if (!name || !*name || strchr (name, '='))
+    {
+      _gpg_err_set_errno (EINVAL);
+      return NULL;
+    }
+
+#ifdef HAVE_W32_SYSTEM
+  {
+    int len, size;
+    char *result;
+
+    len = GetEnvironmentVariable (name, NULL, 0);
+    if (!len && GetLastError () == ERROR_ENVVAR_NOT_FOUND)
+      {
+        _gpg_err_set_errno (0);
+        return NULL;
+      }
+  again:
+    size = len;
+    result = _gpgrt_malloc (size);
+    if (!result)
+      return NULL;
+    len = GetEnvironmentVariable (name, result, size);
+    if (len >= size)
+      {
+        /* Changed in the meantime - retry.  */
+        _gpgrt_free (result);
+        goto again;
+      }
+    if (!len && GetLastError () == ERROR_ENVVAR_NOT_FOUND)
+      {
+        /* Deleted in the meantime.  */
+        _gpgrt_free (result);
+        _gpg_err_set_errno (0);
+        return NULL;
+      }
+    if (!len)
+      {
+        /* Other error.  FIXME: We need mapping fucntion. */
+        _gpgrt_free (result);
+        _gpg_err_set_errno (EIO);
+        return NULL;
+      }
+
+    return result;
+  }
+#else /*!HAVE_W32_SYSTEM*/
+  {
+    const char *s = getenv (name);
+    if (!s)
+      {
+        _gpg_err_set_errno (0);
+        return NULL;
+      }
+    return _gpgrt_strdup (s);
+  }
+#endif /*!HAVE_W32_SYSTEM*/
+}
+
+
+/* Wrapper around setenv so that we can have the same function in
+ * Windows and Unix.  In contrast to the standard setenv passing a
+ * VALUE as NULL and setting OVERWRITE will remove the envvar.  */
+gpg_err_code_t
+_gpgrt_setenv (const char *name, const char *value, int overwrite)
+{
+  if (!name || !*name || strchr (name, '='))
+    return GPG_ERR_EINVAL;
+
+#ifdef HAVE_W32_SYSTEM
+  /* Windows maintains (at least) two sets of environment variables.
+   * One set can be accessed by GetEnvironmentVariable and
+   * SetEnvironmentVariable.  This set is inherited by the children.
+   * The other set is maintained in the C runtime, and is accessed
+   * using getenv and putenv.  We try to keep them in sync by
+   * modifying both sets.  Note that gpgrt_getenv ignores the libc
+   * values - however, too much existing code still uses getenv.  */
+  {
+    int exists;
+    char tmpbuf[10];
+    char *buf;
+
+    if (!value && overwrite)
+      {
+        if (!SetEnvironmentVariable (name, NULL))
+          return GPG_ERR_EINVAL;
+        if (getenv (name))
+          {
+            /* Ugly: Leaking memory.  */
+            buf = _gpgrt_strdup (name);
+            if (!buf)
+              return _gpg_err_code_from_syserror ();
+            if (putenv (buf))
+              return _gpg_err_code_from_syserror ();
+          }
+        return 0;
+      }
+
+    exists = GetEnvironmentVariable (name, tmpbuf, sizeof tmpbuf);
+    if ((! exists || overwrite) && !SetEnvironmentVariable (name, value))
+      return GPG_ERR_EINVAL; /* (Might also be ENOMEM.) */
+    if (overwrite || !getenv (name))
+      {
+        /* Ugly: Leaking memory.  */
+        buf = _gpgrt_strconcat (name, "=", value, NULL);
+        if (!buf)
+          return _gpg_err_code_from_syserror ();
+        if (putenv (buf))
+          return _gpg_err_code_from_syserror ();
+      }
+    return 0;
+  }
+
+#else /*!HAVE_W32_SYSTEM*/
+
+# ifdef HAVE_SETENV
+
+  {
+    if (!value && overwrite)
+      {
+        if (unsetenv (name))
+          return _gpg_err_code_from_syserror ();
+      }
+    else
+      {
+        if (setenv (name, value ? value : "", overwrite))
+          return _gpg_err_code_from_syserror ();
+      }
+
+    return 0;
+  }
+
+# else /*!HAVE_SETENV*/
+
+# if __GNUC__
+#   warning no setenv - using putenv but leaking memory.
+# endif
+  {
+    char *buf;
+
+    if (!value && overwrite)
+      {
+        if (getenv (name))
+          {
+            buf = _gpgrt_strdup (name);
+            if (!buf)
+              return _gpg_err_code_from_syserror ();
+            if (putenv (buf))
+              return -1;
+          }
+      }
+    else if (overwrite || !getenv (name))
+      {
+        buf = _gpgrt_strconcat (name, "=", value, NULL);
+        if (!buf)
+          return _gpg_err_code_from_syserror ();
+        if (putenv (buf))
+          return _gpg_err_code_from_syserror ();
+      }
+
+    return 0;
+  }
+# endif /*!HAVE_SETENV*/
+#endif /*!HAVE_W32_SYSTEM*/
+}
+
+
+#ifndef HAVE_W32_SYSTEM
+static mode_t
+modestr_to_mode (const char *modestr)
+{
+  mode_t mode = 0;
+
+  if (modestr && *modestr)
+    {
+      modestr++;
+      if (*modestr && *modestr++ == 'r')
+        mode |= S_IRUSR;
+      if (*modestr && *modestr++ == 'w')
+        mode |= S_IWUSR;
+      if (*modestr && *modestr++ == 'x')
+        mode |= S_IXUSR;
+      if (*modestr && *modestr++ == 'r')
+        mode |= S_IRGRP;
+      if (*modestr && *modestr++ == 'w')
+        mode |= S_IWGRP;
+      if (*modestr && *modestr++ == 'x')
+        mode |= S_IXGRP;
+      if (*modestr && *modestr++ == 'r')
+        mode |= S_IROTH;
+      if (*modestr && *modestr++ == 'w')
+        mode |= S_IWOTH;
+      if (*modestr && *modestr++ == 'x')
+        mode |= S_IXOTH;
+    }
+
+  return mode;
+}
+#endif
+
+
+/* A wrapper around mkdir which takes a string for the mode argument.
+ * This makes it easier to handle the mode argument which is not
+ * defined on all systems.  The format of the modestring is
+ *
+ *    "-rwxrwxrwx"
+ *
+ * '-' is a don't care or not set.  'r', 'w', 'x' are read allowed,
+ * write allowed, execution allowed with the first group for the user,
+ * the second for the group and the third for all others.  If the
+ * string is shorter than above the missing mode characters are meant
+ * to be not set.
+ *
+ * Note that in addition to returning an gpg-error error code ERRNO is
+ * also set by this function.
+ */
+gpg_err_code_t
+_gpgrt_mkdir (const char *name, const char *modestr)
+{
+#ifdef HAVE_W32_SYSTEM
+  wchar_t *wname;
+  gpg_err_code_t ec;
+  (void)modestr;
+
+  /* Note: Fixme: We should set appropriate permissions.  */
+  wname = _gpgrt_utf8_to_wchar (name);
+  if (!wname)
+    return _gpg_err_code_from_syserror ();
+  if (!CreateDirectoryW (wname, NULL))
+    {
+      _gpgrt_w32_set_errno (-1);
+      ec = _gpg_err_code_from_syserror ();
+    }
+  else
+    ec = 0;
+  _gpgrt_free_wchar (wname);
+  return ec;
+#elif MKDIR_TAKES_ONE_ARG
+  (void)modestr;
+  if (mkdir (name))
+    return _gpg_err_code_from_syserror ();
+  return 0;
+#else
+  if (mkdir (name, modestr_to_mode (modestr)))
+    return _gpg_err_code_from_syserror ();
+  return 0;
+#endif
+}
+
+
+/* A simple wrapper around chdir.  NAME is expected to be utf8
+ * encoded.
+ * Note that in addition to returning an gpg-error error code ERRNO is
+ * also set by this function.  */
+gpg_err_code_t
+_gpgrt_chdir (const char *name)
+{
+#ifdef HAVE_W32_SYSTEM
+  wchar_t *wname;
+  gpg_err_code_t ec;
+
+  wname = _gpgrt_utf8_to_wchar (name);
+  if (!wname)
+    return _gpg_err_code_from_syserror ();
+  if (!SetCurrentDirectoryW (wname))
+    {
+      _gpgrt_w32_set_errno (-1);
+      ec = _gpg_err_code_from_syserror ();
+    }
+  else
+    ec = 0;
+  _gpgrt_free_wchar (wname);
+  return ec;
+
+#else /*!HAVE_W32_SYSTEM*/
+  if (chdir (name))
+    return _gpg_err_code_from_syserror ();
+  return 0;
+#endif /*!HAVE_W32_SYSTEM*/
+}
+
+
+/* Return the current working directory as a malloced string.  Return
+ * NULL and sets ERRNO on error.  */
+char *
+_gpgrt_getcwd (void)
+{
+#ifdef HAVE_W32CE_SYSTEM
+
+  return xtrystrdup ("/");
+
+#elif defined(HAVE_W32_SYSTEM)
+  wchar_t wbuffer[MAX_PATH + sizeof(wchar_t)];
+  DWORD wlen;
+  char *buf, *p;
+
+  wlen = GetCurrentDirectoryW (MAX_PATH, wbuffer);
+  if (!wlen)
+    {
+      _gpgrt_w32_set_errno (-1);
+      return NULL;
+
+    }
+  else if (wlen > MAX_PATH)
+    {
+      _gpg_err_set_errno (ENAMETOOLONG);
+      return NULL;
+    }
+  buf = _gpgrt_wchar_to_utf8 (wbuffer, wlen);
+  if (buf)
+    {
+      for (p=buf; *p; p++)
+        if (*p == '\\')
+          *p = '/';
+    }
+  return buf;
+
+#else /*Unix*/
+  char *buffer;
+  size_t size = 100;
+
+  for (;;)
+    {
+      buffer = xtrymalloc (size+1);
+      if (!buffer)
+        return NULL;
+      if (getcwd (buffer, size) == buffer)
+        return buffer;
+      xfree (buffer);
+      if (errno != ERANGE)
+        return NULL;
+      size *= 2;
+    }
+#endif /*Unix*/
+}
+
+
+/* Wrapper around access to handle file name encoding under Windows.
+ * Returns 0 if FNAME can be accessed in MODE or an error code.  ERRNO
+ * is also set on error. */
+gpg_err_code_t
+_gpgrt_access (const char *fname, int mode)
+{
+  gpg_err_code_t ec;
+
+#ifdef HAVE_W32_SYSTEM
+  if (any8bitchar (fname))
+    {
+      wchar_t *wfname;
+
+      wfname = _gpgrt_utf8_to_wchar (fname);
+      if (!wfname)
+        ec = _gpg_err_code_from_syserror ();
+      else
+        {
+          ec = _waccess (wfname, mode)? _gpg_err_code_from_syserror () : 0;
+          _gpgrt_free_wchar (wfname);
+        }
+    }
+  else
+#endif /*HAVE_W32_SYSTEM*/
+    ec = access (fname, mode)? _gpg_err_code_from_syserror () : 0;
+
+  return ec;
+}
+
+
+
+/* Get the standard home directory for user NAME. If NAME is NULL the
+ * directory for the current user is returned.  Caller must release
+ * the returned string.  */
+char *
+_gpgrt_getpwdir (const char *name)
+{
+  char *result = NULL;
+#ifdef HAVE_PWD_H
+  struct passwd *pwd = NULL;
+
+  if (name)
+    {
+#ifdef HAVE_GETPWNAM
+      /* Fixme: We should use getpwnam_r if available.  */
+      pwd = getpwnam (name);
+#endif
+    }
+  else
+    {
+#ifdef HAVE_GETPWUID
+      /* Fixme: We should use getpwuid_r if available.  */
+      pwd = getpwuid (getuid());
+#endif
+    }
+  if (pwd)
+    {
+      result = _gpgrt_strdup (pwd->pw_dir);
+    }
+#else /*!HAVE_PWD_H*/
+  /* No support at all.  */
+  (void)name;
+#endif /*HAVE_PWD_H*/
+  return result;
+}
+
+
+/* Return a malloced copy of the current user's account name; this may
+ * return NULL on memory failure.  */
+char *
+_gpgrt_getusername (void)
+{
+  char *result = NULL;
+
+#ifdef HAVE_W32_SYSTEM
+  wchar_t wtmp[1];
+  wchar_t *wbuf;
+  DWORD wsize = 1;
+  char *buf;
+
+  GetUserNameW (wtmp, &wsize);
+  wbuf = _gpgrt_malloc (wsize * sizeof *wbuf);
+  if (!wbuf)
+    {
+      _gpgrt_w32_set_errno (-1);
+      return NULL;
+    }
+  if (!GetUserNameW (wbuf, &wsize))
+    {
+      _gpgrt_w32_set_errno (-1);
+      xfree (wbuf);
+      return NULL;
+    }
+  buf = _gpgrt_wchar_to_utf8 (wbuf, wsize);
+  xfree (wbuf);
+  return buf;
+
+#else /* !HAVE_W32_SYSTEM */
+
+# if defined(HAVE_PWD_H) && defined(HAVE_GETPWUID)
+  struct passwd *pwd;
+
+  pwd = getpwuid (getuid());
+  if (pwd)
+    {
+      result = _gpgrt_strdup (pwd->pw_name);
+    }
+
+# endif /*HAVE_PWD_H*/
+
+#endif /* !HAVE_W32_SYSTEM */
+
+  return result;
+}
index f064cce..c650a99 100644 (file)
@@ -20,7 +20,5 @@
 #ifndef THREAD_H
 #define THREAD_H
 
-void _gpgrt_thread_set_syscall_clamp (void (*pre)(void), void (*post)(void));
-
 
 #endif /*THREAD_H*/
index eaeedf8..c2b350d 100644 (file)
@@ -38,8 +38,8 @@ cright_blurb (void)
 {
   static const char blurb[] =
     "\n\n"
-    "This is Libgpg-error " PACKAGE_VERSION " - An error code library\n"
-    "Copyright 2003-2004, 2010, 2013-2017 g10 Code GmbH\n"
+    "This is Libgpg-error " PACKAGE_VERSION " - A runtime library\n"
+    "Copyright 2001-2021 g10 Code GmbH\n"
     "\n"
     "(" BUILD_REVISION " " BUILD_TIMESTAMP ")\n"
     "\n\n";
@@ -47,6 +47,10 @@ cright_blurb (void)
 }
 
 
+/* This function parses the first portion of the version number S and
+ * stores it at NUMBER.  On success, this function returns a pointer
+ * into S starting with the first character, which is not part of the
+ * initial number portion; on failure, NULL is returned.  */
 static const char*
 parse_version_number (const char *s, int *number)
 {
@@ -64,45 +68,161 @@ parse_version_number (const char *s, int *number)
 }
 
 
+/* This function breaks up the complete string-representation of the
+ * version number S, which is of the following struture: <major
+ * number>.<minor number>.<micro number><patch level>.  The major,
+ * minor and micro number components will be stored in *MAJOR, *MINOR
+ * and *MICRO.  If MINOR or MICRO is NULL the version number is
+ * assumed to have just 1 respective 2 parts.
+ *
+ * On success, the last component, the patch level, will be returned;
+ * in failure, NULL will be returned.  */
 static const char *
-parse_version_string (const char *s, int *major, int *minor)
+parse_version_string (const char *s, int *major, int *minor, int *micro)
 {
   s = parse_version_number (s, major);
-  if (!s || *s != '.')
-    return NULL;
-  s++;
-  s = parse_version_number (s, minor);
   if (!s)
     return NULL;
-  return s;  /* Patchlevel.  */
+  if (!minor)
+    {
+      if (*s == '.')
+        s++;
+    }
+  else
+    {
+      if (*s != '.')
+        return NULL;
+      s++;
+      s = parse_version_number (s, minor);
+      if (!s)
+        return NULL;
+      if (!micro)
+        {
+          if (*s == '.')
+            s++;
+        }
+      else
+        {
+          if (*s != '.')
+            return NULL;
+          s++;
+          s = parse_version_number (s, micro);
+          if (!s)
+            return NULL;
+        }
+    }
+  return s; /* patchlevel */
 }
 
 
-static const char *
-compare_versions (const char *my_version, const char *req_version)
+/* Helper for _gpgrt_cmp_version.  */
+static int
+do_cmp_version (const char *a, const char *b, int level)
 {
-  int my_major, my_minor;
-  int rq_major, rq_minor;
-  const char *my_plvl, *rq_plvl;
+  int a_major, a_minor, a_micro;
+  int b_major, b_minor, b_micro;
+  const char *a_plvl, *b_plvl;
+  int r;
+  int ignore_plvl;
+  int positive, negative;
+
+  if (level < 0)
+    {
+      positive = -1;
+      negative = 1;
+      level = 0 - level;
+    }
+  else
+    {
+      positive = 1;
+      negative = -1;
+    }
+  if ((ignore_plvl = (level > 9)))
+    level %= 10;
+
+  a_major = a_minor = a_micro = 0;
+  a_plvl = parse_version_string (a, &a_major,
+                                 level > 1? &a_minor : NULL,
+                                 level > 2? &a_micro : NULL);
+  if (!a_plvl)
+    a_major = a_minor = a_micro = 0; /* Error.  */
+
+  b_major = b_minor = b_micro = 0;
+  b_plvl = parse_version_string (b, &b_major,
+                                 level > 1? &b_minor : NULL,
+                                 level > 2? &b_micro : NULL);
+  if (!b_plvl)
+    b_major = b_minor = b_micro = 0;
+
+  if (!ignore_plvl)
+    {
+      if (!a_plvl && !b_plvl)
+        return negative;  /* Put invalid strings at the end.  */
+      if (a_plvl && !b_plvl)
+        return positive;
+      if (!a_plvl && b_plvl)
+        return negative;
+    }
 
-  if (!req_version)
-    return my_version;
-  if (!my_version)
-    return NULL;
+  if (a_major > b_major)
+    return positive;
+  if (a_major < b_major)
+    return negative;
+
+  if (a_minor > b_minor)
+    return positive;
+  if (a_minor < b_minor)
+    return negative;
+
+  if (a_micro > b_micro)
+    return positive;
+  if (a_micro < b_micro)
+    return negative;
 
-  my_plvl = parse_version_string (my_version, &my_major, &my_minor);
-  if (!my_plvl)
-    return NULL;       /* Very strange: our own version is bogus.  */
-  rq_plvl = parse_version_string(req_version, &rq_major, &rq_minor);
-  if (!rq_plvl)
-    return NULL;       /* Requested version string is invalid.  */
+  if (ignore_plvl)
+    return 0;
 
-  if (my_major > rq_major
-      || (my_major == rq_major && my_minor >= rq_minor))
+  for (; *a_plvl && *b_plvl; a_plvl++, b_plvl++)
     {
-      return my_version;
-    }
-  return NULL;
+      if (*a_plvl == '.' && *b_plvl == '.')
+        {
+          r = strcmp (a_plvl, b_plvl);
+          if (!r)
+            return 0;
+          else if ( r > 0 )
+            return positive;
+          else
+            return negative;
+        }
+      else if (*a_plvl == '.')
+        return negative; /* B is larger. */
+      else if (*b_plvl == '.')
+        return positive; /* A is larger. */
+      else if (*a_plvl != *b_plvl)
+        break;
+        }
+  if (*a_plvl == *b_plvl)
+    return 0;
+  else if ((*(signed char *)a_plvl - *(signed char *)b_plvl) > 0)
+    return positive;
+  else
+    return negative;
+}
+
+
+/* Compare function for version strings.  The return value is
+ * like strcmp().  LEVEL may be
+ *   0 - reserved
+ *   1 - format is "<major><patchlevel>".
+ *   2 - format is "<major>.<minor><patchlevel>".
+ *   3 - format is "<major>.<minor>.<micro><patchlevel>".
+ * To ignore the patchlevel in the comparison add 10 to LEVEL.  To get
+ * a reverse sorting order use a negative number.
+ */
+int
+_gpgrt_cmp_version (const char *a, const char *b, int level)
+{
+  return do_cmp_version (a, b, level);
 }
 
 
@@ -115,7 +235,12 @@ compare_versions (const char *my_version, const char *req_version)
 const char *
 _gpg_error_check_version (const char *req_version)
 {
+  const char *my_version = PACKAGE_VERSION;
+
   if (req_version && req_version[0] == 1 && req_version[1] == 1)
     return cright_blurb ();
-  return compare_versions (PACKAGE_VERSION, req_version);
+  if (!req_version)
+    return my_version;
+  return _gpgrt_cmp_version
+    (my_version, req_version, 12) >= 0 ? my_version : NULL;
 }
index 0986a42..d54210b 100644 (file)
@@ -8,6 +8,7 @@
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * SPDX-License-Identifier: FSFULLR
  */
 
 /* This file is processed by configure to create versioninfo.rc */
@@ -39,7 +40,7 @@ BEGIN
             VALUE "FileDescription", "libgpg-error - Common error codes\0"
             VALUE "FileVersion", "@LIBGPG_ERROR_LT_CURRENT@.@LIBGPG_ERROR_LT_AGE@.@LIBGPG_ERROR_LT_REVISION@.@BUILD_REVISION@\0"
             VALUE "InternalName", "libgpg-error\0"
-            VALUE "LegalCopyright", "Copyright © 2017 g10 Code GmbH\0"
+            VALUE "LegalCopyright", "Copyright © 2021 g10 Code GmbH\0"
             VALUE "LegalTrademarks", "\0"
             VALUE "OriginalFilename", "libgpg-error.dll\0"
             VALUE "PrivateBuild", "\0"
index b637e7a..03a6c45 100644 (file)
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1+
  */
 
 #include <config.h>
 #include <stdarg.h>
+#include <stdlib.h> /* For abort().  */
 
 #define _GPGRT_INCL_BY_VISIBILITY_C 1
 #include "gpgrt-int.h"
@@ -78,6 +80,18 @@ gpg_err_deinit (int mode)
   _gpg_err_deinit (mode);
 }
 
+void
+gpgrt_add_emergency_cleanup (void (*f)(void))
+{
+  _gpgrt_add_emergency_cleanup (f);
+}
+
+void
+gpgrt_abort (void)
+{
+  _gpgrt_abort ();
+}
+
 const char *
 gpg_error_check_version (const char *req_version)
 {
@@ -237,6 +251,12 @@ gpgrt_fclose (estream_t stream)
 }
 
 int
+gpgrt_fcancel (estream_t stream)
+{
+  return _gpgrt_fcancel (stream);
+}
+
+int
 gpgrt_fclose_snatch (estream_t stream, void **r_buffer, size_t *r_buflen)
 {
   return _gpgrt_fclose_snatch (stream, r_buffer, r_buflen);
@@ -388,6 +408,12 @@ gpgrt_rewind (estream_t stream)
 }
 
 int
+gpgrt_ftruncate (estream_t stream, gpgrt_off_t length)
+{
+  return _gpgrt_ftruncate (stream, length);
+}
+
+int
 gpgrt_fgetc (estream_t stream)
 {
   return _gpgrt_fgetc (stream);
@@ -502,19 +528,12 @@ gpgrt_read_line (estream_t stream,
                            max_length);
 }
 
-void
-gpgrt_free (void *a)
-{
-  if (a)
-    _gpgrt_free (a);
-}
-
 int
 gpgrt_vfprintf (estream_t _GPGRT__RESTRICT stream,
                 const char *_GPGRT__RESTRICT format,
                 va_list ap)
 {
-  return _gpgrt_vfprintf (stream, format, ap);
+  return _gpgrt_vfprintf (stream, NULL, NULL, format, ap);
 }
 
 int
@@ -522,7 +541,7 @@ gpgrt_vfprintf_unlocked (estream_t _GPGRT__RESTRICT stream,
                           const char *_GPGRT__RESTRICT format,
                           va_list ap)
 {
-  return _gpgrt_vfprintf_unlocked (stream, format, ap);
+  return _gpgrt_vfprintf_unlocked (stream, NULL, NULL, format, ap);
 }
 
 int
@@ -532,7 +551,7 @@ gpgrt_printf (const char *_GPGRT__RESTRICT format, ...)
   int rc;
 
   va_start (ap, format);
-  rc = _gpgrt_vfprintf (es_stdout, format, ap);
+  rc = _gpgrt_vfprintf (es_stdout, NULL, NULL, format, ap);
   va_end (ap);
 
   return rc;
@@ -545,7 +564,7 @@ gpgrt_printf_unlocked (const char *_GPGRT__RESTRICT format, ...)
   int rc;
 
   va_start (ap, format);
-  rc = _gpgrt_vfprintf_unlocked (es_stdout, format, ap);
+  rc = _gpgrt_vfprintf_unlocked (es_stdout, NULL, NULL, format, ap);
   va_end (ap);
 
   return rc;
@@ -559,7 +578,7 @@ gpgrt_fprintf (estream_t _GPGRT__RESTRICT stream,
   int rc;
 
   va_start (ap, format);
-  rc = _gpgrt_vfprintf (stream, format, ap);
+  rc = _gpgrt_vfprintf (stream, NULL, NULL, format, ap);
   va_end (ap);
 
   return rc;
@@ -573,7 +592,37 @@ gpgrt_fprintf_unlocked (estream_t _GPGRT__RESTRICT stream,
   int rc;
 
   va_start (ap, format);
-  rc = _gpgrt_vfprintf_unlocked (stream, format, ap);
+  rc = _gpgrt_vfprintf_unlocked (stream, NULL, NULL, format, ap);
+  va_end (ap);
+
+  return rc;
+}
+
+int
+gpgrt_fprintf_sf (estream_t _GPGRT__RESTRICT stream,
+                  gpgrt_string_filter_t sf, void *sfvalue,
+                  const char *_GPGRT__RESTRICT format, ...)
+{
+  va_list ap;
+  int rc;
+
+  va_start (ap, format);
+  rc = _gpgrt_vfprintf (stream, sf, sfvalue, format, ap);
+  va_end (ap);
+
+  return rc;
+}
+
+int
+gpgrt_fprintf_sf_unlocked (estream_t _GPGRT__RESTRICT stream,
+                           gpgrt_string_filter_t sf, void *sfvalue,
+                           const char *_GPGRT__RESTRICT format, ...)
+{
+  va_list ap;
+  int rc;
+
+  va_start (ap, format);
+  rc = _gpgrt_vfprintf_unlocked (stream, sf, sfvalue, format, ap);
   va_end (ap);
 
   return rc;
@@ -712,6 +761,118 @@ gpgrt_vsnprintf (char *buf, size_t bufsize,
   return _gpgrt_estream_vsnprintf (buf, bufsize, format, arg_ptr);
 }
 
+
+\f
+void *
+gpgrt_realloc (void *a, size_t n)
+{
+  return _gpgrt_realloc (a, n);
+}
+
+void *
+gpgrt_reallocarray (void *a, size_t oldnmemb, size_t nmemb, size_t size)
+{
+  return _gpgrt_reallocarray (a, oldnmemb, nmemb, size);
+}
+
+void *
+gpgrt_malloc (size_t n)
+{
+  return _gpgrt_malloc (n);
+}
+
+void *
+gpgrt_calloc (size_t n, size_t m)
+{
+  return _gpgrt_calloc (n, m);
+}
+
+char *
+gpgrt_strdup (const char *string)
+{
+  return _gpgrt_strdup (string);
+}
+
+char *
+gpgrt_strconcat (const char *s1, ...)
+{
+  va_list arg_ptr;
+  char *result;
+
+  if (!s1)
+    result = _gpgrt_strdup ("");
+  else
+    {
+      va_start (arg_ptr, s1);
+      result = _gpgrt_strconcat_core (s1, arg_ptr);
+      va_end (arg_ptr);
+    }
+  return result;
+}
+
+void
+gpgrt_free (void *a)
+{
+  if (a)
+    _gpgrt_free (a);
+}
+
+char *
+gpgrt_getenv (const char *name)
+{
+  return _gpgrt_getenv (name);
+}
+
+gpg_err_code_t
+gpgrt_setenv (const char *name, const char *value, int overwrite)
+{
+  return _gpgrt_setenv (name, value, overwrite);
+}
+
+gpg_err_code_t
+gpgrt_mkdir (const char *name, const char *modestr)
+{
+  return _gpgrt_mkdir (name, modestr);
+}
+
+gpg_err_code_t
+gpgrt_chdir (const char *name)
+{
+  return _gpgrt_chdir (name);
+}
+
+char *
+gpgrt_getcwd (void)
+{
+  return _gpgrt_getcwd ();
+}
+
+gpg_err_code_t
+gpgrt_access (const char *fname, int mode)
+{
+  return _gpgrt_access (fname, mode);
+}
+
+
+\f
+gpgrt_b64state_t
+gpgrt_b64enc_start (estream_t stream, const char *title)
+{
+  return _gpgrt_b64enc_start (stream, title);
+}
+
+gpg_err_code_t
+gpgrt_b64enc_write (gpgrt_b64state_t state, const void *buffer, size_t nbytes)
+{
+  return _gpgrt_b64enc_write (state, buffer, nbytes);
+}
+
+gpg_err_code_t
+gpgrt_b64enc_finish (gpgrt_b64state_t state)
+{
+  return _gpgrt_b64enc_finish (state);
+}
+
 gpgrt_b64state_t
 gpgrt_b64dec_start (const char *title)
 {
@@ -730,3 +891,360 @@ gpgrt_b64dec_finish (gpgrt_b64state_t state)
 {
   return _gpgrt_b64dec_finish (state);
 }
+
+
+\f
+int
+gpgrt_get_errorcount (int clear)
+{
+  return _gpgrt_get_errorcount (clear);
+}
+
+void
+gpgrt_inc_errorcount (void)
+{
+  _gpgrt_inc_errorcount ();
+}
+
+void
+gpgrt_log_set_sink (const char *name, estream_t stream, int fd)
+{
+  _gpgrt_log_set_sink (name, stream, fd);
+}
+
+void
+gpgrt_log_set_socket_dir_cb (const char *(*fnc)(void))
+{
+  _gpgrt_log_set_socket_dir_cb (fnc);
+}
+
+void
+gpgrt_log_set_pid_suffix_cb (int (*cb)(unsigned long *r_value))
+{
+  _gpgrt_log_set_pid_suffix_cb (cb);
+}
+
+void
+gpgrt_log_set_prefix (const char *text, unsigned int flags)
+{
+  _gpgrt_log_set_prefix (text, flags);
+}
+
+const char *
+gpgrt_log_get_prefix (unsigned int *flags)
+{
+  return _gpgrt_log_get_prefix (flags);
+}
+
+int
+gpgrt_log_test_fd (int fd)
+{
+  return _gpgrt_log_test_fd (fd);
+}
+
+int
+gpgrt_log_get_fd (void)
+{
+  return _gpgrt_log_get_fd ();
+}
+
+estream_t
+gpgrt_log_get_stream (void)
+{
+  return _gpgrt_log_get_stream ();
+}
+
+void
+gpgrt_log (int level, const char *fmt, ...)
+{
+  va_list arg_ptr ;
+
+  va_start (arg_ptr, fmt) ;
+  _gpgrt_logv (level, fmt, arg_ptr);
+  va_end (arg_ptr);
+}
+
+void
+gpgrt_logv (int level, const char *fmt, va_list arg_ptr)
+{
+  _gpgrt_logv (level, fmt, arg_ptr);
+}
+
+void
+gpgrt_logv_prefix (int level, const char *prefix,
+                    const char *fmt, va_list arg_ptr)
+{
+  _gpgrt_logv_prefix (level, prefix, fmt, arg_ptr);
+}
+
+void
+gpgrt_log_string (int level, const char *string)
+{
+  _gpgrt_log_string (level, string);
+}
+
+void
+gpgrt_log_info (const char *fmt, ...)
+{
+  va_list arg_ptr;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv (GPGRT_LOGLVL_INFO, fmt, arg_ptr);
+  va_end (arg_ptr);
+}
+
+void
+gpgrt_log_error (const char *fmt, ...)
+{
+  va_list arg_ptr;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv (GPGRT_LOGLVL_ERROR, fmt, arg_ptr);
+  va_end (arg_ptr);
+}
+
+void
+gpgrt_log_fatal (const char *fmt, ...)
+{
+  va_list arg_ptr;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv (GPGRT_LOGLVL_FATAL, fmt, arg_ptr);
+  va_end (arg_ptr);
+  _gpgrt_abort (); /* Never called; just to make the compiler happy.  */
+}
+
+void
+gpgrt_log_bug (const char *fmt, ...)
+{
+  va_list arg_ptr;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv (GPGRT_LOGLVL_BUG, fmt, arg_ptr);
+  va_end (arg_ptr);
+  _gpgrt_abort (); /* Never called; just to make the compiler happy.  */
+}
+
+void
+gpgrt_log_debug (const char *fmt, ...)
+{
+  va_list arg_ptr ;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv (GPGRT_LOGLVL_DEBUG, fmt, arg_ptr);
+  va_end (arg_ptr);
+}
+
+void
+gpgrt_log_debug_string (const char *string, const char *fmt, ...)
+{
+  va_list arg_ptr ;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv_internal (GPGRT_LOGLVL_DEBUG, 0, string, NULL, fmt, arg_ptr);
+  va_end (arg_ptr);
+}
+
+void
+gpgrt_log_printf (const char *fmt, ...)
+{
+  va_list arg_ptr;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv (fmt ? GPGRT_LOGLVL_CONT : GPGRT_LOGLVL_BEGIN, fmt, arg_ptr);
+  va_end (arg_ptr);
+}
+
+void
+gpgrt_log_flush (void)
+{
+  _gpgrt_log_flush ();
+}
+
+void
+gpgrt_log_printhex (const void *buffer, size_t length, const char *fmt, ...)
+{
+  va_list arg_ptr;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv_printhex (buffer, length, fmt, arg_ptr);
+  va_end (arg_ptr);
+}
+
+void
+gpgrt_log_clock (const char *fmt, ...)
+{
+  va_list arg_ptr;
+
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv_clock (fmt, arg_ptr);
+  va_end (arg_ptr);
+}
+
+void
+_gpgrt_log_assert (const char *expr, const char *file,
+                   int line, const char *func)
+{
+#ifdef GPGRT_HAVE_MACRO_FUNCTION
+  _gpgrt__log_assert (expr, file, line, func);
+#else
+  _gpgrt__log_assert (expr, file, line);
+#endif
+}
+
+\f
+#if 0
+gpg_err_code_t
+gpgrt_make_pipe (int filedes[2], estream_t *r_fp, int direction, int nonblock)
+{
+  return _gpgrt_make_pipe (filedes, r_fp, direction, nonblock);
+}
+
+gpg_err_code_t
+gpgrt_spawn_process (const char *pgmname, const char *argv[],
+                     int *except, void (*preexec)(void), unsigned int flags,
+                     estream_t *r_infp, estream_t *r_outfp, estream_t *r_errfp,
+                     pid_t *pid)
+{
+  return _gpgrt_spawn_process (pgmname, argv, except, preexec, flags,
+                               r_infp, r_outfp, r_errfp, pid);
+}
+
+gpg_err_code_t
+gpgrt_spawn_process_fd (const char *pgmname, const char *argv[],
+                        int infd, int outfd, int errfd, pid_t *pid)
+{
+  return _gpgrt_spawn_process_fd (pgmname, argv, infd, outfd, errfd, pid);
+}
+
+gpg_err_code_t
+gpgrt_spawn_process_detached (const char *pgmname, const char *argv[],
+                              const char *envp[])
+{
+  return _gpgrt_spawn_process_detached (pgmname, argv, envp);
+}
+
+gpg_err_code_t
+gpgrt_wait_process (const char *pgmname, pid_t pid, int hang, int *r_exitcode)
+{
+  return _gpgrt_wait_process (pgmname, pid, hang, r_exitcode);
+}
+
+gpg_err_code_t
+gpgrt_wait_processes (const char **pgmnames, pid_t *pids,
+                      size_t count, int hang, int *r_exitcodes)
+{
+  return _gpgrt_wait_processes (pgmnames, pids, count, hang, r_exitcodes);
+}
+
+void
+gpgrt_kill_process (pid_t pid)
+{
+  _gpgrt_kill_process (pid);
+}
+
+void
+gpgrt_release_process (pid_t pid)
+{
+  _gpgrt_release_process (pid);
+}
+#endif /*0*/
+
+
+int
+gpgrt_argparse (estream_t fp, gpgrt_argparse_t *arg, gpgrt_opt_t *opts)
+{
+  return _gpgrt_argparse (fp, arg, opts);
+}
+
+int
+gpgrt_argparser (gpgrt_argparse_t *arg, gpgrt_opt_t *opts, const char *name)
+{
+  return _gpgrt_argparser (arg, opts, name);
+}
+
+void
+gpgrt_usage (int level)
+{
+  _gpgrt_usage (level);
+}
+
+const char *
+gpgrt_strusage (int level)
+{
+  return _gpgrt_strusage (level);
+}
+
+void
+gpgrt_set_strusage (const char *(*f)(int))
+{
+  _gpgrt_set_strusage (f);
+}
+
+void
+gpgrt_set_usage_outfnc (int (*f)(int, const char *))
+{
+  _gpgrt_set_usage_outfnc (f);
+}
+
+void
+gpgrt_set_fixed_string_mapper (const char *(*f)(const char*))
+{
+  _gpgrt_set_fixed_string_mapper (f);
+}
+
+void
+gpgrt_set_confdir (int what, const char *name)
+{
+  _gpgrt_set_confdir (what, name);
+}
+
+
+\f
+/* Compare program versions.  */
+int
+gpgrt_cmp_version (const char *a, const char *b, int level)
+{
+  return _gpgrt_cmp_version (a, b, level);
+}
+
+
+\f
+/* String utilities.  */
+char *
+gpgrt_fnameconcat (const char *first, ... )
+{
+  va_list arg_ptr;
+  char *result;
+
+  va_start (arg_ptr, first);
+  result = _gpgrt_vfnameconcat (0, first, arg_ptr);
+  va_end (arg_ptr);
+  return result;
+}
+
+char *
+gpgrt_absfnameconcat (const char *first, ... )
+{
+  va_list arg_ptr;
+  char *result;
+
+  va_start (arg_ptr, first);
+  result = _gpgrt_vfnameconcat (1, first, arg_ptr);
+  va_end (arg_ptr);
+  return result;
+}
+
+
+\f
+/* For consistency reasons we use function wrappers also for Windows
+ * specific function despite that they are technically not needed.  */
+#ifdef HAVE_W32_SYSTEM
+
+char *
+gpgrt_w32_reg_query_string (const char *root, const char *dir, const char *name)
+{
+  return _gpgrt_w32_reg_query_string (root, dir, name);
+}
+
+#endif /*HAVE_W32_SYSTEM*/
index da8e228..f9218b5 100644 (file)
@@ -15,6 +15,7 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1+
  */
 
 #ifndef _GPGRT_VISIBILITY_H
@@ -53,6 +54,8 @@ MARK_VISIBLE (gpg_err_set_errno)
 
 MARK_VISIBLE (gpg_err_init)
 MARK_VISIBLE (gpg_err_deinit)
+MARK_VISIBLE (gpgrt_add_emergency_cleanup)
+MARK_VISIBLE (gpgrt_abort)
 MARK_VISIBLE (gpg_error_check_version)
 MARK_VISIBLE (gpgrt_check_version)
 
@@ -76,6 +79,7 @@ MARK_VISIBLE (gpgrt_fpopen_nc)
 MARK_VISIBLE (gpgrt_freopen)
 MARK_VISIBLE (gpgrt_fopencookie)
 MARK_VISIBLE (gpgrt_fclose)
+MARK_VISIBLE (gpgrt_fcancel)
 MARK_VISIBLE (gpgrt_fclose_snatch)
 MARK_VISIBLE (gpgrt_onclose)
 MARK_VISIBLE (gpgrt_fileno)
@@ -101,6 +105,7 @@ MARK_VISIBLE (gpgrt_fseeko)
 MARK_VISIBLE (gpgrt_ftell)
 MARK_VISIBLE (gpgrt_ftello)
 MARK_VISIBLE (gpgrt_rewind)
+MARK_VISIBLE (gpgrt_ftruncate)
 MARK_VISIBLE (gpgrt_fgetc)
 MARK_VISIBLE (_gpgrt_getc_underflow)
 MARK_VISIBLE (gpgrt_fputc)
@@ -117,9 +122,10 @@ MARK_VISIBLE (gpgrt_fputs)
 MARK_VISIBLE (gpgrt_fputs_unlocked)
 MARK_VISIBLE (gpgrt_getline)
 MARK_VISIBLE (gpgrt_read_line)
-MARK_VISIBLE (gpgrt_free)
 MARK_VISIBLE (gpgrt_fprintf)
 MARK_VISIBLE (gpgrt_fprintf_unlocked)
+MARK_VISIBLE (gpgrt_fprintf_sf)
+MARK_VISIBLE (gpgrt_fprintf_sf_unlocked)
 MARK_VISIBLE (gpgrt_printf)
 MARK_VISIBLE (gpgrt_printf_unlocked)
 MARK_VISIBLE (gpgrt_vfprintf)
@@ -141,13 +147,84 @@ MARK_VISIBLE (gpgrt_bsprintf)
 MARK_VISIBLE (gpgrt_vbsprintf)
 MARK_VISIBLE (gpgrt_snprintf)
 MARK_VISIBLE (gpgrt_vsnprintf)
+
 MARK_VISIBLE (gpgrt_set_syscall_clamp)
 MARK_VISIBLE (gpgrt_get_syscall_clamp)
 MARK_VISIBLE (gpgrt_set_alloc_func)
 
+MARK_VISIBLE (gpgrt_realloc)
+MARK_VISIBLE (gpgrt_reallocarray)
+MARK_VISIBLE (gpgrt_malloc)
+MARK_VISIBLE (gpgrt_calloc)
+MARK_VISIBLE (gpgrt_strdup)
+MARK_VISIBLE (gpgrt_strconcat)
+MARK_VISIBLE (gpgrt_free)
+MARK_VISIBLE (gpgrt_getenv)
+MARK_VISIBLE (gpgrt_setenv)
+MARK_VISIBLE (gpgrt_mkdir)
+MARK_VISIBLE (gpgrt_chdir)
+MARK_VISIBLE (gpgrt_getcwd)
+MARK_VISIBLE (gpgrt_access);
+
 MARK_VISIBLE (gpgrt_b64dec_start)
 MARK_VISIBLE (gpgrt_b64dec_proc)
 MARK_VISIBLE (gpgrt_b64dec_finish)
+MARK_VISIBLE (gpgrt_b64enc_start)
+MARK_VISIBLE (gpgrt_b64enc_write)
+MARK_VISIBLE (gpgrt_b64enc_finish)
+
+MARK_VISIBLE (gpgrt_get_errorcount)
+MARK_VISIBLE (gpgrt_inc_errorcount)
+MARK_VISIBLE (gpgrt_log_set_sink)
+MARK_VISIBLE (gpgrt_log_set_socket_dir_cb)
+MARK_VISIBLE (gpgrt_log_set_pid_suffix_cb)
+MARK_VISIBLE (gpgrt_log_set_prefix)
+MARK_VISIBLE (gpgrt_log_get_prefix)
+MARK_VISIBLE (gpgrt_log_test_fd)
+MARK_VISIBLE (gpgrt_log_get_fd)
+MARK_VISIBLE (gpgrt_log_get_stream)
+MARK_VISIBLE (gpgrt_log)
+MARK_VISIBLE (gpgrt_logv)
+MARK_VISIBLE (gpgrt_logv_prefix)
+MARK_VISIBLE (gpgrt_log_string)
+MARK_VISIBLE (gpgrt_log_bug)
+MARK_VISIBLE (gpgrt_log_fatal)
+MARK_VISIBLE (gpgrt_log_error)
+MARK_VISIBLE (gpgrt_log_info)
+MARK_VISIBLE (gpgrt_log_debug)
+MARK_VISIBLE (gpgrt_log_debug_string)
+MARK_VISIBLE (gpgrt_log_printf)
+MARK_VISIBLE (gpgrt_log_printhex)
+MARK_VISIBLE (gpgrt_log_clock)
+MARK_VISIBLE (gpgrt_log_flush)
+MARK_VISIBLE (_gpgrt_log_assert)
+
+#if 0
+MARK_VISIBLE (gpgrt_make_pipe)
+MARK_VISIBLE (gpgrt_spawn_process)
+MARK_VISIBLE (gpgrt_spawn_process_fd)
+MARK_VISIBLE (gpgrt_spawn_process_detached)
+MARK_VISIBLE (gpgrt_wait_process)
+MARK_VISIBLE (gpgrt_wait_processes)
+MARK_VISIBLE (gpgrt_kill_process)
+MARK_VISIBLE (gpgrt_release_process)
+#endif
+
+MARK_VISIBLE (gpgrt_argparse)
+MARK_VISIBLE (gpgrt_argparser)
+MARK_VISIBLE (gpgrt_usage)
+MARK_VISIBLE (gpgrt_strusage)
+MARK_VISIBLE (gpgrt_set_strusage)
+MARK_VISIBLE (gpgrt_set_fixed_string_mapper);
+MARK_VISIBLE (gpgrt_set_usage_outfnc);
+MARK_VISIBLE (gpgrt_set_confdir);
+
+MARK_VISIBLE (gpgrt_cmp_version);
+
+MARK_VISIBLE (gpgrt_fnameconcat);
+MARK_VISIBLE (gpgrt_absfnameconcat);
+
+
 
 #undef MARK_VISIBLE
 
@@ -166,6 +243,8 @@ MARK_VISIBLE (gpgrt_b64dec_finish)
 
 #define gpg_err_init                _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpg_err_deinit              _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_add_emergency_cleanup _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_abort                 _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpg_error_check_version     _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_check_version         _gpgrt_USE_OTHER_FUNCTION
 
@@ -189,6 +268,7 @@ MARK_VISIBLE (gpgrt_b64dec_finish)
 #define gpgrt_freopen               _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_fopencookie           _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_fclose                _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fcancel               _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_fclose_snatch         _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_onclose               _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_fileno                _gpgrt_USE_UNDERSCORED_FUNCTION
@@ -214,6 +294,7 @@ MARK_VISIBLE (gpgrt_b64dec_finish)
 #define gpgrt_ftell                 _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_ftello                _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_rewind                _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_ftruncate             _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_fgetc                 _gpgrt_USE_UNDERSCORED_FUNCTION
 #define _gpgrt_getc_underflow       _gpgrt_USE_DBLUNDERSCO_FUNCTION
 #define gpgrt_fputc                 _gpgrt_USE_UNDERSCORED_FUNCTION
@@ -230,9 +311,10 @@ MARK_VISIBLE (gpgrt_b64dec_finish)
 #define gpgrt_fputs_unlocked        _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_getline               _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_read_line             _gpgrt_USE_UNDERSCORED_FUNCTION
-#define gpgrt_free                  _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_fprintf               _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_fprintf_unlocked      _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fprintf_sf            _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fprintf_sf_unlocked   _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_printf                _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_printf_unlocked       _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_vfprintf              _gpgrt_USE_UNDERSCORED_FUNCTION
@@ -255,14 +337,83 @@ MARK_VISIBLE (gpgrt_b64dec_finish)
 #define gpgrt_snprintf              _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_vsnprintf             _gpgrt_USE_UNDERSCORED_FUNCTION
 
+#define gpgrt_realloc               _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_reallocarray          _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_malloc                _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_calloc                _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_strdup                _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_strconcat             _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_free                  _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_getenv                _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_setenv                _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_mkdir                 _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_chdir                 _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_getcwd                _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_access                _gpgrt_USE_UNDERSCORED_FUNCTION
+
 #define gpgrt_set_syscall_clamp     _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_get_syscall_clamp     _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_set_alloc_func        _gpgrt_USE_UNDERSCORED_FUNCTION
 
+#define gpgrt_b64enc_start          _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_b64enc_write          _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_b64enc_finish         _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_b64dec_start          _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_b64dec_proc           _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_b64dec_finish         _gpgrt_USE_UNDERSCORED_FUNCTION
 
+#define gpgrt_get_errorcount        _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_inc_errorcount        _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_set_sink          _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_set_socket_dir_cb _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_set_pid_suffix_cb _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_set_prefix        _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_get_prefix        _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_test_fd           _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_get_fd            _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_get_stream        _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log                   _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_logv                  _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_logv_prefix           _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_string            _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_bug               _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_fatal             _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_error             _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_info              _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_debug             _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_debug_string      _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_printf            _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_printhex          _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_clock             _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_log_flush             _gpgrt_USE_UNDERSCORED_FUNCTION
+#define _gpgrt_log_assert           _gpgrt_USE_UNDERSCORED_FUNCTION
+
+#define gpgrt_make_pipe              _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_spawn_process          _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_spawn_process_fd       _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_spawn_process_detached _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_wait_process           _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_wait_processes         _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_kill_process           _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_release_process        _gpgrt_USE_UNDERSCORED_FUNCTION
+
+#define gpgrt_argparse                _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_argparser               _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_usage                   _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_set_strusage            _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_strusage                _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_set_usage_outfnc        _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_set_fixed_string_mapper _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_set_confdir             _gpgrt_USE_UNDERSCORED_FUNCTION
+
+#define gpgrt_cmp_version           _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fnameconcat           _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_absfnameconcat        _gpgrt_USE_UNDERSCORED_FUNCTION
+
+/* Windows specific functions.  */
+#define gpgrt_w32_reg_query_string  _gpgrt_USE_UNDERSCORED_FUNCTION
+
+
 #endif /*!_GPGRT_INCL_BY_VISIBILITY_C*/
 
 #endif /*_GPGRT_VISIBILITY_H*/
index 5db6500..3428961 100644 (file)
@@ -37,6 +37,10 @@ int _gpg_w32_gettext_use_utf8 (int value);
 # define gettext_use_utf8(a) _gpg_w32_gettext_use_utf8 (a)
 #endif /*GPG_ERR_ENABLE_GETTEXT_MACROS*/
 
+/* Force the use of the locale NAME or if NAME is NULL the one derived
+ * from LANGID.  This function must be used early and is not thread-safe. */
+void gpgrt_w32_override_locale (const char *name, unsigned short langid);
+
 
 /* A simple iconv implementation w/o the need for an extra DLL.  */
 struct _gpgrt_w32_iconv_s;
@@ -56,3 +60,8 @@ size_t  gpgrt_w32_iconv (gpgrt_w32_iconv_t cd,
 # define iconv_close(a)   gpgrt_w32_iconv_close ((a))
 # define iconv(a,b,c,d,e) gpgrt_w32_iconv ((a),(b),(c),(d),(e))
 #endif /*GPGRT_ENABLE_W32_ICONV_MACROS*/
+
+/* Query a string in the registry.  */
+char *gpgrt_w32_reg_query_string (const char *root,
+                                  const char *dir,
+                                  const char *name);
index d9a4d36..5bb1bcf 100644 (file)
@@ -28,7 +28,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
 #ifdef HAVE_SYS_TIME_H
@@ -57,8 +56,8 @@
 #define DIM(array) (sizeof (array) / sizeof (*array))
 #endif
 
-#define READBUF_SIZE 4096
-#define WRITEBUF_SIZE 4096
+#define READBUF_SIZE 8192
+#define WRITEBUF_SIZE 8192
 
 
 typedef struct estream_cookie_w32_pollable *estream_cookie_w32_pollable_t;
@@ -119,32 +118,6 @@ struct estream_cookie_w32_pollable
 };
 
 
-static HANDLE
-set_synchronize (HANDLE hd)
-{
-#ifdef HAVE_W32CE_SYSTEM
-  return hd;
-#else
-  HANDLE new_hd;
-
-  /* For NT we have to set the sync flag.  It seems that the only way
-     to do it is by duplicating the handle.  Tsss...  */
-  if (!DuplicateHandle (GetCurrentProcess (), hd,
-                       GetCurrentProcess (), &new_hd,
-                       EVENT_MODIFY_STATE | SYNCHRONIZE, FALSE, 0))
-    {
-      trace_errno (1, ("DuplicateHandle failed: ec=%d", (int)GetLastError ()));
-      /* FIXME: Should translate the error code.  */
-      _gpg_err_set_errno (EIO);
-      return INVALID_HANDLE_VALUE;
-    }
-
-  CloseHandle (hd);
-  return new_hd;
-#endif
-}
-
-
 static DWORD CALLBACK
 reader (void *arg)
 {
@@ -170,7 +143,7 @@ reader (void *arg)
          trace (("%p: got space", ctx));
           EnterCriticalSection (&ctx->mutex);
         }
-      assert (((ctx->writepos + 1) % READBUF_SIZE != ctx->readpos));
+      gpgrt_assert (((ctx->writepos + 1) % READBUF_SIZE != ctx->readpos));
       if (ctx->stop_me)
        {
           LeaveCriticalSection (&ctx->mutex);
@@ -178,7 +151,7 @@ reader (void *arg)
         }
       nbytes = (ctx->readpos + READBUF_SIZE
                - ctx->writepos - 1) % READBUF_SIZE;
-      assert (nbytes);
+      gpgrt_assert (nbytes);
       if (nbytes > READBUF_SIZE - ctx->writepos)
        nbytes = READBUF_SIZE - ctx->writepos;
       LeaveCriticalSection (&ctx->mutex);
@@ -239,7 +212,7 @@ reader (void *arg)
   CloseHandle (ctx->have_space_ev);
   CloseHandle (ctx->thread_hd);
   DeleteCriticalSection (&ctx->mutex);
-  _gpgrt_free (ctx);
+  free (ctx);  /* Standard free!  See comment in create_reader. */
 
   return 0;
 }
@@ -256,6 +229,13 @@ create_reader (estream_cookie_w32_pollable_t pcookie)
   sec_attr.nLength = sizeof sec_attr;
   sec_attr.bInheritHandle = FALSE;
 
+  /* The CTX must be allocated in standard system memory so that we
+   * won't use any custom allocation handler which may use our lock
+   * primitives for its implementation.  The problem here is that the
+   * syscall clamp mechanism (e.g. nPth) would be called recursively:
+   * 1. For example by the caller of _gpgrt_w32_poll and 2. by
+   * gpgrt_lock_lock on behalf of the the custom allocation and free
+   * functions.  */
   ctx = calloc (1, sizeof *ctx);
   if (!ctx)
     {
@@ -282,7 +262,6 @@ create_reader (estream_cookie_w32_pollable_t pcookie)
       return NULL;
     }
 
-  ctx->have_data_ev = set_synchronize (ctx->have_data_ev);
   InitializeCriticalSection (&ctx->mutex);
 
 #ifdef HAVE_W32CE_SYSTEM
@@ -542,7 +521,7 @@ writer (void *arg)
   CloseHandle (ctx->thread_hd);
   DeleteCriticalSection (&ctx->mutex);
   trace (("%p: writer is destroyed", ctx));
-  _gpgrt_free (ctx);
+  free (ctx); /* Standard free!  See comment in create_writer. */
 
   return 0;
 }
@@ -559,6 +538,7 @@ create_writer (estream_cookie_w32_pollable_t pcookie)
   sec_attr.nLength = sizeof sec_attr;
   sec_attr.bInheritHandle = FALSE;
 
+  /* See comment at create_reader.  */
   ctx = calloc (1, sizeof *ctx);
   if (!ctx)
     {
@@ -585,7 +565,6 @@ create_writer (estream_cookie_w32_pollable_t pcookie)
       return NULL;
     }
 
-  ctx->is_empty = set_synchronize (ctx->is_empty);
   InitializeCriticalSection (&ctx->mutex);
 
 #ifdef HAVE_W32CE_SYSTEM
@@ -734,7 +713,7 @@ func_w32_pollable_write (void *cookie, const void *buffer, size_t count)
 
   /* If no error occurred, the number of bytes in the buffer must be
      zero.  */
-  assert (!ctx->nbytes);
+  gpgrt_assert (!ctx->nbytes);
 
   if (count > WRITEBUF_SIZE)
     count = WRITEBUF_SIZE;
@@ -771,12 +750,16 @@ func_w32_pollable_write (void *cookie, const void *buffer, size_t count)
 }
 
 
+/* This is the core of _gpgrt_poll.  The caller needs to make sure that
+ * the syscall clamp has been engaged.  */
 int
 _gpgrt_w32_poll (gpgrt_poll_t *fds, size_t nfds, int timeout)
 {
   HANDLE waitbuf[MAXIMUM_WAIT_OBJECTS];
   int waitidx[MAXIMUM_WAIT_OBJECTS];
+#ifdef ENABLE_TRACING
   char waitinfo[MAXIMUM_WAIT_OBJECTS];
+#endif
   unsigned int code;
   int nwait;
   int i;
@@ -833,7 +816,9 @@ _gpgrt_w32_poll (gpgrt_poll_t *fds, size_t nfds, int timeout)
                   return -1;
                 }
               waitidx[nwait] = i;
+#ifdef ENABLE_TRACING
               waitinfo[nwait] = 'r';
+#endif /*ENABLE_TRACING*/
               waitbuf[nwait++] = ctx->have_data_ev;
              any = 1;
             }
@@ -862,21 +847,39 @@ _gpgrt_w32_poll (gpgrt_poll_t *fds, size_t nfds, int timeout)
                   return -1;
                 }
               waitidx[nwait] = i;
+#ifdef ENABLE_TRACING
               waitinfo[nwait] = 'w';
+#endif /*ENABLE_TRACING*/
               waitbuf[nwait++] = ctx->is_empty;
              any = 1;
             }
         }
     }
+#ifdef ENABLE_TRACING
   trace_start (("poll on [ "));
   for (i = 0; i < nwait; i++)
     trace_append (("%d/%c ", waitidx[i], waitinfo[i]));
   trace_finish (("]"));
+#endif /*ENABLE_TRACING*/
+
   if (!any)
-    return 0;
+    {
+      /* WFMO needs at least one object, thus we use use sleep here.
+       * INFINITE wait does not make any sense in this case, so we
+       * error out. */
+      if (timeout == -1)
+        {
+          _gpg_err_set_errno (EINVAL);
+          return -1;
+        }
+      if (timeout)
+        Sleep (timeout);
+      code = WAIT_TIMEOUT;
+    }
+  else
+    code = WaitForMultipleObjects (nwait, waitbuf, 0,
+                                   timeout == -1 ? INFINITE : timeout);
 
-  code = WaitForMultipleObjects (nwait, waitbuf, 0,
-                                 timeout == -1 ? INFINITE : timeout);
   if (code < WAIT_OBJECT_0 + nwait)
     {
       /* This WFMO is a really silly function: It does return either
@@ -891,7 +894,7 @@ _gpgrt_w32_poll (gpgrt_poll_t *fds, size_t nfds, int timeout)
        {
          if (WaitForSingleObject (waitbuf[i], 0) == WAIT_OBJECT_0)
            {
-             assert (waitidx[i] >=0 && waitidx[i] < nfds);
+             gpgrt_assert (waitidx[i] >=0 && waitidx[i] < nfds);
               /* XXX: What if one wants read and write, is that
                  supported?  */
               if (fds[waitidx[i]].want_read)
index 3b54ebd..7c4c9b0 100644 (file)
@@ -34,9 +34,7 @@
 #include <sys/types.h>
 #endif
 #include <stdint.h>
-#ifndef HAVE_W32CE_SYSTEM
-# include <locale.h>
-#endif /*HAVE_W32CE_SYSTEM*/
+#include <locale.h>
 #include <windows.h>
 
 #ifdef JNLIB_IN_JNLIB
 #endif /*!jnlib_malloc*/
 
 #include "init.h"
-#include "gpg-error.h"
+#include "gpgrt-int.h"
+#include "protos.h"
 
-#ifdef HAVE_W32CE_SYSTEM
-/* Forward declaration.  */
-static wchar_t *utf8_to_wchar (const char *string, size_t length, size_t *retlen);
-
-static HANDLE
-MyCreateFileA (LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwSharedMode,
-            LPSECURITY_ATTRIBUTES lpSecurityAttributes,
-            DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes,
-            HANDLE hTemplateFile)
+/* Override values initialized by gpgrt_w32_override_locale.  If NAME
+ * is not the empty string LANGID will be used.  */
+static struct
 {
-  wchar_t *filename;
-  HANDLE result;
-  int err;
-  size_t size;
-
-  filename = utf8_to_wchar (lpFileName, -1, &size);
-  if (!filename)
-    return INVALID_HANDLE_VALUE;
-
-  result = CreateFileW (filename, dwDesiredAccess, dwSharedMode,
-                       lpSecurityAttributes, dwCreationDisposition,
-                       dwFlagsAndAttributes, hTemplateFile);
-
-  err = GetLastError ();
-  free (filename);
-  SetLastError (err);
-  return result;
-}
-#undef CreateFileA
-#define CreateFileA MyCreateFileA
-#endif
+  unsigned short active;  /* If not zero this override is active. */
+  unsigned short langid;
+  char name[28];
+} override_locale;
+
+
 
 \f
 /* localname.c from gettext BEGIN.  */
@@ -644,36 +622,37 @@ MyCreateFileA (LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwSharedMode,
 static const char *
 my_nl_locale_name (const char *categoryname)
 {
-#ifndef HAVE_W32CE_SYSTEM
   const char *retval;
-#endif
-  LCID lcid;
   LANGID langid;
   int primary, sub;
 
-  /* Let the user override the system settings through environment
-     variables, as on POSIX systems.  */
-#ifndef HAVE_W32CE_SYSTEM
-  retval = getenv ("LC_ALL");
-  if (retval != NULL && retval[0] != '\0')
-    return retval;
-  retval = getenv (categoryname);
-  if (retval != NULL && retval[0] != '\0')
-    return retval;
-  retval = getenv ("LANG");
-  if (retval != NULL && retval[0] != '\0')
-    return retval;
-#endif /*!HAVE_W32CE_SYSTEM*/
-
-  /* Use native Win32 API locale ID.  */
-#ifdef HAVE_W32CE_SYSTEM
-  lcid = GetSystemDefaultLCID ();
-#else
-  lcid = GetThreadLocale ();
-#endif
-
-  /* Strip off the sorting rules, keep only the language part.  */
-  langid = LANGIDFROMLCID (lcid);
+  if (override_locale.active)
+    {
+      if (*override_locale.name)
+        return override_locale.name;
+      langid = override_locale.langid;
+    }
+  else
+    {
+      LCID lcid;
+
+      /* Let the user override the system settings through environment
+       *  variables, as on POSIX systems.  */
+      retval = getenv ("LC_ALL");
+      if (retval != NULL && retval[0] != '\0')
+        return retval;
+      retval = getenv (categoryname);
+      if (retval != NULL && retval[0] != '\0')
+        return retval;
+      retval = getenv ("LANG");
+      if (retval != NULL && retval[0] != '\0')
+        return retval;
+
+      /* 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);
@@ -1231,8 +1210,16 @@ load_domain (const char *filename)
   size_t to_read;
   char *read_ptr;
 
-  fh = CreateFileA (filename, GENERIC_READ, FILE_SHARE_WRITE, NULL,
-                    OPEN_EXISTING, 0, NULL);
+  {
+    wchar_t *wfilename = _gpgrt_utf8_to_wchar (filename);
+
+    if (!wfilename)
+      fh = INVALID_HANDLE_VALUE;
+    else
+      fh = CreateFileW (wfilename, GENERIC_READ, FILE_SHARE_WRITE, NULL,
+                        OPEN_EXISTING, 0, NULL);
+    xfree (wfilename);
+  }
   if (fh == INVALID_HANDLE_VALUE)
     return NULL;
 
@@ -1335,60 +1322,82 @@ load_domain (const char *filename)
 /* Return a malloced wide char string from an UTF-8 encoded input
    string STRING.  Caller must free this value. On failure returns
    NULL.  The result of calling this function with STRING set to NULL
-   is not defined. */
+   is not defined.  If LENGTH is zero and RETLEN NULL the fucntion
+   assumes that STRING is a nul-terminated string and returns a
+   (wchar_t)0-terminated string.  */
 static wchar_t *
 utf8_to_wchar (const char *string, size_t length, size_t *retlen)
 {
   int n;
   wchar_t *result;
   size_t nbytes;
+  int cbmultibyte;
 
-  n = MultiByteToWideChar (CP_UTF8, 0, string, length, NULL, 0);
+  if (!length && !retlen)
+    cbmultibyte = -1;
+  else
+    cbmultibyte = length;
+
+  n = MultiByteToWideChar (CP_UTF8, 0, string, cbmultibyte, NULL, 0);
   if (n < 0 || (n+1) <= 0)
     return NULL;
 
   nbytes = (size_t)(n+1) * sizeof(*result);
   if (nbytes / sizeof(*result) != (n+1))
     {
-      gpg_err_set_errno (ENOMEM);
+      _gpg_err_set_errno (ENOMEM);
       return NULL;
     }
   result = jnlib_malloc (nbytes);
   if (!result)
     return NULL;
 
-  n = MultiByteToWideChar (CP_UTF8, 0, string, length, result, n);
+  n = MultiByteToWideChar (CP_UTF8, 0, string, cbmultibyte, result, n);
   if (n < 0)
     {
       jnlib_free (result);
       return NULL;
     }
-  *retlen = n;
+  if (retlen)
+    *retlen = n;
   return result;
 }
 
 
-/* Return a malloced string encoded in the native console codepage
-   from the wide char input string STRING.
-   Caller must free this value. On failure returns NULL.
-   The result of calling this function with STRING set to NULL
-   is not defined. */
+/* Convert an UTF8 string to a WCHAR string.  Caller should use
+ * _gpgrt_free_wchar to release the result. */
+wchar_t *
+_gpgrt_utf8_to_wchar (const char *string)
+{
+  return utf8_to_wchar (string, 0, NULL);
+}
+
+
+/* We provide a dedicated release function to be sure that we don't
+ * use a somehow mapped free function but the one which matches the
+ * used alloc.  */
+void
+_gpgrt_free_wchar (wchar_t *wstring)
+{
+  if (wstring)
+    jnlib_free (wstring);
+}
+
+
+/* Helper for wchar_to_native and wchar_to_utf8.  */
 static char *
-wchar_to_native (const wchar_t *string, size_t length, size_t *retlen)
+wchar_to_cp (const wchar_t *string, size_t length, size_t *retlen,
+             unsigned int cpno)
 {
   int n;
   char *result;
-  unsigned int cpno = GetConsoleOutputCP ();
-
-  /* GetConsoleOutputCP returns the 8-Bit codepage that should be used
-     for console output. If the codepage is not returned we fall back
-     to the codepage GUI programs should use (CP_ACP). */
-  if (!cpno)
-    cpno = GetACP ();
 
   n = WideCharToMultiByte (cpno, 0, string, length, NULL, 0, NULL, NULL);
   if (n < 0 || (n+1) <= 0)
-    return NULL;
+    {
+      _gpgrt_w32_set_errno (-1);
+      return NULL;
+    }
 
   result = jnlib_malloc (n+1);
   if (!result)
@@ -1397,14 +1406,46 @@ wchar_to_native (const wchar_t *string, size_t length, size_t *retlen)
   n = WideCharToMultiByte (cpno, 0, string, length, result, n, NULL, NULL);
   if (n < 0)
     {
+      _gpgrt_w32_set_errno (-1);
       jnlib_free (result);
       return NULL;
     }
-  *retlen = n;
+  result[n] = 0;
+  if (retlen)
+    *retlen = n;
   return result;
 }
 
 
+/* Return a malloced string encoded in the native console codepage
+   from the wide char input string STRING.
+   Caller must free this value. On failure returns NULL.
+   The result of calling this function with STRING set to NULL
+   is not defined. */
+static char *
+wchar_to_native (const wchar_t *string, size_t length, size_t *retlen)
+{
+  unsigned int cpno = GetConsoleOutputCP ();
+
+  /* GetConsoleOutputCP returns the 8-Bit codepage that should be used
+     for console output. If the codepage is not returned we fall back
+     to the codepage GUI programs should use (CP_ACP). */
+  if (!cpno)
+    cpno = GetACP ();
+
+  return wchar_to_cp (string, length, retlen, cpno);
+}
+
+
+/* Convert a WCHAR string to UTF-8.  Caller should use xfree to
+ * release the result.  Returns NULL on error and sets ERRNO. */
+char *
+_gpgrt_wchar_to_utf8 (const wchar_t *string, size_t length)
+{
+  return wchar_to_cp (string, length, NULL, CP_UTF8);
+}
+
+
 /* Convert UTF8 to the native codepage.  Caller must free the return value. */
 static char *
 utf8_to_native (const char *string, size_t length, size_t *retlen)
@@ -1426,7 +1467,6 @@ utf8_to_native (const char *string, size_t length, size_t *retlen)
 }
 
 
-
 \f
 /* Specify that the DOMAINNAME message catalog will be found
    in DIRNAME rather than in the system locale data base.  */
@@ -1849,7 +1889,7 @@ _gpg_w32_textdomain (const char *domainname)
   if (!domainname)
     {
       if (!current_domainname)
-        gpg_err_set_errno (0);
+        _gpg_err_set_errno (0);
     }
   else
     {
@@ -1922,6 +1962,24 @@ _gpg_w32_gettext_use_utf8 (int value)
 }
 
 
+/* Force the use of the locale NAME or if NAME is NULL the locale
+ * derived from LANGID will be used.  This function is not thread-safe
+ * and must be used early - even before gpgrt_check_version. */
+void
+gpgrt_w32_override_locale (const char *name, unsigned short langid)
+{
+  if (name)
+    {
+      strncpy (override_locale.name, name, sizeof (override_locale.name) - 1);
+      override_locale.name[sizeof (override_locale.name) - 1] = 0;
+    }
+  else
+    *override_locale.name = 0;
+  override_locale.langid = langid;
+  override_locale.active = 1;
+}
+
+
 #ifdef TEST
 int
 main (int argc, char **argv)
@@ -1951,7 +2009,7 @@ main (int argc, char **argv)
   return 0;
 }
 /*
- * Local Variables:
+ *No-Local Variables:
  *  compile-command: "i586-mingw32msvc-gcc -DTEST -Wall -g w32-gettext.c"
  * End:
  */
index c10bb32..888b722 100644 (file)
@@ -1475,6 +1475,7 @@ utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize)
 #define ISO2022_SI  0
 #define ISO2022_SO  1
 
+#if USE_MLANG_DLL
 /* shift in */
 static const char iso2022_SI_seq[] = "\x0F";
 /* shift out */
@@ -1487,6 +1488,7 @@ struct iso2022_esc_t {
     int len;
     int cs;
 };
+#endif
 
 #define ISO2022JP_CS_ASCII            0
 #define ISO2022JP_CS_JISX0201_ROMAN   1
index 51b13a1..feed1e6 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
-#include <gpg-error.h>
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
+#include "gpgrt-int.h"
 #include "lock.h"
 #include "w32-lock-obj.h"
 
 
 
-/*
- * Functions called before and after blocking syscalls.
- * gpgrt_set_syscall_clamp is used to set them.
- */
-static void (*pre_lock_func)(void);
-static void (*post_lock_func)(void);
-
-
-/* Helper to set the clamp functions.  This is called as a helper from
- * _gpgrt_set_syscall_clamp to keep the function pointers local. */
-void
-_gpgrt_lock_set_lock_clamp (void (*pre)(void), void (*post)(void))
-{
-  pre_lock_func = pre;
-  post_lock_func = post;
-}
-
-
-
 static _gpgrt_lock_t *
 get_lock_object (gpgrt_lock_t *lockhd)
 {
   _gpgrt_lock_t *lock = (_gpgrt_lock_t*)lockhd;
 
   if (lock->vers != LOCK_ABI_VERSION)
-    abort ();
+    _gpgrt_abort ();
 
   return lock;
 }
@@ -80,14 +61,14 @@ _gpgrt_lock_init (gpgrt_lock_t *lockhd)
   if (!lock->vers)
     {
       if (sizeof (gpgrt_lock_t) < sizeof (_gpgrt_lock_t))
-        abort ();
+        _gpgrt_abort ();
       lock->vers = LOCK_ABI_VERSION;
     }
   else /* Run the usual check.  */
     {
       lock = get_lock_object (lockhd);
       if (sizeof (gpgrt_lock_t) < sizeof (_gpgrt_lock_t))
-        abort ();
+        _gpgrt_abort ();
     }
 
   InitializeCriticalSection (&lock->csec);
@@ -112,7 +93,7 @@ _gpgrt_lock_lock (gpgrt_lock_t *lockhd)
              and thus fall into the wait loop below.  We ignore that
              STARTED may in theory overflow if this thread starves for
              too long.  */
-          gpgrt_lock_init (lockhd);
+          _gpgrt_lock_init (lockhd);
         }
       else
         {
@@ -121,11 +102,9 @@ _gpgrt_lock_lock (gpgrt_lock_t *lockhd)
         }
     }
 
-  if (pre_lock_func)
-    pre_lock_func ();
+  _gpgrt_pre_syscall ();
   EnterCriticalSection (&lock->csec);
-  if (post_lock_func)
-    post_lock_func ();
+  _gpgrt_post_syscall ();
   return 0;
 }
 
@@ -139,7 +118,7 @@ _gpgrt_lock_trylock (gpgrt_lock_t *lockhd)
     {
       if (!InterlockedIncrement (&lock->started))
         {
-          gpgrt_lock_init (lockhd);
+          _gpgrt_lock_init (lockhd);
         }
       else
         {
diff --git a/src/w32-reg.c b/src/w32-reg.c
new file mode 100644 (file)
index 0000000..d1d2ca6
--- /dev/null
@@ -0,0 +1,203 @@
+/* w32-reg.c - Windows registry support
+ * Copyright (C) 2002, 2005, 2010, 2012, 2017 g10 Code GmbH
+ *
+ * This file is part of Libgpg-error.
+ *
+ * Libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * Libgpg-error 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1+
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifndef HAVE_W32_SYSTEM
+# error This module may only be build for Windows.
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <gpg-error.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include "gpgrt-int.h"
+
+
+/* Return a string from the W32 Registry or NULL in case of error.
+ * Caller must release the return value.  A NULL for root is an alias
+ * for HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE in turn.  The returned
+ * string is UTF-8 encoded; ROOT, DIR, and NAME must be plain
+ * ASCII. */
+char *
+_gpgrt_w32_reg_query_string (const char *root, const char *dir,
+                             const char *name)
+{
+  HKEY root_key, key_handle;
+  DWORD n1, nbytes, type;
+  char *result = NULL;
+
+  if (!root)
+    root_key = HKEY_CURRENT_USER;
+  else if (!strcmp (root, "HKEY_CLASSES_ROOT") || !strcmp (root, "HKCR"))
+    root_key = HKEY_CLASSES_ROOT;
+  else if (!strcmp (root, "HKEY_CURRENT_USER") || !strcmp (root, "HKCU"))
+    root_key = HKEY_CURRENT_USER;
+  else if (!strcmp (root, "HKEY_LOCAL_MACHINE") || !strcmp (root, "HKLM"))
+    root_key = HKEY_LOCAL_MACHINE;
+  else if (!strcmp (root, "HKEY_USERS") || !strcmp (root, "HKU"))
+    root_key = HKEY_USERS;
+  else if (!strcmp (root, "HKEY_PERFORMANCE_DATA"))
+    root_key = HKEY_PERFORMANCE_DATA;
+  else if (!strcmp (root, "HKEY_CURRENT_CONFIG") || !strcmp (root, "HKCC"))
+    root_key = HKEY_CURRENT_CONFIG;
+  else
+    return NULL;
+
+  if (RegOpenKeyExA (root_key, dir, 0, KEY_READ, &key_handle))
+    {
+      if (root)
+        return NULL; /* No need for a RegClose, so return direct.  */
+      /* It seems to be common practise to fall back to HKLM. */
+      if (RegOpenKeyExA (HKEY_LOCAL_MACHINE, dir, 0, KEY_READ, &key_handle))
+        return NULL; /* still no need for a RegClose, so return direct */
+    }
+
+
+  /* FIXME:  Use wide functions and convert to utf-8.  */
+  nbytes = 1;
+  if (RegQueryValueExA (key_handle, name, 0, NULL, NULL, &nbytes))
+    {
+      if (root)
+        goto leave;
+      /* Try to fallback to HKLM also for a missing value.  */
+      RegCloseKey (key_handle);
+      if (RegOpenKeyExA (HKEY_LOCAL_MACHINE, dir, 0, KEY_READ, &key_handle))
+        return NULL; /* Nope.  */
+      if (RegQueryValueExA (key_handle, name, 0, NULL, NULL, &nbytes))
+        goto leave;
+    }
+  n1 = nbytes + 1;
+  result = xtrymalloc (n1);
+  if (!result)
+    goto leave;
+  if (RegQueryValueExA (key_handle, name, 0, &type, (LPBYTE) result, &n1))
+    {
+      xfree (result);
+      result = NULL;
+      goto leave;
+    }
+  result[nbytes] = 0; /* Make sure it is really a string.  */
+
+#ifndef HAVE_W32CE_SYSTEM /* (Windows CE has no environment.)  */
+  if (type == REG_EXPAND_SZ && strchr (result, '%'))
+    {
+      char *tmp;
+
+      n1 += 1000;
+      tmp = xtrymalloc (n1 + 1);
+      if (!tmp)
+        goto leave;
+      nbytes = ExpandEnvironmentStrings (result, tmp, n1);
+      if (nbytes && nbytes > n1)
+        {
+          xfree (tmp);
+          n1 = nbytes;
+          tmp = xtrymalloc (n1 + 1);
+          if (!tmp)
+            goto leave;
+          nbytes = ExpandEnvironmentStrings (result, tmp, n1);
+          if (nbytes && nbytes > n1) {
+            xfree (tmp); /* Oops - truncated, better don't expand at all. */
+            goto leave;
+          }
+          tmp[nbytes] = 0;
+          xfree (result);
+          result = tmp;
+        }
+      else if (nbytes)  /* Okay, reduce the length. */
+        {
+          tmp[nbytes] = 0;
+          xfree (result);
+          result = xtrymalloc (strlen (tmp)+1);
+          if (!result)
+            result = tmp;
+          else
+            {
+              strcpy (result, tmp);
+              xfree (tmp);
+            }
+        }
+      else  /* Error - don't expand. */
+        {
+          xfree (tmp);
+        }
+    }
+#endif
+
+ leave:
+  RegCloseKey (key_handle);
+  return result;
+}
+
+
+/* Compact version of gpgrt_w32_reg_query_string.  This version
+ * expects a single string as key described here using an example:
+ *
+ *    HKCU\Software\GNU\GnuPG:HomeDir
+ *
+ * HKCU := the class, other supported classes are HKLM, HKCR, HKU, and
+ *         HKCC.  If no class is given and the string thus starts with
+ *         a backslash HKCU with a fallback to HKLM is used.
+ * Software\GNU\GnuPG := The actual key.
+ * HomeDir := the name of the item.  The name is optional to use the default
+ *            value.
+ *
+ * Note that the first backslash and the first colon act as delimiters.
+ *
+ * Returns a malloced string or NULL if not found.
+ */
+char *
+_gpgrt_w32_reg_get_string (const char *key_arg)
+{
+  char *key;
+  char *p1, *p2;
+  char *result;
+
+  if (!key_arg)
+    return NULL;
+  key = xtrystrdup (key_arg);
+  if (!key)
+    {
+      _gpgrt_log_info ("warning: malloc failed while reading registry key\n");
+      return NULL;
+    }
+
+  p1 = strchr (key, '\\');
+  if (!p1)
+    {
+      xfree (key);
+      return NULL;
+    }
+  *p1++ = 0;
+  p2 = strchr (p1, ':');
+  if (p2)
+    *p2++ = 0;
+
+  result = _gpgrt_w32_reg_query_string (*key? key : NULL, p1, p2);
+  xfree (key);
+  return result;
+}
index aef421f..c389635 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
-#include <gpg-error.h>
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
+#include "gpgrt-int.h"
 #include "thread.h"
 
-/*
- * Functions called before and after blocking syscalls.
- * gpgrt_set_syscall_clamp is used to set them.
- */
-static void (*pre_syscall_func)(void);
-static void (*post_syscall_func)(void);
-
-
-/* Helper to set the clamp functions.  This is called as a helper from
- * _gpgrt_set_syscall_clamp to keep the function pointers local. */
-void
-_gpgrt_thread_set_syscall_clamp (void (*pre)(void), void (*post)(void))
-{
-  pre_syscall_func = pre;
-  post_syscall_func = post;
-}
-
-
 
 gpg_err_code_t
 _gpgrt_yield (void)
 {
-  if (pre_syscall_func)
-    pre_syscall_func ();
+  _gpgrt_pre_syscall ();
   Sleep (0);
-  if (post_syscall_func)
-    post_syscall_func ();
+  _gpgrt_post_syscall ();
   return 0;
 }
index a3c6cbd..a8327d6 100644 (file)
@@ -25,17 +25,25 @@ else
 extra_includes =
 endif
 
+EXTRA_DIST = t-argparse.conf etc/t-argparse.conf
+
 gpg_error_lib = ../src/libgpg-error.la
 
-TESTS = t-version t-strerror t-syserror t-lock t-printf t-poll t-b64dec
+TESTS = t-version t-strerror t-syserror t-lock t-printf t-poll t-b64 \
+       t-argparse t-logging t-stringutils t-malloc
+
+if HAVE_W32_SYSTEM
+else
+TESTS += t-lock-single-posix
+endif
 
 AM_CPPFLAGS = -I$(top_builddir)/src $(extra_includes)
 
 AM_LDFLAGS = -no-install
-LDADD = $(gpg_error_lib)
+LDADD = $(gpg_error_lib) @LDADD_FOR_TESTS_KLUDGE@
 
 noinst_PROGRAMS = $(TESTS)
 noinst_HEADERS = t-common.h
 
-t_lock_LDADD = $(gpg_error_lib) $(LIBMULTITHREAD)
-t_poll_LDADD = $(gpg_error_lib) $(LIBMULTITHREAD)
+t_lock_LDADD = $(LDADD) $(LIBMULTITHREAD)
+t_poll_LDADD = $(LDADD) $(LIBMULTITHREAD)
index 07b554c..7dcc89b 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -100,47 +110,71 @@ build_triplet = @build@
 host_triplet = @host@
 TESTS = t-version$(EXEEXT) t-strerror$(EXEEXT) t-syserror$(EXEEXT) \
        t-lock$(EXEEXT) t-printf$(EXEEXT) t-poll$(EXEEXT) \
-       t-b64dec$(EXEEXT)
-noinst_PROGRAMS = $(am__EXEEXT_1)
+       t-b64$(EXEEXT) t-argparse$(EXEEXT) t-logging$(EXEEXT) \
+       t-stringutils$(EXEEXT) t-malloc$(EXEEXT) $(am__EXEEXT_1)
+@HAVE_W32_SYSTEM_FALSE@am__append_1 = t-lock-single-posix
+noinst_PROGRAMS = $(am__EXEEXT_2)
 subdir = tests
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-       $(top_srcdir)/build-aux/depcomp $(noinst_HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/autobuild.m4 \
-       $(top_srcdir)/m4/estream.m4 $(top_srcdir)/m4/gettext.m4 \
+       $(top_srcdir)/m4/ax_cc_for_build.m4 \
+       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/estream.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gnupg-misc.m4 \
        $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
        $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/lock.m4 \
        $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
        $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
        $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/threadlib.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
+       $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
+       $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-am__EXEEXT_1 = t-version$(EXEEXT) t-strerror$(EXEEXT) \
+@HAVE_W32_SYSTEM_FALSE@am__EXEEXT_1 = t-lock-single-posix$(EXEEXT)
+am__EXEEXT_2 = t-version$(EXEEXT) t-strerror$(EXEEXT) \
        t-syserror$(EXEEXT) t-lock$(EXEEXT) t-printf$(EXEEXT) \
-       t-poll$(EXEEXT) t-b64dec$(EXEEXT)
+       t-poll$(EXEEXT) t-b64$(EXEEXT) t-argparse$(EXEEXT) \
+       t-logging$(EXEEXT) t-stringutils$(EXEEXT) t-malloc$(EXEEXT) \
+       $(am__EXEEXT_1)
 PROGRAMS = $(noinst_PROGRAMS)
-t_b64dec_SOURCES = t-b64dec.c
-t_b64dec_OBJECTS = t-b64dec.$(OBJEXT)
-t_b64dec_LDADD = $(LDADD)
-t_b64dec_DEPENDENCIES = $(gpg_error_lib)
+t_argparse_SOURCES = t-argparse.c
+t_argparse_OBJECTS = t-argparse.$(OBJEXT)
+t_argparse_LDADD = $(LDADD)
+t_argparse_DEPENDENCIES = $(gpg_error_lib)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
 am__v_lt_1 = 
+t_b64_SOURCES = t-b64.c
+t_b64_OBJECTS = t-b64.$(OBJEXT)
+t_b64_LDADD = $(LDADD)
+t_b64_DEPENDENCIES = $(gpg_error_lib)
 t_lock_SOURCES = t-lock.c
 t_lock_OBJECTS = t-lock.$(OBJEXT)
-am__DEPENDENCIES_1 =
-t_lock_DEPENDENCIES = $(gpg_error_lib) $(am__DEPENDENCIES_1)
+am__DEPENDENCIES_1 = $(gpg_error_lib)
+am__DEPENDENCIES_2 =
+t_lock_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
+t_lock_single_posix_SOURCES = t-lock-single-posix.c
+t_lock_single_posix_OBJECTS = t-lock-single-posix.$(OBJEXT)
+t_lock_single_posix_LDADD = $(LDADD)
+t_lock_single_posix_DEPENDENCIES = $(gpg_error_lib)
+t_logging_SOURCES = t-logging.c
+t_logging_OBJECTS = t-logging.$(OBJEXT)
+t_logging_LDADD = $(LDADD)
+t_logging_DEPENDENCIES = $(gpg_error_lib)
+t_malloc_SOURCES = t-malloc.c
+t_malloc_OBJECTS = t-malloc.$(OBJEXT)
+t_malloc_LDADD = $(LDADD)
+t_malloc_DEPENDENCIES = $(gpg_error_lib)
 t_poll_SOURCES = t-poll.c
 t_poll_OBJECTS = t-poll.$(OBJEXT)
-t_poll_DEPENDENCIES = $(gpg_error_lib) $(am__DEPENDENCIES_1)
+t_poll_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 t_printf_SOURCES = t-printf.c
 t_printf_OBJECTS = t-printf.$(OBJEXT)
 t_printf_LDADD = $(LDADD)
@@ -149,6 +183,10 @@ t_strerror_SOURCES = t-strerror.c
 t_strerror_OBJECTS = t-strerror.$(OBJEXT)
 t_strerror_LDADD = $(LDADD)
 t_strerror_DEPENDENCIES = $(gpg_error_lib)
+t_stringutils_SOURCES = t-stringutils.c
+t_stringutils_OBJECTS = t-stringutils.$(OBJEXT)
+t_stringutils_LDADD = $(LDADD)
+t_stringutils_DEPENDENCIES = $(gpg_error_lib)
 t_syserror_SOURCES = t-syserror.c
 t_syserror_OBJECTS = t-syserror.$(OBJEXT)
 t_syserror_LDADD = $(LDADD)
@@ -171,7 +209,13 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/t-argparse.Po ./$(DEPDIR)/t-b64.Po \
+       ./$(DEPDIR)/t-lock-single-posix.Po ./$(DEPDIR)/t-lock.Po \
+       ./$(DEPDIR)/t-logging.Po ./$(DEPDIR)/t-malloc.Po \
+       ./$(DEPDIR)/t-poll.Po ./$(DEPDIR)/t-printf.Po \
+       ./$(DEPDIR)/t-strerror.Po ./$(DEPDIR)/t-stringutils.Po \
+       ./$(DEPDIR)/t-syserror.Po ./$(DEPDIR)/t-version.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -191,10 +235,12 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = t-b64dec.c t-lock.c t-poll.c t-printf.c t-strerror.c \
-       t-syserror.c t-version.c
-DIST_SOURCES = t-b64dec.c t-lock.c t-poll.c t-printf.c t-strerror.c \
-       t-syserror.c t-version.c
+SOURCES = t-argparse.c t-b64.c t-lock.c t-lock-single-posix.c \
+       t-logging.c t-malloc.c t-poll.c t-printf.c t-strerror.c \
+       t-stringutils.c t-syserror.c t-version.c
+DIST_SOURCES = t-argparse.c t-b64.c t-lock.c t-lock-single-posix.c \
+       t-logging.c t-malloc.c t-poll.c t-printf.c t-strerror.c \
+       t-stringutils.c t-syserror.c t-version.c
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -242,6 +288,8 @@ am__tty_colors = { \
     std='\e[m'; \
   fi; \
 }
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+       $(top_srcdir)/build-aux/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -273,18 +321,20 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
 FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GMSGFMT = @GMSGFMT@
 GMSGFMT_015 = @GMSGFMT_015@
 GPG_ERROR_CONFIG_CFLAGS = @GPG_ERROR_CONFIG_CFLAGS@
 GPG_ERROR_CONFIG_HOST = @GPG_ERROR_CONFIG_HOST@
-GPG_ERROR_CONFIG_ISUBDIRAFTER = @GPG_ERROR_CONFIG_ISUBDIRAFTER@
 GPG_ERROR_CONFIG_LIBS = @GPG_ERROR_CONFIG_LIBS@
+GPG_ERROR_CONFIG_LIBS_PRIVATE = @GPG_ERROR_CONFIG_LIBS_PRIVATE@
 GPG_ERROR_CONFIG_MT_CFLAGS = @GPG_ERROR_CONFIG_MT_CFLAGS@
 GPG_ERROR_CONFIG_MT_LIBS = @GPG_ERROR_CONFIG_MT_LIBS@
 GREP = @GREP@
 INSTALL = @INSTALL@
+INSTALLSHELLPATH = @INSTALLSHELLPATH@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -292,6 +342,7 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LD = @LD@
+LDADD_FOR_TESTS_KLUDGE = @LDADD_FOR_TESTS_KLUDGE@
 LDFLAGS = @LDFLAGS@
 LIBGPG_ERROR_LT_AGE = @LIBGPG_ERROR_LT_AGE@
 LIBGPG_ERROR_LT_CURRENT = @LIBGPG_ERROR_LT_CURRENT@
@@ -300,9 +351,14 @@ LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBREADLINE = @LIBREADLINE@
 LIBS = @LIBS@
+LIBSTDTHREAD = @LIBSTDTHREAD@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
+LIB_NETWORK = @LIB_NETWORK@
 LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
 LIPO = @LIPO@
 LN_S = @LN_S@
@@ -389,6 +445,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -399,13 +456,14 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 @HAVE_W32CE_SYSTEM_FALSE@extra_includes = 
 @HAVE_W32CE_SYSTEM_TRUE@extra_includes = -idirafter $(top_builddir)/src/gpg-extra
+EXTRA_DIST = t-argparse.conf etc/t-argparse.conf
 gpg_error_lib = ../src/libgpg-error.la
 AM_CPPFLAGS = -I$(top_builddir)/src $(extra_includes)
 AM_LDFLAGS = -no-install
-LDADD = $(gpg_error_lib)
+LDADD = $(gpg_error_lib) @LDADD_FOR_TESTS_KLUDGE@
 noinst_HEADERS = t-common.h
-t_lock_LDADD = $(gpg_error_lib) $(LIBMULTITHREAD)
-t_poll_LDADD = $(gpg_error_lib) $(LIBMULTITHREAD)
+t_lock_LDADD = $(LDADD) $(LIBMULTITHREAD)
+t_poll_LDADD = $(LDADD) $(LIBMULTITHREAD)
 all: all-am
 
 .SUFFIXES:
@@ -422,14 +480,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
        $(am__cd) $(top_srcdir) && \
          $(AUTOMAKE) --gnu tests/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -450,14 +507,30 @@ clean-noinstPROGRAMS:
        echo " rm -f" $$list; \
        rm -f $$list
 
-t-b64dec$(EXEEXT): $(t_b64dec_OBJECTS) $(t_b64dec_DEPENDENCIES) $(EXTRA_t_b64dec_DEPENDENCIES) 
-       @rm -f t-b64dec$(EXEEXT)
-       $(AM_V_CCLD)$(LINK) $(t_b64dec_OBJECTS) $(t_b64dec_LDADD) $(LIBS)
+t-argparse$(EXEEXT): $(t_argparse_OBJECTS) $(t_argparse_DEPENDENCIES) $(EXTRA_t_argparse_DEPENDENCIES) 
+       @rm -f t-argparse$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(t_argparse_OBJECTS) $(t_argparse_LDADD) $(LIBS)
+
+t-b64$(EXEEXT): $(t_b64_OBJECTS) $(t_b64_DEPENDENCIES) $(EXTRA_t_b64_DEPENDENCIES) 
+       @rm -f t-b64$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(t_b64_OBJECTS) $(t_b64_LDADD) $(LIBS)
 
 t-lock$(EXEEXT): $(t_lock_OBJECTS) $(t_lock_DEPENDENCIES) $(EXTRA_t_lock_DEPENDENCIES) 
        @rm -f t-lock$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(t_lock_OBJECTS) $(t_lock_LDADD) $(LIBS)
 
+t-lock-single-posix$(EXEEXT): $(t_lock_single_posix_OBJECTS) $(t_lock_single_posix_DEPENDENCIES) $(EXTRA_t_lock_single_posix_DEPENDENCIES) 
+       @rm -f t-lock-single-posix$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(t_lock_single_posix_OBJECTS) $(t_lock_single_posix_LDADD) $(LIBS)
+
+t-logging$(EXEEXT): $(t_logging_OBJECTS) $(t_logging_DEPENDENCIES) $(EXTRA_t_logging_DEPENDENCIES) 
+       @rm -f t-logging$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(t_logging_OBJECTS) $(t_logging_LDADD) $(LIBS)
+
+t-malloc$(EXEEXT): $(t_malloc_OBJECTS) $(t_malloc_DEPENDENCIES) $(EXTRA_t_malloc_DEPENDENCIES) 
+       @rm -f t-malloc$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(t_malloc_OBJECTS) $(t_malloc_LDADD) $(LIBS)
+
 t-poll$(EXEEXT): $(t_poll_OBJECTS) $(t_poll_DEPENDENCIES) $(EXTRA_t_poll_DEPENDENCIES) 
        @rm -f t-poll$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(t_poll_OBJECTS) $(t_poll_LDADD) $(LIBS)
@@ -470,6 +543,10 @@ t-strerror$(EXEEXT): $(t_strerror_OBJECTS) $(t_strerror_DEPENDENCIES) $(EXTRA_t_
        @rm -f t-strerror$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(t_strerror_OBJECTS) $(t_strerror_LDADD) $(LIBS)
 
+t-stringutils$(EXEEXT): $(t_stringutils_OBJECTS) $(t_stringutils_DEPENDENCIES) $(EXTRA_t_stringutils_DEPENDENCIES) 
+       @rm -f t-stringutils$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(t_stringutils_OBJECTS) $(t_stringutils_LDADD) $(LIBS)
+
 t-syserror$(EXEEXT): $(t_syserror_OBJECTS) $(t_syserror_DEPENDENCIES) $(EXTRA_t_syserror_DEPENDENCIES) 
        @rm -f t-syserror$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(t_syserror_OBJECTS) $(t_syserror_LDADD) $(LIBS)
@@ -484,13 +561,24 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-b64dec.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-lock.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-poll.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-printf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-strerror.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-syserror.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-version.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-argparse.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-b64.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-lock-single-posix.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-lock.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-logging.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-malloc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-poll.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-printf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-strerror.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-stringutils.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-syserror.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-version.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -664,7 +752,10 @@ check-TESTS: $(TESTS)
          test "$$failed" -eq 0; \
        else :; fi
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -735,7 +826,18 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
        mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/t-argparse.Po
+       -rm -f ./$(DEPDIR)/t-b64.Po
+       -rm -f ./$(DEPDIR)/t-lock-single-posix.Po
+       -rm -f ./$(DEPDIR)/t-lock.Po
+       -rm -f ./$(DEPDIR)/t-logging.Po
+       -rm -f ./$(DEPDIR)/t-malloc.Po
+       -rm -f ./$(DEPDIR)/t-poll.Po
+       -rm -f ./$(DEPDIR)/t-printf.Po
+       -rm -f ./$(DEPDIR)/t-strerror.Po
+       -rm -f ./$(DEPDIR)/t-stringutils.Po
+       -rm -f ./$(DEPDIR)/t-syserror.Po
+       -rm -f ./$(DEPDIR)/t-version.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -781,7 +883,18 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/t-argparse.Po
+       -rm -f ./$(DEPDIR)/t-b64.Po
+       -rm -f ./$(DEPDIR)/t-lock-single-posix.Po
+       -rm -f ./$(DEPDIR)/t-lock.Po
+       -rm -f ./$(DEPDIR)/t-logging.Po
+       -rm -f ./$(DEPDIR)/t-malloc.Po
+       -rm -f ./$(DEPDIR)/t-poll.Po
+       -rm -f ./$(DEPDIR)/t-printf.Po
+       -rm -f ./$(DEPDIR)/t-strerror.Po
+       -rm -f ./$(DEPDIR)/t-stringutils.Po
+       -rm -f ./$(DEPDIR)/t-syserror.Po
+       -rm -f ./$(DEPDIR)/t-version.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -802,19 +915,21 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
-       clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \
-       ctags ctags-am distclean distclean-compile distclean-generic \
-       distclean-libtool distclean-tags distdir dvi dvi-am html \
-       html-am info info-am install install-am install-data \
-       install-data-am install-dvi install-dvi-am install-exec \
-       install-exec-am install-html install-html-am install-info \
-       install-info-am install-man install-pdf install-pdf-am \
-       install-ps install-ps-am install-strip installcheck \
-       installcheck-am installdirs maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-compile \
-       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-       tags tags-am uninstall uninstall-am
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \
+       check-am clean clean-generic clean-libtool \
+       clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/tests/etc/t-argparse.conf b/tests/etc/t-argparse.conf
new file mode 100644 (file)
index 0000000..92c373d
--- /dev/null
@@ -0,0 +1,80 @@
+# Global test config file for t-argparse
+
+# Options applied to all user's config files
+#verbose
+
+
+# The meta command echo simply prints the argument.  With a dash
+# prefix it does not prepend the file name and line number.
+[-echo Begin global config]
+
+[-echo use $${_user} to echo the current user (${_user})]
+[-echo use $${_file} to echo the current file (${_file})]
+[-echo use $${_line} to echo the current line (${_line})]
+[-echo use $${_epoch} to echo a timestamp (${_epoch})]
+
+[verbose]
+
+[user joy]
+# All the following options are applied only if the current user's
+# account name is "joy" (case-insensitive).  This ends with the next
+# user statement.  This does not affect "echo" and "verbose".
+
+# info is an alias for echo but only executed if a user secion is active.
+# For future compatibility do not use percent or dollar signs.
+[-info In user Joy but real user id ${user}]
+
+[-verbose]
+[+force]
+# All following option are forced and thus ignored when set in user
+# config files.  Valid until the next [user] statement.  Take care
+# that there are often "no-", "disable-", or "enable-" versions of
+# options; these should be explictly marked as ignored so that they
+# can't be used to override the force attribute.
+
+[ignore]
+
+# The compliance is set immutable for these users
+verbose
+
+[-force]
+not-my-option
+
+# If uncommented The next shall raise an error due to the garbage at the end.
+#<off>[+ignore]   fooo
+
+
+[+ignore-all]
+# All options are ignored.
+
+
+[-ignore]  # Comment at  line end
+# Options wich shall not be ignored.  */
+#no-verbose
+
+
+# Options applied only for user joy end here.
+[user wk ]
+[-info Options applied only for user wk follow]
+
+[ignore]
+output
+[-ignore]
+
+
+# Change the immutable attribute back to mutable.
+[-force]
+#compliance gnupg
+
+# Default key for user john
+my-option 42
+
+# Options applied only for user joy end here.
+[user *]
+[-info All the following options are applied only if the]
+[-info current user has no specific section above.]
+
+# The default algorithm for new keys is set to this.
+a-long-option
+
+[-echo End global config]
diff --git a/tests/t-argparse.c b/tests/t-argparse.c
new file mode 100644 (file)
index 0000000..4d24e5f
--- /dev/null
@@ -0,0 +1,173 @@
+/* t-argparse.c - Check the argparse API
+ * Copyright (C) 2018, 2020 g10 Code GmbH
+ *
+ * This file is part of Libgpg-error.
+ *
+ * Libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * Libgpg-error 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#define PGM "t-argparse"
+#include "t-common.h"
+
+
+static struct {
+    int verbose;
+    int debug;
+    char *outfile;
+    char *crf;
+    int myopt;
+    int echo;
+    int a_long_one;
+    char *street;
+} opt;
+
+
+
+static const char *
+my_strusage (int level)
+{
+  const char *p;
+
+  switch (level)
+    {
+    case 9: p = "LGPL-2.1-or-later"; break;
+
+    case 11: p = "t-argparse"; break;
+    case 13: p = "6.42.17-beta99"; break;
+
+    default: p = NULL;
+    }
+  return p;
+}
+
+
+
+int
+main (int argc, char **argv)
+{
+  gpgrt_opt_t opts[] = {
+    ARGPARSE_verbatim("Now for the options:\n"),
+    ARGPARSE_x  ('v', "verbose", NONE, 0, "Laut sein"),
+    ARGPARSE_s_n('e', "echo"   , ("Zeile ausgeben, damit wir sehen, "
+                                  "was wir eingegeben haben")),
+    ARGPARSE_s_n('d', "debug", "Debug\nfalls mal etwas\nschief geht"),
+    ARGPARSE_s_s('o', "output", 0 ),
+    ARGPARSE_o_s('c', "cross-ref", "cross-reference erzeugen\n" ),
+    /* Note that on a non-utf8 terminal the ß might garble the output. */
+    ARGPARSE_header("extra-options", "List of extra options"),
+    ARGPARSE_s_s('s', "street","|Straße|set the name of the street to Straße"),
+    ARGPARSE_o_i('m', "my-option", 0),
+    ARGPARSE_o_i('M', "not-my-option", 0),
+    ARGPARSE_s_n(500, "a-long-option", 0 ),
+    ARGPARSE_conffile(501, "options", "|FILE|read options from FILE"),
+    ARGPARSE_noconffile(502, "no-options", "Ignore conf files"),
+    ARGPARSE_verbatim("This epilog consists\nof only 2 lines\n"),
+    ARGPARSE_end()
+  };
+  gpgrt_argparse_t pargs = { &argc, &argv, (ARGPARSE_FLAG_ALL
+                                            | ARGPARSE_FLAG_MIXED
+                                            | ARGPARSE_FLAG_ONEDASH
+                                            | ARGPARSE_FLAG_SYS
+                                            | ARGPARSE_FLAG_USER
+                                            /* | ARGPARSE_FLAG_VERBOSE */
+                                            /* | ARGPARSE_FLAG_WITHATTR */
+                                            ) };
+  int i;
+  const char *srcdir;
+  int any_warn = 0;
+
+  gpgrt_set_strusage (my_strusage);
+  srcdir = getenv ("srcdir");
+  if (!srcdir)
+    srcdir = ".";
+  gpgrt_set_confdir (GPGRT_CONFDIR_USER, srcdir);
+  {
+    char *p = gpgrt_fnameconcat (srcdir, "etc", NULL);
+    gpgrt_set_confdir (GPGRT_CONFDIR_SYS, p);
+    xfree (p);
+  }
+
+  while (gpgrt_argparser  (&pargs, opts, PGM".conf"))
+    {
+      /* printf ("got option %3d type %0x04x\n", pargs.r_opt, pargs.r_type); */
+      /* if (pargs.r_type & (ARGPARSE_ATTR_IGNORE|ARGPARSE_ATTR_FORCE)) */
+      /*   printf ("attributes:%s%s\n", */
+      /*           (pargs.r_type & ARGPARSE_ATTR_IGNORE)? " ignore":"", */
+      /*           (pargs.r_type & ARGPARSE_ATTR_FORCE)? " force":""); */
+      /* if (pargs.r_type & ARGPARSE_OPT_IGNORE) */
+      /*   { */
+      /*     printf ("ignored\n"); */
+      /*     continue; */
+      /*   } */
+      switch (pargs.r_opt)
+        {
+        case ARGPARSE_CONFFILE:
+          printf ("current conffile='%s'\n",
+                  pargs.r_type? pargs.r.ret_str: "[cmdline]");
+          break;
+        case ARGPARSE_IS_ARG :
+          printf ("arg='%s'\n", pargs.r.ret_str);
+          break;
+
+        case 'v': opt.verbose++; break;
+        case 'e': opt.echo++; break;
+        case 'd': opt.debug++; debug=1;break;
+        case 'o': opt.outfile = pargs.r.ret_str; break;
+        case 'c': opt.crf = pargs.r_type? pargs.r.ret_str:"a.crf"; break;
+        case 'm': opt.myopt = pargs.r_type? pargs.r.ret_int : 1; break;
+        case 'M': opt.myopt = 0; break;
+        case 's': opt.street = pargs.r.ret_str; break;
+        case 500: opt.a_long_one++;  break;
+        default : pargs.err = ARGPARSE_PRINT_WARNING; any_warn = 1; break;
+       }
+    }
+  for (i=0; i < argc; i++ )
+    printf ("%3d -> (%s)\n", i, argv[i] );
+  if (opt.verbose)
+    puts ("Options:");
+  if (opt.verbose)
+    printf ("  verbose=%d\n", opt.verbose );
+  if (opt.debug)
+    printf ("  debug=%d\n", opt.debug );
+  if (opt.outfile)
+    printf ("  outfile='%s'\n", opt.outfile );
+  if (opt.crf)
+    printf ("  crffile='%s'\n", opt.crf );
+  if (opt.street)
+    printf ("  street='%s'\n", opt.street );
+  if (opt.myopt)
+    printf ("  myopt=%d\n", opt.myopt );
+  if (opt.a_long_one)
+    printf ("  a-long-one=%d\n", opt.a_long_one );
+  if (opt.echo)
+    printf ("  echo=%d\n", opt.echo );
+
+  gpgrt_argparse (NULL, &pargs, NULL);
+
+  (void)show;
+  (void)fail;
+  (void)die;
+
+  return !!any_warn;
+}
diff --git a/tests/t-argparse.conf b/tests/t-argparse.conf
new file mode 100644 (file)
index 0000000..a42d1a1
--- /dev/null
@@ -0,0 +1,73 @@
+# User test config file for t-argparse
+
+[-echo begin of user config (user=${user})]
+[+verbose]
+# Options applied to all user's config files
+echo
+
+# The next should be flagged as unexpected meta command.
+#<off>[ignore]
+
+my-option 4711
+
+not-my-option
+
+verbose
+
+[let user  ${_}Montgomery Scott$_$_  ]
+[-echo   The name of the user is: "$user". ]
+[getenv foo FOO]
+[if $_verbose]
+[-echo foo=$foo]
+[fi]
+[getenv home HOME]
+[getenv path PATH ]
+[if $_verbose]
+[-echo home=$home path=$path]
+[fi]
+
+[-info checking user]
+[if $user = Scottie's engines ]
+[fi]
+[-info checking substring check]
+[getenv home $HOME]
+[if $home =~ home ]
+  [-echo in home condition]
+[fi]
+[expand]
+[if $foo -n ]
+  cross-ref "$home/project/$user.crf"
+  [-echo FOO is set]
+  [if $home -n]
+     [-echo home is set]
+  [else]
+     [-echo home is not set]
+  [fi]
+[else]
+  [-echo FOO is not set]
+[fi]
+street Mühlenstraße
+
+[getreg x hkcu\fhghfkhkfh]
+[if $_windows]
+[if $x]
+  street $x
+[fi]
+[fi]
+
+# Print some infos from our strusage function
+[-echo strusage(9)=${_strusage9}]
+[-echo strusage(11)=${_strusage11}]
+[-echo strusage(13)=${_strusage13}]
+[-echo pgm="$_pgm" ver="$_version"]
+[if $_version -v3gt 6.42.16]
+  [-echo is > 6.42.16]
+[fi]
+[if $_version -v3ge 6.42.17]
+  [-echo is >= 6.42.17]
+[fi]
+[if $_version -v3lt 6.42.17]
+[else]
+  [-echo is not < 6.42.17]
+[fi]
+[-echo end of user config]
diff --git a/tests/t-b64.c b/tests/t-b64.c
new file mode 100644 (file)
index 0000000..db08fc0
--- /dev/null
@@ -0,0 +1,376 @@
+/* t-b64.c - b64dec tests.
+ * Copyright (C) 2017, 2018 g10 Code GmbH
+ *
+ * This file is part of Libgpg-error.
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This file 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#define PGM "t-b64"
+#include "t-common.h"
+
+static const char *test_string = "libgpg-error is free software; "
+  "you can redistribute it and/or modify it under the terms of "
+  "the GNU Lesser General Public License as published by the Free "
+  "Software Foundation; either version 2.1 of the License, or "
+  "(at your option) any later version.";
+
+static const char *test_string_b64_0 = "bGliZ3BnLWVycm9yIGlzIGZyZWUgc29"
+  "mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkgaXQgd"
+  "W5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIEx"
+  "pY2Vuc2UgYXMgcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb"
+  "247IGVpdGhlciB2ZXJzaW9uIDIuMSBvZiB0aGUgTGljZW5zZSwgb3IgKGF0IHlvdXI"
+  "gb3B0aW9uKSBhbnkgbGF0ZXIgdmVyc2lvbi4=";
+
+static const char *test_string_b64_1 =
+  "bGliZ3BnLWVycm9yIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmli\n"
+  "dXRlIGl0IGFuZC9vciBtb2RpZnkgaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBH\n"
+  "TlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5\n"
+  "IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDIu\n"
+  "MSBvZiB0aGUgTGljZW5zZSwgb3IgKGF0IHlvdXIgb3B0aW9uKSBhbnkgbGF0ZXIg\n"
+  "dmVyc2lvbi4=\n";
+
+static const char *test_string_b64_2 =
+  "-----BEGIN DATA-----\n"
+  "bGliZ3BnLWVycm9yIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmli\n"
+  "dXRlIGl0IGFuZC9vciBtb2RpZnkgaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBH\n"
+  "TlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5\n"
+  "IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDIu\n"
+  "MSBvZiB0aGUgTGljZW5zZSwgb3IgKGF0IHlvdXIgb3B0aW9uKSBhbnkgbGF0ZXIg\n"
+  "dmVyc2lvbi4=\n"
+  "-----END DATA-----\n";
+
+static const char *test_string_b64_3 =
+  "-----BEGIN PGP ARMORED FILE-----\n"
+  "\n"
+  "bGliZ3BnLWVycm9yIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmli\n"
+  "dXRlIGl0IGFuZC9vciBtb2RpZnkgaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBH\n"
+  "TlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5\n"
+  "IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDIu\n"
+  "MSBvZiB0aGUgTGljZW5zZSwgb3IgKGF0IHlvdXIgb3B0aW9uKSBhbnkgbGF0ZXIg\n"
+  "dmVyc2lvbi4=\n"
+  "=4BMJ\n"
+  "-----END PGP ARMORED FILE-----\n";
+
+static const char *test_blob_1 = "\x01\x03\x04\xff";
+static const char *test_blob_1_b64_0 = "AQME/w==";
+static const char *test_blob_2 = "\x01\x03\x04\xff""A";
+static const char *test_blob_2_b64_0 = "AQME/0E=";
+static const char *test_blob_3 = "\x01\x03\x04\xff""AB";
+static const char *test_blob_3_b64_0 = "AQME/0FC";
+
+
+#define FAIL(a)  do { fail ("line %d: test %d failed\n", __LINE__, (a));  \
+                    } while(0)
+
+static gpg_error_t
+test_b64enc_string (const char *string, const char *expected, const char *title)
+{
+  gpg_err_code_t err;
+  estream_t fp;
+  gpgrt_b64state_t state;
+  char *result;
+
+  fp = es_fopenmem (0, "rwb");
+  if (!fp)
+    die ("es_fopenmem failed: %s\n", gpg_strerror (gpg_error_from_syserror ()));
+
+  state = gpgrt_b64enc_start (fp, title);
+  if (!state)
+    {
+      err = gpg_err_code_from_syserror ();
+      fail ("gpgrt_b64enc_start failed: %s\n", gpg_strerror (err));
+      return err;
+    }
+
+  err = gpgrt_b64enc_write (state, string, strlen (string));
+  if (err)
+    {
+      free (state);
+      fail ("gpgrt_b64enc_write failed: %s\n", gpg_strerror (err));
+      return err;
+    }
+
+  err = gpgrt_b64enc_finish (state);
+  if (err)
+    {
+      fail ("gpgrt_b64enc_finish failed: %s\n", gpg_strerror (err));
+      return err;
+    }
+
+  es_fputc (0, fp);
+  if (es_fclose_snatch (fp, (void**)&result, NULL))
+    die ("es_fclose_snatch failed: %s\n",
+         gpg_strerror (gpg_error_from_syserror ()));
+
+  if (strcmp (result, expected))
+    {
+      if (verbose)
+        {
+          gpgrt_log_debug_string (result,   "result: ");
+          gpgrt_log_debug_string (expected, "expect: ");
+        }
+      return GPG_ERR_FALSE;
+    }
+
+  es_free (result);
+  return 0;
+}
+
+
+static gpg_error_t
+test_b64dec_string (const char *string, const char *expected, const char *title)
+{
+  gpg_error_t err;
+  gpgrt_b64state_t state;
+  char *buffer;
+  size_t len;
+
+  len = strlen (string);
+  buffer = malloc (strlen (string) + 1);
+  if (!buffer)
+    {
+      err = gpg_error_from_syserror ();
+      return err;
+    }
+  strcpy (buffer, string);
+
+  state = gpgrt_b64dec_start (title);
+  if (!state)
+    {
+      err = gpg_err_code_from_syserror ();
+      fail ("gpgrt_b64dec_start failed: %s\n", gpg_strerror (err));
+      free (buffer);
+      return err;
+    }
+
+  err = gpgrt_b64dec_proc (state, buffer, len, &len);
+  if (err)
+    {
+      if (gpg_err_code (err) != GPG_ERR_EOF)
+        {
+          free (buffer);
+          free (state);
+          return err;
+        }
+    }
+
+  err = gpgrt_b64dec_finish (state);
+  if (err)
+    {
+      free (buffer);
+      return err;
+    }
+
+  if (len != strlen (expected) || strncmp (buffer, expected, len))
+    {
+      if (verbose)
+        {
+          gpgrt_log_debug_string (buffer,   "result(len=%zu): ", len);
+          gpgrt_log_debug_string (expected, "expect(len=%zu): ",
+                                  strlen (expected));
+        }
+      free (buffer);
+      return GPG_ERR_FALSE;
+    }
+
+  free (buffer);
+  return 0;
+}
+
+
+static void
+encoder_tests (void)
+{
+  gpg_err_code_t err;
+
+  if (verbose)
+    show ("running encoder tests\n");
+
+  err = test_b64enc_string (test_string, test_string_b64_0, "");
+  if (err)
+    fail ("encoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+  err = test_b64enc_string (test_string, test_string_b64_1, NULL);
+  if (err)
+    fail ("encoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+  err = test_b64enc_string (test_string, test_string_b64_2, "DATA");
+  if (err)
+    fail ("encoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+  err = test_b64enc_string (test_string, test_string_b64_3, "PGP ARMORED FILE");
+  if (err)
+    fail ("encoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+
+  /* Note that the _test_ function dows not allow to provide a string
+   * with an empdded Nul.  */
+  err = test_b64enc_string (test_blob_1, test_blob_1_b64_0, "");
+  if (err)
+    fail ("encoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+  err = test_b64enc_string (test_blob_2, test_blob_2_b64_0, "");
+  if (err)
+    fail ("encoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+  err = test_b64enc_string (test_blob_3, test_blob_3_b64_0, "");
+  if (err)
+    fail ("encoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+
+  err = test_b64enc_string ("@", "QA==", "");
+  if (err)
+    fail ("encoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+  err = test_b64enc_string ("@", "QA==\n", NULL);
+  if (err)
+    fail ("encoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+  err = test_b64enc_string ("@",
+                            "-----BEGIN PGP SOMETHING-----\n"
+                            "\n"
+                            "QA==\n"
+                            "=eMoB\n"
+                            "-----END PGP SOMETHING-----\n",
+                            "PGP SOMETHING");
+  if (err)
+    fail ("encoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+
+  err = test_b64enc_string ("", "", "");
+  if (err)
+    fail ("encoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+  err = test_b64enc_string ("", "", NULL);
+  if (err)
+    fail ("encoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+  err = test_b64enc_string ("", "", "PGP SOMETHING");
+  if (err)
+    fail ("encoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+}
+
+
+static void
+decoder_tests (void)
+{
+  gpg_err_code_t err;
+
+  if (verbose)
+    show ("running decoder tests\n");
+
+  err = test_b64dec_string (test_string_b64_0, test_string, NULL);
+  if (err)
+    fail ("decoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+
+  err = test_b64dec_string (test_string_b64_1, test_string, NULL);
+  if (err)
+    fail ("decoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+
+  err = test_b64dec_string (test_string_b64_2, test_string, "");
+  if (err)
+    fail ("decoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+
+  err = test_b64dec_string (test_string_b64_2, test_string, NULL);
+  if (err != GPG_ERR_BAD_DATA)
+    fail ("decoder test at line %d failed: %s\n", __LINE__, gpg_strerror (err));
+
+}
+
+
+static gpg_error_t
+extra_tests (void)
+{
+  gpg_err_code_t err;
+  gpgrt_b64state_t state;
+
+  if (verbose)
+    show ("running extra tests\n");
+
+  /* Check that we detect mismacthed use of enc and dec functions.  */
+  state = gpgrt_b64enc_start (es_stdout, NULL);
+  if (!state)
+    {
+      err = gpg_err_code_from_syserror ();
+      fail ("gpgrt_b64enc_start failed: %s\n", gpg_strerror (err));
+      return err;
+    }
+
+  err = gpgrt_b64dec_finish (state);
+  if (err != GPG_ERR_CONFLICT)
+    {
+      fail ("gpgrt_b64dec_finish failed: %s\n", gpg_strerror (err));
+      return err;
+    }
+
+  state = gpgrt_b64dec_start (NULL);
+  if (!state)
+    {
+      err = gpg_err_code_from_syserror ();
+      fail ("gpgrt_b64dec_start failed: %s\n", gpg_strerror (err));
+      return err;
+    }
+
+  err = gpgrt_b64enc_finish (state);
+  if (err != GPG_ERR_CONFLICT)
+    {
+      fail ("gpgrt_b64enc_finish failed: %s\n", gpg_strerror (err));
+      return err;
+    }
+
+  return 0;
+}
+
+
+int
+main (int argc, char **argv)
+{
+  int last_argc = -1;
+
+  if (argc)
+    {
+      argc--; argv++;
+    }
+  while (argc && last_argc != argc )
+    {
+      last_argc = argc;
+      if (!strcmp (*argv, "--help"))
+        {
+          puts (
+"usage: ./" PGM " [options]\n"
+"\n"
+"Options:\n"
+"  --verbose      Show what is going on\n"
+"  --debug        Flyswatter\n"
+);
+          exit (0);
+        }
+      if (!strcmp (*argv, "--verbose"))
+        {
+          verbose = 1;
+          argc--; argv++;
+        }
+      else if (!strcmp (*argv, "--debug"))
+        {
+          verbose = debug = 1;
+          argc--; argv++;
+        }
+    }
+
+  encoder_tests ();
+  decoder_tests ();
+  extra_tests ();
+
+  return !!errorcount;
+}
diff --git a/tests/t-b64dec.c b/tests/t-b64dec.c
deleted file mode 100644 (file)
index aae208b..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/* t-b64dec.c - b64dec test.
-   Copyright (C) 2017 g10 Code GmbH
-
-   This file is part of libgpg-error.
-
-   libgpg-error is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public License
-   as published by the Free Software Foundation; either version 2.1 of
-   the License, or (at your option) any later version.
-
-   libgpg-error 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with libgpgme-error; if not, write to the Free
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301, USA.  */
-
-#if HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#include <gpg-error.h>
-
-static const char *test_b64_string = "bGliZ3BnLWVycm9yIGlzIGZyZWUgc29"
-  "mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkgaXQgd"
-  "W5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIEx"
-  "pY2Vuc2UgYXMgcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb"
-  "247IGVpdGhlciB2ZXJzaW9uIDIuMSBvZiB0aGUgTGljZW5zZSwgb3IgKGF0IHlvdXI"
-  "gb3B0aW9uKSBhbnkgbGF0ZXIgdmVyc2lvbi4=";
-
-static const char *test_string = "libgpg-error is free software; "
-  "you can redistribute it and/or modify it under the terms of "
-  "the GNU Lesser General Public License as published by the Free "
-  "Software Foundation; either version 2.1 of the License, or "
-  "(at your option) any later version.";
-
-#define fail(a)  do { fprintf (stderr, "%s:%d: test %d failed\n",\
-                               __FILE__,__LINE__, (a));          \
-                     errcount++;                                 \
-                   } while(0)
-
-static int errcount;
-
-static gpg_error_t
-test_b64dec_string (const char *string, const char *expected)
-{
-  gpg_error_t err;
-  gpgrt_b64state_t state;
-  char *buffer;
-  size_t len;
-
-  len = strlen (string);
-  buffer = malloc (strlen (string) + 1);
-  if (!buffer)
-    {
-      err = gpg_error_from_syserror ();
-      return err;
-    }
-
-  state = gpgrt_b64dec_start ("");
-  if (!state)
-    {
-      err = gpg_error_from_syserror ();
-      free (buffer);
-      return err;
-    }
-
-  err = gpgrt_b64dec_proc (state, buffer, len, &len);
-  if (err)
-    {
-      if (gpg_err_code (err) != GPG_ERR_EOF)
-        {
-          free (buffer);
-          free (state);
-          return err;
-        }
-    }
-
-  err = gpgrt_b64dec_finish (state);
-  if (err)
-    {
-      free (buffer);
-      return err;
-    }
-
-  if (strncmp (buffer, expected, len) == 0)
-    err = 0;
-  else
-    err = GPG_ERR_INTERNAL;
-
-  free (buffer);
-  return err;
-}
-
-
-
-int
-main (int argc, char **argv)
-{
-  gpg_error_t err;
-
-  (void)argc;
-  (void)argv;
-
-  err = test_b64dec_string (test_b64_string, test_string);
-
-  if (err)
-    {
-      fail (1);
-      return 1;
-    }
-  else
-    return 0;
-}
index e11bca9..db496e2 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <stdarg.h>
 
-#include "../src/gpg-error.h"
+#include "../src/gpgrt.h"
 
 #ifndef PGM
 # error Macro PGM not defined.
@@ -34,6 +34,38 @@ static int debug;
 static int errorcount;
 
 
+static void die (const char *format, ...) GPGRT_ATTR_NR_PRINTF(1,2);
+static void fail (const char *format, ...) GPGRT_ATTR_PRINTF(1,2);
+static void show (const char *format, ...) GPGRT_ATTR_PRINTF(1,2);
+
+
+static void *
+xmalloc (size_t n)
+{
+  char *p = gpgrt_malloc (n);
+  if (!p)
+    die ("out of core\n");
+  return p;
+}
+
+static char *
+xstrdup (const char *s)
+{
+  char *p = gpgrt_strdup (s);
+  if (!p)
+    die ("out of core\n");
+  return p;
+}
+
+static void
+xfree (void *p)
+{
+  if (p)
+    gpgrt_free (p);
+}
+
+
+
 static void
 die (const char *format, ...)
 {
@@ -52,6 +84,8 @@ die (const char *format, ...)
 #ifdef HAVE_FLOCKFILE
   funlockfile (stderr);
 #endif
+  xfree (xstrdup (""));  /* To avoid compiler warnings.  */
+  xfree (xmalloc (16));  /* To avoid compiler warnings.  */
   exit (1);
 }
 
diff --git a/tests/t-lock-single-posix.c b/tests/t-lock-single-posix.c
new file mode 100644 (file)
index 0000000..e3432b1
--- /dev/null
@@ -0,0 +1,165 @@
+/* t-lock-single-posix.c - Check the lock functions with single thread
+ * Copyright (C) 2021 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#define PGM "t-lock-single"
+
+#include "t-common.h"
+
+GPGRT_LOCK_DEFINE (the_lock);
+
+static int locking_used;
+
+#ifdef USE_POSIX_THREADS_FROM_LIBC
+#include <pthread.h>
+
+static void *
+thread_func (void *arg)
+{
+  (void)arg;
+  return NULL;
+}
+#endif
+
+static void
+run_test (void)
+{
+  gpg_err_code_t rc;
+
+  rc = gpgrt_lock_lock (&the_lock);
+  if (rc)
+    fail ("gpgrt_lock_lock failed at %d: %s", __LINE__, gpg_strerror (rc));
+
+  rc = gpgrt_lock_unlock (&the_lock);
+  if (rc)
+    fail ("gpgrt_lock_unlock failed at %d: %s", __LINE__,gpg_strerror (rc));
+
+  if (locking_used)
+    /*It was incremented, even with single thread.  */
+    fail ("Single thread situation is not correctly handled\n");
+
+#ifdef USE_POSIX_THREADS_FROM_LIBC
+  /*
+   * With !USE_POSIX_THREADS_FROM_LIBC, it is determined at link time.
+   *
+   * With USE_POSIX_THREADS_FROM_LIBC, it is determined at runtime,
+   * and the condition is changed when an application actually uses
+   * thread.
+   */
+  {
+    pthread_t rthread;
+    pthread_create (&rthread, NULL, thread_func, NULL);
+
+    rc = gpgrt_lock_lock (&the_lock);
+    if (rc)
+      fail ("gpgrt_lock_lock failed at %d: %s", __LINE__, gpg_strerror (rc));
+
+    rc = gpgrt_lock_unlock (&the_lock);
+    if (rc)
+      fail ("gpgrt_lock_unlock failed at %d: %s", __LINE__,gpg_strerror (rc));
+
+    pthread_join (rthread, NULL);
+
+    if (!locking_used)
+      /*It was *NOT* incremented, even with multiple threads.  */
+      fail ("Multiple threads situation is not correctly handled\n");
+  }
+#endif
+}
+
+
+static void
+syscall_clam_pre (void)
+{
+  if (debug)
+    show ("syscall pre called\n");
+  locking_used++;
+}
+
+static void
+syscall_clam_post (void)
+{
+  if (debug)
+    show ("syscall post called\n");
+}
+
+int
+main (int argc, char **argv)
+{
+  int last_argc = -1;
+  int rc;
+
+  if (argc)
+    {
+      argc--; argv++;
+    }
+  while (argc && last_argc != argc )
+    {
+      last_argc = argc;
+      if (!strcmp (*argv, "--help"))
+        {
+          puts (
+"usage: ./t-lock-single [options]\n"
+"\n"
+"Options:\n"
+"  --verbose      Show what is going on\n"
+"  --debug        Flyswatter\n"
+);
+          exit (0);
+        }
+      if (!strcmp (*argv, "--verbose"))
+        {
+          verbose = 1;
+          argc--; argv++;
+        }
+      else if (!strcmp (*argv, "--debug"))
+        {
+          verbose = debug = 1;
+          argc--; argv++;
+        }
+    }
+
+  if (!gpg_error_check_version (GPG_ERROR_VERSION))
+    {
+      die ("gpg_error_check_version returned an error");
+      errorcount++;
+    }
+
+  gpgrt_set_syscall_clamp (syscall_clam_pre, syscall_clam_post);
+
+  rc = gpgrt_lock_init (&the_lock);
+  if (rc)
+    fail ("gpgrt_lock_init failed at %d: %s", __LINE__, gpg_strerror (rc));
+
+  run_test ();
+
+  gpgrt_lock_destroy (&the_lock);
+
+  return errorcount ? 1 : 0;
+}
diff --git a/tests/t-logging.c b/tests/t-logging.c
new file mode 100644 (file)
index 0000000..4fcb64b
--- /dev/null
@@ -0,0 +1,250 @@
+/* t-logging.c - Check the logging interface
+ * Copyright (C) 2018 g10 Code GmbH
+ *
+ * This file is part of Libgpg-error.
+ *
+ * Libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * Libgpg-error 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <unistd.h>
+
+#define PGM "t-logging"
+#include "t-common.h"
+
+/* The memory based estream we use for logging.  */
+static estream_t logmemfp;
+
+
+static const char *
+my_strusage (int level)
+{
+  const char *p;
+
+  switch (level)
+    {
+    case 9: p = "LGPL-2.1-or-later"; break;
+    case 11: p = PGM; break;
+    default: p = NULL;
+    }
+  return p;
+}
+
+
+/* Read all data from the log stream into a new malloced buffer and return
+ * that buffer.  The buffer is always 0 terminated.  Either returns a
+ * string or dies.  The stream will be truncated to zero. */
+static char *
+log_to_string (void)
+{
+#define NCHUNK 1024
+  estream_t stream = gpgrt_log_get_stream ();
+  char *buffer;
+  size_t bufsize, buflen;
+  size_t nread;
+
+  gpgrt_log_flush ();
+  gpgrt_rewind (stream);
+
+  buffer = NULL;
+  buflen = bufsize = 0;
+  do
+    {
+      bufsize += NCHUNK;
+      buffer = realloc (buffer, bufsize+1);
+      if (!buffer)
+        die ("malloc failed at line %d\n", __LINE__);
+
+      nread = gpgrt_fread (buffer + buflen, 1, NCHUNK, stream);
+      if (nread < NCHUNK && gpgrt_ferror (stream))
+        die ("fread failed at line %d: %s\n", __LINE__,
+             gpg_strerror (gpg_err_code_from_syserror ()));
+      buflen += nread;
+    }
+  while (nread == NCHUNK);
+  buffer[nread] = 0;
+
+  if (strlen (buffer) != buflen)
+    fail ("stream_to_string detected an embedded nul");
+
+  gpgrt_ftruncate (stream, 0);
+  return buffer;
+#undef NCHUNK
+}
+
+
+static void
+check_log_info (void)
+{
+  char *logbuf;
+
+  log_info ("first log\n");
+  logbuf = log_to_string ();
+  if (strcmp (logbuf, "t-logging: first log\n"))
+    fail ("log_info test failed at line %d\n", __LINE__);
+  free (logbuf);
+
+  /* The second line should not have a LF.  */
+  log_info ("second log line");
+  log_info ("third log line");
+  logbuf = log_to_string ();
+  if (strcmp (logbuf, ("t-logging: second log line\n"
+                       "t-logging: third log line")))
+    fail ("log_info test failed at line %d\n", __LINE__);
+  free (logbuf);
+
+  /* Now a multi line log.  */
+  log_info ("This is log line 1\nand 2\nand 3\n");
+  logbuf = log_to_string ();
+  if (strcmp (logbuf, ("t-logging: This is log line 1\n"
+                       "and 2\n"
+                       "and 3\n")))
+    fail ("log_info test failed at line %d\n", __LINE__);
+  free (logbuf);
+
+  /* With arguments.  */
+  log_info ("file '%s' line %d: %s\n", "/foo/bar.txt", 20, "not found");
+  logbuf = log_to_string ();
+  if (strcmp (logbuf, "t-logging: file '/foo/bar.txt' line 20: not found\n"))
+    fail ("log_info test failed at line %d\n", __LINE__);
+  free (logbuf);
+
+  /* With arguments and a control char in the string arg.  */
+  log_info ("file '%s' line %d: %s\n", "/foo/bar.txt\b", 20, "not found");
+  logbuf = log_to_string ();
+  if (strcmp (logbuf,
+              "t-logging: file '/foo/bar.txt\\b' line 20: not found\n"))
+    fail ("log_info test failed at line %d\n", __LINE__);
+  free (logbuf);
+
+  /* With arguments and the prefix in a string arg.  */
+  log_info ("file '%s': %s\n", "/foo/bar.txt\nt-logging", "not \x01 found");
+  logbuf = log_to_string ();
+  if (strcmp (logbuf,
+              "t-logging: file '/foo/bar.txt\\nt-logging': not \\x01 found\n"))
+    fail ("log_info test failed at line %d\n", __LINE__);
+  free (logbuf);
+
+  /* With arguments and byte with bit 7 set in a string arg.  */
+  log_info ("file '%s': %s\n", "/foo/bar.txt\n", "not \x81 found");
+  logbuf = log_to_string ();
+  if (strcmp (logbuf,
+              "t-logging: file '/foo/bar.txt\\n': not \x81 found\n"))
+    fail ("log_info test failed at line %d\n", __LINE__);
+  /* show ("===>%s<===\n", logbuf); */
+
+  free (logbuf);
+}
+
+
+static void
+check_with_pid (void)
+{
+  char testbuf[100];
+  char *logbuf;
+
+  snprintf (testbuf, sizeof testbuf, "t-logging[%u]: ",
+            (unsigned int)getpid ());
+
+  log_info ("first log\n");
+  logbuf = log_to_string ();
+  if (strncmp (logbuf, testbuf, strlen (testbuf))
+      || strcmp (logbuf+strlen (testbuf), "first log\n"))
+    fail ("log_with_pid test failed at line %d\n", __LINE__);
+  free (logbuf);
+
+  log_info ("This is log line 1\nand 2\nand 3\n");
+  logbuf = log_to_string ();
+  if (strncmp (logbuf, testbuf, strlen (testbuf))
+      || strcmp (logbuf+strlen (testbuf), ("This is log line 1\n"
+                                           "and 2\n"
+                                           "and 3\n")))
+    fail ("log_with_pid test failed at line %d\n", __LINE__);
+  free (logbuf);
+}
+
+
+static void
+check_log_error (void)
+{
+  char *logbuf;
+
+  if (log_get_errorcount (0))
+    fail ("log_get_errorcount() != 0 at line %d\n", __LINE__);
+
+  log_error ("Hola, something went wrong\n");
+  if (log_get_errorcount (0) != 1)
+    fail ("log_get_errorcount() != 1 at line %d\n", __LINE__);
+  logbuf = log_to_string ();
+  if (strcmp (logbuf, "t-logging: Hola, something went wrong\n"))
+    fail ("log_info test failed at line %d\n", __LINE__);
+  free (logbuf);
+  if (log_get_errorcount (0) != 1)
+    fail ("log_get_errorcount() != 1 at line %d\n", __LINE__);
+  if (log_get_errorcount (1) != 1)  /* note: clear returns old value.  */
+    fail ("log_get_errorcount() != 1 at line %d\n", __LINE__);
+  if (log_get_errorcount (0))
+    fail ("log_get_errorcount() != 0 after clear at line %d\n", __LINE__);
+}
+
+
+int
+main (int argc, char **argv)
+{
+  gpgrt_opt_t opts[] = {
+    ARGPARSE_x  ('v', "verbose", NONE, 0, "Print more diagnostics"),
+    ARGPARSE_s_n('d', "debug", "Flyswatter"),
+    ARGPARSE_end()
+  };
+  gpgrt_argparse_t pargs = { &argc, &argv, 0 };
+
+  gpgrt_set_strusage (my_strusage);
+  gpgrt_log_set_prefix (gpgrt_strusage (11), GPGRT_LOG_WITH_PREFIX);
+
+  while (gpgrt_argparse  (NULL, &pargs, opts))
+    {
+      switch (pargs.r_opt)
+        {
+        case 'v': verbose++; break;
+        case 'd': debug++; break;
+        default : pargs.err = ARGPARSE_PRINT_ERROR; break;
+       }
+    }
+  gpgrt_argparse (NULL, &pargs, NULL);
+
+  show ("testing logging using a memory log stream\n");
+  logmemfp = gpgrt_fopenmem (0, "w+b");
+  if (!logmemfp)
+    die ("fopenmem failed at line %d\n", __LINE__);
+  gpgrt_log_set_sink (NULL, logmemfp, -1);
+
+  check_log_info ();
+  gpgrt_log_set_prefix (NULL, GPGRT_LOG_WITH_PREFIX|GPGRT_LOG_WITH_PID);
+  check_with_pid ();
+  gpgrt_log_set_prefix (NULL, GPGRT_LOG_WITH_PREFIX);
+  check_log_error ();
+
+  /* FIXME: Add more tests.  */
+
+  show ("testing logging finished\n");
+  return !!errorcount;
+}
diff --git a/tests/t-malloc.c b/tests/t-malloc.c
new file mode 100644 (file)
index 0000000..be2ec81
--- /dev/null
@@ -0,0 +1,141 @@
+/* t-malloc.c - Check some malloc functions
+ * Copyright (C) 2020 g10 Code GmbH
+ *
+ * This file is part of Libgpg-error.
+ *
+ * Libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * Libgpg-error 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <unistd.h>
+#include <errno.h>
+
+#define PGM "t-malloc"
+#include "t-common.h"
+
+
+static const char *
+my_strusage (int level)
+{
+  const char *p;
+
+  switch (level)
+    {
+    case 9: p = "LGPL-2.1-or-later"; break;
+    case 11: p = PGM; break;
+    default: p = NULL;
+    }
+  return p;
+}
+
+
+static void
+check_reallocarray (void)
+{
+  struct foo_s { const char *a; int b; } *array;
+  size_t n;
+
+  array = gpgrt_calloc (10, sizeof *array);
+  if (!array)
+    die ("%s: malloc failed\n", __func__);
+
+  for (n=0; n < 10; n++)
+    if (array[n].a || array[n].b)
+      fail ("%s: array not cleared at index %zu\n", __func__, n);
+
+  for (n=0; n < 10; n++)
+    {
+      array[n].a = "dummy string";
+      array[n].b = 100+n;
+    }
+
+  array = gpgrt_reallocarray (array, 10, 20, sizeof *array);
+  if (!array)
+    die ("%s: realloc failed\n", __func__);
+
+  for (n=0; n < 10; n++)
+    {
+      if (!array[n].a || strcmp (array[n].a, "dummy string"))
+        fail ("%s: string in realloced array changed at index %zu\n",
+              __func__, n);
+
+      if (array[n].b != 100 + n)
+        fail ("%s: number in realloced array changed at index %zu\n",
+              __func__, n);
+    }
+  for (n=10; n < 20; n++)
+    if (array[n].a || array[n].b)
+      fail ("%s: realloced array not cleared at index %zu\n", __func__, n);
+
+  /* We can't easily check whether the reallocated array does not
+   * iniitialze in the case OLDN is equal or larger to N, so we skip
+   * this.  Let's do a simple shrink test instead.  */
+
+  array = gpgrt_reallocarray (array, 20, 7, sizeof *array);
+  if (!array)
+    die ("%s: realloc (shrinking) failed\n", __func__);
+
+  for (n=0; n < 7; n++)
+    {
+      if (!array[n].a || strcmp (array[n].a, "dummy string"))
+        fail ("%s: string in shrunk array changed at index %zu\n",
+              __func__, n);
+
+      if (array[n].b != 100 + n)
+        fail ("%s: number in shrunk array changed at index %zu\n",
+              __func__, n);
+    }
+
+  xfree (array);
+}
+
+
+int
+main (int argc, char **argv)
+{
+  gpgrt_opt_t opts[] = {
+    ARGPARSE_x  ('v', "verbose", NONE, 0, "Print more diagnostics"),
+    ARGPARSE_s_n('d', "debug", "Flyswatter"),
+    ARGPARSE_end()
+  };
+  gpgrt_argparse_t pargs = { &argc, &argv, 0 };
+
+  gpgrt_set_strusage (my_strusage);
+  gpgrt_log_set_prefix (gpgrt_strusage (11), GPGRT_LOG_WITH_PREFIX);
+
+  while (gpgrt_argparse  (NULL, &pargs, opts))
+    {
+      switch (pargs.r_opt)
+        {
+        case 'v': verbose++; break;
+        case 'd': debug++; break;
+        default : pargs.err = ARGPARSE_PRINT_ERROR; break;
+       }
+    }
+  gpgrt_argparse (NULL, &pargs, NULL);
+
+  show ("testing malloc functions\n");
+
+  check_reallocarray ();
+
+  return !!errorcount;
+}
index 7fba012..c261838 100644 (file)
 static char *one_test_buf1;
 static int   one_test_rc1;
 
+
+
+
+/* Read all data from STREAM into a new malloced buffer and return
+ * that buffer.  The buffer is always 0 terminated.  Either returns a
+ * string or dies.  The stream will be trunctaed to zero. */
+static char *
+stream_to_string (gpgrt_stream_t stream)
+{
+#define NCHUNK 1024
+  char *buffer;
+  size_t bufsize, buflen;
+  size_t nread;
+
+  gpgrt_rewind (stream);
+
+  buffer = NULL;
+  buflen = bufsize = 0;
+  do
+    {
+      bufsize += NCHUNK;
+      buffer = realloc (buffer, bufsize+1);
+      if (!buffer)
+        die ("malloc failed at line %d\n", __LINE__);
+
+      nread = gpgrt_fread (buffer + buflen, 1, NCHUNK, stream);
+      if (nread < NCHUNK && gpgrt_ferror (stream))
+        die ("fread failed at line %d: %s\n", __LINE__, strerror (errno));
+      buflen += nread;
+    }
+  while (nread == NCHUNK);
+  buffer[nread] = 0;
+
+  if (strlen (buffer) != buflen)
+    fail ("stream_to_string detected an embedded nul");
+
+  gpgrt_ftruncate (stream, 0);
+  return buffer;
+#undef NCHUNK
+}
+
+
+
 static void
 one_test_x0 (const char *format, ...)
 {
@@ -158,6 +201,9 @@ run_tests (void)
   one_test_2 ("%d %% %d", 17, 768114563);
   one_test_2 ("%d %% %d", 17, -768114563);
 
+  /* Checking thousands is not easy because it depends on the locale.  */
+  /* one_test_1 ("%'d", 768114563); */
+
   one_test_1 ("%d", 17);
   one_test_1 ("%4d", 17);
   one_test_1 ("%40d", 17);
@@ -375,6 +421,74 @@ check_snprintf (void)
 }
 
 
+struct sfstate_s
+{
+  char *last_result;
+};
+
+static char *
+string_filter (const char *string, int no, void *opaque)
+{
+  struct sfstate_s *state = opaque;
+
+  free (state->last_result);
+  if (no == -1)
+    {
+      state->last_result = NULL;
+      return NULL;
+    }
+  if (no == 3)
+    state->last_result = NULL;
+  else
+    state->last_result = strdup (string? string : "[==>Niente<==]");
+
+  return state->last_result;
+}
+
+
+static void
+check_fprintf_sf (void)
+{
+  volatile char *nullptr = NULL; /* Avoid compiler warning.  */
+  struct sfstate_s sfstate = {NULL};
+  gpgrt_stream_t stream;
+  const char *expect;
+  char *result;
+
+  stream = gpgrt_fopenmem (0, "w+b");
+  if (!stream)
+    die ("fopenmem failed at line %d\n", __LINE__);
+
+  gpgrt_fprintf_sf (stream, string_filter, &sfstate,
+                    "%s a=%d b=%s c=%d d=%.8s null=%s\n",
+                    nullptr, 1, "foo\x01 bar", 2,
+                    "a longer string", nullptr);
+  expect = "[==>Niente<==] a=1 b=foo\x01 bar c=2 d=a longer null=(null)\n";
+  result = stream_to_string (stream);
+  if (strcmp (result, expect))
+    {
+      show ("expect: '%s'\n", expect);
+      show ("result: '%s'\n", result);
+      fail ("fprintf_sf failed at %d\n", __LINE__);
+    }
+  free (result);
+
+  gpgrt_fprintf_sf (stream, string_filter, &sfstate,
+                    "a=%d b=%s c=%d d=%.8s e=%s\n",
+                    1, "foo\n bar", 2, nullptr, "");
+  expect = "a=1 b=foo\n bar c=2 d=[==>Nien e=\n";
+  result = stream_to_string (stream);
+  if (strcmp (result, expect))
+    {
+      show ("expect: '%s'\n", expect);
+      show ("result: '%s'\n", result);
+      fail ("fprintf_sf failed at %d\n", __LINE__);
+    }
+  free (result);
+
+  gpgrt_fclose (stream);
+}
+
 
 int
 main (int argc, char **argv)
@@ -420,6 +534,7 @@ main (int argc, char **argv)
 
   run_tests ();
   check_snprintf ();
+  check_fprintf_sf ();
 
 #ifdef __GLIBC__
   return !!errorcount;
diff --git a/tests/t-stringutils.c b/tests/t-stringutils.c
new file mode 100644 (file)
index 0000000..8879e1a
--- /dev/null
@@ -0,0 +1,395 @@
+/* t-stringutils.c - Check some string utilities
+ * Copyright (C) 2020 g10 Code GmbH
+ *
+ * This file is part of Libgpg-error.
+ *
+ * Libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * Libgpg-error 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <unistd.h>
+#ifdef HAVE_STAT
+# include <sys/stat.h>
+#endif
+#include <sys/types.h>
+#ifdef HAVE_PWD_H
+# include <pwd.h>
+#endif
+#include <errno.h>
+#ifdef HAVE_W32_SYSTEM
+# include <windows.h>
+#endif
+
+#define PGM "t-stringutils"
+#include "t-common.h"
+
+
+static const char *
+my_strusage (int level)
+{
+  const char *p;
+
+  switch (level)
+    {
+    case 9: p = "LGPL-2.1-or-later"; break;
+    case 11: p = PGM; break;
+    default: p = NULL;
+    }
+  return p;
+}
+
+
+const char *
+mygethome (void)
+{
+  static char *home_buffer;
+
+  if (!home_buffer)
+    {
+      char *home = getenv("HOME");
+
+      if(home)
+        home_buffer = xstrdup (home);
+#if defined(HAVE_GETPWUID) && defined(HAVE_PWD_H)
+      else
+        {
+          struct passwd *pwd;
+
+          pwd = getpwuid (getuid());
+          if (pwd)
+            home_buffer = xstrdup (pwd->pw_dir);
+        }
+#endif
+    }
+  return home_buffer;
+}
+
+
+#ifdef HAVE_W32_SYSTEM
+static wchar_t *
+utf8_to_wchar (const char *string)
+{
+  int n;
+  wchar_t *result;
+  size_t nbytes;
+  int cbmultibyte = -1;
+
+  n = MultiByteToWideChar (CP_UTF8, 0, string, cbmultibyte, NULL, 0);
+  if (n < 0 || (n+1) <= 0)
+    die ("utf8_to_wchar failed\n");
+  nbytes = (size_t)(n+1) * sizeof(*result);
+  if (nbytes / sizeof(*result) != (n+1))
+    die ("utf8_to_wchar failed\n");
+  result = xmalloc (nbytes);
+  n = MultiByteToWideChar (CP_UTF8, 0, string, cbmultibyte, result, n);
+  if (n < 0)
+    die ("utf8_to_wchar failed\n");
+  return result;
+
+}
+
+
+static char *
+wchar_to_utf8 (const wchar_t *string, size_t length)
+{
+  int n;
+  char *result;
+
+  n = WideCharToMultiByte (CP_UTF8, 0, string, length, NULL, 0, NULL, NULL);
+  if (n < 0 || (n+1) <= 0)
+    die ("wchar_to_utf8 failed\n");
+
+  result = xmalloc (n+1);
+  if (!result)
+    die ("wchar_to_utf8 failed\n");
+  n = WideCharToMultiByte (CP_UTF8, 0, string, length, result, n, NULL, NULL);
+  if (n < 0)
+    die ("wchar_to_utf8 failed\n");
+  result[n] = 0;
+  return result;
+}
+#endif
+
+static char *
+mygetcwd (void)
+{
+#ifdef HAVE_W32_SYSTEM
+  wchar_t wbuffer[MAX_PATH + sizeof(wchar_t)];
+  wchar_t *wp;
+  DWORD wlen;
+  char *buf, *p;
+
+  wlen = GetCurrentDirectoryW (MAX_PATH, wbuffer);
+  if (!wlen)
+    die ("GCDW failed - error code: %d\n", (int)GetLastError ());
+  else if (wlen > MAX_PATH)
+    die ("GCDW failed - wlen too large\n");
+
+  buf = wchar_to_utf8 (wbuffer, wlen);
+
+  /* Quick test that the reverse works.  */
+  wp = utf8_to_wchar (buf);
+  if (wcscmp (wp, wbuffer))
+    die ("GCDW: reverse converting failed\n");
+  xfree (wp);
+
+  for (p=buf; *p; p++)
+    if (*p == '\\')
+      *p = '/';
+  return buf;
+
+#else
+  char *buffer;
+  size_t size = 100;
+
+  for (;;)
+    {
+      buffer = xmalloc (size+1);
+      if (getcwd (buffer, size) == buffer)
+        {
+          return buffer;
+        }
+      xfree (buffer);
+      if (errno != ERANGE)
+        die ("error getting current cwd: %s\n", strerror (errno));
+      size *= 2;
+    }
+#endif
+}
+
+
+static void
+check_fnameconcat (void)
+{
+  char *out;
+  const char *home = mygethome ();
+  size_t homelen = home? strlen (home):0;
+
+  out = gpgrt_fnameconcat ("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
+                           "1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
+                           "1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
+                           "1", "2", "3", NULL);
+  if (out)
+    fail ("fnameconcat succeeded but should not at line %d\n", __LINE__);
+  else if (errno != EINVAL)
+    fail ("fnameconcat return wrong error at line %d\n", __LINE__);
+  xfree (out);
+
+  out = gpgrt_fnameconcat ("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
+                           "1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
+                           "1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
+                           "1", "2", "3", "4", NULL);
+  if (out)
+    fail ("fnameconcat succeeded but should not at line %d\n", __LINE__);
+  else if (errno != EINVAL)
+    fail ("fnameconcat return wrong error at line %d\n", __LINE__);
+  xfree (out);
+
+  out = gpgrt_fnameconcat ("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
+                           "1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
+                           "1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
+                           "1", "2", NULL);
+  if (!out || strcmp (out,
+                      "1/2/3/4/5/6/7/8/9/10/"
+                      "1/2/3/4/5/6/7/8/9/10/"
+                      "1/2/3/4/5/6/7/8/9/10/"
+                      "1/2"))
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  xfree (out);
+
+  out = gpgrt_fnameconcat ("foo", "~/bar", "baz/cde", NULL);
+  if (!out || strcmp (out, "foo/~/bar/baz/cde"))
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  xfree (out);
+
+  out = gpgrt_fnameconcat ("foo", "~/bar", "baz/cde/", NULL);
+  if (!out || strcmp (out, "foo/~/bar/baz/cde/"))
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  xfree (out);
+
+  out = gpgrt_fnameconcat ("/foo", "~/bar", "baz/cde/", NULL);
+  if (!out || strcmp (out, "/foo/~/bar/baz/cde/"))
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  xfree (out);
+
+  out = gpgrt_fnameconcat ("//foo", "~/bar", "baz/cde/", NULL);
+  if (!out || strcmp (out, "//foo/~/bar/baz/cde/"))
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  xfree (out);
+
+  out = gpgrt_fnameconcat ("", "~/bar", "baz/cde", NULL);
+  if (!out || strcmp (out, "/~/bar/baz/cde"))
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  xfree (out);
+
+  out = gpgrt_fnameconcat ("~/foo", "bar", NULL);
+  if (!out)
+    fail ("fnameconcat failed at line %d\n", __LINE__);
+  else if (home)
+    {
+      if (strlen (out) < homelen + 7)
+        fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+      else if (strncmp (out, home, homelen))
+        fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+      else if (strcmp (out+homelen, "/foo/bar"))
+        fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+    }
+  else
+    {
+      if (strcmp (out, "~/foo/bar"))
+        fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+    }
+  xfree (out);
+
+  out = gpgrt_fnameconcat ("~", "bar", NULL);
+  if (!out)
+    fail ("fnameconcat failed at line %d\n", __LINE__);
+  else if (home)
+    {
+      if (strlen (out) < homelen + 3)
+        fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+      else if (strncmp (out, home, homelen))
+        fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+      else if (strcmp (out+homelen, "/bar"))
+        fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+    }
+  else
+    {
+      if (strcmp (out, "~/bar"))
+        fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+    }
+  xfree (out);
+}
+
+
+static void
+check_absfnameconcat (void)
+{
+  char *out;
+  char *cwd = mygetcwd ();
+  size_t cwdlen = strlen (cwd);
+
+  out = gpgrt_absfnameconcat ("foo", "bar", NULL);
+  if (!out)
+    fail ("fnameconcat failed at line %d\n", __LINE__);
+  else if (strlen (out) < cwdlen + 7)
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  else if (strncmp (out, cwd, cwdlen))
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  else if (strcmp (out+cwdlen, "/foo/bar"))
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  xfree (out);
+
+  out = gpgrt_absfnameconcat ("./foo", NULL);
+  if (!out)
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  else if (strlen (out) < cwdlen + 5)
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  else if (strncmp (out, cwd, cwdlen))
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  else if (strcmp (out+cwdlen, "/./foo"))
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  xfree (out);
+
+  out = gpgrt_absfnameconcat (".", NULL);
+  if (!out)
+    fail ("fnameconcat failed at line %d\n", __LINE__);
+  else if (strlen (out) < cwdlen)
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  else if (strncmp (out, cwd, cwdlen))
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  else if (strcmp (out+cwdlen, ""))
+    fail ("fnameconcat failed at line %d (out=%s)\n", __LINE__, out);
+  xfree (out);
+
+  xfree (cwd);
+}
+
+
+static void
+check_access (void)
+{
+  char *cwd = mygetcwd ();
+
+  if (gpgrt_access (cwd, F_OK))
+    fail ("gpgrt_access(%s) failed: %s\n",
+          cwd, gpg_strerror (gpg_error_from_syserror ()));
+  else
+    show ("gpgrt_access(%s) succeeded\n", cwd);
+
+  xfree (cwd);
+}
+
+
+int
+main (int argc, char **argv)
+{
+  gpgrt_opt_t opts[] = {
+    ARGPARSE_x  ('v', "verbose", NONE, 0, "Print more diagnostics"),
+    ARGPARSE_s_n('d', "debug", "Flyswatter"),
+    ARGPARSE_x  (501, "pwd", NONE, 0, "Print working directory"),
+    ARGPARSE_end()
+  };
+  gpgrt_argparse_t pargs = { &argc, &argv, 0 };
+  char *cwd;
+  int opt_pwd = 0;
+
+  gpgrt_set_strusage (my_strusage);
+  gpgrt_log_set_prefix (gpgrt_strusage (11), GPGRT_LOG_WITH_PREFIX);
+
+  while (gpgrt_argparse  (NULL, &pargs, opts))
+    {
+      switch (pargs.r_opt)
+        {
+        case 'v': verbose++; break;
+        case 'd': debug++; break;
+        case 501: opt_pwd = 1; break;
+        default : pargs.err = ARGPARSE_PRINT_ERROR; break;
+       }
+    }
+  gpgrt_argparse (NULL, &pargs, NULL);
+
+  cwd = gpgrt_getcwd ();
+  if (!cwd)
+    fail ("gpgrt_getcwd returned error: %s\n",
+          gpg_strerror (gpg_error_from_syserror ()));
+  else
+    {
+      if (opt_pwd)
+        {
+          int save_verbose = verbose;
+          verbose = 1;
+          show ("getcwd -> '%s'\n", cwd);
+          verbose = save_verbose;
+        }
+      xfree (cwd);
+    }
+
+  show ("testing string utilities\n");
+
+  check_fnameconcat ();
+  check_absfnameconcat ();
+  check_access ();
+
+  show ("testing string utilities finished\n");
+  return !!errorcount;
+}
index a4cb983..93264dd 100644 (file)
@@ -49,6 +49,7 @@ main (int argc, char *argv[])
     }
   if (fp)
     {
+      fclose (fp);
       fprintf (stderr, "unable to run test\n");
       return 1;
     }
index 4606dbc..d71f360 100644 (file)
 #include <string.h>
 #include <assert.h>
 
-#include "../src/gpg-error.h"
+#define PGM "t-version"
+#include "t-common.h"
+
+static const char *logpfx = PGM;
+
+
+static void
+t_gpgrt_cmp_version (void)
+{
+  struct { int result; int level; const char *a; const char *b; } t[] = {
+    {  0, 1, "0", "0" },
+    { -1, 1, "0", "1" },
+    {  1, 1, "1", "0" },
+    { -1, 1, "0.0", "0.1" },
+    { -1, 1, "0.1", "1.2" },
+    {  1, 1, "1.0", "0.9" },
+    { -1, 1, "-1.0", "0.9" }, /* A is invalid */
+    {  0, 1, "0rc0", "0rc0" },
+    {  1, 1, "0rc1", "0rc0" },
+    { -1, 1, "0rc1", "0rc2" },
+    {  0, 1, "0.rc0", "0.rc0" },
+    {  1, 1, "0.rc1", "0.rc0" },
+    { -1, 1, "0.rc1", "0.rc2" },
+    {  0, 1, "0.rc1", "0.rc1" },
+    { -1, 1, "0qc1",  "0rc0" },
+    { -1, 1, "0.qc1", "0.rc0" },
+    {  0, 2, "0.0", "0.0" },
+    { -1, 2, "0.1", "0.2" },
+    { -1, 2, "3.1", "3.2" },
+    { -1, 2, "3.1", "4.0" },
+    {  0, 2, "1.1rc0", "1.1rc0" },
+    {  1, 2, "1.1rc1", "1.1rc0" },
+    { -1, 2, "1.1rc0", "1.1rc1" },
+    {  0, 3, "7.0.0", "7.0.0" },
+    { -1, 3, "7.0.1", "7.0.2" },
+    { -1, 3, "7.3.1", "7.3.2" },
+    { -1, 3, "7.3.1", "7.4.0" },
+    {  0, 3, "7.1.1rc0", "7.1.1rc0" },
+    {  1, 3, "7.1.1rc1", "7.1.1rc0" },
+    { -1, 3, "7.1.1rc0", "7.1.1rc1" },
+    {  1, 3, "6.0.0", "5.0.0" },
+    {  0, 3, "6.0.0", "6.0.0" },
+    {  1, 3, "6.0.1", "6.0.0" },
+    {  1, 3, "6.1.0", "6.0.0" },
+    {  1, 3, "6.2.1", "6.2.0" },
+    { -1, 3, "6.2.1", "6.2.2" },
+    { -1, 3, "6.0.0", "6.0.2" },
+    { -1, 3, "6.0.0", "6.1.0" },
+    { -1, 3, "6.2.0", "6.2.1" },
+    {  1, 3, "6.0.0-beta1", "6.0.0-beta0" },
+    {  0, 3, "6.0.0-beta2", "6.0.0-beta2" },
+    {  1, 3, "6.0.0-beta20", "6.0.0-beta19" },
+    { -1, 3, "6.0.0-beta1", "6.0.0-beta2" },
+    {  1, 3, "6.0.0-beta2", "6.0.0-beta1" },
+    { -1, 3, "6.0.0-beta20", "6.0.0-beta21" },
+    {  0,13, "6.0.0-beta1", "6.0.0-beta0" },
+    {  0,13, "6.0.0-beta2", "6.0.0-beta2" },
+    {  0,13, "6.0.0-beta20", "6.0.0-beta19" },
+    {  0,13, "6.0.0-beta1", "6.0.0-beta2" },
+    {  0,13, "6.0.0-beta2", "6.0.0-beta1" },
+    {  0,13, "6.0.0-beta20", "6.0.0-beta21" }
+  };
+  int i;
+  int result, expected;
+
+  for (i=0; i < DIM (t); i++)
+    {
+      expected = t[i].result;
+      result = gpgrt_cmp_version (t[i].a, t[i].b, t[i].level);
+      if (result != expected)
+        fail ("test %d failed: cmp('%s','%s',%d) = %d expected %d",
+              i, t[i].a, t[i].b, t[i].level, result, expected);
+    }
+  for (i=0; i < DIM (t); i++)
+    {
+      expected = 0 - t[i].result;
+      result = gpgrt_cmp_version (t[i].a, t[i].b, -t[i].level);
+      if (result != expected)
+        fail ("test %d-rev failed: cmp('%s','%s',%d) = %d expected %d",
+              i, t[i].a, t[i].b, -t[i].level, result, expected);
+    }
+}
+
 
-static const char *logpfx = "";
-static int verbose;
-static int debug;
-static int errorcount;
 
 int
 main (int argc, char **argv)
@@ -40,7 +118,6 @@ main (int argc, char **argv)
 
   if (argc)
     {
-      logpfx = *argv;
       argc--; argv++;
     }
   while (argc && last_argc != argc )
@@ -68,6 +145,8 @@ main (int argc, char **argv)
         }
     }
 
+  t_gpgrt_cmp_version ();
+
   if (!gpg_error_check_version (GPG_ERROR_VERSION))
     {
       fprintf (stderr, "%s: gpg_error_check_version returned an error\n",
@@ -80,11 +159,12 @@ main (int argc, char **argv)
                "error for an old version\n", logpfx);
       errorcount++;
     }
-  if (gpg_error_check_version ("15"))
+  if (gpg_error_check_version ("15.0"))
     {
       fprintf (stderr, "%s: gpg_error_check_version did not return an error"
                " for a newer version\n", logpfx);
       errorcount++;
+      show ("\n"); /* Reference this function to silence gcc. */
     }
   if (verbose || errorcount)
     {