diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-09-19 00:43:31 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-09-19 00:43:31 +0200 |
| commit | 402b97fbdf4857adc5aa80f85fa5e59148e126b7 (patch) | |
| tree | 666e08bf605b3e09064cb965c3596684e3c0da5e /zig-lua/lua-5.4.7/testes/libs/lib22.c | |
| parent | 2e2da1fd114edb932954a108ddb6f7359dbb868a (diff) | |
| download | probe-402b97fbdf4857adc5aa80f85fa5e59148e126b7.tar.gz | |
Added debuggers to Nix shell
Diffstat (limited to 'zig-lua/lua-5.4.7/testes/libs/lib22.c')
| -rw-r--r-- | zig-lua/lua-5.4.7/testes/libs/lib22.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/zig-lua/lua-5.4.7/testes/libs/lib22.c b/zig-lua/lua-5.4.7/testes/libs/lib22.c new file mode 100644 index 0000000..8e65650 --- /dev/null +++ b/zig-lua/lua-5.4.7/testes/libs/lib22.c @@ -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; +} + + |
