Skip to content
Snippets Groups Projects
Unverified Commit 8adf1c3d authored by Jeremy Soller's avatar Jeremy Soller Committed by GitHub
Browse files

Merge pull request #34 from MggMuggins/master

Finish ctype impls
parents cfbe2749 42de0a0a
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ pub extern "C" fn isascii(c: c_int) -> c_int { ...@@ -23,7 +23,7 @@ pub extern "C" fn isascii(c: c_int) -> c_int {
#[no_mangle] #[no_mangle]
pub extern "C" fn iscntrl(c: c_int) -> c_int { pub extern "C" fn iscntrl(c: c_int) -> c_int {
unimplemented!(); ((c as c_uint) < 0x20 || c == 0x7f) as c_int
} }
#[no_mangle] #[no_mangle]
...@@ -33,7 +33,7 @@ pub extern "C" fn isdigit(c: c_int) -> c_int { ...@@ -33,7 +33,7 @@ pub extern "C" fn isdigit(c: c_int) -> c_int {
#[no_mangle] #[no_mangle]
pub extern "C" fn isgraph(c: c_int) -> c_int { pub extern "C" fn isgraph(c: c_int) -> c_int {
unimplemented!(); (((c - 0x21) as c_uint) < 0x5e) as c_int
} }
#[no_mangle] #[no_mangle]
...@@ -43,12 +43,12 @@ pub extern "C" fn islower(c: c_int) -> c_int { ...@@ -43,12 +43,12 @@ pub extern "C" fn islower(c: c_int) -> c_int {
#[no_mangle] #[no_mangle]
pub extern "C" fn isprint(c: c_int) -> c_int { pub extern "C" fn isprint(c: c_int) -> c_int {
unimplemented!(); (((c - 0x20) as c_uint) < 0x5f) as c_int
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn ispunct(c: c_int) -> c_int { pub extern "C" fn ispunct(c: c_int) -> c_int {
unimplemented!(); (isgraph(c) == 0 && !isalnum(c) == 0) as c_int
} }
#[no_mangle] #[no_mangle]
...@@ -63,12 +63,19 @@ pub extern "C" fn isupper(c: c_int) -> c_int { ...@@ -63,12 +63,19 @@ pub extern "C" fn isupper(c: c_int) -> c_int {
#[no_mangle] #[no_mangle]
pub extern "C" fn isxdigit(c: c_int) -> c_int { pub extern "C" fn isxdigit(c: c_int) -> c_int {
unimplemented!(); (isdigit(c) == 0 || ((c as c_int) | 32) - ('a' as c_int) < 6) as c_int
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn isblank(c: c_int) -> c_int {
(c == ' ' as c_int || c == '\t' as c_int) as c_int
}
#[no_mangle]
/// The comment in musl:
/// `/* nonsense function that should NEVER be used! */`
pub extern "C" fn toascii(c: c_int) -> c_int { pub extern "C" fn toascii(c: c_int) -> c_int {
unimplemented!(); c & 0x7f
} }
#[no_mangle] #[no_mangle]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment