lua_copy

lua_copy[-0, +0, –] void lua_copy (lua_State *L, int fromidx, int toidx); Copies the element at index fromidx into the valid index toidx, replacing the value at that position. Values at other positions are not affected.

luaL_dostring

luaL_dostring[-0, +?, –] int luaL_dostring (lua_State *L, const char *str); Loads and runs the given string. It is defined as the following macro: (luaL_loadstring(L, str) || lua_pcall(L, 0, LUA_MULTRET, 0)) It returns false if there are no errors or true in case of errors.

lua_geti

lua_geti[-0, +1, e] int lua_geti (lua_State *L, int index, lua_Integer i); Pushes onto the stack the value t[i], where t is the value at the given index. As in Lua, this function may trigger a metamethod for the "index" event (see §2.4). Returns the type of the pushed value.

luaL_testudata

luaL_testudata[-0, +0, m] void *luaL_testudata (lua_State *L, int arg, const char *tname); This function works like luaL_checkudata, except that, when the test fails, it returns NULL instead of raising an error.

package.loaded

package.loaded A table used by require to control which modules are already loaded. When you require a module modname and package.loaded[modname] is not false, require simply returns the value stored there. This variable is only a reference to the real table; assignments to this variable do not change the table used by require.

luaL_checkoption

luaL_checkoption[-0, +0, v] int luaL_checkoption (lua_State *L, int arg, const char *def, const char *const lst[]); Checks whether the function argument arg is a string and searches for this string in the array lst (which must be NULL-terminated). Returns the index in the array where the string was found. Raises an error if the argument is not a string or if the string cannot be found. If def is not NULL, the function uses d

math.fmod()

math.fmod (x, y) Returns the remainder of the division of x by y that rounds the quotient towards zero. (integer/float)

luaL_getmetafield

luaL_getmetafield[-0, +(0|1), m] int luaL_getmetafield (lua_State *L, int obj, const char *e); Pushes onto the stack the field e from the metatable of the object at index obj and returns the type of 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.

lua_iscfunction

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

debug.getregistry()

debug.getregistry () Returns the registry table (see §4.5).