LUAL_CALLMETA(3) Library Functions Manual LUAL_CALLMETA(3)

luaL_callmetacalls a metamethod, function indicator [-0, + (0|1), e]

#include <lauxlib.h>

int
luaL_callmeta(lua_State *L, int obj, const char *e);

() calls a metamethod.

If the object at index obj has a metatable and this metatable has a field e, this function calls this field and passes the object as its only argument. In this case this function returns 1 and pushes onto the stack the value returned by the call. If there is no metatable or no metamethod, this function returns 0 (without pushing any value on the stack).

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

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

July 26, 2022 Debian