feat(library/kernel_bindings): add to_io_state_ext helper function
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
f8e71f711f
commit
fc7d5461b1
2 changed files with 8 additions and 0 deletions
|
@ -1280,6 +1280,13 @@ static void open_environment(lua_State * L) {
|
|||
// IO state
|
||||
DECL_UDATA(io_state)
|
||||
|
||||
io_state to_io_state_ext(lua_State * L, int idx) {
|
||||
if (idx <= lua_gettop(L))
|
||||
return to_io_state(L, idx);
|
||||
else
|
||||
return get_io_state(L);
|
||||
}
|
||||
|
||||
int mk_io_state(lua_State * L) {
|
||||
int nargs = lua_gettop(L);
|
||||
if (nargs == 0)
|
||||
|
|
|
@ -76,5 +76,6 @@ public:
|
|||
*/
|
||||
io_state * get_io_state_ptr(lua_State * L);
|
||||
io_state get_io_state(lua_State * L);
|
||||
io_state to_io_state_ext(lua_State * L, int idx);
|
||||
void open_io_state(lua_State * L);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue