summaryrefslogtreecommitdiff
path: root/src/gpgrt-int.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2017-11-28 12:34:12 +0100
committerWerner Koch <wk@gnupg.org>2017-11-28 13:10:30 +0100
commitb67daca506991507cea9d383df7faf95117e58a6 (patch)
tree651968189278b3b7143e54d6bf6813c1bfece78e /src/gpgrt-int.h
parent97b0881216af24f2a46c11650e23691cff9cb12a (diff)
downloadlibgpg-error-b67daca506991507cea9d383df7faf95117e58a6.tar.gz
core: New API functions gpgrt_getenv and gpgrt_setenv.
* 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. -- These functions are wrappers to cope with Windows problems. The code is similar to what we have in GnuPG but not identical. Requires better testing. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'src/gpgrt-int.h')
-rw-r--r--src/gpgrt-int.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gpgrt-int.h b/src/gpgrt-int.h
index c0e83b1..c65f630 100644
--- a/src/gpgrt-int.h
+++ b/src/gpgrt-int.h
@@ -559,6 +559,14 @@ int _gpgrt_logv_internal (int level, int ignore_arg_ptr,
/* 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. */
+int _gpgrt_setenv (const char *name, const char *value, int overwrite);
+
+
/*