Commit Diff


commit - 0ca820d6726c63f217b1d826c1aa9f7d28ea5cb6
commit + c8b5c9fc4857cc0377de44274ebf965ed5091d4b
blob - /dev/null
blob + 37e93831f9b7f5cb5cdfdbdf7764c030e93f5464 (mode 644)
--- /dev/null
+++ man3/luaL_newmetatable.3
@@ -0,0 +1,26 @@
+.Dd $Mdocdate: July 26 2022 $
+.Dt LUAL_NEWMETATABLE 3
+.Os
+.Sh NAME
+.Nm luaL_newmetatable
+.Nd creates a new table to be used as a metatable for userdata
+.Sh SYNOPSIS
+.In lauxlib.h
+.Ft int
+.Fn luaL_newmetatable "lua_State *L" "const char *tname"
+.Sh DESCRIPTION
+.Fn luaL_newmetatable
+If the registry already has the key
+.Fa tname ,
+returns 0. Otherwise, creates a new table to be used as a metatable for
+userdata, adds it to the registry with key
+.Fa tname ,
+and returns 1.
+.Pp
+In both cases pushes onto the stack the final value associated with
+.Fa tname
+in the registry.
+.Sh HISTORY
+The
+.Fn luaL_newmetatable
+manual page was written by Sergey Bronnikov.