Generate native bindings from rust crate

This commit is contained in:
2025-06-04 17:09:39 -03:00
parent 738f9c947b
commit 6ab490ce07
37 changed files with 1112 additions and 23 deletions

16
src/native/mem.rs Normal file
View File

@ -0,0 +1,16 @@
// Copyright (c) Tribufu. All Rights Reserved.
// SPDX-License-Identifier: UNLICENSED
use std::ffi::CString;
use std::os::raw::c_char;
#[no_mangle]
pub extern "C" fn tribufu_free_string(ptr: *mut c_char) {
if ptr.is_null() {
return;
}
unsafe {
let _ = CString::from_raw(ptr);
}
}