LUA_GETTOP(3) Library Functions Manual LUA_GETTOP(3)

lua_gettopreturns the index of the top element in the stack, function indicator [-0, +0, -]

#include <lua.h>

int
lua_gettop(lua_State *L);

() returns the index of the top element in the stack. Because indices start at 1, this result is equal to the number of elements in the stack (and so 0 means an empty stack).

Returns the index of the top element in the stack.

Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes, Lua 5.1 Reference Manual.

The lua_gettop() manual page is based on Lua Reference Manual 5.1 and was created by Sergey Bronnikov.

July 14, 2022 Debian