eris: add 'getnextid' and 'setnextid'

This commit is contained in:
2021-02-28 14:35:10 -05:00
parent b23728f525
commit 23ae577fbb
3 changed files with 12 additions and 0 deletions

View File

@@ -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)

View File

@@ -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 */
};

View File

@@ -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