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_pushcfunction

lua_pushcfunction[-0, +1, –] void lua_pushcfunction (lua_State *L, lua_CFunction f); Pushes a C function

2017-02-21 04:13:54
lua_type

lua_type[-0, +0, –] int lua_type (lua_State *L, int index); Returns the type of the value in the given

2017-02-21 04:14:47
lua_next

lua_next[-1, +(2|0), e] int lua_next (lua_State *L, int index); Pops a key from the stack, and

2017-02-21 04:13:45
lua_compare

lua_compare[-0, +0, e] int lua_compare (lua_State *L, int index1, int index2, int op); Compares

2017-02-21 04:12:55
lua_isnumber

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

2017-02-21 04:13:29
lua_tonumber

lua_tonumber[-0, +0, –] lua_Number lua_tonumber (lua_State *L, int index); Equivalent to

2017-02-21 04:14:41
lua_absindex

lua_absindex[-0, +0, –] int lua_absindex (lua_State *L, int idx); Converts the acceptable index idx

2017-02-21 04:12:45
lua_pushfstring

lua_pushfstring[-0, +1, e] const char *lua_pushfstring (lua_State *L, const char *fmt, ...); Pushes

2017-02-21 04:13:55
lua_tolstring

lua_tolstring[-0, +0, m] const char *lua_tolstring (lua_State *L, int index, size_t *len); Converts

2017-02-21 04:14:40
lua_getextraspace

lua_getextraspace[-0, +0, –] void *lua_getextraspace (lua_State *L); Returns a pointer to a raw memory

2017-02-21 04:13:04