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

lua_rawget[-1, +1, –] int lua_rawget (lua_State *L, int index); Similar to

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

lua_KFunction typedef int (*lua_KFunction) (lua_State *L, int status, lua_KContext ctx); Type for continuation functions (see

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

lua_Integer typedef ... lua_Integer; The type of integers in Lua. By default this type is long long, (usually

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

lua_yield[-?, +?, e] int lua_yield (lua_State *L, int nresults); This function is equivalent to

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

lua_pushlstring[-0, +1, m] const char *lua_pushlstring (lua_State *L, const char *s, size_t len);

2025-01-10 15:47:30