From 0d8d46c76a32176be440b062d2501bbb044fb99d Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 17 Nov 2017 11:26:03 +0100 Subject: 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 --- src/visibility.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/visibility.c') 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) { -- cgit v1.2.3