mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 17:31:11 +02:00
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:
@@ -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);
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user