objc2_security/generated/
SecAsn1Coder.rs1use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7#[cfg(feature = "objc2")]
8use objc2::__framework_prelude::*;
9
10use crate::*;
11
12#[repr(C)]
14#[derive(Debug)]
15pub struct SecAsn1Coder {
16 inner: [u8; 0],
17 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
18}
19
20#[cfg(feature = "objc2")]
21unsafe impl RefEncode for SecAsn1Coder {
22 const ENCODING_REF: Encoding = Encoding::Pointer(&Encoding::Struct("SecAsn1Coder", &[]));
23}
24
25#[deprecated = "SecAsn1 is not supported"]
27pub type SecAsn1CoderRef = *mut SecAsn1Coder;
28
29impl SecAsn1Coder {
30 #[doc(alias = "SecAsn1CoderCreate")]
34 #[deprecated = "SecAsn1 is not supported"]
35 #[inline]
36 pub unsafe fn create(coder: NonNull<SecAsn1CoderRef>) -> OSStatus {
37 extern "C-unwind" {
38 fn SecAsn1CoderCreate(coder: NonNull<SecAsn1CoderRef>) -> OSStatus;
39 }
40 unsafe { SecAsn1CoderCreate(coder) }
41 }
42
43 #[doc(alias = "SecAsn1CoderRelease")]
47 #[deprecated = "SecAsn1 is not supported"]
48 #[inline]
49 pub unsafe fn release(coder: SecAsn1CoderRef) -> OSStatus {
50 extern "C-unwind" {
51 fn SecAsn1CoderRelease(coder: SecAsn1CoderRef) -> OSStatus;
52 }
53 unsafe { SecAsn1CoderRelease(coder) }
54 }
55}
56
57extern "C-unwind" {
58 #[cfg(feature = "SecAsn1Types")]
65 #[deprecated = "SecAsn1 is not supported"]
66 pub fn SecAsn1Decode(
67 coder: SecAsn1CoderRef,
68 src: NonNull<c_void>,
69 len: usize,
70 templates: NonNull<SecAsn1Template>,
71 dest: NonNull<c_void>,
72 ) -> OSStatus;
73}
74
75extern "C-unwind" {
76 #[cfg(feature = "SecAsn1Types")]
83 #[deprecated = "SecAsn1 is not supported"]
84 pub fn SecAsn1DecodeData(
85 coder: SecAsn1CoderRef,
86 src: NonNull<SecAsn1Item>,
87 templ: NonNull<SecAsn1Template>,
88 dest: NonNull<c_void>,
89 ) -> OSStatus;
90}
91
92extern "C-unwind" {
93 #[cfg(feature = "SecAsn1Types")]
100 #[deprecated = "SecAsn1 is not supported"]
101 pub fn SecAsn1EncodeItem(
102 coder: SecAsn1CoderRef,
103 src: NonNull<c_void>,
104 templates: NonNull<SecAsn1Template>,
105 dest: NonNull<SecAsn1Item>,
106 ) -> OSStatus;
107}
108
109#[deprecated = "SecAsn1 is not supported"]
113#[inline]
114pub unsafe extern "C-unwind" fn SecAsn1Malloc(
115 coder: SecAsn1CoderRef,
116 len: usize,
117) -> NonNull<c_void> {
118 extern "C-unwind" {
119 fn SecAsn1Malloc(coder: SecAsn1CoderRef, len: usize) -> Option<NonNull<c_void>>;
120 }
121 let ret = unsafe { SecAsn1Malloc(coder, len) };
122 ret.expect("function was marked as returning non-null, but actually returned NULL")
123}
124
125extern "C-unwind" {
126 #[cfg(feature = "SecAsn1Types")]
131 #[deprecated = "SecAsn1 is not supported"]
132 pub fn SecAsn1AllocItem(
133 coder: SecAsn1CoderRef,
134 item: NonNull<SecAsn1Item>,
135 len: usize,
136 ) -> OSStatus;
137}
138
139extern "C-unwind" {
140 #[cfg(feature = "SecAsn1Types")]
146 #[deprecated = "SecAsn1 is not supported"]
147 pub fn SecAsn1AllocCopy(
148 coder: SecAsn1CoderRef,
149 src: NonNull<c_void>,
150 len: usize,
151 dest: NonNull<SecAsn1Item>,
152 ) -> OSStatus;
153}
154
155extern "C-unwind" {
156 #[cfg(feature = "SecAsn1Types")]
162 #[deprecated = "SecAsn1 is not supported"]
163 pub fn SecAsn1AllocCopyItem(
164 coder: SecAsn1CoderRef,
165 src: NonNull<SecAsn1Item>,
166 dest: NonNull<SecAsn1Item>,
167 ) -> OSStatus;
168}
169
170extern "C-unwind" {
171 #[cfg(feature = "SecAsn1Types")]
176 #[deprecated = "SecAsn1 is not supported"]
177 pub fn SecAsn1OidCompare(oid1: NonNull<SecAsn1Oid>, oid2: NonNull<SecAsn1Oid>) -> bool;
178}
179
180extern "C-unwind" {
181 #[deprecated = "renamed to `SecAsn1Coder::create`"]
182 pub fn SecAsn1CoderCreate(coder: NonNull<SecAsn1CoderRef>) -> OSStatus;
183}
184
185extern "C-unwind" {
186 #[deprecated = "renamed to `SecAsn1Coder::release`"]
187 pub fn SecAsn1CoderRelease(coder: SecAsn1CoderRef) -> OSStatus;
188}