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_rawsetp

lua_rawsetp[-1, +0, m] void lua_rawsetp (lua_State *L, int index, const void *p); Does the equivalent

2017-02-21 04:14:12
lua_getmetatable

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

2017-02-21 04:13:12
lua_atpanic

lua_atpanic[-0, +0, –] lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf); Sets a new panic

2017-02-21 04:12:49
lua_getglobal

lua_getglobal[-0, +1, e] int lua_getglobal (lua_State *L, const char *name); Pushes onto the stack

2017-02-21 04:13:05
lua_setfield

lua_setfield[-1, +0, e] void lua_setfield (lua_State *L, int index, const char *k); Does the equivalent

2017-02-21 04:14:21
lua_tostring

lua_tostring[-0, +0, m] const char *lua_tostring (lua_State *L, int index); Equivalent to

2017-02-21 04:14:44
lua_gettop

lua_gettop[-0, +0, –] int lua_gettop (lua_State *L); Returns the index of the top element in the stack

2017-02-21 04:13:15
lua_insert

lua_insert[-1, +1, –] void lua_insert (lua_State *L, int index); Moves the top element into the given valid

2017-02-21 04:13:19
lua_pushstring

lua_pushstring[-0, +1, m] const char *lua_pushstring (lua_State *L, const char *s); Pushes the

2017-02-21 04:14:02
lua_seti

lua_seti[-1, +0, e] void lua_seti (lua_State *L, int index, lua_Integer n); Does the equivalent

2017-02-21 04:14:25