hslua-0.4.1: A Lua language interpreter embedding in Haskell

Safe Haskell | Safe
Language | Haskell98

Scripting.Lua.Raw

Contents

- Types
- State manipulation
- Basic stack manipulation
- Stack access functions
- Push functions
- Get functions
- Get functions
- `load` and `call` functions (load and run Lua code)
- Coroutine functions
- Garbage-collection functions and options
- Miscellaneous functions
- The Auxiliary Library

Synopsis

- newtype LuaState = LuaState (Ptr ())
- type LuaAlloc = Ptr () -> Ptr () -> CSize -> CSize -> IO (Ptr ())
- type LuaReader = Ptr () -> Ptr () -> Ptr CSize -> IO (Ptr CChar)
- type LuaWriter = LuaState -> Ptr CChar -> CSize -> Ptr () -> IO CInt
- type LuaCFunction = LuaState -> IO CInt
- type LuaInteger = Int32
- type LuaNumber = Double
- c_lua_newstate :: FunPtr LuaAlloc -> Ptr () -> IO LuaState
- c_lua_close :: LuaState -> IO ()
- c_lua_newthread :: LuaState -> IO LuaState
- c_lua_atpanic :: LuaState -> FunPtr LuaCFunction -> IO (FunPtr LuaCFunction)
- c_lua_gettop :: LuaState -> IO CInt
- c_lua_settop :: LuaState -> CInt -> IO ()
- c_lua_pushvalue :: LuaState -> CInt -> IO ()
- c_lua_remove :: LuaState -> CInt -> IO ()
- c_lua_insert :: LuaState -> CInt -> IO ()
- c_lua_replace :: LuaState -> CInt -> IO ()
- c_lua_checkstack :: LuaState -> CInt -> IO CInt
- c_lua_xmove :: LuaState -> LuaState -> CInt -> IO ()
- c_lua_isnumber :: LuaState -> CInt -> IO CInt
- c_lua_isstring :: LuaState -> CInt -> IO CInt
- c_lua_iscfunction :: LuaState -> CInt -> IO CInt
- c_lua_isuserdata :: LuaState -> CInt -> IO CInt
- c_lua_type :: LuaState -> CInt -> IO CInt
- c_lua_typename :: LuaState -> CInt -> IO (Ptr CChar)
- c_lua_equal :: LuaState -> CInt -> CInt -> IO CInt
- c_lua_rawequal :: LuaState -> CInt -> CInt -> IO CInt
- c_lua_lessthan :: LuaState -> CInt -> CInt -> IO CInt
- c_lua_tonumber :: LuaState -> CInt -> IO LuaNumber
- c_lua_tointeger :: LuaState -> CInt -> IO LuaInteger
- c_lua_toboolean :: LuaState -> CInt -> IO CInt
- c_lua_tolstring :: LuaState -> CInt -> Ptr CSize -> IO (Ptr CChar)
- c_lua_objlen :: LuaState -> CInt -> IO CSize
- c_lua_tocfunction :: LuaState -> CInt -> IO (FunPtr LuaCFunction)
- c_lua_touserdata :: LuaState -> CInt -> IO (Ptr a)
- c_lua_tothread :: LuaState -> CInt -> IO LuaState
- c_lua_topointer :: LuaState -> CInt -> IO (Ptr ())
- c_lua_pushnil :: LuaState -> IO ()
- c_lua_pushnumber :: LuaState -> LuaNumber -> IO ()
- c_lua_pushinteger :: LuaState -> LuaInteger -> IO ()
- c_lua_pushlstring :: LuaState -> Ptr CChar -> CSize -> IO ()
- c_lua_pushstring :: LuaState -> Ptr CChar -> IO ()
- c_lua_pushcclosure :: LuaState -> FunPtr LuaCFunction -> CInt -> IO ()
- c_lua_pushboolean :: LuaState -> CInt -> IO ()
- c_lua_pushlightuserdata :: LuaState -> Ptr a -> IO ()
- c_lua_pushthread :: LuaState -> IO CInt
- c_lua_gettable :: LuaState -> CInt -> IO ()
- c_lua_getfield :: LuaState -> CInt -> Ptr CChar -> IO ()
- c_lua_rawget :: LuaState -> CInt -> IO ()
- c_lua_rawgeti :: LuaState -> CInt -> CInt -> IO ()
- c_lua_createtable :: LuaState -> CInt -> CInt -> IO ()
- c_lua_newuserdata :: LuaState -> CInt -> IO (Ptr ())
- c_lua_getmetatable :: LuaState -> CInt -> IO CInt
- c_lua_getfenv :: LuaState -> CInt -> IO ()
- c_lua_settable :: LuaState -> CInt -> IO ()
- c_lua_setfield :: LuaState -> CInt -> Ptr CChar -> IO ()
- c_lua_rawset :: LuaState -> CInt -> IO ()
- c_lua_rawseti :: LuaState -> CInt -> CInt -> IO ()
- c_lua_setmetatable :: LuaState -> CInt -> IO ()
- c_lua_setfenv :: LuaState -> CInt -> IO CInt
- c_lua_call :: LuaState -> CInt -> CInt -> IO ()
- c_lua_pcall :: LuaState -> CInt -> CInt -> CInt -> IO CInt
- c_lua_cpcall :: LuaState -> FunPtr LuaCFunction -> Ptr a -> IO CInt
- c_lua_load :: LuaState -> FunPtr LuaReader -> Ptr () -> Ptr CChar -> IO CInt
- c_lua_dump :: LuaState -> FunPtr LuaWriter -> Ptr () -> IO ()
- c_lua_yield :: LuaState -> CInt -> IO CInt
- c_lua_resume :: LuaState -> CInt -> IO CInt
- c_lua_status :: LuaState -> IO CInt
- c_lua_gc :: LuaState -> CInt -> CInt -> IO CInt
- c_lua_error :: LuaState -> IO CInt
- c_lua_next :: LuaState -> CInt -> IO CInt
- c_lua_concat :: LuaState -> CInt -> IO ()
- c_luaL_openlibs :: LuaState -> IO ()
- c_luaL_newstate :: IO LuaState
- c_luaL_newmetatable :: LuaState -> Ptr CChar -> IO CInt
- c_luaL_argerror :: LuaState -> CInt -> Ptr CChar -> IO CInt
- c_luaL_ref :: LuaState -> CInt -> IO CInt
- c_luaL_unref :: LuaState -> CInt -> CInt -> IO ()

