mirror of
https://github.com/Noratrieb/libuwuc.git
synced 2026-01-14 19:55:07 +01:00
implement more things
This commit is contained in:
parent
119d0f1443
commit
9e2cf38cd5
11 changed files with 177 additions and 12 deletions
|
|
@ -1,3 +1,5 @@
|
|||
use libuwuc::error::Error;
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn memset(ptr: *mut u8, constant: u8, len: usize) {
|
||||
libuwuc::mem::memset(ptr, constant, len)
|
||||
|
|
@ -8,6 +10,11 @@ pub unsafe extern "C" fn memcpy(dest: *mut u8, src: *const u8, size: usize) -> *
|
|||
libuwuc::mem::memcpy(dest, src, size)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn memmove(dest: *mut u8, src: *const u8, size: usize) -> *mut u8 {
|
||||
libuwuc::mem::memmove(dest, src, size)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn memcmp(s1: *const u8, s2: *const u8, size: usize) -> i32 {
|
||||
libuwuc::mem::memcmp(s1, s2, size)
|
||||
|
|
@ -22,3 +29,10 @@ pub unsafe extern "C" fn bcmp(s1: *const u8, s2: *const u8, size: usize) -> i32
|
|||
pub unsafe extern "C" fn strlen(s: *const u8) -> usize {
|
||||
libuwuc::mem::strlen(s)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn strerror(errnum: Error) -> *const u8 {
|
||||
libuwuc::error::strerror(errnum)
|
||||
.map(str::as_ptr)
|
||||
.unwrap_or(core::ptr::null())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue