Skip to content

Commit dcf98f7

Browse files
committed
Delete to_libc/from_libc for now
1 parent d9b4465 commit dcf98f7

2 files changed

Lines changed: 0 additions & 72 deletions

File tree

libcc2rs/src/libc_shims/socket.rs

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -226,58 +226,6 @@ impl ByteRepr for SockaddrStorage {
226226
}
227227
}
228228

229-
impl SockaddrIn {
230-
pub fn to_libc(&self) -> ::libc::sockaddr_in {
231-
let mut sin_zero = [0u8; 8];
232-
sin_zero.copy_from_slice(&self.sin_zero.borrow());
233-
::libc::sockaddr_in {
234-
sin_family: *self.sin_family.borrow(),
235-
sin_port: *self.sin_port.borrow(),
236-
sin_addr: ::libc::in_addr {
237-
s_addr: *self.sin_addr.borrow().s_addr.borrow(),
238-
},
239-
sin_zero,
240-
}
241-
}
242-
pub fn from_libc(l: &::libc::sockaddr_in) -> Self {
243-
Self {
244-
sin_family: Rc::new(RefCell::new(l.sin_family)),
245-
sin_port: Rc::new(RefCell::new(l.sin_port)),
246-
sin_addr: Rc::new(RefCell::new(InAddr {
247-
s_addr: Rc::new(RefCell::new(l.sin_addr.s_addr)),
248-
})),
249-
sin_zero: Rc::new(RefCell::new(l.sin_zero.to_vec().into_boxed_slice())),
250-
}
251-
}
252-
}
253-
254-
impl SockaddrIn6 {
255-
pub fn to_libc(&self) -> ::libc::sockaddr_in6 {
256-
let mut s6 = [0u8; 16];
257-
s6.copy_from_slice(&self.sin6_addr.borrow().s6_addr.borrow());
258-
::libc::sockaddr_in6 {
259-
sin6_family: *self.sin6_family.borrow(),
260-
sin6_port: *self.sin6_port.borrow(),
261-
sin6_flowinfo: *self.sin6_flowinfo.borrow(),
262-
sin6_addr: ::libc::in6_addr { s6_addr: s6 },
263-
sin6_scope_id: *self.sin6_scope_id.borrow(),
264-
}
265-
}
266-
pub fn from_libc(l: &::libc::sockaddr_in6) -> Self {
267-
Self {
268-
sin6_family: Rc::new(RefCell::new(l.sin6_family)),
269-
sin6_port: Rc::new(RefCell::new(l.sin6_port)),
270-
sin6_flowinfo: Rc::new(RefCell::new(l.sin6_flowinfo)),
271-
sin6_addr: Rc::new(RefCell::new(In6Addr {
272-
s6_addr: Rc::new(RefCell::new(
273-
l.sin6_addr.s6_addr.to_vec().into_boxed_slice(),
274-
)),
275-
})),
276-
sin6_scope_id: Rc::new(RefCell::new(l.sin6_scope_id)),
277-
}
278-
}
279-
}
280-
281229
impl ByteRepr for ::libc::sockaddr {}
282230
impl ByteRepr for ::libc::sockaddr_in {}
283231
impl ByteRepr for ::libc::sockaddr_in6 {}

libcc2rs/src/libc_shims/stat.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,4 @@ impl Clone for Stat {
6363

6464
impl ByteRepr for Stat {}
6565

66-
impl Stat {
67-
pub fn from_libc(l: &::libc::stat) -> Self {
68-
Self {
69-
st_dev: Rc::new(RefCell::new(l.st_dev)),
70-
st_ino: Rc::new(RefCell::new(l.st_ino)),
71-
st_nlink: Rc::new(RefCell::new(l.st_nlink)),
72-
st_mode: Rc::new(RefCell::new(l.st_mode)),
73-
st_uid: Rc::new(RefCell::new(l.st_uid)),
74-
st_gid: Rc::new(RefCell::new(l.st_gid)),
75-
st_rdev: Rc::new(RefCell::new(l.st_rdev)),
76-
st_size: Rc::new(RefCell::new(l.st_size)),
77-
st_blksize: Rc::new(RefCell::new(l.st_blksize)),
78-
st_blocks: Rc::new(RefCell::new(l.st_blocks)),
79-
st_atime: Rc::new(RefCell::new(l.st_atime)),
80-
st_mtime: Rc::new(RefCell::new(l.st_mtime)),
81-
st_ctime: Rc::new(RefCell::new(l.st_ctime)),
82-
}
83-
}
84-
}
85-
8666
impl ByteRepr for ::libc::stat {}

0 commit comments

Comments
 (0)