From 057938217328f67dd4b45a946082166be77e58fc Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Sun, 2 Jun 2019 00:08:04 +0200 Subject: [PATCH] feat(ffi): add dc_str_unref --- deltachat-ffi/deltachat.h | 3 +++ deltachat-ffi/src/lib.rs | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index a280132a7..5b55cef34 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -1173,6 +1173,9 @@ int64_t dc_lot_get_timestamp (const dc_lot_t*); #define DC_STR_LOCATION 66 #define DC_STR_COUNT 66 +void dc_str_unref (char*); + + /* * @} */ diff --git a/deltachat-ffi/src/lib.rs b/deltachat-ffi/src/lib.rs index 7247240a3..3d9473e07 100644 --- a/deltachat-ffi/src/lib.rs +++ b/deltachat-ffi/src/lib.rs @@ -1538,3 +1538,8 @@ pub unsafe extern "C" fn dc_lot_get_id(lot: *mut dc_lot::dc_lot_t) -> libc::uint pub unsafe extern "C" fn dc_lot_get_timestamp(lot: *mut dc_lot::dc_lot_t) -> i64 { dc_lot::dc_lot_get_timestamp(lot) } + +#[no_mangle] +pub unsafe extern "C" fn dc_str_unref(s: *mut libc::c_char) { + libc::free(s as *mut _) +}