Repository navigation
Expand file tree
/
Copy pathLuaSF.hpp.in
More file actions
40 lines (35 loc) · 1.52 KB
/
Copy pathLuaSF.hpp.in
File metadata and controls
40 lines (35 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include <cstddef>
#include "LuaSFValueTraits.hpp"
#if defined(_WIN32)
#if defined(LUASF_BUILD_DLL)
#define LUASF_API __declspec(dllexport)
#else
#define LUASF_API __declspec(dllimport)
#endif
#elif defined(__GNUC__) || defined(__clang__)
#define LUASF_API __attribute__((visibility("default")))
#else
#define LUASF_API
#endif
struct lua_State;
using LuaSFStateEnterHook = int (*)(lua_State* state, void* context) noexcept;
using LuaSFStateTryEnterHook = int (*)(lua_State* state, void* context) noexcept;
using LuaSFStateLeaveHook = void (*)(lua_State* state, void* context) noexcept;
extern "C" LUASF_API int LuaSF_initialize_state(lua_State* state);
extern "C" LUASF_API int LuaSF_set_state_execution_hooks(
lua_State* state,
LuaSFStateEnterHook enterHook,
LuaSFStateTryEnterHook tryEnterHook,
LuaSFStateLeaveHook leaveHook,
void* context);
extern "C" LUASF_API void LuaSF_quiesce_state(lua_State* state) noexcept;
extern "C" LUASF_API void LuaSF_shutdown_state(lua_State* state);
extern "C" LUASF_API int LuaSF_enter_state(lua_State* state);
extern "C" LUASF_API int LuaSF_try_enter_state(lua_State* state) noexcept;
extern "C" LUASF_API void LuaSF_leave_state(lua_State* state) noexcept;
extern "C" LUASF_API int LuaSF_take_deferred_callback_error(
lua_State* state, char* buffer, std::size_t capacity);
extern "C" LUASF_API int {module_name}_register(lua_State* state);
extern "C" LUASF_API int {module_name}_write_stub(lua_State* state,
const char* path);