use core::cell::UnsafeCell;
use core::ffi::*;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use crate::*;
#[repr(C)]
#[derive(Debug)]
pub struct SecAsn1Coder {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for SecAsn1Coder {
const ENCODING_REF: Encoding = Encoding::Pointer(&Encoding::Struct("SecAsn1Coder", &[]));
}
#[deprecated = "SecAsn1 is not supported"]
pub type SecAsn1CoderRef = *mut SecAsn1Coder;
impl SecAsn1Coder {
#[doc(alias = "SecAsn1CoderCreate")]
#[deprecated = "SecAsn1 is not supported"]
#[inline]
pub unsafe fn create(coder: NonNull<SecAsn1CoderRef>) -> OSStatus {
extern "C-unwind" {
fn SecAsn1CoderCreate(coder: NonNull<SecAsn1CoderRef>) -> OSStatus;
}
unsafe { SecAsn1CoderCreate(coder) }
}
#[doc(alias = "SecAsn1CoderRelease")]
#[deprecated = "SecAsn1 is not supported"]
#[inline]
pub unsafe fn release(coder: SecAsn1CoderRef) -> OSStatus {
extern "C-unwind" {
fn SecAsn1CoderRelease(coder: SecAsn1CoderRef) -> OSStatus;
}
unsafe { SecAsn1CoderRelease(coder) }
}
}
extern "C-unwind" {
#[cfg(feature = "SecAsn1Types")]
#[deprecated = "SecAsn1 is not supported"]
pub fn SecAsn1Decode(
coder: SecAsn1CoderRef,
src: NonNull<c_void>,
len: usize,
templates: NonNull<SecAsn1Template>,
dest: NonNull<c_void>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "SecAsn1Types")]
#[deprecated = "SecAsn1 is not supported"]
pub fn SecAsn1DecodeData(
coder: SecAsn1CoderRef,
src: NonNull<SecAsn1Item>,
templ: NonNull<SecAsn1Template>,
dest: NonNull<c_void>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "SecAsn1Types")]
#[deprecated = "SecAsn1 is not supported"]
pub fn SecAsn1EncodeItem(
coder: SecAsn1CoderRef,
src: NonNull<c_void>,
templates: NonNull<SecAsn1Template>,
dest: NonNull<SecAsn1Item>,
) -> OSStatus;
}
#[deprecated = "SecAsn1 is not supported"]
#[inline]
pub unsafe extern "C-unwind" fn SecAsn1Malloc(
coder: SecAsn1CoderRef,
len: usize,
) -> NonNull<c_void> {
extern "C-unwind" {
fn SecAsn1Malloc(coder: SecAsn1CoderRef, len: usize) -> Option<NonNull<c_void>>;
}
let ret = unsafe { SecAsn1Malloc(coder, len) };
ret.expect("function was marked as returning non-null, but actually returned NULL")
}
extern "C-unwind" {
#[cfg(feature = "SecAsn1Types")]
#[deprecated = "SecAsn1 is not supported"]
pub fn SecAsn1AllocItem(
coder: SecAsn1CoderRef,
item: NonNull<SecAsn1Item>,
len: usize,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "SecAsn1Types")]
#[deprecated = "SecAsn1 is not supported"]
pub fn SecAsn1AllocCopy(
coder: SecAsn1CoderRef,
src: NonNull<c_void>,
len: usize,
dest: NonNull<SecAsn1Item>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "SecAsn1Types")]
#[deprecated = "SecAsn1 is not supported"]
pub fn SecAsn1AllocCopyItem(
coder: SecAsn1CoderRef,
src: NonNull<SecAsn1Item>,
dest: NonNull<SecAsn1Item>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "SecAsn1Types")]
#[deprecated = "SecAsn1 is not supported"]
pub fn SecAsn1OidCompare(oid1: NonNull<SecAsn1Oid>, oid2: NonNull<SecAsn1Oid>) -> bool;
}
extern "C-unwind" {
#[deprecated = "renamed to `SecAsn1Coder::create`"]
pub fn SecAsn1CoderCreate(coder: NonNull<SecAsn1CoderRef>) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "renamed to `SecAsn1Coder::release`"]
pub fn SecAsn1CoderRelease(coder: SecAsn1CoderRef) -> OSStatus;
}