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

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

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

lua_Unsigned typedef ... lua_Unsigned; The unsigned version of

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

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

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

lua_newtable[-0, +1, m] void lua_newtable (lua_State *L); Creates a new empty table and pushes

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

lua_setglobal[-1, +0, e] void lua_setglobal (lua_State *L, const char *name); Pops a value from

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

lua_close[-0, +0, –] void lua_close (lua_State *L); Destroys all objects in the given Lua state (calling

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

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

2025-01-10 15:47:30