objc2_core_services/generated/AE/
AEDataModel.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/desctype?language=objc)
12pub type DescType = ResType;
13
14/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aekeyword?language=objc)
15pub type AEKeyword = FourCharCode;
16
17/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeboolean?language=objc)
18pub const typeBoolean: DescType = 0x626f6f6c;
19/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typechar?language=objc)
20pub const typeChar: DescType = 0x54455854;
21
22/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typestyledunicodetext?language=objc)
23pub const typeStyledUnicodeText: DescType = 0x73757478;
24/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeencodedstring?language=objc)
25pub const typeEncodedString: DescType = 0x656e6373;
26/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeunicodetext?language=objc)
27pub const typeUnicodeText: DescType = 0x75747874;
28/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typecstring?language=objc)
29pub const typeCString: DescType = 0x63737472;
30/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typepstring?language=objc)
31pub const typePString: DescType = 0x70737472;
32
33/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeutf16externalrepresentation?language=objc)
34pub const typeUTF16ExternalRepresentation: DescType = 0x75743136;
35/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeutf8text?language=objc)
36pub const typeUTF8Text: DescType = 0x75746638;
37
38/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typesint16?language=objc)
39pub const typeSInt16: DescType = 0x73686f72;
40/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeuint16?language=objc)
41pub const typeUInt16: DescType = 0x75736872;
42/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typesint32?language=objc)
43pub const typeSInt32: DescType = 0x6c6f6e67;
44/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeuint32?language=objc)
45pub const typeUInt32: DescType = 0x6d61676e;
46/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typesint64?language=objc)
47pub const typeSInt64: DescType = 0x636f6d70;
48/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeuint64?language=objc)
49pub const typeUInt64: DescType = 0x75636f6d;
50/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeieee32bitfloatingpoint?language=objc)
51pub const typeIEEE32BitFloatingPoint: DescType = 0x73696e67;
52/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeieee64bitfloatingpoint?language=objc)
53pub const typeIEEE64BitFloatingPoint: DescType = 0x646f7562;
54/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/type128bitfloatingpoint?language=objc)
55pub const type128BitFloatingPoint: DescType = 0x6c64626c;
56/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typedecimalstruct?language=objc)
57pub const typeDecimalStruct: DescType = 0x6465636d;
58
59/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeaelist?language=objc)
60pub const typeAEList: DescType = 0x6c697374;
61/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeaerecord?language=objc)
62pub const typeAERecord: DescType = 0x7265636f;
63/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeappleevent?language=objc)
64pub const typeAppleEvent: DescType = 0x61657674;
65/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeeventrecord?language=objc)
66pub const typeEventRecord: DescType = 0x65767263;
67/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typetrue?language=objc)
68pub const typeTrue: DescType = 0x74727565;
69/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typefalse?language=objc)
70pub const typeFalse: DescType = 0x66616c73;
71/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typealias?language=objc)
72pub const typeAlias: DescType = 0x616c6973;
73/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeenumerated?language=objc)
74pub const typeEnumerated: DescType = 0x656e756d;
75/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typetype?language=objc)
76pub const typeType: DescType = 0x74797065;
77/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeappparameters?language=objc)
78pub const typeAppParameters: DescType = 0x61707061;
79/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeproperty?language=objc)
80pub const typeProperty: DescType = 0x70726f70;
81/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typefsref?language=objc)
82pub const typeFSRef: DescType = 0x66737266;
83/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typefileurl?language=objc)
84pub const typeFileURL: DescType = 0x6675726c;
85/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typebookmarkdata?language=objc)
86pub const typeBookmarkData: DescType = 0x626d726b;
87/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typekeyword?language=objc)
88pub const typeKeyword: DescType = 0x6b657977;
89/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typesectionh?language=objc)
90pub const typeSectionH: DescType = 0x73656374;
91/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typewildcard?language=objc)
92pub const typeWildCard: DescType = 0x2a2a2a2a;
93/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeapplsignature?language=objc)
94pub const typeApplSignature: DescType = 0x7369676e;
95/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeqdrectangle?language=objc)
96pub const typeQDRectangle: DescType = 0x71647274;
97/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typefixed?language=objc)
98pub const typeFixed: DescType = 0x66697864;
99/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeprocessserialnumber?language=objc)
100pub const typeProcessSerialNumber: DescType = 0x70736e20;
101/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeapplicationurl?language=objc)
102pub const typeApplicationURL: DescType = 0x6170726c;
103/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typenull?language=objc)
104pub const typeNull: DescType = 0x6e756c6c;
105
106/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typecfattributedstringref?language=objc)
107pub const typeCFAttributedStringRef: DescType = 0x63666173;
108/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typecfmutableattributedstringref?language=objc)
109pub const typeCFMutableAttributedStringRef: DescType = 0x63666161;
110/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typecfstringref?language=objc)
111pub const typeCFStringRef: DescType = 0x63667374;
112/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typecfmutablestringref?language=objc)
113pub const typeCFMutableStringRef: DescType = 0x63666d73;
114/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typecfarrayref?language=objc)
115pub const typeCFArrayRef: DescType = 0x63666172;
116/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typecfmutablearrayref?language=objc)
117pub const typeCFMutableArrayRef: DescType = 0x63666d61;
118/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typecfdictionaryref?language=objc)
119pub const typeCFDictionaryRef: DescType = 0x63666463;
120/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typecfmutabledictionaryref?language=objc)
121pub const typeCFMutableDictionaryRef: DescType = 0x63666d64;
122/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typecfnumberref?language=objc)
123pub const typeCFNumberRef: DescType = 0x63666e62;
124/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typecfbooleanref?language=objc)
125pub const typeCFBooleanRef: DescType = 0x63667466;
126/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typecftyperef?language=objc)
127pub const typeCFTypeRef: DescType = 0x63667479;
128
129/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typekernelprocessid?language=objc)
130pub const typeKernelProcessID: DescType = 0x6b706964;
131/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typemachport?language=objc)
132pub const typeMachPort: DescType = 0x706f7274;
133
134/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeaudittoken?language=objc)
135pub const typeAuditToken: DescType = 0x746f6b6e;
136
137/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/typeapplicationbundleid?language=objc)
138pub const typeApplicationBundleID: DescType = 0x62756e64;
139
140/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keytransactionidattr?language=objc)
141pub const keyTransactionIDAttr: AEKeyword = 0x7472616e;
142/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyreturnidattr?language=objc)
143pub const keyReturnIDAttr: AEKeyword = 0x72746964;
144/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyeventclassattr?language=objc)
145pub const keyEventClassAttr: AEKeyword = 0x6576636c;
146/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyeventidattr?language=objc)
147pub const keyEventIDAttr: AEKeyword = 0x65766964;
148/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyaddressattr?language=objc)
149pub const keyAddressAttr: AEKeyword = 0x61646472;
150/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyoptionalkeywordattr?language=objc)
151pub const keyOptionalKeywordAttr: AEKeyword = 0x6f70746b;
152/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keytimeoutattr?language=objc)
153pub const keyTimeoutAttr: AEKeyword = 0x74696d6f;
154/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyinteractlevelattr?language=objc)
155pub const keyInteractLevelAttr: AEKeyword = 0x696e7465;
156/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyeventsourceattr?language=objc)
157pub const keyEventSourceAttr: AEKeyword = 0x65737263;
158/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keymissedkeywordattr?language=objc)
159pub const keyMissedKeywordAttr: AEKeyword = 0x6d697373;
160/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyoriginaladdressattr?language=objc)
161pub const keyOriginalAddressAttr: AEKeyword = 0x66726f6d;
162/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyaccepttimeoutattr?language=objc)
163pub const keyAcceptTimeoutAttr: AEKeyword = 0x6163746d;
164/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyreplyrequestedattr?language=objc)
165pub const keyReplyRequestedAttr: AEKeyword = 0x72657071;
166/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysendereuidattr?language=objc)
167pub const keySenderEUIDAttr: AEKeyword = 0x73656964;
168/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysenderegidattr?language=objc)
169pub const keySenderEGIDAttr: AEKeyword = 0x73676964;
170/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysenderuidattr?language=objc)
171pub const keySenderUIDAttr: AEKeyword = 0x75696473;
172/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysendergidattr?language=objc)
173pub const keySenderGIDAttr: AEKeyword = 0x67696473;
174/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysenderpidattr?language=objc)
175pub const keySenderPIDAttr: AEKeyword = 0x73706964;
176/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysenderaudittokenattr?language=objc)
177pub const keySenderAuditTokenAttr: AEKeyword = 0x746f6b6e;
178/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysenderapplescriptentitlementsattr?language=objc)
179pub const keySenderApplescriptEntitlementsAttr: AEKeyword = 0x656e746c;
180/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysenderapplicationidentifierentitlementattr?language=objc)
181pub const keySenderApplicationIdentifierEntitlementAttr: AEKeyword = 0x61696561;
182/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysenderapplicationsandboxed?language=objc)
183pub const keySenderApplicationSandboxed: AEKeyword = 0x73737362;
184/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyactualsenderaudittoken?language=objc)
185pub const keyActualSenderAuditToken: AEKeyword = 0x61636174;
186
187/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedebugpostheader?language=objc)
188pub const kAEDebugPOSTHeader: c_int = 1 << 0;
189/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedebugreplyheader?language=objc)
190pub const kAEDebugReplyHeader: c_int = 1 << 1;
191/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedebugxmlrequest?language=objc)
192pub const kAEDebugXMLRequest: c_int = 1 << 2;
193/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedebugxmlresponse?language=objc)
194pub const kAEDebugXMLResponse: c_int = 1 << 3;
195/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedebugxmldebugall?language=objc)
196pub const kAEDebugXMLDebugAll: c_int = -1;
197
198/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/ksoap1999schema?language=objc)
199pub const kSOAP1999Schema: c_uint = 0x73733939;
200/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/ksoap2001schema?language=objc)
201pub const kSOAP2001Schema: c_uint = 0x73733031;
202
203/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyusernameattr?language=objc)
204pub const keyUserNameAttr: AEKeyword = 0x756e616d;
205/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyuserpasswordattr?language=objc)
206pub const keyUserPasswordAttr: AEKeyword = 0x70617373;
207/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keydisableauthenticationattr?language=objc)
208pub const keyDisableAuthenticationAttr: AEKeyword = 0x61757468;
209/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyxmldebuggingattr?language=objc)
210pub const keyXMLDebuggingAttr: AEKeyword = 0x78646267;
211/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaerpcclass?language=objc)
212pub const kAERPCClass: AEKeyword = 0x72706320;
213/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaexmlrpcscheme?language=objc)
214pub const kAEXMLRPCScheme: AEKeyword = 0x52504332;
215/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaesoapscheme?language=objc)
216pub const kAESOAPScheme: AEKeyword = 0x534f4150;
217/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaesharedscripthandler?language=objc)
218pub const kAESharedScriptHandler: AEKeyword = 0x77736370;
219/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyrpcmethodname?language=objc)
220pub const keyRPCMethodName: AEKeyword = 0x6d657468;
221/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyrpcmethodparam?language=objc)
222pub const keyRPCMethodParam: AEKeyword = 0x7061726d;
223/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyrpcmethodparamorder?language=objc)
224pub const keyRPCMethodParamOrder: AEKeyword = 0x2f6f7264;
225/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyaepostheaderdata?language=objc)
226pub const keyAEPOSTHeaderData: AEKeyword = 0x70686564;
227/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyaereplyheaderdata?language=objc)
228pub const keyAEReplyHeaderData: AEKeyword = 0x72686564;
229/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyaexmlrequestdata?language=objc)
230pub const keyAEXMLRequestData: AEKeyword = 0x78726571;
231/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyaexmlreplydata?language=objc)
232pub const keyAEXMLReplyData: AEKeyword = 0x78726570;
233/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyadditionalhttpheaders?language=objc)
234pub const keyAdditionalHTTPHeaders: AEKeyword = 0x61686564;
235/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysoapaction?language=objc)
236pub const keySOAPAction: AEKeyword = 0x73616374;
237/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysoapmethodnamespace?language=objc)
238pub const keySOAPMethodNameSpace: AEKeyword = 0x6d737063;
239/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysoapmethodnamespaceuri?language=objc)
240pub const keySOAPMethodNameSpaceURI: AEKeyword = 0x6d737075;
241/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysoapschemaversion?language=objc)
242pub const keySOAPSchemaVersion: AEKeyword = 0x73736368;
243
244/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysoapstructuremetadata?language=objc)
245pub const keySOAPStructureMetaData: AEKeyword = 0x2f736d64;
246/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysoapsmdnamespace?language=objc)
247pub const keySOAPSMDNamespace: AEKeyword = 0x73736e73;
248/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysoapsmdnamespaceuri?language=objc)
249pub const keySOAPSMDNamespaceURI: AEKeyword = 0x73736e75;
250/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keysoapsmdtype?language=objc)
251pub const keySOAPSMDType: AEKeyword = 0x73737470;
252
253/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeusehttpproxyattr?language=objc)
254pub const kAEUseHTTPProxyAttr: c_uint = 0x78757072;
255/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaehttpproxyportattr?language=objc)
256pub const kAEHTTPProxyPortAttr: c_uint = 0x78687470;
257/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaehttpproxyhostattr?language=objc)
258pub const kAEHTTPProxyHostAttr: c_uint = 0x78687468;
259
260/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaesocks4protocol?language=objc)
261pub const kAESocks4Protocol: c_uint = 4;
262/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaesocks5protocol?language=objc)
263pub const kAESocks5Protocol: c_uint = 5;
264
265/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeusesocksattr?language=objc)
266pub const kAEUseSocksAttr: c_uint = 0x78736373;
267/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaesocksproxyattr?language=objc)
268pub const kAESocksProxyAttr: c_uint = 0x78736f6b;
269/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaesockshostattr?language=objc)
270pub const kAESocksHostAttr: c_uint = 0x78736873;
271/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaesocksportattr?language=objc)
272pub const kAESocksPortAttr: c_uint = 0x78736870;
273/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaesocksuserattr?language=objc)
274pub const kAESocksUserAttr: c_uint = 0x78736875;
275/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaesockspasswordattr?language=objc)
276pub const kAESocksPasswordAttr: c_uint = 0x78736877;
277
278/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedesclistfactornone?language=objc)
279pub const kAEDescListFactorNone: c_uint = 0;
280/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedesclistfactortype?language=objc)
281pub const kAEDescListFactorType: c_uint = 4;
282/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedesclistfactortypeandsize?language=objc)
283pub const kAEDescListFactorTypeAndSize: c_uint = 8;
284
285/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kautogeneratereturnid?language=objc)
286pub const kAutoGenerateReturnID: c_int = -1;
287/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kanytransactionid?language=objc)
288pub const kAnyTransactionID: c_int = 0;
289
290/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/opaqueaedatastoragetype?language=objc)
291#[repr(C)]
292#[derive(Debug)]
293pub struct OpaqueAEDataStorageType {
294    inner: [u8; 0],
295    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
296}
297
298#[cfg(feature = "objc2")]
299unsafe impl RefEncode for OpaqueAEDataStorageType {
300    const ENCODING_REF: Encoding =
301        Encoding::Pointer(&Encoding::Struct("OpaqueAEDataStorageType", &[]));
302}
303
304/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aedatastoragetype?language=objc)
305pub type AEDataStorageType = *mut OpaqueAEDataStorageType;
306
307/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aedatastorage?language=objc)
308pub type AEDataStorage = *mut AEDataStorageType;
309
310/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aedesc?language=objc)
311#[repr(C, packed(2))]
312#[derive(Clone, Copy, Debug, PartialEq)]
313pub struct AEDesc {
314    pub descriptorType: DescType,
315    pub dataHandle: AEDataStorage,
316}
317
318#[cfg(feature = "objc2")]
319unsafe impl Encode for AEDesc {
320    const ENCODING: Encoding =
321        Encoding::Struct("AEDesc", &[<DescType>::ENCODING, <AEDataStorage>::ENCODING]);
322}
323
324#[cfg(feature = "objc2")]
325unsafe impl RefEncode for AEDesc {
326    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
327}
328
329/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aedescptr?language=objc)
330pub type AEDescPtr = *mut AEDesc;
331
332/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aekeydesc?language=objc)
333#[repr(C, packed(2))]
334#[derive(Clone, Copy, Debug, PartialEq)]
335pub struct AEKeyDesc {
336    pub descKey: AEKeyword,
337    pub descContent: AEDesc,
338}
339
340#[cfg(feature = "objc2")]
341unsafe impl Encode for AEKeyDesc {
342    const ENCODING: Encoding =
343        Encoding::Struct("AEKeyDesc", &[<AEKeyword>::ENCODING, <AEDesc>::ENCODING]);
344}
345
346#[cfg(feature = "objc2")]
347unsafe impl RefEncode for AEKeyDesc {
348    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
349}
350
351/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aedesclist?language=objc)
352pub type AEDescList = AEDesc;
353
354/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aerecord?language=objc)
355pub type AERecord = AEDescList;
356
357/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aeaddressdesc?language=objc)
358pub type AEAddressDesc = AEDesc;
359
360/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/appleevent?language=objc)
361pub type AppleEvent = AERecord;
362
363/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/appleeventptr?language=objc)
364pub type AppleEventPtr = *mut AppleEvent;
365
366/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aereturnid?language=objc)
367pub type AEReturnID = i16;
368
369/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aetransactionid?language=objc)
370pub type AETransactionID = i32;
371
372/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aeeventclass?language=objc)
373pub type AEEventClass = FourCharCode;
374
375/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aeeventid?language=objc)
376pub type AEEventID = FourCharCode;
377
378/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aearraytype?language=objc)
379pub type AEArrayType = i8;
380
381/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedataarray?language=objc)
382pub const kAEDataArray: c_uint = 0;
383/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaepackedarray?language=objc)
384pub const kAEPackedArray: c_uint = 1;
385/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedescarray?language=objc)
386pub const kAEDescArray: c_uint = 3;
387/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaekeydescarray?language=objc)
388pub const kAEKeyDescArray: c_uint = 4;
389
390/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaehandlearray?language=objc)
391pub const kAEHandleArray: c_uint = 2;
392
393/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aearraydata?language=objc)
394#[repr(C, packed(2))]
395#[derive(Clone, Copy)]
396pub union AEArrayData {
397    pub kAEDataArray: [i16; 1],
398    pub kAEPackedArray: [c_char; 1],
399    pub kAEHandleArray: [Handle; 1],
400    pub kAEDescArray: [AEDesc; 1],
401    pub kAEKeyDescArray: [AEKeyDesc; 1],
402}
403
404#[cfg(feature = "objc2")]
405unsafe impl Encode for AEArrayData {
406    const ENCODING: Encoding = Encoding::Union(
407        "AEArrayData",
408        &[
409            <[i16; 1]>::ENCODING,
410            <[c_char; 1]>::ENCODING,
411            <[Handle; 1]>::ENCODING,
412            <[AEDesc; 1]>::ENCODING,
413            <[AEKeyDesc; 1]>::ENCODING,
414        ],
415    );
416}
417
418#[cfg(feature = "objc2")]
419unsafe impl RefEncode for AEArrayData {
420    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
421}
422
423/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aearraydatapointer?language=objc)
424pub type AEArrayDataPointer = *mut AEArrayData;
425
426/// ************************************************************************
427/// These constants are used by AEMach and AEInteraction APIs.  They are not
428/// strictly part of the data format, but are declared here due to layering.
429/// ************************************************************************
430///
431/// See also [Apple's documentation](https://developer.apple.com/documentation/coreservices/aesendpriority?language=objc)
432pub type AESendPriority = i16;
433
434/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaenormalpriority?language=objc)
435pub const kAENormalPriority: c_uint = 0x00000000;
436/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaehighpriority?language=objc)
437pub const kAEHighPriority: c_uint = 0x00000001;
438
439/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aesendmode?language=objc)
440pub type AESendMode = i32;
441
442/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaenoreply?language=objc)
443pub const kAENoReply: c_uint = 0x00000001;
444/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaequeuereply?language=objc)
445pub const kAEQueueReply: c_uint = 0x00000002;
446/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaewaitreply?language=objc)
447pub const kAEWaitReply: c_uint = 0x00000003;
448/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedontreconnect?language=objc)
449pub const kAEDontReconnect: c_uint = 0x00000080;
450/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaewantreceipt?language=objc)
451pub const kAEWantReceipt: c_uint = 0x00000200;
452/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeneverinteract?language=objc)
453pub const kAENeverInteract: c_uint = 0x00000010;
454/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaecaninteract?language=objc)
455pub const kAECanInteract: c_uint = 0x00000020;
456/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaealwaysinteract?language=objc)
457pub const kAEAlwaysInteract: c_uint = 0x00000030;
458/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaecanswitchlayer?language=objc)
459pub const kAECanSwitchLayer: c_uint = 0x00000040;
460/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedontrecord?language=objc)
461pub const kAEDontRecord: c_uint = 0x00001000;
462/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedontexecute?language=objc)
463pub const kAEDontExecute: c_uint = 0x00002000;
464/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeprocessnonreplyevents?language=objc)
465pub const kAEProcessNonReplyEvents: c_uint = 0x00008000;
466/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedonotautomaticallyaddannotationstoevent?language=objc)
467pub const kAEDoNotAutomaticallyAddAnnotationsToEvent: c_uint = 0x00010000;
468
469/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedefaulttimeout?language=objc)
470pub const kAEDefaultTimeout: c_int = -1;
471/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/knotimeout?language=objc)
472pub const kNoTimeOut: c_int = -2;
473
474/// ************************************************************************
475/// These calls are used to set up and modify the coercion dispatch table.
476/// ************************************************************************
477///
478/// See also [Apple's documentation](https://developer.apple.com/documentation/coreservices/aecoercedescprocptr?language=objc)
479pub type AECoerceDescProcPtr =
480    Option<unsafe extern "C-unwind" fn(*const AEDesc, DescType, SRefCon, *mut AEDesc) -> OSErr>;
481
482/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aecoerceptrprocptr?language=objc)
483pub type AECoercePtrProcPtr = Option<
484    unsafe extern "C-unwind" fn(
485        DescType,
486        *const c_void,
487        Size,
488        DescType,
489        SRefCon,
490        *mut AEDesc,
491    ) -> OSErr,
492>;
493
494/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aecoercedescupp?language=objc)
495pub type AECoerceDescUPP = AECoerceDescProcPtr;
496
497/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aecoerceptrupp?language=objc)
498pub type AECoercePtrUPP = AECoercePtrProcPtr;
499
500extern "C-unwind" {
501    /// # Safety
502    ///
503    /// `user_routine` must be implemented correctly.
504    pub fn NewAECoerceDescUPP(user_routine: AECoerceDescProcPtr) -> AECoerceDescUPP;
505}
506
507extern "C-unwind" {
508    /// # Safety
509    ///
510    /// `user_routine` must be implemented correctly.
511    pub fn NewAECoercePtrUPP(user_routine: AECoercePtrProcPtr) -> AECoercePtrUPP;
512}
513
514extern "C-unwind" {
515    /// # Safety
516    ///
517    /// `user_upp` must be implemented correctly.
518    pub fn DisposeAECoerceDescUPP(user_upp: AECoerceDescUPP);
519}
520
521extern "C-unwind" {
522    /// # Safety
523    ///
524    /// `user_upp` must be implemented correctly.
525    pub fn DisposeAECoercePtrUPP(user_upp: AECoercePtrUPP);
526}
527
528extern "C-unwind" {
529    /// # Safety
530    ///
531    /// - `from_desc` must be a valid pointer.
532    /// - `handler_refcon` must be a valid pointer.
533    /// - `to_desc` must be a valid pointer.
534    /// - `user_upp` must be implemented correctly.
535    pub fn InvokeAECoerceDescUPP(
536        from_desc: *const AEDesc,
537        to_type: DescType,
538        handler_refcon: SRefCon,
539        to_desc: *mut AEDesc,
540        user_upp: AECoerceDescUPP,
541    ) -> OSErr;
542}
543
544extern "C-unwind" {
545    /// # Safety
546    ///
547    /// - `data_ptr` must be a valid pointer.
548    /// - `handler_refcon` must be a valid pointer.
549    /// - `result` must be a valid pointer.
550    /// - `user_upp` must be implemented correctly.
551    pub fn InvokeAECoercePtrUPP(
552        type_code: DescType,
553        data_ptr: *const c_void,
554        data_size: Size,
555        to_type: DescType,
556        handler_refcon: SRefCon,
557        result: *mut AEDesc,
558        user_upp: AECoercePtrUPP,
559    ) -> OSErr;
560}
561
562/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aecoercionhandlerupp?language=objc)
563pub type AECoercionHandlerUPP = AECoerceDescUPP;
564
565/// # Safety
566///
567/// - `handler` must be implemented correctly.
568/// - `handler_refcon` must be a valid pointer.
569#[inline]
570pub unsafe extern "C-unwind" fn AEInstallCoercionHandler(
571    from_type: DescType,
572    to_type: DescType,
573    handler: AECoercionHandlerUPP,
574    handler_refcon: SRefCon,
575    from_type_is_desc: bool,
576    is_sys_handler: bool,
577) -> OSErr {
578    extern "C-unwind" {
579        fn AEInstallCoercionHandler(
580            from_type: DescType,
581            to_type: DescType,
582            handler: AECoercionHandlerUPP,
583            handler_refcon: SRefCon,
584            from_type_is_desc: Boolean,
585            is_sys_handler: Boolean,
586        ) -> OSErr;
587    }
588    unsafe {
589        AEInstallCoercionHandler(
590            from_type,
591            to_type,
592            handler,
593            handler_refcon,
594            from_type_is_desc as _,
595            is_sys_handler as _,
596        )
597    }
598}
599
600/// # Safety
601///
602/// `handler` must be implemented correctly.
603#[inline]
604pub unsafe extern "C-unwind" fn AERemoveCoercionHandler(
605    from_type: DescType,
606    to_type: DescType,
607    handler: AECoercionHandlerUPP,
608    is_sys_handler: bool,
609) -> OSErr {
610    extern "C-unwind" {
611        fn AERemoveCoercionHandler(
612            from_type: DescType,
613            to_type: DescType,
614            handler: AECoercionHandlerUPP,
615            is_sys_handler: Boolean,
616        ) -> OSErr;
617    }
618    unsafe { AERemoveCoercionHandler(from_type, to_type, handler, is_sys_handler as _) }
619}
620
621/// # Safety
622///
623/// - `handler` must be a valid pointer.
624/// - `handler_refcon` must be a valid pointer.
625/// - `from_type_is_desc` must be a valid pointer.
626#[inline]
627pub unsafe extern "C-unwind" fn AEGetCoercionHandler(
628    from_type: DescType,
629    to_type: DescType,
630    handler: *mut AECoercionHandlerUPP,
631    handler_refcon: *mut SRefCon,
632    from_type_is_desc: *mut Boolean,
633    is_sys_handler: bool,
634) -> OSErr {
635    extern "C-unwind" {
636        fn AEGetCoercionHandler(
637            from_type: DescType,
638            to_type: DescType,
639            handler: *mut AECoercionHandlerUPP,
640            handler_refcon: *mut SRefCon,
641            from_type_is_desc: *mut Boolean,
642            is_sys_handler: Boolean,
643        ) -> OSErr;
644    }
645    unsafe {
646        AEGetCoercionHandler(
647            from_type,
648            to_type,
649            handler,
650            handler_refcon,
651            from_type_is_desc,
652            is_sys_handler as _,
653        )
654    }
655}
656
657extern "C-unwind" {
658    /// ************************************************************************
659    /// The following calls provide for a coercion interface.
660    /// ************************************************************************
661    ///
662    /// # Safety
663    ///
664    /// - `data_ptr` must be a valid pointer.
665    /// - `result` must be a valid pointer.
666    pub fn AECoercePtr(
667        type_code: DescType,
668        data_ptr: *const c_void,
669        data_size: Size,
670        to_type: DescType,
671        result: *mut AEDesc,
672    ) -> OSErr;
673}
674
675extern "C-unwind" {
676    /// # Safety
677    ///
678    /// - `the_ae_desc` must be a valid pointer.
679    /// - `result` must be a valid pointer.
680    pub fn AECoerceDesc(
681        the_ae_desc: *const AEDesc,
682        to_type: DescType,
683        result: *mut AEDesc,
684    ) -> OSErr;
685}
686
687extern "C-unwind" {
688    /// ************************************************************************
689    /// The following calls apply to any AEDesc. Every 'result' descriptor is
690    /// created for you, so you will be responsible for memory management
691    /// (including disposing) of the descriptors so created.
692    /// ************************************************************************
693    ///
694    /// # Safety
695    ///
696    /// `desc` must be a valid pointer.
697    pub fn AEInitializeDesc(desc: *mut AEDesc);
698}
699
700extern "C-unwind" {
701    /// # Safety
702    ///
703    /// - `data_ptr` must be a valid pointer.
704    /// - `result` must be a valid pointer.
705    pub fn AECreateDesc(
706        type_code: DescType,
707        data_ptr: *const c_void,
708        data_size: Size,
709        result: *mut AEDesc,
710    ) -> OSErr;
711}
712
713extern "C-unwind" {
714    /// # Safety
715    ///
716    /// `the_ae_desc` must be a valid pointer.
717    pub fn AEDisposeDesc(the_ae_desc: *mut AEDesc) -> OSErr;
718}
719
720extern "C-unwind" {
721    /// # Safety
722    ///
723    /// - `the_ae_desc` must be a valid pointer.
724    /// - `result` must be a valid pointer.
725    pub fn AEDuplicateDesc(the_ae_desc: *const AEDesc, result: *mut AEDesc) -> OSErr;
726}
727
728/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aedisposeexternalprocptr?language=objc)
729pub type AEDisposeExternalProcPtr =
730    Option<unsafe extern "C-unwind" fn(*const c_void, Size, SRefCon)>;
731
732/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aedisposeexternalupp?language=objc)
733pub type AEDisposeExternalUPP = AEDisposeExternalProcPtr;
734
735extern "C-unwind" {
736    /// # Safety
737    ///
738    /// - `data_ptr` must be a valid pointer.
739    /// - `dispose_callback` must be implemented correctly.
740    /// - `dispose_refcon` must be a valid pointer.
741    /// - `the_desc` must be a valid pointer.
742    pub fn AECreateDescFromExternalPtr(
743        descriptor_type: OSType,
744        data_ptr: *const c_void,
745        data_length: Size,
746        dispose_callback: AEDisposeExternalUPP,
747        dispose_refcon: SRefCon,
748        the_desc: *mut AEDesc,
749    ) -> OSStatus;
750}
751
752extern "C-unwind" {
753    /// # Safety
754    ///
755    /// - `desc1` must be a valid pointer.
756    /// - `desc2` must be a valid pointer.
757    /// - `result_p` must be a valid pointer.
758    pub fn AECompareDesc(
759        desc1: *const AEDesc,
760        desc2: *const AEDesc,
761        result_p: *mut Boolean,
762    ) -> OSStatus;
763}
764
765/// ************************************************************************
766/// The following calls apply to AEDescList. Since AEDescList is a subtype of
767/// AEDesc, the calls in the previous section can also be used for AEDescList.
768/// All list and array indices are 1-based. If the data was greater than
769/// maximumSize in the routines below, then actualSize will be greater than
770/// maximumSize, but only maximumSize bytes will actually be retrieved.
771/// ************************************************************************
772///
773/// # Safety
774///
775/// - `factoring_ptr` must be a valid pointer.
776/// - `result_list` must be a valid pointer.
777#[inline]
778pub unsafe extern "C-unwind" fn AECreateList(
779    factoring_ptr: *const c_void,
780    factored_size: Size,
781    is_record: bool,
782    result_list: *mut AEDescList,
783) -> OSErr {
784    extern "C-unwind" {
785        fn AECreateList(
786            factoring_ptr: *const c_void,
787            factored_size: Size,
788            is_record: Boolean,
789            result_list: *mut AEDescList,
790        ) -> OSErr;
791    }
792    unsafe { AECreateList(factoring_ptr, factored_size, is_record as _, result_list) }
793}
794
795extern "C-unwind" {
796    /// # Safety
797    ///
798    /// - `the_ae_desc_list` must be a valid pointer.
799    /// - `the_count` must be a valid pointer.
800    pub fn AECountItems(the_ae_desc_list: *const AEDescList, the_count: *mut c_long) -> OSErr;
801}
802
803extern "C-unwind" {
804    /// # Safety
805    ///
806    /// - `the_ae_desc_list` must be a valid pointer.
807    /// - `data_ptr` must be a valid pointer.
808    pub fn AEPutPtr(
809        the_ae_desc_list: *mut AEDescList,
810        index: c_long,
811        type_code: DescType,
812        data_ptr: *const c_void,
813        data_size: Size,
814    ) -> OSErr;
815}
816
817extern "C-unwind" {
818    /// # Safety
819    ///
820    /// - `the_ae_desc_list` must be a valid pointer.
821    /// - `the_ae_desc` must be a valid pointer.
822    pub fn AEPutDesc(
823        the_ae_desc_list: *mut AEDescList,
824        index: c_long,
825        the_ae_desc: *const AEDesc,
826    ) -> OSErr;
827}
828
829extern "C-unwind" {
830    /// # Safety
831    ///
832    /// - `the_ae_desc_list` must be a valid pointer.
833    /// - `the_ae_keyword` must be a valid pointer.
834    /// - `type_code` must be a valid pointer.
835    /// - `data_ptr` must be a valid pointer.
836    /// - `actual_size` must be a valid pointer.
837    pub fn AEGetNthPtr(
838        the_ae_desc_list: *const AEDescList,
839        index: c_long,
840        desired_type: DescType,
841        the_ae_keyword: *mut AEKeyword,
842        type_code: *mut DescType,
843        data_ptr: *mut c_void,
844        maximum_size: Size,
845        actual_size: *mut Size,
846    ) -> OSErr;
847}
848
849extern "C-unwind" {
850    /// # Safety
851    ///
852    /// - `the_ae_desc_list` must be a valid pointer.
853    /// - `the_ae_keyword` must be a valid pointer.
854    /// - `result` must be a valid pointer.
855    pub fn AEGetNthDesc(
856        the_ae_desc_list: *const AEDescList,
857        index: c_long,
858        desired_type: DescType,
859        the_ae_keyword: *mut AEKeyword,
860        result: *mut AEDesc,
861    ) -> OSErr;
862}
863
864extern "C-unwind" {
865    /// # Safety
866    ///
867    /// - `the_ae_desc_list` must be a valid pointer.
868    /// - `type_code` must be a valid pointer.
869    /// - `data_size` must be a valid pointer.
870    pub fn AESizeOfNthItem(
871        the_ae_desc_list: *const AEDescList,
872        index: c_long,
873        type_code: *mut DescType,
874        data_size: *mut Size,
875    ) -> OSErr;
876}
877
878extern "C-unwind" {
879    /// # Safety
880    ///
881    /// - `the_ae_desc_list` must be a valid pointer.
882    /// - `array_ptr` must be a valid pointer.
883    /// - `item_type` must be a valid pointer.
884    /// - `item_size` must be a valid pointer.
885    /// - `item_count` must be a valid pointer.
886    pub fn AEGetArray(
887        the_ae_desc_list: *const AEDescList,
888        array_type: AEArrayType,
889        array_ptr: AEArrayDataPointer,
890        maximum_size: Size,
891        item_type: *mut DescType,
892        item_size: *mut Size,
893        item_count: *mut c_long,
894    ) -> OSErr;
895}
896
897extern "C-unwind" {
898    /// # Safety
899    ///
900    /// - `the_ae_desc_list` must be a valid pointer.
901    /// - `array_ptr` must be a valid pointer.
902    pub fn AEPutArray(
903        the_ae_desc_list: *mut AEDescList,
904        array_type: AEArrayType,
905        array_ptr: *const AEArrayData,
906        item_type: DescType,
907        item_size: Size,
908        item_count: c_long,
909    ) -> OSErr;
910}
911
912extern "C-unwind" {
913    /// # Safety
914    ///
915    /// `the_ae_desc_list` must be a valid pointer.
916    pub fn AEDeleteItem(the_ae_desc_list: *mut AEDescList, index: c_long) -> OSErr;
917}
918
919/// ************************************************************************
920/// The following calls apply to AERecord. Since AERecord is a subtype of
921/// AEDescList, the calls in the previous sections can also be used for
922/// AERecord an AERecord can be created by using AECreateList with isRecord
923/// set to true.
924/// ************************************************************************
925///
926/// ***********************************************************************
927/// AERecords can have an abitrary descriptorType.  This allows you to
928/// check if desc is truly an AERecord
929/// **********************************************************************
930///
931/// # Safety
932///
933/// `the_desc` must be a valid pointer.
934#[inline]
935pub unsafe extern "C-unwind" fn AECheckIsRecord(the_desc: *const AEDesc) -> bool {
936    extern "C-unwind" {
937        fn AECheckIsRecord(the_desc: *const AEDesc) -> Boolean;
938    }
939    let ret = unsafe { AECheckIsRecord(the_desc) };
940    ret != 0
941}
942
943extern "C-unwind" {
944    /// ************************************************************************
945    /// The following calls create and manipulate the AppleEvent data type.
946    /// ************************************************************************
947    ///
948    /// # Safety
949    ///
950    /// - `target` must be a valid pointer.
951    /// - `result` must be a valid pointer.
952    pub fn AECreateAppleEvent(
953        the_ae_event_class: AEEventClass,
954        the_ae_event_id: AEEventID,
955        target: *const AEAddressDesc,
956        return_id: AEReturnID,
957        transaction_id: AETransactionID,
958        result: *mut AppleEvent,
959    ) -> OSErr;
960}
961
962extern "C-unwind" {
963    /// ************************************************************************
964    /// The following calls are used to pack and unpack parameters from records
965    /// of type AppleEvent. Since AppleEvent is a subtype of AERecord, the calls
966    /// in the previous sections can also be used for variables of type
967    /// AppleEvent. The next six calls are in fact identical to the six calls
968    /// for AERecord.
969    /// ************************************************************************
970    ///
971    /// # Safety
972    ///
973    /// - `the_apple_event` must be a valid pointer.
974    /// - `data_ptr` must be a valid pointer.
975    pub fn AEPutParamPtr(
976        the_apple_event: *mut AppleEvent,
977        the_ae_keyword: AEKeyword,
978        type_code: DescType,
979        data_ptr: *const c_void,
980        data_size: Size,
981    ) -> OSErr;
982}
983
984extern "C-unwind" {
985    /// # Safety
986    ///
987    /// - `the_apple_event` must be a valid pointer.
988    /// - `the_ae_desc` must be a valid pointer.
989    pub fn AEPutParamDesc(
990        the_apple_event: *mut AppleEvent,
991        the_ae_keyword: AEKeyword,
992        the_ae_desc: *const AEDesc,
993    ) -> OSErr;
994}
995
996extern "C-unwind" {
997    /// # Safety
998    ///
999    /// - `the_apple_event` must be a valid pointer.
1000    /// - `actual_type` must be a valid pointer.
1001    /// - `data_ptr` must be a valid pointer.
1002    /// - `actual_size` must be a valid pointer.
1003    pub fn AEGetParamPtr(
1004        the_apple_event: *const AppleEvent,
1005        the_ae_keyword: AEKeyword,
1006        desired_type: DescType,
1007        actual_type: *mut DescType,
1008        data_ptr: *mut c_void,
1009        maximum_size: Size,
1010        actual_size: *mut Size,
1011    ) -> OSErr;
1012}
1013
1014extern "C-unwind" {
1015    /// # Safety
1016    ///
1017    /// - `the_apple_event` must be a valid pointer.
1018    /// - `result` must be a valid pointer.
1019    pub fn AEGetParamDesc(
1020        the_apple_event: *const AppleEvent,
1021        the_ae_keyword: AEKeyword,
1022        desired_type: DescType,
1023        result: *mut AEDesc,
1024    ) -> OSErr;
1025}
1026
1027extern "C-unwind" {
1028    /// # Safety
1029    ///
1030    /// - `the_apple_event` must be a valid pointer.
1031    /// - `type_code` must be a valid pointer.
1032    /// - `data_size` must be a valid pointer.
1033    pub fn AESizeOfParam(
1034        the_apple_event: *const AppleEvent,
1035        the_ae_keyword: AEKeyword,
1036        type_code: *mut DescType,
1037        data_size: *mut Size,
1038    ) -> OSErr;
1039}
1040
1041extern "C-unwind" {
1042    /// # Safety
1043    ///
1044    /// `the_apple_event` must be a valid pointer.
1045    pub fn AEDeleteParam(the_apple_event: *mut AppleEvent, the_ae_keyword: AEKeyword) -> OSErr;
1046}
1047
1048extern "C-unwind" {
1049    /// # Safety
1050    ///
1051    /// - `the_apple_event` must be a valid pointer.
1052    /// - `type_code` must be a valid pointer.
1053    /// - `data_ptr` must be a valid pointer.
1054    /// - `actual_size` must be a valid pointer.
1055    pub fn AEGetAttributePtr(
1056        the_apple_event: *const AppleEvent,
1057        the_ae_keyword: AEKeyword,
1058        desired_type: DescType,
1059        type_code: *mut DescType,
1060        data_ptr: *mut c_void,
1061        maximum_size: Size,
1062        actual_size: *mut Size,
1063    ) -> OSErr;
1064}
1065
1066extern "C-unwind" {
1067    /// # Safety
1068    ///
1069    /// - `the_apple_event` must be a valid pointer.
1070    /// - `result` must be a valid pointer.
1071    pub fn AEGetAttributeDesc(
1072        the_apple_event: *const AppleEvent,
1073        the_ae_keyword: AEKeyword,
1074        desired_type: DescType,
1075        result: *mut AEDesc,
1076    ) -> OSErr;
1077}
1078
1079extern "C-unwind" {
1080    /// # Safety
1081    ///
1082    /// - `the_apple_event` must be a valid pointer.
1083    /// - `type_code` must be a valid pointer.
1084    /// - `data_size` must be a valid pointer.
1085    pub fn AESizeOfAttribute(
1086        the_apple_event: *const AppleEvent,
1087        the_ae_keyword: AEKeyword,
1088        type_code: *mut DescType,
1089        data_size: *mut Size,
1090    ) -> OSErr;
1091}
1092
1093extern "C-unwind" {
1094    /// # Safety
1095    ///
1096    /// - `the_apple_event` must be a valid pointer.
1097    /// - `data_ptr` must be a valid pointer.
1098    pub fn AEPutAttributePtr(
1099        the_apple_event: *mut AppleEvent,
1100        the_ae_keyword: AEKeyword,
1101        type_code: DescType,
1102        data_ptr: *const c_void,
1103        data_size: Size,
1104    ) -> OSErr;
1105}
1106
1107extern "C-unwind" {
1108    /// # Safety
1109    ///
1110    /// - `the_apple_event` must be a valid pointer.
1111    /// - `the_ae_desc` must be a valid pointer.
1112    pub fn AEPutAttributeDesc(
1113        the_apple_event: *mut AppleEvent,
1114        the_ae_keyword: AEKeyword,
1115        the_ae_desc: *const AEDesc,
1116    ) -> OSErr;
1117}
1118
1119extern "C-unwind" {
1120    /// ************************************************************************
1121    /// AppleEvent Serialization Support
1122    ///
1123    /// AESizeOfFlattenedDesc, AEFlattenDesc, AEUnflattenDesc
1124    ///
1125    /// These calls will work for all AppleEvent data types and between different
1126    /// versions of the OS (including between Mac OS 9 and X)
1127    ///
1128    /// Basic types, AEDesc, AEList and AERecord are OK, but AppleEvent records
1129    /// themselves may not be reliably flattened for storage.
1130    /// ************************************************************************
1131    ///
1132    /// # Safety
1133    ///
1134    /// `the_ae_desc` must be a valid pointer.
1135    pub fn AESizeOfFlattenedDesc(the_ae_desc: *const AEDesc) -> Size;
1136}
1137
1138extern "C-unwind" {
1139    /// # Safety
1140    ///
1141    /// - `the_ae_desc` must be a valid pointer.
1142    /// - `buffer` must be a valid pointer.
1143    /// - `actual_size` must be a valid pointer.
1144    pub fn AEFlattenDesc(
1145        the_ae_desc: *const AEDesc,
1146        buffer: Ptr,
1147        buffer_size: Size,
1148        actual_size: *mut Size,
1149    ) -> OSStatus;
1150}
1151
1152extern "C-unwind" {
1153    /// # Safety
1154    ///
1155    /// - `buffer` must be a valid pointer.
1156    /// - `result` must be a valid pointer.
1157    #[deprecated]
1158    pub fn AEUnflattenDesc(buffer: *const c_void, result: *mut AEDesc) -> OSStatus;
1159}
1160
1161extern "C-unwind" {
1162    /// Allocates an AEDesc (given a Null Desc) constructed from a flattened data
1163    /// buffer produced by calling AEFlattenDesc.
1164    ///
1165    ///
1166    /// Parameter `buffer`: A pointer to data produced by `AEFlattenDesc`
1167    ///
1168    /// Parameter `bufferLen`: The size of the data referenced by `buffer`
1169    ///
1170    /// Parameter `result`: On successful completion, a pointer to an `AEDesc*` containing the unflattened descriptor. The caller is responsible for disposing of it.
1171    ///
1172    /// Returns: `noErr` on success, `paramErr` if the buffer could not be parsed, or `memFullErr` for irrational memory sizes.
1173    ///
1174    /// # Safety
1175    ///
1176    /// - `buffer` must be a valid pointer.
1177    /// - `result` must be a valid pointer.
1178    pub fn AEUnflattenDescFromBytes(
1179        buffer: *const c_void,
1180        buffer_len: usize,
1181        result: *mut AEDesc,
1182    ) -> OSStatus;
1183}
1184
1185extern "C-unwind" {
1186    /// ************************************************************************
1187    /// The following calls are necessary to deal with opaque data in AEDescs, because the
1188    /// traditional way of dealing with a basic AEDesc has been to dereference the dataHandle
1189    /// directly.  This is not supported under Carbon.
1190    /// ************************************************************************
1191    ///
1192    /// # Safety
1193    ///
1194    /// - `the_ae_desc` must be a valid pointer.
1195    /// - `data_ptr` must be a valid pointer.
1196    pub fn AEGetDescData(
1197        the_ae_desc: *const AEDesc,
1198        data_ptr: *mut c_void,
1199        maximum_size: Size,
1200    ) -> OSErr;
1201}
1202
1203extern "C-unwind" {
1204    /// # Safety
1205    ///
1206    /// `the_ae_desc` must be a valid pointer.
1207    pub fn AEGetDescDataSize(the_ae_desc: *const AEDesc) -> Size;
1208}
1209
1210extern "C-unwind" {
1211    /// # Safety
1212    ///
1213    /// - `data_ptr` must be a valid pointer.
1214    /// - `the_ae_desc` must be a valid pointer.
1215    pub fn AEReplaceDescData(
1216        type_code: DescType,
1217        data_ptr: *const c_void,
1218        data_size: Size,
1219        the_ae_desc: *mut AEDesc,
1220    ) -> OSErr;
1221}
1222
1223extern "C-unwind" {
1224    /// # Safety
1225    ///
1226    /// - `data_desc` must be a valid pointer.
1227    /// - `buffer` must be a valid pointer.
1228    pub fn AEGetDescDataRange(
1229        data_desc: *const AEDesc,
1230        buffer: *mut c_void,
1231        offset: Size,
1232        length: Size,
1233    ) -> OSStatus;
1234}
1235
1236/// ************************************************************************
1237/// A AEEventHandler is installed to process an AppleEvent
1238/// ************************************************************************
1239///
1240/// See also [Apple's documentation](https://developer.apple.com/documentation/coreservices/aeeventhandlerprocptr?language=objc)
1241pub type AEEventHandlerProcPtr =
1242    Option<unsafe extern "C-unwind" fn(*const AppleEvent, *mut AppleEvent, SRefCon) -> OSErr>;
1243
1244/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aeeventhandlerupp?language=objc)
1245pub type AEEventHandlerUPP = AEEventHandlerProcPtr;
1246
1247extern "C-unwind" {
1248    /// # Safety
1249    ///
1250    /// `user_routine` must be implemented correctly.
1251    pub fn NewAEDisposeExternalUPP(user_routine: AEDisposeExternalProcPtr) -> AEDisposeExternalUPP;
1252}
1253
1254extern "C-unwind" {
1255    /// # Safety
1256    ///
1257    /// `user_routine` must be implemented correctly.
1258    pub fn NewAEEventHandlerUPP(user_routine: AEEventHandlerProcPtr) -> AEEventHandlerUPP;
1259}
1260
1261extern "C-unwind" {
1262    /// # Safety
1263    ///
1264    /// `user_upp` must be implemented correctly.
1265    pub fn DisposeAEDisposeExternalUPP(user_upp: AEDisposeExternalUPP);
1266}
1267
1268extern "C-unwind" {
1269    /// # Safety
1270    ///
1271    /// `user_upp` must be implemented correctly.
1272    pub fn DisposeAEEventHandlerUPP(user_upp: AEEventHandlerUPP);
1273}
1274
1275extern "C-unwind" {
1276    /// # Safety
1277    ///
1278    /// - `data_ptr` must be a valid pointer.
1279    /// - `refcon` must be a valid pointer.
1280    /// - `user_upp` must be implemented correctly.
1281    pub fn InvokeAEDisposeExternalUPP(
1282        data_ptr: *const c_void,
1283        data_length: Size,
1284        refcon: SRefCon,
1285        user_upp: AEDisposeExternalUPP,
1286    );
1287}
1288
1289extern "C-unwind" {
1290    /// # Safety
1291    ///
1292    /// - `the_apple_event` must be a valid pointer.
1293    /// - `reply` must be a valid pointer.
1294    /// - `handler_refcon` must be a valid pointer.
1295    /// - `user_upp` must be implemented correctly.
1296    pub fn InvokeAEEventHandlerUPP(
1297        the_apple_event: *const AppleEvent,
1298        reply: *mut AppleEvent,
1299        handler_refcon: SRefCon,
1300        user_upp: AEEventHandlerUPP,
1301    ) -> OSErr;
1302}