• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use libc::*;
2 
3 cfg_if! {
4     if #[cfg(ossl110)] {
5         pub enum OPENSSL_STACK {}
6     } else {
7         #[repr(C)]
8         pub struct _STACK {
9             pub num: c_int,
10             pub data: *mut *mut c_char,
11             pub sorted: c_int,
12             pub num_alloc: c_int,
13             pub comp: Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>,
14         }
15     }
16 }
17 
18 cfg_if! {
19     if #[cfg(ossl110)] {
20         extern "C" {
21             pub fn OPENSSL_sk_num(stack: *const OPENSSL_STACK) -> c_int;
22             pub fn OPENSSL_sk_value(stack: *const OPENSSL_STACK, idx: c_int) -> *mut c_void;
23 
24             pub fn OPENSSL_sk_new_null() -> *mut OPENSSL_STACK;
25             pub fn OPENSSL_sk_free(st: *mut OPENSSL_STACK);
26             pub fn OPENSSL_sk_pop_free(
27                 st: *mut OPENSSL_STACK,
28                 free: Option<unsafe extern "C" fn(*mut c_void)>,
29             );
30             pub fn OPENSSL_sk_push(st: *mut OPENSSL_STACK, data: *const c_void) -> c_int;
31             pub fn OPENSSL_sk_pop(st: *mut OPENSSL_STACK) -> *mut c_void;
32         }
33     } else {
34         extern "C" {
35             pub fn sk_num(st: *const _STACK) -> c_int;
36             pub fn sk_value(st: *const _STACK, n: c_int) -> *mut c_void;
37 
38             pub fn sk_new_null() -> *mut _STACK;
39             pub fn sk_free(st: *mut _STACK);
40             pub fn sk_pop_free(st: *mut _STACK, free: Option<unsafe extern "C" fn(*mut c_void)>);
41             pub fn sk_push(st: *mut _STACK, data: *mut c_void) -> c_int;
42             pub fn sk_pop(st: *mut _STACK) -> *mut c_void;
43         }
44     }
45 }
46