diff options
author | Werner Koch <[email protected]> | 2017-11-17 10:26:03 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2017-11-17 10:26:03 +0000 |
commit | 0d8d46c76a32176be440b062d2501bbb044fb99d (patch) | |
tree | 7033aa06cf73e40bd8360a8058262bd61d9c0d4f /src/visibility.c | |
parent | core: New API functions gpgrt_malloc, gpgrt_calloc, and gpgrt_realloc. (diff) | |
download | libgpg-error-0d8d46c76a32176be440b062d2501bbb044fb99d.tar.gz libgpg-error-0d8d46c76a32176be440b062d2501bbb044fb99d.zip |
core: New API functions gpgrt_strdup and gpgrt_strconcat.
* src/visibility.c (gpgrt_strdup): New API fucntion.
(gpgrt_strconcat): New API fucntion.
* src/visibility.h: Add corresponding macros.
* src/gpg-error.def.in: Add them.
* src/gpg-error.vers: Add them.
* src/gpgrt-int.h (DIM): New macro.
* src/init.c (_gpgrt_strdup): New.
(_gpgrt_strconcat_core): New.
(_gpgrt_strconcat): New.
--
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/visibility.c')
-rw-r--r-- | src/visibility.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/visibility.c b/src/visibility.c index 6172769..888492a 100644 --- a/src/visibility.c +++ b/src/visibility.c @@ -522,6 +522,29 @@ gpgrt_calloc (size_t n, size_t m) return _gpgrt_calloc (n, m); } +char * +gpgrt_strdup (const char *string) +{ + return _gpgrt_strdup (string); +} + +char * +gpgrt_strconcat (const char *s1, ...) +{ + va_list arg_ptr; + char *result; + + if (!s1) + result = _gpgrt_strdup (""); + else + { + va_start (arg_ptr, s1); + result = _gpgrt_strconcat_core (s1, arg_ptr); + va_end (arg_ptr); + } + return result; +} + void gpgrt_free (void *a) { |