Skip to content

Commit 4044ea8

Browse files
committed
---
yaml --- r: 91591 b: refs/heads/auto c: 30c885e h: refs/heads/master i: 91589: f8915fa 91587: e4ca266 91583: ddc07b9 v: v3
1 parent 7a8d44b commit 4044ea8

File tree

15 files changed

+311
-956
lines changed

15 files changed

+311
-956
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 3851f908d16b55dfe69d5a423ecbef4cd224fae2
16+
refs/heads/auto: 30c885ea52458b361bb8f215c17c384743e6851a
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustuv/addrinfo.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ impl GetAddrInfoRequest {
110110
self.get_req_data().getaddrinfo_cb = Some(wrapper_cb);
111111

112112
unsafe {
113-
assert!(0 == uvll::getaddrinfo(loop_.native_handle(),
114-
self.native_handle(),
115-
getaddrinfo_cb,
116-
c_node_ptr,
117-
c_service_ptr,
118-
hint_ptr));
113+
assert!(0 == uvll::uv_getaddrinfo(loop_.native_handle(),
114+
self.native_handle(),
115+
getaddrinfo_cb,
116+
c_node_ptr,
117+
c_service_ptr,
118+
hint_ptr));
119119
}
120120

121121
extern "C" fn getaddrinfo_cb(req: *uvll::uv_getaddrinfo_t,
@@ -127,7 +127,7 @@ impl GetAddrInfoRequest {
127127
let data = req.get_req_data();
128128
(*data.getaddrinfo_cb.get_ref())(req, &addrinfo, err);
129129
unsafe {
130-
uvll::freeaddrinfo(res);
130+
uvll::uv_freeaddrinfo(res);
131131
}
132132
}
133133
}

branches/auto/src/librustuv/async.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl AsyncWatcher {
2626
watcher.install_watcher_data();
2727
let data = watcher.get_watcher_data();
2828
data.async_cb = Some(cb);
29-
assert_eq!(0, uvll::async_init(loop_.native_handle(), handle, async_cb));
29+
assert_eq!(0, uvll::uv_async_init(loop_.native_handle(), handle, async_cb));
3030
return watcher;
3131
}
3232

@@ -42,7 +42,7 @@ impl AsyncWatcher {
4242
pub fn send(&mut self) {
4343
unsafe {
4444
let handle = self.native_handle();
45-
uvll::async_send(handle);
45+
uvll::uv_async_send(handle);
4646
}
4747
}
4848
}

branches/auto/src/librustuv/file.rs

Lines changed: 81 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ impl FsRequest {
4242
me.req_boilerplate(Some(cb))
4343
};
4444
let ret = path.with_ref(|p| unsafe {
45-
uvll::fs_open(loop_.native_handle(),
46-
self.native_handle(), p, flags, mode, complete_cb_ptr)
45+
uvll::uv_fs_open(loop_.native_handle(),
46+
self.native_handle(), p, flags as c_int,
47+
mode as c_int, complete_cb_ptr)
4748
});
4849
assert_eq!(ret, 0);
4950
}
@@ -52,17 +53,18 @@ impl FsRequest {
5253
flags: int, mode: int) -> Result<c_int, UvError> {
5354
let complete_cb_ptr = self.req_boilerplate(None);
5455
let result = path.with_ref(|p| unsafe {
55-
uvll::fs_open(loop_.native_handle(),
56-
self.native_handle(), p, flags, mode, complete_cb_ptr)
56+
uvll::uv_fs_open(loop_.native_handle(),
57+
self.native_handle(), p, flags as c_int,
58+
mode as c_int, complete_cb_ptr)
5759
});
5860
self.sync_cleanup(result)
5961
}
6062

