luainstance: add GetRevision() function

- Set Lua api version to 1.12

Signed-off-by: svenhoefer <svenhoefer@svenhoefer.com>


Origin commit data
------------------
Branch: ni/coolstream
Commit: 7caf055ea0
Author: defans <defans@bluepeercrew.us>
Date: 2015-11-23 (Mon, 23 Nov 2015)

Origin message was:
------------------
- luainstance: add GetRevision() function

 - Set Lua api version to 1.12

Signed-off-by: svenhoefer <svenhoefer@svenhoefer.com>


------------------
This commit was generated by Migit
This commit is contained in:
defans
2015-11-23 22:02:27 +01:00
committed by Michael Liebmann
parent af4a8016ec
commit 9b60d60076
2 changed files with 13 additions and 1 deletions

View File

@@ -542,6 +542,7 @@ void CLuaInstance::abortScript()
const luaL_Reg CLuaInstance::methods[] =
{
{ "GetRevision", CLuaInstance::GetRevision },
{ "PaintBox", CLuaInstance::PaintBox },
{ "RenderString", CLuaInstance::RenderString },
{ "PaintIcon", CLuaInstance::PaintIcon },
@@ -646,6 +647,16 @@ int CLuaInstance::NewWindow(lua_State *L)
return 1;
}
int CLuaInstance::GetRevision(lua_State *L)
{
unsigned int ret = 0;
#if HAVE_COOL_HARDWARE
ret = cs_get_revision();
#endif
lua_pushinteger(L, ret);
return 1;
}
int CLuaInstance::PaintBox(lua_State *L)
{
int count = lua_gettop(L);

View File

@@ -34,7 +34,7 @@ extern "C" {
#include <vector>
#define LUA_API_VERSION_MAJOR 1
#define LUA_API_VERSION_MINOR 11
#define LUA_API_VERSION_MINOR 12
/* this is stored as userdata in the lua_State */
struct CLuaData
@@ -215,6 +215,7 @@ private:
static void paramDeprecated(lua_State *L, const char* oldParam, const char* newParam);
static lua_Unsigned checkMagicMask(lua_Unsigned &col);
static int GetRevision(lua_State *L);
static int NewWindow(lua_State *L);
static int PaintBox(lua_State *L);
static int PaintIcon(lua_State *L);