Lua script something
This commit is contained in:
40
src/script/scriptmanager.h
Normal file
40
src/script/scriptmanager.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "error/error.h"
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
#include <lualib.h>
|
||||
|
||||
typedef struct scriptmanager_s {
|
||||
lua_State *luaState;
|
||||
} scriptmanager_t;
|
||||
|
||||
extern scriptmanager_t SCRIPT_MANAGER;
|
||||
|
||||
/**
|
||||
* Initialize the script manager.
|
||||
*
|
||||
* @return The error return value.
|
||||
*/
|
||||
errorret_t scriptManagerInit();
|
||||
|
||||
/**
|
||||
* Execute a Lua script.
|
||||
*
|
||||
* @param script The script to execute.
|
||||
* @return The error return value.
|
||||
*/
|
||||
errorret_t scriptManagerExec(const char_t *script);
|
||||
|
||||
/**
|
||||
* Dispose of the script manager.
|
||||
*
|
||||
* @return The error return value.
|
||||
*/
|
||||
errorret_t scriptManagerDispose();
|
||||
Reference in New Issue
Block a user