rust/src/lib/_str.rs

26 lines
415 B
Rust
Raw Normal View History

2010-06-23 23:03:09 -05:00
import rustrt.sbuf;
native "rust" mod rustrt {
type sbuf;
fn str_buf(str s) -> sbuf;
fn str_len(str s) -> uint;
fn str_alloc(uint n_bytes) -> str;
fn refcount[T](str s) -> uint;
2010-06-23 23:03:09 -05:00
}
fn is_utf8(vec[u8] v) -> bool {
fail; // FIXME
2010-06-23 23:03:09 -05:00
}
fn alloc(uint n_bytes) -> str {
2010-06-23 23:03:09 -05:00
ret rustrt.str_alloc(n_bytes);
}
fn len(str s) -> uint {
ret rustrt.str_len(s);
}
fn buf(str s) -> sbuf {
ret rustrt.str_buf(s);
}