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_error
  • References/Lua/Lua/API/Functions and Types

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

2025-01-10 15:47:30
lua_rawset
  • References/Lua/Lua/API/Functions and Types

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

2025-01-10 15:47:30
lua_Alloc
  • References/Lua/Lua/API/Functions and Types

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

2025-01-10 15:47:30
lua_topointer
  • References/Lua/Lua/API/Functions and Types

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

2025-01-10 15:47:30
lua_copy
  • References/Lua/Lua/API/Functions and Types

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

2025-01-10 15:47:30
lua_pushglobaltable
  • References/Lua/Lua/API/Functions and Types

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

2025-01-10 15:47:30
lua_tonumberx
  • References/Lua/Lua/API/Functions and Types

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

2025-01-10 15:47:30
lua_pcall
  • References/Lua/Lua/API/Functions and Types

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

2025-01-10 15:47:30
lua_callk
  • References/Lua/Lua/API/Functions and Types

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

2025-01-10 15:47:30
lua_status
  • References/Lua/Lua/API/Functions and Types

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

2025-01-10 15:47:30