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_touserdata

lua_touserdata[-0, +0, –] void *lua_touserdata (lua_State *L, int index); If the value at the given index

2017-02-21 04:14:46
lua_pop

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

2017-02-21 04:13:50
lua_rawgeti

lua_rawgeti[-0, +1, –] int lua_rawgeti (lua_State *L, int index, lua_Integer n); Pushes onto the stack

2017-02-21 04:14:07
lua_remove

lua_remove[-1, +0, –] void lua_remove (lua_State *L, int index); Removes the element at the given valid

2017-02-21 04:14:15
lua_Reader

lua_Reader typedef const char * (*lua_Reader) (lua_State *L, void *data,

2017-02-21 04:14:13
lua_newthread

lua_newthread[-0, +1, m] lua_State *lua_newthread (lua_State *L); Creates a new thread, pushes

2017-02-21 04:13:42
lua_settop

lua_settop[-?, +?, –] void lua_settop (lua_State *L, int index); Accepts any index, or 0, and sets the

2017-02-21 04:14:29
lua_register

lua_register[-0, +0, e] void lua_register (lua_State *L, const char *name, lua_CFunction f); Sets

2017-02-21 04:14:14
lua_isfunction

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

2017-02-21 04:13:24
lua_tointegerx

lua_tointegerx[-0, +0, –] lua_Integer lua_tointegerx (lua_State *L, int index, int *isnum); Converts the

2017-02-21 04:14:39