refactor: Entire code base, thread and log usage

Boils down to:
- Include headers
- Reduce boiler plate with helpers
- Swap out explicit usages with core API layer
  and ensure the right API is configured beforehand
This commit is contained in:
icex2
2024-08-14 17:53:51 +02:00
parent 82d1a2df52
commit 93e0a090bc
338 changed files with 1307 additions and 641 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
dlls += eamio
libs_eamio := geninput util
libs_eamio := core geninput util
src_eamio := \
eam-api.c \
eam-impl.c \
+5 -4
View File
@@ -11,14 +11,15 @@
#include "bemanitools/eamio.h"
#include "bemanitools/input.h"
#include "core/log.h"
#include "core/thread.h"
#include "eamio/eam-config.h"
#include "eamio/eam-impl.h"
#include "eamio/eam-s11n.h"
#include "util/fs.h"
#include "util/log.h"
#include "util/msg-thread.h"
#include "util/thread.h"
static void eam_handle_hotplug_msg(WPARAM wparam, const DEV_BROADCAST_HDR *hdr);
static FILE *eam_io_config_open(const char *mode);
@@ -108,14 +109,14 @@ void eam_io_set_loggers(
log_formatter_t warning,
log_formatter_t fatal)
{
log_to_external(misc, info, warning, fatal);
core_log_impl_set(misc, info, warning, fatal);
}
bool eam_io_init(
thread_create_t create, thread_join_t join, thread_destroy_t destroy)
{
input_init(create, join, destroy);
thread_api_init(create, join, destroy);
core_thread_impl_set(create, join, destroy);
eam_io_config_load();
msg_thread_init(eam_hinst);
+2 -1
View File
@@ -9,6 +9,8 @@
#include "bemanitools/eamio.h"
#include "core/log.h"
#include "eamio/eam-impl.h"
#include "geninput/hid-mgr.h"
@@ -16,7 +18,6 @@
#include "util/defs.h"
#include "util/fs.h"
#include "util/hex.h"
#include "util/log.h"
#include "util/mem.h"
#include "util/str.h"