| 1 |
use super::super::*; |
| 2 |
use std::ffi::{c_char, c_int, c_ulong}; |
| 3 |
|
| 4 |
#[repr(C)] |
| 5 |
pub struct ERR_STRING_DATA { |
| 6 |
pub error: c_ulong, |
| 7 |
pub string: *const c_char, |
| 8 |
} |
| 9 |
|
| 10 |
cfg_if! { |
| 11 |
if #[cfg(ossl300)] { |
| 12 |
extern "C" { |
| 13 |
pub fn ERR_new(); |
| 14 |
pub fn ERR_set_debug(file: *const c_char, line: c_int, func: *const c_char); |
| 15 |
pub fn ERR_set_error(lib: c_int, reason: c_int, fmt: *const c_char, ...); |
| 16 |
} |
| 17 |
} else { |
| 18 |
extern "C" { |
| 19 |
pub fn ERR_put_error(lib: c_int, func: c_int, reason: c_int, file: *const c_char, line: c_int); |
| 20 |
} |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
extern "C" { |
| 25 |
pub fn ERR_set_error_data(data: *mut c_char, flags: c_int); |
| 26 |
|
| 27 |
pub fn ERR_get_error() -> c_ulong; |
| 28 |
#[cfg(ossl300)] |
| 29 |
pub fn ERR_get_error_all( |
| 30 |
file: *mut *const c_char, |
| 31 |
line: *mut c_int, |
| 32 |
func: *mut *const c_char, |
| 33 |
data: *mut *const c_char, |
| 34 |
flags: *mut c_int, |
| 35 |
) -> c_ulong; |
| 36 |
pub fn ERR_peek_last_error() -> c_ulong; |
| 37 |
pub fn ERR_clear_error(); |
| 38 |
pub fn ERR_lib_error_string(err: c_ulong) -> *const c_char; |
| 39 |
pub fn ERR_reason_error_string(err: c_ulong) -> *const c_char; |
| 40 |
#[cfg(ossl110)] |
| 41 |
pub fn ERR_load_strings(lib: c_int, str: *mut ERR_STRING_DATA) -> c_int; |
| 42 |
#[cfg(not(ossl110))] |
| 43 |
pub fn ERR_load_strings(lib: c_int, str: *mut ERR_STRING_DATA); |
| 44 |
#[cfg(not(ossl110))] |
| 45 |
pub fn ERR_load_crypto_strings(); |
| 46 |
|
| 47 |
pub fn ERR_get_next_error_library() -> c_int; |
| 48 |
} |
| 49 |
|
| 50 |
#[cfg(not(osslconf = "OPENSSL_NO_DEPRECATED_3_0"))] |
| 51 |
extern "C" { |
| 52 |
pub fn ERR_get_error_line_data( |
| 53 |
file: *mut *const c_char, |
| 54 |
line: *mut c_int, |
| 55 |
data: *mut *const c_char, |
| 56 |
flags: *mut c_int, |
| 57 |
) -> c_ulong; |
| 58 |
pub fn ERR_func_error_string(err: c_ulong) -> *const c_char; |
| 59 |
} |