mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Rename Lua test folder
This commit is contained in:
parent
a8945714e8
commit
5f088cec23
40 changed files with 30 additions and 30 deletions
23
third_party/lua/test/libs/lib2.c
vendored
Normal file
23
third_party/lua/test/libs/lib2.c
vendored
Normal 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;
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue