commit cee3adcc02139368cbd81909fad4febf2d836b5f from: ligurio date: Fri Nov 11 12:46:50 2022 UTC Deploying to gh-pages from @ ligurio/luac-manual-pages@e81b0dc716054de434f7e1d4c8c1ea685069bbe2 🚀 commit - 99b2d2978ab317e2d080e98c7059ddd1c3aae03f commit + cee3adcc02139368cbd81909fad4febf2d836b5f blob - /dev/null blob + 3e5693ee3e83da58c32f8a75d5eaf8a232b8891f (mode 644) --- /dev/null +++ luaL_Buffer.3 @@ -0,0 +1,58 @@ +.Dd $Mdocdate: July 26 2022 $ +.Dt LUAL_BUFFER 3 +.Os +.Sh NAME +.Nm luaL_Buffer +.Nd type for a string buffer +.Sh SYNOPSIS +.In lauxlib.h +.Vt typedef struct luaL_Buffer luaL_Buffer ; +.Sh DESCRIPTION +.Fn luaL_Buffer +type for a +.Em string buffer . +.Pp +A string buffer allows C code to build Lua strings piecemeal. +Its pattern of use is as follows: +.Pp +.Bl -bullet -compact +.It +First you declare a variable b of type +.Nm luaL_Buffer . +.It +Then you initialize it with a call +.Em luaL_buffinit(L, &b) . +.It +Then you add string pieces to the buffer calling any of the +.Em luaL_add* +functions. +.It +You finish by calling +.Em luaL_pushresult(&b) . +This call leaves the final string on the top of the stack. +.El +.Pp +During its normal operation, a string buffer uses a variable number of stack +slots. +So, while using a buffer, you cannot assume that you know where the top +of the stack is. +You can use the stack between successive calls to buffer operations as long as +that use is balanced; that is, when you call a buffer operation, the stack is +at the same level it was immediately after the previous buffer operation. +.Pq The only exception to this rule is Em luaL_addvalue . +After calling +.Xr luaL_pushresult 3 +the stack is back to its level when the buffer was initialized, plus the final +string on its top. +.Sh SEE ALSO +.Xr luaL_pushresult 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_Buffer +manual page was written by Sergey Bronnikov. blob - /dev/null blob + e18ea316d4eb0a9edcd3a5c101115cd991b6341d (mode 644) --- /dev/null +++ luaL_Buffer.3.html @@ -0,0 +1,71 @@ + + + + + + LUAL_BUFFER(3) + + + + + + + + +
LUAL_BUFFER(3)Library Functions ManualLUAL_BUFFER(3)
+
+

+luaL_Buffer — +
type for a string buffer
+

+#include + <lauxlib.h> +
+typedef struct luaL_Buffer luaL_Buffer; +

+luaL_Buffer() type for a + string buffer. +
+A string buffer allows C code to build Lua strings piecemeal. Its pattern of use + is as follows: +
+ +
+During its normal operation, a string buffer uses a variable number of stack + slots. So, while using a buffer, you cannot assume that you know where the top + of the stack is. You can use the stack between successive calls to buffer + operations as long as that use is balanced; that is, when you call a buffer + operation, the stack is at the same level it was immediately after the + previous buffer operation. (The only exception to this rule is + luaL_addvalue). After calling + luaL_pushresult(3) the stack is back to its level + when the buffer was initialized, plus the final string on its top. +

