summaryrefslogtreecommitdiff
path: root/src/gpg-error.h.in
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/gpg-error.h.in
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/gpg-error.h.in')
-rw-r--r--src/gpg-error.h.in13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in
index 35027d6..3d9c914 100644
--- a/src/gpg-error.h.in
+++ b/src/gpg-error.h.in
@@ -445,6 +445,19 @@ 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.*/
+int gpgrt_setenv (const char *name, const char *value, int overwrite);
+#define gpgrt_unsetenv(n) gpgrt_setenv ((n), NULL, 1)
+
+
+
/*
* Lock functions.