aboutsummaryrefslogtreecommitdiffstats
path: root/src/log.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-05-30 17:08:39 -0400
committerDavid Robillard <d@drobilla.net>2022-08-17 13:50:15 -0400
commit7179a0eb65a72dfa22998be2e2792bb2aed330c6 (patch)
treedfa3ee14a05e88f70ec7e31e03a356c2632c57ec /src/log.h
parentdd3833d21a71893e8ba143edaad7f5ef279fcbaa (diff)
downloadjalv-7179a0eb65a72dfa22998be2e2792bb2aed330c6.tar.gz
jalv-7179a0eb65a72dfa22998be2e2792bb2aed330c6.tar.bz2
jalv-7179a0eb65a72dfa22998be2e2792bb2aed330c6.zip
Separate log.h from jalv_internal.h
Diffstat (limited to 'src/log.h')
-rw-r--r--src/log.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/log.h b/src/log.h
new file mode 100644
index 0000000..a939d3d
--- /dev/null
+++ b/src/log.h
@@ -0,0 +1,54 @@
+// Copyright 2007-2022 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef JALV_LOG_H
+#define JALV_LOG_H
+
+#include "jalv_internal.h"
+
+#include "lv2/log/log.h"
+#include "lv2/urid/urid.h"
+
+#include <stdbool.h>
+#include <stdio.h>
+
+#ifdef __GNUC__
+# define JALV_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1)))
+#else
+# define JALV_LOG_FUNC(fmt, arg1)
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// String and log utilities
+
+void
+jalv_print_control(Jalv* jalv, const struct Port* port, float value);
+
+char*
+jalv_strdup(const char* str);
+
+char*
+jalv_strjoin(const char* a, const char* b);
+
+JALV_LOG_FUNC(3, 4)
+int
+jalv_printf(LV2_Log_Handle handle, LV2_URID type, const char* fmt, ...);
+
+JALV_LOG_FUNC(3, 0)
+int
+jalv_vprintf(LV2_Log_Handle handle, LV2_URID type, const char* fmt, va_list ap);
+
+bool
+jalv_ansi_start(FILE* stream, int color);
+
+void
+jalv_ansi_reset(FILE* stream);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // JALV_LOG_H