objc2_core_services/generated/AE/
AEHelpers.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6#[cfg(feature = "objc2")]
7use objc2::__framework_prelude::*;
8
9use crate::*;
10
11/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuilderrorcode?language=objc)
12pub type AEBuildErrorCode = u32;
13
14/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxnoerr?language=objc)
15pub const aeBuildSyntaxNoErr: c_uint = 0;
16/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxbadtoken?language=objc)
17pub const aeBuildSyntaxBadToken: c_uint = 1;
18/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxbadeof?language=objc)
19pub const aeBuildSyntaxBadEOF: c_uint = 2;
20/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxnoeof?language=objc)
21pub const aeBuildSyntaxNoEOF: c_uint = 3;
22/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxbadnegative?language=objc)
23pub const aeBuildSyntaxBadNegative: c_uint = 4;
24/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxmissingquote?language=objc)
25pub const aeBuildSyntaxMissingQuote: c_uint = 5;
26/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxbadhex?language=objc)
27pub const aeBuildSyntaxBadHex: c_uint = 6;
28/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxoddhex?language=objc)
29pub const aeBuildSyntaxOddHex: c_uint = 7;
30/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxnoclosehex?language=objc)
31pub const aeBuildSyntaxNoCloseHex: c_uint = 8;
32/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxuncoercedhex?language=objc)
33pub const aeBuildSyntaxUncoercedHex: c_uint = 9;
34/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxnoclosestring?language=objc)
35pub const aeBuildSyntaxNoCloseString: c_uint = 10;
36/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxbaddesc?language=objc)
37pub const aeBuildSyntaxBadDesc: c_uint = 11;
38/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxbaddata?language=objc)
39pub const aeBuildSyntaxBadData: c_uint = 12;
40/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxnocloseparen?language=objc)
41pub const aeBuildSyntaxNoCloseParen: c_uint = 13;
42/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxnoclosebracket?language=objc)
43pub const aeBuildSyntaxNoCloseBracket: c_uint = 14;
44/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxnoclosebrace?language=objc)
45pub const aeBuildSyntaxNoCloseBrace: c_uint = 15;
46/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxnokey?language=objc)
47pub const aeBuildSyntaxNoKey: c_uint = 16;
48/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxnocolon?language=objc)
49pub const aeBuildSyntaxNoColon: c_uint = 17;
50/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxcoercedlist?language=objc)
51pub const aeBuildSyntaxCoercedList: c_uint = 18;
52/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuildsyntaxuncoerceddoubleat?language=objc)
53pub const aeBuildSyntaxUncoercedDoubleAt: c_uint = 19;
54
55/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aebuilderror?language=objc)
56#[repr(C, packed(2))]
57#[derive(Clone, Copy, Debug, PartialEq)]
58pub struct AEBuildError {
59    pub fError: AEBuildErrorCode,
60    pub fErrorPos: u32,
61}
62
63#[cfg(feature = "objc2")]
64unsafe impl Encode for AEBuildError {
65    const ENCODING: Encoding = Encoding::Struct(
66        "AEBuildError",
67        &[<AEBuildErrorCode>::ENCODING, <u32>::ENCODING],
68    );
69}
70
71#[cfg(feature = "objc2")]
72unsafe impl RefEncode for AEBuildError {
73    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
74}
75
76extern "C-unwind" {
77    /// # Safety
78    ///
79    /// - `desc` must be a valid pointer.
80    /// - `result` must be a valid pointer.
81    #[cfg(feature = "AEDataModel")]
82    pub fn AEPrintDescToHandle(desc: *const AEDesc, result: *mut Handle) -> OSStatus;
83}
84
85/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/opaqueaestreamref?language=objc)
86#[repr(C)]
87#[derive(Debug)]
88pub struct OpaqueAEStreamRef {
89    inner: [u8; 0],
90    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
91}
92
93#[cfg(feature = "objc2")]
94unsafe impl RefEncode for OpaqueAEStreamRef {
95    const ENCODING_REF: Encoding = Encoding::Pointer(&Encoding::Struct("OpaqueAEStreamRef", &[]));
96}
97
98/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aestreamref?language=objc)
99pub type AEStreamRef = *mut OpaqueAEStreamRef;
100
101extern "C-unwind" {
102    pub fn AEStreamOpen() -> AEStreamRef;
103}
104
105extern "C-unwind" {
106    /// # Safety
107    ///
108    /// - `ref` must be a valid pointer.
109    /// - `desc` must be a valid pointer.
110    #[cfg(feature = "AEDataModel")]
111    pub fn AEStreamClose(r#ref: AEStreamRef, desc: *mut AEDesc) -> OSStatus;
112}
113
114extern "C-unwind" {
115    /// # Safety
116    ///
117    /// `ref` must be a valid pointer.
118    #[cfg(feature = "AEDataModel")]
119    pub fn AEStreamOpenDesc(r#ref: AEStreamRef, new_type: DescType) -> OSStatus;
120}
121
122extern "C-unwind" {
123    /// # Safety
124    ///
125    /// - `ref` must be a valid pointer.
126    /// - `data` must be a valid pointer.
127    pub fn AEStreamWriteData(r#ref: AEStreamRef, data: *const c_void, length: Size) -> OSStatus;
128}
129
130extern "C-unwind" {
131    /// # Safety
132    ///
133    /// `ref` must be a valid pointer.
134    pub fn AEStreamCloseDesc(r#ref: AEStreamRef) -> OSStatus;
135}
136
137extern "C-unwind" {
138    /// # Safety
139    ///
140    /// - `ref` must be a valid pointer.
141    /// - `data` must be a valid pointer.
142    #[cfg(feature = "AEDataModel")]
143    pub fn AEStreamWriteDesc(
144        r#ref: AEStreamRef,
145        new_type: DescType,
146        data: *const c_void,
147        length: Size,
148    ) -> OSStatus;
149}
150
151extern "C-unwind" {
152    /// # Safety
153    ///
154    /// - `ref` must be a valid pointer.
155    /// - `desc` must be a valid pointer.
156    #[cfg(feature = "AEDataModel")]
157    pub fn AEStreamWriteAEDesc(r#ref: AEStreamRef, desc: *const AEDesc) -> OSStatus;
158}
159
160extern "C-unwind" {
161    /// # Safety
162    ///
163    /// `ref` must be a valid pointer.
164    pub fn AEStreamOpenList(r#ref: AEStreamRef) -> OSStatus;
165}
166
167extern "C-unwind" {
168    /// # Safety
169    ///
170    /// `ref` must be a valid pointer.
171    pub fn AEStreamCloseList(r#ref: AEStreamRef) -> OSStatus;
172}
173
174extern "C-unwind" {
175    /// # Safety
176    ///
177    /// `ref` must be a valid pointer.
178    #[cfg(feature = "AEDataModel")]
179    pub fn AEStreamOpenRecord(r#ref: AEStreamRef, new_type: DescType) -> OSStatus;
180}
181
182extern "C-unwind" {
183    /// # Safety
184    ///
185    /// `ref` must be a valid pointer.
186    #[cfg(feature = "AEDataModel")]
187    pub fn AEStreamSetRecordType(r#ref: AEStreamRef, new_type: DescType) -> OSStatus;
188}
189
190extern "C-unwind" {
191    /// # Safety
192    ///
193    /// `ref` must be a valid pointer.
194    pub fn AEStreamCloseRecord(r#ref: AEStreamRef) -> OSStatus;
195}
196
197extern "C-unwind" {
198    /// # Safety
199    ///
200    /// - `ref` must be a valid pointer.
201    /// - `data` must be a valid pointer.
202    #[cfg(feature = "AEDataModel")]
203    pub fn AEStreamWriteKeyDesc(
204        r#ref: AEStreamRef,
205        key: AEKeyword,
206        new_type: DescType,
207        data: *const c_void,
208        length: Size,
209    ) -> OSStatus;
210}
211
212extern "C-unwind" {
213    /// # Safety
214    ///
215    /// `ref` must be a valid pointer.
216    #[cfg(feature = "AEDataModel")]
217    pub fn AEStreamOpenKeyDesc(r#ref: AEStreamRef, key: AEKeyword, new_type: DescType) -> OSStatus;
218}
219
220extern "C-unwind" {
221    /// # Safety
222    ///
223    /// `ref` must be a valid pointer.
224    #[cfg(feature = "AEDataModel")]
225    pub fn AEStreamWriteKey(r#ref: AEStreamRef, key: AEKeyword) -> OSStatus;
226}
227
228extern "C-unwind" {
229    /// # Safety
230    ///
231    /// `target_data` must be a valid pointer.
232    #[cfg(feature = "AEDataModel")]
233    pub fn AEStreamCreateEvent(
234        clazz: AEEventClass,
235        id: AEEventID,
236        target_type: DescType,
237        target_data: *const c_void,
238        target_length: Size,
239        return_id: i16,
240        transaction_id: i32,
241    ) -> AEStreamRef;
242}
243
244extern "C-unwind" {
245    /// # Safety
246    ///
247    /// `event` must be a valid pointer.
248    #[cfg(feature = "AEDataModel")]
249    pub fn AEStreamOpenEvent(event: *mut AppleEvent) -> AEStreamRef;
250}
251
252extern "C-unwind" {
253    /// # Safety
254    ///
255    /// `ref` must be a valid pointer.
256    #[cfg(feature = "AEDataModel")]
257    pub fn AEStreamOptionalParam(r#ref: AEStreamRef, key: AEKeyword) -> OSStatus;
258}