Copyright | © 2007–2012 Gracjan Polak 2012–2016 Ömer Sinan Ağacan 2017-2020 Albert Krewinkel |
---|---|
License | MIT |
Maintainer | Albert Krewinkel <tarleb+hslua@zeitkraut.de> |
Stability | beta |
Portability | ForeignFunctionInterface, CPP |
Safe Haskell | None |
Language | Haskell2010 |
Haskell bindings to Lua C API functions.
Synopsis
- lua_close :: State -> IO ()
- lua_absindex :: State -> StackIndex -> IO StackIndex
- lua_gettop :: State -> IO StackIndex
- lua_settop :: State -> StackIndex -> IO ()
- lua_pushvalue :: State -> StackIndex -> IO ()
- lua_pop :: State -> StackIndex -> IO ()
- lua_copy :: State -> StackIndex -> StackIndex -> IO ()
- lua_remove :: State -> StackIndex -> IO ()
- lua_insert :: State -> StackIndex -> IO ()
- lua_replace :: State -> StackIndex -> IO ()
- lua_checkstack :: State -> CInt -> IO LuaBool
- lua_isnumber :: State -> StackIndex -> IO LuaBool
- lua_isinteger :: State -> StackIndex -> IO LuaBool
- lua_isstring :: State -> StackIndex -> IO LuaBool
- lua_iscfunction :: State -> StackIndex -> IO LuaBool
- lua_isuserdata :: State -> StackIndex -> IO LuaBool
- lua_type :: State -> StackIndex -> IO TypeCode
- lua_typename :: State -> TypeCode -> IO CString
- hslua_compare :: State -> StackIndex -> StackIndex -> CInt -> Ptr StatusCode -> IO LuaBool
- lua_rawequal :: State -> StackIndex -> StackIndex -> IO LuaBool
- lua_toboolean :: State -> StackIndex -> IO LuaBool
- lua_tocfunction :: State -> StackIndex -> IO CFunction
- lua_tointegerx :: State -> StackIndex -> Ptr LuaBool -> IO Integer
- lua_tonumberx :: State -> StackIndex -> Ptr LuaBool -> IO Number
- lua_tolstring :: State -> StackIndex -> Ptr CSize -> IO (Ptr CChar)
- lua_topointer :: State -> StackIndex -> IO (Ptr ())
- lua_tothread :: State -> StackIndex -> IO State
- lua_touserdata :: State -> StackIndex -> IO (Ptr a)
- lua_rawlen :: State -> StackIndex -> IO CSize
- lua_pushnil :: State -> IO ()
- lua_pushnumber :: State -> Number -> IO ()
- lua_pushinteger :: State -> Integer -> IO ()
- lua_pushlstring :: State -> Ptr CChar -> CSize -> IO ()
- lua_pushcclosure :: State -> CFunction -> NumArgs -> IO ()
- lua_pushboolean :: State -> LuaBool -> IO ()
- lua_pushlightuserdata :: State -> Ptr a -> IO ()
- lua_pushthread :: State -> IO CInt
- hslua_gettable :: State -> StackIndex -> Ptr StatusCode -> IO ()
- lua_rawget :: State -> StackIndex -> IO ()
- lua_rawgeti :: State -> StackIndex -> Integer -> IO ()
- lua_createtable :: State -> CInt -> CInt -> IO ()
- lua_newuserdata :: State -> CSize -> IO (Ptr ())
- lua_getmetatable :: State -> StackIndex -> IO LuaBool
- hslua_getglobal :: State -> CString -> CSize -> Ptr StatusCode -> IO ()
- hslua_settable :: State -> StackIndex -> Ptr StatusCode -> IO ()
- lua_rawset :: State -> StackIndex -> IO ()
- lua_rawseti :: State -> StackIndex -> Integer -> IO ()
- lua_setmetatable :: State -> StackIndex -> IO ()
- hslua_setglobal :: State -> CString -> CSize -> Ptr StatusCode -> IO ()
- lua_pcall :: State -> NumArgs -> NumResults -> StackIndex -> IO StatusCode
- lua_load :: State -> Reader -> Ptr () -> CString -> CString -> IO StatusCode
- lua_status :: State -> IO StatusCode
- lua_gc :: State -> CInt -> CInt -> IO CInt
- hslua_error :: State -> IO NumResults
- hslua_next :: State -> StackIndex -> Ptr StatusCode -> IO LuaBool
- hslua_concat :: State -> NumArgs -> Ptr StatusCode -> IO ()
- lua_pushglobaltable :: State -> IO ()
- luaL_openlibs :: State -> IO ()
- lua_open_base_ptr :: CFunction
- lua_open_table_ptr :: CFunction
- lua_open_io_ptr :: CFunction
- lua_open_os_ptr :: CFunction
- lua_open_string_ptr :: CFunction
- lua_open_math_ptr :: CFunction
- lua_open_debug_ptr :: CFunction
- lua_open_package_ptr :: CFunction
State manipulation
Basic stack manipulation
lua_absindex :: State -> StackIndex -> IO StackIndex Source #
See lua_absindex
lua_gettop :: State -> IO StackIndex Source #
See lua_gettop
lua_settop :: State -> StackIndex -> IO () Source #
See lua_settop
lua_pushvalue :: State -> StackIndex -> IO () Source #
See lua_pushvalue
lua_copy :: State -> StackIndex -> StackIndex -> IO () Source #
See lua_copy
lua_remove :: State -> StackIndex -> IO () Source #
See lua_remove
lua_insert :: State -> StackIndex -> IO () Source #
See lua_insert
lua_replace :: State -> StackIndex -> IO () Source #
See lua_replace
lua_checkstack :: State -> CInt -> IO LuaBool Source #
See lua_checkstack
Stack access functions
lua_isnumber :: State -> StackIndex -> IO LuaBool Source #
See lua_isnumber
lua_isinteger :: State -> StackIndex -> IO LuaBool Source #
See lua_isinteger
lua_isstring :: State -> StackIndex -> IO LuaBool Source #
See lua_isstring
lua_iscfunction :: State -> StackIndex -> IO LuaBool Source #
See lua_iscfunction
lua_isuserdata :: State -> StackIndex -> IO LuaBool Source #
See lua_isuserdata
lua_typename :: State -> TypeCode -> IO CString Source #
See lua_typename
hslua_compare :: State -> StackIndex -> StackIndex -> CInt -> Ptr StatusCode -> IO LuaBool Source #
Wrapper around -- @lua_compare@ which catches any longjmp
s.
lua_rawequal :: State -> StackIndex -> StackIndex -> IO LuaBool Source #
See lua_rawequal
lua_toboolean :: State -> StackIndex -> IO LuaBool Source #
See lua_toboolean
lua_tocfunction :: State -> StackIndex -> IO CFunction Source #
See lua_tocfunction
lua_tointegerx :: State -> StackIndex -> Ptr LuaBool -> IO Integer Source #
See lua_tointegerx
lua_tonumberx :: State -> StackIndex -> Ptr LuaBool -> IO Number Source #
See lua_tonumberx
lua_tolstring :: State -> StackIndex -> Ptr CSize -> IO (Ptr CChar) Source #
See lua_tolstring
lua_topointer :: State -> StackIndex -> IO (Ptr ()) Source #
See lua_topointer
lua_tothread :: State -> StackIndex -> IO State Source #
See lua_tothread
lua_touserdata :: State -> StackIndex -> IO (Ptr a) Source #
See lua_touserdata
lua_rawlen :: State -> StackIndex -> IO CSize Source #
See lua_rawlen
Push functions
lua_pushnil :: State -> IO () Source #
See lua_pushnil
lua_pushnumber :: State -> Number -> IO () Source #
See lua_pushnumber
lua_pushinteger :: State -> Integer -> IO () Source #
See lua_pushinteger
lua_pushlstring :: State -> Ptr CChar -> CSize -> IO () Source #
See lua_pushlstring
lua_pushcclosure :: State -> CFunction -> NumArgs -> IO () Source #
See lua_pushcclosure
lua_pushboolean :: State -> LuaBool -> IO () Source #
See lua_pushboolean
lua_pushthread :: State -> IO CInt Source #
See lua_pushthread
Get functions
hslua_gettable :: State -> StackIndex -> Ptr StatusCode -> IO () Source #
Wrapper around -- @lua_gettable@ which catches any longjmp
s.
lua_rawget :: State -> StackIndex -> IO () Source #
See lua_rawget
lua_rawgeti :: State -> StackIndex -> Integer -> IO () Source #
See lua_rawgeti
lua_createtable :: State -> CInt -> CInt -> IO () Source #
See lua_createtable
lua_newuserdata :: State -> CSize -> IO (Ptr ()) Source #
See lua_newuserdata
lua_getmetatable :: State -> StackIndex -> IO LuaBool Source #
See lua_getmetatable
hslua_getglobal :: State -> CString -> CSize -> Ptr StatusCode -> IO () Source #
Wrapper around -- @lua_getglobal@ which catches any longjmp
s.
Set functions
hslua_settable :: State -> StackIndex -> Ptr StatusCode -> IO () Source #
Wrapper around -- @lua_settable@ which catches any longjmp
s.
lua_rawset :: State -> StackIndex -> IO () Source #
See lua_rawset
lua_rawseti :: State -> StackIndex -> Integer -> IO () Source #
See lua_rawseti
lua_setmetatable :: State -> StackIndex -> IO () Source #
See lua_setmetatable
hslua_setglobal :: State -> CString -> CSize -> Ptr StatusCode -> IO () Source #
Wrapper around -- @lua_setglobal@ which catches any longjmp
s.
'load' and 'call' functions (load and run Lua code)
lua_pcall :: State -> NumArgs -> NumResults -> StackIndex -> IO StatusCode Source #
See lua_pcall
Coroutine functions
lua_status :: State -> IO StatusCode Source #
See lua_status
Garbage-collection functions and options
Miscellaneous functions
hslua_error :: State -> IO NumResults Source #
Replacement for -- @lua_error@; it uses the HsLua error signaling convention instead of raw
hslua_next :: State -> StackIndex -> Ptr StatusCode -> IO LuaBool Source #
Wrapper around -- @lua_next@ which catches any longjmp
s.
hslua_concat :: State -> NumArgs -> Ptr StatusCode -> IO () Source #
Wrapper around -- @lua_concat@ which catches any longjmp
s.
lua_pushglobaltable :: State -> IO () Source #
Lua Libraries
luaL_openlibs :: State -> IO () Source #
See luaL_openlibs
lua_open_base_ptr :: CFunction Source #
Point to function opening the base library.
lua_open_table_ptr :: CFunction Source #
Point to function opening the table library.
lua_open_io_ptr :: CFunction Source #
Point to function opening the io library.
lua_open_os_ptr :: CFunction Source #
Point to function opening the os library.
lua_open_string_ptr :: CFunction Source #
Point to function opening the string library.
lua_open_math_ptr :: CFunction Source #
Point to function opening the math library.
lua_open_debug_ptr :: CFunction Source #
Point to function opening the debug library.
lua_open_package_ptr :: CFunction Source #
Point to function opening the package library.