| Copyright | © 2017 Albert Krewinkel |
|---|---|
| License | MIT |
| Maintainer | Albert Krewinkel <tarleb+hslua@zeitkraut.de> |
| Stability | beta |
| Portability | ForeignFunctionInterface |
| Safe Haskell | None |
| Language | Haskell98 |
Foreign.Lua.Api.SafeBindings
Description
Haskell bindings to safe, longjmp catching wrappers of Lua C API functions.
Functions in this module follow a custom protocol. If an error happens (i.e., if
the lua status is not 0), the status code is returned as a negative number.
Results of a successful execution of the wrapped function are returned as
non-negative numbers. This is possible because all (supported) lua API functions
are either safe and don't need wrapping, or return void, size_t or a
non-negative int.
- hslua_compare :: LuaState -> CInt -> CInt -> CInt -> IO CInt
- hslua_concat :: LuaState -> CInt -> IO CInt
- hslua_getfield :: LuaState -> CInt -> Ptr CChar -> IO CInt
- hslua_getglobal :: LuaState -> Ptr CChar -> IO CInt
- hslua_gettable :: LuaState -> CInt -> IO CInt
- hslua_next :: LuaState -> CInt -> IO CInt
- hslua_setfield :: LuaState -> CInt -> Ptr CChar -> IO CInt
- hslua_setglobal :: LuaState -> Ptr CChar -> IO CInt
- hslua_settable :: LuaState -> CInt -> IO CInt
Documentation
hslua_compare :: LuaState -> CInt -> CInt -> CInt -> IO CInt Source #
Wrapper around -- @lua_compare@ which catches any longjmps.
hslua_concat :: LuaState -> CInt -> IO CInt Source #
Wrapper around -- @lua_concat@ which catches any longjmps.
hslua_getfield :: LuaState -> CInt -> Ptr CChar -> IO CInt Source #
Wrapper around -- @lua_getfield@ which catches any longjmps.
hslua_getglobal :: LuaState -> Ptr CChar -> IO CInt Source #
Wrapper around -- @lua_getglobal@ which catches any longjmps.
hslua_gettable :: LuaState -> CInt -> IO CInt Source #
Wrapper around -- @lua_gettable@ which catches any longjmps.
hslua_next :: LuaState -> CInt -> IO CInt Source #
Wrapper around -- @lua_next@ which catches any longjmps.
hslua_setfield :: LuaState -> CInt -> Ptr CChar -> IO CInt Source #
Wrapper around -- @lua_setfield@ which catches any longjmps.
hslua_setglobal :: LuaState -> Ptr CChar -> IO CInt Source #
Wrapper around -- @lua_setglobal@ which catches any longjmps.
hslua_settable :: LuaState -> CInt -> IO CInt Source #
Wrapper around -- @lua_settable@ which catches any longjmps.