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

lua_gc[-0, +0, m] int lua_gc (lua_State *L, int what, int data); Controls the garbage collector

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

lua_getallocf[-0, +0, –] lua_Alloc lua_getallocf (lua_State *L, void **ud); Returns the memory-allocation

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

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

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

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

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

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

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

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

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

lua_yieldk[-?, +?, e] int lua_yieldk (lua_State *L, int nresults, lua_KContext

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

lua_pushboolean[-0, +1, –] void lua_pushboolean (lua_State *L, int b); Pushes a boolean value with value

2025-01-10 15:47:30