Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/encoding.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use types::{c_int, c_char, Value};

extern "C" {
pub fn rb_enc_associate_index(obj: Value, idx: c_int) -> Value;
pub fn rb_enc_find_index(name: *const c_char ) -> c_int;
pub fn rb_enc_get_index(obj: Value) -> c_int;
pub fn rb_enc_set_index(obj: Value, encindex: c_int);
pub fn rb_filesystem_encindex() -> c_int;
pub fn rb_locale_encindex() -> c_int;
pub fn rb_to_encoding_index(obj: Value) -> c_int;
pub fn rb_usascii_encindex() -> c_int;
pub fn rb_utf8_encindex() -> c_int;
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ extern crate libc;
pub mod array;
pub mod constant;
pub mod class;
pub mod encoding;
pub mod fixnum;
pub mod gc;
pub mod float;
Expand Down
3 changes: 3 additions & 0 deletions src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ extern "C" {
pub fn rb_utf8_str_new(str: *const c_char, len: c_long) -> Value;
pub fn rb_string_value_cstr(str: *const Value) -> *const c_char;
pub fn rb_string_value_ptr(str: *const Value) -> *const c_char;
pub fn rb_str_ascii_only_p(str: Value) -> bool;
pub fn rb_str_export_locale(str: Value) -> Value;
pub fn rb_str_valid_encoding_p(str: Value) -> bool;
}

#[repr(C)]
Expand Down