LLUV_INTERNAL void lluv_tcp_initlib(lua_State *L, int nup, int safe){ lutil_pushnvalues(L, nup); if(!lutil_createmetap(L, LLUV_TCP, lluv_tcp_methods, nup)) lua_pop(L, nup); lua_pop(L, 1); luaL_setfuncs(L, lluv_functions[safe], nup); lluv_register_constants(L, lluv_tcp_constants); }
LLUV_INTERNAL void lluv_poll_initlib(lua_State *L, int nup, int safe){ assert((safe == 0) || (safe == 1)); lutil_pushnvalues(L, nup); if(!lutil_createmetap(L, LLUV_POLL, lluv_poll_methods, nup)) lua_pop(L, nup); lua_pop(L, 1); luaL_setfuncs(L, lluv_poll_functions[safe], nup); lluv_register_constants(L, lluv_poll_constants); }
LLUV_INTERNAL void lluv_signal_initlib(lua_State *L, int nup, int safe){ lutil_pushnvalues(L, nup); if(!lutil_createmetap(L, LLUV_SIGNAL, lluv_signal_methods, nup)) lua_pop(L, nup); lua_pop(L, 1); luaL_setfuncs(L, lluv_functions[safe], nup); lluv_register_constants(L, lluv_signal_constants); #ifndef _WIN32 signal(SIGPIPE, SIG_IGN); #endif }
LLUV_INTERNAL void lluv_dns_initlib(lua_State *L, int nup, int safe){ luaL_setfuncs(L, lluv_functions[safe], nup); lluv_register_constants(L, lluv_dns_constants); }