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-02-23 13:29:53 +01:00
parent bc9b8b508e
commit 0adec478cc
338 changed files with 1307 additions and 640 deletions
+1
View File
@@ -4,6 +4,7 @@ deplibs_unicorntail := \
avs \
libs_unicorntail := \
core \
p3io \
p3ioemu \
hook \
+3 -2
View File
@@ -2,6 +2,8 @@
#include <stdbool.h>
#include "core/log.h"
#include "hook/iohook.h"
#include "hooklib/app.h"
@@ -12,7 +14,6 @@
#include "unicorntail/usbmem.h"
#include "util/defs.h"
#include "util/log.h"
static bool my_dll_entry_init(char *sidcode, struct property_node *param);
static bool my_dll_entry_main(void);
@@ -50,7 +51,7 @@ BOOL WINAPI DllMain(HMODULE self, DWORD reason, void *ctx)
goto end;
}
log_to_external(
core_log_impl_set(
log_body_misc, log_body_info, log_body_warning, log_body_fatal);
app_hook_init(my_dll_entry_init, my_dll_entry_main);
+2 -1
View File
@@ -3,6 +3,8 @@
#include <stdbool.h>
#include <stdint.h>
#include "core/log.h"
#include "p3io/cmd.h"
#include "p3io/frame.h"
@@ -11,7 +13,6 @@
#include "unicorntail/p3io.h"
#include "util/array.h"
#include "util/log.h"
#include "util/str.h"
static bool p3io_match_irp_locked(const struct irp *irp);
+2 -1
View File
@@ -3,9 +3,10 @@
#include <stdbool.h>
#include <stddef.h>
#include "core/log.h"
#include "hook/iohook.h"
#include "util/log.h"
#include "util/str.h"
static bool usbmem_match_irp(const struct irp *irp);