diff --git a/luprex/eris-master/src/lapi.c b/luprex/eris-master/src/lapi.c index d011431e..cf79e72a 100644 --- a/luprex/eris-master/src/lapi.c +++ b/luprex/eris-master/src/lapi.c @@ -456,6 +456,15 @@ LUA_API const void *lua_topointer (lua_State *L, int idx) { } +LUA_API lua_Integer lua_getnextid (lua_State *L) { + return L->nextid; +} + + +LUA_API void lua_setnextid (lua_State *L, lua_Integer id) { + L->nextid = id; +} + /* ** push functions (C -> stack) diff --git a/luprex/eris-master/src/lstate.h b/luprex/eris-master/src/lstate.h index daffd9aa..7a26c7c9 100644 --- a/luprex/eris-master/src/lstate.h +++ b/luprex/eris-master/src/lstate.h @@ -173,6 +173,7 @@ struct lua_State { struct lua_longjmp *errorJmp; /* current error recover point */ ptrdiff_t errfunc; /* current error handling function (stack index) */ CallInfo base_ci; /* CallInfo for first level (C calling Lua) */ + lua_Integer nextid; /* ID allocator for luprex */ }; diff --git a/luprex/eris-master/src/lua.h b/luprex/eris-master/src/lua.h index 00c0290d..2534f6d6 100644 --- a/luprex/eris-master/src/lua.h +++ b/luprex/eris-master/src/lua.h @@ -176,6 +176,8 @@ LUA_API void *(lua_touserdata) (lua_State *L, int idx); LUA_API lua_State *(lua_tothread) (lua_State *L, int idx); LUA_API const void *(lua_topointer) (lua_State *L, int idx); +LUA_API lua_Integer (lua_getnextid) (lua_State *L); +LUA_API void (lua_setnextid) (lua_State *L, lua_Integer id); /* ** Comparison and arithmetic functions