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

lua_isnone[-0, +0, –] int lua_isnone (lua_State *L, int index); Returns 1 if the given index is not valid

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

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

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

lua_numbertointeger int lua_numbertointeger (lua_Number n, lua_Integer *p); Converts a Lua float to a Lua integer. This macro assumes

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

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

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

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

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

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

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

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

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

lua_getuservalue[-0, +1, –] int lua_getuservalue (lua_State *L, int index); Pushes onto the stack the Lua

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

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

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

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

2025-01-10 15:47:30