Skip to content

Commit f3ef2fa

Browse files
committed
---
yaml --- r: 4600 b: refs/heads/master c: 82b1e3f h: refs/heads/master v: v3
1 parent 7de6e37 commit f3ef2fa

File tree

14 files changed

+67
-64
lines changed

14 files changed

+67
-64
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: c0846525e8329bd39125559f08fb378a461b7957
2+
refs/heads/master: 82b1e3f5cc0d0fec0f7fbab0f9b8766ce732c792

trunk/src/lib/run_program.rs

+14-11
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ fn run_program(prog: str, args: vec[str]) -> int {
3636
type program =
3737
obj {
3838
fn get_id() -> int;
39-
fn input() -> io::writer;
40-
fn output() -> io::reader;
41-
fn err() -> io::reader;
39+
fn input() -> ioivec::writer;
40+
fn output() -> ioivec::reader;
41+
fn err() -> ioivec::reader;
4242
fn close_input();
4343
fn finish() -> int;
4444
fn destroy();
@@ -65,14 +65,17 @@ fn start_program(prog: str, args: vec[str]) -> @program_res {
6565
err_file: os::libc::FILE,
6666
mutable finished: bool) {
6767
fn get_id() -> int { ret pid; }
68-
fn input() -> io::writer {
69-
ret io::new_writer(io::fd_buf_writer(in_fd, option::none));
68+
fn input() -> ioivec::writer {
69+
ret ioivec::new_writer(
70+
ioivec::fd_buf_writer(in_fd, option::none));
7071
}
71-
fn output() -> io::reader {
72-
ret io::new_reader(io::FILE_buf_reader(out_file, option::none));
72+
fn output() -> ioivec::reader {
73+
ret ioivec::new_reader(
74+
ioivec::FILE_buf_reader(out_file, option::none));
7375
}
74-
fn err() -> io::reader {
75-
ret io::new_reader(io::FILE_buf_reader(err_file, option::none));
76+
fn err() -> ioivec::reader {
77+
ret ioivec::new_reader(
78+
ioivec::FILE_buf_reader(err_file, option::none));
7679
}
7780
fn close_input() {
7881
let invalid_fd = -1;
@@ -100,10 +103,10 @@ fn start_program(prog: str, args: vec[str]) -> @program_res {
100103
false));
101104
}
102105

103-
fn read_all(rd: &io::reader) -> str {
106+
fn read_all(rd: &ioivec::reader) -> str {
104107
let buf = "";
105108
while !rd.eof() {
106-
let bytes = ivec::from_vec(rd.read_bytes(4096u));
109+
let bytes = rd.read_bytes(4096u);
107110
buf += str::unsafe_from_bytes(bytes);
108111
}
109112
ret buf;

trunk/src/lib/term.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ const color_bright_cyan: u8 = 14u8;
4040

4141
const color_bright_white: u8 = 15u8;
4242

43-
fn esc(writer: io::buf_writer) { writer.write([0x1bu8, '[' as u8]); }
43+
fn esc(writer: ioivec::buf_writer) { writer.write(~[0x1bu8, '[' as u8]); }
4444

45-
fn reset(writer: io::buf_writer) {
45+
fn reset(writer: ioivec::buf_writer) {
4646
esc(writer);
47-
writer.write(['0' as u8, 'm' as u8]);
47+
writer.write(~['0' as u8, 'm' as u8]);
4848
}
4949

5050
fn color_supported() -> bool {
@@ -55,18 +55,18 @@ fn color_supported() -> bool {
5555
};
5656
}
5757

58-
fn set_color(writer: io::buf_writer, first_char: u8, color: u8) {
58+
fn set_color(writer: ioivec::buf_writer, first_char: u8, color: u8) {
5959
assert (color < 16u8);
6060
esc(writer);
61-
if color >= 8u8 { writer.write(['1' as u8, ';' as u8]); color -= 8u8; }
62-
writer.write([first_char, ('0' as u8) + color, 'm' as u8]);
61+
if color >= 8u8 { writer.write(~['1' as u8, ';' as u8]); color -= 8u8; }
62+
writer.write(~[first_char, ('0' as u8) + color, 'm' as u8]);
6363
}
6464

65-
fn fg(writer: io::buf_writer, color: u8) {
65+
fn fg(writer: ioivec::buf_writer, color: u8) {
6666
ret set_color(writer, '3' as u8, color);
6767
}
6868

69-
fn bg(writer: io::buf_writer, color: u8) {
69+
fn bg(writer: ioivec::buf_writer, color: u8) {
7070
ret set_color(writer, '4' as u8, color);
7171
}
7272
// export fg;

trunk/src/lib/test.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ fn run_tests_console_(opts: &test_opts, tests: &[test_desc],
106106
to_task: &test_to_task) -> bool {
107107

108108
type test_state = @{
109-
out: io::writer,
109+
out: ioivec::writer,
110110
use_color: bool,
111111
mutable total: uint,
112112
mutable passed: uint,
@@ -148,7 +148,7 @@ fn run_tests_console_(opts: &test_opts, tests: &[test_desc],
148148
}
149149

150150
let st = @{
151-
out: io::stdout(),
151+
out: ioivec::stdout(),
152152
use_color: use_color(),
153153
mutable total: 0u,
154154
mutable passed: 0u,
@@ -181,19 +181,19 @@ fn run_tests_console_(opts: &test_opts, tests: &[test_desc],
181181

182182
ret success;
183183

184-
fn write_ok(out: &io::writer, use_color: bool) {
184+
fn write_ok(out: &ioivec::writer, use_color: bool) {
185185
write_pretty(out, "ok", term::color_green, use_color);
186186
}
187187

188-
fn write_failed(out: &io::writer, use_color: bool) {
188+
fn write_failed(out: &ioivec::writer, use_color: bool) {
189189
write_pretty(out, "FAILED", term::color_red, use_color);
190190
}
191191

192-
fn write_ignored(out: &io::writer, use_color: bool) {
192+
fn write_ignored(out: &ioivec::writer, use_color: bool) {
193193
write_pretty(out, "ignored", term::color_yellow, use_color);
194194
}
195195

196-
fn write_pretty(out: &io::writer, word: &str, color: u8,
196+
fn write_pretty(out: &ioivec::writer, word: &str, color: u8,
197197
use_color: bool) {
198198
if use_color && term::color_supported() {
199199
term::fg(out.get_buf_writer(), color);

trunk/src/test/bench/shootout-pfib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import std::uint;
1717
import std::time;
1818
import std::str;
1919
import std::int::range;
20-
import std::io;
20+
import std::ioivec;
2121
import std::getopts;
2222
import std::task;
2323
import std::u64;
@@ -94,7 +94,7 @@ fn main(argv: vec[str]) {
9494

9595
let num_trials = 10;
9696

97-
let out = io::stdout();
97+
let out = ioivec::stdout();
9898

9999

100100
for each n: int in range(1, max + 1) {

trunk/src/test/bench/task-perf-word-count.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
use std;
1212

13-
import std::io;
1413
import option = std::option::t;
1514
import std::option::some;
1615
import std::option::none;
1716
import std::str;
1817
import std::vec;
1918
import std::map;
2019
import std::ivec;
20+
import std::ioivec;
2121

2222
import std::time;
2323
import std::u64;
@@ -27,7 +27,7 @@ import clone = std::task::clone_chan;
2727

2828
fn map(filename: str, emit: map_reduce::putter) {
2929
// log_err "mapping " + filename;
30-
let f = io::file_reader(filename);
30+
let f = ioivec::file_reader(filename);
3131

3232

3333
while true {
@@ -51,7 +51,7 @@ fn reduce(word: str, get: map_reduce::getter) {
5151
}
5252
}
5353

54-
// auto out = io::stdout();
54+
// auto out = ioivec::stdout();
5555
// out.write_line(#fmt("%s: %d", word, count));
5656

5757
// log_err "reduce " + word + " done.";
@@ -226,7 +226,7 @@ mod map_reduce {
226226

227227
fn main(argv: vec[str]) {
228228
if vec::len(argv) < 2u {
229-
let out = io::stdout();
229+
let out = ioivec::stdout();
230230

231231
out.write_line(#fmt("Usage: %s <filename> ...", argv.(0)));
232232

@@ -251,7 +251,7 @@ fn main(argv: vec[str]) {
251251
log_err "MapReduce completed in " + u64::str(elapsed) + "ms";
252252
}
253253

254-
fn read_word(r: io::reader) -> option[str] {
254+
fn read_word(r: ioivec::reader) -> option[str] {
255255
let w = "";
256256

257257
while !r.eof() {

trunk/src/test/compiletest/header.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import std::option;
22
import std::str;
3-
import std::io;
3+
import std::ioivec;
44
import std::fs;
55

66
import common::config;
@@ -69,7 +69,7 @@ fn is_test_ignored(config: &config, testfile: &str) -> bool {
6969
}
7070

7171
iter iter_header(testfile: &str) -> str {
72-
let rdr = io::file_reader(testfile);
72+
let rdr = ioivec::file_reader(testfile);
7373
while !rdr.eof() {
7474
let ln = rdr.read_line();
7575

trunk/src/test/compiletest/procsrv.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import std::ivec;
1212
import std::os;
1313
import std::run;
1414
import std::unsafe;
15-
import std::io;
15+
import std::ioivec;
1616
import std::str;
1717

1818
export handle;
@@ -73,8 +73,8 @@ fn run(handle: &handle, lib_path: &str,
7373

7474
fn writeclose(fd: int, s: &option::t[str]) {
7575
if option::is_some(s) {
76-
let writer = io::new_writer(
77-
io::fd_buf_writer(fd, option::none));
76+
let writer = ioivec::new_writer(
77+
ioivec::fd_buf_writer(fd, option::none));
7878
writer.write_str(option::get(s));
7979
}
8080

@@ -84,10 +84,11 @@ fn writeclose(fd: int, s: &option::t[str]) {
8484
fn readclose(fd: int) -> str {
8585
// Copied from run::program_output
8686
let file = os::fd_FILE(fd);
87-
let reader = io::new_reader(io::FILE_buf_reader(file, option::none));
87+
let reader = ioivec::new_reader(
88+
ioivec::FILE_buf_reader(file, option::none));
8889
let buf = "";
8990
while !reader.eof() {
90-
let bytes = ivec::from_vec(reader.read_bytes(4096u));
91+
let bytes = reader.read_bytes(4096u);
9192
buf += str::unsafe_from_bytes(bytes);
9293
}
9394
os::libc::fclose(file);

trunk/src/test/compiletest/runtest.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import std::io;
21
import std::ioivec;
32
import std::str;
43
import std::option;
@@ -24,7 +23,7 @@ fn run(cx: &cx, testfile: &str) {
2423
test::configure_test_task();
2524
if (cx.config.verbose) {
2625
// We're going to be dumping a lot of info. Start on a new line.
27-
io::stdout().write_str("\n\n");
26+
ioivec::stdout().write_str("\n\n");
2827
}
2928
log #fmt("running %s", testfile);
3029
let props = load_props(testfile);
@@ -168,7 +167,7 @@ actual:\n\
168167
------------------------------------------\n\
169168
\n",
170169
expected, actual);
171-
io::stdout().write_str(msg);
170+
ioivec::stdout().write_str(msg);
172171
fail;
173172
}
174173
}
@@ -336,7 +335,8 @@ fn dump_output(config: &config, testfile: &str,
336335
fn dump_output_file(config: &config, testfile: &str,
337336
out: &str, extension: &str) {
338337
let outfile = make_out_name(config, testfile, extension);
339-
let writer = io::file_writer(outfile, [io::create, io::truncate]);
338+
let writer = ioivec::file_writer(outfile,
339+
~[ioivec::create, ioivec::truncate]);
340340
writer.write_str(out);
341341
}
342342

@@ -370,15 +370,15 @@ fn maybe_dump_to_stdout(config: &config,
370370
let sep2 = #fmt("------%s------------------------------",
371371
"stderr");
372372
let sep3 = "------------------------------------------";
373-
io::stdout().write_line(sep1);
374-
io::stdout().write_line(out);
375-
io::stdout().write_line(sep2);
376-
io::stdout().write_line(err);
377-
io::stdout().write_line(sep3);
373+
ioivec::stdout().write_line(sep1);
374+
ioivec::stdout().write_line(out);
375+
ioivec::stdout().write_line(sep2);
376+
ioivec::stdout().write_line(err);
377+
ioivec::stdout().write_line(sep3);
378378
}
379379
}
380380

381-
fn error(err: &str) { io::stdout().write_line(#fmt("\nerror: %s", err)); }
381+
fn error(err: &str) { ioivec::stdout().write_line(#fmt("\nerror: %s", err)); }
382382

383383
fn fatal(err: &str) -> ! { error(err); fail; }
384384

@@ -397,6 +397,6 @@ stderr:\n\
397397
------------------------------------------\n\
398398
\n",
399399
err, procres.cmdline, procres.stdout, procres.stderr);
400-
io::stdout().write_str(msg);
400+
ioivec::stdout().write_str(msg);
401401
fail;
402402
}

trunk/src/test/compiletest/util.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import std::option;
22
import std::generic_os::getenv;
3-
import std::io;
3+
import std::ioivec;
44

55
import common::config;
66

@@ -25,5 +25,5 @@ fn lib_path_env_var() -> str { "PATH" }
2525

2626
fn logv(config: &config, s: &str) {
2727
log s;
28-
if config.verbose { io::stdout().write_line(s); }
28+
if config.verbose { ioivec::stdout().write_line(s); }
2929
}

trunk/src/test/run-pass/hashmap-memory.rs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use std;
88

9-
import std::io;
109
import option = std::option::t;
1110
import std::option::some;
1211
import std::option::none;

trunk/src/test/run-pass/utf8_chars.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std;
22
import std::str;
3-
import std::io;
43
import std::ivec;
54

65
fn main() {

trunk/src/test/stdtest/io.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// -*- rust -*-
22
use std;
3-
import std::io;
3+
import std::ioivec;
44
import std::str;
55

66
#[cfg(target_os = "linux")]
@@ -12,11 +12,11 @@ fn test_simple() {
1212
let frood: str = "A hoopy frood who really knows where his towel is.";
1313
log frood;
1414
{
15-
let out: io::writer =
16-
io::file_writer(tmpfile, [io::create, io::truncate]);
15+
let out: ioivec::writer =
16+
ioivec::file_writer(tmpfile, ~[ioivec::create, ioivec::truncate]);
1717
out.write_str(frood);
1818
}
19-
let inp: io::reader = io::file_reader(tmpfile);
19+
let inp: ioivec::reader = ioivec::file_reader(tmpfile);
2020
let frood2: str = inp.read_c_str();
2121
log frood2;
2222
assert (str::eq(frood, frood2));

0 commit comments

Comments
 (0)