#include #include #include #include int mumble_ctx_init(mumble_ctx_t *ctx) { int result; memset(ctx, 0, sizeof(mumble_ctx_t)); result = uv_loop_init(&ctx->uv_loop); assert(result == 0); if (result != 0) return result; ctx->uv_loop.data = ctx; ctx->uv_resolver.data = ctx; ctx->uv_connect_req.data = ctx; ctx->uv_tcp_socket.data = ctx; ctx->status = READY; return 0; } void mumble_ctx_close(mumble_ctx_t *ctx) { uv_loop_close(&ctx->uv_loop); }