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

lua_rawgetp[-0, +1, –] int lua_rawgetp (lua_State *L, int index, const void *p); Pushes onto the stack

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

lua_tonumber[-0, +0, –] lua_Number lua_tonumber (lua_State *L, int index); Equivalent to

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

lua_typename[-0, +0, –] const char *lua_typename (lua_State *L, int tp); Returns the name of the type encoded

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

lua_absindex[-0, +0, –] int lua_absindex (lua_State *L, int idx); Converts the acceptable index idx

2025-01-10 15:47:30