lua_settable

lua_settable[-2, +0, e] void lua_settable (lua_State *L, int index); Does the equivalent to t[k] = v, where t is the value at the given index, v is the value at the top of the stack, and k is the value just below the top. This function pops both the key and the value from the stack. As in Lua, this function may trigger a metamethod for the "newindex" event (see §2.4).

lua_pop

lua_pop[-n, +0, –] void lua_pop (lua_State *L, int n); Pops n elements from the stack.

coroutine.create()

coroutine.create (f) Creates a new coroutine, with body f. f must be a function. Returns this new coroutine, an object with type "thread".

lua_typename

lua_typename[-0, +0, –] const char *lua_typename (lua_State *L, int tp); Returns the name of the type encoded by the value tp, which must be one the values returned by lua_type.

lua_numbertointeger

lua_numbertointeger int lua_numbertointeger (lua_Number n, lua_Integer *p); Converts a Lua float to a Lua integer. This macro assumes that n has an integral value. If that value is within the range of Lua integers, it is converted to an integer and assigned to *p. The macro results in a boolean indicating whether the conversion was successful. (Note that this range test can be tricky to do correctly without this macro, due to roundings.) This macro may evaluate its arguments more than once.

io.type()

io.type (obj) Checks whether obj is a valid file handle. Returns the string "file" if obj is an open file handle, "closed file" if obj is a closed file handle, or nil if obj is not a file handle.

lua_State

lua_State typedef struct lua_State lua_State; An opaque structure that points to a thread and indirectly (through the thread) to the whole state of a Lua interpreter. The Lua library is fully reentrant: it has no global variables. All information about a state is accessible through this structure. A pointer to this structure must be passed as the first argument to every function in the library, except to lua_newstate, which creates a Lua state from scratch.

table.move()

table.move (a1, f, e, t [,a2]) Moves elements from table a1 to table a2, performing the equivalent to the following multiple assignment: a2[t],··· = a1[f],···,a1[e]. The default for a2 is a1. The destination range can overlap with the source range. The number of elements to be moved must fit in a Lua integer. Returns the destination table a2.

lua_isboolean

lua_isboolean[-0, +0, –] int lua_isboolean (lua_State *L, int index); Returns 1 if the value at the given index is a boolean, and 0 otherwise.

lua_tointeger

lua_tointeger[-0, +0, –] lua_Integer lua_tointeger (lua_State *L, int index); Equivalent to lua_tointegerx with isnum equal to NULL.