Debian Codegraph @

third_party/rust/nss-gk-api/src/exp.rs

raw
1 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
2 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
4 // option. This file may not be copied, modified, or distributed
5 // except according to those terms.
6
7 /* TODO
8 macro_rules! experimental_api {
9 ( $n:ident ( $( $a:ident : $t:ty ),* $(,)? ) ) => {
10 #[allow(non_snake_case)]
11 #[allow(clippy::too_many_arguments)]
12 pub(crate) unsafe fn $n ( $( $a : $t ),* ) -> Result<(), crate::err::Error> {
13 const EXP_FUNCTION: &str = stringify!($n);
14 let n = ::std::ffi::CString::new(EXP_FUNCTION)?;
15 let f = crate::ssl::SSL_GetExperimentalAPI(n.as_ptr());
16 if f.is_null() {
17 return Err(crate::err::Error::InternalError);
18 }
19 let f: unsafe extern "C" fn( $( $t ),* ) -> crate::SECStatus = ::std::mem::transmute(f);
20 let rv = f( $( $a ),* );
21 crate::err::secstatus_to_res(rv)
22 }
23 };
24 }
25 */