mirror of
https://github.com/Noratrieb/libuwuc.git
synced 2026-01-14 19:55:07 +01:00
strncmp
This commit is contained in:
parent
9e2cf38cd5
commit
8d1795ad1a
8 changed files with 126 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use libuwuc::error::Error;
|
||||
use libuwuc::{error::Error, utils::SharedThinCstr};
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn memset(ptr: *mut u8, constant: u8, len: usize) {
|
||||
|
|
@ -25,6 +25,17 @@ pub unsafe extern "C" fn bcmp(s1: *const u8, s2: *const u8, size: usize) -> i32
|
|||
libuwuc::mem::memcmp(s1, s2, size)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn strcmp(s1: SharedThinCstr<'_>, s2: SharedThinCstr<'_>) -> i32 {
|
||||
libuwuc::mem::strcmp(s1, s2)
|
||||
}
|
||||
|
||||
// This technically violates the safety precondition of SharedThinCstr but that's fine, we're careful.
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn strncmp(s1: SharedThinCstr<'_>, s2: SharedThinCstr<'_>, n: usize) -> i32 {
|
||||
libuwuc::mem::strncmp(s1, s2, n)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn strlen(s: *const u8) -> usize {
|
||||
libuwuc::mem::strlen(s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue