ekt: move files around

This commit is contained in:
2025-09-04 08:42:54 +02:00
parent dc631215b1
commit 619285c412
15 changed files with 140 additions and 154 deletions

View File

@ -7,6 +7,8 @@
#include "hooklib/config.h"
#include "hooklib/dvd.h"
#include "hooklib/y3.h"
#include "hooklib/y3-dll.h"
void dvd_config_load(struct dvd_config *cfg, const wchar_t *filename)
{
@ -148,3 +150,97 @@ void printer_cx_config_load(struct printer_cx_config *cfg, const wchar_t *filena
filename);
}
void y3_dll_config_load(
struct y3_dll_config *cfg,
const wchar_t *filename)
{
assert(cfg != NULL);
assert(filename != NULL);
GetPrivateProfileStringW(
L"y3io",
L"path",
L"",
cfg->path,
_countof(cfg->path),
filename);
}
void y3_config_load(
struct y3_config *cfg,
const wchar_t *filename)
{
assert(cfg != NULL);
assert(filename != NULL);
wchar_t tmpstr[5];
memset(cfg->firm_name_field, ' ', sizeof(cfg->firm_name_field) - 1);
cfg->firm_name_field[sizeof(cfg->firm_name_field) - 1] = '\0';
memset(cfg->firm_name_printer, ' ', sizeof(cfg->firm_name_printer) - 1);
cfg->firm_name_printer[sizeof(cfg->firm_name_printer) - 1] = '\0';
memset(cfg->target_code_field, ' ', sizeof(cfg->target_code_field) - 1);
cfg->target_code_field[sizeof(cfg->target_code_field) - 1] = '\0';
memset(cfg->target_code_printer, ' ', sizeof(cfg->target_code_printer) - 1);
cfg->target_code_printer[sizeof(cfg->target_code_printer) - 1] = '\0';
cfg->enable = GetPrivateProfileIntW(L"flatPanelReader", L"enable", 1, filename);
cfg->port_field = GetPrivateProfileIntW(L"flatPanelReader", L"port_field", 10, filename);
cfg->port_printer = GetPrivateProfileIntW(L"flatPanelReader", L"port_printer", 11, filename);
cfg->dll_version = (float)GetPrivateProfileIntW(
L"flatPanelReader",
L"dllVersion",
1,
filename);
cfg->firm_version = (float)GetPrivateProfileIntW(
L"flatPanelReader",
L"firmVersion",
1,
filename);
GetPrivateProfileStringW(
L"flatPanelReader",
L"firmNameField",
L"SFPR",
tmpstr,
_countof(tmpstr),
filename);
wcstombs(cfg->firm_name_field, tmpstr, sizeof(cfg->firm_name_field) - 1);
GetPrivateProfileStringW(
L"flatPanelReader",
L"firmNamePrinter",
L"SPRT",
tmpstr,
_countof(tmpstr),
filename);
wcstombs(cfg->firm_name_printer, tmpstr, sizeof(cfg->firm_name_printer) - 1);
GetPrivateProfileStringW(
L"flatPanelReader",
L"targetCodeField",
L"SFR0",
tmpstr,
_countof(tmpstr),
filename);
wcstombs(cfg->target_code_field, tmpstr, sizeof(cfg->target_code_field) - 1);
GetPrivateProfileStringW(
L"flatPanelReader",
L"targetCodePrinter",
L"SPT0",
tmpstr,
_countof(tmpstr),
filename);
wcstombs(cfg->target_code_printer, tmpstr, sizeof(cfg->target_code_printer) - 1);
}

View File

