lua_toboolean

Function lua_toboolean 

Source
pub fn lua_toboolean(l: LuaState, idx: c_int) -> c_int
Expand description

Converts the Lua value at the given acceptable index to a C boolean value (0 or 1). Like all tests in Lua, lua_toboolean returns 1 for any Lua value different from false and nil; otherwise returning 0. This also returns 0 when called with a non-valid index. (If you want to accept only actual boolean values, use lua_isboolean to test the value’s type.)