Pushes onto the stack the field e from the metatable of the
object at index obj and returns the type of the pushed value. If
the object does not have a metatable, or if the metatable does not
have this field, pushes nothing and returns
LUA_TNIL.
Modulelua-2.3.2Haskell2010
Lua.Auxiliary
Raw bindings to functions and constants of the auxiliary library.
- 1 type
- 16 values
- Packagelua-2.3.2
- Exports17
- LanguageHaskell2010
- LicenceMIT
- SourceAuxiliary.hs
The Auxiliary Library
12 declarationsPushes onto the stack the metatable associated with name tname in
the registry (see luaL_newmetatable) (nil if there is no
metatable associated with that name). Returns the type of the pushed
value.
Loads a buffer as a Lua chunk. This function uses lua_load to
load the chunk in the buffer pointed to by buff with size sz.
This function returns the same results as lua_load. name is the
chunk name, used for debug information and error messages.
Equivalent to luaL_loadfilex with mode equal to NULL.
Loads a file as a Lua chunk. This function uses lua_load to load
the chunk in the file named filename. If filename is NULL, then it
loads from the standard input. The first line in the file is ignored
if it starts with a #.
The string mode works as in function lua_load.
This function returns the same results as lua_load, but it has an
extra error code LUA_ERRFILE for file-related errors (e.g., it cannot
open or read the file).
As lua_load, this function only loads the chunk; it does not run
it.
Opens all standard Lua libraries into the given state.
If the registry already has the key tname, returns 0.
Otherwise, creates a new table to be used as a metatable for
userdata, adds to this new table the pair __name = tname, adds to
the registry the pair [tname] = new table, and returns 1. (The
entry __name is used by some error-reporting functions.)
In both cases pushes onto the stack the final value associated with
tname in the registry.
Creates and returns a reference, in the table at index t, for the
object at the top of the stack (and pops the object).
A reference is a unique integer key. As long as you do not manually
add integer keys into table t, luaL_ref ensures the uniqueness of
the key it returns. You can retrieve an object referred by reference
r by calling lua_rawgeti l t r. Function luaL_unref frees a
reference and its associated object.
If the object at the top of the stack is nil, luaL_ref returns the
constant LUA_REFNIL. The constant
LUA_NOREF is guaranteed to be different
from any reference returned by luaL_ref.
Checks whether the function argument arg is a userdata of the
type tname (see luaL_newmetatable) and returns the userdata
address (see ). Returns Lua.lua_touserdataNULL if the
test fails.
Creates and pushes a traceback of the stack l1. If msg is not
NULL it is appended at the beginning of the traceback. The level
parameter tells at which level to start the traceback.
Releases reference ref from the table at index t (see
luaL_ref). The entry is removed from the table, so that the
referred object can be collected. The reference ref is also freed
to be used again.
Pushes onto the stack a string identifying the current position of
the control at level lvl in the call stack. Typically this string
has the following format:
chunkname:currentline:Level 0 is the running function, level 1 is the function that called the running function, etc.
This function is used to build a prefix for error messages.
Registry fields
Key, in the registry, for table of loaded modules.
Key, in the registry, for table of preloaded loaders.
References
Reference to a stored value.
Convert a reference to its C representation.
Create a reference from its C representation.