# Types

newtype LuaState #

Synonym for `lua_State *`. See `lua_State` in Lua Reference Manual.

Constructors

LuaState (Ptr ()) |

Instances

StackValue LuaState # |
Methods push :: LuaState -> LuaState -> IO () # peek :: LuaState -> Int -> IO (Maybe LuaState) # valuetype :: LuaState -> LTYPE #
StackValue (FunPtr LuaCFunction) # |
Methods push :: LuaState -> FunPtr LuaCFunction -> IO () # peek :: LuaState -> Int -> IO (Maybe (FunPtr LuaCFunction)) # valuetype :: FunPtr LuaCFunction -> LTYPE #

type LuaAlloc = Ptr () -> Ptr () -> CSize -> CSize -> IO (Ptr ()) #

Synonym for `lua_Alloc`. See `lua_Alloc` in Lua Reference Manual.

type LuaReader = Ptr () -> Ptr () -> Ptr CSize -> IO (Ptr CChar) #

Synonym for `lua_Reader`. See `lua_Reader` in Lua Reference Manual.

type LuaWriter = LuaState -> Ptr CChar -> CSize -> Ptr () -> IO CInt #

Synonym for `lua_Writer`. See `lua_Writer` in Lua Reference Manual.

type LuaCFunction = LuaState -> IO CInt #

Synonym for `lua_CFunction`. See `lua_CFunction` in Lua Reference Manual.

type LuaInteger = Int32 #

Synonym for `lua_Integer`. See `lua_Integer` in Lua Reference Manual.

type LuaNumber = Double #

Synonym for `lua_Number`. See `lua_Number` in Lua Reference Manual.

# State manipulation

c_lua_newstate :: FunPtr LuaAlloc -> Ptr () -> IO LuaState #

c_lua_close :: LuaState -> IO () #

c_lua_newthread :: LuaState -> IO LuaState #

c_lua_atpanic :: LuaState -> FunPtr LuaCFunction -> IO (FunPtr LuaCFunction) #

# Basic stack manipulation

c_lua_gettop :: LuaState -> IO CInt #

c_lua_settop :: LuaState -> CInt -> IO () #

c_lua_pushvalue :: LuaState -> CInt -> IO () #

c_lua_remove :: LuaState -> CInt -> IO () #

c_lua_insert :: LuaState -> CInt -> IO () #

c_lua_replace :: LuaState -> CInt -> IO () #

c_lua_checkstack :: LuaState -> CInt -> IO CInt #

c_lua_xmove :: LuaState -> LuaState -> CInt -> IO () #

# Stack access functions

c_lua_isnumber :: LuaState -> CInt -> IO CInt #

c_lua_isstring :: LuaState -> CInt -> IO CInt #

c_lua_iscfunction :: LuaState -> CInt -> IO CInt #

