#include "lua.h" #include "table.h" #include "crypto.h" #include "io.h" int luaopen_llib(lua_State* L) { lua_newtable(L); //create .array functions lua_newtable(L); luaL_register(L, NULL, array_function_list); lua_setfield(L, 2, "array"); lua_newtable(L); luaL_register(L, NULL, crypto_function_list); lua_setfield(L, 2, "crypto"); lua_newtable(L); luaL_register(L, NULL, io_function_list); lua_setfield(L, 2, "io"); //make llib global lua_setglobal(L, "llib"); return 1; }