add lua_version()

This commit is contained in:
Francois Perrad 2017-03-20 19:01:33 +01:00
parent 4e460bb7a3
commit b7ea5c97b8
2 changed files with 6 additions and 0 deletions

View File

@ -112,6 +112,11 @@ LUA_API void lua_xmove(lua_State *from, lua_State *to, int n)
from->top = f; from->top = f;
} }
LUA_API const lua_Number *lua_version (lua_State *L) {
static const lua_Number version = LUA_VERSION_NUM;
return &version;
}
/* -- Stack manipulation -------------------------------------------------- */ /* -- Stack manipulation -------------------------------------------------- */
LUA_API int lua_gettop(lua_State *L) LUA_API int lua_gettop(lua_State *L)

View File

@ -348,6 +348,7 @@ LUA_API void *lua_upvalueid (lua_State *L, int idx, int n);
LUA_API void lua_upvaluejoin (lua_State *L, int idx1, int n1, int idx2, int n2); LUA_API void lua_upvaluejoin (lua_State *L, int idx1, int n1, int idx2, int n2);
LUA_API int lua_loadx (lua_State *L, lua_Reader reader, void *dt, LUA_API int lua_loadx (lua_State *L, lua_Reader reader, void *dt,
const char *chunkname, const char *mode); const char *chunkname, const char *mode);
LUA_API const lua_Number *lua_version (lua_State *L);
struct lua_Debug { struct lua_Debug {