diff --git a/src/libcore/rt/uvll.rs b/src/libcore/rt/uvll.rs index 3eb7f8006b9ea..31f672aa7c74b 100644 --- a/src/libcore/rt/uvll.rs +++ b/src/libcore/rt/uvll.rs @@ -98,7 +98,7 @@ pub enum uv_req_type { pub unsafe fn malloc_handle(handle: uv_handle_type) -> *c_void { assert!(handle != UV_UNKNOWN_HANDLE && handle != UV_HANDLE_TYPE_MAX); - let size = rust_uv_handle_size(handle as uint); + let size = uv_handle_size(handle as uint); let p = malloc(size); assert!(p.is_not_null()); return p; @@ -110,7 +110,7 @@ pub unsafe fn free_handle(v: *c_void) { pub unsafe fn malloc_req(req: uv_req_type) -> *c_void { assert!(req != UV_UNKNOWN_REQ && req != UV_REQ_TYPE_MAX); - let size = rust_uv_req_size(req as uint); + let size = uv_req_size(req as uint); let p = malloc(size); assert!(p.is_not_null()); return p; @@ -135,7 +135,7 @@ fn request_sanity_check() { } pub unsafe fn loop_new() -> *c_void { - return rust_uv_loop_new(); + return uv_loop_new(); } pub unsafe fn loop_delete(loop_handle: *c_void) { @@ -147,11 +147,11 @@ pub unsafe fn run(loop_handle: *c_void) { } pub unsafe fn close(handle: *T, cb: *u8) { - rust_uv_close(handle as *c_void, cb); + uv_close(handle as *c_void, cb); } pub unsafe fn walk(loop_handle: *c_void, cb: *u8, arg: *c_void) { - rust_uv_walk(loop_handle, cb, arg); + uv_walk(loop_handle, cb, arg); } pub unsafe fn idle_new() -> *uv_idle_t { @@ -163,19 +163,19 @@ pub unsafe fn idle_delete(handle: *uv_idle_t) { } pub unsafe fn idle_init(loop_handle: *uv_loop_t, handle: *uv_idle_t) -> c_int { - rust_uv_idle_init(loop_handle, handle) + uv_idle_init(loop_handle, handle) } pub unsafe fn idle_start(handle: *uv_idle_t, cb: uv_idle_cb) -> c_int { - rust_uv_idle_start(handle, cb) + uv_idle_start(handle, cb) } pub unsafe fn idle_stop(handle: *uv_idle_t) -> c_int { - rust_uv_idle_stop(handle) + uv_idle_stop(handle) } pub unsafe fn tcp_init(loop_handle: *c_void, handle: *uv_tcp_t) -> c_int { - return rust_uv_tcp_init(loop_handle, handle); + return uv_tcp_init(loop_handle, handle); } // FIXME ref #2064 @@ -212,24 +212,24 @@ pub unsafe fn tcp_getpeername6(tcp_handle_ptr: *uv_tcp_t, name: *sockaddr_in6) - } pub unsafe fn listen(stream: *T, backlog: c_int, cb: *u8) -> c_int { - return rust_uv_listen(stream as *c_void, backlog, cb); + return uv_listen(stream as *c_void, backlog, cb); } pub unsafe fn accept(server: *c_void, client: *c_void) -> c_int { - return rust_uv_accept(server as *c_void, client as *c_void); + return uv_accept(server as *c_void, client as *c_void); } pub unsafe fn write(req: *uv_write_t, stream: *T, buf_in: &[uv_buf_t], cb: *u8) -> c_int { let buf_ptr = vec::raw::to_ptr(buf_in); let buf_cnt = vec::len(buf_in) as i32; - return rust_uv_write(req as *c_void, stream as *c_void, buf_ptr, buf_cnt, cb); + return uv_write(req as *c_void, stream as *c_void, buf_ptr, buf_cnt, cb); } pub unsafe fn read_start(stream: *uv_stream_t, on_alloc: *u8, on_read: *u8) -> c_int { - return rust_uv_read_start(stream as *c_void, on_alloc, on_read); + return uv_read_start(stream as *c_void, on_alloc, on_read); } pub unsafe fn read_stop(stream: *uv_stream_t) -> c_int { - return rust_uv_read_stop(stream as *c_void); + return uv_read_stop(stream as *c_void); } pub unsafe fn last_error(loop_handle: *c_void) -> uv_err_t { @@ -244,11 +244,11 @@ pub unsafe fn err_name(err: *uv_err_t) -> *c_char { } pub unsafe fn async_init(loop_handle: *c_void, async_handle: *uv_async_t, cb: *u8) -> c_int { - return rust_uv_async_init(loop_handle, async_handle, cb); + return uv_async_init(loop_handle, async_handle, cb); } pub unsafe fn async_send(async_handle: *uv_async_t) { - return rust_uv_async_send(async_handle); + return uv_async_send(async_handle); } pub unsafe fn buf_init(input: *u8, len: uint) -> uv_buf_t { let out_buf = uv_buf_t { base: ptr::null(), len: 0 as size_t }; @@ -258,14 +258,14 @@ pub unsafe fn buf_init(input: *u8, len: uint) -> uv_buf_t { } pub unsafe fn timer_init(loop_ptr: *c_void, timer_ptr: *uv_timer_t) -> c_int { - return rust_uv_timer_init(loop_ptr, timer_ptr); + return uv_timer_init(loop_ptr, timer_ptr); } pub unsafe fn timer_start(timer_ptr: *uv_timer_t, cb: *u8, timeout: uint, repeat: uint) -> c_int { - return rust_uv_timer_start(timer_ptr, cb, timeout as c_uint, repeat as c_uint); + return uv_timer_start(timer_ptr, cb, timeout as c_uint, repeat as c_uint); } pub unsafe fn timer_stop(timer_ptr: *uv_timer_t) -> c_int { - return rust_uv_timer_stop(timer_ptr); + return uv_timer_stop(timer_ptr); } pub unsafe fn malloc_ip4_addr(ip: &str, port: int) -> *sockaddr_in { @@ -352,29 +352,29 @@ pub struct uv_err_data { extern { - fn rust_uv_handle_size(type_: uintptr_t) -> size_t; - fn rust_uv_req_size(type_: uintptr_t) -> size_t; + fn uv_handle_size(type_: uintptr_t) -> size_t; + fn uv_req_size(type_: uintptr_t) -> size_t; fn rust_uv_handle_type_max() -> uintptr_t; fn rust_uv_req_type_max() -> uintptr_t; // libuv public API - fn rust_uv_loop_new() -> *c_void; + fn uv_loop_new() -> *c_void; fn rust_uv_loop_delete(lp: *c_void); fn rust_uv_run(loop_handle: *c_void); - fn rust_uv_close(handle: *c_void, cb: *u8); - fn rust_uv_walk(loop_handle: *c_void, cb: *u8, arg: *c_void); + fn uv_close(handle: *c_void, cb: *u8); + fn uv_walk(loop_handle: *c_void, cb: *u8, arg: *c_void); fn rust_uv_idle_new() -> *uv_idle_t; fn rust_uv_idle_delete(handle: *uv_idle_t); - fn rust_uv_idle_init(loop_handle: *uv_loop_t, handle: *uv_idle_t) -> c_int; - fn rust_uv_idle_start(handle: *uv_idle_t, cb: uv_idle_cb) -> c_int; - fn rust_uv_idle_stop(handle: *uv_idle_t) -> c_int; + fn uv_idle_init(loop_handle: *uv_loop_t, handle: *uv_idle_t) -> c_int; + fn uv_idle_start(handle: *uv_idle_t, cb: uv_idle_cb) -> c_int; + fn uv_idle_stop(handle: *uv_idle_t) -> c_int; - fn rust_uv_async_send(handle: *uv_async_t); - fn rust_uv_async_init(loop_handle: *c_void, + fn uv_async_send(handle: *uv_async_t); + fn uv_async_init(loop_handle: *c_void, async_handle: *uv_async_t, cb: *u8) -> c_int; - fn rust_uv_tcp_init(loop_handle: *c_void, handle_ptr: *uv_tcp_t) -> c_int; + fn uv_tcp_init(loop_handle: *c_void, handle_ptr: *uv_tcp_t) -> c_int; // FIXME ref #2604 .. ? fn rust_uv_buf_init(out_buf: *uv_buf_t, base: *u8, len: size_t); fn rust_uv_last_error(loop_handle: *c_void) -> uv_err_t; @@ -386,8 +386,6 @@ extern { fn rust_uv_ip6_addrp(ip: *u8, port: c_int) -> *sockaddr_in6; fn rust_uv_free_ip4_addr(addr: *sockaddr_in); fn rust_uv_free_ip6_addr(addr: *sockaddr_in6); - fn rust_uv_ip4_name(src: *sockaddr_in, dst: *u8, size: size_t) -> c_int; - fn rust_uv_ip6_name(src: *sockaddr_in6, dst: *u8, size: size_t) -> c_int; fn rust_uv_ip4_port(src: *sockaddr_in) -> c_uint; fn rust_uv_ip6_port(src: *sockaddr_in6) -> c_uint; // FIXME ref #2064 @@ -406,24 +404,24 @@ extern { fn rust_uv_tcp_bind6(tcp_server: *uv_tcp_t, ++addr: *sockaddr_in6) -> c_int; fn rust_uv_tcp_getpeername(tcp_handle_ptr: *uv_tcp_t, ++name: *sockaddr_in) -> c_int; fn rust_uv_tcp_getpeername6(tcp_handle_ptr: *uv_tcp_t, ++name: *sockaddr_in6) ->c_int; - fn rust_uv_listen(stream: *c_void, backlog: c_int, cb: *u8) -> c_int; - fn rust_uv_accept(server: *c_void, client: *c_void) -> c_int; - fn rust_uv_write(req: *c_void, + fn uv_listen(stream: *c_void, backlog: c_int, cb: *u8) -> c_int; + fn uv_accept(server: *c_void, client: *c_void) -> c_int; + fn uv_write(req: *c_void, stream: *c_void, ++buf_in: *uv_buf_t, buf_cnt: c_int, cb: *u8) -> c_int; - fn rust_uv_read_start(stream: *c_void, + fn uv_read_start(stream: *c_void, on_alloc: *u8, on_read: *u8) -> c_int; - fn rust_uv_read_stop(stream: *c_void) -> c_int; - fn rust_uv_timer_init(loop_handle: *c_void, + fn uv_read_stop(stream: *c_void) -> c_int; + fn uv_timer_init(loop_handle: *c_void, timer_handle: *uv_timer_t) -> c_int; - fn rust_uv_timer_start(timer_handle: *uv_timer_t, + fn uv_timer_start(timer_handle: *uv_timer_t, cb: *u8, timeout: c_uint, repeat: c_uint) -> c_int; - fn rust_uv_timer_stop(handle: *uv_timer_t) -> c_int; + fn uv_timer_stop(handle: *uv_timer_t) -> c_int; fn rust_uv_malloc_buf_base_of(sug_size: size_t) -> *u8; fn rust_uv_free_base_of_buf(++buf: uv_buf_t); diff --git a/src/libstd/uv_ll.rs b/src/libstd/uv_ll.rs index 8d7a97e2e483c..5c8eb495420a6 100644 --- a/src/libstd/uv_ll.rs +++ b/src/libstd/uv_ll.rs @@ -733,26 +733,26 @@ pub mod uv_ll_struct_stubgen { extern mod rustrt { // libuv public API - unsafe fn rust_uv_loop_new() -> *libc::c_void; + unsafe fn uv_loop_new() -> *libc::c_void; unsafe fn rust_uv_loop_delete(lp: *libc::c_void); unsafe fn rust_uv_run(loop_handle: *libc::c_void); - unsafe fn rust_uv_close(handle: *libc::c_void, cb: *u8); - unsafe fn rust_uv_walk(loop_handle: *libc::c_void, cb: *u8, + unsafe fn uv_close(handle: *libc::c_void, cb: *u8); + unsafe fn uv_walk(loop_handle: *libc::c_void, cb: *u8, arg: *libc::c_void); unsafe fn rust_uv_idle_new() -> *uv_idle_t; unsafe fn rust_uv_idle_delete(handle: *uv_idle_t); - unsafe fn rust_uv_idle_init(loop_handle: *uv_loop_t, + unsafe fn uv_idle_init(loop_handle: *uv_loop_t, handle: *uv_idle_t) -> libc::c_int; - unsafe fn rust_uv_idle_start(handle: *uv_idle_t, + unsafe fn uv_idle_start(handle: *uv_idle_t, cb: uv_idle_cb) -> libc::c_int; - unsafe fn rust_uv_idle_stop(handle: *uv_idle_t) -> libc::c_int; + unsafe fn uv_idle_stop(handle: *uv_idle_t) -> libc::c_int; - unsafe fn rust_uv_async_send(handle: *uv_async_t); - unsafe fn rust_uv_async_init(loop_handle: *libc::c_void, + unsafe fn uv_async_send(handle: *uv_async_t); + unsafe fn uv_async_init(loop_handle: *libc::c_void, async_handle: *uv_async_t, cb: *u8) -> libc::c_int; - unsafe fn rust_uv_tcp_init( + unsafe fn uv_tcp_init( loop_handle: *libc::c_void, handle_ptr: *uv_tcp_t) -> libc::c_int; // FIXME ref #2604 .. ? @@ -763,15 +763,15 @@ extern mod rustrt { unsafe fn rust_uv_strerror(err: *uv_err_t) -> *libc::c_char; // FIXME ref #2064 unsafe fn rust_uv_err_name(err: *uv_err_t) -> *libc::c_char; - unsafe fn rust_uv_ip4_addr(ip: *u8, port: libc::c_int) + unsafe fn uv_ip4_addr(ip: *u8, port: libc::c_int) -> sockaddr_in; - unsafe fn rust_uv_ip6_addr(ip: *u8, port: libc::c_int) + unsafe fn uv_ip6_addr(ip: *u8, port: libc::c_int) -> sockaddr_in6; - unsafe fn rust_uv_ip4_name(src: *sockaddr_in, + unsafe fn uv_ip4_name(src: *sockaddr_in, dst: *u8, size: libc::size_t) -> libc::c_int; - unsafe fn rust_uv_ip6_name(src: *sockaddr_in6, + unsafe fn uv_ip6_name(src: *sockaddr_in6, dst: *u8, size: libc::size_t) -> libc::c_int; @@ -797,31 +797,31 @@ extern mod rustrt { ++name: *sockaddr_in) -> libc::c_int; unsafe fn rust_uv_tcp_getpeername6(tcp_handle_ptr: *uv_tcp_t, ++name: *sockaddr_in6) ->libc::c_int; - unsafe fn rust_uv_listen(stream: *libc::c_void, + unsafe fn uv_listen(stream: *libc::c_void, backlog: libc::c_int, cb: *u8) -> libc::c_int; - unsafe fn rust_uv_accept(server: *libc::c_void, client: *libc::c_void) + unsafe fn uv_accept(server: *libc::c_void, client: *libc::c_void) -> libc::c_int; - unsafe fn rust_uv_write(req: *libc::c_void, + unsafe fn uv_write(req: *libc::c_void, stream: *libc::c_void, ++buf_in: *uv_buf_t, buf_cnt: libc::c_int, cb: *u8) -> libc::c_int; - unsafe fn rust_uv_read_start(stream: *libc::c_void, + unsafe fn uv_read_start(stream: *libc::c_void, on_alloc: *u8, on_read: *u8) -> libc::c_int; - unsafe fn rust_uv_read_stop(stream: *libc::c_void) -> libc::c_int; - unsafe fn rust_uv_timer_init(loop_handle: *libc::c_void, + unsafe fn uv_read_stop(stream: *libc::c_void) -> libc::c_int; + unsafe fn uv_timer_init(loop_handle: *libc::c_void, timer_handle: *uv_timer_t) -> libc::c_int; - unsafe fn rust_uv_timer_start( + unsafe fn uv_timer_start( timer_handle: *uv_timer_t, cb: *u8, timeout: libc::c_uint, repeat: libc::c_uint) -> libc::c_int; - unsafe fn rust_uv_timer_stop(handle: *uv_timer_t) -> libc::c_int; + unsafe fn uv_timer_stop(handle: *uv_timer_t) -> libc::c_int; unsafe fn rust_uv_getaddrinfo(loop_ptr: *libc::c_void, handle: *uv_getaddrinfo_t, @@ -883,7 +883,7 @@ extern mod rustrt { } pub unsafe fn loop_new() -> *libc::c_void { - return rustrt::rust_uv_loop_new(); + return rustrt::uv_loop_new(); } pub unsafe fn loop_delete(loop_handle: *libc::c_void) { @@ -895,11 +895,11 @@ pub unsafe fn run(loop_handle: *libc::c_void) { } pub unsafe fn close(handle: *T, cb: *u8) { - rustrt::rust_uv_close(handle as *libc::c_void, cb); + rustrt::uv_close(handle as *libc::c_void, cb); } pub unsafe fn walk(loop_handle: *libc::c_void, cb: *u8, arg: *libc::c_void) { - rustrt::rust_uv_walk(loop_handle, cb, arg); + rustrt::uv_walk(loop_handle, cb, arg); } pub unsafe fn idle_new() -> *uv_idle_t { @@ -912,20 +912,20 @@ pub unsafe fn idle_delete(handle: *uv_idle_t) { pub unsafe fn idle_init(loop_handle: *uv_loop_t, handle: *uv_idle_t) -> libc::c_int { - rustrt::rust_uv_idle_init(loop_handle, handle) + rustrt::uv_idle_init(loop_handle, handle) } pub unsafe fn idle_start(handle: *uv_idle_t, cb: uv_idle_cb) -> libc::c_int { - rustrt::rust_uv_idle_start(handle, cb) + rustrt::uv_idle_start(handle, cb) } pub unsafe fn idle_stop(handle: *uv_idle_t) -> libc::c_int { - rustrt::rust_uv_idle_stop(handle) + rustrt::uv_idle_stop(handle) } pub unsafe fn tcp_init(loop_handle: *libc::c_void, handle: *uv_tcp_t) -> libc::c_int { - return rustrt::rust_uv_tcp_init(loop_handle, handle); + return rustrt::uv_tcp_init(loop_handle, handle); } // FIXME ref #2064 pub unsafe fn tcp_connect(connect_ptr: *uv_connect_t, @@ -970,12 +970,12 @@ pub unsafe fn tcp_getpeername6(tcp_handle_ptr: *uv_tcp_t, pub unsafe fn listen(stream: *T, backlog: libc::c_int, cb: *u8) -> libc::c_int { - return rustrt::rust_uv_listen(stream as *libc::c_void, backlog, cb); + return rustrt::uv_listen(stream as *libc::c_void, backlog, cb); } pub unsafe fn accept(server: *libc::c_void, client: *libc::c_void) -> libc::c_int { - return rustrt::rust_uv_accept(server as *libc::c_void, + return rustrt::uv_accept(server as *libc::c_void, client as *libc::c_void); } @@ -983,18 +983,18 @@ pub unsafe fn write(req: *uv_write_t, stream: *T, buf_in: *~[uv_buf_t], cb: *u8) -> libc::c_int { let buf_ptr = vec::raw::to_ptr(*buf_in); let buf_cnt = vec::len(*buf_in) as i32; - return rustrt::rust_uv_write(req as *libc::c_void, + return rustrt::uv_write(req as *libc::c_void, stream as *libc::c_void, buf_ptr, buf_cnt, cb); } pub unsafe fn read_start(stream: *uv_stream_t, on_alloc: *u8, on_read: *u8) -> libc::c_int { - return rustrt::rust_uv_read_start(stream as *libc::c_void, + return rustrt::uv_read_start(stream as *libc::c_void, on_alloc, on_read); } pub unsafe fn read_stop(stream: *uv_stream_t) -> libc::c_int { - return rustrt::rust_uv_read_stop(stream as *libc::c_void); + return rustrt::uv_read_stop(stream as *libc::c_void); } pub unsafe fn last_error(loop_handle: *libc::c_void) -> uv_err_t { @@ -1011,13 +1011,13 @@ pub unsafe fn err_name(err: *uv_err_t) -> *libc::c_char { pub unsafe fn async_init(loop_handle: *libc::c_void, async_handle: *uv_async_t, cb: *u8) -> libc::c_int { - return rustrt::rust_uv_async_init(loop_handle, + return rustrt::uv_async_init(loop_handle, async_handle, cb); } pub unsafe fn async_send(async_handle: *uv_async_t) { - return rustrt::rust_uv_async_send(async_handle); + return rustrt::uv_async_send(async_handle); } pub unsafe fn buf_init(input: *u8, len: uint) -> uv_buf_t { let out_buf = uv_buf_t { base: ptr::null(), len: 0 as libc::size_t }; @@ -1027,13 +1027,13 @@ pub unsafe fn buf_init(input: *u8, len: uint) -> uv_buf_t { } pub unsafe fn ip4_addr(ip: &str, port: int) -> sockaddr_in { do str::as_c_str(ip) |ip_buf| { - rustrt::rust_uv_ip4_addr(ip_buf as *u8, + rustrt::uv_ip4_addr(ip_buf as *u8, port as libc::c_int) } } pub unsafe fn ip6_addr(ip: &str, port: int) -> sockaddr_in6 { do str::as_c_str(ip) |ip_buf| { - rustrt::rust_uv_ip6_addr(ip_buf as *u8, + rustrt::uv_ip6_addr(ip_buf as *u8, port as libc::c_int) } } @@ -1042,7 +1042,7 @@ pub unsafe fn ip4_name(src: &sockaddr_in) -> ~str { let dst: ~[u8] = ~[0u8,0u8,0u8,0u8,0u8,0u8,0u8,0u8, 0u8,0u8,0u8,0u8,0u8,0u8,0u8,0u8]; do vec::as_imm_buf(dst) |dst_buf, size| { - rustrt::rust_uv_ip4_name(to_unsafe_ptr(src), + rustrt::uv_ip4_name(to_unsafe_ptr(src), dst_buf, size as libc::size_t); // seems that checking the result of uv_ip4_name // doesn't work too well.. @@ -1063,7 +1063,7 @@ pub unsafe fn ip6_name(src: &sockaddr_in6) -> ~str { 0u8,0u8,0u8,0u8,0u8,0u8]; do vec::as_imm_buf(dst) |dst_buf, size| { let src_unsafe_ptr = to_unsafe_ptr(src); - let result = rustrt::rust_uv_ip6_name(src_unsafe_ptr, + let result = rustrt::uv_ip6_name(src_unsafe_ptr, dst_buf, size as libc::size_t); match result { 0i32 => str::raw::from_buf(dst_buf), @@ -1080,15 +1080,15 @@ pub unsafe fn ip6_port(src: &sockaddr_in6) -> uint { pub unsafe fn timer_init(loop_ptr: *libc::c_void, timer_ptr: *uv_timer_t) -> libc::c_int { - return rustrt::rust_uv_timer_init(loop_ptr, timer_ptr); + return rustrt::uv_timer_init(loop_ptr, timer_ptr); } pub unsafe fn timer_start(timer_ptr: *uv_timer_t, cb: *u8, timeout: uint, repeat: uint) -> libc::c_int { - return rustrt::rust_uv_timer_start(timer_ptr, cb, timeout as libc::c_uint, + return rustrt::uv_timer_start(timer_ptr, cb, timeout as libc::c_uint, repeat as libc::c_uint); } pub unsafe fn timer_stop(timer_ptr: *uv_timer_t) -> libc::c_int { - return rustrt::rust_uv_timer_stop(timer_ptr); + return rustrt::uv_timer_stop(timer_ptr); } pub unsafe fn getaddrinfo(loop_ptr: *libc::c_void, handle: *uv_getaddrinfo_t, diff --git a/src/rt/rust_uv.cpp b/src/rt/rust_uv.cpp index 8cf2bd4b4acb9..262adf8c0acd9 100644 --- a/src/rt/rust_uv.cpp +++ b/src/rt/rust_uv.cpp @@ -95,10 +95,6 @@ extern "C" void rust_uv_free(void* ptr) { current_kernel_free(ptr); } -extern "C" void* -rust_uv_loop_new() { - return (void*)uv_loop_new(); -} extern "C" void rust_uv_loop_delete(uv_loop_t* loop) { @@ -149,16 +145,6 @@ rust_uv_run(uv_loop_t* loop) { uv_run(loop, UV_RUN_DEFAULT); } -extern "C" void -rust_uv_close(uv_handle_t* handle, uv_close_cb cb) { - uv_close(handle, cb); -} - -extern "C" void -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; @@ -178,18 +164,6 @@ rust_uv_hilvl_close_timer(uv_async_t* handle) { current_kernel_free(handle); } -extern "C" void -rust_uv_async_send(uv_async_t* handle) { - uv_async_send(handle); -} - -extern "C" int -rust_uv_async_init(uv_loop_t* loop_handle, - uv_async_t* async_handle, - uv_async_cb cb) { - return uv_async_init(loop_handle, async_handle, cb); -} - extern "C" void* rust_uv_hilvl_async_init(uv_loop_t* loop, extern_simple_cb cb, uint8_t* buf) { @@ -222,27 +196,6 @@ rust_uv_hilvl_timer_start(uv_timer_t* the_timer, uint32_t timeout, 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); -} - -extern "C" int -rust_uv_timer_start(uv_timer_t* the_timer, uv_timer_cb cb, - uint32_t timeout, uint32_t repeat) { - return uv_timer_start(the_timer, cb, timeout, repeat); -} - -extern "C" int -rust_uv_timer_stop(uv_timer_t* the_timer) { - return uv_timer_stop(the_timer); -} - -extern "C" int -rust_uv_tcp_init(uv_loop_t* loop, uv_tcp_t* handle) { - return uv_tcp_init(loop, handle); -} - extern "C" int rust_uv_tcp_connect(uv_connect_t* connect_ptr, uv_tcp_t* tcp_ptr, @@ -293,17 +246,6 @@ rust_uv_tcp_getpeername6 return uv_tcp_getpeername(handle, (sockaddr*)name, &namelen); } -extern "C" int -rust_uv_listen(uv_stream_t* stream, int backlog, - uv_connection_cb cb) { - return uv_listen(stream, backlog, cb); -} - -extern "C" int -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); @@ -442,23 +384,6 @@ rust_uv_err_name(uv_err_t* err_ptr) { return uv_err_name(err); } -extern "C" int -rust_uv_write(uv_write_t* req, uv_stream_t* handle, - uv_buf_t* bufs, int buf_cnt, - uv_write_cb cb) { - return uv_write(req, handle, bufs, buf_cnt, cb); -} -extern "C" int -rust_uv_read_start(uv_stream_t* stream, uv_alloc_cb on_alloc, - uv_read_cb on_read) { - return uv_read_start(stream, on_alloc, on_read); -} - -extern "C" int -rust_uv_read_stop(uv_stream_t* stream) { - return uv_read_stop(stream); -} - extern "C" char* rust_uv_malloc_buf_base_of(size_t suggested_size) { return (char*) current_kernel_malloc(sizeof(char)*suggested_size, @@ -469,16 +394,6 @@ rust_uv_free_base_of_buf(uv_buf_t buf) { current_kernel_free(buf.base); } -extern "C" struct sockaddr_in -rust_uv_ip4_addr(const char* ip, int port) { - struct sockaddr_in addr = uv_ip4_addr(ip, port); - return addr; -} -extern "C" struct sockaddr_in6 -rust_uv_ip6_addr(const char* ip, int port) { - return uv_ip6_addr(ip, port); -} - extern "C" struct sockaddr_in* rust_uv_ip4_addrp(const char* ip, int port) { struct sockaddr_in addr = uv_ip4_addr(ip, port); @@ -506,15 +421,6 @@ rust_uv_free_ip6_addr(sockaddr_in6 *addrp) { free(addrp); } -extern "C" int -rust_uv_ip4_name(struct sockaddr_in* src, char* dst, size_t size) { - return uv_ip4_name(src, dst, size); -} -extern "C" int -rust_uv_ip6_name(struct sockaddr_in6* src, char* dst, size_t size) { - int result = uv_ip6_name(src, dst, size); - return result; -} extern "C" unsigned int rust_uv_ip4_port(struct sockaddr_in* src) { return ntohs(src->sin_port); @@ -533,17 +439,16 @@ extern "C" void rust_uv_current_kernel_free(void* mem) { current_kernel_free(mem); } - extern "C" int rust_uv_getaddrinfo(uv_loop_t* loop, uv_getaddrinfo_t* handle, uv_getaddrinfo_cb cb, char* node, char* service, addrinfo* hints) { - return uv_getaddrinfo(loop, handle, cb, node, service, hints); + return uv_getaddrinfo(loop, handle, cb, node, service, hints); } extern "C" void rust_uv_freeaddrinfo(addrinfo* res) { - uv_freeaddrinfo(res); + uv_freeaddrinfo(res); } extern "C" bool rust_uv_is_ipv4_addrinfo(addrinfo* input) { @@ -576,31 +481,6 @@ rust_uv_idle_delete(uv_idle_t* handle) { delete handle; } -extern "C" int -rust_uv_idle_init(uv_loop_t* loop, uv_idle_t* idle) { - return uv_idle_init(loop, idle); -} - -extern "C" int -rust_uv_idle_start(uv_idle_t* idle, uv_idle_cb cb) { - return uv_idle_start(idle, cb); -} - -extern "C" int -rust_uv_idle_stop(uv_idle_t* idle) { - return uv_idle_stop(idle); -} - -extern "C" size_t -rust_uv_handle_size(uintptr_t type) { - return uv_handle_size((uv_handle_type)type); -} - -extern "C" size_t -rust_uv_req_size(uintptr_t type) { - return uv_req_size((uv_req_type)type); -} - extern "C" uintptr_t rust_uv_handle_type_max() { return UV_HANDLE_TYPE_MAX; diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index 6be41251f1bd9..4f7cbb45ab4f4 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -71,44 +71,26 @@ rust_upcall_free rust_upcall_free_noswitch rust_upcall_malloc rust_upcall_malloc_noswitch -rust_uv_loop_new rust_uv_loop_delete -rust_uv_walk rust_uv_loop_set_data rust_uv_bind_op_cb rust_uv_stop_op_cb rust_uv_run -rust_uv_close rust_uv_hilvl_close rust_uv_hilvl_close_async rust_uv_hilvl_close_timer -rust_uv_async_send -rust_uv_async_init rust_uv_hilvl_async_init rust_uv_hilvl_timer_init rust_uv_hilvl_timer_start -rust_uv_timer_init -rust_uv_timer_start -rust_uv_timer_stop rust_uv_free -rust_uv_tcp_init rust_uv_buf_init rust_uv_last_error rust_uv_strerror rust_uv_err_name -rust_uv_ip4_addr -rust_uv_ip4_name -rust_uv_ip6_addr -rust_uv_ip6_name rust_uv_tcp_connect rust_uv_tcp_bind rust_uv_tcp_connect6 rust_uv_tcp_bind6 -rust_uv_listen -rust_uv_accept -rust_uv_write -rust_uv_read_start -rust_uv_read_stop rust_uv_malloc_buf_base_of rust_uv_free_base_of_buf rust_uv_is_ipv4_addrinfo @@ -142,13 +124,8 @@ rust_uv_get_base_from_buf rust_uv_get_len_from_buf rust_uv_current_kernel_malloc rust_uv_current_kernel_free -rust_uv_getaddrinfo -rust_uv_freeaddrinfo rust_uv_idle_new rust_uv_idle_delete -rust_uv_idle_init -rust_uv_idle_start -rust_uv_idle_stop rust_dbg_lock_create rust_dbg_lock_destroy rust_dbg_lock_lock @@ -214,8 +191,6 @@ rust_dbg_extern_return_TwoU64s rust_dbg_extern_identity_double rust_dbg_extern_identity_u8 rust_get_rt_env -rust_uv_handle_size -rust_uv_req_size rust_uv_handle_type_max rust_uv_req_type_max rust_uv_ip4_addrp @@ -234,3 +209,6 @@ rust_try rust_begin_unwind rust_take_task_borrow_list rust_set_task_borrow_list +uv_.* +rust_uv_getaddrinfo +rust_uv_freeaddrinfo