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