commit d20f837ad9e4ea2b067dd3ef19fd6bc41099f573 from: Sergey Bronnikov date: Wed Jul 27 06:59:11 2022 UTC man3: luaL_loadfile.3 commit - 814b4a8d972ba66ecd347367119c9bf9ea0ffbd0 commit + d20f837ad9e4ea2b067dd3ef19fd6bc41099f573 blob - /dev/null blob + 25872e5f6ba44116c63133c5019c6871cfd25428 (mode 644) --- /dev/null +++ man3/luaL_loadfile.3 @@ -0,0 +1,36 @@ +.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 HISTORY +The +.Fn luaL_loadfile +manual page was written by Sergey Bronnikov.