diff options
Diffstat (limited to 'src/jalv_internal.h')
-rw-r--r-- | src/jalv_internal.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/jalv_internal.h b/src/jalv_internal.h index 3eb1a3d..c171b72 100644 --- a/src/jalv_internal.h +++ b/src/jalv_internal.h @@ -18,6 +18,8 @@ #define JALV_INTERNAL_H #include <semaphore.h> +#include <stdlib.h> +#include <string.h> #include <jack/jack.h> #include <jack/ringbuffer.h> @@ -138,6 +140,15 @@ jalv_restore(Jalv* jalv, const char* dir); void jalv_restore_instance(Jalv* jalv, const char* dir); +static inline char* +jalv_strdup(const char* str) +{ + const size_t len = strlen(str); + char* copy = (char*)malloc(len + 1); + memcpy(copy, str, len + 1); + return copy; +} + #ifdef __cplusplus } // extern "C" #endif |