summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2010-03-10 13:24:58 +0100
committerWerner Koch <wk@gnupg.org>2010-03-10 13:24:58 +0100
commitd8b1099d01ebc1d305d47ec6dcb326980ad56396 (patch)
treecb92563d8b116872c34ad26dcdacfd02ed3da04a /common
parentFix for latest libgpg-error. (diff)
downloadgnupg2-d8b1099d01ebc1d305d47ec6dcb326980ad56396.tar.xz
gnupg2-d8b1099d01ebc1d305d47ec6dcb326980ad56396.zip
Merged jnlib into common.
Diffstat (limited to '')
-rw-r--r--common/ChangeLog27
-rw-r--r--common/ChangeLog.jnlib (renamed from jnlib/ChangeLog)33
-rw-r--r--common/Makefile.am54
-rw-r--r--common/README.jnlib (renamed from jnlib/Makefile.am)78
-rw-r--r--common/argparse.c (renamed from jnlib/argparse.c)0
-rw-r--r--common/argparse.h (renamed from jnlib/argparse.h)0
-rw-r--r--common/audit.h2
-rw-r--r--common/dotlock.c (renamed from jnlib/dotlock.c)0
-rw-r--r--common/dotlock.h (renamed from jnlib/dotlock.h)0
-rw-r--r--common/dynload.h (renamed from jnlib/dynload.h)0
-rw-r--r--common/exechelp.c10
-rw-r--r--common/exechelp.h2
-rw-r--r--common/http.h2
-rw-r--r--common/i18n.h2
-rw-r--r--common/init.c1
-rw-r--r--common/iobuf.c4
-rw-r--r--common/libjnlib-config.h (renamed from jnlib/libjnlib-config.h)0
-rw-r--r--common/localename.c4
-rw-r--r--common/logging.c (renamed from jnlib/logging.c)0
-rw-r--r--common/logging.h (renamed from jnlib/logging.h)0
-rw-r--r--common/mischelp.c (renamed from jnlib/mischelp.c)0
-rw-r--r--common/mischelp.h (renamed from jnlib/mischelp.h)2
-rw-r--r--common/simple-pwquery.c4
-rw-r--r--common/simple-pwquery.h2
-rw-r--r--common/stringhelp.c (renamed from jnlib/stringhelp.c)0
-rw-r--r--common/stringhelp.h (renamed from jnlib/stringhelp.h)0
-rw-r--r--common/strlist.c (renamed from jnlib/strlist.c)0
-rw-r--r--common/strlist.h (renamed from jnlib/strlist.h)0
-rw-r--r--common/sysutils.h2
-rw-r--r--common/t-stringhelp.c (renamed from jnlib/t-stringhelp.c)0
-rw-r--r--common/t-support.c (renamed from jnlib/t-support.c)0
-rw-r--r--common/t-support.h (renamed from jnlib/t-support.h)0
-rw-r--r--common/t-timestuff.c (renamed from jnlib/t-timestuff.c)0
-rw-r--r--common/t-w32-reg.c (renamed from jnlib/t-w32-reg.c)0
-rw-r--r--common/ttyio.c1
-rw-r--r--common/types.h (renamed from jnlib/types.h)0
-rw-r--r--common/utf8conv.c (renamed from jnlib/utf8conv.c)0
-rw-r--r--common/utf8conv.h (renamed from jnlib/utf8conv.h)0
-rw-r--r--common/util.h27
-rw-r--r--common/w32-afunix.c (renamed from jnlib/w32-afunix.c)0
-rw-r--r--common/w32-afunix.h (renamed from jnlib/w32-afunix.h)0
-rw-r--r--common/w32-reg.c (renamed from jnlib/w32-reg.c)0
-rw-r--r--common/w32help.h (renamed from jnlib/w32help.h)0
-rw-r--r--common/xasprintf.c1
-rw-r--r--common/xmalloc.c (renamed from jnlib/xmalloc.c)0
-rw-r--r--common/xmalloc.h (renamed from jnlib/xmalloc.h)0
46 files changed, 178 insertions, 80 deletions
diff --git a/common/ChangeLog b/common/ChangeLog
index 7408123ec..6f4b70b30 100644
--- a/common/ChangeLog
+++ b/common/ChangeLog
@@ -1,5 +1,32 @@
+2010-03-10 Werner Koch <wk@g10code.com>
+
+ * util.h: Replace jnlib path part by common.
+ (snprintf): Use the replacement macro on all platforms.
+
+ * Makefile.am (jnlib_sources): New.
+ (libcommon_a_SOURCES, libcommonpth_a_SOURCES): Add jnlib_sources.
+ (jnlib_tests): New.
+ (noinst_PROGRAMS, TESTS): Add jnlib_tests.
+ (t_common_ldadd): Remove libjnlib.a.
+
+ * README.jnlib, ChangeLog.jnlib, libjnlib-config.h, argparse.c
+ * argparse.h, dotlock.c, dotlock.h, dynload.h, logging.c
+ * logging.h, mischelp.c, mischelp.h, stringhelp.c, stringhelp.h
+ * strlist.c, strlist.h, types.h, utf8conv.c, utf8conv.h
+ * w32-afunix.c, w32-afunix.h, w32-reg.c, w32help.h, xmalloc.c
+ * xmalloc.h, t-stringhelp.c, t-support.c, t-support.h
+ * t-timestuff.c, t-w32-reg.c: Move from jnlib to here.
+
+ * init.c: Remove "estream.h".
+ * util.h: Include "estream.h".
+
+ * xasprintf.c, ttyio.c: Remove "estream-printf.h".
+
2010-03-08 Werner Koch <wk@g10code.com>
+ * exechelp.c [!HAVE_SIGNAL_H]: Do not include signal.h.
+ (DETACHED_PROCESS, CREATE_NEW_PROCESS_GROUP) [W32CE]: Provide stubs.
+
* iobuf.h (iobuf_ioctl_t): New. Use the new macros instead of the
hard wired values.
* iobuf.c (iobuf_append): Remove.
diff --git a/jnlib/ChangeLog b/common/ChangeLog.jnlib
index 53ceedf27..f51525e42 100644
--- a/jnlib/ChangeLog
+++ b/common/ChangeLog.jnlib
@@ -1,3 +1,14 @@
+2010-03-10 Werner Koch <wk@g10code.com>
+
+ See gnupg/common/ChangeLog for newer changes.
+
+ JNLIB has been merged into GnuPG's common directory. README.jnlib
+ list the files making up JNLIB.
+
+ * README: Rename to README.jnlib
+ * ChangeLog: Rename to ChangeLog.jnlib.
+ * Makefile.am: Remove.
+
2010-03-01 Werner Koch <wk@g10code.com>
* t-w32-reg.c: New.
@@ -108,7 +119,7 @@
2009-01-22 Werner Koch <wk@g10code.com>
- * t-support.c (gpg_err_code_from_errno)
+ * t-support.c (gpg_err_code_from_errno)
(gpg_err_code_from_syserror): New.
2008-11-20 Werner Koch <wk@g10code.com>
@@ -151,7 +162,7 @@
* stringhelp.c (make_basename): Silent gcc warning about unused arg.
* argparse.c (store_alias): Ditto.
- (find_long_option):
+ (find_long_option):
2008-10-15 Werner Koch <wk@g10code.com>
@@ -338,7 +349,7 @@
* stringhelp.c (strsep): New. Copied from gnupg 1.4.5
util/strgutil.c.
- * strlist.h (STRLIST): Removed deprecated typedef.
+ * strlist.h (STRLIST): Removed deprecated typedef.
* types.h: Made cpp commands work with old compilers. Also shows
up nicer with Emacs' font locking.
@@ -348,14 +359,14 @@
Changed license from GPL to LGPL. Note that all code has either
been written by me, David, employees of g10 Code or taken from
glibc.
-
+
* libjnlib-config.h, stringhelp.c, stringhelp.h:
* strlist.c, strlist.h, utf8conv.c, utf8conv.h:
* argparse.c, argparse.h, logging.c, logging.h:
* dotlock.c, dotlock.h, types.h, mischelp.h:
* xmalloc.c, xmalloc.h, w32-pth.c, w32-pth.h:
* w32-afunix.c, w32-afunix.h: Tagged them to be long to jnlib
- which is a part of GnuPG but also used by other projetcs.
+ which is a part of GnuPG but also used by other projetcs.
2006-09-22 Werner Koch <wk@g10code.com>
@@ -483,10 +494,10 @@
(_pth_strerror): New.
(do_pth_wait): Before we enter the loop we check if there
are too much events in the ring.
-
+
2004-12-14 Werner Koch <wk@g10code.com>
- * w32-pth.h (pth_event_occured): Removed macro.
+ * w32-pth.h (pth_event_occured): Removed macro.
* w32-pth.c: Fixed license statement; its under the LGPL.
(enter_pth, leave_pth): Use them to bracket almost all public
functions.
@@ -498,7 +509,7 @@
(pth_kill): Release global mutex section.
(helper_thread): New.
(pth_spawn): Make sure only one thread is running.
-
+
2004-12-13 Werner Koch <wk@g10code.com>
* stringhelp.c (w32_strerror) [W32]: New.
@@ -518,7 +529,7 @@
* w32-afunix.c: New. AF_UNIX emulation for W32.
* w32-afunix.h: Likewise.
-
+
2004-11-22 Werner Koch <wk@g10code.com>
* logging.c (log_test_fd): Add test on LOGSTREAM. Reported by
@@ -629,7 +640,7 @@
2003-06-13 Werner Koch <wk@gnupg.org>
- * mischelp.h (wipememory2,wipememory): New. Taken from GnuPG 1.3.2.
+ * mischelp.h (wipememory2,wipememory): New. Taken from GnuPG 1.3.2.
2002-06-04 Werner Koch <wk@gnupg.org>
@@ -683,7 +694,7 @@
* logging.c (log_set_prefix): New.
(do_logv): Include prefix and pid only if enabled. Print time only
when explicitly enabled.
- (log_logv): New.
+ (log_logv): New.
* logging.h: Include log_logv() only when requested.
2001-11-06 Werner Koch <wk@gnupg.org>
diff --git a/common/Makefile.am b/common/Makefile.am
index c7a9f09ba..1a73d31b1 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -1,5 +1,5 @@
# Makefile for common gnupg modules
-# Copyright (C) 2001, 2003, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2007, 2010 Free Software Foundation, Inc.
#
# This file is part of GnuPG.
#
@@ -19,11 +19,11 @@
## Process this file with automake to produce Makefile.in
EXTRA_DIST = mkstrtable.awk exaudit.awk exstatus.awk \
- audit-events.h status-codes.h
+ audit-events.h status-codes.h README.jnlib ChangeLog.jnlib
noinst_LIBRARIES = libcommon.a libcommonpth.a libsimple-pwquery.a libgpgrl.a
-noinst_PROGRAMS = $(module_tests) $(module_maint_tests)
-TESTS = $(module_tests)
+noinst_PROGRAMS = $(jnlib_tests) $(module_tests) $(module_maint_tests)
+TESTS = $(jnlib_tests) $(module_tests)
BUILT_SOURCES = audit-events.h status-codes.h
@@ -35,9 +35,26 @@ AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(KSBA_CFLAGS)
include $(top_srcdir)/am/cmacros.am
+jnlib_sources = \
+ libjnlib-config.h \
+ types.h dynload.h w32help.h \
+ stringhelp.c stringhelp.h \
+ strlist.c strlist.h \
+ utf8conv.c utf8conv.h \
+ argparse.c argparse.h \
+ logging.c logging.h \
+ dotlock.c dotlock.h \
+ mischelp.c mischelp.h
+
+if HAVE_W32_SYSTEM
+jnlib_sources += w32-reg.c w32-afunix.c w32-afunix.h
+endif
+
+
common_sources = \
common-defs.h \
util.h i18n.c i18n.h \
+ estream.c estream.h estream-printf.c estream-printf.h \
status.c status.h\
openpgpdefs.h \
gc-opt-flags.h \
@@ -62,7 +79,6 @@ common_sources = \
asshelp.c asshelp.h \
exechelp.c exechelp.h \
signal.c \
- estream.c estream.h estream-printf.c estream-printf.h \
audit.c audit.h \
srv.h \
dns-cert.c dns-cert.h \
@@ -78,13 +94,13 @@ without_pth_sources = \
get-passphrase.c get-passphrase.h
-libcommon_a_SOURCES = $(common_sources) $(without_pth_sources)
+libcommon_a_SOURCES = $(jnlib_sources) $(common_sources) $(without_pth_sources)
if USE_DNS_SRV
libcommon_a_SOURCES += srv.c
endif
libcommon_a_CFLAGS = $(AM_CFLAGS) $(LIBASSUAN_CFLAGS) -DWITHOUT_GNU_PTH=1
-libcommonpth_a_SOURCES = $(common_sources)
+libcommonpth_a_SOURCES = $(jnlib_sources) $(common_sources)
if USE_DNS_SRV
libcommonpth_a_SOURCES += srv.c
endif
@@ -121,13 +137,32 @@ endif
#
# Module tests
#
+t_jnlib_src = t-support.c t-support.h
+jnlib_tests = t-stringhelp t-timestuff
+if HAVE_W32_SYSTEM
+jnlib_tests += t-w32-reg
+endif
module_tests = t-convert t-percent t-gettime t-sysutils t-sexputil t-exechelp \
t-session-env
module_maint_tests = t-helpfile t-b64
-t_common_ldadd = libcommon.a ../jnlib/libjnlib.a ../gl/libgnu.a \
+
+t_common_ldadd = libcommon.a ../gl/libgnu.a \
$(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) $(LIBINTL) $(LIBICONV)
+# jnlib tests
+t_stringhelp_SOURCES = t-stringhelp.c $(t_jnlib_src)
+t_stringhelp_LDADD = $(t_common_ldadd)
+
+t_timestuff_SOURCES = t-timestuff.c $(t_jnlib_src)
+t_timestuff_LDADD = $(t_common_ldadd)
+
+if HAVE_W32_SYSTEM
+t_w32_reg_SOURCES = t-w32-reg.c $(t_jnlib_src)
+t_w32_reg_LDADD = $(t_common_ldadd)
+endif
+
+# common tests
t_convert_LDADD = $(t_common_ldadd)
t_percent_LDADD = $(t_common_ldadd)
t_gettime_LDADD = $(t_common_ldadd)
@@ -138,3 +173,6 @@ t_b64_LDADD = $(t_common_ldadd)
t_exechelp_LDADD = $(t_common_ldadd)
t_session_env_LDADD = $(t_common_ldadd)
+
+
+
diff --git a/jnlib/Makefile.am b/common/README.jnlib
index 232aef980..e8df795cb 100644
--- a/jnlib/Makefile.am
+++ b/common/README.jnlib
@@ -1,25 +1,45 @@
-# Makefile for the JNLIB part of GnuPG
-# Copyright (C) 1999, 2000, 2001, 2004, 2006,
-# 2010 Feee Software Soundation, Inc.
-#
-# This file is part of JNLIB.
-#
-# JNLIB 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 3 of
-# the License, or (at your option) any later version.
-#
-# JNLIB 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 <http://www.gnu.org/licenses/>.
-
-
-## Process this file with automake to produce Makefile.in
-
+JNLIB - This is a collection of utility function which are too small
+to put into a library. The code here is licensed under the LGPL.
+
+libjnlib-config.h should be be modified for each project to make these
+functions fit into the software. Mainly these are memory functions in
+case you need another allocator.
+
+Files which make up jnlib:
+ README.jnlib
+ ChangeLog.jnlib
+ libjnlib-config.h
+ argparse.c
+ argparse.h
+ dotlock.c
+ dotlock.h
+ dynload.h
+ logging.c
+ logging.h
+ mischelp.c
+ mischelp.h
+ stringhelp.c
+ stringhelp.h
+ strlist.c
+ strlist.h
+ types.h
+ utf8conv.c
+ utf8conv.h
+ w32-afunix.c
+ w32-afunix.h
+ w32-reg.c
+ w32help.h
+ xmalloc.c
+ xmalloc.h
+ t-stringhelp.c
+ t-support.c
+ t-support.h
+ t-timestuff.c
+ t-w32-reg.c
+
+
+Here is a template Makefile.am for these jnlib modules:
+===8<==================================================
EXTRA_DIST = README
noinst_PROGRAMS = $(module_tests)
TESTS = $(module_tests)
@@ -27,12 +47,10 @@ TESTS = $(module_tests)
AM_CPPFLAGS = -I$(top_srcdir)/intl
# We need libgcrypt because libjnlib-config includes gcrypt.h
-AM_CFLAGS = -DJNLIB_IN_JNLIB $(LIBGCRYPT_CFLAGS)
+AM_CFLAGS = $(LIBGCRYPT_CFLAGS)
noinst_LIBRARIES = libjnlib.a
-
-#libjnlib_a_LDFLAGS =
libjnlib_a_SOURCES = \
libjnlib-config.h \
stringhelp.c stringhelp.h \
@@ -41,17 +59,13 @@ libjnlib_a_SOURCES = \
argparse.c argparse.h \
logging.c logging.h \
dotlock.c dotlock.h \
- types.h mischelp.c mischelp.h dynload.h w32help.h
+ types.h mischelp.c mischelp.h dynload.h w32help.h \
+ xmalloc.c xmalloc.h
if HAVE_W32_SYSTEM
libjnlib_a_SOURCES += w32-reg.c w32-afunix.c w32-afunix.h
endif
-
-# For GnuPG we don't need the xmalloc stuff.
-# xmalloc.c xmalloc.h
-
-
#
# Module tests.
#
@@ -82,4 +96,6 @@ if HAVE_W32_SYSTEM
t_w32_reg_SOURCES = t-w32-reg.c $(t_jnlib_src)
t_w32_reg_LDADD = $(t_jnlib_ldadd)
endif
+==>8===================================================
+
diff --git a/jnlib/argparse.c b/common/argparse.c
index ab88922a4..ab88922a4 100644
--- a/jnlib/argparse.c
+++ b/common/argparse.c
diff --git a/jnlib/argparse.h b/common/argparse.h
index b211e5fdf..b211e5fdf 100644
--- a/jnlib/argparse.h
+++ b/common/argparse.h
diff --git a/common/audit.h b/common/audit.h
index 28d1edbd1..8f413aa30 100644
--- a/common/audit.h
+++ b/common/audit.h
@@ -22,7 +22,7 @@
#include <ksba.h>
-#include "estream.h"
+#include "../common/estream.h"
struct audit_ctx_s;
typedef struct audit_ctx_s *audit_ctx_t;
diff --git a/jnlib/dotlock.c b/common/dotlock.c
index 0d5a7bce9..0d5a7bce9 100644
--- a/jnlib/dotlock.c
+++ b/common/dotlock.c
diff --git a/jnlib/dotlock.h b/common/dotlock.h
index 407a80b37..407a80b37 100644
--- a/jnlib/dotlock.h
+++ b/common/dotlock.h
diff --git a/jnlib/dynload.h b/common/dynload.h
index 0c8a3bbaa..0c8a3bbaa 100644
--- a/jnlib/dynload.h
+++ b/common/dynload.h
diff --git a/common/exechelp.c b/common/exechelp.c
index 95e5b633c..f71cd7349 100644
--- a/common/exechelp.c
+++ b/common/exechelp.c
@@ -25,7 +25,9 @@
#include <string.h>
#include <errno.h>
#include <assert.h>
-#include <signal.h>
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
+#endif
#include <unistd.h>
#include <fcntl.h>
@@ -78,6 +80,12 @@
#define X_OK F_OK
#endif /* HAVE_W32_SYSTEM */
+/* Constants not supported by WindowsCE. */
+#ifdef HAVE_W32CE_SYSTEM
+# define DETACHED_PROCESS (0)
+# define CREATE_NEW_PROCESS_GROUP (0)
+#endif
+
#ifdef HAVE_W32_SYSTEM
/* We assume that a HANDLE can be represented by an int which should
diff --git a/common/exechelp.h b/common/exechelp.h
index 06cb79c29..c5ecc0dea 100644
--- a/common/exechelp.h
+++ b/common/exechelp.h
@@ -20,7 +20,7 @@
#ifndef GNUPG_COMMON_EXECHELP_H
#define GNUPG_COMMON_EXECHELP_H
-#include "estream.h"
+#include "../common/estream.h"
/* Return the maximum number of currently allowed file descriptors.
diff --git a/common/http.h b/common/http.h
index 28a5304eb..e7120f561 100644
--- a/common/http.h
+++ b/common/http.h
@@ -22,7 +22,7 @@
#include <gpg-error.h>
#ifdef HTTP_USE_ESTREAM
-#include "estream.h"
+#include "../common/estream.h"
#endif
struct uri_tuple_s {
diff --git a/common/i18n.h b/common/i18n.h
index 7405f9a55..abb8bd83e 100644
--- a/common/i18n.h
+++ b/common/i18n.h
@@ -16,7 +16,7 @@
#ifdef USE_SIMPLE_GETTEXT
-# include "../jnlib/w32help.h"
+# include "../common/w32help.h"
# define _(a) gettext (a)
# define N_(a) (a)
#else
diff --git a/common/init.c b/common/init.c
index 5425acee8..d8e0be7bf 100644
--- a/common/init.c
+++ b/common/init.c
@@ -31,7 +31,6 @@
#include <pth.h>
#endif
-#include "estream.h"
#include "util.h"
diff --git a/common/iobuf.c b/common/iobuf.c
index 87af2868f..441c69467 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -1156,10 +1156,10 @@ iobuf_open_fd_or_name (gnupg_fd_t fd, const char *fname, const char *mode)
{
iobuf_t a;
- if (fd == -1)
+ if (fd == GNUPG_INVALID_FD)
a = iobuf_open (fname);
else
- a = iobuf_fdopen_nc (fd, mode);
+ a = iobuf_fdopen_nc (FD2INT(fd), mode);
return a;
}
diff --git a/jnlib/libjnlib-config.h b/common/libjnlib-config.h
index 621e89feb..621e89feb 100644
--- a/jnlib/libjnlib-config.h
+++ b/common/libjnlib-config.h
diff --git a/common/localename.c b/common/localename.c
index cb7fcc2f7..5c46ddd34 100644
--- a/common/localename.c
+++ b/common/localename.c
@@ -30,7 +30,7 @@
#include <locale.h>
#endif
-#include "../jnlib/w32help.h"
+#include "../common/w32help.h"
/* XPG3 defines the result of 'setlocale (category, NULL)' as:
"Directs 'setlocale()' to query 'category' and return the current
@@ -101,7 +101,7 @@ gnupg_messages_locale_name (void)
const char *s;
#ifdef HAVE_W32_SYSTEM
- /* We use the localname function from ../jnlib/w32-gettext.c. */
+ /* We use the localname function from ../common/w32-gettext.c. */
s = gettext_localename ();
#else
s = do_nl_locale_name (LC_MESSAGES, "LC_MESSAGES");
diff --git a/jnlib/logging.c b/common/logging.c
index 028697b78..028697b78 100644
--- a/jnlib/logging.c
+++ b/common/logging.c
diff --git a/jnlib/logging.h b/common/logging.h
index 0b96108a8..0b96108a8 100644
--- a/jnlib/logging.h
+++ b/common/logging.h
diff --git a/jnlib/mischelp.c b/common/mischelp.c
index e06be21f2..e06be21f2 100644
--- a/jnlib/mischelp.c
+++ b/common/mischelp.c
diff --git a/jnlib/mischelp.h b/common/mischelp.h
index 52781e12f..5a0132aa6 100644
--- a/jnlib/mischelp.h
+++ b/common/mischelp.h
@@ -23,7 +23,7 @@
/* Because we can't use the internal jnlib_free macro in inline
- functions we provide a wrapper fucntion as well. */
+ functions we provide a wrapper function as well. */
void _jnlib_free (void *p);
/* Check whether the files NAME1 and NAME2 are identical. This is for
diff --git a/common/simple-pwquery.c b/common/simple-pwquery.c
index 3598b3598..fd48b6f5a 100644
--- a/common/simple-pwquery.c
+++ b/common/simple-pwquery.c
@@ -41,9 +41,9 @@
#endif
#define JNLIB_NEED_AFLOCAL
-#include "../jnlib/mischelp.h"
+#include "../common/mischelp.h"
#ifdef HAVE_W32_SYSTEM
-#include "../jnlib/w32-afunix.h"
+#include "../common/w32-afunix.h"
#endif
diff --git a/common/simple-pwquery.h b/common/simple-pwquery.h
index 8de9b1bd2..edd834ef4 100644
--- a/common/simple-pwquery.h
+++ b/common/simple-pwquery.h
@@ -24,7 +24,7 @@
/* Include whatever files you need. */
#include <gcrypt.h>
-#include "../jnlib/logging.h"
+#include "../common/logging.h"
/* Try to write error message using the standard log mechanism. The
current implementation requires that the HAVE_JNLIB_LOGGING is also
diff --git a/jnlib/stringhelp.c b/common/stringhelp.c
index 36f96b8ff..36f96b8ff 100644
--- a/jnlib/stringhelp.c
+++ b/common/stringhelp.c
diff --git a/jnlib/stringhelp.h b/common/stringhelp.h
index a560b163e..a560b163e 100644
--- a/jnlib/stringhelp.h
+++ b/common/stringhelp.h
diff --git a/jnlib/strlist.c b/common/strlist.c
index b31e6213a..b31e6213a 100644
--- a/jnlib/strlist.c
+++ b/common/strlist.c
diff --git a/jnlib/strlist.h b/common/strlist.h
index 1e2ffa8da..1e2ffa8da 100644
--- a/jnlib/strlist.h
+++ b/common/strlist.h
diff --git a/common/sysutils.h b/common/sysutils.h
index fd4340f3d..6f34b9791 100644
--- a/common/sysutils.h
+++ b/common/sysutils.h
@@ -52,7 +52,7 @@ void gnupg_allow_set_foregound_window (pid_t pid);
#ifdef HAVE_W32_SYSTEM
-#include "../jnlib/w32help.h"
+#include "../common/w32help.h"
#endif /*HAVE_W32_SYSTEM*/
diff --git a/jnlib/t-stringhelp.c b/common/t-stringhelp.c
index 0c921b03d..0c921b03d 100644
--- a/jnlib/t-stringhelp.c
+++ b/common/t-stringhelp.c
diff --git a/jnlib/t-support.c b/common/t-support.c
index bf05c4c06..bf05c4c06 100644
--- a/jnlib/t-support.c
+++ b/common/t-support.c
diff --git a/jnlib/t-support.h b/common/t-support.h
index 2dfbc0990..2dfbc0990 100644
--- a/jnlib/t-support.h
+++ b/common/t-support.h
diff --git a/jnlib/t-timestuff.c b/common/t-timestuff.c
index 46816765d..46816765d 100644
--- a/jnlib/t-timestuff.c
+++ b/common/t-timestuff.c
diff --git a/jnlib/t-w32-reg.c b/common/t-w32-reg.c
index f4848cbaa..f4848cbaa 100644
--- a/jnlib/t-w32-reg.c
+++ b/common/t-w32-reg.c
diff --git a/common/ttyio.c b/common/ttyio.c
index fc274070c..ec26b06e8 100644
--- a/common/ttyio.c
+++ b/common/ttyio.c
@@ -48,7 +48,6 @@
#include "util.h"
#include "ttyio.h"
-#include "estream-printf.h"
#include "common-defs.h"
#define CONTROL_D ('D' - 'A' + 1)
diff --git a/jnlib/types.h b/common/types.h
index 62fa0470d..62fa0470d 100644
--- a/jnlib/types.h
+++ b/common/types.h
diff --git a/jnlib/utf8conv.c b/common/utf8conv.c
index 6cbe4e92c..6cbe4e92c 100644
--- a/jnlib/utf8conv.c
+++ b/common/utf8conv.c
diff --git a/jnlib/utf8conv.h b/common/utf8conv.h
index 28dd450dd..28dd450dd 100644
--- a/jnlib/utf8conv.h
+++ b/common/utf8conv.h
diff --git a/common/util.h b/common/util.h
index 56678620b..32d4085e7 100644
--- a/common/util.h
+++ b/common/util.h
@@ -33,29 +33,30 @@
/* Hash function used with libksba. */
#define HASH_FNC ((void (*)(void *, const void*,size_t))gcry_md_write)
+/* Estream replaces most uses of stdio. */
+#include "../common/estream.h"
+#include "../common/estream-printf.h"
+
/* Get all the stuff from jnlib. */
-#include "../jnlib/logging.h"
-#include "../jnlib/argparse.h"
-#include "../jnlib/stringhelp.h"
-#include "../jnlib/mischelp.h"
-#include "../jnlib/strlist.h"
-#include "../jnlib/dotlock.h"
-#include "../jnlib/utf8conv.h"
-#include "../jnlib/dynload.h"
+#include "../common/logging.h"
+#include "../common/argparse.h"
+#include "../common/stringhelp.h"
+#include "../common/mischelp.h"
+#include "../common/strlist.h"
+#include "../common/dotlock.h"
+#include "../common/utf8conv.h"
+#include "../common/dynload.h"
#include "init.h"
/* Redefine asprintf by our estream version which uses our own memory
allocator.. */
-#include "estream-printf.h"
#define asprintf estream_asprintf
#define vasprintf estream_vasprintf
-/* Due to a bug in mingw32's snprintf related to the 'l' modifier we
- better use our snprintf. */
-#ifdef HAVE_W32_SYSTEM
+/* Due to a bug in mingw32's snprintf related to the 'l' modifier and
+ for increased portability we use our snprintf on all systems. */
#define snprintf estream_snprintf
-#endif
/* GCC attributes. */
diff --git a/jnlib/w32-afunix.c b/common/w32-afunix.c
index 579621491..579621491 100644
--- a/jnlib/w32-afunix.c
+++ b/common/w32-afunix.c
diff --git a/jnlib/w32-afunix.h b/common/w32-afunix.h
index 23681ddeb..23681ddeb 100644
--- a/jnlib/w32-afunix.h
+++ b/common/w32-afunix.h
diff --git a/jnlib/w32-reg.c b/common/w32-reg.c
index 5809c32bb..5809c32bb 100644
--- a/jnlib/w32-reg.c
+++ b/common/w32-reg.c
diff --git a/jnlib/w32help.h b/common/w32help.h
index 518d4251c..518d4251c 100644
--- a/jnlib/w32help.h
+++ b/common/w32help.h
diff --git a/common/xasprintf.c b/common/xasprintf.c
index 9774d06de..f16410dbd 100644
--- a/common/xasprintf.c
+++ b/common/xasprintf.c
@@ -23,7 +23,6 @@
#include "util.h"
#include "iobuf.h"
-#include "estream-printf.h"
#if !defined(_ESTREAM_PRINTF_MALLOC) || !defined(_ESTREAM_PRINTF_FREE)
#error Need to define ESTREAM_PRINTF_MALLOC and _FREE
diff --git a/jnlib/xmalloc.c b/common/xmalloc.c
index eb6d5ab11..eb6d5ab11 100644
--- a/jnlib/xmalloc.c
+++ b/common/xmalloc.c
diff --git a/jnlib/xmalloc.h b/common/xmalloc.h
index 8c9c5292b..8c9c5292b 100644
--- a/jnlib/xmalloc.h
+++ b/common/xmalloc.h