bananatools/ferrumhook/config.c

48 lines
1.1 KiB
C

#include <assert.h>
#include <stddef.h>
#include "ferrumhook/config.h"
#include "platform/config.h"
void ferrum_dll_config_load(
struct ferrum_dll_config *cfg,
const wchar_t *filename)
{
assert(cfg != NULL);
assert(filename != NULL);
GetPrivateProfileStringW(
L"ferrumio",
L"path",
L"",
cfg->path,
_countof(cfg->path),
filename);
}
void ferrum_xinput_config_load(
struct ferrum_xinput_config *cfg,
const wchar_t *filename)
{
assert(cfg != NULL);
assert(filename != NULL);
cfg->enable = GetPrivateProfileIntW(L"xinput", L"enable", 1, filename);
}
void ferrum_hook_config_load(
struct ferrum_hook_config *cfg,
const wchar_t *filename)
{
assert(cfg != NULL);
assert(filename != NULL);
platform_config_load(&cfg->platform, filename);
ferrum_dll_config_load(&cfg->dll, filename);
ferrum_xinput_config_load(&cfg->xinput, filename);
gfx_config_load(&cfg->gfx, filename);
bpreader_config_load(&cfg->reader, filename);
}