diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2026-03-09 19:42:12 +0800 |
|---|---|---|
| committer | Weicao-CatilGrass <1992414357@qq.com> | 2026-03-09 19:42:12 +0800 |
| commit | f7e36925c566cd8336e71eb507c8a766240f03a0 (patch) | |
| tree | ba92f1d6a69a738e00a1d77b5f19cbbe7c57deab /ffi/src/lib.rs | |
| parent | 2827668ab5f38c05f95a0060988313c449436267 (diff) | |
Add C FFI bindings for library usage
Diffstat (limited to 'ffi/src/lib.rs')
| -rw-r--r-- | ffi/src/lib.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ffi/src/lib.rs b/ffi/src/lib.rs new file mode 100644 index 0000000..46503ed --- /dev/null +++ b/ffi/src/lib.rs @@ -0,0 +1,12 @@ +pub use butchunker::ctx::ffi::*; + +#[unsafe(no_mangle)] +#[allow(nonstandard_style)] +pub extern "C" fn Butck_FreeString(ptr: *mut libc::c_char) { + if ptr.is_null() { + return; + } + unsafe { + drop(std::ffi::CString::from_raw(ptr)); + } +} |
