mirror of
https://github.com/Noratrieb/libuwuc.git
synced 2026-01-14 19:55:07 +01:00
more tests
This commit is contained in:
parent
043c960708
commit
1827bd19c9
12 changed files with 240 additions and 72 deletions
|
|
@ -13,7 +13,7 @@ pub unsafe extern "C" fn puts(s: *const c_char) -> i32 {
|
|||
// PRINTF:
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn __printf_chk(_flag: c_int, format: *const c_char, mut args: ...) -> c_int {
|
||||
pub unsafe extern "C" fn __printf_chk(_flag: c_int, format: *const u8, mut args: ...) -> c_int {
|
||||
let mut sink = WriteCounter(stdout, 0);
|
||||
|
||||
let result = libuwuc::fmt::printf::printf_generic(
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
use libuwuc::utils::SharedThinCstr;
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn malloc(size: usize) -> *mut u8 {
|
||||
libuwuc::alloc::malloc_zeroed(size, 16)
|
||||
|
|
@ -12,3 +14,10 @@ pub unsafe extern "C" fn free(ptr: *mut u8) {
|
|||
pub unsafe extern "C" fn exit(code: i32) -> ! {
|
||||
libuwuc::start::exit(code as i64 as _)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn getenv(name: *const u8) -> *const u8 {
|
||||
libuwuc::env::getenv(SharedThinCstr::from_raw(name))
|
||||
.map(SharedThinCstr::as_raw)
|
||||
.unwrap_or(core::ptr::null())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue