#pragma once #include #include #include "../loop.h" struct nn_curl { struct nn_event_loop *loop; ev_io event; bool started; ev_timer timer; bool timer_started; CURL *handle; CURLM *multi_handle; bool added; curl_socket_t sock; void (*handle_events)(void *, struct nn_curl *); void *userdata; }; bool nn_curl_init(struct nn_curl *curl); void nn_curl_set_url(struct nn_curl *curl, str *url); bool nn_curl_add_handle(struct nn_curl *curl); bool nn_curl_remove_handle(struct nn_curl *curl); void nn_curl_close(struct nn_curl *curl);