diff options
| author | bors <bors@rust-lang.org> | 2013-10-24 14:26:15 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-10-24 14:26:15 -0700 |
| commit | 3f5b2219cc893b30863f9136703166f306fcc684 (patch) | |
| tree | d7267619b1909f2deaf319c560a64d667d141d35 /src/rt/rust_uv.cpp | |
| parent | 61f8c059c4c6082683d78b2ee3d963f65fa1eb98 (diff) | |
| parent | 188e471339dfe652b8ff9f3bbe4cc262a040c584 (diff) | |
| download | rust-3f5b2219cc893b30863f9136703166f306fcc684.tar.gz rust-3f5b2219cc893b30863f9136703166f306fcc684.zip | |
auto merge of #9901 : alexcrichton/rust/unix-sockets, r=brson
Large topics: * Implemented `rt::io::net::unix`. We've got an implementation backed by "named pipes" for windows for free from libuv, so I'm not sure if these should be `cfg(unix)` or whether they'd be better placed in `rt::io::pipe` (which is currently kinda useless), or to leave in `unix`. Regardless, we probably shouldn't deny windows of functionality which it certainly has. * Fully implemented `net::addrinfo`, or at least fully implemented in the sense of making the best attempt to wrap libuv's `getaddrinfo` api * Moved standard I/O to a libuv TTY instead of just a plain old file descriptor. I found that this interacted better when closing stdin, and it has the added bonus of getting things like terminal dimentions (someone should make a progress bar now!) * Migrate to `~Trait` instead of a typedef'd object where possible. There are only two more types which are blocked on this, and those are traits which have a method which takes by-value self (there's an open issue on this) * Drop `rt::io::support::PathLike` in favor of just `ToCStr`. We recently had a lot of Path work done, but it still wasn't getting passed down to libuv (there was an intermediate string conversion), and this allows true paths to work all the way down to libuv (and anything else that can become a C string). * Removes `extra::fileinput` and `extra::io_util` Closes #9895 Closes #9975 Closes #8330 Closes #6850 (ported lots of libraries away from std::io) cc #4248 (implemented unix/dns) cc #9128 (made everything truly trait objects)
Diffstat (limited to 'src/rt/rust_uv.cpp')
| -rw-r--r-- | src/rt/rust_uv.cpp | 61 |
1 files changed, 51 insertions, 10 deletions
diff --git a/src/rt/rust_uv.cpp b/src/rt/rust_uv.cpp index 3e9b8ba136e..0cbbb58d02c 100644 --- a/src/rt/rust_uv.cpp +++ b/src/rt/rust_uv.cpp @@ -466,16 +466,6 @@ rust_uv_addrinfo_as_sockaddr_in6(addrinfo* input) { return (sockaddr_in6*)input->ai_addr; } -extern "C" uv_idle_t* -rust_uv_idle_new() { - return new uv_idle_t; -} - -extern "C" void -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); @@ -637,3 +627,54 @@ extern "C" int rust_uv_pipe_init(uv_loop_t *loop, uv_pipe_t* p, int ipc) { return uv_pipe_init(loop, p, ipc); } + +extern "C" int +rust_uv_pipe_open(uv_pipe_t *pipe, int file) { + return uv_pipe_open(pipe, file); +} + +extern "C" int +rust_uv_pipe_bind(uv_pipe_t *pipe, char *name) { + return uv_pipe_bind(pipe, name); +} + +extern "C" void +rust_uv_pipe_connect(uv_connect_t *req, uv_pipe_t *handle, + char *name, uv_connect_cb cb) { + uv_pipe_connect(req, handle, name, cb); +} + +extern "C" int +rust_uv_tty_init(uv_loop_t *loop, uv_tty_t *tty, int fd, int readable) { + return uv_tty_init(loop, tty, fd, readable); +} + +extern "C" int +rust_uv_tty_set_mode(uv_tty_t *tty, int mode) { + return uv_tty_set_mode(tty, mode); +} + +extern "C" int +rust_uv_tty_get_winsize(uv_tty_t *tty, int *width, int *height) { + return uv_tty_get_winsize(tty, width, height); +} + +extern "C" uv_handle_type +rust_uv_guess_handle(int fd) { + return uv_guess_handle(fd); +} + +extern "C" int +rust_uv_signal_init(uv_loop_t* loop, uv_signal_t* handle) { + return uv_signal_init(loop, handle); +} + +extern "C" int +rust_uv_signal_start(uv_signal_t* handle, uv_signal_cb signal_cb, int signum) { + return uv_signal_start(handle, signal_cb, signum); +} + +extern "C" int +rust_uv_signal_stop(uv_signal_t* handle) { + return uv_signal_stop(handle); +} |
