From fb1442b7342b3cef0f906eac3fef21c849213fab Mon Sep 17 00:00:00 2001 From: icex2 Date: Sun, 25 Feb 2024 09:30:53 +0100 Subject: [PATCH] feat: Add helper to set avs implementations Doesn't really reduce boiler plate but adds clarity with a more meaningful function name what the operation does. --- src/main/avs-util/Module.mk | 1 + src/main/avs-util/core-interop.c | 16 ++++++++++++++++ src/main/avs-util/core-interop.h | 7 +++++++ 3 files changed, 24 insertions(+) create mode 100644 src/main/avs-util/core-interop.c create mode 100644 src/main/avs-util/core-interop.h diff --git a/src/main/avs-util/Module.mk b/src/main/avs-util/Module.mk index 8db0691..2e59f57 100644 --- a/src/main/avs-util/Module.mk +++ b/src/main/avs-util/Module.mk @@ -3,4 +3,5 @@ libs += avs-util libs_avs-util := \ src_avs-util := \ + core-interop.c \ error.c \ diff --git a/src/main/avs-util/core-interop.c b/src/main/avs-util/core-interop.c new file mode 100644 index 0000000..555930f --- /dev/null +++ b/src/main/avs-util/core-interop.c @@ -0,0 +1,16 @@ +#include "core/log.h" +#include "core/thread.h" + +#include "imports/avs.h" + +void avs_util_core_interop_log_avs_impl_set() +{ + core_log_impl_set( + log_body_misc, log_body_info, log_body_warning, log_body_fatal); +} + +void avs_util_core_interop_thread_avs_impl_set() +{ + core_thread_impl_set( + avs_thread_create, avs_thread_join, avs_thread_destroy); +} \ No newline at end of file diff --git a/src/main/avs-util/core-interop.h b/src/main/avs-util/core-interop.h new file mode 100644 index 0000000..51b1e11 --- /dev/null +++ b/src/main/avs-util/core-interop.h @@ -0,0 +1,7 @@ +#ifndef AVS_UTIL_CORE_INTEROP_H +#define AVS_UTIL_CORE_INTEROP_H + +void avs_util_core_interop_log_avs_impl_set(); +void avs_util_core_interop_thread_avs_impl_set(); + +#endif \ No newline at end of file