static int new_timer(lua_State* L) { uv_timer_t* handle = luv_create_timer(L); if (uv_timer_init(uv_default_loop(), handle)) { uv_err_t err = uv_last_error(uv_default_loop()); return luaL_error(L, "new_timer: %s", uv_strerror(err)); } return 1; }
int luv_new_timer (lua_State* L) { uv_timer_t* handle = luv_create_timer(L); uv_timer_init(luv_get_loop(L), handle); return 1; }