From e3b1e3857e00c6e8216e953b0b38f4dcda00cd53 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 31 Aug 2022 14:18:24 +0900 Subject: Drop WindowsCE support. * contrib/*: Remove. * Makefile.am (EXTRA_DIST): Don't include contrib/. * configure.ac (HAVE_W32CE_SYSTEM): Remove. * src/gpgcedev.c: Remove. * src/gpgcedev.def: Remove. * src/gpgcemgr.c: Remove. * src/system-w32ce.c: Remove. * src/w32ce-add.h: Remove. * src/w32ce-fd-t.inc.h: Remove. * src/Makefile.am (EXTRA_DIST, parts_of_assuan_h, common_sources): Fix. * src/assuan-buffer.c [HAVE_W32CE_SYSTEM]: No conditionalize. * src/setenv.c [HAVE_W32CE_SYSTEM]: Likewise. * src/assuan-defs.h [HAVE_W32CE_SYSTEM]: Remove dependent part. * src/assuan-error.c [HAVE_W32CE_SYSTEM]: Likewise. * src/assuan-handler.c [HAVE_W32CE_SYSTEM]: Likewise. * src/assuan-socket.c [HAVE_W32CE_SYSTEM]: Likewise. * src/system.c [HAVE_W32CE_SYSTEM]: Likewise. * src/sysutils.c [HAVE_W32CE_SYSTEM]: Likewise. * tests/Makefile.am (EXTRA_DIST): Fix. (w32cetools): Remove. * tests/common.h [HAVE_W32CE_SYSTEM]: Remove dependent part. * tests/pipeconnect.c [HAVE_W32CE_SYSTEM]: Likewise. * tests/ce-createpipe.c: Remove. * tests/ce-server.c: Remove. -- GnuPG-bug-id: 6170 Signed-off-by: NIIBE Yutaka --- src/sysutils.c | 87 ---------------------------------------------------------- 1 file changed, 87 deletions(-) (limited to 'src/sysutils.c') diff --git a/src/sysutils.c b/src/sysutils.c index 6c09e47..3778668 100644 --- a/src/sysutils.c +++ b/src/sysutils.c @@ -30,9 +30,6 @@ # include # endif # include -# ifdef HAVE_W32CE_SYSTEM -# include -# endif /*HAVE_W32CE_SYSTEM*/ #endif /*HAVE_W32_SYSTEM*/ #include "assuan-defs.h" @@ -54,87 +51,3 @@ _assuan_sysutils_blurb (void) "\n\n"; return blurb; } - - -/* Return a string from the Win32 Registry or NULL in case of error. - The returned string is allocated using a plain malloc and thus the - caller needs to call the standard free(). The string is looked up - under HKEY_LOCAL_MACHINE. */ -#ifdef HAVE_W32CE_SYSTEM -static char * -w32_read_registry (const wchar_t *dir, const wchar_t *name) -{ - HKEY handle; - DWORD n, nbytes; - wchar_t *buffer = NULL; - char *result = NULL; - - if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, dir, 0, KEY_READ, &handle)) - return NULL; /* No need for a RegClose, so return immediately. */ - - nbytes = 1; - if (RegQueryValueEx (handle, name, 0, NULL, NULL, &nbytes)) - goto out; - buffer = malloc ((n=nbytes+2)); - if (!buffer) - goto out; - if (RegQueryValueEx (handle, name, 0, NULL, (PBYTE)buffer, &n)) - { - free (buffer); - buffer = NULL; - goto out; - } - - n = WideCharToMultiByte (CP_UTF8, 0, buffer, nbytes, NULL, 0, NULL, NULL); - if (n < 0 || (n+1) <= 0) - goto out; - result = malloc (n+1); - if (!result) - goto out; - n = WideCharToMultiByte (CP_UTF8, 0, buffer, nbytes, result, n, NULL, NULL); - if (n < 0) - { - free (result); - result = NULL; - goto out; - } - result[n] = 0; - - out: - free (buffer); - RegCloseKey (handle); - return result; -} -#endif /*HAVE_W32CE_SYSTEM*/ - - - -#ifdef HAVE_W32CE_SYSTEM -/* Replacement for getenv which takes care of the our use of getenv. - The code is not thread safe but we expect it to work in all cases - because it is called for the first time early enough. */ -char * -_assuan_getenv (const char *name) -{ - static int initialized; - static char *val_debug; - static char *val_full_logging; - - if (!initialized) - { - val_debug = w32_read_registry (L"\\Software\\GNU\\libassuan", - L"debug"); - val_full_logging = w32_read_registry (L"\\Software\\GNU\\libassuan", - L"full_logging"); - initialized = 1; - } - - - if (!strcmp (name, "ASSUAN_DEBUG")) - return val_debug; - else if (!strcmp (name, "ASSUAN_FULL_LOGGING")) - return val_full_logging; - else - return NULL; -} -#endif /*HAVE_W32CE_SYSTEM*/ -- cgit v1.2.3