This commit is contained in:
Justine Tunney
2021-03-02 05:51:10 -08:00
parent aad841610e
commit 4d3195f57a
105 changed files with 47020 additions and 0 deletions

25
third_party/lua/testes/libs/lib22.c vendored Normal file
View File

@@ -0,0 +1,25 @@
#include "lua.h"
#include "lauxlib.h"
static int id (lua_State *L) {
lua_pushboolean(L, 1);
lua_insert(L, 1);
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;
}