prototype dc_set_config_from_qr()

This commit is contained in:
B. Petersen
2020-02-10 23:36:56 +01:00
committed by holger krekel
parent 1882176489
commit 2b7a0a4585
3 changed files with 41 additions and 0 deletions

View File

@@ -423,6 +423,22 @@ pub unsafe extern "C" fn dc_set_stock_translation(
.unwrap_or(0)
}
#[no_mangle]
pub unsafe extern "C" fn dc_set_config_from_qr(
context: *mut dc_context_t,
qr: *mut libc::c_char,
) -> libc::c_int {
if context.is_null() || qr.is_null() {
eprintln!("ignoring careless call to dc_set_config_from_qr");
return 0;
}
let qr = to_string_lossy(qr);
let ffi_context = &*context;
ffi_context
.with_inner(|ctx| qr::set_config_from_qr(ctx, &qr) as libc::c_int)
.unwrap_or(0)
}
#[no_mangle]
pub unsafe extern "C" fn dc_get_info(context: *mut dc_context_t) -> *mut libc::c_char {
if context.is_null() {