mirror of
https://github.com/LibreSplit/LibreSplit.git
synced 2026-04-27 22:30:30 +00:00
This should allow for plugins to refer to LibreSplit's functions without having to pull in half of the codebase.
46 lines
1.1 KiB
C
46 lines
1.1 KiB
C
#pragma once
|
|
#include "include/lasr/auto-splitter.h"
|
|
#include "include/timer.h"
|
|
#include "lua.h"
|
|
|
|
extern ExternalLASRFunctionRegistry external_lasr_functions;
|
|
|
|
extern TimerHookRegistry start_hooks;
|
|
extern TimerHookRegistry stop_hooks;
|
|
extern TimerHookRegistry split_hooks;
|
|
extern TimerHookRegistry reset_hooks;
|
|
extern TimerHookRegistry cancel_hooks;
|
|
extern TimerHookRegistry skip_hooks;
|
|
extern TimerHookRegistry unsplit_hooks;
|
|
extern TimerHookRegistry pause_hooks;
|
|
extern TimerHookRegistry unpause_hooks;
|
|
|
|
/*! \enum event
|
|
*
|
|
* Describes the events you can register an event hook for.
|
|
*/
|
|
typedef enum HookableEvent {
|
|
START,
|
|
SPLIT,
|
|
STOP,
|
|
RESET,
|
|
CANCEL,
|
|
SKIP,
|
|
UNSPLIT,
|
|
PAUSE,
|
|
UNPAUSE,
|
|
} HookableEvent;
|
|
|
|
typedef int (*register_lua_func)(const char*, lua_CFunction);
|
|
typedef int (*register_event_func)(HookableEvent event, timer_hook_func fn);
|
|
|
|
typedef struct PlugAPI {
|
|
register_lua_func register_lua_function;
|
|
register_event_func register_event_hook;
|
|
} PlugAPI;
|
|
|
|
int register_lua_function(const char* name, lua_CFunction);
|
|
|
|
int register_event_hook(HookableEvent event, timer_hook_func fn);
|
|
|
|
void init_external_lasr_functions(void);
|