nexus\api/
updater.rs

1//! Update management.
2
3use crate::{util::str_to_c, AddonApi};
4use std::ffi::c_char;
5
6pub type RawRequestUpdate = unsafe extern "C-unwind" fn(signature: i32, update_url: *const c_char);
7
8/// Requests an update to be downloaded **without** performing a version check.
9pub fn request_update(signature: i32, update_url: impl AsRef<str>) {
10    let AddonApi { request_update, .. } = AddonApi::get();
11    let update_url = str_to_c(update_url, "failed to convert update url");
12    unsafe { request_update(signature, update_url.as_ptr()) }
13}