diff --git a/src/rt/rust_uv.cpp b/src/rt/rust_uv.cpp index f537e866dfc..0462789af9f 100644 --- a/src/rt/rust_uv.cpp +++ b/src/rt/rust_uv.cpp @@ -17,34 +17,6 @@ #include "rust_globals.h" -// extern fn pointers -typedef void (*extern_async_op_cb)(uv_loop_t* loop, void* data, - uv_async_t* op_handle); -typedef void (*extern_simple_cb)(uint8_t* id_buf, void* loop_data); -typedef void (*extern_close_cb)(uint8_t* id_buf, void* handle, - void* data); - -// data types -#define RUST_UV_HANDLE_LEN 16 - -struct handle_data { - uint8_t id_buf[RUST_UV_HANDLE_LEN]; - extern_simple_cb cb; - extern_close_cb close_cb; -}; - -static void -foreign_timer_cb(uv_timer_t* handle, int status) { - handle_data* handle_d = (handle_data*)handle->data; - void* loop_data = handle->loop->data; - handle_d->cb(handle_d->id_buf, loop_data); -} - -static void -foreign_close_cb(uv_handle_t* handle) { - handle_data* data = (handle_data*)handle->data; - data->close_cb(data->id_buf, handle, handle->loop->data); -} extern "C" void* rust_uv_loop_new() { return (void*)uv_loop_new(); @@ -91,13 +63,6 @@ rust_uv_walk(uv_loop_t* loop, uv_walk_cb cb, void* arg) { uv_walk(loop, cb, arg); } -extern "C" void -rust_uv_hilvl_close(uv_handle_t* handle, extern_close_cb cb) { - handle_data* data = (handle_data*)handle->data; - data->close_cb = cb; - uv_close(handle, foreign_close_cb); -} - extern "C" void rust_uv_async_send(uv_async_t* handle) { uv_async_send(handle); @@ -110,12 +75,6 @@ rust_uv_async_init(uv_loop_t* loop_handle, return uv_async_init(loop_handle, async_handle, cb); } -extern "C" void -rust_uv_hilvl_timer_start(uv_timer_t* the_timer, uint32_t timeout, - uint32_t repeat) { - uv_timer_start(the_timer, foreign_timer_cb, timeout, repeat); -} - extern "C" int rust_uv_timer_init(uv_loop_t* loop, uv_timer_t* timer) { return uv_timer_init(loop, timer); @@ -301,58 +260,6 @@ rust_uv_accept(uv_stream_t* server, uv_stream_t* client) { return uv_accept(server, client); } -extern "C" size_t -rust_uv_helper_uv_tcp_t_size() { - return sizeof(uv_tcp_t); -} -extern "C" size_t -rust_uv_helper_uv_connect_t_size() { - return sizeof(uv_connect_t); -} -extern "C" size_t -rust_uv_helper_uv_buf_t_size() { - return sizeof(uv_buf_t); -} -extern "C" size_t -rust_uv_helper_uv_write_t_size() { - return sizeof(uv_write_t); -} -extern "C" size_t -rust_uv_helper_uv_err_t_size() { - return sizeof(uv_err_t); -} -extern "C" size_t -rust_uv_helper_sockaddr_in_size() { - return sizeof(sockaddr_in); -} -extern "C" size_t -rust_uv_helper_sockaddr_in6_size() { - return sizeof(sockaddr_in6); -} -extern "C" size_t -rust_uv_helper_uv_async_t_size() { - return sizeof(uv_async_t); -} -extern "C" size_t -rust_uv_helper_uv_timer_t_size() { - return sizeof(uv_timer_t); -} -extern "C" size_t -rust_uv_helper_addr_in_size() { - return sizeof(sockaddr_in6); -} -extern "C" size_t -rust_uv_helper_uv_getaddrinfo_t_size() { - return sizeof(uv_getaddrinfo_t); -} -extern "C" size_t -rust_uv_helper_addrinfo_size() { - return sizeof(addrinfo); -} -extern "C" unsigned int -rust_uv_helper_get_INADDR_NONE() { - return INADDR_NONE; -} extern "C" uv_stream_t* rust_uv_get_stream_handle_from_connect_req(uv_connect_t* connect) { return connect->handle; diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index b5ce0400c1e..ecf22d72b12 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -40,10 +40,8 @@ rust_uv_walk rust_uv_loop_set_data rust_uv_run rust_uv_close -rust_uv_hilvl_close rust_uv_async_send rust_uv_async_init -rust_uv_hilvl_timer_start rust_uv_timer_init rust_uv_timer_start rust_uv_timer_stop @@ -92,19 +90,6 @@ rust_uv_is_ipv6_addrinfo rust_uv_get_next_addrinfo rust_uv_addrinfo_as_sockaddr_in rust_uv_addrinfo_as_sockaddr_in6 -rust_uv_helper_uv_tcp_t_size -rust_uv_helper_uv_connect_t_size -rust_uv_helper_uv_buf_t_size -rust_uv_helper_uv_write_t_size -rust_uv_helper_uv_err_t_size -rust_uv_helper_sockaddr_in_size -rust_uv_helper_sockaddr_in6_size -rust_uv_helper_addr_in_size -rust_uv_helper_addrinfo_size -rust_uv_helper_uv_getaddrinfo_t_size -rust_uv_helper_get_INADDR_NONE -rust_uv_helper_uv_async_t_size -rust_uv_helper_uv_timer_t_size rust_uv_get_stream_handle_from_connect_req rust_uv_get_stream_handle_from_write_req rust_uv_get_loop_for_uv_handle