mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 12:56:30 +03:00
add dc_get_last_error() (#2788)
* add dc_get_last_error() * make clippy happy * simplify block_on() call
This commit is contained in:
@@ -2206,6 +2206,16 @@ pub unsafe extern "C" fn dc_delete_all_locations(context: *mut dc_context_t) {
|
||||
});
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn dc_get_last_error(context: *mut dc_context_t) -> *mut libc::c_char {
|
||||
if context.is_null() {
|
||||
eprintln!("ignoring careless call to dc_get_last_error()");
|
||||
return "".strdup();
|
||||
}
|
||||
let ctx = &*context;
|
||||
block_on(ctx.get_last_error()).strdup()
|
||||
}
|
||||
|
||||
// dc_array_t
|
||||
|
||||
pub type dc_array_t = dc_array::dc_array_t;
|
||||
|
||||
Reference in New Issue
Block a user