diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-02-06 03:37:54 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-02-06 03:37:54 +0800 |
| commit | f0001b45f91e7889c7060e45ac6c740401f7acb3 (patch) | |
| tree | 51f0f93ecc4b1240871801b52ae0ffa77b3e8e6e /ffi/src | |
| parent | 520925836243b9c3e60f199f11374b3eddbe3fae (diff) | |
Add FFI support for constants with C-compatible functions
Diffstat (limited to 'ffi/src')
| -rw-r--r-- | ffi/src/lib.rs | 13 |
1 files changed, 13 insertions, 0 deletions
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)); + } +} |