@ -7,7 +7,26 @@
#include "hooklib/printer_chc.h"
#include "hooklib/printer_cx.h"
struct y3_config {
bool enable;
float dll_version;
float firm_version;
char firm_name_field[5];
char firm_name_printer[5];
char target_code_field[5];
char target_code_printer[5];
uint8_t port_field;
uint8_t port_printer;
};
struct y3_dll_config {
wchar_t path[MAX_PATH];
};
void dvd_config_load(struct dvd_config *cfg, const wchar_t *filename);
void touch_screen_config_load(struct touch_screen_config *cfg, const wchar_t *filename);
void printer_chc_config_load(struct printer_chc_config *cfg, const wchar_t *filename);
void printer_cx_config_load(struct printer_cx_config *cfg, const wchar_t *filename);
void y3_config_load(struct y3_config *cfg, const wchar_t *filename);
void y3_dll_config_load(struct y3_dll_config *cfg, const wchar_t *filename);

View File

@ -37,5 +37,9 @@ hooklib_lib = static_library(
'printer_chc.h',
'printer_cx.c',
'printer_cx.h',
'y3.c',
'y3.h',
'y3-dll.c',
'y3-dll.h',
],
)

View File

@ -3,12 +3,14 @@
#include <assert.h>
#include <stdlib.h>
#include "config.h"
#include "y3.h"
#include "y3-dll.h"
#include "hooklib/config.h"
#include "util/dll-bind.h"
#include "util/dprintf.h"
#include "y3.h"
#include "y3-dll.h"
const struct dll_bind_sym y3_dll_syms[] = {
{
.sym = "y3_io_init",

View File

@ -4,8 +4,8 @@
#include <stdbool.h>
#include <stdint.h>
#include "config.h"
#include "y3.h"
#include "hooklib/y3.h"
struct y3_dll {
uint16_t api_version;

View File

@ -7,11 +7,12 @@
#include <assert.h>
#include "y3.h"
#include "y3-dll.h"
#include "hook/table.h"
#include "hook/procaddr.h"
#include "hooklib/y3-dll.h"
#include "util/dprintf.h"
#define CALL __cdecl

View File

@ -3,7 +3,7 @@
#include <stdint.h>
#include <stdbool.h>
#include "config.h"
#include "hooklib/config.h"
#pragma pack(push, 1)

View File

@ -1,100 +0,0 @@
#include "y3io/config.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
void y3_config_load(
struct y3_config *cfg,
const wchar_t *filename)
{
assert(cfg != NULL);
assert(filename != NULL);
wchar_t tmpstr[5];
memset(cfg->firm_name_field, ' ', sizeof(cfg->firm_name_field) - 1);
cfg->firm_name_field[sizeof(cfg->firm_name_field) - 1] = '\0';
memset(cfg->firm_name_printer, ' ', sizeof(cfg->firm_name_printer) - 1);
cfg->firm_name_printer[sizeof(cfg->firm_name_printer) - 1] = '\0';
memset(cfg->target_code_field, ' ', sizeof(cfg->target_code_field) - 1);
cfg->target_code_field[sizeof(cfg->target_code_field) - 1] = '\0';
memset(cfg->target_code_printer, ' ', sizeof(cfg->target_code_printer) - 1);
cfg->target_code_printer[sizeof(cfg->target_code_printer) - 1] = '\0';
cfg->enable = GetPrivateProfileIntW(L"flatPanelReader", L"enable", 1, filename);
cfg->port_field = GetPrivateProfileIntW(L"flatPanelReader", L"port_field", 10, filename);
cfg->port_printer = GetPrivateProfileIntW(L"flatPanelReader", L"port_printer", 11, filename);
cfg->dll_version = (float)GetPrivateProfileIntW(
L"flatPanelReader",
L"dllVersion",
1,
filename);
cfg->firm_version = (float)GetPrivateProfileIntW(
L"flatPanelReader",
L"firmVersion",
1,
filename);
GetPrivateProfileStringW(
L"flatPanelReader",
L"firmNameField",
L"SFPR",
tmpstr,
_countof(tmpstr),
filename);
wcstombs(cfg->firm_name_field, tmpstr, sizeof(cfg->firm_name_field) - 1);
GetPrivateProfileStringW(
L"flatPanelReader",
L"firmNamePrinter",
L"SPRT",
tmpstr,
_countof(tmpstr),
filename);
wcstombs(cfg->firm_name_printer, tmpstr, sizeof(cfg->firm_name_printer) - 1);
GetPrivateProfileStringW(
L"flatPanelReader",
L"targetCodeField",
L"SFR0",
tmpstr,
_countof(tmpstr),
filename);
wcstombs(cfg->target_code_field, tmpstr, sizeof(cfg->target_code_field) - 1);
GetPrivateProfileStringW(
L"flatPanelReader",
L"targetCodePrinter",
L"SPT0",
tmpstr,
_countof(tmpstr),
filename);
wcstombs(cfg->target_code_printer, tmpstr, sizeof(cfg->target_code_printer) - 1);
}
void y3_dll_config_load(
struct y3_dll_config *cfg,
const wchar_t *filename)
{
assert(cfg != NULL);
assert(filename != NULL);
GetPrivateProfileStringW(
L"y3io",
L"path",
L"",
cfg->path,
_countof(cfg->path),
filename);
}

View File

@ -1,29 +0,0 @@
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <windows.h>
struct y3_config {
bool enable;
float dll_version;
float firm_version;
char firm_name_field[5];
char firm_name_printer[5];
char target_code_field[5];
char target_code_printer[5];
uint8_t port_field;
uint8_t port_printer;
};
struct y3_dll_config {
wchar_t path[MAX_PATH];
};
void y3_config_load(
struct y3_config *cfg,
const wchar_t *filename);
void y3_dll_config_load(
struct y3_dll_config *cfg,
const wchar_t *filename);

View File

@ -2,7 +2,8 @@
#include <windows.h>
#include "util/dprintf.h"
#include "y3io/y3.h"
#include "hooklib/y3.h"
uint16_t y3_io_get_api_version() {

View File

@ -6,7 +6,7 @@
#include "3rdparty/websockets/websocket.h"
#include "3rdparty/cjson/cJSON.h"
#include "util/dprintf.h"
#include "y3io/y3.h"
#include "../../../hooklib/y3.h"
DWORD __stdcall y3_websocket_thread_proc(LPVOID ctx);

View File

@ -11,12 +11,6 @@ y3io_lib = static_library(
util_lib
],
sources : [
'config.c',
'config.h',
'y3-dll.c',
'y3-dll.h',
'y3.c',
'y3.h',
'impl/dummy/y3io.c',
'impl/websockets/y3io.c',
'impl/websockets/3rdparty/websockets/aw-base64.h',

View File

@ -3,15 +3,13 @@
#include "board/config.h"
#include "ekthook/config.h"
#include "ekthook/ekt-dll.h"
#include "hooklib/config.h"
#include "platform/config.h"
#include "ekthook/config.h"
#include "y3io/config.h"
#include "ekthook/ekt-dll.h"
void led15093_config_load(struct led15093_config *cfg, const wchar_t *filename)
{
assert(cfg != NULL);

View File

@ -6,6 +6,9 @@
#include "board/config.h"
#include "board/led15093.h"
#include "ekthook/ekt-dll.h"
#include "hooklib/config.h"
#include "hooklib/dvd.h"
#include "hooklib/printer_cx.h"
@ -13,9 +16,6 @@
#include "unityhook/config.h"
#include "ekthook/ekt-dll.h"
#include "y3io/config.h"
struct ekt_hook_config {
struct platform_config platform;
struct aime_config aime;

View File

@ -42,8 +42,8 @@
#include "util/dprintf.h"
#include "util/env.h"
#include "y3io/y3-dll.h"
#include "y3io/y3.h"
#include "hooklib/y3-dll.h"
#include "hooklib/y3.h"
static HMODULE ekt_hook_mod;
static process_entry_t ekt_startup;