Added manual and tests for version 5.4-w2

This commit is contained in:
Roberto Ierusalimschy
2018-07-09 12:33:01 -03:00
parent f59e6a93c0
commit 7c519dfbd0
37 changed files with 22260 additions and 0 deletions

23
testes/libs/lib2.c Normal file
View File

@@ -0,0 +1,23 @@
#include "lua.h"
#include "lauxlib.h"
static int id (lua_State *L) {
return lua_gettop(L);
}
static const struct luaL_Reg funcs[] = {
{"id", id},
{NULL, NULL}
};
LUAMOD_API int luaopen_lib2 (lua_State *L) {
lua_settop(L, 2);
lua_setglobal(L, "y"); /* y gets 2nd parameter */
lua_setglobal(L, "x"); /* x gets 1st parameter */
luaL_newlib(L, funcs);
return 1;
}