From a674fbe45df718f194948a7fa399c58fd9672519 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 7 Jun 2015 20:55:38 +0000 Subject: MirLua: initial commit git-svn-id: http://svn.miranda-ng.org/main/trunk@14061 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/mlua.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 plugins/MirLua/src/mlua.cpp (limited to 'plugins/MirLua/src/mlua.cpp') diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp new file mode 100644 index 0000000000..ee6d91e117 --- /dev/null +++ b/plugins/MirLua/src/mlua.cpp @@ -0,0 +1,20 @@ +#include "stdafx.h" + +CMLua::CMLua() +{ + lua = luaL_newstate(); + + luaL_openlibs(lua); + luaL_newlib(lua, CMLua::CoreFunctions); + lua_setglobal(lua, "M"); +} + +CMLua::~CMLua() +{ + lua_close(lua); +} + +void CMLua::Load(const char *name) +{ + luaL_dofile(lua, name); +} \ No newline at end of file -- cgit v1.2.3