aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
parentdd3833d21a71893e8ba143edaad7f5ef279fcbaa (diff)
downloadjalv-7179a0eb65a72dfa22998be2e2792bb2aed330c6.tar.gz
jalv-7179a0eb65a72dfa22998be2e2792bb2aed330c6.tar.bz2
jalv-7179a0eb65a72dfa22998be2e2792bb2aed330c6.zip
Separate log.h from jalv_internal.h
Diffstat (limited to 'src')
-rw-r--r--src/jack.c1
-rw-r--r--src/jalv.c1
-rw-r--r--src/jalv_console.c1
-rw-r--r--src/jalv_internal.h33
-rw-r--r--src/log.c7
-rw-r--r--src/log.h54
-rw-r--r--src/state.c1
7 files changed, 65 insertions, 33 deletions
diff --git a/src/jack.c b/src/jack.c
index 3e06e44..95b6b1d 100644
--- a/src/jack.c
+++ b/src/jack.c
@@ -3,6 +3,7 @@
#include "jalv_config.h"
#include "jalv_internal.h"
+#include "log.h"
#include "lv2_evbuf.h"
#include "lilv/lilv.h"
diff --git a/src/jalv.c b/src/jalv.c
index eb259bb..278f54b 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -7,6 +7,7 @@
#include "jalv_config.h"
#include "jalv_internal.h"
+#include "log.h"
#include "lv2_evbuf.h"
#include "worker.h"
diff --git a/src/jalv_console.c b/src/jalv_console.c
index 943587a..496a9e5 100644
--- a/src/jalv_console.c
+++ b/src/jalv_console.c
@@ -8,6 +8,7 @@
#include "jalv_config.h"
#include "jalv_internal.h"
+#include "log.h"
#include "lilv/lilv.h"
#include "lv2/ui/ui.h"
diff --git a/src/jalv_internal.h b/src/jalv_internal.h
index 1cc10f4..ce34de6 100644
--- a/src/jalv_internal.h
+++ b/src/jalv_internal.h
@@ -30,12 +30,9 @@
#include "lv2/urid/urid.h"
#include "lv2/worker/worker.h"
-#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#ifdef __clang__
# define REALTIME __attribute__((annotate("realtime")))
@@ -43,12 +40,6 @@
# define REALTIME
#endif
-#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
@@ -466,6 +457,7 @@ jalv_save(Jalv* jalv, const char* dir);
void
jalv_save_port_values(Jalv* jalv, SerdWriter* writer, const SerdNode* subject);
+
char*
jalv_make_path(LV2_State_Make_Path_Handle handle, const char* path);
@@ -478,29 +470,6 @@ atom_to_turtle(LV2_URID_Unmap* unmap,
const SerdNode* predicate,
const LV2_Atom* atom);
-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
diff --git a/src/log.c b/src/log.c
index c59d8a0..70b272d 100644
--- a/src/log.c
+++ b/src/log.c
@@ -1,11 +1,14 @@
-// Copyright 2007-2016 David Robillard <d@drobilla.net>
+// Copyright 2007-2022 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
#define _POSIX_C_SOURCE 200809L
+#include "log.h"
+
#include "jalv_config.h"
#include "jalv_internal.h"
+#include "lilv/lilv.h"
#include "lv2/log/log.h"
#include "lv2/urid/urid.h"
@@ -16,6 +19,8 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
void
jalv_print_control(Jalv* const jalv,
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
diff --git a/src/state.c b/src/state.c
index c12ed28..b7d8ea3 100644
--- a/src/state.c
+++ b/src/state.c
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: ISC
#include "jalv_internal.h"
+#include "log.h"
#include "lilv/lilv.h"
#include "lv2/atom/forge.h"