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_topointer

lua_topointer[-0, +0, –] const void *lua_topointer (lua_State *L, int index); Converts the value at the

2017-02-21 04:14:43
lua_isthread

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

2017-02-21 04:13:32
lua_rotate

lua_rotate[-0, +0, –] void lua_rotate (lua_State *L, int idx, int n); Rotates the stack elements between

2017-02-21 04:14:19
lua_tothread

lua_tothread[-0, +0, –] lua_State *lua_tothread (lua_State *L, int index); Converts the value at the given

2017-02-21 04:14:45
lua_pcall

lua_pcall[-(nargs + 1), +(nresults|1), –] int lua_pcall (lua_State *L, int nargs, int nresults, int msgh);

2017-02-21 04:13:49
lua_gc

lua_gc[-0, +0, m] int lua_gc (lua_State *L, int what, int data); Controls the garbage collector

2017-02-21 04:13:02
lua_pushglobaltable

lua_pushglobaltable[-0, +1, –] void lua_pushglobaltable (lua_State *L); Pushes the global environment onto

2017-02-21 04:13:56
lua_error

lua_error[-1, +0, v] int lua_error (lua_State *L); Generates a Lua error, using the value at the

2017-02-21 04:13:01
lua_Unsigned

lua_Unsigned typedef ... lua_Unsigned; The unsigned version of

2017-02-21 04:14:49
lua_CFunction

lua_CFunction typedef int (*lua_CFunction) (lua_State *L); Type for C functions. In order to communicate properly with Lua

2017-02-21 04:12:52