hslua-0.6.0: A Lua language interpreter embedding in Haskell

Copyright© 2017 Albert Krewinkel
LicenseMIT
MaintainerAlbert Krewinkel <tarleb+hslua@zeitkraut.de>
Stabilitybeta
PortabilityForeignFunctionInterface
Safe HaskellNone
LanguageHaskell98

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.

Synopsis

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.