6163
pub fn unlink(mut self, loop_: &Loop, path: &CString, cb: FsCallback) {
6264
let complete_cb_ptr = self.req_boilerplate(Some(cb));
6365
let ret = path.with_ref(|p| unsafe {
64-
uvll::fs_unlink(loop_.native_handle(),
65-
self.native_handle(), p, complete_cb_ptr)
66+
uvll::uv_fs_unlink(loop_.native_handle(),
67+
self.native_handle(), p, complete_cb_ptr)
6668
});
6769
assert_eq!(ret, 0);
6870
}
@@ -71,8 +73,8 @@ impl FsRequest {
7173
-> Result<c_int, UvError> {
7274
let complete_cb_ptr = self.req_boilerplate(None);
7375
let result = path.with_ref(|p| unsafe {
74-
uvll::fs_unlink(loop_.native_handle(),
75-
self.native_handle(), p, complete_cb_ptr)
76+
uvll::uv_fs_unlink(loop_.native_handle(),
77+
self.native_handle(), p, complete_cb_ptr)
7678
});
7779
self.sync_cleanup(result)
7880
}
@@ -89,8 +91,8 @@ impl FsRequest {
8991
pub fn stat(mut self, loop_: &Loop, path: &CString, cb: FsCallback) {
9092
let complete_cb_ptr = self.req_boilerplate(Some(cb));
9193
let ret = path.with_ref(|p| unsafe {
92-
uvll::fs_stat(loop_.native_handle(),
93-
self.native_handle(), p, complete_cb_ptr)
94+
uvll::uv_fs_stat(loop_.native_handle(),
95+
self.native_handle(), p, complete_cb_ptr)
9496
});
9597
assert_eq!(ret, 0);
9698
}
@@ -101,9 +103,9 @@ impl FsRequest {
101103
let base_ptr = buf.base as *c_void;
102104
let len = buf.len as uint;
103105
let ret = unsafe {
104-
uvll::fs_write(loop_.native_handle(), self.native_handle(),
105-
fd, base_ptr,
106-
len, offset, complete_cb_ptr)
106+
uvll::uv_fs_write(loop_.native_handle(), self.native_handle(),
107+
fd, base_ptr,
108+
len as c_uint, offset, complete_cb_ptr)
107109
};
108110
assert_eq!(ret, 0);
109111
}
@@ -113,9 +115,9 @@ impl FsRequest {
113115
let base_ptr = buf.base as *c_void;
114116
let len = buf.len as uint;
115117
let result = unsafe {
116-
uvll::fs_write(loop_.native_handle(), self.native_handle(),
117-
fd, base_ptr,
118-
len, offset, complete_cb_ptr)
118+
uvll::uv_fs_write(loop_.native_handle(), self.native_handle(),
119+
fd, base_ptr,
120+
len as c_uint, offset, complete_cb_ptr)
119121
};
120122
self.sync_cleanup(result)
121123
}
@@ -126,9 +128,9 @@ impl FsRequest {
126128
let buf_ptr = buf.base as *c_void;
127129
let len = buf.len as uint;
128130
let ret = unsafe {
129-
uvll::fs_read(loop_.native_handle(), self.native_handle(),
130-
fd, buf_ptr,
131-
len, offset, complete_cb_ptr)
131+
uvll::uv_fs_read(loop_.native_handle(), self.native_handle(),
132+
fd, buf_ptr,
133+
len as c_uint, offset, complete_cb_ptr)
132134
};
133135
assert_eq!(ret, 0);
134136
}
@@ -138,30 +140,44 @@ impl FsRequest {
138140
let buf_ptr = buf.base as *c_void;
139141
let len = buf.len as uint;
140142
let result = unsafe {
141-
uvll::fs_read(loop_.native_handle(), self.native_handle(),
142-
fd, buf_ptr,
143-
len, offset, complete_cb_ptr)
143+
uvll::uv_fs_read(loop_.native_handle(), self.native_handle(),
144+
fd, buf_ptr,
145+
len as c_uint, offset, complete_cb_ptr)
144146
};
145147
self.sync_cleanup(result)
146148
}
147149

150+
<<<<<<< HEAD
148151
pub fn close(mut self, loop_: &Loop, fd: c_int, cb: FsCallback) {
149152
let complete_cb_ptr = self.req_boilerplate(Some(cb));
150153
assert_eq!(unsafe {
151154
uvll::fs_close(loop_.native_handle(), self.native_handle(),
152155
fd, complete_cb_ptr)
153156
}, 0);
157+
=======
158+
pub fn close(self, loop_: &Loop, fd: c_int, cb: FsCallback) {
159+
let complete_cb_ptr = {
160+
let mut me = self;
161+
me.req_boilerplate(Some(cb))
162+
};
163+
let ret = unsafe {
164+
uvll::uv_fs_close(loop_.native_handle(), self.native_handle(),
165+
fd, complete_cb_ptr)
166+
};
167+
assert_eq!(ret, 0);
168+
>>>>>>> 1850d26... Remove lots of uv/C++ wrappers
154169
}
155170
pub fn close_sync(mut self, loop_: &Loop,
156171
fd: c_int) -> Result<c_int, UvError> {
157172
let complete_cb_ptr = self.req_boilerplate(None);
158173
let result = unsafe {
159-
uvll::fs_close(loop_.native_handle(), self.native_handle(),
160-
fd, complete_cb_ptr)
174+
uvll::uv_fs_close(loop_.native_handle(), self.native_handle(),
175+
fd, complete_cb_ptr)
161176
};
162177
self.sync_cleanup(result)
163178
}
164179

180+
<<<<<<< HEAD
165181
pub fn mkdir(mut self, loop_: &Loop, path: &CString, mode: c_int,
166182
cb: FsCallback) {
167183
let complete_cb_ptr = self.req_boilerplate(Some(cb));
@@ -198,10 +214,36 @@ impl FsRequest {
198214
uvll::fs_chmod(loop_.native_handle(), self.native_handle(), p, mode,
199215
complete_cb_ptr)
200216
}), 0);
217+
=======
218+
pub fn mkdir(self, loop_: &Loop, path: &CString, mode: int, cb: FsCallback) {
219+
let complete_cb_ptr = {
220+
let mut me = self;
221+
me.req_boilerplate(Some(cb))
222+
};
223+
let ret = path.with_ref(|p| unsafe {
224+
uvll::uv_fs_mkdir(loop_.native_handle(),
225+
self.native_handle(), p,
226+
mode as c_int, complete_cb_ptr)
227+
});
228+
assert_eq!(ret, 0);
229+
}
230+
231+
pub fn rmdir(self, loop_: &Loop, path: &CString, cb: FsCallback) {
232+
let complete_cb_ptr = {
233+
let mut me = self;
234+
me.req_boilerplate(Some(cb))
235+
};
236+
let ret = path.with_ref(|p| unsafe {
237+
uvll::uv_fs_rmdir(loop_.native_handle(),
238+
self.native_handle(), p, complete_cb_ptr)
239+
});
240+
assert_eq!(ret, 0);
241+
>>>>>>> 1850d26... Remove lots of uv/C++ wrappers
201242
}
202243

203244
pub fn readdir(mut self, loop_: &Loop, path: &CString,
204245
flags: c_int, cb: FsCallback) {
246+
<<<<<<< HEAD
205247
let complete_cb_ptr = self.req_boilerplate(Some(cb));
206248
assert_eq!(path.with_ref(|p| unsafe {
207249
uvll::fs_readdir(loop_.native_handle(),
@@ -276,6 +318,17 @@ impl FsRequest {
276318
uvll::uv_fs_fdatasync(loop_.native_handle(), self.native_handle(), fd,
277319
complete_cb_ptr)
278320
}, 0);
321+
=======
322+
let complete_cb_ptr = {
323+
let mut me = self;
324+
me.req_boilerplate(Some(cb))
325+
};
326+
let ret = path.with_ref(|p| unsafe {
327+
uvll::uv_fs_readdir(loop_.native_handle(),
328+
self.native_handle(), p, flags, complete_cb_ptr)
329+
});
330+
assert_eq!(ret, 0);
331+
>>>>>>> 1850d26... Remove lots of uv/C++ wrappers
279332
}
280333

281334
// accessors/utility funcs
@@ -287,12 +340,10 @@ impl FsRequest {
287340
None => Ok(result)
288341
}
289342
}
290-
fn req_boilerplate(&mut self, cb: Option<FsCallback>) -> *u8 {
343+
fn req_boilerplate(&mut self, cb: Option<FsCallback>) -> uvll::uv_fs_cb {
291344
let result = match cb {
292-
Some(_) => {
293-
compl_cb as *u8
294-
},
295-
None => 0 as *u8
345+
Some(_) => compl_cb,
346+
None => 0 as uvll::uv_fs_cb
296347
};
297348
self.install_req_data(cb);
298349
result
@@ -365,7 +416,7 @@ impl FsRequest {
365416
let data = uvll::get_data_for_req(self.native_handle());
366417
let _data = transmute::<*c_void, ~RequestData>(data);
367418
uvll::set_data_for_req(self.native_handle(), null::<()>());
368-
uvll::fs_req_cleanup(self.native_handle());
419+
uvll::uv_fs_req_cleanup(self.native_handle());
369420
free_req(self.native_handle() as *c_void)
370421
}
371422
}

branches/auto/src/librustuv/idle.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl IdleWatcher {
2121
unsafe {
2222
let handle = uvll::malloc_handle(uvll::UV_IDLE);
2323
assert!(handle.is_not_null());
24-
assert_eq!(uvll::idle_init(loop_.native_handle(), handle), 0);
24+
assert_eq!(uvll::uv_idle_init(loop_.native_handle(), handle), 0);
2525
let mut watcher: IdleWatcher = NativeHandle::from_native_handle(handle);
2626
watcher.install_watcher_data();
2727
return watcher
@@ -35,14 +35,14 @@ impl IdleWatcher {
3535
}
3636

3737
unsafe {
38-
assert_eq!(uvll::idle_start(self.native_handle(), idle_cb), 0)
38+
assert_eq!(uvll::uv_idle_start(self.native_handle(), idle_cb), 0)
3939
}
4040
}
4141

4242
pub fn restart(&mut self) {
4343
unsafe {
4444
assert!(self.get_watcher_data().idle_cb.is_some());
45-
assert_eq!(uvll::idle_start(self.native_handle(), idle_cb), 0)
45+
assert_eq!(uvll::uv_idle_start(self.native_handle(), idle_cb), 0)
4646
}
4747
}
4848

@@ -52,7 +52,7 @@ impl IdleWatcher {
5252
// free
5353

5454
unsafe {
55-
assert_eq!(uvll::idle_stop(self.native_handle()), 0);
55+
assert_eq!(uvll::uv_idle_stop(self.native_handle()), 0);
5656
}
5757
}
5858
}

0 commit comments

Comments
 (0)