4.8 – Functions and Types[-o, +p, x]

Here we list all functions and types from the C API in alphabetical order. Each function has an indicator like this:

The first field, o, is how many elements the function pops from the stack. The second field, p, is how many elements the function pushes onto the stack. (Any function always pushes its results after popping its arguments.) A field in the form x|y means the function can push (or pop) x or y elements, depending on the situation; an interrogation mark '?' means that we cannot know how many elements the function pops/pushes by looking only at its arguments (e.g., they may depend on what is on the stack). The third field, x, tells whether the function may raise errors: '-' means the function never raises any error; 'm' means the function may raise out-of-memory errors and errors running a __gc metamethod; 'e' means the function may raise any errors (it can run arbitrary Lua code, either directly or through metamethods); 'v' means the function may raise an error on purpose.

lua_getfield

lua_getfield[-0, +1, e] int lua_getfield (lua_State *L, int index, const char *k); Pushes onto

2017-02-21 04:13:05
lua_callk

lua_callk[-(nargs + 1), +nresults, e] void lua_callk (lua_State *L, int nargs,

2017-02-21 04:12:51
lua_Alloc

lua_Alloc typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize,

2017-02-21 04:12:46
lua_setglobal

lua_setglobal[-1, +0, e] void lua_setglobal (lua_State *L, const char *name); Pops a value from

2017-02-21 04:14:22
lua_isuserdata

lua_isuserdata[-0, +0, –] int lua_isuserdata (lua_State *L, int index); Returns 1 if the value at the given

2017-02-21 04:13:33
lua_pushvfstring

lua_pushvfstring[-0, +1, m] const char *lua_pushvfstring (lua_State *L, const

2017-02-21 04:14:04
lua_status

lua_status[-0, +0, –] int lua_status (lua_State *L); Returns the status of the thread L.

2017-02-21 04:14:33
lua_tonumberx

lua_tonumberx[-0, +0, –] lua_Number lua_tonumberx (lua_State *L, int index, int *isnum); Converts the Lua

2017-02-21 04:14:42
lua_rawset

lua_rawset[-2, +0, m] void lua_rawset (lua_State *L, int index); Similar to

2017-02-21 04:14:10
lua_copy

lua_copy[-0, +0, –] void lua_copy (lua_State *L, int fromidx, int toidx); Copies the element at index

2017-02-21 04:12:57