diff --git a/ll.rs b/ll.rs index f2febe7..5d30a67 100644 --- a/ll.rs +++ b/ll.rs @@ -25,7 +25,7 @@ pub struct lwc_string { insensitive: *lwc_string } -extern { +pub extern { fn lwc_intern_string(s: *c_char, slen: size_t, ret: *mut *lwc_string) -> lwc_error; fn rust_lwc_string_ref(s: *lwc_string); fn rust_lwc_string_unref(s: *lwc_string); diff --git a/wapcaplet.rc b/wapcaplet.rc index 41f120e..f36969a 100644 --- a/wapcaplet.rc +++ b/wapcaplet.rc @@ -4,14 +4,14 @@ extern mod std; -pub mod ll; - use core::libc::size_t; use core::ptr::{null, to_mut_unsafe_ptr}; use core::cast::transmute; use core::libc::*; use ll::*; +pub mod ll; + fn require_ok(code: lwc_error) { match code { lwc_error_ok => (), @@ -76,7 +76,7 @@ pub impl LwcString { } } - fn to_str_slice(&self) -> &self/str { + fn to_str_slice(&self) -> &'self str { unsafe { let p: *u8 = transmute(self.string.offset(1)); do str::raw::buf_as_slice(p, self.len()) |slice| { @@ -87,7 +87,7 @@ pub impl LwcString { } impl ToStr for LwcString { - pure fn to_str(&self) -> ~str { + fn to_str(&self) -> ~str { unsafe { // The string is located immediately after the handle let p: *c_char = transmute(self.string.offset(1));