Skip to content
Snippets Groups Projects
Commit af78f481 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Merge branch 'master' of github.com:redox-os/relibc

parents 4198055d 8adf1c3d
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 {
#[no_mangle]
pub extern "C" fn iscntrl(c: c_int) -> c_int {
unimplemented!();
((c as c_uint) < 0x20 || c == 0x7f) as c_int
}
#[no_mangle]
......@@ -33,7 +33,7 @@ pub extern "C" fn isdigit(c: c_int) -> c_int {
#[no_mangle]
pub extern "C" fn isgraph(c: c_int) -> c_int {
unimplemented!();
(((c - 0x21) as c_uint) < 0x5e) as c_int
}
#[no_mangle]
......@@ -43,12 +43,12 @@ pub extern "C" fn islower(c: c_int) -> c_int {
#[no_mangle]
pub extern "C" fn isprint(c: c_int) -> c_int {
unimplemented!();
(((c - 0x20) as c_uint) < 0x5f) as c_int
}
#[no_mangle]
pub extern "C" fn ispunct(c: c_int) -> c_int {
unimplemented!();
(isgraph(c) == 0 && !isalnum(c) == 0) as c_int
}
#[no_mangle]
......@@ -63,12 +63,19 @@ pub extern "C" fn isupper(c: c_int) -> c_int {
#[no_mangle]
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]
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 {
unimplemented!();
c & 0x7f
}
#[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