| 1 | use super::super::*; |
| 2 | use libc::*; |
| 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 | unsafeextern "C" { |
| 25 | pub unsafefn ERR_set_error_data(data: *mut c_char, flags: c_int); |
| 26 | |
| 27 | pub unsafefn ERR_get_error() -> c_ulong; |
| 28 | #[cfg (ossl300)] |
| 29 | pub unsafefn 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 unsafefn ERR_get_error_line_data( |
| 37 | file: *mut *const c_char, |
| 38 | line: *mut c_int, |
| 39 | data: *mut *const c_char, |
| 40 | flags: *mut c_int, |
| 41 | ) -> c_ulong; |
| 42 | pub unsafefn ERR_peek_last_error() -> c_ulong; |
| 43 | pub unsafefn ERR_clear_error(); |
| 44 | pub unsafefn ERR_lib_error_string(err: c_ulong) -> *const c_char; |
| 45 | pub unsafefn ERR_func_error_string(err: c_ulong) -> *const c_char; |
| 46 | pub unsafefn ERR_reason_error_string(err: c_ulong) -> *const c_char; |
| 47 | #[cfg (ossl110)] |
| 48 | pub unsafefn ERR_load_strings(lib: c_int, str: *mut ERR_STRING_DATA) -> c_int; |
| 49 | #[cfg (not(ossl110))] |
| 50 | pub fn ERR_load_strings(lib: c_int, str: *mut ERR_STRING_DATA); |
| 51 | #[cfg (not(ossl110))] |
| 52 | pub fn ERR_load_crypto_strings(); |
| 53 | |
| 54 | pub unsafefn ERR_get_next_error_library() -> c_int; |
| 55 | } |
| 56 | |