+luaL_pushresult(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_Buffer() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 26, 2022Debian
+ + blob - /dev/null blob + 897bbc03baf4317e98657d69045f318301cb841c (mode 644) --- /dev/null +++ luaL_Reg.3 @@ -0,0 +1,46 @@ +.Dd $Mdocdate: July 26 2022 $ +.Dt LUAL_REG 3 +.Os +.Sh NAME +.Nm luaL_Reg +.Nd type for arrays of functions to be registered by luaL_register +.Sh SYNOPSIS +.In lauxlib.h +.Vt typedef struct luaL_Reg ; +.Sh DESCRIPTION +.Fn luaL_Reg +type for arrays of functions to be registered by +.Xr luaL_register 3 . +.Vt luaL_Reg +is defined as: +.Bd -literal +typedef struct luaL_Reg { + const char *name; + lua_CFunction func; +} luaL_Reg; +.Ed +.Pp +.Fa name +is the function name and +.Fa func +is a pointer to the function. +Any array of +.Nm luaL_Reg +must end with an sentinel entry in which both +.Fa name +and +.Fa func +are +.Dv NULL . +.Sh SEE ALSO +.Xr luaL_register 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_Reg +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 26fbb7429f9db1f8eaaec3ea58ccc6b28fe225c9 (mode 644) --- /dev/null +++ luaL_Reg.3.html @@ -0,0 +1,64 @@ + + + + + + LUAL_REG(3) + + + + + + + + +
LUAL_REG(3)Library Functions ManualLUAL_REG(3)
+
+

+luaL_Reg — +
type for arrays of functions to be registered by + luaL_register
+

+#include + <lauxlib.h> +
+typedef struct luaL_Reg; +

+luaL_Reg() type for arrays of functions to be + registered by luaL_register(3). + luaL_Reg is defined as: +
+
+
+typedef struct luaL_Reg { 
+        const char *name; 
+        lua_CFunction func; 
+} luaL_Reg;
+
+
+
+name is the function name and + func is a pointer to the function. Any array + of luaL_Reg must end with an sentinel entry + in which both name and + func are + NULL. +

+luaL_register(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_Reg() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 26, 2022Debian
+ + blob - /dev/null blob + 93849f6b1a297eeb67367767207afb57541ef81c (mode 644) --- /dev/null +++ luaL_addchar.3 @@ -0,0 +1,29 @@ +.Dd $Mdocdate: July 22 2022 $ +.Dt LUAL_ADDCHAR 3 +.Os +.Sh NAME +.Nm luaL_addchar +.Nd adds the character to the buffer +.Sh SYNOPSIS +.In lauxlib.h +.Ft void +.Fn luaL_addchar "luaL_Buffer *B" "char c" +.Sh DESCRIPTION +.Fn luaL_addchar +adds the character +.Fa c +to the buffer +.Fa B +.Pq see Xr luaL_Buffer 3 . +.Sh SEE ALSO +.Xr luaL_Buffer 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_addchar +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 92a70d50199aac305ad77f73334dc8883df815db (mode 644) --- /dev/null +++ luaL_addchar.3.html @@ -0,0 +1,52 @@ + + + + + + LUAL_ADDCHAR(3) + + + + + + + + +
LUAL_ADDCHAR(3)Library Functions ManualLUAL_ADDCHAR(3)
+
+

+luaL_addchar — +
adds the character to the buffer
+

+#include + <lauxlib.h> +
+void +
+luaL_addchar(luaL_Buffer + *B, char + c); +

+luaL_addchar() adds the character + c to the buffer + B (see + luaL_Buffer(3)). +

+luaL_Buffer(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_addchar() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 22, 2022Debian
+ + blob - /dev/null blob + e597b34172f84781b9731650969afca6dae68a8c (mode 644) --- /dev/null +++ luaL_addlstring.3 @@ -0,0 +1,32 @@ +.Dd $Mdocdate: July 22 2022 $ +.Dt LUAL_ADDLSTRING 3 +.Os +.Sh NAME +.Nm luaL_addlstring +.Nd adds the string to the buffer +.Sh SYNOPSIS +.In lauxlib.h +.Ft void +.Fn luaL_addlstring "luaL_Buffer *B" "const char *s" "size_t l" +.Sh DESCRIPTION +.Fn luaL_addlstring +adds the string pointed to by +.Fa s +with length +.Fa l +to the buffer +.Fa B +.Pq see Xr luaL_Buffer 3 . +The string may contain embedded zeros. +.Sh SEE ALSO +.Xr luaL_Buffer 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_addlstring +manual page was written by Sergey Bronnikov. blob - /dev/null blob + ace5efe9e26b8e29cd325df89eafe36d4c989704 (mode 644) --- /dev/null +++ luaL_addlstring.3.html @@ -0,0 +1,55 @@ + + + + + + LUAL_ADDLSTRING(3) + + + + + + + + +
LUAL_ADDLSTRING(3)Library Functions ManualLUAL_ADDLSTRING(3)
+
+

+luaL_addlstring — +
adds the string to the buffer
+

+#include + <lauxlib.h> +
+void +
+luaL_addlstring(luaL_Buffer + *B, const char + *s, size_t + l); +

+luaL_addlstring() adds the string pointed to + by s with length + l to the buffer + B (see + luaL_Buffer(3)). The string may contain embedded + zeros. +

+luaL_Buffer(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_addlstring() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 22, 2022Debian
+ + blob - /dev/null blob + e41a091b9088be7f6861cdb2ff34f1f1b344e1ee (mode 644) --- /dev/null +++ luaL_addsize.3 @@ -0,0 +1,32 @@ +.Dd $Mdocdate: July 22 2022 $ +.Dt LUAL_ADDSIZE 3 +.Os +.Sh NAME +.Nm luaL_addsize +.Nd adds to the buffer a string +.Sh SYNOPSIS +.In lauxlib.h +.Ft void +.Fn luaL_addsize "luaL_Buffer *B" "size_t n" +.Sh DESCRIPTION +.Fn luaL_addsize +adds to the buffer +.Fa B +.Pq see Xr luaL_Buffer 3 +a string of length +.Fa n +previously copied to the buffer area +.Pq see Xr luaL_prepbuffer 3 . +.Sh SEE ALSO +.Xr luaL_Buffer 3 , +.Xr luaL_prepbuffer 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_addsize +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 260f54fe6e3c95c414ba2012e6fb66ac1fe86440 (mode 644) --- /dev/null +++ luaL_addsize.3.html @@ -0,0 +1,54 @@ + + + + + + LUAL_ADDSIZE(3) + + + + + + + + +
LUAL_ADDSIZE(3)Library Functions ManualLUAL_ADDSIZE(3)
+
+

+luaL_addsize — +
adds to the buffer a string
+

+#include + <lauxlib.h> +
+void +
+luaL_addsize(luaL_Buffer + *B, size_t + n); +

+luaL_addsize() adds to the buffer + B (see + luaL_Buffer(3)) a string of length + n previously copied to the buffer area (see + luaL_prepbuffer(3)). +

+luaL_Buffer(3), + luaL_prepbuffer(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_addsize() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 22, 2022Debian
+ + blob - /dev/null blob + 999c71a4ff688239b5e2f2ffcfa8b9688f840e16 (mode 644) --- /dev/null +++ luaL_addstring.3 @@ -0,0 +1,30 @@ +.Dd $Mdocdate: July 22 2022 $ +.Dt LUAL_ADDSTRING 3 +.Os +.Sh NAME +.Nm luaL_addstring +.Nd adds the zero-terminated string to the buffer +.Sh SYNOPSIS +.In lauxlib.h +.Ft void +.Fn luaL_addstring "luaL_Buffer *B" "const char *s" +.Sh DESCRIPTION +.Fn luaL_addstring +adds the zero-terminated string pointed to by +.Fa s +to the buffer +.Fa B +.Pq see Xr luaL_Buffer 3 . +The string may not contain embedded zeros. +.Sh SEE ALSO +.Xr luaL_Buffer 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_addstring +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 8c4316c77c14e3098dce868d8f6929b9854cf830 (mode 644) --- /dev/null +++ luaL_addstring.3.html @@ -0,0 +1,53 @@ + + + + + + LUAL_ADDSTRING(3) + + + + + + + + +
LUAL_ADDSTRING(3)Library Functions ManualLUAL_ADDSTRING(3)
+
+

+luaL_addstring — +
adds the zero-terminated string to the buffer
+

+#include + <lauxlib.h> +
+void +
+luaL_addstring(luaL_Buffer + *B, const char + *s); +

+luaL_addstring() adds the zero-terminated + string pointed to by s to the buffer + B (see + luaL_Buffer(3)). The string may not contain + embedded zeros. +

+luaL_Buffer(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_addstring() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 22, 2022Debian
+ + blob - /dev/null blob + 0b040d22da499660d0ebcf182e4c2ec6637f1488 (mode 644) --- /dev/null +++ luaL_addvalue.3 @@ -0,0 +1,31 @@ +.Dd $Mdocdate: July 22 2022 $ +.Dt LUAL_ADDVALUE 3 +.Os +.Sh NAME +.Nm luaL_addvalue +.Nd adds the value at the top of the stack to the buffer +.Sh SYNOPSIS +.In lauxlib.h +.Ft void +.Fn luaL_addvalue "luaL_Buffer *B" +.Sh DESCRIPTION +.Fn luaL_addvalue +adds the value at the top of the stack to the buffer +.Fa B +.Pq see Xr luaL_Buffer 3 . +Pops the value. +.Pp +This is the only function on string buffers that can (and must) be called with +an extra element on the stack, which is the value to be added to the buffer. +.Sh SEE ALSO +.Xr luaL_Buffer 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_addvalue +manual page was written by Sergey Bronnikov. blob - /dev/null blob + a1bfcc42592daab1184b2853cb1ce126dce37957 (mode 644) --- /dev/null +++ luaL_addvalue.3.html @@ -0,0 +1,54 @@ + + + + + + LUAL_ADDVALUE(3) + + + + + + + + +
LUAL_ADDVALUE(3)Library Functions ManualLUAL_ADDVALUE(3)
+
+

+luaL_addvalue — +
adds the value at the top of the stack to the + buffer
+

+#include + <lauxlib.h> +
+void +
+luaL_addvalue(luaL_Buffer + *B); +

+luaL_addvalue() adds the value at the top of + the stack to the buffer B (see + luaL_Buffer(3)). Pops the value. +
+This is the only function on string buffers that can (and must) be called with + an extra element on the stack, which is the value to be added to the buffer. +

+luaL_Buffer(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_addvalue() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 22, 2022Debian
+ + blob - /dev/null blob + 4237c99f0e4a9fe0cfd061d68e79ccb996c0c1b3 (mode 644) --- /dev/null +++ luaL_argcheck.3 @@ -0,0 +1,30 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_ARGCHECK 3 +.Os +.Sh NAME +.Nm luaL_argcheck +.Nd checks whether cond is true +.Sh SYNOPSIS +.In lauxlib.h +.Ft void +.Fn luaL_argcheck "lua_State *L" "int cond" "int narg" "const char *extramsg" +.Sh DESCRIPTION +.Fn luaL_argcheck +checks whether cond is true. +If not, raises an error with the following message, where func is retrieved +from the call stack: +.Pp +.Bd -literal -offset indent -compact +bad argument # to () +.Ed +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_argcheck +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 2347a3aed45bbbff94839c844c2e9055f9dd5497 (mode 644) --- /dev/null +++ luaL_argcheck.3.html @@ -0,0 +1,57 @@ + + + + + + LUAL_ARGCHECK(3) + + + + + + + + +
LUAL_ARGCHECK(3)Library Functions ManualLUAL_ARGCHECK(3)
+
+

+luaL_argcheck — +
checks whether cond is true
+

+#include + <lauxlib.h> +
+void +
+luaL_argcheck(lua_State + *L, int + cond, int + narg, const char + *extramsg); +

+luaL_argcheck() checks whether cond is true. + If not, raises an error with the following message, where func is retrieved + from the call stack: +
+
+
+bad argument #<narg> to <func> (<extramsg>)
+
+
+

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

+The luaL_argcheck() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + 6a6d8dfaf27a71437d4c6e19f12d9d4e70bce3ce (mode 644) --- /dev/null +++ luaL_argerror.3 @@ -0,0 +1,33 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_ARGERROR 3 +.Os +.Sh NAME +.Nm luaL_argerror +.Nd raises an error with the message +.Sh SYNOPSIS +.In lauxlib.h +.Ft int +.Fn luaL_argerror "lua_State *L" "int narg" "const char *extramsg" +.Sh DESCRIPTION +.Fn luaL_argerror +raises an error with the following message, where func is retrieved from the +call stack: +.Pp +.Bd -literal -offset indent -compact +bad argument # to () +.Ed +.Pp +This function never returns, but it is an idiom to use it in C functions as +return +.Em luaL_argerror(args) . +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_argerror +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 5744a51e78b864756b0c9f105b3614b818867b43 (mode 644) --- /dev/null +++ luaL_argerror.3.html @@ -0,0 +1,58 @@ + + + + + + LUAL_ARGERROR(3) + + + + + + + + +
LUAL_ARGERROR(3)Library Functions ManualLUAL_ARGERROR(3)
+
+

+luaL_argerror — +
raises an error with the message
+

+#include + <lauxlib.h> +
+int +
+luaL_argerror(lua_State + *L, int + narg, const char + *extramsg); +

+luaL_argerror() raises an error with the + following message, where func is retrieved from the call stack: +
+
+
+bad argument #<narg> to <func> (<extramsg>)
+
+
+
+This function never returns, but it is an idiom to use it in C functions as + return luaL_argerror(args). +

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

+The luaL_argerror() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + edbd16164471105d89735185ce4e36b2c84a223c (mode 644) --- /dev/null +++ luaL_buffinit.3 @@ -0,0 +1,29 @@ +.Dd $Mdocdate: July 22 2022 $ +.Dt LUAL_BUFFINIT 3 +.Os +.Sh NAME +.Nm luaL_buffinit +.Nd initializes a buffer +.Sh SYNOPSIS +.In lauxlib.h +.Ft void +.Fn luaL_buffinit "lua_State *L" "luaL_Buffer *B" +.Sh DESCRIPTION +.Fn luaL_buffinit +initializes a buffer +.Fa B . +This function does not allocate any space; the buffer must be declared as a +variable +.Pq see Xr luaL_Buffer 3 . +.Sh SEE ALSO +.Xr luaL_Buffer 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_buffinit +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 5aaf75494a9fd174d5c4ba3897673a17cc97adb9 (mode 644) --- /dev/null +++ luaL_buffinit.3.html @@ -0,0 +1,52 @@ + + + + + + LUAL_BUFFINIT(3) + + + + + + + + +
LUAL_BUFFINIT(3)Library Functions ManualLUAL_BUFFINIT(3)
+
+

+luaL_buffinit — +
initializes a buffer
+

+#include + <lauxlib.h> +
+void +
+luaL_buffinit(lua_State + *L, luaL_Buffer + *B); +

+luaL_buffinit() initializes a buffer + B. This function does not allocate any space; + the buffer must be declared as a variable (see + luaL_Buffer(3)). +

+luaL_Buffer(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_buffinit() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 22, 2022Debian
+ + blob - /dev/null blob + 6f661e2c62cb88dab44e0e451263c1ec031048f6 (mode 644) --- /dev/null +++ luaL_callmeta.3 @@ -0,0 +1,32 @@ +.Dd $Mdocdate: July 26 2022 $ +.Dt LUAL_CALLMETA 3 +.Os +.Sh NAME +.Nm luaL_callmeta +.Nd calls a metamethod +.Sh SYNOPSIS +.In lauxlib.h +.Ft int +.Fn luaL_callmeta "lua_State *L" "int obj" "const char *e" +.Sh DESCRIPTION +.Fn luaL_callmeta +calls a metamethod. +.Sh RETURN VALUES +If the object at index obj has a metatable and this metatable has a field +.Fa 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). +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_callmeta +manual page was written by Sergey Bronnikov. blob - /dev/null blob + ce565d4347ea287e665b0852285b9ada3809caa9 (mode 644) --- /dev/null +++ luaL_callmeta.3.html @@ -0,0 +1,56 @@ + + + + + + LUAL_CALLMETA(3) + + + + + + + + +
LUAL_CALLMETA(3)Library Functions ManualLUAL_CALLMETA(3)
+
+

+luaL_callmeta — +
calls a metamethod
+

+#include + <lauxlib.h> +
+int +
+luaL_callmeta(lua_State + *L, int + obj, const char + *e); +

+luaL_callmeta() 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 was written + by Sergey Bronnikov.
+ + + + + +
July 26, 2022Debian
+ + blob - /dev/null blob + 8dffc35c8ded7799950a875178745fe13fe301c3 (mode 644) --- /dev/null +++ luaL_checkany.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_CHECKANY 3 +.Os +.Sh NAME +.Nm luaL_checkany +.Nd checks whether the function has an argument of any type +.Sh SYNOPSIS +.In lauxlib.h +.Ft void +.Fn luaL_checkany "lua_State *L" "int narg" +.Sh DESCRIPTION +.Fn luaL_checkany +checks whether the function has an argument of any type +.Pq including Em nil +at +position +.Fa narg . +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_checkany +manual page was written by Sergey Bronnikov. blob - /dev/null blob + ec2f9306b7bd1e61d66dbcb0e87034c60a72af7c (mode 644) --- /dev/null +++ luaL_checkany.3.html @@ -0,0 +1,50 @@ + + + + + + LUAL_CHECKANY(3) + + + + + + + + +
LUAL_CHECKANY(3)Library Functions ManualLUAL_CHECKANY(3)
+
+

+luaL_checkany — +
checks whether the function has an argument of any + type
+

+#include + <lauxlib.h> +
+void +
+luaL_checkany(lua_State + *L, int + narg); +

+luaL_checkany() checks whether the function + has an argument of any type (including nil) at + position narg. +

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

+The luaL_checkany() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + 6a4b9afed8048024cda5dabb44c3dd8973f2be75 (mode 644) --- /dev/null +++ luaL_checkint.3 @@ -0,0 +1,27 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_CHECKINT 3 +.Os +.Sh NAME +.Nm luaL_checkint +.Nd checks whether the function argument is a number +.Sh SYNOPSIS +.In lauxlib.h +.Ft int +.Fn luaL_checkint "lua_State *L" "int narg" +.Sh DESCRIPTION +.Fn luaL_checkint +checks whether the function argument +.Fa narg +is a number and returns this number cast to an +.Em int . +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_checkint +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 126e64b2d60c392053aaf62d933cf1f3208044b6 (mode 644) --- /dev/null +++ luaL_checkint.3.html @@ -0,0 +1,50 @@ + + + + + + LUAL_CHECKINT(3) + + + + + + + + +
LUAL_CHECKINT(3)Library Functions ManualLUAL_CHECKINT(3)
+
+

+luaL_checkint — +
checks whether the function argument is a + number
+

+#include + <lauxlib.h> +
+int +
+luaL_checkint(lua_State + *L, int + narg); +

+luaL_checkint() checks whether the function + argument narg is a number and returns this + number cast to an int. +

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

+The luaL_checkint() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + 21ad45eaf7affaf7cc0806a54b0bcc5cd624fe8d (mode 644) --- /dev/null +++ luaL_checkinteger.3 @@ -0,0 +1,29 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_CHECKINTEGER 3 +.Os +.Sh NAME +.Nm luaL_checkinteger +.Nd checks whether the function argument is a number +.Sh SYNOPSIS +.In lauxlib.h +.Ft lua_Integer +.Fn luaL_checkinteger "lua_State *L" "int narg" +.Sh DESCRIPTION +.Fn luaL_checkinteger +checks whether the function argument +.Fa narg +is a number and returns this number +cast to a +.Xr lua_Integer 3 . +.Sh SEE ALSO +.Xr lua_Integer 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_checkinteger +manual page was written by Sergey Bronnikov. blob - /dev/null blob + f8850e9b7a8210ad849f1e36f1abbfaf87748e6b (mode 644) --- /dev/null +++ luaL_checkinteger.3.html @@ -0,0 +1,52 @@ + + + + + + LUAL_CHECKINTEGER(3) + + + + + + + + +
LUAL_CHECKINTEGER(3)Library Functions ManualLUAL_CHECKINTEGER(3)
+
+

+luaL_checkinteger — +
checks whether the function argument is a + number
+

+#include + <lauxlib.h> +
+lua_Integer +
+luaL_checkinteger(lua_State + *L, int + narg); +

+luaL_checkinteger() checks whether the + function argument narg is a number and + returns this number cast to a lua_Integer(3). +

+lua_Integer(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_checkinteger() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + 0b4cd7fdb194052e0bc4968fc8677964863c5ae3 (mode 644) --- /dev/null +++ luaL_checklong.3 @@ -0,0 +1,26 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_CHECKLONG 3 +.Os +.Sh NAME +.Nm luaL_checklong +.Nd checks whether the function argument is a number +.Sh SYNOPSIS +.In lauxlib.h +.Ft long +.Fn luaL_checklong "lua_State *L" "int narg" +.Sh DESCRIPTION +.Fn luaL_checklong +checks whether the function argument +.Fa narg +is a number and returns this number cast to a long. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_checklong +manual page was written by Sergey Bronnikov. blob - /dev/null blob + b7915b76057716e64a261bb95f141f56a0f98da2 (mode 644) --- /dev/null +++ luaL_checklong.3.html @@ -0,0 +1,50 @@ + + + + + + LUAL_CHECKLONG(3) + + + + + + + + +
LUAL_CHECKLONG(3)Library Functions ManualLUAL_CHECKLONG(3)
+
+

+luaL_checklong — +
checks whether the function argument is a + number
+

+#include + <lauxlib.h> +
+long +
+luaL_checklong(lua_State + *L, int + narg); +

+luaL_checklong() checks whether the function + argument narg is a number and returns this + number cast to a long. +

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

+The luaL_checklong() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + 5040092fc3021cb4385b83d151d92fa712590607 (mode 644) --- /dev/null +++ luaL_checklstring.3 @@ -0,0 +1,36 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_CHECKLSTRING 3 +.Os +.Sh NAME +.Nm luaL_checklstring +.Nd checks whether the function argument is a string +.Sh SYNOPSIS +.In lauxlib.h +.Ft const char * +.Fn luaL_checklstring "lua_State *L" "int narg" "size_t *l" +.Sh DESCRIPTION +.Fn luaL_checklstring +checks whether the function argument +.Fa narg +is a string and returns this string; +if l is not +.Dv NULL +fills +.Fa *l +with the string's length. +.Pp +This function uses +.Xr lua_tolstring 3 +to get its result, so all conversions and caveats of that function apply here. +.Sh SEE ALSO +.Xr lua_tolstring 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_checklstring +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 5d8fd8dde10ffc29222cfb283f189ab01b7ca6a4 (mode 644) --- /dev/null +++ luaL_checklstring.3.html @@ -0,0 +1,57 @@ + + + + + + LUAL_CHECKLSTRING(3) + + + + + + + + +
LUAL_CHECKLSTRING(3)Library Functions ManualLUAL_CHECKLSTRING(3)
+
+

+luaL_checklstring — +
checks whether the function argument is a + string
+

+#include + <lauxlib.h> +
+const char * +
+luaL_checklstring(lua_State + *L, int + narg, size_t + *l); +

+luaL_checklstring() checks whether the + function argument narg is a string and + returns this string; if l is not NULL fills + *l with the string's length. +
+This function uses lua_tolstring(3) to get its + result, so all conversions and caveats of that function apply here. +

+lua_tolstring(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_checklstring() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + c25a3bb23182870b17535b0ba9106cc7233ac572 (mode 644) --- /dev/null +++ luaL_checknumber.3 @@ -0,0 +1,27 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_CHECKNUMBER 3 +.Os +.Sh NAME +.Nm luaL_checknumber +.Nd checks whether the function argument narg is a number and returns this +number +.Sh SYNOPSIS +.In lauxlib.h +.Ft lua_Number +.Fn luaL_checknumber "lua_State *L" "int narg" +.Sh DESCRIPTION +.Fn luaL_checknumber +checks whether the function argument +.Fa narg +is a number and returns this number. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_checknumber +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 913193e0b038319cdc49cb3cc7d01b47ebec2d66 (mode 644) --- /dev/null +++ luaL_checknumber.3.html @@ -0,0 +1,50 @@ + + + + + + LUAL_CHECKNUMBER(3) + + + + + + + + +
LUAL_CHECKNUMBER(3)Library Functions ManualLUAL_CHECKNUMBER(3)
+
+

+luaL_checknumber — +
checks whether the function argument narg is a number + and returns this number
+

+#include + <lauxlib.h> +
+lua_Number +
+luaL_checknumber(lua_State + *L, int + narg); +

+luaL_checknumber() checks whether the + function argument narg is a number and + returns this number. +

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

+The luaL_checknumber() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + 41c147945a6e698bd52a4a39b0d07854b3248217 (mode 644) --- /dev/null +++ luaL_checkoption.3 @@ -0,0 +1,45 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_CHECKOPTION 3 +.Os +.Sh NAME +.Nm luaL_checkoption +.Nd checks whether the function argument is a string +.Sh SYNOPSIS +.In lauxlib.h +.Ft int +.Fn luaL_checkoption "lua_State *L" "int narg" "const char *def" "const char *const lst[]" +.Sh DESCRIPTION +.Fn luaL_checkoption +checks whether the function argument +.Fa narg +is a string and searches for this string in the array +.Fa lst +(which must be +.Dv NULL +-terminated). +Returns the index in the array where the string was found. +Raises an error if the argument is not a string or if the string cannot be +found. +.Pp +If +.Fa def +is not +.Dv NULL , +the function uses def as a default value when there is no argument +.Fa narg +or if this argument is +.Dv nil . +.Pp +This is a useful function for mapping strings to C enums. (The usual convention +in Lua libraries is to use strings instead of numbers to select options.) +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_checkoption +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 59c5d21e86b659e76fb3162c10e4b72207733ce2 (mode 644) --- /dev/null +++ luaL_checkoption.3.html @@ -0,0 +1,63 @@ + + + + + + LUAL_CHECKOPTION(3) + + + + + + + + +
LUAL_CHECKOPTION(3)Library Functions ManualLUAL_CHECKOPTION(3)
+
+

+luaL_checkoption — +
checks whether the function argument is a + string
+

+#include + <lauxlib.h> +
+int +
+luaL_checkoption(lua_State + *L, int + narg, const char + *def, const char + *const lst[]); +

+luaL_checkoption() checks whether the + function argument narg is a string and + searches for this string in the array lst + (which must be NULL -terminated). Returns + the index in the array where the string was found. Raises an error if the + argument is not a string or if the string cannot be found. +
+If def is not + NULL, the function uses def as a default + value when there is no argument narg or if + this argument is nil. +
+This is a useful function for mapping strings to C enums. (The usual convention + in Lua libraries is to use strings instead of numbers to select options.) +

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

+The luaL_checkoption() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + 14a16717d0886d773176b590d7cd7e52e2ccba3e (mode 644) --- /dev/null +++ luaL_checkstack.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_CHECKSTACK 3 +.Os +.Sh NAME +.Nm luaL_checkstack +.Nd grows the stack size to specified size of elements +.Sh SYNOPSIS +.In lauxlib.h +.Ft void +.Fn luaL_checkstack "lua_State *L" "int sz" "const char *msg" +.Sh DESCRIPTION +.Fn luaL_checkstack +grows the stack size to +.Em top + sz +elements, raising an error if the stack cannot grow to that size. +.Fa msg +is an additional text to go into the error message. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_checkstack +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 3b5abc4b967b3e98d0c82e5a6a3c5b5444bacda5 (mode 644) --- /dev/null +++ luaL_checkstack.3.html @@ -0,0 +1,52 @@ + + + + + + LUAL_CHECKSTACK(3) + + + + + + + + +
LUAL_CHECKSTACK(3)Library Functions ManualLUAL_CHECKSTACK(3)
+
+

+luaL_checkstack — +
grows the stack size to specified size of + elements
+

+#include + <lauxlib.h> +
+void +
+luaL_checkstack(lua_State + *L, int + sz, const char + *msg); +

+luaL_checkstack() grows the stack size to + top + sz elements, raising an error if the stack + cannot grow to that size. msg is an + additional text to go into the error message. +

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

+The luaL_checkstack() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + c413017352dab90d3c127838eabee19e02792f4d (mode 644) --- /dev/null +++ luaL_checkstring.3 @@ -0,0 +1,31 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_CHECKSTRING 3 +.Os +.Sh NAME +.Nm luaL_checkstring +.Nd checks whether the function argument is a string and returns this string +.Sh SYNOPSIS +.In lauxlib.h +.Ft const char * +.Fn luaL_checkstring "lua_State *L" "int narg" +.Sh DESCRIPTION +.Fn luaL_checkstring +checks whether the function argument +.Fa narg +is a string and returns this string. +.Pp +This function uses +.Xr lua_tolstring 3 +to get its result, so all conversions and caveats of that function apply here. +.Sh SEE ALSO +.Xr lua_tolstring 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_checkstring +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 62e61f634dc814e053563e66663a3593a9211fdc (mode 644) --- /dev/null +++ luaL_checkstring.3.html @@ -0,0 +1,55 @@ + + + + + + LUAL_CHECKSTRING(3) + + + + + + + + +
LUAL_CHECKSTRING(3)Library Functions ManualLUAL_CHECKSTRING(3)
+
+

+luaL_checkstring — +
checks whether the function argument is a string and + returns this string
+

+#include + <lauxlib.h> +
+const char * +
+luaL_checkstring(lua_State + *L, int + narg); +

+luaL_checkstring() checks whether the + function argument narg is a string and + returns this string. +
+This function uses lua_tolstring(3) to get its + result, so all conversions and caveats of that function apply here. +

+lua_tolstring(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_checkstring() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + 9c67b486ecdf37842e7523227ed87fe965e50224 (mode 644) --- /dev/null +++ luaL_checktype.3 @@ -0,0 +1,32 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_CHECKTYPE 3 +.Os +.Sh NAME +.Nm luaL_checktype +.Nd checks whether the function argument has a certain type +.Sh SYNOPSIS +.In lauxlib.h +.Ft void +.Fn luaL_checktype "lua_State *L" "int narg" "int t" +.Sh DESCRIPTION +.Fn luaL_checktype +checks whether the function argument +.Fa narg +has type +.Fa t . +See +.Xr lua_type 3 +for the encoding of types for +.Fa t . +.Sh SEE ALSO +.Xr lua_type 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_checktype +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 806d134215a25b213a70e1ff1485f5cec0f4e33d (mode 644) --- /dev/null +++ luaL_checktype.3.html @@ -0,0 +1,55 @@ + + + + + + LUAL_CHECKTYPE(3) + + + + + + + + +
LUAL_CHECKTYPE(3)Library Functions ManualLUAL_CHECKTYPE(3)
+
+

+luaL_checktype — +
checks whether the function argument has a certain + type
+

+#include + <lauxlib.h> +
+void +
+luaL_checktype(lua_State + *L, int + narg, int + t); +

+luaL_checktype() checks whether the function + argument narg has type + t. See + lua_type(3) for the encoding of types for + t. +

+lua_type(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_checktype() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + 057fc8cf7183dfdace357e99c981e4d1e294d023 (mode 644) --- /dev/null +++ luaL_checkudata.3 @@ -0,0 +1,29 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_CHECKUDATA 3 +.Os +.Sh NAME +.Nm luaL_checkudata +.Nd checks whether the function argument is a userdata of a certain type +.Sh SYNOPSIS +.In lauxlib.h +.Ft void * +.Fn luaL_checkudata "lua_State *L" "int narg" "const char *tname" +.Sh DESCRIPTION +.Fn luaL_checkudata +checks whether the function argument +.Fa narg +is a userdata of the type +.Fa tname +.Pq see Xr luaL_newmetatable 3 . +.Sh SEE ALSO +.Xr luaL_newmetatable 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_checkudata +manual page was written by Sergey Bronnikov. blob - /dev/null blob + e8c17cafe1160b7dab8bde71c41fd9987544ad32 (mode 644) --- /dev/null +++ luaL_checkudata.3.html @@ -0,0 +1,54 @@ + + + + + + LUAL_CHECKUDATA(3) + + + + + + + + +
LUAL_CHECKUDATA(3)Library Functions ManualLUAL_CHECKUDATA(3)
+
+

+luaL_checkudata — +
checks whether the function argument is a userdata of + a certain type
+

+#include + <lauxlib.h> +
+void * +
+luaL_checkudata(lua_State + *L, int + narg, const char + *tname); +

+luaL_checkudata() checks whether the function + argument narg is a userdata of the type + tname (see + luaL_newmetatable(3)). +

+luaL_newmetatable(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_checkudata() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + 4f3d888dcf60d40b31dd63c33d1fc7b45f270046 (mode 644) --- /dev/null +++ luaL_dofile.3 @@ -0,0 +1,31 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_DOFILE 3 +.Os +.Sh NAME +.Nm luaL_dofile +.Nd loads and runs the given file +.Sh SYNOPSIS +.In lauxlib.h +.Ft int +.Fn luaL_dofile "lua_State *L" "const char *filename" +.Sh DESCRIPTION +.Fn luaL_dofile +loads and runs the given file. +It is defined as the following macro: +.Pp +.Bd -literal -offset indent -compact +(luaL_loadfile(L, filename) || lua_pcall(L, 0, LUA_MULTRET, 0)) +.Ed +.Sh RETURN VALUES +It returns 0 if there are no errors or 1 in case of errors. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_dofile +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 41922caa407092b0bfa605b2d30cef514038cf95 (mode 644) --- /dev/null +++ luaL_dofile.3.html @@ -0,0 +1,57 @@ + + + + + + LUAL_DOFILE(3) + + + + + + + + +
LUAL_DOFILE(3)Library Functions ManualLUAL_DOFILE(3)
+
+

+luaL_dofile — +
loads and runs the given file
+

+#include + <lauxlib.h> +
+int +
+luaL_dofile(lua_State + *L, const char + *filename); +

+luaL_dofile() loads and runs the given file. + It is defined as the following macro: +
+
+
+(luaL_loadfile(L, filename) || lua_pcall(L, 0, LUA_MULTRET, 0))
+
+
+

+It returns 0 if there are no errors or 1 in case of errors. +

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

+The luaL_dofile() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + a42e449490730d4cf134d80b84522c32939aee6f (mode 644) --- /dev/null +++ luaL_dostring.3 @@ -0,0 +1,31 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_DOSTRING 3 +.Os +.Sh NAME +.Nm luaL_dostring +.Nd loads and runs the given string +.Sh SYNOPSIS +.In lauxlib.h +.Ft int +.Fn luaL_dostring "lua_State *L" "const char *str" +.Sh DESCRIPTION +.Fn luaL_dostring +loads and runs the given string. +It is defined as the following macro: +.Pp +.Bd -literal -offset indent -compact +(luaL_loadstring(L, str) || lua_pcall(L, 0, LUA_MULTRET, 0)) +.Ed +.Sh RETURN VALUES +It returns 0 if there are no errors or 1 in case of errors. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_dostring +manual page was written by Sergey Bronnikov. blob - /dev/null blob + a35832a3d4249cfa9bebf3b3104d861f0c956b21 (mode 644) --- /dev/null +++ luaL_dostring.3.html @@ -0,0 +1,57 @@ + + + + + + LUAL_DOSTRING(3) + + + + + + + + +
LUAL_DOSTRING(3)Library Functions ManualLUAL_DOSTRING(3)
+
+

+luaL_dostring — +
loads and runs the given string
+

+#include + <lauxlib.h> +
+int +
+luaL_dostring(lua_State + *L, const char + *str); +

+luaL_dostring() loads and runs the given + string. It is defined as the following macro: +
+
+
+(luaL_loadstring(L, str) || lua_pcall(L, 0, LUA_MULTRET, 0))
+
+
+

+It returns 0 if there are no errors or 1 in case of errors. +

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

+The luaL_dostring() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + a8d6235b348bc25c6d45df76f00c3b66133fcb79 (mode 644) --- /dev/null +++ luaL_error.3 @@ -0,0 +1,35 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_ERROR 3 +.Os +.Sh NAME +.Nm luaL_error +.Nd raises an error +.Sh SYNOPSIS +.In lauxlib.h +.Ft int +.Fn luaL_error "lua_State *L" "const char *fmt" "..." +.Sh DESCRIPTION +.Fn luaL_error +raises an error. +The error message format is given by +.Fa fmt +plus any extra arguments, following the same rules of +.Xr lua_pushfstring 3 . +It also adds at the beginning of the message the file name and the line number +where the error occurred, if this information is available. +.Pp +This function never returns, but it is an idiom to use it in C functions as +return +.Em luaL_error(args) . +.Sh SEE ALSO +.Xr lua_pushfstring 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_error +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 24f9d05072d26944db63f80aad10004465138f19 (mode 644) --- /dev/null +++ luaL_error.3.html @@ -0,0 +1,58 @@ + + + + + + LUAL_ERROR(3) + + + + + + + + +
LUAL_ERROR(3)Library Functions ManualLUAL_ERROR(3)
+
+

+luaL_error — +
raises an error
+

+#include + <lauxlib.h> +
+int +
+luaL_error(lua_State + *L, const char + *fmt, + ...); +

+luaL_error() raises an error. The error + message format is given by fmt plus any extra + arguments, following the same rules of + lua_pushfstring(3). It also adds at the beginning + of the message the file name and the line number where the error occurred, if + this information is available. +
+This function never returns, but it is an idiom to use it in C functions as + return luaL_error(args). +

+lua_pushfstring(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_error() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + c53f356115705ea4e6c90c91ce52eb71223806cb (mode 644) --- /dev/null +++ luaL_getmetafield.3 @@ -0,0 +1,30 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_GETMETAFIELD 3 +.Os +.Sh NAME +.Nm luaL_getmetafield +.Nd pushes onto the stack the field from the metatable of the object at the +specified index +.Sh SYNOPSIS +.In lauxlib.h +.Ft int +.Fn luaL_getmetafield "lua_State *L" "int obj" "const char *e" +.Sh DESCRIPTION +.Fn luaL_getmetafield +pushes onto the stack the field +.Fa e +from the metatable of the object at index +.Fa obj . +If the object does not have a metatable, or if the metatable does not have +this field, returns 0 and pushes nothing. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_getmetafield +manual page was written by Sergey Bronnikov. blob - /dev/null blob + b6e903aedf8dd545d4053aff07319850c940ecc3 (mode 644) --- /dev/null +++ luaL_getmetafield.3.html @@ -0,0 +1,53 @@ + + + + + + LUAL_GETMETAFIELD(3) + + + + + + + + +
LUAL_GETMETAFIELD(3)Library Functions ManualLUAL_GETMETAFIELD(3)
+
+

+luaL_getmetafield — +
pushes onto the stack the field from the metatable of + the object at the specified index
+

+#include + <lauxlib.h> +
+int +
+luaL_getmetafield(lua_State + *L, int + obj, const char + *e); +

+luaL_getmetafield() pushes onto the stack the + field e from the metatable of the object at + index obj. If the object does not have a + metatable, or if the metatable does not have this field, returns 0 and pushes + nothing. +

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

+The luaL_getmetafield() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + 103a59f5e876f010ad13aead7f6f9790ec8a474c (mode 644) --- /dev/null +++ luaL_getmetatable.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_GETMETATABLE 3 +.Os +.Sh NAME +.Nm luaL_getmetatable +.Nd pushes onto the stack the metatable associated with name in the registry +.Sh SYNOPSIS +.In lauxlib.h +.Ft void +.Fn luaL_getmetatable "lua_State *L" "const char *tname" +.Sh DESCRIPTION +.Fn luaL_getmetatable +pushes onto the stack the metatable associated with name +.Fa tname +in the registry +.Pq see Xr luaL_newmetatable 3 . +.Sh SEE ALSO +.Xr luaL_newmetatable 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_getmetatable +manual page was written by Sergey Bronnikov. blob - /dev/null blob + cadeda91e86f519991ddfabe32a4e9ae73f718de (mode 644) --- /dev/null +++ luaL_getmetatable.3.html @@ -0,0 +1,52 @@ + + + + + + LUAL_GETMETATABLE(3) + + + + + + + + +
LUAL_GETMETATABLE(3)Library Functions ManualLUAL_GETMETATABLE(3)
+
+

+luaL_getmetatable — +
pushes onto the stack the metatable associated with + name in the registry
+

+#include + <lauxlib.h> +
+void +
+luaL_getmetatable(lua_State + *L, const char + *tname); +

+luaL_getmetatable() pushes onto the stack the + metatable associated with name tname in the + registry (see luaL_newmetatable(3)). +

+luaL_newmetatable(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_getmetatable() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + 32eca7f10c0dbc5503f285efd1b55029339b8794 (mode 644) --- /dev/null +++ luaL_gsub.3 @@ -0,0 +1,31 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_GSUB 3 +.Os +.Sh NAME +.Nm luaL_gsub +.Nd creates a copy of string A by replacing any occurrence of the string B with +the string C +.Sh SYNOPSIS +.In lauxlib.h +.Ft const char * +.Fn luaL_gsub "lua_State *L" "const char *s" "const char *p" "const char *r" +.Sh DESCRIPTION +.Fn luaL_gsub +creates a copy of string +.Fa s +by replacing any occurrence of the string +.Fa p +with the string +.Fa r . +Pushes the resulting string on the stack and returns it. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_gsub +manual page was written by Sergey Bronnikov. blob - /dev/null blob + da9494910c934deeb5b40b78c8ce9143f4227db8 (mode 644) --- /dev/null +++ luaL_gsub.3.html @@ -0,0 +1,54 @@ + + + + + + LUAL_GSUB(3) + + + + + + + + +
LUAL_GSUB(3)Library Functions ManualLUAL_GSUB(3)
+
+

+luaL_gsub — +
creates a copy of string A by replacing any + occurrence of the string B with the string C
+

+#include + <lauxlib.h> +
+const char * +
+luaL_gsub(lua_State + *L, const char + *s, const char + *p, const char + *r); +

+luaL_gsub() creates a copy of string + s by replacing any occurrence of the string + p with the string + r. Pushes the resulting string on the stack + and returns it. +

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

+The luaL_gsub() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + b7a0c452619f8f6586c76ccf5fc603c1feec6556 (mode 644) --- /dev/null +++ luaL_loadbuffer.3 @@ -0,0 +1,37 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_LOADBUFFER 3 +.Os +.Sh NAME +.Nm luaL_loadbuffer +.Nd loads a buffer as a Lua chunk +.Sh SYNOPSIS +.In lauxlib.h +.Ft int +.Fn luaL_loadbuffer "lua_State *L" "const char *buff" "size_t sz" "const char *name" +.Sh DESCRIPTION +.Fn luaL_loadbuffer +loads a buffer as a Lua chunk. +This function uses +.Xr lua_load 3 +to load the chunk in the buffer pointed to by +.Fa buff +with size +.Fa sz . +.Pp +This function returns the same results as +.Xr lua_load 3 . +.Fa name +is the chunk name, +used for debug information and error messages. +.Sh SEE ALSO +.Xr lua_load 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_loadbuffer +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 63b9f0abf5bdb015fd8872027fb009ef038807b3 (mode 644) --- /dev/null +++ luaL_loadbuffer.3.html @@ -0,0 +1,59 @@ + + + + + + LUAL_LOADBUFFER(3) + + + + + + + + +
LUAL_LOADBUFFER(3)Library Functions ManualLUAL_LOADBUFFER(3)
+
+

+luaL_loadbuffer — +
loads a buffer as a Lua chunk
+

+#include + <lauxlib.h> +
+int +
+luaL_loadbuffer(lua_State + *L, const char + *buff, size_t + sz, const char + *name); +

+luaL_loadbuffer() loads a buffer as a Lua + chunk. This function uses lua_load(3) to load the + chunk in the buffer pointed to by buff with + size sz. +
+This function returns the same results as + lua_load(3). + name is the chunk name, used for debug + information and error messages. +

+lua_load(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_loadbuffer() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + 8255ed36136fba727ed9ba81caf358f7a973cb5e (mode 644) --- /dev/null +++ luaL_loadfile.3 @@ -0,0 +1,44 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_LOADFILE 3 +.Os +.Sh NAME +.Nm luaL_loadfile +.Nd loads a file as a Lua chunk +.Sh SYNOPSIS +.In lauxlib.h +.Ft int +.Fn luaL_loadfile "lua_State *L" "const char *filename" +.Sh DESCRIPTION +.Fn luaL_loadfile +loads a file as a Lua chunk. +This function uses +.Xr lua_load 3 +to load the chunk in the file named +.Fa filename . +If filename is +.Dv NULL , +then it loads from the standard input. +The first line in the file is ignored if it starts with a +.Em # . +.Pp +As +.Xr lua_load 3 , +this function only loads the chunk; it does not run it. +.Sh RETURN VALUES +This function returns the same results as +.Xr lua_load 3 , +but it has an extra error code +.Dv LUA_ERRFILE +if it cannot open/read the file. +.Sh SEE ALSO +.Xr lua_load 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_loadfile +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 9bf05468dbfadece23e8f2445f118db69e87db43 (mode 644) --- /dev/null +++ luaL_loadfile.3.html @@ -0,0 +1,63 @@ + + + + + + LUAL_LOADFILE(3) + + + + + + + + +
LUAL_LOADFILE(3)Library Functions ManualLUAL_LOADFILE(3)
+
+

+luaL_loadfile — +
loads a file as a Lua chunk
+

+#include + <lauxlib.h> +
+int +
+luaL_loadfile(lua_State + *L, const char + *filename); +

+luaL_loadfile() loads a file as a Lua chunk. + This function uses lua_load(3) to load the chunk + in the file named filename. If filename is + NULL, then it loads from the standard + input. The first line in the file is ignored if it starts with a + #. +
+As lua_load(3), this function only loads the chunk; + it does not run it. +

+This function returns the same results as + lua_load(3), but it has an extra error code + LUA_ERRFILE if it cannot open/read the + file. +

+lua_load(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_loadfile() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + ff451dc263329b5b5604ea25727256173bc2d4b8 (mode 644) --- /dev/null +++ luaL_loadstring.3 @@ -0,0 +1,36 @@ +.Dd $Mdocdate: July 24 2022 $ +.Dt LUAL_LOADSTRING 3 +.Os +.Sh NAME +.Nm luaL_loadstring +.Nd loads a string as a Lua chunk +.Sh SYNOPSIS +.In lauxlib.h +.Ft int +.Fn luaL_loadstring "lua_State *L" "const char *s" +.Sh DESCRIPTION +.Fn luaL_loadstring +loads a string as a Lua chunk. +This function uses +.Xr lua_load 3 +to load the chunk in the zero-terminated string +.Fa s . +.Pp +This function returns the same results as +.Xr lua_load 3 . +.Pp +Also as +.Xr lua_load 3 , +this function only loads the chunk; it does not run it. +.Sh SEE ALSO +.Xr lua_load 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_loadstring +manual page was written by Sergey Bronnikov. blob - /dev/null blob + d52f06f17c37ce0635f06fe04f354a1f58c07e36 (mode 644) --- /dev/null +++ luaL_loadstring.3.html @@ -0,0 +1,57 @@ + + + + + + LUAL_LOADSTRING(3) + + + + + + + + +
LUAL_LOADSTRING(3)Library Functions ManualLUAL_LOADSTRING(3)
+
+

+luaL_loadstring — +
loads a string as a Lua chunk
+

+#include + <lauxlib.h> +
+int +
+luaL_loadstring(lua_State + *L, const char + *s); +

+luaL_loadstring() loads a string as a Lua + chunk. This function uses lua_load(3) to load the + chunk in the zero-terminated string s. +
+This function returns the same results as + lua_load(3). +
+Also as lua_load(3), this function only loads the + chunk; it does not run it. +

+lua_load(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_loadstring() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 24, 2022Debian
+ + blob - /dev/null blob + 330549d7d024faae9a1e9640f6069ff8ae9029fa (mode 644) --- /dev/null +++ luaL_newmetatable.3 @@ -0,0 +1,33 @@ +.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 SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_newmetatable +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 37d36dbb19d7057530bf7cd222d8a68dbed8121f (mode 644) --- /dev/null +++ luaL_newmetatable.3.html @@ -0,0 +1,54 @@ + + + + + + LUAL_NEWMETATABLE(3) + + + + + + + + +
LUAL_NEWMETATABLE(3)Library Functions ManualLUAL_NEWMETATABLE(3)
+
+

+luaL_newmetatable — +
creates a new table to be used as a metatable for + userdata
+

+#include + <lauxlib.h> +
+int +
+luaL_newmetatable(lua_State + *L, const char + *tname); +

+luaL_newmetatable() If the registry already + has the key tname, returns 0. Otherwise, + creates a new table to be used as a metatable for userdata, adds it to the + registry with key tname, and returns 1. +
+In both cases pushes onto the stack the final value associated with + tname in the registry. +

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

+The luaL_newmetatable() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 26, 2022Debian
+ + blob - /dev/null blob + 04a3b3c9937587cb228bef85d67176283795616c (mode 644) --- /dev/null +++ luaL_newstate.3 @@ -0,0 +1,38 @@ +.Dd $Mdocdate: July 26 2022 $ +.Dt LUAL_NEWSTATE 3 +.Os +.Sh NAME +.Nm luaL_newstate +.Nd creates a new Lua state +.Sh SYNOPSIS +.In lauxlib.h +.Ft lua_State * +.Fn luaL_newstate "void" +.Sh DESCRIPTION +.Fn luaL_newstate +creates a new Lua state. +It calls +.Xr lua_newstate 3 +with an allocator based on the standard C +.Xr realloc 3 +function and then sets a panic function +.Pq see Xr lua_atpanic 3 +that prints an error message to the standard error output in case of fatal +errors. +.Sh RETURN VALUES +Returns the new state, or +.Dv NULL +if there is a memory allocation error. +.Sh SEE ALSO +.Xr lua_atpanic 3 , +.Xr lua_newstate 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_newstate +manual page was written by Sergey Bronnikov. blob - /dev/null blob + d021b123d47aa73b39cec690bb6a8b4fac138fc7 (mode 644) --- /dev/null +++ luaL_newstate.3.html @@ -0,0 +1,56 @@ + + + + + + LUAL_NEWSTATE(3) + + + + + + + + +
LUAL_NEWSTATE(3)Library Functions ManualLUAL_NEWSTATE(3)
+
+

+luaL_newstate — +
creates a new Lua state
+

+#include + <lauxlib.h> +
+lua_State * +
+luaL_newstate(void); +

+luaL_newstate() creates a new Lua state. It + calls lua_newstate(3) with an allocator based on + the standard C realloc(3) function and then sets + a panic function (see lua_atpanic(3)) that prints + an error message to the standard error output in case of fatal errors. +

+Returns the new state, or NULL if there is a + memory allocation error. +

+lua_atpanic(3), + lua_newstate(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_newstate() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 26, 2022Debian
+ + blob - /dev/null blob + 1704cc31862ac1d8fbacfa41f77b98e144a47727 (mode 644) --- /dev/null +++ luaL_openlibs.3 @@ -0,0 +1,24 @@ +.Dd $Mdocdate: July 26 2022 $ +.Dt LUAL_OPENLIBS 3 +.Os +.Sh NAME +.Nm luaL_openlibs +.Nd opens all standard Lua libraries into the given state +.Sh SYNOPSIS +.In lauxlib.h +.Ft void +.Fn luaL_openlibs "lua_State *L" +.Sh DESCRIPTION +.Fn luaL_openlibs +opens all standard Lua libraries into the given state. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_openlibs +manual page was written by Sergey Bronnikov. blob - /dev/null blob + c75d950bcbe09c73880399ae65819a8148484229 (mode 644) --- /dev/null +++ luaL_openlibs.3.html @@ -0,0 +1,48 @@ + + + + + + LUAL_OPENLIBS(3) + + + + + + + + +
LUAL_OPENLIBS(3)Library Functions ManualLUAL_OPENLIBS(3)
+
+

+luaL_openlibs — +
opens all standard Lua libraries into the given + state
+

+#include + <lauxlib.h> +
+void +
+luaL_openlibs(lua_State + *L); +

+luaL_openlibs() opens all standard Lua + libraries into the given state. +

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

+The luaL_openlibs() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 26, 2022Debian
+ + blob - /dev/null blob + 7c1e60aeb970394fb04aad723c05e2e6f3a90b86 (mode 644) --- /dev/null +++ luaL_optint.3 @@ -0,0 +1,31 @@ +.Dd $Mdocdate: July 26 2022 $ +.Dt LUAL_OPTINT 3 +.Os +.Sh NAME +.Nm luaL_optint +.Nd casts a number to an int +.Sh SYNOPSIS +.In lauxlib.h +.Ft int +.Fn luaL_optint "lua_State *L" "int narg" "int d" +.Sh DESCRIPTION +.Fn luaL_optint +if the function argument +.Fa narg +is a number, returns this number cast to an int. +If this argument is absent or is +.Dv nil , +returns +.Fa d . +Otherwise, raises an error. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_optint +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 433deec1cff8a1f7571102a7d2a84557cf89f5f1 (mode 644) --- /dev/null +++ luaL_optint.3.html @@ -0,0 +1,52 @@ + + + + + + LUAL_OPTINT(3) + + + + + + + + +
LUAL_OPTINT(3)Library Functions ManualLUAL_OPTINT(3)
+
+

+luaL_optint — +
casts a number to an int
+

+#include + <lauxlib.h> +
+int +
+luaL_optint(lua_State + *L, int + narg, int + d); +

+luaL_optint() if the function argument + narg is a number, returns this number cast to + an int. If this argument is absent or is + nil, returns + d. Otherwise, raises an error. +

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

+The luaL_optint() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 26, 2022Debian
+ + blob - /dev/null blob + 483cedaf7adfbea6b1f47f8ba73c6f768c2f478d (mode 644) --- /dev/null +++ luaL_optinteger.3 @@ -0,0 +1,33 @@ +.Dd $Mdocdate: July 26 2022 $ +.Dt LUAL_OPTINTEGER 3 +.Os +.Sh NAME +.Nm luaL_optinteger +.Nd casts a number to a lua_Integer +.Sh SYNOPSIS +.In lauxlib.h +.Ft lua_Integer +.Fn luaL_optinteger "lua_State *L" "int narg" "lua_Integer d" +.Sh DESCRIPTION +.Fn luaL_optinteger +if the function argument +.Fa narg +is a number, returns this number cast to a +.Xr lua_Integer 3 . +If this argument is absent or is +.Dv nil , +returns +.Fa d . +Otherwise, raises an error. +.Sh SEE ALSO +.Xr lua_Integer 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_optinteger +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 3b643c6fa2dc966ae6bef82c7040941236c95f52 (mode 644) --- /dev/null +++ luaL_optinteger.3.html @@ -0,0 +1,54 @@ + + + + + + LUAL_OPTINTEGER(3) + + + + + + + + +
LUAL_OPTINTEGER(3)Library Functions ManualLUAL_OPTINTEGER(3)
+
+

+luaL_optinteger — +
casts a number to a lua_Integer
+

+#include + <lauxlib.h> +
+lua_Integer +
+luaL_optinteger(lua_State + *L, int + narg, + lua_Integer d); +

+luaL_optinteger() if the function argument + narg is a number, returns this number cast to + a lua_Integer(3). If this argument is absent or + is nil, returns + d. Otherwise, raises an error. +

+lua_Integer(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_optinteger() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 26, 2022Debian
+ + blob - /dev/null blob + 9b21ea94bd1d19a5962f05af1de252b84fee97da (mode 644) --- /dev/null +++ luaL_optlong.3 @@ -0,0 +1,29 @@ +.Dd $Mdocdate: July 26 2022 $ +.Dt LUAL_OPTLONG 3 +.Os +.Sh NAME +.Nm luaL_optlong +.Nd casts a number to a long +.Sh SYNOPSIS +.In lauxlib.h +.Ft long +.Fn luaL_optlong "lua_State *L" "int narg" "long d" +.Sh DESCRIPTION +.Fn luaL_optlong +if the function argument narg is a number, returns this number cast to a long. +If this argument is absent or is +.Dv nil , +returns +.Fa d . +Otherwise, raises an error. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_optlong +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 10e72f55bd20fec4c0c443a1839041a4b1832998 (mode 644) --- /dev/null +++ luaL_optlong.3.html @@ -0,0 +1,51 @@ + + + + + + LUAL_OPTLONG(3) + + + + + + + + +
LUAL_OPTLONG(3)Library Functions ManualLUAL_OPTLONG(3)
+
+

+luaL_optlong — +
casts a number to a long
+

+#include + <lauxlib.h> +
+long +
+luaL_optlong(lua_State + *L, int + narg, long + d); +

+luaL_optlong() if the function argument narg + is a number, returns this number cast to a long. If this argument is absent or + is nil, returns + d. Otherwise, raises an error. +

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

+The luaL_optlong() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 26, 2022Debian
+ + blob - /dev/null blob + b997fc0b2c84a399571b89acff33665f562097a8 (mode 644) --- /dev/null +++ luaL_optlstring.3 @@ -0,0 +1,39 @@ +.Dd $Mdocdate: July 26 2022 $ +.Dt LUAL_OPTLSTRING 3 +.Os +.Sh NAME +.Nm luaL_optlstring +.Nd if the function argument is a string, returns this string +.Sh SYNOPSIS +.In lauxlib.h +.Ft const char * +.Fn luaL_optlstring "lua_State *L" "int narg" "const char *d" "size_t *l" +.Sh DESCRIPTION +.Fn luaL_optlstring +if the function argument +.Fa narg +is a string, returns this string. +If this argument is absent or is +.Dv nil , +returns +.Fa d . +Otherwise, raises an error. +.Pp +If +.Fa l +is not +.Dv NULL , +fills the position +.Fa *l +with the results's length. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_optlstring +manual page was written by Sergey Bronnikov. blob - /dev/null blob + fd83acff3ecf054cceecc278b203bd4f92e738a5 (mode 644) --- /dev/null +++ luaL_optlstring.3.html @@ -0,0 +1,57 @@ + + + + + + LUAL_OPTLSTRING(3) + + + + + + + + +
LUAL_OPTLSTRING(3)Library Functions ManualLUAL_OPTLSTRING(3)
+
+

+luaL_optlstring — +
if the function argument is a string, returns this + string
+

+#include + <lauxlib.h> +
+const char * +
+luaL_optlstring(lua_State + *L, int + narg, const char + *d, size_t + *l); +

+luaL_optlstring() if the function argument + narg is a string, returns this string. If + this argument is absent or is nil, returns + d. Otherwise, raises an error. +
+If l is not + NULL, fills the position + *l with the results's length. +

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

+The luaL_optlstring() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 26, 2022Debian
+ + blob - /dev/null blob + 1842cb75421391d1bd018fef7e5d8f251791de94 (mode 644) --- /dev/null +++ luaL_optnumber.3 @@ -0,0 +1,31 @@ +.Dd $Mdocdate: July 26 2022 $ +.Dt LUAL_OPTNUMBER 3 +.Os +.Sh NAME +.Nm luaL_optnumber +.Nd if the function argument is a number, returns this number +.Sh SYNOPSIS +.In lauxlib.h +.Ft lua_Number +.Fn luaL_optnumber "lua_State *L" "int narg" "lua_Number d" +.Sh DESCRIPTION +.Fn luaL_optnumber +if the function argument +.Fa narg +is a number, returns this number. +If this argument is absent or is +.Dv nil , +returns +.Fa d . +Otherwise, raises an error. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_optnumber +manual page was written by Sergey Bronnikov. blob - /dev/null blob + c53c102671e5610484e6002e94f05e401aa5ad7f (mode 644) --- /dev/null +++ luaL_optnumber.3.html @@ -0,0 +1,52 @@ + + + + + + LUAL_OPTNUMBER(3) + + + + + + + + +
LUAL_OPTNUMBER(3)Library Functions ManualLUAL_OPTNUMBER(3)
+
+

+luaL_optnumber — +
if the function argument is a number, returns this + number
+

+#include + <lauxlib.h> +
+lua_Number +
+luaL_optnumber(lua_State + *L, int + narg, lua_Number + d); +

+luaL_optnumber() if the function argument + narg is a number, returns this number. If + this argument is absent or is nil, returns + d. Otherwise, raises an error. +

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

+The luaL_optnumber() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 26, 2022Debian
+ + blob - /dev/null blob + 6b77d185adf263527ad5c5222e722accf29960d6 (mode 644) --- /dev/null +++ luaL_optstring.3 @@ -0,0 +1,31 @@ +.Dd $Mdocdate: July 26 2022 $ +.Dt LUAL_OPTSTRING 3 +.Os +.Sh NAME +.Nm luaL_optstring +.Nd if the function argument is a string, returns this string +.Sh SYNOPSIS +.In lauxlib.h +.Ft const char * +.Fn luaL_optstring "lua_State *L" "int narg" "const char *d" +.Sh DESCRIPTION +.Fn luaL_optstring +if the function argument +.Fa narg +is a string, returns this string. +If this argument is absent or is +.Dv nil , +returns +.Fa d . +Otherwise, raises an error. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_optstring +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 09066d0388e2f4bd654a87ad1fd8b008d3862e56 (mode 644) --- /dev/null +++ luaL_optstring.3.html @@ -0,0 +1,52 @@ + + + + + + LUAL_OPTSTRING(3) + + + + + + + + +
LUAL_OPTSTRING(3)Library Functions ManualLUAL_OPTSTRING(3)
+
+

+luaL_optstring — +
if the function argument is a string, returns this + string
+

+#include + <lauxlib.h> +
+const char * +
+luaL_optstring(lua_State + *L, int + narg, const char + *d); +

+luaL_optstring() if the function argument + narg is a string, returns this string. If + this argument is absent or is nil, returns + d. Otherwise, raises an error. +

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

+The luaL_optstring() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 26, 2022Debian
+ + blob - /dev/null blob + 869dbeb92516ab51cc1ef574e0f0792ea1e109b8 (mode 644) --- /dev/null +++ luaL_prepbuffer.3 @@ -0,0 +1,34 @@ +.Dd $Mdocdate: July 26 2022 $ +.Dt LUAL_PREPBUFFER 3 +.Os +.Sh NAME +.Nm luaL_prepbuffer +.Nd prepares a buffer luaL_Buffer +.Sh SYNOPSIS +.In lauxlib.h +.Ft char * +.Fn luaL_prepbuffer "luaL_Buffer *B" +.Sh DESCRIPTION +.Fn luaL_prepbuffer +returns an address to a space of size +.Dv LUAL_BUFFERSIZE +where you can copy a +string to be added to buffer +.Fa B +.Pq see Xr luaL_Buffer 3 . +After copying the string into this space you must call +.Xr luaL_addsize 3 +with the size of the string to actually add it to the buffer. +.Sh SEE ALSO +.Xr luaL_addsize 3 , +.Xr luaL_Buffer 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_prepbuffer +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 8797209914daf88e6d3cb592f8779ec70bab490d (mode 644) --- /dev/null +++ luaL_prepbuffer.3.html @@ -0,0 +1,54 @@ + + + + + + LUAL_PREPBUFFER(3) + + + + + + + + +
LUAL_PREPBUFFER(3)Library Functions ManualLUAL_PREPBUFFER(3)
+
+

+luaL_prepbuffer — +
prepares a buffer luaL_Buffer
+

+#include + <lauxlib.h> +
+char * +
+luaL_prepbuffer(luaL_Buffer + *B); +

+luaL_prepbuffer() returns an address to a + space of size LUAL_BUFFERSIZE where you can + copy a string to be added to buffer B (see + luaL_Buffer(3)). After copying the string into + this space you must call luaL_addsize(3) with the + size of the string to actually add it to the buffer. +

+luaL_addsize(3), + luaL_Buffer(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_prepbuffer() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 26, 2022Debian
+ + blob - /dev/null blob + e656ecf49c77a5b394ebbd8a4e5a96615d0610a7 (mode 644) --- /dev/null +++ luaL_pushresult.3 @@ -0,0 +1,26 @@ +.Dd $Mdocdate: July 22 2022 $ +.Dt LUAL_PUSHRESULT 3 +.Os +.Sh NAME +.Nm luaL_pushresult +.Nd finishes the use of buffer +.Sh SYNOPSIS +.In luaxlib.h +.Ft void +.Fn luaL_pushresult "luaL_Buffer *B" +.Sh DESCRIPTION +.Fn luaL_pushresult +finishes the use of buffer +.Fa B +leaving the final string on the top of the stack. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_pushresult +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 7e05c4ce22483694ea54543b2cc236ea375a6091 (mode 644) --- /dev/null +++ luaL_pushresult.3.html @@ -0,0 +1,48 @@ + + + + + + LUAL_PUSHRESULT(3) + + + + + + + + +
LUAL_PUSHRESULT(3)Library Functions ManualLUAL_PUSHRESULT(3)
+
+

+luaL_pushresult — +
finishes the use of buffer
+

+#include + <luaxlib.h> +
+void +
+luaL_pushresult(luaL_Buffer + *B); +

+luaL_pushresult() finishes the use of buffer + B leaving the final string on the top of the + stack. +

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

+The luaL_pushresult() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 22, 2022Debian
+ + blob - /dev/null blob + c87a17a20bf74d82738832058953584c9b2e983e (mode 644) --- /dev/null +++ luaL_ref.3 @@ -0,0 +1,50 @@ +.Dd $Mdocdate: July 21 2022 $ +.Dt LUAL_REF 3 +.Os +.Sh NAME +.Nm luaL_ref +.Nd creates and returns a reference for the object at the top of the stack and +pops the object +.Sh SYNOPSIS +.In lauxlib.h +.Ft int +.Fn luaL_ref "lua_State *L" "int t" +.Sh DESCRIPTION +.Fn luaL_ref +creates and returns a +.Em reference , +in the table at index +.Fa t , +for the object at the top of the stack (and pops the object). +.Pp +A reference is a unique integer key. +As long as you do not manually add integer keys into table +.Fa t , +.Nm luaL_ref +ensures the uniqueness of the key it returns. +You can retrieve an object referred by reference r by calling +.Em lua_rawgeti(L, t, r) . +Function +.Xr luaL_unref 3 +frees a reference and its associated object. +.Sh RETURN VALUES +If the object at the top of the stack is +.Dv nil , +.Nm luaL_ref returns the constant +.Dv LUA_REFNIL . +The constant +.Dv LUA_NOREF +is guaranteed to be different from any reference returned by +.Nm luaL_ref . +.Sh SEE ALSO +.Xr luaL_unref 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_ref +manual page was written by Sergey Bronnikov. blob - /dev/null blob + cc9d1c81f82d13ac07ce0716097ca677aa583f70 (mode 644) --- /dev/null +++ luaL_ref.3.html @@ -0,0 +1,68 @@ + + + + + + LUAL_REF(3) + + + + + + + + +
LUAL_REF(3)Library Functions ManualLUAL_REF(3)
+
+

+luaL_ref — +
creates and returns a reference for the object at the + top of the stack and pops the object
+

+#include + <lauxlib.h> +
+int +
+luaL_ref(lua_State + *L, int + t); +

+luaL_ref() creates and returns a + reference, in the table at index + t, for the object at the top of the stack + (and pops the object). +
+A reference is a unique integer key. As long as you do not manually add integer + keys into table t, + luaL_ref ensures the uniqueness of the key + it returns. You can retrieve an object referred by reference r by calling + lua_rawgeti(L, t, r). Function + luaL_unref(3) frees a reference and its + associated object. +

+If the object at the top of the stack is nil, + luaL_ref returns the constant + LUA_REFNIL. The constant + LUA_NOREF is guaranteed to be different + from any reference returned by luaL_ref. +

+luaL_unref(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_ref() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 21, 2022Debian
+ + blob - /dev/null blob + a9f1855b08c8bd5c5144e5c7d21ab96c2ea56ad5 (mode 644) --- /dev/null +++ luaL_register.3 @@ -0,0 +1,52 @@ +.Dd $Mdocdate: July 21 2022 $ +.Dt LUAL_REGISTER 3 +.Os +.Sh NAME +.Nm luaL_register +.Nd opens a library +.Sh SYNOPSIS +.In lauxlib.h +.Ft void +.Fn luaL_register "lua_State *L" "const char *libname" "const luaL_Reg *l" +.Sh DESCRIPTION +.Fn luaL_register +opens a library. +.Pp +When called with +.Fa libname +equal to +.Dv NULL , +it simply registers all functions in +the list +.Fa l +.Pq see Xr luaL_Reg 3 +into the table on the top of the stack. +.Pp +When called with a non-null +.Fa libname , +.Nm luaL_register 3 +creates a new table t, sets it as the value of the global variable +.Fa libname , +sets it as the value of +.Em package.loaded[libname] , +and registers on it all functions in the list +.Fa l . +If there is a table in +.Em package.loaded[libname] +or in variable +.Fa libname , +reuses this table instead of creating a new one. +.Pp +In any case the function leaves the table on the top of the stack. +.Sh SEE ALSO +.Xr luaL_Reg 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_register +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 0cfeb40650ac5c4d773155cf924033dcd8900c12 (mode 644) --- /dev/null +++ luaL_register.3.html @@ -0,0 +1,68 @@ + + + + + + LUAL_REGISTER(3) + + + + + + + + +
LUAL_REGISTER(3)Library Functions ManualLUAL_REGISTER(3)
+
+

+luaL_register — +
opens a library
+

+#include + <lauxlib.h> +
+void +
+luaL_register(lua_State + *L, const char + *libname, const + luaL_Reg *l); +

+luaL_register() opens a library. +
+When called with libname equal to + NULL, it simply registers all functions in + the list l (see + luaL_Reg(3)) into the table on the top of the + stack. +
+When called with a non-null libname, + luaL_register 3 creates a new table t, sets + it as the value of the global variable + libname, sets it as the value of + package.loaded[libname], and registers on it all + functions in the list l. If there is a table + in package.loaded[libname] or in variable + libname, reuses this table instead of + creating a new one. +
+In any case the function leaves the table on the top of the stack. +

+luaL_Reg(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_register() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 21, 2022Debian
+ + blob - /dev/null blob + de478df7dba5bd65c0441e57fbe1d50d1901b082 (mode 644) --- /dev/null +++ luaL_typename.3 @@ -0,0 +1,24 @@ +.Dd $Mdocdate: July 21 2022 $ +.Dt LUAL_TYPENAME 3 +.Os +.Sh NAME +.Nm luaL_typename +.Nd returns the name of the type of the value +.Sh SYNOPSIS +.In lauxlib.h +.Ft const char * +.Fn luaL_typename "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn luaL_typename +returns the name of the type of the value at the given index. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_typename +manual page was written by Sergey Bronnikov. blob - /dev/null blob + a1a68528e6fb2f377b51003ed8bdc3caacf09a77 (mode 644) --- /dev/null +++ luaL_typename.3.html @@ -0,0 +1,48 @@ + + + + + + LUAL_TYPENAME(3) + + + + + + + + +
LUAL_TYPENAME(3)Library Functions ManualLUAL_TYPENAME(3)
+
+

+luaL_typename — +
returns the name of the type of the value
+

+#include + <lauxlib.h> +
+const char * +
+luaL_typename(lua_State + *L, int + index); +

+luaL_typename() returns the name of the type + of the value at the given index. +

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

+The luaL_typename() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 21, 2022Debian
+ + blob - /dev/null blob + 03567dc44aa7e286c63dcd85b835e689da128386 (mode 644) --- /dev/null +++ luaL_typerror.3 @@ -0,0 +1,38 @@ +.Dd $Mdocdate: July 21 2022 $ +.Dt LUAL_TYPERROR 3 +.Os +.Sh NAME +.Nm luaL_typerror +.Nd generates an error with a message +.Sh SYNOPSIS +.In lauxlib.h +.Ft int +.Fn luaL_typerror "lua_State *L" "int narg" "const char *tname" +.Sh DESCRIPTION +.Fn luaL_typerror +generates an error with a message like the following: +.Pp +.Em location : +bad argument +.Fa narg to +.Em 'func' +( +.Fa tname +expected, got rt) +.Pp +where location is produced by +.Xr luaL_where 3 , +func is the name of the current function, and rt is the type name of the actual +argument. +.Sh SEE ALSO +.Xr luaL_where 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_typerror +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 8a9caf75d55a589df4e4131e53da4bed88bd9175 (mode 644) --- /dev/null +++ luaL_typerror.3.html @@ -0,0 +1,59 @@ + + + + + + LUAL_TYPERROR(3) + + + + + + + + +
LUAL_TYPERROR(3)Library Functions ManualLUAL_TYPERROR(3)
+
+

+luaL_typerror — +
generates an error with a message
+

+#include + <lauxlib.h> +
+int +
+luaL_typerror(lua_State + *L, int + narg, const char + *tname); +

+luaL_typerror() generates an error with a + message like the following: +
+location: bad argument + narg to 'func' ( + tname expected, got rt) +
+where location is produced by luaL_where(3), func + is the name of the current function, and rt is the type name of the actual + argument. +

+luaL_where(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_typerror() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 21, 2022Debian
+ + blob - /dev/null blob + 796985f0656070f0138edbcefd7265172d88364e (mode 644) --- /dev/null +++ luaL_unref.3 @@ -0,0 +1,39 @@ +.Dd $Mdocdate: July 21 2022 $ +.Dt LUAL_UNREF 3 +.Os +.Sh NAME +.Nm luaL_unref +.Nd releases reference from the table +.Sh SYNOPSIS +.In lauxlib.h +.Ft void +.Fn luaL_unref "lua_State *L" "int t" "int ref" +.Sh DESCRIPTION +.Fn luaL_unref +releases reference +.Fa ref +from the table at index +.Fa t +.Pq see Xr luaL_ref 3 . +The entry is removed from the table, so that the referred object can be +collected. +The reference ref is also freed to be used again. +.Pp +If ref is +.Dv LUA_NOREF +or +.Dv LUA_REFNIL , +.Nm luaL_unref +does nothing. +.Sh SEE ALSO +.Xr luaL_ref 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_unref +manual page was written by Sergey Bronnikov. blob - /dev/null blob + bc91cf9dc651279629d1fc66a926548599a140ad (mode 644) --- /dev/null +++ luaL_unref.3.html @@ -0,0 +1,58 @@ + + + + + + LUAL_UNREF(3) + + + + + + + + +
LUAL_UNREF(3)Library Functions ManualLUAL_UNREF(3)
+
+

+luaL_unref — +
releases reference from the table
+

+#include + <lauxlib.h> +
+void +
+luaL_unref(lua_State + *L, int t, + int ref); +

+luaL_unref() releases reference + ref from the table at index + t (see + luaL_ref(3)). The entry is removed from the + table, so that the referred object can be collected. The reference ref is also + freed to be used again. +
+If ref is LUA_NOREF or + LUA_REFNIL, + luaL_unref does nothing. +

+luaL_ref(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_unref() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 21, 2022Debian
+ + blob - /dev/null blob + 7a268acae8672ce544f0c19ec325d3e66ce20a2f (mode 644) --- /dev/null +++ luaL_where.3 @@ -0,0 +1,36 @@ +.Dd $Mdocdate: July 21 2022 $ +.Dt LUAL_WHERE 3 +.Os +.Sh NAME +.Nm luaL_where +.Nd pushes onto the stack a string identifying the current position of the +control +.Sh SYNOPSIS +.In lauxlib.h +.Ft void +.Fn luaL_where "lua_State *L" "int lvl" +.Sh DESCRIPTION +.Fn luaL_where +pushes onto the stack a string identifying the current position of the control +at level +.Fa lvl +in the call stack. +Typically this string has the following format: +.Pp +.Em chunkname:currentline : +.Pp +Level 0 is the running function, level 1 is the function that called the +running function, etc. +.Pp +This function is used to build a prefix for error messages. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_where +manual page was written by Sergey Bronnikov. blob - /dev/null blob + a1f7a9b11e38dd9714177983d379ba7fa9452740 (mode 644) --- /dev/null +++ luaL_where.3.html @@ -0,0 +1,58 @@ + + + + + + LUAL_WHERE(3) + + + + + + + + +
LUAL_WHERE(3)Library Functions ManualLUAL_WHERE(3)
+
+

+luaL_where — +
pushes onto the stack a string identifying the + current position of the control
+

+#include + <lauxlib.h> +
+void +
+luaL_where(lua_State + *L, int + lvl); +

+luaL_where() pushes onto the stack a string + identifying the current position of the control at level + lvl in the call stack. Typically this string + has the following format: +
+chunkname:currentline: +
+Level 0 is the running function, level 1 is the function that called the running + function, etc. +
+This function is used to build a prefix for error messages. +

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

+The luaL_where() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 21, 2022Debian
+ + blob - /dev/null blob + 13933cd6a10d047b432ef590346d3871c064d624 (mode 644) --- /dev/null +++ lua_Alloc.3 @@ -0,0 +1,99 @@ +.Dd $Mdocdate: July 13 2022 $ +.Dt LUA_ALLOC 3 +.Os +.Sh NAME +.Nm lua_Alloc +.Nd the type of the memory-allocation function used by Lua states +.Sh SYNOPSIS +.In lua.h +.Ft typedef void * +.Fn (*lua_Alloc) "void *ud" "void *ptr" "size_t osize" "size_t nsize" +.Sh DESCRIPTION +The type of the memory-allocation function used by Lua states. +The allocator function must provide a functionality similar to +.Xr realloc 3 , +but not exactly the same. +Its arguments are +.Fa ud , +an opaque pointer passed to +.Xr lua_newstate 3 ; +.Fa ptr , +a pointer to the block being allocated/reallocated/freed; +.Fa osize , +the original size of the block; +.Fa nsize , +the new size of the block. +.Fa ptr +is +.Dv NULL +if and only if +.Fa osize +is zero. +When +.Fa nsize +is not zero and +.Fa osize +is zero, the allocator should behave like +.Xr malloc 3 . +When +.Fa nsize +and +.Fa osize +are not zero, the allocator behaves like +.Xr realloc 3 . +Lua assumes that the allocator never fails when +.Fa osize +>= +.Fa nsize . +.Pp +Here is a simple implementation for the allocator function. +It is used in the auxiliary library by +.Xr luaL_newstate 3 . +.Pp +.Bd -literal -offset indent -compact +static void *l_alloc (void *ud, void *ptr, size_t osize, + size_t nsize) { + (void)ud; (void)osize; /* not used */ + if (nsize == 0) { + free(ptr); + return NULL; + } + else + return realloc(ptr, nsize); +} +.Ed +.Pp +This code assumes that +.Em free(NULL) +has no effect and that +.Em realloc(NULL, size) +is equivalent to +.Em malloc(size) . +ANSI C ensures both behaviors. +.Sh RETURN VALUES +When +.Fa nsize +is zero, the allocator must return +.Dv NULL ; +if +.Fa osize +is not zero, it should free the block pointed to by +.Fa ptr . +When +.Fa nsize +is not zero, the allocator returns +.Dv NULL +if and only if it cannot fill the request. +.Sh SEE ALSO +.Xr lua_newstate 3 , +.Xr luaL_newstate 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_Alloc +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 84d85ebb5fb7b598d80afe44ddd879e4fc4189a1 (mode 644) --- /dev/null +++ lua_Alloc.3.html @@ -0,0 +1,102 @@ + + + + + + LUA_ALLOC(3) + + + + + + + + +
LUA_ALLOC(3)Library Functions ManualLUA_ALLOC(3)
+
+

+lua_Alloc — +
the type of the memory-allocation function used by + Lua states
+

+#include + <lua.h> +
+typedef void * +
+(*lua_Alloc)(void + *ud, void + *ptr, size_t + osize, size_t + nsize); +

+The type of the memory-allocation function used by Lua states. The allocator + function must provide a functionality similar to + realloc(3), but not exactly the same. Its + arguments are ud, an opaque pointer passed to + lua_newstate(3); + ptr, a pointer to the block being + allocated/reallocated/freed; osize, the + original size of the block; nsize, the new + size of the block. ptr is + NULL if and only if + osize is zero. When + nsize is not zero and + osize is zero, the allocator should behave + like malloc(3). When + nsize and + osize are not zero, the allocator behaves + like realloc(3). Lua assumes that the allocator + never fails when osize >= + nsize. +
+Here is a simple implementation for the allocator function. It is used in the + auxiliary library by luaL_newstate(3). +
+
+
+static void *l_alloc (void *ud, void *ptr, size_t osize, 
+                                           size_t nsize) { 
+  (void)ud;  (void)osize;  /* not used */ 
+  if (nsize == 0) { 
+    free(ptr); 
+    return NULL; 
+  } 
+  else 
+    return realloc(ptr, nsize); 
+}
+
+
+
+This code assumes that free(NULL) has no effect and + that realloc(NULL, size) is equivalent to + malloc(size). ANSI C ensures both behaviors. +

+When nsize is zero, the allocator must return + NULL; if + osize is not zero, it should free the block + pointed to by ptr. When + nsize is not zero, the allocator returns + NULL if and only if it cannot fill the + request. +

+lua_newstate(3), + luaL_newstate(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_Alloc() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 13, 2022Debian
+ + blob - /dev/null blob + caf0e76a893df3d52ca1d9e356e93977d1da9530 (mode 644) --- /dev/null +++ lua_CFunction.3 @@ -0,0 +1,62 @@ +.Dd $Mdocdate: July 19 2022 $ +.Dt LUA_CFUNCTION 3 +.Os +.Sh NAME +.Nm lua_CFunction +.Nd type for C functions +.Sh SYNOPSIS +.In lua.h +.Ft typedef int * +.Fn lua_CFunction "lua_State *L" +.Sh DESCRIPTION +.Fn lua_CFunction +type for C functions. +.Pp +In order to communicate properly with Lua, a C function must use the following +protocol, which defines the way parameters and results are passed: a C function +receives its arguments from Lua in its stack in direct order +.Pq the first argument is pushed first . +So, when the function starts, lua_gettop(L) returns the number of arguments +received by the function. +The first argument +.Pq if any +is at index 1 and its last argument is at index lua_gettop(L). +To return values to Lua, a C function just pushes them onto the stack, in +direct order +.Pq the first result is pushed first , +and returns the number of results. +Any other value in the stack below the results will be properly discarded by +Lua. +Like a Lua function, a C function called by Lua can also return many results. +.Pp +As an example, the following function receives a variable number of numerical +arguments and returns their average and sum: +.Pp +.Bd -literal -offset indent -compact +static int foo (lua_State *L) { + int n = lua_gettop(L); /* number of arguments */ + lua_Number sum = 0; + int i; + for (i = 1; i <= n; i++) { + if (!lua_isnumber(L, i)) { + lua_pushstring(L, "incorrect argument"); + lua_error(L); + } + sum += lua_tonumber(L, i); + } + lua_pushnumber(L, sum/n); /* first result */ + lua_pushnumber(L, sum); /* second result */ + return 2; /* number of results */ +} +.Ed +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_CFunction +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 9edbe15877c63edb87e71d02d730f0bf04fcfc2c (mode 644) --- /dev/null +++ lua_CFunction.3.html @@ -0,0 +1,81 @@ + + + + + + LUA_CFUNCTION(3) + + + + + + + + +
LUA_CFUNCTION(3)Library Functions ManualLUA_CFUNCTION(3)
+
+

+lua_CFunction — +
type for C functions
+

+#include + <lua.h> +
+typedef int * +
+lua_CFunction(lua_State + *L); +

+lua_CFunction() type for C functions. +
+In order to communicate properly with Lua, a C function must use the following + protocol, which defines the way parameters and results are passed: a C + function receives its arguments from Lua in its stack in direct order (the + first argument is pushed first). So, when the function starts, lua_gettop(L) + returns the number of arguments received by the function. The first argument + (if any) is at index 1 and its last argument is at index lua_gettop(L). To + return values to Lua, a C function just pushes them onto the stack, in direct + order (the first result is pushed first), and returns the number of results. + Any other value in the stack below the results will be properly discarded by + Lua. Like a Lua function, a C function called by Lua can also return many + results. +
+As an example, the following function receives a variable number of numerical + arguments and returns their average and sum: +
+
+
+static int foo (lua_State *L) { 
+  int n = lua_gettop(L);    /* number of arguments */ 
+  lua_Number sum = 0; 
+  int i; 
+  for (i = 1; i <= n; i++) { 
+    if (!lua_isnumber(L, i)) { 
+      lua_pushstring(L, "incorrect argument"); 
+      lua_error(L); 
+    } 
+    sum += lua_tonumber(L, i); 
+  } 
+  lua_pushnumber(L, sum/n);        /* first result */ 
+  lua_pushnumber(L, sum);         /* second result */ 
+  return 2;                   /* number of results */ 
+}
+
+
+

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

+The lua_CFunction() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 19, 2022Debian
+ + blob - /dev/null blob + c946f6c2ea20475293d64773d7ce4b40f499f4be (mode 644) --- /dev/null +++ lua_Debug.3 @@ -0,0 +1,94 @@ +.Dd $Mdocdate: July 19 2022 $ +.Dt LUA_DEBUG 3 +.Os +.Sh NAME +.Nm lua_Debug +.Nd structure used to carry different pieces of information about an active +function +.Sh SYNOPSIS +.In lua.h +.Vt typedef struct lua_Debug ; +.Sh DESCRIPTION +.Fn lua_Debug +a structure used to carry different pieces of information about an active +function. +.Xr lua_getstack 3 +fills only the private part of this structure, for later use. +To fill the other fields of +.Nm lua_Debug +with useful information, call +.Xr lua_getinfo 3 . +.Pp +.Vt lua_Debug +is defined as: +.Bd -literal +typedef struct lua_Debug { + int event; + const char *name; /* (n) */ + const char *namewhat; /* (n) */ + const char *what; /* (S) */ + const char *source; /* (S) */ + int currentline; /* (l) */ + int nups; /* (u) number of upvalues */ + int linedefined; /* (S) */ + int lastlinedefined; /* (S) */ + char short_src[LUA_IDSIZE]; /* (S) */ + /* private part */ + other fields +} lua_Debug; +.Ed +.Pp +The fields of +.Nm lua_Debug +have the following meaning: +.Pp +.Bl -tag -width lastlinedefined: -offset indent -compact +.It Sy source : +If the function was defined in a string, then source is that string. +If the function was defined in a file, then source starts with a '@' followed +by the file name. +.It Sy short_src : +a "printable" version of source, to be used in error messages. +.It Sy linedefined : +the line number where the definition of the function starts. +.It Sy lastlinedefined : +the line number where the definition of the function ends. +.It Sy what : +the string "Lua" if the function is a Lua function, "C" if it is a C function, +"main" if it is the main part of a chunk, and "tail" if it was a function that +did a tail call. +In the latter case, Lua has no other information about the function. +.It Sy currentline : +the current line where the given function is executing. +When no line information is available, currentline is set to -1. +.It Sy name : +a reasonable name for the given function. +Because functions in Lua are first-class values, they do not have a fixed name: +some functions can be the value of multiple global variables, while others can +be stored only in a table field. +The +.Xr lua_getinfo 3 +function checks how the function was called to find a suitable name. +If it cannot find a name, then name is set to +.Dv NULL . +.It Sy namewhat : +explains the name field. +The value of namewhat can be "global", "local", "method", "field", "upvalue", +or "" (the empty string), according to how the function was called. (Lua uses +the empty string when no other option seems to apply.) +.It Sy nups : +the number of upvalues of the function. +.El +.Sh SEE ALSO +.Xr lua_getinfo 3 , +.Xr lua_getstack 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_Debug +manual page was written by Sergey Bronnikov. blob - /dev/null blob + c6a92d9ace16e3474fb79a313faf7eb71259b166 (mode 644) --- /dev/null +++ lua_Debug.3.html @@ -0,0 +1,117 @@ + + + + + + LUA_DEBUG(3) + + + + + + + + +
LUA_DEBUG(3)Library Functions ManualLUA_DEBUG(3)
+
+

+lua_Debug — +
structure used to carry different pieces of + information about an active function
+

+#include + <lua.h> +
+typedef struct lua_Debug; +

+lua_Debug() a structure used to carry + different pieces of information about an active function. + lua_getstack(3) fills only the private part of + this structure, for later use. To fill the other fields of + lua_Debug with useful information, call + lua_getinfo(3). +
+lua_Debug is defined as: +
+
+
+typedef struct lua_Debug { 
+        int event; 
+        const char *name;           /* (n) */ 
+        const char *namewhat;       /* (n) */ 
+        const char *what;           /* (S) */ 
+        const char *source;         /* (S) */ 
+        int currentline;            /* (l) */ 
+        int nups;                   /* (u) number of upvalues */ 
+        int linedefined;            /* (S) */ 
+        int lastlinedefined;        /* (S) */ 
+        char short_src[LUA_IDSIZE]; /* (S) */ 
+        /* private part */ 
+        other fields 
+} lua_Debug;
+
+
+
+The fields of lua_Debug have the following + meaning: +
+
+
+
source:
+
If the function was defined in a string, then source is that string. If + the function was defined in a file, then source starts with a '@' followed + by the file name.
+
short_src:
+
a "printable" version of source, to be used in error + messages.
+
linedefined:
+
the line number where the definition of the function starts.
+
lastlinedefined:
+
the line number where the definition of the function ends.
+
what:
+
the string "Lua" if the function is a Lua function, + "C" if it is a C function, "main" if it is the main + part of a chunk, and "tail" if it was a function that did a tail + call. In the latter case, Lua has no other information about the + function.
+
currentline:
+
the current line where the given function is executing. When no line + information is available, currentline is set to -1.
+
name:
+
a reasonable name for the given function. Because functions in Lua are + first-class values, they do not have a fixed name: some functions can be + the value of multiple global variables, while others can be stored only in + a table field. The lua_getinfo(3) function + checks how the function was called to find a suitable name. If it cannot + find a name, then name is set to + NULL.
+
namewhat:
+
explains the name field. The value of namewhat can be "global", + "local", "method", "field", + "upvalue", or "" (the empty string), according to how + the function was called. (Lua uses the empty string when no other option + seems to apply.)
+
nups:
+
the number of upvalues of the function.
+
+
+

+lua_getinfo(3), + lua_getstack(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_Debug() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 19, 2022Debian
+ + blob - /dev/null blob + f86db2cb387e94e4375e935fce02af076dc70d0a (mode 644) --- /dev/null +++ lua_Hook.3 @@ -0,0 +1,49 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_HOOK 3 +.Os +.Sh NAME +.Nm lua_Hook +.Nd type for debugging hook functions +.Sh SYNOPSIS +.In lua.h +.Ft typedef void * +.Fn lua_Hook "lua_State *L" "lua_Debug *ar" +.Sh DESCRIPTION +.Fn lua_Hook +type for debugging hook functions. +.Pp +Whenever a hook is called, its ar argument has its field event set to the +specific event that triggered the hook. +Lua identifies these events with the following constants: +.Dv LUA_HOOKCALL , +.Dv LUA_HOOKRET , +.Dv LUA_HOOKTAILRET , +.Dv LUA_HOOKLINE , +and +.Dv LUA_HOOKCOUNT . +Moreover, for line events, the field currentline is also set. +To get the value of any other field in ar, the hook must call +.Xr lua_getinfo 3 . +For return events, event can be +.Dv LUA_HOOKRET , +the normal value, or +.Dv LUA_HOOKTAILRET . +In the latter case, Lua is simulating a return from a function that did a tail +call; in this case, it is useless to call +.Xr lua_getinfo 3 . +.Pp +While Lua is running a hook, it disables other calls to hooks. +Therefore, if a hook calls back Lua to execute a function or a chunk, this +execution occurs without any calls to hooks. +.Sh SEE ALSO +.Xr lua_getinfo 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_Hook +manual page was written by Sergey Bronnikov. blob - /dev/null blob + ffbed084881cddb186f5a67778649f1757416471 (mode 644) --- /dev/null +++ lua_Hook.3.html @@ -0,0 +1,68 @@ + + + + + + LUA_HOOK(3) + + + + + + + + +
LUA_HOOK(3)Library Functions ManualLUA_HOOK(3)
+
+

+lua_Hook — +
type for debugging hook functions
+

+#include + <lua.h> +
+typedef void * +
+lua_Hook(lua_State + *L, lua_Debug + *ar); +

+lua_Hook() type for debugging hook functions. +
+Whenever a hook is called, its ar argument has its field event set to the + specific event that triggered the hook. Lua identifies these events with the + following constants: LUA_HOOKCALL, + LUA_HOOKRET, + LUA_HOOKTAILRET, + LUA_HOOKLINE, and + LUA_HOOKCOUNT. Moreover, for line events, + the field currentline is also set. To get the value of any other field in ar, + the hook must call lua_getinfo(3). For return + events, event can be LUA_HOOKRET, the + normal value, or LUA_HOOKTAILRET. In the + latter case, Lua is simulating a return from a function that did a tail call; + in this case, it is useless to call + lua_getinfo(3). +
+While Lua is running a hook, it disables other calls to hooks. Therefore, if a + hook calls back Lua to execute a function or a chunk, this execution occurs + without any calls to hooks. +

+lua_getinfo(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_Hook() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + f49d8db27cb7e7373f7b7d31e2316e8eaf5e7870 (mode 644) --- /dev/null +++ lua_Integer.3 @@ -0,0 +1,27 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_INTEGER 3 +.Os +.Sh NAME +.Nm lua_Integer +.Nd type to represent integral values +.Sh SYNOPSIS +.In lua.h +.Vt typedef ptrdiff_t lua_Integer ; +.Sh DESCRIPTION +.Vt lua_Integer +the type used by the Lua API to represent integral values. +By default it is a +.Dv ptrdiff_t , +which is usually the largest signed integral type the machine handles +.Qq comfortably . +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_Integer +manual page was written by Sergey Bronnikov. blob - /dev/null blob + d0a48d99fe94f54a685632c093f8ff81b8dd65d0 (mode 644) --- /dev/null +++ lua_Integer.3.html @@ -0,0 +1,46 @@ + + + + + + LUA_INTEGER(3) + + + + + + + + +
LUA_INTEGER(3)Library Functions ManualLUA_INTEGER(3)
+
+

+lua_Integer — +
type to represent integral values
+

+#include + <lua.h> +
+typedef ptrdiff_t lua_Integer; +

+lua_Integer the type used by the Lua API to + represent integral values. By default it is a + ptrdiff_t, which is usually the largest + signed integral type the machine handles “comfortably”. +

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

+The lua_Integer() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + ea8f43ef4ac40b9430609da1ed8807a4b44da017 (mode 644) --- /dev/null +++ lua_Number.3 @@ -0,0 +1,27 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_NUMBER 3 +.Os +.Sh NAME +.Nm lua_Number +.Nd type of numbers in Lua +.Sh SYNOPSIS +.In lua.h +.Vt typedef double lua_Number ; +.Sh DESCRIPTION +The type of numbers in Lua. +By default, it is double, but that can be changed in +.In luaconf.h . +.Pp +Through the configuration file you can change Lua to operate with another type +for numbers (e.g., float or long). +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Vt lua_Number +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 48df890f4eda76ea6d566f2e2dec2f392840f783 (mode 644) --- /dev/null +++ lua_Number.3.html @@ -0,0 +1,47 @@ + + + + + + LUA_NUMBER(3) + + + + + + + + +
LUA_NUMBER(3)Library Functions ManualLUA_NUMBER(3)
+
+

+lua_Number — +
type of numbers in Lua
+

+#include + <lua.h> +
+typedef double lua_Number; +

+The type of numbers in Lua. By default, it is double, but that can be changed in + <luaconf.h>. +
+Through the configuration file you can change Lua to operate with another type + for numbers (e.g., float or long). +

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

+The lua_Number manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + 0939d01f479e774c09c344b49c48e701aecdd5aa (mode 644) --- /dev/null +++ lua_Reader.3 @@ -0,0 +1,39 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_READER 3 +.Os +.Sh NAME +.Nm lua_Reader +.Nd reader function used by +.Xr lua_load 3 +.Sh SYNOPSIS +.In lua.h +.Ft typedef const char * +.Fn (*lua_Reader) "lua_State *L" "void *data" "size_t *size" +.Sh DESCRIPTION +The +reader function +.Fn lua_Reader +used by +.Xr lua_load 3 . +Every time it needs another piece of the chunk, +.Xr lua_load 3 +calls the reader, passing along its data parameter. +The reader must return a pointer to a block of memory with a new piece of the +chunk and set size to the block size. +The block must exist until the reader function is called again. +To signal the end of the chunk, the reader must return +.Dv NULL +or set size to zero. +The reader function may return pieces of any size greater than zero. +.Sh SEE ALSO +.Xr lua_load 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_Reader +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 598abfbb97ff74396685ab90f1cbd71d24ca4b6f (mode 644) --- /dev/null +++ lua_Reader.3.html @@ -0,0 +1,59 @@ + + + + + + LUA_READER(3) + + + + + + + + +
LUA_READER(3)Library Functions ManualLUA_READER(3)
+
+

+lua_Reader — +
reader function used by + lua_load(3)
+

+#include + <lua.h> +
+typedef const char * +
+(*lua_Reader)(lua_State + *L, void + *data, size_t + *size); +

+The reader function lua_Reader() used by + lua_load(3). Every time it needs another piece of + the chunk, lua_load(3) calls the reader, passing + along its data parameter. The reader must return a pointer to a block of + memory with a new piece of the chunk and set size to the block size. The block + must exist until the reader function is called again. To signal the end of the + chunk, the reader must return NULL or set + size to zero. The reader function may return pieces of any size greater than + zero. +

+lua_load(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_Reader() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + 9cc18caf585d80216f5a20ce4a6bbfef64e157e7 (mode 644) --- /dev/null +++ lua_State.3 @@ -0,0 +1,30 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_STATE 3 +.Os +.Sh NAME +.Nm lua_State +.Nd opaque structure that keeps the whole state of a Lua interpreter +.Sh SYNOPSIS +.In lua.h +.Vt typedef struct lua_State lua_State ; +.Sh DESCRIPTION +.Vt lua_State +opaque structure that keeps the whole state of a Lua interpreter. +The Lua library is fully reentrant: it has no global variables. +All information about a state is kept in this structure. +A pointer to this state must be passed as the first argument to every function +in the library, except to +.Xr lua_newstate 3 , +which creates a Lua state from scratch. +.Sh SEE ALSO +.Xr lua_newstate 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Vt lua_State +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 880fcd474afb284659ac0fbf6debbd8a8707e75b (mode 644) --- /dev/null +++ lua_State.3.html @@ -0,0 +1,51 @@ + + + + + + LUA_STATE(3) + + + + + + + + +
LUA_STATE(3)Library Functions ManualLUA_STATE(3)
+
+

+lua_State — +
opaque structure that keeps the whole state of a Lua + interpreter
+

+#include + <lua.h> +
+typedef struct lua_State lua_State; +

+lua_State opaque structure that keeps the whole + state of a Lua interpreter. The Lua library is fully reentrant: it has no + global variables. All information about a state is kept in this structure. A + pointer to this state must be passed as the first argument to every function + in the library, except to lua_newstate(3), which + creates a Lua state from scratch. +

+lua_newstate(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_State manual page was written by Sergey + Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 1abbed08ae7e042d21acd3a5aaa7020ddfdd4f1c (mode 644) --- /dev/null +++ lua_Writer.3 @@ -0,0 +1,39 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_WRITER 3 +.Os +.Sh NAME +.Nm lua_Writer +.Nd type of the writer function used by +.Xr lua_dump 3 +.Sh SYNOPSIS +.In lua.h +.Ft typedef int * +.Fn lua_Writer "lua_State *L" "const void* p" "size_t sz" "void* ud" +.Sh DESCRIPTION +.Vt lua_Writer +type of the writer function used by +.Xr lua_dump 3 . +Every time it produces another piece of chunk, +.Xr lua_dump 3 +calls the writer, passing along the buffer to be written +.Pq Fa p , +its size +.Pq Fa sz , +and the data parameter supplied to +.Xr lua_dump 3 . +.Sh RETURN VALUES +The writer returns an error code: 0 means no errors; any other value means an +error and stops +.Xr lua_dump 3 +from calling the writer again. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Vt lua_Writer +manual page was written by Sergey Bronnikov. blob - /dev/null blob + d95d6256293d77fec2803cf89e3ab3ebbfbbbdd0 (mode 644) --- /dev/null +++ lua_Writer.3.html @@ -0,0 +1,60 @@ + + + + + + LUA_WRITER(3) + + + + + + + + +
LUA_WRITER(3)Library Functions ManualLUA_WRITER(3)
+
+

+lua_Writer — +
type of the writer function used by + lua_dump(3)
+

+#include + <lua.h> +
+typedef int * +
+lua_Writer(lua_State + *L, const void* + p, size_t + sz, void* + ud); +

+lua_Writer type of the writer function used by + lua_dump(3). Every time it produces another piece + of chunk, lua_dump(3) calls the writer, passing + along the buffer to be written (p), its size + (sz), and the data parameter supplied to + lua_dump(3). +

+The writer returns an error code: 0 means no errors; any other value means an + error and stops lua_dump(3) from calling the + writer again. +

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

+The lua_Writer manual page was written by + Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + e02f2dcea2807d938a591213c56e0d3ca33375af (mode 644) --- /dev/null +++ lua_atpanic.3 @@ -0,0 +1,33 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_ATPANIC 3 +.Os +.Sh NAME +.Nm lua_atpanic +.Nd sets a new panic function and returns the old one +.Sh SYNOPSIS +.In lua.h +.Ft lua_CFunction +.Fn lua_atpanic "lua_State *L" "lua_CFunction panicf" +.Sh DESCRIPTION +.Fn lua_atpanic +sets a new panic function and returns the old one. +.Pp +If an error happens outside any protected environment, Lua calls a panic +function and then calls +.Em exit(EXIT_FAILURE) , +thus exiting the host application. +Your panic function can avoid this exit by never returning (e.g., doing a long +jump). +.Pp +The panic function can access the error message at the top of the stack. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_atpanic +manual page was written by Sergey Bronnikov. blob - /dev/null blob + b6dc11ee668a7301759f5c8b0170798b2073a4ab (mode 644) --- /dev/null +++ lua_atpanic.3.html @@ -0,0 +1,57 @@ + + + + + + LUA_ATPANIC(3) + + + + + + + + +
LUA_ATPANIC(3)Library Functions ManualLUA_ATPANIC(3)
+
+

+lua_atpanic — +
sets a new panic function and returns the old + one
+

+#include + <lua.h> +
+lua_CFunction +
+lua_atpanic(lua_State + *L, + lua_CFunction + panicf); +

+lua_atpanic() sets a new panic function and + returns the old one. +
+If an error happens outside any protected environment, Lua calls a panic + function and then calls exit(EXIT_FAILURE), thus + exiting the host application. Your panic function can avoid this exit by never + returning (e.g., doing a long jump). +
+The panic function can access the error message at the top of the stack. +

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

+The lua_atpanic() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + f8f32c7655810914ee250b27513e838b5a8b4888 (mode 644) --- /dev/null +++ lua_call.3 @@ -0,0 +1,68 @@ +.Dd $Mdocdate: July 19 2022 $ +.Dt LUA_CALL 3 +.Os +.Sh NAME +.Nm lua_call +.Nd calls a function +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_call "lua_State *L" "int nargs" "int nresults" +.Sh DESCRIPTION +.Fn lua_call +calls a function. +.Pp +To call a function you must use the following protocol: first, the function to +be called is pushed onto the stack; then, the arguments to the function are +pushed in direct order; that is, the first argument is pushed first. +Finally you call +.Nm lua_call ; +.Fa nargs +is the number of arguments that you pushed onto the stack. +All arguments and the function value are popped from the stack when the +function is called. +The function results are pushed onto the stack when the function returns. +The number of results is adjusted to nresults, unless nresults is +.Dv LUA_MULTRET . +In this case, all results from the function are pushed. +Lua takes care that the returned values fit into the stack space. +The function results are pushed onto the stack in direct order (the first +result is pushed first), so that after the call the last result is on the top +of the stack. +.Pp +Any error inside the called function is propagated upwards (with a longjmp). +.Pp +The following example shows how the host program can do the equivalent to this +Lua code: +.Pp +.Bd -literal -offset indent -compact +a = f("how", t.x, 14) +.Ed +.Pp +Here it is in C: +.Pp +.Bd -literal -offset indent -compact +lua_getfield(L, LUA_GLOBALSINDEX, "f"); /* function to be called */ +lua_pushstring(L, "how"); /* 1st argument */ +lua_getfield(L, LUA_GLOBALSINDEX, "t"); /* table to be indexed */ +lua_getfield(L, -1, "x"); /* push result of t.x (2nd arg) */ +lua_remove(L, -2); /* remove 't' from the stack */ +lua_pushinteger(L, 14); /* 3rd argument */ +lua_call(L, 3, 1); /* call 'f' with 3 arguments and 1 result */ +lua_setfield(L, LUA_GLOBALSINDEX, "a"); /* set global 'a' */ +.Ed +.Pp +Note that the code above is "balanced": at its end, the stack is back to its +original configuration. +This is considered good programming practice. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_call +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 47a768503ae52150c4798545917265972bf38249 (mode 644) --- /dev/null +++ lua_call.3.html @@ -0,0 +1,91 @@ + + + + + + LUA_CALL(3) + + + + + + + + +
LUA_CALL(3)Library Functions ManualLUA_CALL(3)
+
+

+lua_call — +
calls a function
+

+#include + <lua.h> +
+void +
+lua_call(lua_State + *L, int + nargs, int + nresults); +

+lua_call() calls a function. +
+To call a function you must use the following protocol: first, the function to + be called is pushed onto the stack; then, the arguments to the function are + pushed in direct order; that is, the first argument is pushed first. Finally + you call lua_call; + nargs is the number of arguments that you + pushed onto the stack. All arguments and the function value are popped from + the stack when the function is called. The function results are pushed onto + the stack when the function returns. The number of results is adjusted to + nresults, unless nresults is LUA_MULTRET. + In this case, all results from the function are pushed. Lua takes care that + the returned values fit into the stack space. The function results are pushed + onto the stack in direct order (the first result is pushed first), so that + after the call the last result is on the top of the stack. +
+Any error inside the called function is propagated upwards (with a longjmp). +
+The following example shows how the host program can do the equivalent to this + Lua code: +
+
+
+a = f("how", t.x, 14)
+
+
+
+Here it is in C: +
+
+
+lua_getfield(L, LUA_GLOBALSINDEX, "f"); /* function to be called */ 
+lua_pushstring(L, "how");                        /* 1st argument */ 
+lua_getfield(L, LUA_GLOBALSINDEX, "t");   /* table to be indexed */ 
+lua_getfield(L, -1, "x");        /* push result of t.x (2nd arg) */ 
+lua_remove(L, -2);                  /* remove 't' from the stack */ 
+lua_pushinteger(L, 14);                          /* 3rd argument */ 
+lua_call(L, 3, 1);     /* call 'f' with 3 arguments and 1 result */ 
+lua_setfield(L, LUA_GLOBALSINDEX, "a");        /* set global 'a' */
+
+
+
+Note that the code above is "balanced": at its end, the stack is back + to its original configuration. This is considered good programming practice. +

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

+The lua_call() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 19, 2022Debian
+ + blob - /dev/null blob + 8fe8b3ffd205f66f986b5c3ad45fe8d8008d290e (mode 644) --- /dev/null +++ lua_checkstack.3 @@ -0,0 +1,27 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_CHECKSTACK 3 +.Os +.Sh NAME +.Nm lua_checkstack +.Nd ensures that there are at least extra free stack slots in the stack +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_checkstack "lua_State *L" "int extra" +.Sh DESCRIPTION +.Fn lua_checkstack +ensures that there are at least extra free stack slots in the stack. +It returns false if it cannot grow the stack to that size. +This function never shrinks the stack; if the stack is already larger than the +new size, it is left unchanged. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_checkstack +manual page was written by Sergey Bronnikov. blob - /dev/null blob + a7fdebeb02aba577bb93d9d31aa6f8d0cea89eb4 (mode 644) --- /dev/null +++ lua_checkstack.3.html @@ -0,0 +1,51 @@ + + + + + + LUA_CHECKSTACK(3) + + + + + + + + +
LUA_CHECKSTACK(3)Library Functions ManualLUA_CHECKSTACK(3)
+
+

+lua_checkstack — +
ensures that there are at least extra free stack + slots in the stack
+

+#include + <lua.h> +
+int +
+lua_checkstack(lua_State + *L, int + extra); +

+lua_checkstack() ensures that there are at + least extra free stack slots in the stack. It returns false if it cannot grow + the stack to that size. This function never shrinks the stack; if the stack is + already larger than the new size, it is left unchanged. +

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

+The lua_checkstack() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 43d1bb648bd3428647541b08f2fe546de517d8b9 (mode 644) --- /dev/null +++ lua_close.3 @@ -0,0 +1,27 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_CLOSE 3 +.Os +.Sh NAME +.Nm lua_close +.Nd ensures that there are at least extra free stack slots in the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_close "lua_State *L" +.Sh DESCRIPTION +.Fn lua_close +ensures that there are at least extra free stack slots in the stack. +It returns false if it cannot grow the stack to that size. +This function never shrinks the stack; if the stack is already larger than the +new size, it is left unchanged. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_close +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 68b1806d2df96c352c14b6d51ab16b410543f829 (mode 644) --- /dev/null +++ lua_close.3.html @@ -0,0 +1,50 @@ + + + + + + LUA_CLOSE(3) + + + + + + + + +
LUA_CLOSE(3)Library Functions ManualLUA_CLOSE(3)
+
+

+lua_close — +
ensures that there are at least extra free stack + slots in the stack
+

+#include + <lua.h> +
+void +
+lua_close(lua_State + *L); +

+lua_close() ensures that there are at least + extra free stack slots in the stack. It returns false if it cannot grow the + stack to that size. This function never shrinks the stack; if the stack is + already larger than the new size, it is left unchanged. +

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

+The lua_close() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + c7d284ff8c07d87c03ce7a10635e76dbfb16a598 (mode 644) --- /dev/null +++ lua_concat.3 @@ -0,0 +1,37 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_CONCAT 3 +.Os +.Sh NAME +.Nm lua_concat +.Nd concatenates the values at the top of the stack, pops them, and leaves the +result at the top +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_concat "lua_State *L" "int n" +.Sh DESCRIPTION +.Fn lua_concat +concatenates the +.Fa n +values at the top of the stack, pops them, and leaves the +result at the top. +Concatenation is performed following the +usual semantics of Lua. +.Sh RETURN VALUES +If +.Fa n +is 1, the result is the single value on the stack (that +is, the function does nothing); if +.Fa n +is 0, the result is the empty string. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_concat +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 947925929b0a9197c1ac852e5157cea78fc20288 (mode 644) --- /dev/null +++ lua_concat.3.html @@ -0,0 +1,56 @@ + + + + + + LUA_CONCAT(3) + + + + + + + + +
LUA_CONCAT(3)Library Functions ManualLUA_CONCAT(3)
+
+

+lua_concat — +
concatenates the values at the top of the stack, pops + them, and leaves the result at the top
+

+#include + <lua.h> +
+void +
+lua_concat(lua_State + *L, int + n); +

+lua_concat() concatenates the + n values at the top of the stack, pops them, + and leaves the result at the top. Concatenation is performed following the + usual semantics of Lua. +

+If n is 1, the result is the single value on + the stack (that is, the function does nothing); if + n is 0, the result is the empty string. +

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

+The lua_concat() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + b34af570cfe94bf90cd468a8dd26177c9dd7f2a5 (mode 644) --- /dev/null +++ lua_cpcall.3 @@ -0,0 +1,40 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_CPCALL 3 +.Os +.Sh NAME +.Nm lua_cpcall +.Nd calls the C function in protected mode +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_cpcall "lua_State *L" "lua_CFunction func" "void *ud" +.Sh DESCRIPTION +.Fn lua_cpcall +calls the C function +.Fa func +in protected mode. +.Fa func +starts with only one element in its stack, a light userdata containing +.Fa ud . +.Sh RETURN VALUES +In case of errors, +.Fn lua_cpcall +returns the same error codes as +.Xr lua_pcall 3 , +plus the error object on the top of the stack; otherwise, it returns zero, and +does not change the stack. +All values returned by +.Fa func +are discarded. +.Sh SEE ALSO +.Xr lua_pcall 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_cpcall +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 458443985b920ff03ed8b111397796ec2998defe (mode 644) --- /dev/null +++ lua_cpcall.3.html @@ -0,0 +1,61 @@ + + + + + + LUA_CPCALL(3) + + + + + + + + +
LUA_CPCALL(3)Library Functions ManualLUA_CPCALL(3)
+
+

+lua_cpcall — +
calls the C function in protected mode
+

+#include + <lua.h> +
+int +
+lua_cpcall(lua_State + *L, + lua_CFunction + func, void + *ud); +

+lua_cpcall() calls the C function + func in protected mode. + func starts with only one element in its + stack, a light userdata containing ud. +

+In case of errors, lua_cpcall() returns the + same error codes as lua_pcall(3), plus the error + object on the top of the stack; otherwise, it returns zero, and does not + change the stack. All values returned by func + are discarded. +

+lua_pcall(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_cpcall() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 59d340427446afacc99be9ae907283636aaaa07c (mode 644) --- /dev/null +++ lua_createtable.3 @@ -0,0 +1,34 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_CREATETABLE 3 +.Os +.Sh NAME +.Nm lua_createtable +.Nd creates a new empty table and pushes it onto the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_createtable "lua_State *L" "int narr" "int nrec" +.Sh DESCRIPTION +.Fn lua_createtable +creates a new empty table and pushes it onto the stack. +The new table has space pre-allocated for +.Fa narr +array elements and +.Fa nrec +non-array elements. +This pre-allocation is useful when you know exactly how many elements the table +will have. +Otherwise you can use the function +.Xr lua_newtable 3 . +.Sh SEE ALSO +.Xr lua_newtable 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_createtable +manual page was written by Sergey Bronnikov. blob - /dev/null blob + d5d73720b906c1ce9393fd47c0d5eb7c7faac4c4 (mode 644) --- /dev/null +++ lua_createtable.3.html @@ -0,0 +1,57 @@ + + + + + + LUA_CREATETABLE(3) + + + + + + + + +
LUA_CREATETABLE(3)Library Functions ManualLUA_CREATETABLE(3)
+
+

+lua_createtable — +
creates a new empty table and pushes it onto the + stack
+

+#include + <lua.h> +
+void +
+lua_createtable(lua_State + *L, int + narr, int + nrec); +

+lua_createtable() creates a new empty table + and pushes it onto the stack. The new table has space pre-allocated for + narr array elements and + nrec non-array elements. This pre-allocation + is useful when you know exactly how many elements the table will have. + Otherwise you can use the function + lua_newtable(3). +

+lua_newtable(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_createtable() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 4c8349a1b835be6d393def9d920ef485700fafbf (mode 644) --- /dev/null +++ lua_dump.3 @@ -0,0 +1,37 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_DUMP 3 +.Os +.Sh NAME +.Nm lua_dump +.Nd dumps a function as a binary chunk +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_dump "lua_State *L" "lua_Writer writer" "void *data" +.Sh DESCRIPTION +.Fn lua_dump +dumps a function as a binary chunk. +Receives a Lua function on the top of the stack and produces a binary chunk +that, if loaded again, results in a function equivalent to the one dumped. +As it produces parts of the chunk, +.Fn lua_dump +calls function writer (see +.Xr lua_Writer 3 ) +with the given data to write them. +.Pp +This function does not pop the Lua function from the stack. +.Sh RETURN VALUES +The value returned is the error code returned by the last call to the writer; 0 +means no errors. +.Sh SEE ALSO +.Xr lua_Writer 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_dump +manual page was written by Sergey Bronnikov. blob - /dev/null blob + fc19a34767ec9b68b80e9c120804325fa2a7f170 (mode 644) --- /dev/null +++ lua_dump.3.html @@ -0,0 +1,61 @@ + + + + + + LUA_DUMP(3) + + + + + + + + +
LUA_DUMP(3)Library Functions ManualLUA_DUMP(3)
+
+

+lua_dump — +
dumps a function as a binary chunk
+

+#include + <lua.h> +
+int +
+lua_dump(lua_State + *L, lua_Writer + writer, void + *data); +

+lua_dump() dumps a function as a binary + chunk. Receives a Lua function on the top of the stack and produces a binary + chunk that, if loaded again, results in a function equivalent to the one + dumped. As it produces parts of the chunk, + lua_dump() calls function writer (see + lua_Writer(3)) with the given data to write them. +
+This function does not pop the Lua function from the stack. +

+The value returned is the error code returned by the last call to the writer; 0 + means no errors. +

+lua_Writer(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_dump() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + b95a856b7c53a7c399a406e54081f69815f450a4 (mode 644) --- /dev/null +++ lua_equal.3 @@ -0,0 +1,32 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_EQUAL 3 +.Os +.Sh NAME +.Nm lua_equal +.Nd compare two values for equality +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_equal "lua_State *L" "int index1" "int index2" +.Sh DESCRIPTION +.Fn lua_equal +.Sh RETURN VALUES +Returns 1 if the two values in acceptable indices +.Fa index1 +and +.Fa index2 +are equal, following the semantics of the Lua +.Em == +operator (that is, may call metamethods). +Otherwise returns 0. Also returns 0 if any of the indices is non valid. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_equal +manual page was written by Sergey Bronnikov. blob - /dev/null blob + de32c2c76b8f9e24e6098aee55789e869522ef8c (mode 644) --- /dev/null +++ lua_equal.3.html @@ -0,0 +1,56 @@ + + + + + + LUA_EQUAL(3) + + + + + + + + +
LUA_EQUAL(3)Library Functions ManualLUA_EQUAL(3)
+
+

+lua_equal — +
compare two values for equality
+

+#include + <lua.h> +
+int +
+lua_equal(lua_State + *L, int + index1, int + index2); +

+lua_equal() +

+Returns 1 if the two values in acceptable indices + index1 and + index2 are equal, following the semantics of + the Lua == operator (that is, may call + metamethods). Otherwise returns 0. Also returns 0 if any of the indices is non + valid. +

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

+The lua_equal() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 4280d878af688b2d681405306bb76eb29c15e2eb (mode 644) --- /dev/null +++ lua_error.3 @@ -0,0 +1,29 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_ERROR 3 +.Os +.Sh NAME +.Nm lua_error +.Nd generates a Lua error +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_error "lua_State *L" +.Sh DESCRIPTION +.Fn lua_error +generates a Lua error. +The error message (which can actually be a Lua value of any type) must be on +the stack top. +.Sh RETURN VALUES +This function does a long jump, and therefore never returns. +.Sh SEE ALSO +.Xr luaL_error 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn luaL_error +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 215c608ad3ec3471a6abd3759b6eca24a92f49f3 (mode 644) --- /dev/null +++ lua_error.3.html @@ -0,0 +1,53 @@ + + + + + + LUA_ERROR(3) + + + + + + + + +
LUA_ERROR(3)Library Functions ManualLUA_ERROR(3)
+
+

+lua_error — +
generates a Lua error
+

+#include + <lua.h> +
+int +
+lua_error(lua_State + *L); +

+lua_error() generates a Lua error. The error + message (which can actually be a Lua value of any type) must be on the stack + top. +

+This function does a long jump, and therefore never returns. +

+luaL_error(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The luaL_error() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 3546f12f608065ff8603cd5698265bca6f7050ee (mode 644) --- /dev/null +++ lua_gc.3 @@ -0,0 +1,54 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_GC 3 +.Os +.Sh NAME +.Nm lua_gc +.Nd controls the garbage collector +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_gc "lua_State *L" "int what" "int data" +.Sh DESCRIPTION +.Fn lua_gc +controls the garbage collector. +.Pp +This function performs several tasks, according to the value of the parameter +what: +.Pp +.Bl -tag -width LUA_GCSETSTEPMUL -offset indent -compact +.It Dv LUA_GCSTOP : +stops the garbage collector. +.It Dv LUA_GCRESTART : +restarts the garbage collector. +.It Dv LUA_GCCOLLECT : +performs a full garbage-collection cycle. +.It Dv LUA_GCCOUNT : +returns the current amount of memory (in Kbytes) in use by Lua. +.It Dv LUA_GCCOUNTB : +returns the remainder of dividing the current amount of bytes of memory in use +by Lua by 1024. +.It Dv LUA_GCSTEP : +performs an incremental step of garbage collection. +The step "size" is controlled by data (larger values mean more steps) in a +non-specified way. +If you want to control the step size you must experimentally tune the value of +data. +The function returns 1 if the step finished a garbage-collection cycle. +.It Dv LUA_GCSETPAUSE : +sets data as the new value for the pause of the collector. +The function returns the previous value of the pause. +.It Dv LUA_GCSETSTEPMUL : +sets data as the new value for the step multiplier of the collector. +The function returns the previous value of the step multiplier. +.El +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_gc +manual page was written by Sergey Bronnikov. blob - /dev/null blob + de4074efa11f156d5d7f4f1ff62ea451706dccbb (mode 644) --- /dev/null +++ lua_gc.3.html @@ -0,0 +1,79 @@ + + + + + + LUA_GC(3) + + + + + + + + +
LUA_GC(3)Library Functions ManualLUA_GC(3)
+
+

+lua_gc — +
controls the garbage collector
+

+#include + <lua.h> +
+int +
+lua_gc(lua_State + *L, int + what, int + data); +

+lua_gc() controls the garbage collector. +
+This function performs several tasks, according to the value of the parameter + what: +
+
+
+
:
+
stops the garbage collector.
+
:
+
restarts the garbage collector.
+
:
+
performs a full garbage-collection cycle.
+
:
+
returns the current amount of memory (in Kbytes) in use by Lua.
+
:
+
returns the remainder of dividing the current amount of bytes of memory in + use by Lua by 1024.
+
:
+
performs an incremental step of garbage collection. The step + "size" is controlled by data (larger values mean more steps) in + a non-specified way. If you want to control the step size you must + experimentally tune the value of data. The function returns 1 if the step + finished a garbage-collection cycle.
+
:
+
sets data as the new value for the pause of the collector. The function + returns the previous value of the pause.
+
:
+
sets data as the new value for the step multiplier of the collector. The + function returns the previous value of the step multiplier.
+
+
+

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

+The lua_gc() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + 7c348ff7bbdda8e9cb08d1c8e0f7c69b00989970 (mode 644) --- /dev/null +++ lua_getallocf.3 @@ -0,0 +1,34 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_GETALLOCF 3 +.Os +.Sh NAME +.Nm lua_getallocf +.Nd returns the memory-allocation function of a given state +.Sh SYNOPSIS +.In lua.h +.Ft lua_Alloc +.Fn lua_getallocf "lua_State *L" "void **ud" +.Sh DESCRIPTION +.Fn lua_getallocf +returns the memory-allocation function of a given state. +.Sh RETURN VALUES +If +.Fa ud +is not +.Dv NULL , +Lua stores in +.Fa *ud +the opaque pointer passed to +.Xr lua_newstate 3 . +.Sh SEE ALSO +.Xr lua_newstate 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_getallocf +manual page was written by Sergey Bronnikov. blob - /dev/null blob + ebd44b4d4f039b6862f6a3c03fff20bc5e4e09da (mode 644) --- /dev/null +++ lua_getallocf.3.html @@ -0,0 +1,57 @@ + + + + + + LUA_GETALLOCF(3) + + + + + + + + +
LUA_GETALLOCF(3)Library Functions ManualLUA_GETALLOCF(3)
+
+

+lua_getallocf — +
returns the memory-allocation function of a given + state
+

+#include + <lua.h> +
+lua_Alloc +
+lua_getallocf(lua_State + *L, void + **ud); +

+lua_getallocf() returns the memory-allocation + function of a given state. +

+If ud is not + NULL, Lua stores in + *ud the opaque pointer passed to + lua_newstate(3). +

+lua_newstate(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_getallocf() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + e3bbc2efc6bbef3e6e80739e8241b99a431694e8 (mode 644) --- /dev/null +++ lua_getfenv.3 @@ -0,0 +1,24 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_GETFENV 3 +.Os +.Sh NAME +.Nm lua_getfenv +.Nd pushes onto the stack the environment table of the value at the given index +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_getfenv "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_getfenv +pushes onto the stack the environment table of the value at the given index. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_getfenv +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 4aed2ea83f0217c18d85dfbb9e2d699d4a927fce (mode 644) --- /dev/null +++ lua_getfenv.3.html @@ -0,0 +1,49 @@ + + + + + + LUA_GETFENV(3) + + + + + + + + +
LUA_GETFENV(3)Library Functions ManualLUA_GETFENV(3)
+
+

+lua_getfenv — +
pushes onto the stack the environment table of the + value at the given index
+

+#include + <lua.h> +
+void +
+lua_getfenv(lua_State + *L, int + index); +

+lua_getfenv() pushes onto the stack the + environment table of the value at the given index. +

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

+The lua_getfenv() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 3727ded3cb58f444fdc3bfdf2885ba171863c1d9 (mode 644) --- /dev/null +++ lua_getfield.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_GETFIELD 3 +.Os +.Sh NAME +.Nm lua_getfield +.Nd pushes onto the stack the value t[k], where t is the value at the given valid index +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_getfield "lua_State *L" "int index" "const char *k" +.Sh DESCRIPTION +.Fn lua_getfield +pushes onto the stack the value t[k], where t is the value at the given valid +index. +As in Lua, this function may trigger a metamethod for the +.Qq index +event. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_getfield +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 2d975a9f8311db2f9f4ead996dd494df4bb4b14f (mode 644) --- /dev/null +++ lua_getfield.3.html @@ -0,0 +1,51 @@ + + + + + + LUA_GETFIELD(3) + + + + + + + + +
LUA_GETFIELD(3)Library Functions ManualLUA_GETFIELD(3)
+
+

+lua_getfield — +
pushes onto the stack the value t[k], where t is the + value at the given valid index
+

+#include + <lua.h> +
+void +
+lua_getfield(lua_State + *L, int + index, const + char *k); +

+lua_getfield() pushes onto the stack the + value t[k], where t is the value at the given valid index. As in Lua, this + function may trigger a metamethod for the “index” event. +

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

+The lua_getfield() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + f72a7c976c731b526a65422e05d4793f59519d06 (mode 644) --- /dev/null +++ lua_getglobal.3 @@ -0,0 +1,27 @@ +.Dd $Mdocdate: July 19 2022 $ +.Dt LUA_GETGLOBAL 3 +.Os +.Sh NAME +.Nm lua_getglobal +.Nd pushes onto the stack the value of the global name +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_getglobal "lua_State *L" "const char *name" +.Sh DESCRIPTION +.Fn lua_getglobal +pushes onto the stack the value of the global name. +It is defined as a macro: +.Pp +.Fd #define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, s) +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_getglobal +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 1f8ff9f72b36b66f8bb553fedcad0017833d1bdd (mode 644) --- /dev/null +++ lua_getglobal.3.html @@ -0,0 +1,52 @@ + + + + + + LUA_GETGLOBAL(3) + + + + + + + + +
LUA_GETGLOBAL(3)Library Functions ManualLUA_GETGLOBAL(3)
+
+

+lua_getglobal — +
pushes onto the stack the value of the global + name
+

+#include + <lua.h> +
+void +
+lua_getglobal(lua_State + *L, const char + *name); +

+lua_getglobal() pushes onto the stack the + value of the global name. It is defined as a macro: +
+#define lua_getglobal(L,s) lua_getfield(L, + LUA_GLOBALSINDEX, s) +

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

+The lua_getglobal() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 19, 2022Debian
+ + blob - /dev/null blob + 9fc0d5e31247fafbb1b88cc6fee0538786b42890 (mode 644) --- /dev/null +++ lua_gethook.3 @@ -0,0 +1,26 @@ +.Dd $Mdocdate: July 13 2022 $ +.Dt LUA_GETHOOK 3 +.Os +.Sh NAME +.Nm lua_gethook +.Nd returns the current hook function +.Sh SYNOPSIS +.In lua.h +.Ft lua_Hook +.Fn lua_gethook "lua_State *L" +.Sh DESCRIPTION +.Fn lua_gethook +returns the current hook function. +.Sh RETURN VALUES +Returns the current hook function. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_gethook +manual page was written by Sergey Bronnikov. blob - /dev/null blob + d60549a47e88e352fec7358501377cea6dc773ff (mode 644) --- /dev/null +++ lua_gethook.3.html @@ -0,0 +1,50 @@ + + + + + + LUA_GETHOOK(3) + + + + + + + + +
LUA_GETHOOK(3)Library Functions ManualLUA_GETHOOK(3)
+
+

+lua_gethook — +
returns the current hook function
+

+#include + <lua.h> +
+lua_Hook +
+lua_gethook(lua_State + *L); +

+lua_gethook() returns the current hook + function. +

+Returns the current hook function. +

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

+The lua_gethook() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 13, 2022Debian
+ + blob - /dev/null blob + d9429750b76735aa7e0b7c604b5c9c6916284b2a (mode 644) --- /dev/null +++ lua_gethookcount.3 @@ -0,0 +1,26 @@ +.Dd $Mdocdate: July 13 2022 $ +.Dt LUA_GETHOOKCOUNT 3 +.Os +.Sh NAME +.Nm lua_gethookcount +.Nd returns the current hook count +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_gethookcount "lua_State *L" +.Sh DESCRIPTION +.Fn lua_gethookmask +returns the current hook count. +.Sh RETURN VALUES +Returns the current hook count. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_gethookcount +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 5545522c77e7d96a67167cd7605f75e462a7fbc2 (mode 644) --- /dev/null +++ lua_gethookcount.3.html @@ -0,0 +1,50 @@ + + + + + + LUA_GETHOOKCOUNT(3) + + + + + + + + +
LUA_GETHOOKCOUNT(3)Library Functions ManualLUA_GETHOOKCOUNT(3)
+
+

+lua_gethookcount — +
returns the current hook count
+

+#include + <lua.h> +
+int +
+lua_gethookcount(lua_State + *L); +

+lua_gethookmask() returns the current hook + count. +

+Returns the current hook count. +

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

+The lua_gethookcount() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 13, 2022Debian
+ + blob - /dev/null blob + 26852c63f5120a59bfcf6c9ef0714cade336e977 (mode 644) --- /dev/null +++ lua_gethookmask.3 @@ -0,0 +1,26 @@ +.Dd $Mdocdate: July 13 2022 $ +.Dt LUA_GETHOOKMASK 3 +.Os +.Sh NAME +.Nm lua_gethookmask +.Nd returns the current hook mask +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_gethookmask "lua_State *L" +.Sh DESCRIPTION +.Fn lua_gethookmask +returns the current hook mask. +.Sh RETURN VALUES +Returns the current hook mask. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_gethookmask +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 79efa13251b5297c85310561e4ec83d1aa7daf23 (mode 644) --- /dev/null +++ lua_gethookmask.3.html @@ -0,0 +1,50 @@ + + + + + + LUA_GETHOOKMASK(3) + + + + + + + + +
LUA_GETHOOKMASK(3)Library Functions ManualLUA_GETHOOKMASK(3)
+
+

+lua_gethookmask — +
returns the current hook mask
+

+#include + <lua.h> +
+int +
+lua_gethookmask(lua_State + *L); +

+lua_gethookmask() returns the current hook + mask. +

+Returns the current hook mask. +

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

+The lua_gethookmask() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 13, 2022Debian
+ + blob - /dev/null blob + a9536a1077d27f3edf9b0eb4bb2b567512aaefcd (mode 644) --- /dev/null +++ lua_getinfo.3 @@ -0,0 +1,69 @@ +.Dd $Mdocdate: July 19 2022 $ +.Dt LUA_GETINFO 3 +.Os +.Sh NAME +.Nm lua_getinfo +.Nd returns information about a specific function or function invocation +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_getinfo "lua_State *L" "const char *what" "lua_Debug *ar" +.Sh DESCRIPTION +.Fn lua_getinfo +returns information about a specific function or function invocation. +.Pp +To get information about a function invocation, the parameter ar must be a +valid activation record that was filled by a previous call to lua_getstack or +given as argument to a hook +.Pq see Xr lua_Hook 3 . +.Pp +To get information about a function you push it onto the stack and start the +what string with the character '>'. +(In that case, +.Nm lua_getinfo +pops the function in the top of the stack.) +For instance, to know in which line a function +.Fa f +was defined, you can write the following code: +.Pp +.Bd -literal -offset indent -compact +lua_Debug ar; +lua_getfield(L, LUA_GLOBALSINDEX, "f"); /* get global 'f' */ +lua_getinfo(L, ">S", &ar); +printf("%d\n", ar.linedefined); +.Ed +.Pp +Each character in the string what selects some fields of the structure ar to be +filled or a value to be pushed on the stack: +.Pp +.Bl -tag -width 'L' -compact +.It Sy 'n' +fills in the field name and namewhat; +.It Sy 'S' +fills in the fields source, short_src, linedefined, lastlinedefined, and what; +.It Sy 'l' +fills in the field currentline; +.It Sy 'u' +fills in the field nups; +.It Sy 'f' +pushes onto the stack the function that is running at the given level; +.It Sy 'L' +pushes onto the stack a table whose indices are the numbers of the lines that +are valid on the function. +(A valid line is a line with some associated code, that is, a line where you +can put a break point. +Non-valid lines include empty lines and comments.) +This function returns 0 on error (for instance, an invalid option in what). +.El +.Sh SEE ALSO +.Xr lua_Hook 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_getinfo +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 5878650304f5294eff16e9f68ffc4a45c882e3df (mode 644) --- /dev/null +++ lua_getinfo.3.html @@ -0,0 +1,96 @@ + + + + + + LUA_GETINFO(3) + + + + + + + + +
LUA_GETINFO(3)Library Functions ManualLUA_GETINFO(3)
+
+

+lua_getinfo — +
returns information about a specific function or + function invocation
+

+#include + <lua.h> +
+int +
+lua_getinfo(lua_State + *L, const char + *what, lua_Debug + *ar); +

+lua_getinfo() returns information about a + specific function or function invocation. +
+To get information about a function invocation, the parameter ar must be a valid + activation record that was filled by a previous call to lua_getstack or given + as argument to a hook (see lua_Hook(3)). +
+To get information about a function you push it onto the stack and start the + what string with the character '>'. (In that case, + lua_getinfo pops the function in the top of + the stack.) For instance, to know in which line a function + f was defined, you can write the following + code: +
+
+
+lua_Debug ar; 
+lua_getfield(L, LUA_GLOBALSINDEX, "f");  /* get global 'f' */ 
+lua_getinfo(L, ">S", &ar); 
+printf("%d0, ar.linedefined);
+
+
+
+Each character in the string what selects some fields of the structure ar to be + filled or a value to be pushed on the stack: +
+
+
'n'
+
fills in the field name and namewhat;
+
'S'
+
fills in the fields source, short_src, linedefined, lastlinedefined, and + what;
+
'l'
+
fills in the field currentline;
+
'u'
+
fills in the field nups;
+
'f'
+
pushes onto the stack the function that is running at the given + level;
+
'L'
+
pushes onto the stack a table whose indices are the numbers of the lines + that are valid on the function. (A valid line is a line with some + associated code, that is, a line where you can put a break point. + Non-valid lines include empty lines and comments.) This function returns 0 + on error (for instance, an invalid option in what).
+
+

+lua_Hook(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_getinfo() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 19, 2022Debian
+ + blob - /dev/null blob + 3bb407e627ba2b4847f86831730f2a6207c83b14 (mode 644) --- /dev/null +++ lua_getlocal.3 @@ -0,0 +1,45 @@ +.Dd $Mdocdate: July 13 2022 $ +.Dt LUA_GETLOCAL 3 +.Os +.Sh NAME +.Nm lua_getlocal +.Nd gets information about a local variable of a given activation record +.Sh SYNOPSIS +.In lua.h +.Ft const char * +.Fn lua_getlocal "lua_State *L" "lua_Debug *ar" "int n" +.Sh DESCRIPTION +.Fn lua_getlocal +gets information about a local variable of a given activation record. +The parameter +.Fa ar +must be a valid activation record that was filled by a previous call to +.Fn lua_getstack +or given as argument to a hook (see +.Xr lua_Hook 3 ). +The index +.Fa n +selects which local variable to inspect (1 is the first parameter or active +local variable, and so on, until the last active local variable). +.Fn lua_getlocal +pushes the variable's value onto the stack and returns its name. +.Pp +Variable names starting with '(' (open parentheses) represent internal +variables (loop control variables, temporaries, and C function locals). +.Sh RETURN VALUES +Returns +.Dv NULL +.Pq and pushes nothing +when the index is greater than the number of active local variables. +.Sh SEE ALSO +.Xr lua_Hook 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_getlocal +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 8b4cddb9a7536e86dc8c0733e5d2e5ac5dd3da7b (mode 644) --- /dev/null +++ lua_getlocal.3.html @@ -0,0 +1,67 @@ + + + + + + LUA_GETLOCAL(3) + + + + + + + + +
LUA_GETLOCAL(3)Library Functions ManualLUA_GETLOCAL(3)
+
+

+lua_getlocal — +
gets information about a local variable of a given + activation record
+

+#include + <lua.h> +
+const char * +
+lua_getlocal(lua_State + *L, lua_Debug + *ar, int + n); +

+lua_getlocal() gets information about a local + variable of a given activation record. The parameter + ar must be a valid activation record that was + filled by a previous call to lua_getstack() + or given as argument to a hook (see lua_Hook(3) + ). The index n selects which local variable + to inspect (1 is the first parameter or active local variable, and so on, + until the last active local variable). + lua_getlocal() pushes the variable's value + onto the stack and returns its name. +
+Variable names starting with '(' (open parentheses) represent internal variables + (loop control variables, temporaries, and C function locals). +

+Returns NULL (and pushes nothing) when the + index is greater than the number of active local variables. +

+lua_Hook(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_getlocal() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 13, 2022Debian
+ + blob - /dev/null blob + d508132557f202c48017c1fdd342e23621189cd2 (mode 644) --- /dev/null +++ lua_getmetatable.3 @@ -0,0 +1,29 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_GETMETATABLE 3 +.Os +.Sh NAME +.Nm lua_getmetatable +.Nd pushes onto the stack the metatable of the value at the given acceptable index +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_getmetatable "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_getmetatable +pushes onto the stack the metatable of the value at the given acceptable index. +.Sh RETURN VALUES +If the +.Fa index +is not valid, or if the value does not have a metatable, the function returns 0 +and pushes nothing on the stack. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_getmetatable +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 29f00e333eac26ec6e3d4a1a5bbb83f7b38c2c64 (mode 644) --- /dev/null +++ lua_getmetatable.3.html @@ -0,0 +1,53 @@ + + + + + + LUA_GETMETATABLE(3) + + + + + + + + +
LUA_GETMETATABLE(3)Library Functions ManualLUA_GETMETATABLE(3)
+
+

+lua_getmetatable — +
pushes onto the stack the metatable of the value at + the given acceptable index
+

+#include + <lua.h> +
+int +
+lua_getmetatable(lua_State + *L, int + index); +

+lua_getmetatable() pushes onto the stack the + metatable of the value at the given acceptable index. +

+If the index is not valid, or if the value does + not have a metatable, the function returns 0 and pushes nothing on the stack. +

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

+The lua_getmetatable() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 10ef22f1255cb90ec5bb69e68cdbf3df14b57511 (mode 644) --- /dev/null +++ lua_getstack.3 @@ -0,0 +1,37 @@ +.Dd $Mdocdate: July 13 2022 $ +.Dt LUA_GETSTACK 3 +.Os +.Sh NAME +.Nm lua_getstack +.Nd get information about the interpreter runtime stack +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_getstack "lua_State *L" "int level" "lua_Debug *ar" +.Sh DESCRIPTION +.Fn lua_getstack +get information about the interpreter runtime stack. +.Pp +This function fills parts of a +.Xr lua_Debug 3 +structure with an identification of the activation record of the function +executing at a given level. +Level 0 is the current running function, whereas level n+1 is the function that +has called level +.Fa n . +.Sh RETURN VALUES +When there are no errors, +.Fn lua_getstack +returns 1; when called with a level greater than the stack depth, it returns 0. +.Sh SEE ALSO +.Xr lua_Debug 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_getstack +manual page was written by Sergey Bronnikov. blob - /dev/null blob + a8a48f3ffbd35ba84884bbbf152346ba88e08e40 (mode 644) --- /dev/null +++ lua_getstack.3.html @@ -0,0 +1,63 @@ + + + + + + LUA_GETSTACK(3) + + + + + + + + +
LUA_GETSTACK(3)Library Functions ManualLUA_GETSTACK(3)
+
+

+lua_getstack — +
get information about the interpreter runtime + stack
+

+#include + <lua.h> +
+int +
+lua_getstack(lua_State + *L, int + level, lua_Debug + *ar); +

+lua_getstack() get information about the + interpreter runtime stack. +
+This function fills parts of a lua_Debug(3) + structure with an identification of the activation record of the function + executing at a given level. Level 0 is the current running function, whereas + level n+1 is the function that has called level + n. +

+When there are no errors, lua_getstack() + returns 1; when called with a level greater than the stack depth, it returns + 0. +

+lua_Debug(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_getstack() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 13, 2022Debian
+ + blob - /dev/null blob + 76a86364e1df4f17796a9fa8ec39234159659176 (mode 644) --- /dev/null +++ lua_gettable.3 @@ -0,0 +1,32 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_GETTABLE 3 +.Os +.Sh NAME +.Nm lua_gettable +.Nd pushes onto the stack the value t[k], where t is the value at the given valid +index and k is the value at the top of the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_gettable "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_gettable +pushes onto the stack the value t[k], where t is the value at the given valid +index and k is the value at the top of the stack. +.Pp +This function pops the key from the stack (putting the resulting value in its +place). +As in Lua, this function may trigger a metamethod for the +.Qq index +event. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_gettable +manual page was written by Sergey Bronnikov. blob - /dev/null blob + e0f185b666fc04a043cfbd5ae8becc5dec8f6e96 (mode 644) --- /dev/null +++ lua_gettable.3.html @@ -0,0 +1,55 @@ + + + + + + LUA_GETTABLE(3) + + + + + + + + +
LUA_GETTABLE(3)Library Functions ManualLUA_GETTABLE(3)
+
+

+lua_gettable — +
pushes onto the stack the value t[k], where t is the + value at the given valid index and k is the value at the top of the + stack
+

+#include + <lua.h> +
+void +
+lua_gettable(lua_State + *L, int + index); +

+lua_gettable() pushes onto the stack the + value t[k], where t is the value at the given valid index and k is the value + at the top of the stack. +
+This function pops the key from the stack (putting the resulting value in its + place). As in Lua, this function may trigger a metamethod for the + “index” event. +

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

+The lua_gettable() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 8da859c48707a0e13baa8347da07e577b26b58c3 (mode 644) --- /dev/null +++ lua_gettop.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_GETTOP 3 +.Os +.Sh NAME +.Nm lua_gettop +.Nd returns the index of the top element in the stack +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_gettop "lua_State *L" +.Sh DESCRIPTION +.Fn lua_gettop +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). +.Sh RETURN VALUES +Returns the index of the top element in the stack. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_gettop +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 512c99558f7140d0e2c5f4e2db919f5f5e5cf8fc (mode 644) --- /dev/null +++ lua_gettop.3.html @@ -0,0 +1,52 @@ + + + + + + LUA_GETTOP(3) + + + + + + + + +
LUA_GETTOP(3)Library Functions ManualLUA_GETTOP(3)
+
+

+lua_gettop — +
returns the index of the top element in the + stack
+

+#include + <lua.h> +
+int +
+lua_gettop(lua_State + *L); +

+lua_gettop() 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 was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 55de275046b8460a84d79e0828c3a2565a31e5c3 (mode 644) --- /dev/null +++ lua_getupvalue.3 @@ -0,0 +1,42 @@ +.Dd $Mdocdate: July 13 2022 $ +.Dt LUA_GETUPVALUE 3 +.Os +.Sh NAME +.Nm lua_getupvalue +.Nd gets information about a closure's upvalue +.Sh SYNOPSIS +.In lua.h +.Ft const char * +.Fn lua_getupvalue "lua_State *L" "int funcindex" "int n" +.Sh DESCRIPTION +.Fn lua_getupvalue +gets information about a closure's upvalue. +(For Lua functions, upvalues are the external local variables that the function +uses, and that are consequently included in its closure.) +.Fn lua_getupvalue +gets the index +.Fa n +of an upvalue, pushes the upvalue's value onto the stack, and returns its name. +.Fa funcindex +points to the closure in the stack. +(Upvalues have no particular order, as they are active through the whole +function. +So, they are numbered in an arbitrary order.) +.Sh RETURN VALUES +Returns +.Dv NULL +.Pq and pushes nothing +when the index is greater than the number of upvalues. +For C functions, this function uses the empty string "" as a name for all +upvalues. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_getupvalue +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 3c418bd5fad88808a722ddc52f2f8398934aee92 (mode 644) --- /dev/null +++ lua_getupvalue.3.html @@ -0,0 +1,61 @@ + + + + + + LUA_GETUPVALUE(3) + + + + + + + + +
LUA_GETUPVALUE(3)Library Functions ManualLUA_GETUPVALUE(3)
+
+

+lua_getupvalue — +
gets information about a closure's upvalue
+

+#include + <lua.h> +
+const char * +
+lua_getupvalue(lua_State + *L, int + funcindex, int + n); +

+lua_getupvalue() gets information about a + closure's upvalue. (For Lua functions, upvalues are the external local + variables that the function uses, and that are consequently included in its + closure.) lua_getupvalue() gets the index + n of an upvalue, pushes the upvalue's value + onto the stack, and returns its name. + funcindex points to the closure in the stack. + (Upvalues have no particular order, as they are active through the whole + function. So, they are numbered in an arbitrary order.) +

+Returns NULL (and pushes nothing) when the + index is greater than the number of upvalues. For C functions, this function + uses the empty string "" as a name for all upvalues. +

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

+The lua_getupvalue() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 13, 2022Debian
+ + blob - /dev/null blob + 5d761df28d9aca518695b9342a62e4171af20f1e (mode 644) --- /dev/null +++ lua_insert.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_INSERT 3 +.Os +.Sh NAME +.Nm lua_insert +.Nd moves the top element into the given valid index, shifting up the elements +above this index to open space +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_insert "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_insert +moves the top element into the given valid index, shifting up the elements +above this index to open space. +Cannot be called with a pseudo-index, because a pseudo-index is not an actual +stack position. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_insert +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 45a2166ec6e94296eda888efdf3c61bba287a0bf (mode 644) --- /dev/null +++ lua_insert.3.html @@ -0,0 +1,51 @@ + + + + + + LUA_INSERT(3) + + + + + + + + +
LUA_INSERT(3)Library Functions ManualLUA_INSERT(3)
+
+

+lua_insert — +
moves the top element into the given valid index, + shifting up the elements above this index to open space
+

+#include + <lua.h> +
+void +
+lua_insert(lua_State + *L, int + index); +

+lua_insert() moves the top element into the + given valid index, shifting up the elements above this index to open space. + Cannot be called with a pseudo-index, because a pseudo-index is not an actual + stack position. +

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

+The lua_insert() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + ee7b02bd31bfb67cf34b1404db1caa4b6e1c2ee5 (mode 644) --- /dev/null +++ lua_isboolean.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_ISBOOLEAN 3 +.Os +.Sh NAME +.Nm lua_isboolean +.Nd check whether a value is a boolean +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_isboolean "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_isboolean +returns 1 if the value at the given acceptable index has type boolean, and 0 +otherwise. +.Sh RETURN VALUES +Returns 1 if the value at the given acceptable index has type boolean, and 0 +otherwise. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_isboolean +manual page was written by Sergey Bronnikov. blob - /dev/null blob + e0cbd81a443f34d0a93b1b68531c91a8c04d8995 (mode 644) --- /dev/null +++ lua_isboolean.3.html @@ -0,0 +1,52 @@ + + + + + + LUA_ISBOOLEAN(3) + + + + + + + + +
LUA_ISBOOLEAN(3)Library Functions ManualLUA_ISBOOLEAN(3)
+
+

+lua_isboolean — +
check whether a value is a boolean
+

+#include + <lua.h> +
+int +
+lua_isboolean(lua_State + *L, int + index); +

+lua_isboolean() returns 1 if the value at the + given acceptable index has type boolean, and 0 otherwise. +

+Returns 1 if the value at the given acceptable index has type boolean, and 0 + otherwise. +

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

+The lua_isboolean() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 6558385f59c2e319d5137aa9b429739fababb4c5 (mode 644) --- /dev/null +++ lua_iscfunction.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_ISCFUNCTION 3 +.Os +.Sh NAME +.Nm lua_iscfunction +.Nd check whether a value is a C function +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_iscfunction "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_iscfunction +returns 1 if the value at the given acceptable index is a C function, and 0 +otherwise. +.Sh RETURN VALUES +Returns 1 if the value at the given acceptable index is a C function, and 0 +otherwise. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_iscfunction +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 4d69edd2a64464a5c8db038d912c4d440c8bbaed (mode 644) --- /dev/null +++ lua_iscfunction.3.html @@ -0,0 +1,52 @@ + + + + + + LUA_ISCFUNCTION(3) + + + + + + + + +
LUA_ISCFUNCTION(3)Library Functions ManualLUA_ISCFUNCTION(3)
+
+

+lua_iscfunction — +
check whether a value is a C function
+

+#include + <lua.h> +
+int +
+lua_iscfunction(lua_State + *L, int + index); +

+lua_iscfunction() returns 1 if the value at + the given acceptable index is a C function, and 0 otherwise. +

+Returns 1 if the value at the given acceptable index is a C function, and 0 + otherwise. +

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

+The lua_iscfunction() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + c96dc84923a533c383f0cbab5f874aa5db6f748f (mode 644) --- /dev/null +++ lua_isfunction.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_ISFUNCTION 3 +.Os +.Sh NAME +.Nm lua_isfunction +.Nd check whether a value is a function +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_isfunction "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_isfunction +returns 1 if the value at the given acceptable index is a function (either C or +Lua), and 0 otherwise. +.Sh RETURN VALUES +Returns 1 if the value at the given acceptable index is a function (either C or +Lua), and 0 otherwise. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_isfunction +manual page was written by Sergey Bronnikov. blob - /dev/null blob + d51c4611da2003784754cbe0671c32f9a3a900d8 (mode 644) --- /dev/null +++ lua_isfunction.3.html @@ -0,0 +1,52 @@ + + + + + + LUA_ISFUNCTION(3) + + + + + + + + +
LUA_ISFUNCTION(3)Library Functions ManualLUA_ISFUNCTION(3)
+
+

+lua_isfunction — +
check whether a value is a function
+

+#include + <lua.h> +
+int +
+lua_isfunction(lua_State + *L, int + index); +

+lua_isfunction() returns 1 if the value at + the given acceptable index is a function (either C or Lua), and 0 otherwise. +

+Returns 1 if the value at the given acceptable index is a function (either C or + Lua), and 0 otherwise. +

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

+The lua_isfunction() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 00622693069d916eb84155cde6b1f2aa602da642 (mode 644) --- /dev/null +++ lua_islightuserdata.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_ISLIGHTUSERDATA 3 +.Os +.Sh NAME +.Nm lua_islightuserdata +.Nd check whether a value is a light userdata +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_islightuserdata "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_islightuserdata +returns 1 if the value at the given acceptable index is a light userdata, and 0 +otherwise. +.Sh RETURN VALUES +Returns 1 if the value at the given acceptable index is a light userdata, and 0 +otherwise. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_islightuserdata +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 0040013c558c08093c7041a86161948069d1dce5 (mode 644) --- /dev/null +++ lua_islightuserdata.3.html @@ -0,0 +1,52 @@ + + + + + + LUA_ISLIGHTUSERDATA(3) + + + + + + + + +
LUA_ISLIGHTUSERDATA(3)Library Functions ManualLUA_ISLIGHTUSERDATA(3)
+
+

+lua_islightuserdata — +
check whether a value is a light userdata
+

+#include + <lua.h> +
+int +
+lua_islightuserdata(lua_State + *L, int + index); +

+lua_islightuserdata() returns 1 if the value + at the given acceptable index is a light userdata, and 0 otherwise. +

+Returns 1 if the value at the given acceptable index is a light userdata, and 0 + otherwise. +

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

+The lua_islightuserdata() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 8ece0c7f4242fdb5f7b6746be8edcc12a1a2ac6f (mode 644) --- /dev/null +++ lua_isnil.3 @@ -0,0 +1,26 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_ISNIL 3 +.Os +.Sh NAME +.Nm lua_isnil +.Nd check whether a value is a nil +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_isnil "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_isnil +returns 1 if the value at the given acceptable index is nil, and 0 otherwise. +.Sh RETURN VALUES +Returns 1 if the value at the given acceptable index is nil, and 0 otherwise. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_isnil +manual page was written by Sergey Bronnikov. blob - /dev/null blob + bb9227a6f6fe11518fb0b3e921ce2fea84665d6c (mode 644) --- /dev/null +++ lua_isnil.3.html @@ -0,0 +1,51 @@ + + + + + + LUA_ISNIL(3) + + + + + + + + +
LUA_ISNIL(3)Library Functions ManualLUA_ISNIL(3)
+
+

+lua_isnil — +
check whether a value is a nil
+

+#include + <lua.h> +
+int +
+lua_isnil(lua_State + *L, int + index); +

+lua_isnil() returns 1 if the value at the + given acceptable index is nil, and 0 otherwise. +

+Returns 1 if the value at the given acceptable index is nil, and 0 otherwise. +

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

+The lua_isnil() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 2337f07202173d7ad2ca3f92fdc3ee2ded48dac1 (mode 644) --- /dev/null +++ lua_isnone.3 @@ -0,0 +1,27 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_ISNONE 3 +.Os +.Sh NAME +.Nm lua_isnone +.Nd check whether a value is not valid +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_isnone "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_isnone +returns 1 if the given acceptable index is not valid, and 0 otherwise. +.Sh RETURN VALUES +Returns 1 if the given acceptable index is not valid (that is, it refers to an +element outside the current stack), and 0 otherwise. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_isnone +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 717893064edd0912d59f3d075941271a3e947508 (mode 644) --- /dev/null +++ lua_isnone.3.html @@ -0,0 +1,52 @@ + + + + + + LUA_ISNONE(3) + + + + + + + + +
LUA_ISNONE(3)Library Functions ManualLUA_ISNONE(3)
+
+

+lua_isnone — +
check whether a value is not valid
+

+#include + <lua.h> +
+int +
+lua_isnone(lua_State + *L, int + index); +

+lua_isnone() returns 1 if the given + acceptable index is not valid, and 0 otherwise. +

+Returns 1 if the given acceptable index is not valid (that is, it refers to an + element outside the current stack), and 0 otherwise. +

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

+The lua_isnone() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 07cf95ac0ed2af47041a8ec40b7036f8e33dffd8 (mode 644) --- /dev/null +++ lua_isnoneornil.3 @@ -0,0 +1,29 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_ISNONEORNIL 3 +.Os +.Sh NAME +.Nm lua_isnoneornil +.Nd check whether a value is not valid or if the value is nil +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_isnoneornil "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_isnoneornil +returns 1 if the given acceptable index is not valid or if the value at this +index is nil, and 0 otherwise. +.Sh RETURN VALUES +Returns 1 if the given acceptable index is not valid (that is, it refers to an +element outside the current stack) or if the value at this index is nil, and 0 +otherwise. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_isnoneornil +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 07f6c4b36e6aac6e42f3dd9148b0c134305a4636 (mode 644) --- /dev/null +++ lua_isnoneornil.3.html @@ -0,0 +1,55 @@ + + + + + + LUA_ISNONEORNIL(3) + + + + + + + + +
LUA_ISNONEORNIL(3)Library Functions ManualLUA_ISNONEORNIL(3)
+
+

+lua_isnoneornil — +
check whether a value is not valid or if the value is + nil
+

+#include + <lua.h> +
+int +
+lua_isnoneornil(lua_State + *L, int + index); +

+lua_isnoneornil() returns 1 if the given + acceptable index is not valid or if the value at this index is nil, and 0 + otherwise. +

+Returns 1 if the given acceptable index is not valid (that is, it refers to an + element outside the current stack) or if the value at this index is nil, and 0 + otherwise. +

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

+The lua_isnoneornil() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 67375aaf54cf37314d50964b4a7183d5351c0c40 (mode 644) --- /dev/null +++ lua_isnumber.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_ISNUMBER 3 +.Os +.Sh NAME +.Nm lua_isnumber +.Nd check whether a value is a number +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_isnumber "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_isnumber +returns 1 if the value at the given acceptable index is a number or a string +convertible to a number, and 0 otherwise. +.Sh RETURN VALUES +Returns 1 if the value at the given acceptable index is a number or a string +convertible to a number, and 0 otherwise. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_isnumber +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 3f4549d0691396798300229c404d2722e67f85d3 (mode 644) --- /dev/null +++ lua_isnumber.3.html @@ -0,0 +1,53 @@ + + + + + + LUA_ISNUMBER(3) + + + + + + + + +
LUA_ISNUMBER(3)Library Functions ManualLUA_ISNUMBER(3)
+
+

+lua_isnumber — +
check whether a value is a number
+

+#include + <lua.h> +
+int +
+lua_isnumber(lua_State + *L, int + index); +

+lua_isnumber() returns 1 if the value at the + given acceptable index is a number or a string convertible to a number, and 0 + otherwise. +

+Returns 1 if the value at the given acceptable index is a number or a string + convertible to a number, and 0 otherwise. +

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

+The lua_isnumber() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + d2b8c264c0da360c10c4ca87028b044e085d514f (mode 644) --- /dev/null +++ lua_isstring.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_ISSTRING 3 +.Os +.Sh NAME +.Nm lua_isstring +.Nd check whether a value is a string or a number +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_isstring "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_isstring +returns 1 if the value at the given acceptable index is a string or a number +(which is always convertible to a string), and 0 otherwise. +.Sh RETURN VALUES +Returns 1 if the value at the given acceptable index is a string or a number +(which is always convertible to a string), and 0 otherwise. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_isstring +manual page was written by Sergey Bronnikov. blob - /dev/null blob + ffa6a8811792cdc342ecec6d9ee76622a58e6119 (mode 644) --- /dev/null +++ lua_isstring.3.html @@ -0,0 +1,53 @@ + + + + + + LUA_ISSTRING(3) + + + + + + + + +
LUA_ISSTRING(3)Library Functions ManualLUA_ISSTRING(3)
+
+

+lua_isstring — +
check whether a value is a string or a number
+

+#include + <lua.h> +
+int +
+lua_isstring(lua_State + *L, int + index); +

+lua_isstring() returns 1 if the value at the + given acceptable index is a string or a number (which is always convertible to + a string), and 0 otherwise. +

+Returns 1 if the value at the given acceptable index is a string or a number + (which is always convertible to a string), and 0 otherwise. +

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

+The lua_isstring() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + 7183c88fda82f3de2b6d6add509f8a0f827110e7 (mode 644) --- /dev/null +++ lua_istable.3 @@ -0,0 +1,26 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_ISTABLE 3 +.Os +.Sh NAME +.Nm lua_istable +.Nd check whether a value is a table +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_istable "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_istable +.Sh RETURN VALUES +Returns 1 if the value at the given acceptable index is a table, and 0 +otherwise. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_istable +manual page was written by Sergey Bronnikov. blob - /dev/null blob + e39117a711dd4025854d373dba1d61eb321e0d41 (mode 644) --- /dev/null +++ lua_istable.3.html @@ -0,0 +1,51 @@ + + + + + + LUA_ISTABLE(3) + + + + + + + + +
LUA_ISTABLE(3)Library Functions ManualLUA_ISTABLE(3)
+
+

+lua_istable — +
check whether a value is a table
+

+#include + <lua.h> +
+int +
+lua_istable(lua_State + *L, int + index); +

+lua_istable() +

+Returns 1 if the value at the given acceptable index is a table, and 0 + otherwise. +

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

+The lua_istable() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + cbc0a288d97e5a2e357256fe92aafb29cb554b25 (mode 644) --- /dev/null +++ lua_isthread.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_ISTHREAD 3 +.Os +.Sh NAME +.Nm lua_isthread +.Nd check whether a value is a thread +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_isthread "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_isthread +returns 1 if the value at the given acceptable index is a thread, and 0 +otherwise. +.Sh RETURN VALUES +Returns 1 if the value at the given acceptable index is a thread, and 0 +otherwise. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_isthread +manual page was written by Sergey Bronnikov. blob - /dev/null blob + ddfab492915454a0d87db1a5891cbc1d12c54e70 (mode 644) --- /dev/null +++ lua_isthread.3.html @@ -0,0 +1,52 @@ + + + + + + LUA_ISTHREAD(3) + + + + + + + + +
LUA_ISTHREAD(3)Library Functions ManualLUA_ISTHREAD(3)
+
+

+lua_isthread — +
check whether a value is a thread
+

+#include + <lua.h> +
+int +
+lua_isthread(lua_State + *L, int + index); +

+lua_isthread() returns 1 if the value at the + given acceptable index is a thread, and 0 otherwise. +

+Returns 1 if the value at the given acceptable index is a thread, and 0 + otherwise. +

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

+The lua_isthread() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + f6b066a7389e3fcb6a819a86f7d88860da0a81a2 (mode 644) --- /dev/null +++ lua_isuserdata.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_ISUSERDATA 3 +.Os +.Sh NAME +.Nm lua_isuserdata +.Nd check whether a value is a userdata +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_isuserdata "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_isuserdata +returns 1 if the value at the given acceptable index is a userdata (either full +or light), and 0 otherwise. +.Sh RETURN VALUES +Returns 1 if the value at the given acceptable index is a userdata (either full +or light), and 0 otherwise. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_isuserdata +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 01e2c8e7455f05f9acbba7f0daaaffbebae17bcb (mode 644) --- /dev/null +++ lua_isuserdata.3.html @@ -0,0 +1,53 @@ + + + + + + LUA_ISUSERDATA(3) + + + + + + + + +
LUA_ISUSERDATA(3)Library Functions ManualLUA_ISUSERDATA(3)
+
+

+lua_isuserdata — +
check whether a value is a userdata
+

+#include + <lua.h> +
+int +
+lua_isuserdata(lua_State + *L, int + index); +

+lua_isuserdata() returns 1 if the value at + the given acceptable index is a userdata (either full or light), and 0 + otherwise. +

+Returns 1 if the value at the given acceptable index is a userdata (either full + or light), and 0 otherwise. +

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

+The lua_isuserdata() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + 21d651b70712462d3838e1f5116533fb8ce8b542 (mode 644) --- /dev/null +++ lua_lessthan.3 @@ -0,0 +1,32 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_LESSTHAN 3 +.Os +.Sh NAME +.Nm lua_lessthan +.Nd compares two values +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_lessthan "lua_State *L" "int index1" "int index2" +.Sh DESCRIPTION +.Fn lua_lessthan +.Sh RETURN VALUES +Returns 1 if the value at acceptable index +.Fa index1 +is smaller than the value at acceptable index +.Fa index2 +, following the semantics of the Lua < operator (that is, may call +metamethods). +Otherwise returns 0. +Also returns 0 if any of the indices is non valid. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_lessthan +manual page was written by Sergey Bronnikov. blob - /dev/null blob + bb2e312d20407d408c350cdbfdc7a2c59dcc145c (mode 644) --- /dev/null +++ lua_lessthan.3.html @@ -0,0 +1,55 @@ + + + + + + LUA_LESSTHAN(3) + + + + + + + + +
LUA_LESSTHAN(3)Library Functions ManualLUA_LESSTHAN(3)
+
+

+lua_lessthan — +
compares two values
+

+#include + <lua.h> +
+int +
+lua_lessthan(lua_State + *L, int + index1, int + index2); +

+lua_lessthan() +

+Returns 1 if the value at acceptable index + index1 is smaller than the value at + acceptable index index2 , following the + semantics of the Lua < operator (that is, may call metamethods). Otherwise + returns 0. Also returns 0 if any of the indices is non valid. +

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

+The lua_lessthan() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + 237d92fb3ad2cea9fa4dcbc34992d48b6fb6c50b (mode 644) --- /dev/null +++ lua_load.3 @@ -0,0 +1,59 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_LOAD 3 +.Os +.Sh NAME +.Nm lua_load +.Nd loads a Lua chunk +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_load "lua_State *L" "lua_Reader reader" "void *data" "const char *chunkname" +.Sh DESCRIPTION +.Fn lua_load +loads a Lua chunk. +If there are no errors, +.Fn lua_load +pushes the compiled chunk as a Lua function on top of the stack. +Otherwise, it pushes an error message. +.Pp +This function only loads a chunk; it does not run it. +.Pp +.Fn lua_load +automatically detects whether the chunk is text or binary, and loads it +accordingly, see +.Xr luac 1 . +.Pp +The +.Fn lua_load +function uses a user-supplied reader function to read the chunk, see +.Xr lua_Reader 3 . +The data argument is an opaque value passed to the reader function. +.Pp +The chunkname argument gives a name to the chunk, which is used for error +messages and in debug information. +.Sh RETURN VALUES +The return values of +.Fn lua_load +are: +.Pp +.Bl -tag -width LUA_ERRSYNTAX: -offset indent -compact +.It Dv 0 : +no errors; +.It Dv LUA_ERRSYNTAX : +syntax error during pre-compilation; +.It Dv LUA_ERRMEM : +memory allocation error. +.El +.Sh SEE ALSO +.Xr luac 1 , +.Xr lua_Reader 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_load +manual page was written by Sergey Bronnikov. blob - /dev/null blob + a978645f548f0c08940315516008e4372c483c44 (mode 644) --- /dev/null +++ lua_load.3.html @@ -0,0 +1,82 @@ + + + + + + LUA_LOAD(3) + + + + + + + + +
LUA_LOAD(3)Library Functions ManualLUA_LOAD(3)
+
+

+lua_load — +
loads a Lua chunk
+

+#include + <lua.h> +
+int +
+lua_load(lua_State + *L, lua_Reader + reader, void + *data, const + char *chunkname); +

+lua_load() loads a Lua chunk. If there are no + errors, lua_load() pushes the compiled + chunk as a Lua function on top of the stack. Otherwise, it pushes an error + message. +
+This function only loads a chunk; it does not run it. +
+lua_load() automatically detects whether the + chunk is text or binary, and loads it accordingly, see + luac(1). +
+The lua_load() function uses a user-supplied + reader function to read the chunk, see + lua_Reader(3). The data argument is an opaque + value passed to the reader function. +
+The chunkname argument gives a name to the chunk, which is used for error + messages and in debug information. +

+The return values of lua_load() are: +
+
+
+
:
+
no errors;
+
:
+
syntax error during pre-compilation;
+
:
+
memory allocation error.
+
+
+

+luac(1), lua_Reader(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_load() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + ab3781e7ff87589fa40aa65809b0423a4be3a187 (mode 644) --- /dev/null +++ lua_newstate.3 @@ -0,0 +1,36 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_NEWSTATE 3 +.Os +.Sh NAME +.Nm lua_newstate +.Nd creates a new, independent state +.Sh SYNOPSIS +.In lua.h +.Ft lua_State * +.Fn lua_newstate "lua_Alloc f" "void *ud" +.Sh DESCRIPTION +.Fn lua_newstate +creates a new, independent state. +The argument +.Fa f +is the allocator function; Lua does all memory allocation for this state +through this function. +The second argument, +.Fa ud , +is an opaque pointer that Lua simply passes to the allocator in every call. +.Sh RETURN VALUES +Returns +.Dv NULL +if cannot create the state +.Pq due to lack of memory . +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_newstate +manual page was written by Sergey Bronnikov. blob - /dev/null blob + f34c2c29b20d17a80a740a05c62fb838de96e703 (mode 644) --- /dev/null +++ lua_newstate.3.html @@ -0,0 +1,55 @@ + + + + + + LUA_NEWSTATE(3) + + + + + + + + +
LUA_NEWSTATE(3)Library Functions ManualLUA_NEWSTATE(3)
+
+

+lua_newstate — +
creates a new, independent state
+

+#include + <lua.h> +
+lua_State * +
+lua_newstate(lua_Alloc + f, void + *ud); +

+lua_newstate() creates a new, independent + state. The argument f is the allocator + function; Lua does all memory allocation for this state through this function. + The second argument, ud, is an opaque pointer + that Lua simply passes to the allocator in every call. +

+Returns NULL if cannot create the state (due + to lack of memory). +

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

+The lua_newstate() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + b6537ab9a19b6efd9f4c912e2dd661e01bb2bf21 (mode 644) --- /dev/null +++ lua_newtable.3 @@ -0,0 +1,26 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_NEWTABLE 3 +.Os +.Sh NAME +.Nm lua_newtable +.Nd creates a new empty table and pushes it onto the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_newtable "lua_State *L" +.Sh DESCRIPTION +.Fn lua_newtable +creates a new empty table and pushes it onto the stack. +It is equivalent to +.Em lua_createtable(L, 0, 0) . +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_newtable +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 7403955b7ff523efd094110880d6ea5c3193d036 (mode 644) --- /dev/null +++ lua_newtable.3.html @@ -0,0 +1,49 @@ + + + + + + LUA_NEWTABLE(3) + + + + + + + + +
LUA_NEWTABLE(3)Library Functions ManualLUA_NEWTABLE(3)
+
+

+lua_newtable — +
creates a new empty table and pushes it onto the + stack
+

+#include + <lua.h> +
+void +
+lua_newtable(lua_State + *L); +

+lua_newtable() creates a new empty table and + pushes it onto the stack. It is equivalent to + lua_createtable(L, 0, 0). +

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

+The lua_newtable() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + bbde69cc60bf8e531ca58595056694a088114319 (mode 644) --- /dev/null +++ lua_newthread.3 @@ -0,0 +1,37 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_NEWTHREAD 3 +.Os +.Sh NAME +.Nm lua_newthread +.Nd creates a new thread +.Sh SYNOPSIS +.In lua.h +.Ft lua_State * +.Fn lua_newthread "lua_State *L" +.Sh DESCRIPTION +.Fn lua_newthread +creates a new thread, pushes it on the stack, and returns a pointer to a +.Xr lua_State 3 +that represents this new thread. +The new state returned by this function shares with the original state all +global objects (such as tables), but has an independent execution stack. +.Pp +There is no explicit function to close or to destroy a thread. +Threads are subject to garbage collection, like any Lua object. +.Sh RETURN VALUES +.Fn lua_newthread +returns a pointer to a +.Xr lua_State 3 +that represents this new thread. +.Sh SEE ALSO +.Xr lua_State 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_newthread +manual page was written by Sergey Bronnikov. blob - /dev/null blob + b54d4fe6e650c3078385c62318d5083a4ce4b43d (mode 644) --- /dev/null +++ lua_newthread.3.html @@ -0,0 +1,59 @@ + + + + + + LUA_NEWTHREAD(3) + + + + + + + + +
LUA_NEWTHREAD(3)Library Functions ManualLUA_NEWTHREAD(3)
+
+

+lua_newthread — +
creates a new thread
+

+#include + <lua.h> +
+lua_State * +
+lua_newthread(lua_State + *L); +

+lua_newthread() creates a new thread, pushes + it on the stack, and returns a pointer to a + lua_State(3) that represents this new thread. The + new state returned by this function shares with the original state all global + objects (such as tables), but has an independent execution stack. +
+There is no explicit function to close or to destroy a thread. Threads are + subject to garbage collection, like any Lua object. +

+lua_newthread() returns a pointer to a + lua_State(3) that represents this new thread. +

+lua_State(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_newthread() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + 30e905ded2624b87f7cddf4b32450a842fdf0ef5 (mode 644) --- /dev/null +++ lua_newuserdata.3 @@ -0,0 +1,37 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_NEWUSERDATA 3 +.Os +.Sh NAME +.Nm lua_newuserdata +.Nd allocates a new block of memory with the given size +.Sh SYNOPSIS +.In lua.h +.Ft void * +.Fn lua_newuserdata "lua_State *L" "size_t size" +.Sh DESCRIPTION +.Fn lua_newuserdata +allocates a new block of memory with the given size, pushes onto the stack a +new full userdata with the block address, and returns this address. +.Pp +Userdata represent C values in Lua. +A +.Em full +userdata represents a block of memory. +It is an object (like a table): you must create it, it can have its own +metatable, and you can detect when it is being collected. +A full userdata is only equal to itself (under raw equality). +.Pp +When Lua collects a full userdata with a gc metamethod, Lua calls the +metamethod and marks the userdata as finalized. +When this userdata is collected again then Lua frees its corresponding memory. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_newuserdata +manual page was written by Sergey Bronnikov. blob - /dev/null blob + c8ecebcde1af644c9f4ab59ced1615574dfa425d (mode 644) --- /dev/null +++ lua_newuserdata.3.html @@ -0,0 +1,59 @@ + + + + + + LUA_NEWUSERDATA(3) + + + + + + + + +
LUA_NEWUSERDATA(3)Library Functions ManualLUA_NEWUSERDATA(3)
+
+

+lua_newuserdata — +
allocates a new block of memory with the given + size
+

+#include + <lua.h> +
+void * +
+lua_newuserdata(lua_State + *L, size_t + size); +

+lua_newuserdata() allocates a new block of + memory with the given size, pushes onto the stack a new full userdata with the + block address, and returns this address. +
+Userdata represent C values in Lua. A full userdata + represents a block of memory. It is an object (like a table): you must create + it, it can have its own metatable, and you can detect when it is being + collected. A full userdata is only equal to itself (under raw equality). +
+When Lua collects a full userdata with a gc metamethod, Lua calls the metamethod + and marks the userdata as finalized. When this userdata is collected again + then Lua frees its corresponding memory. +

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

+The lua_newuserdata() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + 4c65fdbd197e5248213707078628affa858e637a (mode 644) --- /dev/null +++ lua_next.3 @@ -0,0 +1,52 @@ +.Dd $Mdocdate: July 20 2022 $ +.Dt LUA_NEXT 3 +.Os +.Sh NAME +.Nm lua_next +.Nd pops a key from the stack, and pushes a key-value pair from the table +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_next "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_next +pops a key from the stack, and pushes a key-value pair from the table at the +given index (the "next" pair after the given key). +If there are no more elements in the table, then +.Nm lua_next +returns 0 (and pushes nothing). +.Pp +A typical traversal looks like this: +.Pp +.Bd -literal -offset indent -compact +/* table is in the stack at index 't' */ +lua_pushnil(L); /* first key */ +while (lua_next(L, t) != 0) { + /* uses 'key' (at index -2) and 'value' (at index -1) */ + printf("%s - %s\n", + lua_typename(L, lua_type(L, -2)), + lua_typename(L, lua_type(L, -1))); + /* removes 'value'; keeps 'key' for next iteration */ + lua_pop(L, 1); +} +.Ed +.Pp +While traversing a table, do not call +.Xr lua_tolstring 3 +directly on a key, unless you know that the key is actually a string. +Recall that +.Xr lua_tolstring 3 +changes the value at the given index; this confuses the next call to +.Nm lua_next . +.Sh SEE ALSO +.Xr lua_tolstring 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_next +manual page was written by Sergey Bronnikov. blob - /dev/null blob + dcaa27caf94fddc44347e1b5c960495099c7f6db (mode 644) --- /dev/null +++ lua_next.3.html @@ -0,0 +1,78 @@ + + + + + + LUA_NEXT(3) + + + + + + + + +
LUA_NEXT(3)Library Functions ManualLUA_NEXT(3)
+
+

+lua_next — +
pops a key from the stack, and pushes a key-value + pair from the table
+

+#include + <lua.h> +
+int +
+lua_next(lua_State + *L, int + index); +

+lua_next() pops a key from the stack, and + pushes a key-value pair from the table at the given index (the + "next" pair after the given key). If there are no more elements in + the table, then lua_next returns 0 (and + pushes nothing). +
+A typical traversal looks like this: +
+
+
+/* table is in the stack at index 't' */ 
+lua_pushnil(L);  /* first key */ 
+while (lua_next(L, t) != 0) { 
+  /* uses 'key' (at index -2) and 'value' (at index -1) */ 
+  printf("%s - %s0, 
+         lua_typename(L, lua_type(L, -2)), 
+         lua_typename(L, lua_type(L, -1))); 
+  /* removes 'value'; keeps 'key' for next iteration */ 
+  lua_pop(L, 1); 
+}
+
+
+
+While traversing a table, do not call + lua_tolstring(3) directly on a key, unless you + know that the key is actually a string. Recall that + lua_tolstring(3) changes the value at the given + index; this confuses the next call to + lua_next. +

+lua_tolstring(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_next() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 20, 2022Debian
+ + blob - /dev/null blob + f82aec52f12a48d83f9dab1aae2a3ba1abedcbd9 (mode 644) --- /dev/null +++ lua_objlen.3 @@ -0,0 +1,29 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_OBJLEN 3 +.Os +.Sh NAME +.Nm lua_objlen +.Nd returns the "length" of the value +.Sh SYNOPSIS +.In lua.h +.Ft size_t +.Fn lua_objlen "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_objlen +returns the +.Qq length +of the value at the given acceptable index: for strings, this is the string +length; for tables, this is the result of the length operator ('#'); for +userdata, this is the size of the block of memory allocated for the userdata; +for other values, it is 0. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_objlen +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 0887d3133b0d7332f851c83e94ee3c8b6e1a7ac5 (mode 644) --- /dev/null +++ lua_objlen.3.html @@ -0,0 +1,51 @@ + + + + + + LUA_OBJLEN(3) + + + + + + + + +
LUA_OBJLEN(3)Library Functions ManualLUA_OBJLEN(3)
+
+

+lua_objlen — +
returns the length of the value
+

+#include + <lua.h> +
+size_t +
+lua_objlen(lua_State + *L, int + index); +

+lua_objlen() returns the + “length” of the value at the given acceptable index: for + strings, this is the string length; for tables, this is the result of the + length operator ('#'); for userdata, this is the size of the block of memory + allocated for the userdata; for other values, it is 0. +

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

+The lua_objlen() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + e01fb2e0c7eee1981dd998348efa301d22119392 (mode 644) --- /dev/null +++ lua_pcall.3 @@ -0,0 +1,78 @@ +.Dd $Mdocdate: July 20 2022 $ +.Dt LUA_PCALL 3 +.Os +.Sh NAME +.Nm lua_pcall +.Nd calls a function in protected mode +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_pcall "lua_State *L" "int nargs" "int nresults" "int errfunc" +.Sh DESCRIPTION +.Fn lua_pcall +calls a function in protected mode. +.Pp +Both +.Fa nargs +and +.Fa nresults +have the same meaning as in +.Xr lua_call 3 . +If there are no errors during the call, +.Nm lua_pcall +behaves exactly like +.Xr lua_call 3 . +However, if there is any error, +.Nm lua_pcall +catches it, pushes a single value on the stack (the error message), and returns +an error code. +Like +.Xr lua_call 3 , +.Nm lua_pcall +always removes the function and its arguments from the stack. +.Pp +If +.Fa errfunc +is 0, then the error message returned on the stack is exactly the original +error message. +Otherwise, +.Fa errfunc +is the stack index of an +.Em error handler function . +(In the current implementation, this index cannot be a pseudo-index.) +In case of runtime errors, this function will be called with the error message +and its return value will be the message returned on the stack by +.Nm lua_pcall . +.Pp +Typically, the error handler function is used to add more debug information to +the error message, such as a stack traceback. +Such information cannot be gathered after the return of +.Nm lua_pcall , +since by then the stack has unwound. +.Sh RETURN VALUES +The +.Nm lua_pcall +function returns 0 in case of success or one of the following error codes +.Pq defined in In lua.h : +.Pp +.Bl -tag -width LUA_ERRRUN: -offset indent -compact +.It Dv LUA_ERRRUN : +a runtime error. +.It Dv LUA_ERRMEM : +memory allocation error. +For such errors, Lua does not call the error handler function. +.It Dv LUA_ERRERR : +error while running the error handler function. +.El +.Sh SEE ALSO +.Xr lua_call 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pcall +manual page was written by Sergey Bronnikov. blob - /dev/null blob + bafe33cf98adfb21bd26330ed5534dfc7fdde3cf (mode 644) --- /dev/null +++ lua_pcall.3.html @@ -0,0 +1,94 @@ + + + + + + LUA_PCALL(3) + + + + + + + + +
LUA_PCALL(3)Library Functions ManualLUA_PCALL(3)
+
+

+lua_pcall — +
calls a function in protected mode
+

+#include + <lua.h> +
+int +
+lua_pcall(lua_State + *L, int + nargs, int + nresults, int + errfunc); +

+lua_pcall() calls a function in protected + mode. +
+Both nargs and + nresults have the same meaning as in + lua_call(3). If there are no errors during the + call, lua_pcall behaves exactly like + lua_call(3). However, if there is any error, + lua_pcall catches it, pushes a single value + on the stack (the error message), and returns an error code. Like + lua_call(3), + lua_pcall always removes the function and + its arguments from the stack. +
+If errfunc is 0, then the error message + returned on the stack is exactly the original error message. Otherwise, + errfunc is the stack index of an + error handler function. (In the current + implementation, this index cannot be a pseudo-index.) In case of runtime + errors, this function will be called with the error message and its return + value will be the message returned on the stack by + lua_pcall. +
+Typically, the error handler function is used to add more debug information to + the error message, such as a stack traceback. Such information cannot be + gathered after the return of lua_pcall, + since by then the stack has unwound. +

+The lua_pcall function returns 0 in case of + success or one of the following error codes (defined in + <lua.h>): +
+
+
+
:
+
a runtime error.
+
:
+
memory allocation error. For such errors, Lua does not call the error + handler function.
+
:
+
error while running the error handler function.
+
+
+

+lua_call(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_pcall() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 20, 2022Debian
+ + blob - /dev/null blob + 3eeb713cf122b1a45f313bb8e74a1188ee5a709f (mode 644) --- /dev/null +++ lua_pop.3 @@ -0,0 +1,26 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_POP 3 +.Os +.Sh NAME +.Nm lua_pop +.Nd pops n elements from the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_pop "lua_State *L" "int n" +.Sh DESCRIPTION +.Fn lua_pop +pops +.Fa n +elements from the stack. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pop +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 0f7297c88965d2c9a9f5487051f8f9f19f331879 (mode 644) --- /dev/null +++ lua_pop.3.html @@ -0,0 +1,48 @@ + + + + + + LUA_POP(3) + + + + + + + + +
LUA_POP(3)Library Functions ManualLUA_POP(3)
+
+

+lua_pop — +
pops n elements from the stack
+

+#include + <lua.h> +
+void +
+lua_pop(lua_State + *L, int + n); +

+lua_pop() pops + n elements from the stack. +

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

+The lua_pop() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + b40f464897dadd50ff68310ed12878850fb9cc6a (mode 644) --- /dev/null +++ lua_pushboolean.3 @@ -0,0 +1,26 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_PUSHBOOLEAN 3 +.Os +.Sh NAME +.Nm lua_pushboolean +.Nd pushes a boolean value onto the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_pushboolean "lua_State *L" "int b" +.Sh DESCRIPTION +.Fn lua_pushboolean +pushes a boolean value with value +.Fa b +onto the stack. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pushboolean +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 35833874179d3c4ad0c96e8ab5781d3902e241b8 (mode 644) --- /dev/null +++ lua_pushboolean.3.html @@ -0,0 +1,48 @@ + + + + + + LUA_PUSHBOOLEAN(3) + + + + + + + + +
LUA_PUSHBOOLEAN(3)Library Functions ManualLUA_PUSHBOOLEAN(3)
+
+

+lua_pushboolean — +
pushes a boolean value onto the stack
+

+#include + <lua.h> +
+void +
+lua_pushboolean(lua_State + *L, int + b); +

+lua_pushboolean() pushes a boolean value with + value b onto the stack. +

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

+The lua_pushboolean() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + 70ad7890e458b094daf24662bdf2db67c8ce4453 (mode 644) --- /dev/null +++ lua_pushcclosure.3 @@ -0,0 +1,41 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_PUSHCCLOSURE 3 +.Os +.Sh NAME +.Nm lua_pushcclosure +.Nd pushes a new C closure onto the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_pushcclosure "lua_State *L" "lua_CFunction fn" "int n" +.Sh DESCRIPTION +.Fn lua_pushcclosure +pushes a new C closure onto the stack. +.Pp +When a C function is created, it is possible to associate some values with it, +thus creating a C closure; these values are then accessible to the function +whenever it is called. +To associate values with a C function, first these values should be pushed onto +the stack (when there are multiple values, the first value is pushed first). +Then +.Fn lua_pushcclosure +is called to create and push the C function onto the stack, with the argument +.Fa n +telling how many values should be associated with the function. +.Fn lua_pushcclosure +also pops these values from the stack. +.Pp +The maximum value for +.Fa n +is 255. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pushcclosure +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 117e6037055ded599add48311fc819f673d13164 (mode 644) --- /dev/null +++ lua_pushcclosure.3.html @@ -0,0 +1,64 @@ + + + + + + LUA_PUSHCCLOSURE(3) + + + + + + + + +
LUA_PUSHCCLOSURE(3)Library Functions ManualLUA_PUSHCCLOSURE(3)
+
+

+lua_pushcclosure — +
pushes a new C closure onto the stack
+

+#include + <lua.h> +
+void +
+lua_pushcclosure(lua_State + *L, + lua_CFunction + fn, int + n); +

+lua_pushcclosure() pushes a new C closure + onto the stack. +
+When a C function is created, it is possible to associate some values with it, + thus creating a C closure; these values are then accessible to the function + whenever it is called. To associate values with a C function, first these + values should be pushed onto the stack (when there are multiple values, the + first value is pushed first). Then + lua_pushcclosure() is called to create and + push the C function onto the stack, with the argument + n telling how many values should be + associated with the function. + lua_pushcclosure() also pops these values + from the stack. +
+The maximum value for n is 255. +

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

+The lua_pushcclosure() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + 5bc6792d7ca20354bf9ee8f0c26391fefc00a899 (mode 644) --- /dev/null +++ lua_pushcfunction.3 @@ -0,0 +1,39 @@ +.Dd $Mdocdate: July 20 2022 $ +.Dt LUA_PUSHCFUNCTION 3 +.Os +.Sh NAME +.Nm lua_pushcfunction +.Nd pushes a C function onto the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_pushcfunction "lua_State *L" "lua_CFunction f" +.Sh DESCRIPTION +.Fn lua_pushcfunction +pushes a C function onto the stack. +This function receives a pointer to a C function and pushes onto the stack a +Lua value of type function that, when called, invokes the corresponding C +function. +.Pp +Any function to be registered in Lua must follow the correct protocol to +receive its parameters and return its results +.Pq see Xr lua_CFunction 3 . +.Pp +.Nm lua_pushcfunction +is defined as a macro: +.Pp +.Bd -literal -offset indent -compact +#define lua_pushcfunction(L,f) lua_pushcclosure(L,f,0) +.Ed +.Sh SEE ALSO +.Xr lua_CFunction 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pushcfunction +manual page was written by Sergey Bronnikov. blob - /dev/null blob + afae11a1640c6415c64f3eef253ee47139792a58 (mode 644) --- /dev/null +++ lua_pushcfunction.3.html @@ -0,0 +1,65 @@ + + + + + + LUA_PUSHCFUNCTION(3) + + + + + + + + +
LUA_PUSHCFUNCTION(3)Library Functions ManualLUA_PUSHCFUNCTION(3)
+
+

+lua_pushcfunction — +
pushes a C function onto the stack
+

+#include + <lua.h> +
+void +
+lua_pushcfunction(lua_State + *L, + lua_CFunction + f); +

+lua_pushcfunction() pushes a C function onto + the stack. This function receives a pointer to a C function and pushes onto + the stack a Lua value of type function that, when called, invokes the + corresponding C function. +
+Any function to be registered in Lua must follow the correct protocol to receive + its parameters and return its results (see + lua_CFunction(3)). +
+lua_pushcfunction is defined as a macro: +
+
+
+#define lua_pushcfunction(L,f)  lua_pushcclosure(L,f,0)
+
+
+

+lua_CFunction(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_pushcfunction() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 20, 2022Debian
+ + blob - /dev/null blob + c065ffc23a112d797c89441e1f50f44b0a7cfc12 (mode 644) --- /dev/null +++ lua_pushfstring.3 @@ -0,0 +1,51 @@ +.Dd $Mdocdate: July 20 2022 $ +.Dt LUA_PUSHFSTRING 3 +.Os +.Sh NAME +.Nm lua_pushfstring +.Nd pushes onto the stack a formatted string and returns a pointer to this string +.Sh SYNOPSIS +.In lua.h +.Ft const char * +.Fn lua_pushfstring "lua_State *L" "const char *fmt" "..." +.Sh DESCRIPTION +.Fn lua_pushfstring +pushes onto the stack a formatted string and returns a pointer to this string. +It is similar to the C function +.Xr sprintf 3 , +but has some important differences: +.Bl -hyphen +.It +You do not have to allocate space for the result: the result is a Lua string +and Lua takes care of memory allocation (and deallocation, through garbage +collection). +.It +The conversion specifiers are quite restricted. +There are no flags, widths, or precisions. +The conversion specifiers can only be +.Sq %% +.Pq inserts a '%' in the string , +.Sq %s +.Pq inserts a zero-terminated string, with no size restrictions , +.Sq %f +.Pq inserts a Xr lua_Number 3 , +.Sq %p +.Pq inserts a pointer as a hexadecimal numeral , +.Sq %d +.Pq inserts an int , +and +.Sq %c +.Pq inserts an int as a character . +.El +.Sh SEE ALSO +.Xr lua_Number 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pushfstring +manual page was written by Sergey Bronnikov. blob - /dev/null blob + bc912fa9e8dd7be08fbc72674e34fa583e59bfda (mode 644) --- /dev/null +++ lua_pushfstring.3.html @@ -0,0 +1,67 @@ + + + + + + LUA_PUSHFSTRING(3) + + + + + + + + +
LUA_PUSHFSTRING(3)Library Functions ManualLUA_PUSHFSTRING(3)
+
+

+lua_pushfstring — +
pushes onto the stack a formatted string and returns + a pointer to this string
+

+#include + <lua.h> +
+const char * +
+lua_pushfstring(lua_State + *L, const char + *fmt, + ...); +

+lua_pushfstring() pushes onto the stack a + formatted string and returns a pointer to this string. It is similar to the C + function sprintf(3), but has some important + differences: +
    +
  • You do not have to allocate space for the result: the result is a Lua + string and Lua takes care of memory allocation (and deallocation, through + garbage collection).
  • +
  • The conversion specifiers are quite restricted. There are no flags, + widths, or precisions. The conversion specifiers can only be + ‘%%’ (inserts a '%' in the string), ‘%s’ + (inserts a zero-terminated string, with no size restrictions), + ‘%f’ (inserts a lua_Number(3)), + ‘%p’ (inserts a pointer as a hexadecimal numeral), + ‘%d’ (inserts an int), and ‘%c’ (inserts an + int as a character).
  • +
+

+lua_Number(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_pushfstring() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 20, 2022Debian
+ + blob - /dev/null blob + f4c30ac1c8fccba70d2d0a48295f34feda50abad (mode 644) --- /dev/null +++ lua_pushinteger.3 @@ -0,0 +1,26 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_PUSHINTEGER 3 +.Os +.Sh NAME +.Nm lua_pushinteger +.Nd pushes a number with value +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_pushinteger "lua_State *L" "lua_Integer n" +.Sh DESCRIPTION +.Fn lua_pushinteger +pushes a number with value +.Fa n +onto the stack. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pushinteger +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 7336ba7b1369dd09045687bfede86d0eea184649 (mode 644) --- /dev/null +++ lua_pushinteger.3.html @@ -0,0 +1,48 @@ + + + + + + LUA_PUSHINTEGER(3) + + + + + + + + +
LUA_PUSHINTEGER(3)Library Functions ManualLUA_PUSHINTEGER(3)
+
+

+lua_pushinteger — +
pushes a number with value
+

+#include + <lua.h> +
+void +
+lua_pushinteger(lua_State + *L, lua_Integer + n); +

+lua_pushinteger() pushes a number with value + n onto the stack. +

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

+The lua_pushinteger() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + 7f8b7abeed4c70a2c5031521e2e9148d581bb69c (mode 644) --- /dev/null +++ lua_pushlightuserdata.3 @@ -0,0 +1,32 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_PUSHLIGHTUSERDATA 3 +.Os +.Sh NAME +.Nm lua_pushlightuserdata +.Nd pushes a light userdata onto the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_pushlightuserdata "lua_State *L" "void *p" +.Sh DESCRIPTION +.Fn lua_pushlightuserdata +pushes a light userdata onto the stack. +.Pp +Userdata represent C values in Lua. +A +.Em light userdata +represents a pointer. +It is a value (like a number): you do not create it, it has no individual +metatable, and it is not collected (as it was never created). +A light userdata is equal to "any" light userdata with the same C address. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pushlightuserdata +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 5baef8d0656b61dae693063d6aa179beb987a303 (mode 644) --- /dev/null +++ lua_pushlightuserdata.3.html @@ -0,0 +1,54 @@ + + + + + + LUA_PUSHLIGHTUSERDATA(3) + + + + + + + + +
LUA_PUSHLIGHTUSERDATA(3)Library Functions ManualLUA_PUSHLIGHTUSERDATA(3)
+
+

+lua_pushlightuserdata — +
pushes a light userdata onto the stack
+

+#include + <lua.h> +
+void +
+lua_pushlightuserdata(lua_State + *L, void + *p); +

+lua_pushlightuserdata() pushes a light + userdata onto the stack. +
+Userdata represent C values in Lua. A light + userdata represents a pointer. It is a value (like a number): you do not + create it, it has no individual metatable, and it is not collected (as it was + never created). A light userdata is equal to "any" light userdata + with the same C address. +

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

+The lua_pushlightuserdata() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + 8101ddd879ebffdf06e27d929efa48bde44a04c9 (mode 644) --- /dev/null +++ lua_pushliteral.3 @@ -0,0 +1,33 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_PUSHLITERAL 3 +.Os +.Sh NAME +.Nm lua_pushliteral +.Nd pushes the string onto the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_pushliteral "lua_State *L" "const char *s" +.Sh DESCRIPTION +.Fn lua_pushliteral +pushes the string pointed to by +.Fa s +onto the stack. +This macro is equivalent to +.Xr lua_pushlstring 3 , +but can be used only when +.Fa s +is a literal string. +In these cases, it automatically provides the string length. +.Sh SEE ALSO +.Xr lua_pushlstring 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pushliteral +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 7b1e2cb76bac3a4d92fcf08250450e0058052525 (mode 644) --- /dev/null +++ lua_pushliteral.3.html @@ -0,0 +1,53 @@ + + + + + + LUA_PUSHLITERAL(3) + + + + + + + + +
LUA_PUSHLITERAL(3)Library Functions ManualLUA_PUSHLITERAL(3)
+
+

+lua_pushliteral — +
pushes the string onto the stack
+

+#include + <lua.h> +
+void +
+lua_pushliteral(lua_State + *L, const char + *s); +

+lua_pushliteral() pushes the string pointed + to by s onto the stack. This macro is + equivalent to lua_pushlstring(3), but can be used + only when s is a literal string. In these + cases, it automatically provides the string length. +

+lua_pushlstring(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_pushliteral() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + a328231fead150c3c2528d5e3b78039f01c1fad0 (mode 644) --- /dev/null +++ lua_pushlstring.3 @@ -0,0 +1,33 @@ +.Dd $Mdocdate: July 20 2022 $ +.Dt LUA_PUSHLSTRING 3 +.Os +.Sh NAME +.Nm lua_pushlstring +.Nd pushes the string onto the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_pushlstring "lua_State *L" "const char *s" "size_t len" +.Sh DESCRIPTION +.Fn lua_pushlstring +pushes the string pointed to by +.Fa s +with size +.Fa len +onto the stack. +.Pp +Lua makes (or reuses) an internal copy of the given string, so the memory at +.Fa s +can be freed or reused immediately after the function returns. +The string can contain embedded zeros. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pushlstring +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 4f84b751f7e68ca94c9e98372a202c007a7424dd (mode 644) --- /dev/null +++ lua_pushlstring.3.html @@ -0,0 +1,54 @@ + + + + + + LUA_PUSHLSTRING(3) + + + + + + + + +
LUA_PUSHLSTRING(3)Library Functions ManualLUA_PUSHLSTRING(3)
+
+

+lua_pushlstring — +
pushes the string onto the stack
+

+#include + <lua.h> +
+void +
+lua_pushlstring(lua_State + *L, const char + *s, size_t + len); +

+lua_pushlstring() pushes the string pointed + to by s with size + len onto the stack. +
+Lua makes (or reuses) an internal copy of the given string, so the memory at + s can be freed or reused immediately after + the function returns. The string can contain embedded zeros. +

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

+The lua_pushlstring() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 20, 2022Debian
+ + blob - /dev/null blob + 1c505590ce83da0933717df4f6e4c257ad8a1a75 (mode 644) --- /dev/null +++ lua_pushnil.3 @@ -0,0 +1,24 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_PUSHNIL 3 +.Os +.Sh NAME +.Nm lua_pushnil +.Nd pushes a nil value onto the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_pushnil "lua_State *L" +.Sh DESCRIPTION +.Fn lua_pushnil +pushes a nil value onto the stack. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pushnil +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 81e9b09fa43c8f15742019051dd4858f0279a0d0 (mode 644) --- /dev/null +++ lua_pushnil.3.html @@ -0,0 +1,47 @@ + + + + + + LUA_PUSHNIL(3) + + + + + + + + +
LUA_PUSHNIL(3)Library Functions ManualLUA_PUSHNIL(3)
+
+

+lua_pushnil — +
pushes a nil value onto the stack
+

+#include + <lua.h> +
+void +
+lua_pushnil(lua_State + *L); +

+lua_pushnil() pushes a nil value onto the + stack. +

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

+The lua_pushnil() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + 4f019f90f2eba384485cb30f9b2af96595567df3 (mode 644) --- /dev/null +++ lua_pushnumber.3 @@ -0,0 +1,26 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_PUSHNUMBER 3 +.Os +.Sh NAME +.Nm lua_pushnumber +.Nd pushes a number onto the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_pushnumber "lua_State *L" "lua_Number n" +.Sh DESCRIPTION +.Fn lua_pushnumber +pushes a number with value +.Fa n +onto the stack. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pushnumber +manual page was written by Sergey Bronnikov. blob - /dev/null blob + dc90e96cb382e3b6c74e985cf543c51118989fd2 (mode 644) --- /dev/null +++ lua_pushnumber.3.html @@ -0,0 +1,48 @@ + + + + + + LUA_PUSHNUMBER(3) + + + + + + + + +
LUA_PUSHNUMBER(3)Library Functions ManualLUA_PUSHNUMBER(3)
+
+

+lua_pushnumber — +
pushes a number onto the stack
+

+#include + <lua.h> +
+void +
+lua_pushnumber(lua_State + *L, lua_Number + n); +

+lua_pushnumber() pushes a number with value + n onto the stack. +

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

+The lua_pushnumber() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + f3122713b944e304cab730ec25318c76c4c753eb (mode 644) --- /dev/null +++ lua_pushstring.3 @@ -0,0 +1,31 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_PUSHSTRING 3 +.Os +.Sh NAME +.Nm lua_pushstring +.Nd pushes the zero-terminated string onto the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_pushstring "lua_State *L" "const char *s" +.Sh DESCRIPTION +.Fn lua_pushstring +pushes the zero-terminated string pointed to by +.Fa s +onto the stack. +Lua makes (or reuses) an internal copy of the given string, so the memory at +.Fa s +can be freed or reused immediately after the function returns. +The string cannot contain embedded zeros; it is assumed to end at the first +zero. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pushstring +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 786cb95ba70b1f0e5cd2f020dcc7ece978a3c4b8 (mode 644) --- /dev/null +++ lua_pushstring.3.html @@ -0,0 +1,53 @@ + + + + + + LUA_PUSHSTRING(3) + + + + + + + + +
LUA_PUSHSTRING(3)Library Functions ManualLUA_PUSHSTRING(3)
+
+

+lua_pushstring — +
pushes the zero-terminated string onto the + stack
+

+#include + <lua.h> +
+void +
+lua_pushstring(lua_State + *L, const char + *s); +

+lua_pushstring() pushes the zero-terminated + string pointed to by s onto the stack. Lua + makes (or reuses) an internal copy of the given string, so the memory at + s can be freed or reused immediately after + the function returns. The string cannot contain embedded zeros; it is assumed + to end at the first zero. +

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

+The lua_pushstring() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + a04d41c98c28dd42391ca443d24145347328a263 (mode 644) --- /dev/null +++ lua_pushthread.3 @@ -0,0 +1,27 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_PUSHTHREAD 3 +.Os +.Sh NAME +.Nm lua_pushthread +.Nd pushes the thread onto the stack +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_pushthread "lua_State *L" +.Sh DESCRIPTION +.Fn lua_pushthread +pushes the thread represented by +.Fa L +onto the stack. +Returns 1 if this thread is the main thread of its state. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pushthread +manual page was written by Sergey Bronnikov. blob - /dev/null blob + f7846e7b49ce4cb31ee723001ff382ff7a432b3c (mode 644) --- /dev/null +++ lua_pushthread.3.html @@ -0,0 +1,48 @@ + + + + + + LUA_PUSHTHREAD(3) + + + + + + + + +
LUA_PUSHTHREAD(3)Library Functions ManualLUA_PUSHTHREAD(3)
+
+

+lua_pushthread — +
pushes the thread onto the stack
+

+#include + <lua.h> +
+int +
+lua_pushthread(lua_State + *L); +

+lua_pushthread() pushes the thread + represented by L onto the stack. Returns 1 if + this thread is the main thread of its state. +

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

+The lua_pushthread() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + d0fe3d4ce1b275e0de3d3f61697c73308f74955d (mode 644) --- /dev/null +++ lua_pushvalue.3 @@ -0,0 +1,24 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_PUSHVALUE 3 +.Os +.Sh NAME +.Nm lua_pushvalue +.Nd pushes a copy of the element onto the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_pushvalue "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_pushvalue +pushes a copy of the element at the given valid index onto the stack. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pushvalue +manual page was written by Sergey Bronnikov. blob - /dev/null blob + e6836c9f9fccb5854620582bf10c600f6ac824e9 (mode 644) --- /dev/null +++ lua_pushvalue.3.html @@ -0,0 +1,48 @@ + + + + + + LUA_PUSHVALUE(3) + + + + + + + + +
LUA_PUSHVALUE(3)Library Functions ManualLUA_PUSHVALUE(3)
+
+

+lua_pushvalue — +
pushes a copy of the element onto the stack
+

+#include + <lua.h> +
+void +
+lua_pushvalue(lua_State + *L, int + index); +

+lua_pushvalue() pushes a copy of the element + at the given valid index onto the stack. +

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

+The lua_pushvalue() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + 3c78e20c9b4d037ac42a712117afeb62a223be69 (mode 644) --- /dev/null +++ lua_pushvfstring.3 @@ -0,0 +1,30 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_PUSHVFSTRING 3 +.Os +.Sh NAME +.Nm lua_pushvfstring +.Nd pushes onto the stack a formatted string and returns a pointer to this string +.Sh SYNOPSIS +.In lua.h +.Ft const char * +.Fn lua_pushvfstring "lua_State *L" "const char *fmt" "va_list argp" +.Sh DESCRIPTION +.Fn lua_pushvfstring +pushes onto the stack a formatted string and returns a pointer to this string. +Equivalent to +.Xr lua_pushfstring 3 , +except that it receives a +.Fa va_list +instead of a variable number of arguments. +.Sh SEE ALSO +.Xr lua_pushfstring 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_pushvfstring +manual page was written by Sergey Bronnikov. blob - /dev/null blob + ccb21a45e1f345829fd7f5ee691778bbcd9fe4f1 (mode 644) --- /dev/null +++ lua_pushvfstring.3.html @@ -0,0 +1,55 @@ + + + + + + LUA_PUSHVFSTRING(3) + + + + + + + + +
LUA_PUSHVFSTRING(3)Library Functions ManualLUA_PUSHVFSTRING(3)
+
+

+lua_pushvfstring — +
pushes onto the stack a formatted string and returns + a pointer to this string
+

+#include + <lua.h> +
+const char * +
+lua_pushvfstring(lua_State + *L, const char + *fmt, va_list + argp); +

+lua_pushvfstring() pushes onto the stack a + formatted string and returns a pointer to this string. Equivalent to + lua_pushfstring(3), except that it receives a + va_list instead of a variable number of + arguments. +

+lua_pushfstring(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_pushvfstring() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + 3c00a0b9d0e3b302ce03e84bccd567ae3462dfcf (mode 644) --- /dev/null +++ lua_rawequal.3 @@ -0,0 +1,30 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_RAWEQUAL 3 +.Os +.Sh NAME +.Nm lua_rawequal +.Nd compare two values for equality without calling metamethods +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_rawequal "lua_State *L" "int index1" "int index2" +.Sh DESCRIPTION +.Fn lua_rawequal +returns 1 if the two values in acceptable indices +.Fa index1 +and +.Fa index2 +are primitively equal (that is, without calling metamethods). +Otherwise returns 0. +Also returns 0 if any of the indices are non valid. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_rawequal +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 08148ee26876b25f1aa0037fe6bc0858413bc224 (mode 644) --- /dev/null +++ lua_rawequal.3.html @@ -0,0 +1,53 @@ + + + + + + LUA_RAWEQUAL(3) + + + + + + + + +
LUA_RAWEQUAL(3)Library Functions ManualLUA_RAWEQUAL(3)
+
+

+lua_rawequal — +
compare two values for equality without calling + metamethods
+

+#include + <lua.h> +
+int +
+lua_rawequal(lua_State + *L, int + index1, int + index2); +

+lua_rawequal() returns 1 if the two values in + acceptable indices index1 and + index2 are primitively equal (that is, + without calling metamethods). Otherwise returns 0. Also returns 0 if any of + the indices are non valid. +

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

+The lua_rawequal() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + c51fc0adf15bad5eaf762ebd934fe079157ecd07 (mode 644) --- /dev/null +++ lua_rawget.3 @@ -0,0 +1,32 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_RAWGET 3 +.Os +.Sh NAME +.Nm lua_rawget +.Nd pops the key from the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_rawget "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_rawget +pops the key from the stack (putting the resulting value in its place). +As in Lua, this function may trigger a metamethod for the +.Qq index +event. +Similar to +.Xr lua_gettable 3 , +but does a raw access +.Pq i.e., without metamethods . +.Sh SEE ALSO +.Xr lua_gettable 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_rawget +manual page was written by Sergey Bronnikov. blob - /dev/null blob + c64320a743c39859e628cec980a0ccea8c47e0ec (mode 644) --- /dev/null +++ lua_rawget.3.html @@ -0,0 +1,53 @@ + + + + + + LUA_RAWGET(3) + + + + + + + + +
LUA_RAWGET(3)Library Functions ManualLUA_RAWGET(3)
+
+

+lua_rawget — +
pops the key from the stack
+

+#include + <lua.h> +
+void +
+lua_rawget(lua_State + *L, int + index); +

+lua_rawget() pops the key from the stack + (putting the resulting value in its place). As in Lua, this function may + trigger a metamethod for the “index” event. Similar to + lua_gettable(3), but does a raw access (i.e., + without metamethods). +

+lua_gettable(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_rawget() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + 210bc84f2f1307e52d03bb5fcf2dddc516c08cf0 (mode 644) --- /dev/null +++ lua_rawgeti.3 @@ -0,0 +1,27 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_RAWGETI 3 +.Os +.Sh NAME +.Nm lua_rawgeti +.Nd pushes onto the stack the value t[n], where t is the value at the given +valid index +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_rawgeti "lua_State *L" "int index" "int n" +.Sh DESCRIPTION +.Fn lua_rawgeti +pushes onto the stack the value t[n], where t is the value at the given valid +index. +The access is raw; that is, it does not invoke metamethods. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_rawgeti +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 08c93585a730669a4a10d07c1a16d3fdf9c6ce75 (mode 644) --- /dev/null +++ lua_rawgeti.3.html @@ -0,0 +1,51 @@ + + + + + + LUA_RAWGETI(3) + + + + + + + + +
LUA_RAWGETI(3)Library Functions ManualLUA_RAWGETI(3)
+
+

+lua_rawgeti — +
pushes onto the stack the value t[n], where t is the + value at the given valid index
+

+#include + <lua.h> +
+void +
+lua_rawgeti(lua_State + *L, int + index, int + n); +

+lua_rawgeti() pushes onto the stack the value + t[n], where t is the value at the given valid index. The access is raw; that + is, it does not invoke metamethods. +

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

+The lua_rawgeti() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + 11eb37a6186674287de7c2e8486a4693d4b69443 (mode 644) --- /dev/null +++ lua_rawset.3 @@ -0,0 +1,30 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_RAWSET 3 +.Os +.Sh NAME +.Nm lua_rawset +.Nd pops both the key and the value from the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_rawset "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_rawset +pops both the key and the value from the stack. +As in Lua, this function may trigger a metamethod for the "newindex" event. +Similar to +.Xr lua_settable 3 , +but does a raw assignment +.Pq i.e., without metamethods . +.Sh SEE ALSO +.Xr lua_settable 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_rawset +manual page was written by Sergey Bronnikov. blob - /dev/null blob + a65ed0bd0ffc8611062ee5bf3f235da7ff628e84 (mode 644) --- /dev/null +++ lua_rawset.3.html @@ -0,0 +1,53 @@ + + + + + + LUA_RAWSET(3) + + + + + + + + +
LUA_RAWSET(3)Library Functions ManualLUA_RAWSET(3)
+
+

+lua_rawset — +
pops both the key and the value from the stack
+

+#include + <lua.h> +
+void +
+lua_rawset(lua_State + *L, int + index); +

+lua_rawset() pops both the key and the value + from the stack. As in Lua, this function may trigger a metamethod for the + "newindex" event. Similar to + lua_settable(3), but does a raw assignment (i.e., + without metamethods). +

+lua_settable(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_rawset() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + b4effe0f9cbefba58e41c9d604e7282d0e3d9164 (mode 644) --- /dev/null +++ lua_rawseti.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_RAWSETI 3 +.Os +.Sh NAME +.Nm lua_rawseti +.Nd pops the value from the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_rawseti "lua_State *L" "int index" "int n" +.Sh DESCRIPTION +.Fn lua_rawseti +does the equivalent of t[n] = v, where t is the value at the given valid index +and v is the value at the top of the stack. +.Pp +This function pops the value from the stack. +The assignment is raw; that is, it does not invoke metamethods. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_rawseti +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 4b0132f7add25926a3e83ab2762ccac40e703611 (mode 644) --- /dev/null +++ lua_rawseti.3.html @@ -0,0 +1,53 @@ + + + + + + LUA_RAWSETI(3) + + + + + + + + +
LUA_RAWSETI(3)Library Functions ManualLUA_RAWSETI(3)
+
+

+lua_rawseti — +
pops the value from the stack
+

+#include + <lua.h> +
+void +
+lua_rawseti(lua_State + *L, int + index, int + n); +

+lua_rawseti() does the equivalent of t[n] = + v, where t is the value at the given valid index and v is the value at the top + of the stack. +
+This function pops the value from the stack. The assignment is raw; that is, it + does not invoke metamethods. +

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

+The lua_rawseti() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + f73671cf2df665d0623d8bebdac334ab6cd615c1 (mode 644) --- /dev/null +++ lua_register.3 @@ -0,0 +1,31 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_REGISTER 3 +.Os +.Sh NAME +.Nm lua_register +.Nd sets the C function as the new value of global name +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_register "lua_State *L" "const char *name" "lua_CFunction f" +.Sh DESCRIPTION +.Fn lua_register +sets the C function +.Fa f +as the new value of global name. +It is defined as a macro: +.Pp +.Bd -literal -offset indent -compact +#define lua_register(L,n,f) (lua_pushcfunction(L, f), lua_setglobal(L, n)) +.Ed +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_register +manual page was written by Sergey Bronnikov. blob - /dev/null blob + bde49108c7e1fa362d6e7a17697214a6989cace9 (mode 644) --- /dev/null +++ lua_register.3.html @@ -0,0 +1,58 @@ + + + + + + LUA_REGISTER(3) + + + + + + + + +
LUA_REGISTER(3)Library Functions ManualLUA_REGISTER(3)
+
+

+lua_register — +
sets the C function as the new value of global + name
+

+#include + <lua.h> +
+void +
+lua_register(lua_State + *L, const char + *name, + lua_CFunction + f); +

+lua_register() sets the C function + f as the new value of global name. It is + defined as a macro: +
+
+
+#define lua_register(L,n,f) (lua_pushcfunction(L, f), lua_setglobal(L, n))
+
+
+

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

+The lua_register() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + b9cc54e0ea89fcfdb8ab14d458571150374265be (mode 644) --- /dev/null +++ lua_remove.3 @@ -0,0 +1,27 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_REMOVE 3 +.Os +.Sh NAME +.Nm lua_remove +.Nd removes the element at the given index +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_remove "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_remove +removes the element at the given valid index, shifting down the elements above +this index to fill the gap. +Cannot be called with a pseudo-index, because a pseudo-index is not an actual +stack position. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_remove +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 5e9a5529279fb0da4ed0e470333e49bc14d52c9d (mode 644) --- /dev/null +++ lua_remove.3.html @@ -0,0 +1,50 @@ + + + + + + LUA_REMOVE(3) + + + + + + + + +
LUA_REMOVE(3)Library Functions ManualLUA_REMOVE(3)
+
+

+lua_remove — +
removes the element at the given index
+

+#include + <lua.h> +
+void +
+lua_remove(lua_State + *L, int + index); +

+lua_remove() removes the element at the given + valid index, shifting down the elements above this index to fill the gap. + Cannot be called with a pseudo-index, because a pseudo-index is not an actual + stack position. +

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

+The lua_remove() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + 6cc484531f2a74a22718a52543f6ef691ce5d894 (mode 644) --- /dev/null +++ lua_replace.3 @@ -0,0 +1,25 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_REPLACE 3 +.Os +.Sh NAME +.Nm lua_replace +.Nd moves the top element into the given position +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_replace "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_replace +moves the top element into the given position (and pops it), without shifting +any element (therefore replacing the value at the given position). +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_replace +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 1d646ed5c7e44b94a4195ebd2ae4ce169c121aa3 (mode 644) --- /dev/null +++ lua_replace.3.html @@ -0,0 +1,49 @@ + + + + + + LUA_REPLACE(3) + + + + + + + + +
LUA_REPLACE(3)Library Functions ManualLUA_REPLACE(3)
+
+

+lua_replace — +
moves the top element into the given position
+

+#include + <lua.h> +
+void +
+lua_replace(lua_State + *L, int + index); +

+lua_replace() moves the top element into the + given position (and pops it), without shifting any element (therefore + replacing the value at the given position). +

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

+The lua_replace() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + 1b11d900fbe1d62a3245ecdc152da5009ffd62bf (mode 644) --- /dev/null +++ lua_resume.3 @@ -0,0 +1,49 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_RESUME 3 +.Os +.Sh NAME +.Nm lua_resume +.Nd starts and resumes a coroutine in a given thread +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_resume "lua_State *L" "int narg" +.Sh DESCRIPTION +.Fn lua_resume +starts and resumes a coroutine in a given thread. +.Pp +To start a coroutine, you first create a new thread (see +.Xr lua_newthread 3 ); +then you push onto its stack the main function plus any arguments; then you +call lua_resume, with narg being the number of arguments. +This call returns when the coroutine suspends or finishes its execution. +When it returns, the stack contains all values passed to +.Xr lua_yield 3 , +or all values returned by the body function. +In case of errors, the stack is not unwound, +so you can use the debug API over it. +The error message is on the top of the stack. +To restart a coroutine, you put on its stack only the values to be passed as +results from yield, and then call lua_resume. +.Sh RETURN VALUES +.Fn lua_resume +returns +.Dv LUA_YIELD +if the coroutine yields, 0 if the coroutine finishes its execution without +errors, or an error code in case of errors (see +.Xr lua_pcall 3 +). +.Sh SEE ALSO +.Xr lua_newthread 3 , +.Xr lua_pcall 3 , +.Xr lua_yield 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_resume +manual page was written by Sergey Bronnikov. blob - /dev/null blob + dcd711db2c4ab3550b103c7680d2716b0c467c94 (mode 644) --- /dev/null +++ lua_resume.3.html @@ -0,0 +1,70 @@ + + + + + + LUA_RESUME(3) + + + + + + + + +
LUA_RESUME(3)Library Functions ManualLUA_RESUME(3)
+
+

+lua_resume — +
starts and resumes a coroutine in a given + thread
+

+#include + <lua.h> +
+int +
+lua_resume(lua_State + *L, int + narg); +

+lua_resume() starts and resumes a coroutine + in a given thread. +
+To start a coroutine, you first create a new thread (see + lua_newthread(3) ); then you push onto its stack + the main function plus any arguments; then you call lua_resume, with narg + being the number of arguments. This call returns when the coroutine suspends + or finishes its execution. When it returns, the stack contains all values + passed to lua_yield(3), or all values returned by + the body function. In case of errors, the stack is not unwound, so you can use + the debug API over it. The error message is on the top of the stack. To + restart a coroutine, you put on its stack only the values to be passed as + results from yield, and then call lua_resume. +

+lua_resume() returns + LUA_YIELD if the coroutine yields, 0 if the + coroutine finishes its execution without errors, or an error code in case of + errors (see lua_pcall(3) ). +

+lua_newthread(3), + lua_pcall(3), + lua_yield(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_resume() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + d4b25e79bd47b176767e16b7b916b64a19872923 (mode 644) --- /dev/null +++ lua_setallocf.3 @@ -0,0 +1,27 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_SETALLOCF 3 +.Os +.Sh NAME +.Nm lua_setallocf +.Nd changes the allocator function +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_setallocf "lua_State *L" "lua_Alloc f" "void *ud" +.Sh DESCRIPTION +.Fn lua_setallocf +changes the allocator function of a given state to +.Fa f +with user data +.Fa ud . +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_setallocf +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 7be37995f23efeb2681e11fd104ecd85ef20800a (mode 644) --- /dev/null +++ lua_setallocf.3.html @@ -0,0 +1,50 @@ + + + + + + LUA_SETALLOCF(3) + + + + + + + + +
LUA_SETALLOCF(3)Library Functions ManualLUA_SETALLOCF(3)
+
+

+lua_setallocf — +
changes the allocator function
+

+#include + <lua.h> +
+void +
+lua_setallocf(lua_State + *L, lua_Alloc + f, void + *ud); +

+lua_setallocf() changes the allocator + function of a given state to f with user data + ud. +

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

+The lua_setallocf() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + a6eae2a7ede82d3d02e8de52c9987543e269bbb0 (mode 644) --- /dev/null +++ lua_setfenv.3 @@ -0,0 +1,31 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_SETFENV 3 +.Os +.Sh NAME +.Nm lua_setfenv +.Nd pops a table from the stack and sets it as the new environment for the value +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_setfenv "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_setfenv +pops a table from the stack and sets it as the new environment for the value at +the given index. +.Sh RETURN VALUES +If the value at the given index is neither a function nor a thread nor a +userdata, +.Fn lua_setfenv +returns 0. +Otherwise it returns 1. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_setfenv +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 07a08b3f68a7c3dea30f1485a09cdda6e827b07f (mode 644) --- /dev/null +++ lua_setfenv.3.html @@ -0,0 +1,54 @@ + + + + + + LUA_SETFENV(3) + + + + + + + + +
LUA_SETFENV(3)Library Functions ManualLUA_SETFENV(3)
+
+

+lua_setfenv — +
pops a table from the stack and sets it as the new + environment for the value
+

+#include + <lua.h> +
+int +
+lua_setfenv(lua_State + *L, int + index); +

+lua_setfenv() pops a table from the stack and + sets it as the new environment for the value at the given index. +

+If the value at the given index is neither a function nor a thread nor a + userdata, lua_setfenv() returns 0. + Otherwise it returns 1. +

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

+The lua_setfenv() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + cf4b172a77b851c2d71d8ebae61fae5fa1f4f4ed (mode 644) --- /dev/null +++ lua_setfield.3 @@ -0,0 +1,30 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_SETFIELD 3 +.Os +.Sh NAME +.Nm lua_setfield +.Nd pops the value from the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_setfield "lua_State *L" "int index" "const char *k" +.Sh DESCRIPTION +.Fn lua_setfield +does the equivalent to t[k] = v, where t is the value at the given valid index +and v is the value at the top of the stack. +.Pp +This function pops the value from the stack. +As in Lua, this function may trigger a metamethod for the +.Qq newindex +event. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_setfield +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 83fdeb6b4e746db5b5a349c1f16d5efb51c74a39 (mode 644) --- /dev/null +++ lua_setfield.3.html @@ -0,0 +1,53 @@ + + + + + + LUA_SETFIELD(3) + + + + + + + + +
LUA_SETFIELD(3)Library Functions ManualLUA_SETFIELD(3)
+
+

+lua_setfield — +
pops the value from the stack
+

+#include + <lua.h> +
+void +
+lua_setfield(lua_State + *L, int + index, const + char *k); +

+lua_setfield() does the equivalent to t[k] = + v, where t is the value at the given valid index and v is the value at the top + of the stack. +
+This function pops the value from the stack. As in Lua, this function may + trigger a metamethod for the “newindex” event. +

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

+The lua_setfield() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + 5264535d58e3b221f07d5ede88268c01ecbf99e4 (mode 644) --- /dev/null +++ lua_setglobal.3 @@ -0,0 +1,27 @@ +.Dd $Mdocdate: July 20 2022 $ +.Dt LUA_SETGLOBAL 3 +.Os +.Sh NAME +.Nm lua_setglobal +.Nd pops a value from the stack and sets it as the new value of global name +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_setglobal "lua_State *L" "const char *name" +.Sh DESCRIPTION +.Fn lua_setglobal +pops a value from the stack and sets it as the new value of global name. +It is defined as a macro: +.Pp +.Fd #define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, s) +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_setglobal +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 3fb204ea1639a67066b2d47fd6267d25b261687f (mode 644) --- /dev/null +++ lua_setglobal.3.html @@ -0,0 +1,52 @@ + + + + + + LUA_SETGLOBAL(3) + + + + + + + + +
LUA_SETGLOBAL(3)Library Functions ManualLUA_SETGLOBAL(3)
+
+

+lua_setglobal — +
pops a value from the stack and sets it as the new + value of global name
+

+#include + <lua.h> +
+void +
+lua_setglobal(lua_State + *L, const char + *name); +

+lua_setglobal() pops a value from the stack + and sets it as the new value of global name. It is defined as a macro: +
+#define lua_setglobal(L,s) lua_setfield(L, + LUA_GLOBALSINDEX, s) +

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

+The lua_setglobal() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 20, 2022Debian
+ + blob - /dev/null blob + 005ef1505add9b2fa718f381d293e34ffd3037b2 (mode 644) --- /dev/null +++ lua_sethook.3 @@ -0,0 +1,54 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_SETHOOK 3 +.Os +.Sh NAME +.Nm lua_sethook +.Nd sets the debugging hook function +.Sh SYNOPSIS +.In fcntl.h +.Ft int +.Fn lua_sethook "lua_State *L" "lua_Hook f" "int mask" "int count" +.Sh DESCRIPTION +.Fn lua_sethook +sets the debugging hook function. +.Pp +Argument f is the hook function. mask specifies on which events the hook will +be called: it is formed by a bitwise or of the constants +.Dv LUA_MASKCALL , +.Dv LUA_MASKRET , +.Dv LUA_MASKLINE , +and +.Dv LUA_MASKCOUNT . +The count argument is only meaningful when the mask includes +.Dv LUA_MASKCOUNT . +For each event, the hook is called as explained below: +.Bl -tag -width "The return hook:" +.It Sy The call hook: +is called when the interpreter calls a function. +The hook is called just after Lua enters the new function, before the function +gets its arguments. +.It Sy The return hook: +is called when the interpreter returns from a function. +The hook is called just before Lua leaves the function. +You have no access to the values to be returned by the function. +.It Sy The line hook: +is called when the interpreter is about to start the execution of a new line of +code, or when it jumps back in the code (even to the same line). +(This event only happens while Lua is executing a Lua function.) +.It Sy The count hook: +is called after the interpreter executes every count instructions. +(This event only happens while Lua is executing a Lua function.) +.El +.Pp +A hook is disabled by setting mask to zero. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_sethook +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 798851f82d85a07efe66cfd7362c9f6954533d58 (mode 644) --- /dev/null +++ lua_sethook.3.html @@ -0,0 +1,87 @@ + + + + + + LUA_SETHOOK(3) + + + + + + + + +
LUA_SETHOOK(3)Library Functions ManualLUA_SETHOOK(3)
+
+

+lua_sethook — +
sets the debugging hook function
+

+#include + <fcntl.h> +
+int +
+lua_sethook(lua_State + *L, lua_Hook + f, int + mask, int + count); +

+lua_sethook() sets the debugging hook + function. +
+Argument f is the hook function. mask specifies on which events the hook will be + called: it is formed by a bitwise or of the constants + LUA_MASKCALL, + LUA_MASKRET, + LUA_MASKLINE, and + LUA_MASKCOUNT. The count argument is only + meaningful when the mask includes + LUA_MASKCOUNT. For each event, the hook is + called as explained below: +
+
 
+
 
+
The call hook:
+
is called when the interpreter calls a function. The hook is called just + after Lua enters the new function, before the function gets its + arguments.
+
 
+
 
+
The return hook:
+
is called when the interpreter returns from a function. The hook is called + just before Lua leaves the function. You have no access to the values to + be returned by the function.
+
 
+
 
+
The line hook:
+
is called when the interpreter is about to start the execution of a new + line of code, or when it jumps back in the code (even to the same line). + (This event only happens while Lua is executing a Lua function.)
+
 
+
 
+
The count hook:
+
is called after the interpreter executes every count instructions. (This + event only happens while Lua is executing a Lua function.)
+
+
+A hook is disabled by setting mask to zero. +

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

+The lua_sethook() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + 676fe0d26db5336641c8e2e54fe54ec80e0c41ad (mode 644) --- /dev/null +++ lua_setlocal.3 @@ -0,0 +1,38 @@ +.Dd $Mdocdate: July 13 2022 $ +.Dt LUA_SETLOCAL 3 +.Os +.Sh NAME +.Nm lua_setlocal +.Nd sets the value of a local variable of a given activation record +.Sh SYNOPSIS +.In lua.h +.Ft const char * +.Fn lua_setlocal "lua_State *L" "lua_Debug *ar" "int n" +.Sh DESCRIPTION +.Fn lua_setlocal +sets the value of a local variable of a given activation record. +Parameters +.Fa ar +and +.Fa n +are as in +.Xr lua_getlocal 3 . +.Fn lua_setlocal +assigns the value at the top of the stack to the variable and returns its name. +It also pops the value from the stack. +.Sh RETURN VALUES +Returns +.Dv NULL +.Pq and pops nothing +when the index is greater than the number of active local variables. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_setlocal +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 4461427693b95a9d62a75ee6b1540f5cbdeea150 (mode 644) --- /dev/null +++ lua_setlocal.3.html @@ -0,0 +1,59 @@ + + + + + + LUA_SETLOCAL(3) + + + + + + + + +
LUA_SETLOCAL(3)Library Functions ManualLUA_SETLOCAL(3)
+
+

+lua_setlocal — +
sets the value of a local variable of a given + activation record
+

+#include + <lua.h> +
+const char * +
+lua_setlocal(lua_State + *L, lua_Debug + *ar, int + n); +

+lua_setlocal() sets the value of a local + variable of a given activation record. Parameters + ar and n are + as in lua_getlocal(3). + lua_setlocal() assigns the value at the top + of the stack to the variable and returns its name. It also pops the value from + the stack. +

+Returns NULL (and pops nothing) when the + index is greater than the number of active local variables. +

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

+The lua_setlocal() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 13, 2022Debian
+ + blob - /dev/null blob + 29833649d3742e28c1a6480a47f443ce3965ce27 (mode 644) --- /dev/null +++ lua_setmetatable.3 @@ -0,0 +1,25 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_SETMETATABLE 3 +.Os +.Sh NAME +.Nm lua_setmetatable +.Nd pops a table from the stack and sets it as the new metatable for the value +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_setmetatable "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_setmetatable +pops a table from the stack and sets it as the new metatable for the value at +the given acceptable index. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_setmetatable +manual page was written by Sergey Bronnikov. blob - /dev/null blob + e18229e41275ac16d7134af06abf4605e0ae84fd (mode 644) --- /dev/null +++ lua_setmetatable.3.html @@ -0,0 +1,50 @@ + + + + + + LUA_SETMETATABLE(3) + + + + + + + + +
LUA_SETMETATABLE(3)Library Functions ManualLUA_SETMETATABLE(3)
+
+

+lua_setmetatable — +
pops a table from the stack and sets it as the new + metatable for the value
+

+#include + <lua.h> +
+int +
+lua_setmetatable(lua_State + *L, int + index); +

+lua_setmetatable() pops a table from the + stack and sets it as the new metatable for the value at the given acceptable + index. +

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

+The lua_setmetatable() manual page was + written by Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + b87ad7eb242f958f3f8586930fa799c6c822beed (mode 644) --- /dev/null +++ lua_settable.3 @@ -0,0 +1,30 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_SETTABLE 3 +.Os +.Sh NAME +.Nm lua_settable +.Nd pops both the key and the value from the stack +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_settable "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_settable +does the equivalent to t[k] = v, where t is the value at the given valid index, +v is the value at the top of the stack, and k is the value just below the top. +.Pp +This function pops both the key and the value from the stack. +As in Lua, this function may trigger a metamethod for the +.Qq newindex +event. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_settable +manual page was written by Sergey Bronnikov. blob - /dev/null blob + de6b8ba98ccd0be1583e948fa10de3e4ce43a709 (mode 644) --- /dev/null +++ lua_settable.3.html @@ -0,0 +1,52 @@ + + + + + + LUA_SETTABLE(3) + + + + + + + + +
LUA_SETTABLE(3)Library Functions ManualLUA_SETTABLE(3)
+
+

+lua_settable — +
pops both the key and the value from the stack
+

+#include + <lua.h> +
+void +
+lua_settable(lua_State + *L, int + index); +

+lua_settable() does the equivalent to t[k] = + v, where t is the value at the given valid index, v is the value at the top of + the stack, and k is the value just below the top. +
+This function pops both the key and the value from the stack. As in Lua, this + function may trigger a metamethod for the “newindex” event. +

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

+The lua_settable() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + a55ce5ac46bbe39316653234576ba940675631ef (mode 644) --- /dev/null +++ lua_settop.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_SETTOP 3 +.Os +.Sh NAME +.Nm lua_settop +.Nd sets the stack top to the index +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_settop "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_settop +accepts any acceptable index, or 0, and sets the stack top to this index. +If the new top is larger than the old one, then the new elements are filled +with +.Dv nil . +If index is 0, then all stack elements are removed. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_settop +manual page was written by Sergey Bronnikov. blob - /dev/null blob + bd328f28c2866512f68a7774cd7349bd35fcef04 (mode 644) --- /dev/null +++ lua_settop.3.html @@ -0,0 +1,51 @@ + + + + + + LUA_SETTOP(3) + + + + + + + + +
LUA_SETTOP(3)Library Functions ManualLUA_SETTOP(3)
+
+

+lua_settop — +
sets the stack top to the index
+

+#include + <lua.h> +
+void +
+lua_settop(lua_State + *L, int + index); +

+lua_settop() accepts any acceptable index, or + 0, and sets the stack top to this index. If the new top is larger than the old + one, then the new elements are filled with + nil. If index is 0, then all stack elements + are removed. +

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

+The lua_settop() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + 58f26fc7602077b7e938209c5e87a7a526c46271 (mode 644) --- /dev/null +++ lua_setupvalue.3 @@ -0,0 +1,38 @@ +.Dd $Mdocdate: July 13 2022 $ +.Dt LUA_SETUPVALUE 3 +.Os +.Sh NAME +.Nm lua_setupvalue +.Nd sets the value of a closure's upvalue +.Sh SYNOPSIS +.In lua.h +.Ft const char * +.Fn lua_setupvalue "lua_State *L" "int funcindex" "int n" +.Sh DESCRIPTION +.Fn lua_setupvalue +sets the value of a closure's upvalue. +It assigns the value at the top of the stack to the upvalue and returns its +name. +It also pops the value from the stack. +Parameters +.Fa funcindex +and +.Fa n +are as in the +.Xr lua_getupvalue 3 . +.Sh RETURN VALUES +Returns +.Dv NULL +.Pq and pops nothing +when the index is greater than the number of upvalues. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_setupvalue +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 0053db79e2a421a64802c94e7c04bd9cd5ecd163 (mode 644) --- /dev/null +++ lua_setupvalue.3.html @@ -0,0 +1,57 @@ + + + + + + LUA_SETUPVALUE(3) + + + + + + + + +
LUA_SETUPVALUE(3)Library Functions ManualLUA_SETUPVALUE(3)
+
+

+lua_setupvalue — +
sets the value of a closure's upvalue
+

+#include + <lua.h> +
+const char * +
+lua_setupvalue(lua_State + *L, int + funcindex, int + n); +

+lua_setupvalue() sets the value of a + closure's upvalue. It assigns the value at the top of the stack to the upvalue + and returns its name. It also pops the value from the stack. Parameters + funcindex and + n are as in the + lua_getupvalue(3). +

+Returns NULL (and pops nothing) when the + index is greater than the number of upvalues. +

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

+The lua_setupvalue() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 13, 2022Debian
+ + blob - /dev/null blob + 2887a2be67be7fa3779fb8a6db583989fe6b11de (mode 644) --- /dev/null +++ lua_status.3 @@ -0,0 +1,29 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_STATUS 3 +.Os +.Sh NAME +.Nm lua_status +.Nd returns the status of the thread L +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_status "lua_State *L" +.Sh DESCRIPTION +.Fn lua_status +returns the status of the thread L. +.Sh RETURN VALUES +The status can be 0 for a normal thread, an error code if the thread finished +its execution with an error, or +.Dv LUA_YIELD +if the thread is suspended. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_status +manual page was written by Sergey Bronnikov. blob - /dev/null blob + bfedf774065b128c7fdf122b063953548f031832 (mode 644) --- /dev/null +++ lua_status.3.html @@ -0,0 +1,52 @@ + + + + + + LUA_STATUS(3) + + + + + + + + +
LUA_STATUS(3)Library Functions ManualLUA_STATUS(3)
+
+

+lua_status — +
returns the status of the thread L
+

+#include + <lua.h> +
+int +
+lua_status(lua_State + *L); +

+lua_status() returns the status of the thread + L. +

+The status can be 0 for a normal thread, an error code if the thread finished + its execution with an error, or LUA_YIELD + if the thread is suspended. +

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

+The lua_status() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 4ff5281457f98fd89a4f14ac7be4ed577ceb45ec (mode 644) --- /dev/null +++ lua_toboolean.3 @@ -0,0 +1,38 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_TOBOOLEAN 3 +.Os +.Sh NAME +.Nm lua_toboolean +.Nd converts the Lua value to a C boolean value +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_toboolean "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_toboolean +converts the Lua value at the given acceptable index to a C boolean value (0 or +1). +.Sh RETURN VALUES +Like all tests in Lua, +.Fn lua_toboolean +returns 1 for any Lua value different from +.Sy false +and +.Sy nil ; +otherwise it returns 0. +It also returns 0 when called with a non-valid index. +(If you want to accept only actual boolean values, use +.Xr lua_isboolean 3 +to test the value's type.) +.Sh SEE ALSO +.Xr lua_isboolean 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_toboolean +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 2ad766fc1eee3a5eef43b1ba93f9132d8fe2a345 (mode 644) --- /dev/null +++ lua_toboolean.3.html @@ -0,0 +1,58 @@ + + + + + + LUA_TOBOOLEAN(3) + + + + + + + + +
LUA_TOBOOLEAN(3)Library Functions ManualLUA_TOBOOLEAN(3)
+
+

+lua_toboolean — +
converts the Lua value to a C boolean value
+

+#include + <lua.h> +
+int +
+lua_toboolean(lua_State + *L, int + index); +

+lua_toboolean() converts the Lua value at the + given acceptable index to a C boolean value (0 or 1). +

+Like all tests in Lua, lua_toboolean() + returns 1 for any Lua value different from false + and nil; otherwise it returns 0. It also returns + 0 when called with a non-valid index. (If you want to accept only actual + boolean values, use lua_isboolean(3) to test the + value's type.) +

+lua_isboolean(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_toboolean() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 17e600499347cc0bf82249e7820b3b82b1804daf (mode 644) --- /dev/null +++ lua_tocfunction.3 @@ -0,0 +1,27 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_TOCFUNCTION 3 +.Os +.Sh NAME +.Nm lua_tocfunction +.Nd converts a value to a C function +.Sh SYNOPSIS +.In lua.h +.Ft lua_CFunction +.Fn lua_tocfunction "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_tocfunction +converts a value at the given acceptable index to a C function. +.Sh RETURN VALUES +That value must be a C function; otherwise, returns +.Dv NULL . +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_tocfunction +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 61e7b2d122fd2ab37d9f453633b6266eb87bd4ca (mode 644) --- /dev/null +++ lua_tocfunction.3.html @@ -0,0 +1,52 @@ + + + + + + LUA_TOCFUNCTION(3) + + + + + + + + +
LUA_TOCFUNCTION(3)Library Functions ManualLUA_TOCFUNCTION(3)
+
+

+lua_tocfunction — +
converts a value to a C function
+

+#include + <lua.h> +
+lua_CFunction +
+lua_tocfunction(lua_State + *L, int + index); +

+lua_tocfunction() converts a value at the + given acceptable index to a C function. +

+That value must be a C function; otherwise, returns + NULL. +

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

+The lua_tocfunction() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + d54ea07f906da5102fc9479cc7d40baea4f7b239 (mode 644) --- /dev/null +++ lua_tointeger.3 @@ -0,0 +1,33 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_TOINTEGER 3 +.Os +.Sh NAME +.Nm lua_tointeger +.Nd converts the Lua value to the signed integral type +.Sh SYNOPSIS +.In lua.h +.Ft lua_Integer +.Fn lua_tointeger "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_tointeger +converts the Lua value at the given acceptable index to the signed integral +type +.Xr lua_Integer 3 . +.Sh RETURN VALUES +The Lua value must be a number or a string convertible to a number; otherwise, +.Fn lua_tointeger +returns 0. +.Pp +If the number is not an integer, it is truncated in some non-specified way. +.Sh SEE ALSO +.Xr lua_Integer 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_tointeger +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 12d64c44201435af5c114c875c8d0bbe7ea2b1b1 (mode 644) --- /dev/null +++ lua_tointeger.3.html @@ -0,0 +1,58 @@ + + + + + + LUA_TOINTEGER(3) + + + + + + + + +
LUA_TOINTEGER(3)Library Functions ManualLUA_TOINTEGER(3)
+
+

+lua_tointeger — +
converts the Lua value to the signed integral + type
+

+#include + <lua.h> +
+lua_Integer +
+lua_tointeger(lua_State + *L, int + index); +

+lua_tointeger() converts the Lua value at the + given acceptable index to the signed integral type + lua_Integer(3). +

+The Lua value must be a number or a string convertible to a number; otherwise, + lua_tointeger() returns 0. +
+If the number is not an integer, it is truncated in some non-specified way. +

+lua_Integer(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_tointeger() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 73811601c6db30224f8766604e12c8d559707254 (mode 644) --- /dev/null +++ lua_tolstring.3 @@ -0,0 +1,52 @@ +.Dd $Mdocdate: July 14 2022 $ +.Dt LUA_TOLSTRING 3 +.Os +.Sh NAME +.Nm lua_tolstring +.Nd converts the Lua value to a C string +.Sh SYNOPSIS +.In lua.h +.Ft const char * +.Fn lua_tolstring "lua_State *L" "int index" "size_t *len" +.Sh DESCRIPTION +.Fn lua_tolstring +converts the Lua value at the given acceptable index to a C string. +If +.Fa len +is not +.Dv NULL , +it also sets +.Fa *len +with the string length. +The Lua value must be a string or a number; otherwise, the function returns +.Dv NULL . +If the value is a number, then +.Fn lua_tolstring +also changes the actual value in the stack to a string. +(This change confuses +.Xr lua_next 3 +when +.Fn lua_tolstring +is applied to keys during a table traversal.) +.Sh RETURN VALUES +.Fn lua_tolstring +returns a fully aligned pointer to a string inside the Lua state. +This string always has a zero ('\\0') after its last character +.Pq as in C , +but can contain other zeros in its body. +Because Lua has garbage collection, there is no guarantee that the pointer +returned by +.Fn lua_tolstring +will be valid after the corresponding value is removed from the stack. +.Sh SEE ALSO +.Xr lua_next 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_tolstring +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 074505e00093a2ef598e6f2e2aae8c22f250960d (mode 644) --- /dev/null +++ lua_tolstring.3.html @@ -0,0 +1,68 @@ + + + + + + LUA_TOLSTRING(3) + + + + + + + + +
LUA_TOLSTRING(3)Library Functions ManualLUA_TOLSTRING(3)
+
+

+lua_tolstring — +
converts the Lua value to a C string
+

+#include + <lua.h> +
+const char * +
+lua_tolstring(lua_State + *L, int + index, size_t + *len); +

+lua_tolstring() converts the Lua value at the + given acceptable index to a C string. If len + is not NULL, it also sets + *len with the string length. The Lua value + must be a string or a number; otherwise, the function returns + NULL. If the value is a number, then + lua_tolstring() also changes the actual + value in the stack to a string. (This change confuses + lua_next(3) when + lua_tolstring() is applied to keys during a + table traversal.) +

+lua_tolstring() returns a fully aligned + pointer to a string inside the Lua state. This string always has a zero ('\0') + after its last character (as in C), but can contain other zeros in its body. + Because Lua has garbage collection, there is no guarantee that the pointer + returned by lua_tolstring() will be valid + after the corresponding value is removed from the stack. +

+lua_next(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_tolstring() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 14, 2022Debian
+ + blob - /dev/null blob + 772f99d171895b778eb81bd7cf3296d42fef587d (mode 644) --- /dev/null +++ lua_tonumber.3 @@ -0,0 +1,30 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_TONUMBER 3 +.Os +.Sh NAME +.Nm lua_tonumber +.Nd converts the Lua value to the C type +.Xr lua_Number 3 +.Sh SYNOPSIS +.In lua.h +.Ft lua_Number +.Fn lua_tonumber "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_tonumber +converts the Lua value at the given acceptable index to the C type +.Xr lua_Number 3 . +The Lua value must be a number or a string convertible to a number; otherwise, +.Nm lua_tonumber +returns 0. +.Sh SEE ALSO +.Xr lua_Number 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_tonumber +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 09460919092c4811bc4e476c12d3e47146a2e09f (mode 644) --- /dev/null +++ lua_tonumber.3.html @@ -0,0 +1,54 @@ + + + + + + LUA_TONUMBER(3) + + + + + + + + +
LUA_TONUMBER(3)Library Functions ManualLUA_TONUMBER(3)
+
+

+lua_tonumber — +
converts the Lua value to the C type + lua_Number(3)
+

+#include + <lua.h> +
+lua_Number +
+lua_tonumber(lua_State + *L, int + index); +

+lua_tonumber() converts the Lua value at the + given acceptable index to the C type + lua_Number(3). The Lua value must be a number or + a string convertible to a number; otherwise, + lua_tonumber returns 0. +

+lua_Number(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_tonumber() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + ac3dfd827da10bf4833354840c1aaa9c5cc904b0 (mode 644) --- /dev/null +++ lua_topointer.3 @@ -0,0 +1,32 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_TOPOINTER 3 +.Os +.Sh NAME +.Nm lua_topointer +.Nd converts the value to a generic C pointer +.Sh SYNOPSIS +.In lua.h +.Ft const void * +.Fn lua_topointer "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_topointer +converts the value at the given acceptable index to a generic C pointer (void*). +The value can be a userdata, a table, a thread, or a function; otherwise, +.Nm lua_topointer +returns +.Dv NULL . +Different objects will give different pointers. +There is no way to convert the pointer back to its original value. +.Pp +Typically this function is used only for debug information. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_topointer +manual page was written by Sergey Bronnikov. blob - /dev/null blob + b77da9da1dba5a10e83ecdf75c7e8cb1ac834b81 (mode 644) --- /dev/null +++ lua_topointer.3.html @@ -0,0 +1,54 @@ + + + + + + LUA_TOPOINTER(3) + + + + + + + + +
LUA_TOPOINTER(3)Library Functions ManualLUA_TOPOINTER(3)
+
+

+lua_topointer — +
converts the value to a generic C pointer
+

+#include + <lua.h> +
+const void * +
+lua_topointer(lua_State + *L, int + index); +

+lua_topointer() converts the value at the + given acceptable index to a generic C pointer (void*). The value can be a + userdata, a table, a thread, or a function; otherwise, + lua_topointer returns + NULL. Different objects will give different + pointers. There is no way to convert the pointer back to its original value. +
+Typically this function is used only for debug information. +

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

+The lua_topointer() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + 495d487829b48eb8f2b93ba42449214cba4b18f0 (mode 644) --- /dev/null +++ lua_tostring.3 @@ -0,0 +1,30 @@ +.Dd $Mdocdate: July 15 2022 $ +.Dt LUA_TOSTRING 3 +.Os +.Sh NAME +.Nm lua_tostring +.Nd converts the Lua value to a C string +.Sh SYNOPSIS +.In lua.h +.Ft const char * +.Fn lua_tostring "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_tostring +converts the Lua value at the given acceptable index to a C string. +.Pp +Equivalent to +.Xr lua_tolstring 3 +with len equal to +.Dv NULL . +.Sh SEE ALSO +.Xr lua_tolstring 3 +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_tostring +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 173199f9dbf25fb04bc9eb2b5cf91abe6f01ede0 (mode 644) --- /dev/null +++ lua_tostring.3.html @@ -0,0 +1,53 @@ + + + + + + LUA_TOSTRING(3) + + + + + + + + +
LUA_TOSTRING(3)Library Functions ManualLUA_TOSTRING(3)
+
+

+lua_tostring — +
converts the Lua value to a C string
+

+#include + <lua.h> +
+const char * +
+lua_tostring(lua_State + *L, int + index); +

+lua_tostring() converts the Lua value at the + given acceptable index to a C string. +
+Equivalent to lua_tolstring(3) with len equal to + NULL. +

+lua_tolstring(3) +
+Roberto Ierusalimschy, + Luiz Henrique de Figueiredo, and + Waldemar Celes, Lua 5.1 Reference + Manual. +

+The lua_tostring() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 15, 2022Debian
+ + blob - /dev/null blob + 936db681615845c5dcda478103b1a666e7563547 (mode 644) --- /dev/null +++ lua_tothread.3 @@ -0,0 +1,31 @@ +.Dd $Mdocdate: July 13 2022 $ +.Dt LUA_TOTHREAD 3 +.Os +.Sh NAME +.Nm lua_tothread +.Nd converts the value to a Lua thread +.Sh SYNOPSIS +.In lua.h +.Ft lua_State * +.Fn lua_tothread "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_tothread +converts the value at the given acceptable index to a Lua thread (represented +as lua_State *). +This value must be a thread; otherwise, the function returns +.Dv NULL . +.Sh RETURN VALUES +Returns Lua thread represented as lua_State* and returns +.Dv NULL +when value is not a thread. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_gethook +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 190ffc83aec291e2ad6f03d935fa2f4ef5aef9dd (mode 644) --- /dev/null +++ lua_tothread.3.html @@ -0,0 +1,54 @@ + + + + + + LUA_TOTHREAD(3) + + + + + + + + +
LUA_TOTHREAD(3)Library Functions ManualLUA_TOTHREAD(3)
+
+

+lua_tothread — +
converts the value to a Lua thread
+

+#include + <lua.h> +
+lua_State * +
+lua_tothread(lua_State + *L, int + index); +

+lua_tothread() converts the value at the + given acceptable index to a Lua thread (represented as lua_State *). This + value must be a thread; otherwise, the function returns + NULL. +

+Returns Lua thread represented as lua_State* and returns + NULL when value is not a thread. +

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

+The lua_gethook() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 13, 2022Debian
+ + blob - /dev/null blob + 7707705f62b672ea19a62a8dcc1a1406bb5fd12c (mode 644) --- /dev/null +++ lua_touserdata.3 @@ -0,0 +1,28 @@ +.Dd $Mdocdate: July 13 2022 $ +.Dt LUA_TOUSERDATA 3 +.Os +.Sh NAME +.Nm lua_touserdata +.Nd returns address to userdata +.Sh SYNOPSIS +.In lua.h +.Ft void * +.Fn lua_touserdata "lua_State *L" "int index" +.Sh DESCRIPTION +If the value at the given acceptable index is a full userdata, returns its +block address. +.Sh RETURN VALUES +If the value is a light userdata, returns its pointer. +Otherwise, returns +.Dv NULL . +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_touserdata +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 51a40bb1a996f85f39338f657a15f6c6dee342fb (mode 644) --- /dev/null +++ lua_touserdata.3.html @@ -0,0 +1,52 @@ + + + + + + LUA_TOUSERDATA(3) + + + + + + + + +
LUA_TOUSERDATA(3)Library Functions ManualLUA_TOUSERDATA(3)
+
+

+lua_touserdata — +
returns address to userdata
+

+#include + <lua.h> +
+void * +
+lua_touserdata(lua_State + *L, int + index); +

+If the value at the given acceptable index is a full userdata, returns its block + address. +

+If the value is a light userdata, returns its pointer. Otherwise, returns + NULL. +

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

+The lua_touserdata() manual page was written + by Sergey Bronnikov.
+ + + + + +
July 13, 2022Debian
+ + blob - /dev/null blob + 933f6e194efdc0289f9e3d49fbf0dc9b042db51c (mode 644) --- /dev/null +++ lua_type.3 @@ -0,0 +1,42 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_TYPE 3 +.Os +.Sh NAME +.Nm lua_type +.Nd returns the type of the value +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_type "lua_State *L" "int index" +.Sh DESCRIPTION +.Fn lua_type +returns the type of the value in the given acceptable index, or +.Dv LUA_TNONE +for a non-valid index (that is, an index to an +"empty" +stack position). +The types returned by +.Nm lua_type +are coded by the following constants defined in +.In lua.h : +.Dv LUA_TNIL , +.Dv LUA_TNUMBER , +.Dv LUA_TBOOLEAN , +.Dv LUA_TSTRING , +.Dv LUA_TTABLE , +.Dv LUA_TFUNCTION , +.Dv LUA_TUSERDATA , +.Dv LUA_TTHREAD , +and +.Dv LUA_TLIGHTUSERDATA . +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_type +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 1d47f28cfab0a1f1f8505d019924af793f0b8968 (mode 644) --- /dev/null +++ lua_type.3.html @@ -0,0 +1,61 @@ + + + + + + LUA_TYPE(3) + + + + + + + + +
LUA_TYPE(3)Library Functions ManualLUA_TYPE(3)
+
+

+lua_type — +
returns the type of the value
+

+#include + <lua.h> +
+int +
+lua_type(lua_State + *L, int + index); +

+lua_type() returns the type of the value in + the given acceptable index, or LUA_TNONE + for a non-valid index (that is, an index to an "empty" stack + position). The types returned by lua_type + are coded by the following constants defined in + <lua.h>: + LUA_TNIL, + LUA_TNUMBER, + LUA_TBOOLEAN, + LUA_TSTRING, + LUA_TTABLE, + LUA_TFUNCTION, + LUA_TUSERDATA, + LUA_TTHREAD, and + LUA_TLIGHTUSERDATA. +

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

+The lua_type() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ + blob - /dev/null blob + f6ba5c7c4ca4a90274a442eb94f79971aa0149e6 (mode 644) --- /dev/null +++ lua_typename.3 @@ -0,0 +1,29 @@ +.Dd $Mdocdate: July 13 2022 $ +.Dt LUA_TYPENAME 3 +.Os +.Sh NAME +.Nm lua_typename +.Nd returns the name of the type encoded by the value +.Sh SYNOPSIS +.In lua.h +.Ft const char * +.Fn lua_typename "lua_State *L" "int tp" +.Sh DESCRIPTION +.Fn lua_typename +returns the name of the type encoded by the value +.Fa tp , +which must be one the values returned by +.Xr lua_type 3 . +.Sh RETURN VALUES +Returns the name of the type encoded by the value. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_typename +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 79e4e1395ab2662c4ed8c38cf2645d01bf887609 (mode 644) --- /dev/null +++ lua_typename.3.html @@ -0,0 +1,53 @@ + + + + + + LUA_TYPENAME(3) + + + + + + + + +
LUA_TYPENAME(3)Library Functions ManualLUA_TYPENAME(3)
+
+

+lua_typename — +
returns the name of the type encoded by the + value
+

+#include + <lua.h> +
+const char * +
+lua_typename(lua_State + *L, int + tp); +

+lua_typename() returns the name of the type + encoded by the value tp, which must be one + the values returned by lua_type(3). +

+Returns the name of the type encoded by the value. +

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

+The lua_typename() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 13, 2022Debian
+ + blob - /dev/null blob + ae0105dee449476981fc259af737b98c88630045 (mode 644) --- /dev/null +++ lua_xmove.3 @@ -0,0 +1,26 @@ +.Dd $Mdocdate: July 13 2022 $ +.Dt LUA_XMOVE 3 +.Os +.Sh NAME +.Nm lua_xmove +.Nd exchange values between different threads of the same global state +.Sh SYNOPSIS +.In lua.h +.Ft void +.Fn lua_xmove "lua_State *from" "lua_State *to" "int n" +.Sh DESCRIPTION +.Fn lua_xmove +exchange values between different threads of the same global state. +This function pops n values from the stack from, and pushes them onto the stack +to. +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_xmove +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 0b328b5b1bb6925d136401ab440a45f9238a7582 (mode 644) --- /dev/null +++ lua_xmove.3.html @@ -0,0 +1,51 @@ + + + + + + LUA_XMOVE(3) + + + + + + + + +
LUA_XMOVE(3)Library Functions ManualLUA_XMOVE(3)
+
+

+lua_xmove — +
exchange values between different threads of the same + global state
+

+#include + <lua.h> +
+void +
+lua_xmove(lua_State + *from, lua_State + *to, int + n); +

+lua_xmove() exchange values between different + threads of the same global state. This function pops n values from the stack + from, and pushes them onto the stack to. +

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

+The lua_xmove() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 13, 2022Debian
+ + blob - /dev/null blob + be7bdd5a3d3e10cd5fa01ea8e83fe0b945910167 (mode 644) --- /dev/null +++ lua_yield.3 @@ -0,0 +1,39 @@ +.Dd $Mdocdate: July 18 2022 $ +.Dt LUA_YIELD 3 +.Os +.Sh NAME +.Nm lua_yield +.Nd yields a coroutine +.Sh SYNOPSIS +.In lua.h +.Ft int +.Fn lua_yield "lua_State *L" "int nresults" +.Sh DESCRIPTION +.Fn lua_yield +yields a coroutine. +This function should only be called as the return expression of a C function, +as follows: +.Pp +.Bd -literal -offset indent -compact +return lua_yield (L, nresults); +.Ed +.Pp +When a C function calls +.Nm lua_yield +in that way, the running coroutine suspends its execution, and the call to +lua_resume that started this coroutine returns. +The parameter +.Fa nresults +is the number of values from the stack that are passed as results to +.Xr lua_resume 3 . +.Sh SEE ALSO +.Rs +.%A Roberto Ierusalimschy +.%A Luiz Henrique de Figueiredo +.%A Waldemar Celes +.%T Lua 5.1 Reference Manual +.Re +.Sh HISTORY +The +.Fn lua_yield +manual page was written by Sergey Bronnikov. blob - /dev/null blob + 387cf8017db7dc41d81bcfe08cf19902ef33bd45 (mode 644) --- /dev/null +++ lua_yield.3.html @@ -0,0 +1,61 @@ + + + + + + LUA_YIELD(3) + + + + + + + + +
LUA_YIELD(3)Library Functions ManualLUA_YIELD(3)
+
+

+lua_yield — +
yields a coroutine
+

+#include + <lua.h> +
+int +
+lua_yield(lua_State + *L, int + nresults); +

+lua_yield() yields a coroutine. This function + should only be called as the return expression of a C function, as follows: +
+
+
+return lua_yield (L, nresults);
+
+
+
+When a C function calls lua_yield in that + way, the running coroutine suspends its execution, and the call to lua_resume + that started this coroutine returns. The parameter + nresults is the number of values from the + stack that are passed as results to + lua_resume(3). +

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

+The lua_yield() manual page was written by + Sergey Bronnikov.
+ + + + + +
July 18, 2022Debian
+ +