From f0001b45f91e7889c7060e45ac6c740401f7acb3 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 6 Feb 2026 03:37:54 +0800 Subject: Add FFI support for constants with C-compatible functions --- ffi/src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ffi/src/lib.rs (limited to 'ffi/src') diff --git a/ffi/src/lib.rs b/ffi/src/lib.rs new file mode 100644 index 0000000..7ffcb00 --- /dev/null +++ b/ffi/src/lib.rs @@ -0,0 +1,13 @@ +// Export constants functions +pub use constants::*; + +#[unsafe(no_mangle)] +#[allow(nonstandard_style)] +pub extern "C" fn JV_FreeString(ptr: *mut libc::c_char) { + if ptr.is_null() { + return; + } + unsafe { + drop(std::ffi::CString::from_raw(ptr)); + } +} -- cgit