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:
@@ -1,5 +1,5 @@
|
||||
dlls += eamio
|
||||
libs_eamio := geninput util
|
||||
libs_eamio := core geninput util
|
||||
src_eamio := \
|
||||
eam-api.c \
|
||||
eam-impl.c \
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user