diff options
author | NIIBE Yutaka <[email protected]> | 2022-08-31 05:18:24 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2022-08-31 05:29:02 +0000 |
commit | e3b1e3857e00c6e8216e953b0b38f4dcda00cd53 (patch) | |
tree | ac7b2d6542c56903847d21b8e50367dd9a0beca4 /src/sysutils.c | |
parent | build: Update config.guess, config.sub, and config.rpath. (diff) | |
download | libassuan-e3b1e3857e00c6e8216e953b0b38f4dcda00cd53.tar.gz libassuan-e3b1e3857e00c6e8216e953b0b38f4dcda00cd53.zip |
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 <[email protected]>
Diffstat (limited to 'src/sysutils.c')
-rw-r--r-- | src/sysutils.c | 87 |
1 files changed, 0 insertions, 87 deletions
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 <winsock2.h> # endif # include <windows.h> -# ifdef HAVE_W32CE_SYSTEM -# include <winioctl.h> -# 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*/ |