summaryrefslogtreecommitdiff
path: root/ffi/src
diff options
context:
space:
mode:
Diffstat (limited to 'ffi/src')
-rw-r--r--ffi/src/lib.rs12
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));
+ }
+}