continue rustification

This commit is contained in:
dignifiedquire
2019-05-01 14:50:09 +02:00
parent 72e9fe6150
commit 75319dbf67
23 changed files with 2091 additions and 2120 deletions

View File

@@ -12,11 +12,12 @@ The result must be free()'d! */
pub unsafe fn dc_stock_str(mut context: &dc_context_t, mut id: libc::c_int) -> *mut libc::c_char {
return get_string(context, id, 0i32);
}
unsafe fn get_string(
mut context: *mut dc_context_t,
mut context: &dc_context_t,
mut id: libc::c_int,
mut qty: libc::c_int,
) -> &libc::c_char {
) -> *mut libc::c_char {
let mut ret: *mut libc::c_char = 0 as *mut libc::c_char;
if !context.is_null() {
ret = ((*context).cb)(
@@ -212,10 +213,10 @@ unsafe fn default_string(mut id: libc::c_int) -> *mut libc::c_char {
/* Replaces the first `%1$s` in the given String-ID by the given value.
The result must be free()'d! */
pub unsafe fn dc_stock_str_repl_string(
mut context: *mut dc_context_t,
mut context: &dc_context_t,
mut id: libc::c_int,
mut to_insert: *const libc::c_char,
) -> &libc::c_char {
) -> *mut libc::c_char {
let mut ret: *mut libc::c_char = get_string(context, id, 0i32);
dc_str_replace(
&mut ret,
@@ -230,10 +231,10 @@ pub unsafe fn dc_stock_str_repl_string(
return ret;
}
pub unsafe fn dc_stock_str_repl_int(
mut context: *mut dc_context_t,
mut context: &dc_context_t,
mut id: libc::c_int,
mut to_insert_int: libc::c_int,
) -> &libc::c_char {
) -> *mut libc::c_char {
let mut ret: *mut libc::c_char = get_string(context, id, to_insert_int);
let mut to_insert_str: *mut libc::c_char = dc_mprintf(
b"%i\x00" as *const u8 as *const libc::c_char,
@@ -255,11 +256,11 @@ pub unsafe fn dc_stock_str_repl_int(
/* Replaces the first `%1$s` and `%2$s` in the given String-ID by the two given strings.
The result must be free()'d! */
pub unsafe fn dc_stock_str_repl_string2(
mut context: *mut dc_context_t,
mut context: &dc_context_t,
mut id: libc::c_int,
mut to_insert: *const libc::c_char,
mut to_insert2: *const libc::c_char,
) -> &libc::c_char {
) -> *mut libc::c_char {
let mut ret: *mut libc::c_char = get_string(context, id, 0i32);
dc_str_replace(
&mut ret,
@@ -285,12 +286,12 @@ pub unsafe fn dc_stock_str_repl_string2(
}
/* Misc. */
pub unsafe fn dc_stock_system_msg(
mut context: *mut dc_context_t,
mut context: &dc_context_t,
mut str_id: libc::c_int,
mut param1: *const libc::c_char,
mut param2: *const libc::c_char,
mut from_id: uint32_t,
) -> &libc::c_char {
) -> *mut libc::c_char {
let mut ret: *mut libc::c_char = 0 as *mut libc::c_char;
let mut mod_contact: *mut dc_contact_t = 0 as *mut dc_contact_t;
let mut mod_displayname: *mut libc::c_char = 0 as *mut libc::c_char;