Browse Source

melib/gpgme: trim header file

jmap-eventsource
Manos Pitsidianakis 1 year ago
parent
commit
20840625d6
Signed by: epilys GPG Key ID: 73627C2F690DF710
  1. 5228
      melib/src/gpgme/bindings.rs
  2. 7
      melib/src/gpgme/mod.rs

5228
melib/src/gpgme/bindings.rs
File diff suppressed because it is too large
View File

7
melib/src/gpgme/mod.rs

@ -40,8 +40,6 @@ use std::os::unix::io::{AsRawFd, RawFd};
use std::path::Path;
use std::sync::{Arc, Mutex};
const GPGME_MIN_VERSION: &str = "1.12.0";
macro_rules! call {
($lib:expr, $func:ty) => {{
let func: libloading::Symbol<$func> =
@ -215,16 +213,15 @@ impl Drop for ContextInner {
impl Context {
pub fn new() -> Result<Self> {
let version = CString::new(GPGME_MIN_VERSION).unwrap();
let lib = Arc::new(libloading::Library::new(libloading::library_filename(
"gpgme",
))?);
if unsafe { call!(&lib, gpgme_check_version)(version.as_c_str().as_ptr() as *mut _) }
if unsafe { call!(&lib, gpgme_check_version)(GPGME_VERSION.as_bytes().as_ptr() as *mut _) }
.is_null()
{
return Err(MeliError::new(format!(
"Could not use libgpgme: requested version compatible with {} but got {}",
GPGME_MIN_VERSION,
GPGME_VERSION,
unsafe {
CStr::from_ptr(call!(&lib, gpgme_check_version)(std::ptr::null_mut()))
.to_string_lossy()

Loading…
Cancel
Save