c test program

This commit is contained in:
nora 2023-09-30 10:54:59 +02:00
parent 54e0e7604e
commit 1baf8df4a8
18 changed files with 150 additions and 68 deletions

25
rawc/src/string.rs Normal file
View file

@ -0,0 +1,25 @@
#[no_mangle]
pub unsafe extern "C" fn memset(ptr: *mut u8, constant: u8, len: usize) {
libuwuc::mem::memset(ptr, constant, len)
}
#[no_mangle]
pub unsafe extern "C" fn memcpy(dest: *mut u8, src: *const u8, size: usize) -> *mut u8 {
libuwuc::mem::memcpy(dest, src, size)
}
#[no_mangle]
pub unsafe fn memcmp(s1: *const u8, s2: *const u8, size: usize) -> i32 {
libuwuc::mem::memcmp(s1, s2, size)
}
#[no_mangle]
pub unsafe fn bcmp(s1: *const u8, s2: *const u8, size: usize) -> i32 {
libuwuc::mem::memcmp(s1, s2, size)
}
#[no_mangle]
pub unsafe extern "C" fn strlen(s: *const u8) -> usize {
libuwuc::mem::strlen(s)
}