Re-added Data:getPointer (can be used with LuaJIT's FFI)

This commit is contained in:
Alex Szpakowski
2013-08-29 17:16:21 -03:00
parent 4c4a385ce6
commit c15fc4453b
7 changed files with 14 additions and 0 deletions
+8
View File
@@ -35,6 +35,13 @@ int w_Data_getString(lua_State *L)
return 1;
}
int w_Data_getPointer(lua_State *L)
{
Data *t = luax_checkdata(L, 1);
lua_pushlightuserdata(L, t->getData());
return 1;
}
int w_Data_getSize(lua_State *L)
{
Data *t = luax_checkdata(L, 1);
@@ -45,6 +52,7 @@ int w_Data_getSize(lua_State *L)
const luaL_Reg w_Data_functions[] =
{
{ "getString", w_Data_getString },
{ "getPointer", w_Data_getPointer },
{ "getSize", w_Data_getSize },
{ 0, 0 }
};