Make dc_open arguments rusty

This commit is contained in:
Alexander Krotov
2019-07-29 03:04:59 +03:00
parent c34e66adb6
commit 2d5b04148f
8 changed files with 41 additions and 62 deletions

View File

@@ -56,9 +56,16 @@ pub unsafe extern "C" fn dc_open(
blobdir: *mut libc::c_char,
) -> libc::c_int {
assert!(!context.is_null());
assert!(!dbfile.is_null());
let context = &mut *context;
context::dc_open(context, dbfile, blobdir)
let dbfile_str = dc_tools::as_str(dbfile);
let blobdir_str = if blobdir.is_null() {
None
} else {
Some(dc_tools::as_str(blobdir))
};
context::dc_open(context, dbfile_str, blobdir_str) as libc::c_int
}
#[no_mangle]