libgcrypt_sys/
types.rs

1use libc::{c_char, c_int, c_uint, c_void, size_t};
2
3pub use libgpg_error_sys::gpg_error_t as gcry_error_t;
4
5// extern {
6//     pub type gcry_thread_cbs;
7//     pub type gcry_context;
8//     pub type gcry_sexp;
9//     pub type gcry_mpi;
10//     pub type gcry_mpi_point;
11//     pub type gcry_cipher_handle;
12//     pub type gcry_md_handle;
13//     pub type gcry_mac_handle;
14// }
15
16#[repr(C)]
17pub struct gcry_thread_cbs {
18    _priv: [u8; 0],
19}
20#[repr(C)]
21pub struct gcry_context {
22    _priv: [u8; 0],
23}
24#[repr(C)]
25pub struct gcry_sexp {
26    _priv: [u8; 0],
27}
28#[repr(C)]
29pub struct gcry_mpi {
30    _priv: [u8; 0],
31}
32#[repr(C)]
33pub struct gcry_mpi_point {
34    _priv: [u8; 0],
35}
36#[repr(C)]
37pub struct gcry_cipher_handle {
38    _priv: [u8; 0],
39}
40#[repr(C)]
41pub struct gcry_md_handle {
42    _priv: [u8; 0],
43}
44#[repr(C)]
45pub struct gcry_mac_handle {
46    _priv: [u8; 0],
47}
48
49pub type gcry_ctx_t = *mut gcry_context;
50pub type gcry_sexp_t = *mut gcry_sexp;
51pub type gcry_mpi_t = *mut gcry_mpi;
52pub type gcry_mpi_point_t = *mut gcry_mpi_point;
53pub type gcry_cipher_hd_t = *mut gcry_cipher_handle;
54pub type gcry_md_hd_t = *mut gcry_md_handle;
55pub type gcry_mac_hd_t = *mut gcry_mac_handle;
56
57pub type gcry_prime_check_func_t =
58    Option<unsafe extern "C" fn(*mut c_void, c_int, gcry_mpi_t) -> c_int>;
59
60pub type gcry_handler_progress_t =
61    Option<unsafe extern "C" fn(*mut c_void, *const c_char, c_int, c_int, c_int)>;
62pub type gcry_handler_alloc_t = Option<unsafe extern "C" fn(size_t) -> *mut c_void>;
63pub type gcry_handler_secure_check_t = Option<unsafe extern "C" fn(*const c_void) -> c_int>;
64pub type gcry_handler_realloc_t = Option<unsafe extern "C" fn(*mut c_void, size_t) -> *mut c_void>;
65pub type gcry_handler_free_t = Option<unsafe extern "C" fn(*mut c_void)>;
66pub type gcry_handler_no_mem_t = Option<unsafe extern "C" fn(*mut c_void, size_t, c_uint) -> c_int>;
67pub type gcry_handler_error_t = Option<unsafe extern "C" fn(*mut c_void, c_int, *const c_char)>;
68//pub type gcry_handler_log_t = Option<unsafe extern fn(*mut c_void, c_int, *const c_char, va_list)>