hslua-1.3.0.1: Bindings to Lua, an embeddable scripting language
Copyright© 2017-2020 Albert Krewinkel
LicenseMIT
MaintainerAlbert Krewinkel <tarleb+hslua@zeitkraut.de>
Stabilitybeta
PortabilityForeignFunctionInterface
Safe HaskellNone
LanguageHaskell2010

Foreign.Lua.Raw.Userdata

Description

Bindings to HsLua-specific functions used to push Haskell values as userdata.

Synopsis

Documentation

hslua_fromuserdata Source #

Arguments

:: State 
-> StackIndex

userdata index

-> CString

name

-> IO (Maybe a) 

Retrieves a Haskell object from userdata at the given index. The userdata must have the given name.

hslua_newhsuserdata :: State -> a -> IO () Source #

Creates a new userdata wrapping the given Haskell object.

hslua_newudmetatable Source #

Arguments

:: State

Lua state

-> CString

Userdata name (__name)

-> IO LuaBool

True iff new metatable was created.

Creates and registers a new metatable for a userdata-wrapped Haskell value; checks whether a metatable of that name has been registered yet and uses the registered table if possible.