aboutsummaryrefslogtreecommitdiffstats
path: root/src/string_utils.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-11-15 09:23:33 -0500
committerDavid Robillard <d@drobilla.net>2024-11-17 14:40:27 -0500
commit9e71c9372d25b699d63a8110ab26a3239ca48cd6 (patch)
tree3415c03bd253bb990d98ee823bb21b5ffa63989e /src/string_utils.h
parent9e74b423c87f50c6f50cc40cece057e439ddca57 (diff)
downloadjalv-9e71c9372d25b699d63a8110ab26a3239ca48cd6.tar.gz
jalv-9e71c9372d25b699d63a8110ab26a3239ca48cd6.tar.bz2
jalv-9e71c9372d25b699d63a8110ab26a3239ca48cd6.zip
Move string utilities to a separate compilation unit
These don't really have anything to do with logging. Also replace a call to the non-standard strdup() in the process.
Diffstat (limited to 'src/string_utils.h')
-rw-r--r--src/string_utils.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/string_utils.h b/src/string_utils.h
new file mode 100644
index 0000000..53f09fd
--- /dev/null
+++ b/src/string_utils.h
@@ -0,0 +1,21 @@
+// Copyright 2007-2022 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef JALV_STRING_UTILS_H
+#define JALV_STRING_UTILS_H
+
+#include "attributes.h"
+
+JALV_BEGIN_DECLS
+
+/// Return a newly allocated copy of a string
+char*
+jalv_strdup(const char* str);
+
+/// Return a newly allocated concatenation of two strings
+char*
+jalv_strjoin(const char* a, const char* b);
+
+JALV_END_DECLS
+
+#endif // JALV_STRING_UTILS_H