summaryrefslogtreecommitdiff
path: root/src/gpgrt-int.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2017-11-17 11:26:03 +0100
committerWerner Koch <wk@gnupg.org>2017-11-17 11:26:03 +0100
commit0d8d46c76a32176be440b062d2501bbb044fb99d (patch)
tree7033aa06cf73e40bd8360a8058262bd61d9c0d4f /src/gpgrt-int.h
parent80c18e1b212cc91946864db7a53da50e9f91b861 (diff)
downloadlibgpg-error-0d8d46c76a32176be440b062d2501bbb044fb99d.tar.gz
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 <wk@gnupg.org>
Diffstat (limited to 'src/gpgrt-int.h')
-rw-r--r--src/gpgrt-int.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gpgrt-int.h b/src/gpgrt-int.h
index 4db330f..c226e2b 100644
--- a/src/gpgrt-int.h
+++ b/src/gpgrt-int.h
@@ -85,6 +85,14 @@
#endif /*_GPGRT_NEED_AFLOCAL*/
+/*
+ * Common helper macros.
+ */
+#ifndef DIM
+# define DIM(array) (sizeof (array) / sizeof (*array))
+#endif
+
+
/*
* Local error function prototypes.
@@ -103,8 +111,12 @@ void _gpgrt_set_alloc_func (void *(*f)(void *a, size_t n));
void *_gpgrt_realloc (void *a, size_t n);
void *_gpgrt_malloc (size_t n);
-void _gpgrt_free (void *a);
void *_gpgrt_calloc (size_t n, size_t m);
+char *_gpgrt_strdup (const char *string);
+char *_gpgrt_strconcat (const char *s1, ...) GPGRT_ATTR_SENTINEL(0);
+void _gpgrt_free (void *a);
+/* The next is only to be used by visibility.c. */
+char *_gpgrt_strconcat_core (const char *s1, va_list arg_ptr);
const char *_gpg_error_check_version (const char *req_version);