c_lua_isuserdata :: LuaState -> CInt -> IO CInt #

c_lua_type :: LuaState -> CInt -> IO CInt #

c_lua_typename :: LuaState -> CInt -> IO (Ptr CChar) #

c_lua_equal :: LuaState -> CInt -> CInt -> IO CInt #

c_lua_rawequal :: LuaState -> CInt -> CInt -> IO CInt #

c_lua_lessthan :: LuaState -> CInt -> CInt -> IO CInt #

c_lua_tonumber :: LuaState -> CInt -> IO LuaNumber #

c_lua_tointeger :: LuaState -> CInt -> IO LuaInteger #

c_lua_toboolean :: LuaState -> CInt -> IO CInt #

c_lua_tolstring :: LuaState -> CInt -> Ptr CSize -> IO (Ptr CChar) #

c_lua_objlen :: LuaState -> CInt -> IO CSize #

c_lua_tocfunction :: LuaState -> CInt -> IO (FunPtr LuaCFunction) #

c_lua_touserdata :: LuaState -> CInt -> IO (Ptr a) #

c_lua_tothread :: LuaState -> CInt -> IO LuaState #

c_lua_topointer :: LuaState -> CInt -> IO (Ptr ()) #

# Push functions

c_lua_pushnil :: LuaState -> IO () #

c_lua_pushnumber :: LuaState -> LuaNumber -> IO () #

c_lua_pushinteger :: LuaState -> LuaInteger -> IO () #

c_lua_pushlstring :: LuaState -> Ptr CChar -> CSize -> IO () #

c_lua_pushstring :: LuaState -> Ptr CChar -> IO () #

c_lua_pushcclosure :: LuaState -> FunPtr LuaCFunction -> CInt -> IO () #

c_lua_pushboolean :: LuaState -> CInt -> IO () #

c_lua_pushlightuserdata :: LuaState -> Ptr a -> IO () #

c_lua_pushthread :: LuaState -> IO CInt #

# Get functions

c_lua_gettable :: LuaState -> CInt -> IO () #

c_lua_getfield :: LuaState -> CInt -> Ptr CChar -> IO () #

c_lua_rawget :: LuaState -> CInt -> IO () #

c_lua_rawgeti :: LuaState -> CInt -> CInt -> IO () #

c_lua_createtable :: LuaState -> CInt -> CInt -> IO () #

c_lua_newuserdata :: LuaState -> CInt -> IO (Ptr ()) #

c_lua_getmetatable :: LuaState -> CInt -> IO CInt #

c_lua_getfenv :: LuaState -> CInt -> IO () #

# Get functions

c_lua_settable :: LuaState -> CInt -> IO () #

c_lua_setfield :: LuaState -> CInt -> Ptr CChar -> IO () #

c_lua_rawset :: LuaState -> CInt -> IO () #

c_lua_rawseti :: LuaState -> CInt -> CInt -> IO () #

c_lua_setmetatable :: LuaState -> CInt -> IO () #

c_lua_setfenv :: LuaState -> CInt -> IO CInt #

# `load` and `call` functions (load and run Lua code)

c_lua_call :: LuaState -> CInt -> CInt -> IO () #

c_lua_pcall :: LuaState -> CInt -> CInt -> CInt -> IO CInt #

c_lua_cpcall :: LuaState -> FunPtr LuaCFunction -> Ptr a -> IO CInt #

c_lua_load :: LuaState -> FunPtr LuaReader -> Ptr () -> Ptr CChar -> IO CInt #

c_lua_dump :: LuaState -> FunPtr LuaWriter -> Ptr () -> IO () #

# Coroutine functions

c_lua_yield :: LuaState -> CInt -> IO CInt #

c_lua_resume :: LuaState -> CInt -> IO CInt #

c_lua_status :: LuaState -> IO CInt #

# Garbage-collection functions and options

c_lua_gc :: LuaState -> CInt -> CInt -> IO CInt #

# Miscellaneous functions

c_lua_error :: LuaState -> IO CInt #

c_lua_next :: LuaState -> CInt -> IO CInt #

c_lua_concat :: LuaState -> CInt -> IO () #

c_luaL_openlibs :: LuaState -> IO () #

# The Auxiliary Library

c_luaL_newstate :: IO LuaState #

c_luaL_newmetatable :: LuaState -> Ptr CChar -> IO CInt #

c_luaL_argerror :: LuaState -> CInt -> Ptr CChar -> IO CInt #

c_luaL_ref :: LuaState -> CInt -> IO CInt #

c_luaL_unref :: LuaState -> CInt -> CInt -> IO () #