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

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

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

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

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

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

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

lua_resume[-?, +?, –] int lua_resume (lua_State *L, lua_State *from, int nargs); Starts and resumes a coroutine

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

lua_rawlen[-0, +0, –] size_t lua_rawlen (lua_State *L, int index); Returns the raw "length" of the value

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

lua_stringtonumber[-0, +1, –] size_t lua_stringtonumber (lua_State *L, const char *s); Converts the zero-terminated

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

lua_tocfunction[-0, +0, –] lua_CFunction lua_tocfunction (lua_State *L, int index); Converts a value at

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