mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Lua: Disabled debug library.
This commit is contained in:
parent
ad2a986e88
commit
e196ac08db
@ -30,8 +30,26 @@ void LuaManager::Initialize()
|
||||
// Initialize Lua
|
||||
c_State = lua_open();
|
||||
|
||||
// Load Lua base libraries
|
||||
luaL_openlibs(c_State);
|
||||
// Initialize standard libraries except debug, modified from linit.c
|
||||
const luaL_Reg lualibs[] =
|
||||
{
|
||||
{ "", luaopen_base },
|
||||
{ LUA_LOADLIBNAME, luaopen_package },
|
||||
{ LUA_TABLIBNAME, luaopen_table },
|
||||
{ LUA_IOLIBNAME, luaopen_io },
|
||||
{ LUA_OSLIBNAME, luaopen_os },
|
||||
{ LUA_STRLIBNAME, luaopen_string },
|
||||
{ LUA_MATHLIBNAME, luaopen_math },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
const luaL_Reg* lib = lualibs;
|
||||
for (; lib->func; lib++)
|
||||
{
|
||||
lua_pushcfunction(c_State, lib->func);
|
||||
lua_pushstring(c_State, lib->name);
|
||||
lua_call(c_State, 1, 0);
|
||||
}
|
||||
|
||||
// Register custom types and functions
|
||||
RegisterGlobal(c_State);
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "../LuaManager.h"
|
||||
#include "../../Litestep.h"
|
||||
|
||||
static int Global_Print(lua_State* L)
|
||||
static int Print(lua_State* L)
|
||||
{
|
||||
// Modified version of luaB_print()
|
||||
std::string message;
|
||||
@ -59,5 +59,5 @@ static int Global_Print(lua_State* L)
|
||||
|
||||
void LuaManager::RegisterGlobal(lua_State* L)
|
||||
{
|
||||
lua_register(L, "print", Global_Print);
|
||||
lua_register(L, "print", Print);
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ static int GetStringValue(lua_State* L)
|
||||
|
||||
void LuaManager::RegisterMeasure(lua_State* L)
|
||||
{
|
||||
const luaL_reg functions[] =
|
||||
const luaL_Reg functions[] =
|
||||
{
|
||||
{ "GetName", GetName },
|
||||
{ "GetOption", GetOption },
|
||||
|
@ -148,7 +148,7 @@ static int SetText(lua_State* L)
|
||||
|
||||
void LuaManager::RegisterMeter(lua_State* L)
|
||||
{
|
||||
const luaL_reg functions[] =
|
||||
const luaL_Reg functions[] =
|
||||
{
|
||||
{ "GetName", GetName },
|
||||
{ "GetOption", GetOption },
|
||||
|
@ -179,7 +179,7 @@ static int MakePathAbsolute(lua_State* L)
|
||||
|
||||
void LuaManager::RegisterMeterWindow(lua_State* L)
|
||||
{
|
||||
const luaL_reg functions[] =
|
||||
const luaL_Reg functions[] =
|
||||
{
|
||||
{ "Bang", Bang },
|
||||
{ "GetMeter", GetMeter },
|
||||
|
Loading…
Reference in New Issue
Block a user