use core::cell::UnsafeCell;
use core::ffi::*;
use core::marker::{PhantomData, PhantomPinned};
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use crate::*;
pub type DescType = ResType;
pub type AEKeyword = FourCharCode;
pub const typeBoolean: DescType = 0x626f6f6c;
pub const typeChar: DescType = 0x54455854;
pub const typeStyledUnicodeText: DescType = 0x73757478;
pub const typeEncodedString: DescType = 0x656e6373;
pub const typeUnicodeText: DescType = 0x75747874;
pub const typeCString: DescType = 0x63737472;
pub const typePString: DescType = 0x70737472;
pub const typeUTF16ExternalRepresentation: DescType = 0x75743136;
pub const typeUTF8Text: DescType = 0x75746638;
pub const typeSInt16: DescType = 0x73686f72;
pub const typeUInt16: DescType = 0x75736872;
pub const typeSInt32: DescType = 0x6c6f6e67;
pub const typeUInt32: DescType = 0x6d61676e;
pub const typeSInt64: DescType = 0x636f6d70;
pub const typeUInt64: DescType = 0x75636f6d;
pub const typeIEEE32BitFloatingPoint: DescType = 0x73696e67;
pub const typeIEEE64BitFloatingPoint: DescType = 0x646f7562;
pub const type128BitFloatingPoint: DescType = 0x6c64626c;
pub const typeDecimalStruct: DescType = 0x6465636d;
pub const typeAEList: DescType = 0x6c697374;
pub const typeAERecord: DescType = 0x7265636f;
pub const typeAppleEvent: DescType = 0x61657674;
pub const typeEventRecord: DescType = 0x65767263;
pub const typeTrue: DescType = 0x74727565;
pub const typeFalse: DescType = 0x66616c73;
pub const typeAlias: DescType = 0x616c6973;
pub const typeEnumerated: DescType = 0x656e756d;
pub const typeType: DescType = 0x74797065;
pub const typeAppParameters: DescType = 0x61707061;
pub const typeProperty: DescType = 0x70726f70;
pub const typeFSRef: DescType = 0x66737266;
pub const typeFileURL: DescType = 0x6675726c;
pub const typeBookmarkData: DescType = 0x626d726b;
pub const typeKeyword: DescType = 0x6b657977;
pub const typeSectionH: DescType = 0x73656374;
pub const typeWildCard: DescType = 0x2a2a2a2a;
pub const typeApplSignature: DescType = 0x7369676e;
pub const typeQDRectangle: DescType = 0x71647274;
pub const typeFixed: DescType = 0x66697864;
pub const typeProcessSerialNumber: DescType = 0x70736e20;
pub const typeApplicationURL: DescType = 0x6170726c;
pub const typeNull: DescType = 0x6e756c6c;
pub const typeCFAttributedStringRef: DescType = 0x63666173;
pub const typeCFMutableAttributedStringRef: DescType = 0x63666161;
pub const typeCFStringRef: DescType = 0x63667374;
pub const typeCFMutableStringRef: DescType = 0x63666d73;
pub const typeCFArrayRef: DescType = 0x63666172;
pub const typeCFMutableArrayRef: DescType = 0x63666d61;
pub const typeCFDictionaryRef: DescType = 0x63666463;
pub const typeCFMutableDictionaryRef: DescType = 0x63666d64;
pub const typeCFNumberRef: DescType = 0x63666e62;
pub const typeCFBooleanRef: DescType = 0x63667466;
pub const typeCFTypeRef: DescType = 0x63667479;
pub const typeKernelProcessID: DescType = 0x6b706964;
pub const typeMachPort: DescType = 0x706f7274;
pub const typeAuditToken: DescType = 0x746f6b6e;
pub const typeApplicationBundleID: DescType = 0x62756e64;
pub const keyTransactionIDAttr: AEKeyword = 0x7472616e;
pub const keyReturnIDAttr: AEKeyword = 0x72746964;
pub const keyEventClassAttr: AEKeyword = 0x6576636c;
pub const keyEventIDAttr: AEKeyword = 0x65766964;
pub const keyAddressAttr: AEKeyword = 0x61646472;
pub const keyOptionalKeywordAttr: AEKeyword = 0x6f70746b;
pub const keyTimeoutAttr: AEKeyword = 0x74696d6f;
pub const keyInteractLevelAttr: AEKeyword = 0x696e7465;
pub const keyEventSourceAttr: AEKeyword = 0x65737263;
pub const keyMissedKeywordAttr: AEKeyword = 0x6d697373;
pub const keyOriginalAddressAttr: AEKeyword = 0x66726f6d;
pub const keyAcceptTimeoutAttr: AEKeyword = 0x6163746d;
pub const keyReplyRequestedAttr: AEKeyword = 0x72657071;
pub const keySenderEUIDAttr: AEKeyword = 0x73656964;
pub const keySenderEGIDAttr: AEKeyword = 0x73676964;
pub const keySenderUIDAttr: AEKeyword = 0x75696473;
pub const keySenderGIDAttr: AEKeyword = 0x67696473;
pub const keySenderPIDAttr: AEKeyword = 0x73706964;
pub const keySenderAuditTokenAttr: AEKeyword = 0x746f6b6e;
pub const keySenderApplescriptEntitlementsAttr: AEKeyword = 0x656e746c;
pub const keySenderApplicationIdentifierEntitlementAttr: AEKeyword = 0x61696561;
pub const keySenderApplicationSandboxed: AEKeyword = 0x73737362;
pub const keyActualSenderAuditToken: AEKeyword = 0x61636174;
pub const kAEDebugPOSTHeader: c_int = 1 << 0;
pub const kAEDebugReplyHeader: c_int = 1 << 1;
pub const kAEDebugXMLRequest: c_int = 1 << 2;
pub const kAEDebugXMLResponse: c_int = 1 << 3;
pub const kAEDebugXMLDebugAll: c_int = -1;
pub const kSOAP1999Schema: c_uint = 0x73733939;
pub const kSOAP2001Schema: c_uint = 0x73733031;
pub const keyUserNameAttr: AEKeyword = 0x756e616d;
pub const keyUserPasswordAttr: AEKeyword = 0x70617373;
pub const keyDisableAuthenticationAttr: AEKeyword = 0x61757468;
pub const keyXMLDebuggingAttr: AEKeyword = 0x78646267;
pub const kAERPCClass: AEKeyword = 0x72706320;
pub const kAEXMLRPCScheme: AEKeyword = 0x52504332;
pub const kAESOAPScheme: AEKeyword = 0x534f4150;
pub const kAESharedScriptHandler: AEKeyword = 0x77736370;
pub const keyRPCMethodName: AEKeyword = 0x6d657468;
pub const keyRPCMethodParam: AEKeyword = 0x7061726d;
pub const keyRPCMethodParamOrder: AEKeyword = 0x2f6f7264;
pub const keyAEPOSTHeaderData: AEKeyword = 0x70686564;
pub const keyAEReplyHeaderData: AEKeyword = 0x72686564;
pub const keyAEXMLRequestData: AEKeyword = 0x78726571;
pub const keyAEXMLReplyData: AEKeyword = 0x78726570;
pub const keyAdditionalHTTPHeaders: AEKeyword = 0x61686564;
pub const keySOAPAction: AEKeyword = 0x73616374;
pub const keySOAPMethodNameSpace: AEKeyword = 0x6d737063;
pub const keySOAPMethodNameSpaceURI: AEKeyword = 0x6d737075;
pub const keySOAPSchemaVersion: AEKeyword = 0x73736368;
pub const keySOAPStructureMetaData: AEKeyword = 0x2f736d64;
pub const keySOAPSMDNamespace: AEKeyword = 0x73736e73;
pub const keySOAPSMDNamespaceURI: AEKeyword = 0x73736e75;
pub const keySOAPSMDType: AEKeyword = 0x73737470;
pub const kAEUseHTTPProxyAttr: c_uint = 0x78757072;
pub const kAEHTTPProxyPortAttr: c_uint = 0x78687470;
pub const kAEHTTPProxyHostAttr: c_uint = 0x78687468;
pub const kAESocks4Protocol: c_uint = 4;
pub const kAESocks5Protocol: c_uint = 5;
pub const kAEUseSocksAttr: c_uint = 0x78736373;
pub const kAESocksProxyAttr: c_uint = 0x78736f6b;
pub const kAESocksHostAttr: c_uint = 0x78736873;
pub const kAESocksPortAttr: c_uint = 0x78736870;
pub const kAESocksUserAttr: c_uint = 0x78736875;
pub const kAESocksPasswordAttr: c_uint = 0x78736877;
pub const kAEDescListFactorNone: c_uint = 0;
pub const kAEDescListFactorType: c_uint = 4;
pub const kAEDescListFactorTypeAndSize: c_uint = 8;
pub const kAutoGenerateReturnID: c_int = -1;
pub const kAnyTransactionID: c_int = 0;
#[repr(C)]
#[derive(Debug)]
pub struct OpaqueAEDataStorageType {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for OpaqueAEDataStorageType {
const ENCODING_REF: Encoding =
Encoding::Pointer(&Encoding::Struct("OpaqueAEDataStorageType", &[]));
}
pub type AEDataStorageType = *mut OpaqueAEDataStorageType;
pub type AEDataStorage = *mut AEDataStorageType;
#[repr(C, packed(2))]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct AEDesc {
pub descriptorType: DescType,
pub dataHandle: AEDataStorage,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for AEDesc {
const ENCODING: Encoding =
Encoding::Struct("AEDesc", &[<DescType>::ENCODING, <AEDataStorage>::ENCODING]);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for AEDesc {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type AEDescPtr = *mut AEDesc;
#[repr(C, packed(2))]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct AEKeyDesc {
pub descKey: AEKeyword,
pub descContent: AEDesc,
}
#[cfg(feature = "objc2")]
unsafe impl Encode for AEKeyDesc {
const ENCODING: Encoding =
Encoding::Struct("AEKeyDesc", &[<AEKeyword>::ENCODING, <AEDesc>::ENCODING]);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for AEKeyDesc {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type AEDescList = AEDesc;
pub type AERecord = AEDescList;
pub type AEAddressDesc = AEDesc;
pub type AppleEvent = AERecord;
pub type AppleEventPtr = *mut AppleEvent;
pub type AEReturnID = i16;
pub type AETransactionID = i32;
pub type AEEventClass = FourCharCode;
pub type AEEventID = FourCharCode;
pub type AEArrayType = i8;
pub const kAEDataArray: c_uint = 0;
pub const kAEPackedArray: c_uint = 1;
pub const kAEDescArray: c_uint = 3;
pub const kAEKeyDescArray: c_uint = 4;
pub const kAEHandleArray: c_uint = 2;
#[repr(C, packed(2))]
#[derive(Clone, Copy)]
pub union AEArrayData {
pub kAEDataArray: [i16; 1],
pub kAEPackedArray: [c_char; 1],
pub kAEHandleArray: [Handle; 1],
pub kAEDescArray: [AEDesc; 1],
pub kAEKeyDescArray: [AEKeyDesc; 1],
}
#[cfg(feature = "objc2")]
unsafe impl Encode for AEArrayData {
const ENCODING: Encoding = Encoding::Union(
"AEArrayData",
&[
<[i16; 1]>::ENCODING,
<[c_char; 1]>::ENCODING,
<[Handle; 1]>::ENCODING,
<[AEDesc; 1]>::ENCODING,
<[AEKeyDesc; 1]>::ENCODING,
],
);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for AEArrayData {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type AEArrayDataPointer = *mut AEArrayData;
pub type AESendPriority = i16;
pub const kAENormalPriority: c_uint = 0x00000000;
pub const kAEHighPriority: c_uint = 0x00000001;
pub type AESendMode = i32;
pub const kAENoReply: c_uint = 0x00000001;
pub const kAEQueueReply: c_uint = 0x00000002;
pub const kAEWaitReply: c_uint = 0x00000003;
pub const kAEDontReconnect: c_uint = 0x00000080;
pub const kAEWantReceipt: c_uint = 0x00000200;
pub const kAENeverInteract: c_uint = 0x00000010;
pub const kAECanInteract: c_uint = 0x00000020;
pub const kAEAlwaysInteract: c_uint = 0x00000030;
pub const kAECanSwitchLayer: c_uint = 0x00000040;
pub const kAEDontRecord: c_uint = 0x00001000;
pub const kAEDontExecute: c_uint = 0x00002000;
pub const kAEProcessNonReplyEvents: c_uint = 0x00008000;
pub const kAEDoNotAutomaticallyAddAnnotationsToEvent: c_uint = 0x00010000;
pub const kAEDefaultTimeout: c_int = -1;
pub const kNoTimeOut: c_int = -2;
pub type AECoerceDescProcPtr =
Option<unsafe extern "C-unwind" fn(*const AEDesc, DescType, SRefCon, *mut AEDesc) -> OSErr>;
pub type AECoercePtrProcPtr = Option<
unsafe extern "C-unwind" fn(
DescType,
*const c_void,
Size,
DescType,
SRefCon,
*mut AEDesc,
) -> OSErr,
>;
pub type AECoerceDescUPP = AECoerceDescProcPtr;
pub type AECoercePtrUPP = AECoercePtrProcPtr;
extern "C-unwind" {
pub fn NewAECoerceDescUPP(user_routine: AECoerceDescProcPtr) -> AECoerceDescUPP;
}
extern "C-unwind" {
pub fn NewAECoercePtrUPP(user_routine: AECoercePtrProcPtr) -> AECoercePtrUPP;
}
extern "C-unwind" {
pub fn DisposeAECoerceDescUPP(user_upp: AECoerceDescUPP);
}
extern "C-unwind" {
pub fn DisposeAECoercePtrUPP(user_upp: AECoercePtrUPP);
}
extern "C-unwind" {
pub fn InvokeAECoerceDescUPP(
from_desc: *const AEDesc,
to_type: DescType,
handler_refcon: SRefCon,
to_desc: *mut AEDesc,
user_upp: AECoerceDescUPP,
) -> OSErr;
}
extern "C-unwind" {
pub fn InvokeAECoercePtrUPP(
type_code: DescType,
data_ptr: *const c_void,
data_size: Size,
to_type: DescType,
handler_refcon: SRefCon,
result: *mut AEDesc,
user_upp: AECoercePtrUPP,
) -> OSErr;
}
pub type AECoercionHandlerUPP = AECoerceDescUPP;
#[inline]
pub unsafe extern "C-unwind" fn AEInstallCoercionHandler(
from_type: DescType,
to_type: DescType,
handler: AECoercionHandlerUPP,
handler_refcon: SRefCon,
from_type_is_desc: bool,
is_sys_handler: bool,
) -> OSErr {
extern "C-unwind" {
fn AEInstallCoercionHandler(
from_type: DescType,
to_type: DescType,
handler: AECoercionHandlerUPP,
handler_refcon: SRefCon,
from_type_is_desc: Boolean,
is_sys_handler: Boolean,
) -> OSErr;
}
unsafe {
AEInstallCoercionHandler(
from_type,
to_type,
handler,
handler_refcon,
from_type_is_desc as _,
is_sys_handler as _,
)
}
}
#[inline]
pub unsafe extern "C-unwind" fn AERemoveCoercionHandler(
from_type: DescType,
to_type: DescType,
handler: AECoercionHandlerUPP,
is_sys_handler: bool,
) -> OSErr {
extern "C-unwind" {
fn AERemoveCoercionHandler(
from_type: DescType,
to_type: DescType,
handler: AECoercionHandlerUPP,
is_sys_handler: Boolean,
) -> OSErr;
}
unsafe { AERemoveCoercionHandler(from_type, to_type, handler, is_sys_handler as _) }
}
#[inline]
pub unsafe extern "C-unwind" fn AEGetCoercionHandler(
from_type: DescType,
to_type: DescType,
handler: *mut AECoercionHandlerUPP,
handler_refcon: *mut SRefCon,
from_type_is_desc: *mut Boolean,
is_sys_handler: bool,
) -> OSErr {
extern "C-unwind" {
fn AEGetCoercionHandler(
from_type: DescType,
to_type: DescType,
handler: *mut AECoercionHandlerUPP,
handler_refcon: *mut SRefCon,
from_type_is_desc: *mut Boolean,
is_sys_handler: Boolean,
) -> OSErr;
}
unsafe {
AEGetCoercionHandler(
from_type,
to_type,
handler,
handler_refcon,
from_type_is_desc,
is_sys_handler as _,
)
}
}
extern "C-unwind" {
pub fn AECoercePtr(
type_code: DescType,
data_ptr: *const c_void,
data_size: Size,
to_type: DescType,
result: *mut AEDesc,
) -> OSErr;
}
extern "C-unwind" {
pub fn AECoerceDesc(
the_ae_desc: *const AEDesc,
to_type: DescType,
result: *mut AEDesc,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEInitializeDesc(desc: *mut AEDesc);
}
extern "C-unwind" {
pub fn AECreateDesc(
type_code: DescType,
data_ptr: *const c_void,
data_size: Size,
result: *mut AEDesc,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEDisposeDesc(the_ae_desc: *mut AEDesc) -> OSErr;
}
extern "C-unwind" {
pub fn AEDuplicateDesc(the_ae_desc: *const AEDesc, result: *mut AEDesc) -> OSErr;
}
pub type AEDisposeExternalProcPtr =
Option<unsafe extern "C-unwind" fn(*const c_void, Size, SRefCon)>;
pub type AEDisposeExternalUPP = AEDisposeExternalProcPtr;
extern "C-unwind" {
pub fn AECreateDescFromExternalPtr(
descriptor_type: OSType,
data_ptr: *const c_void,
data_length: Size,
dispose_callback: AEDisposeExternalUPP,
dispose_refcon: SRefCon,
the_desc: *mut AEDesc,
) -> OSStatus;
}
extern "C-unwind" {
pub fn AECompareDesc(
desc1: *const AEDesc,
desc2: *const AEDesc,
result_p: *mut Boolean,
) -> OSStatus;
}
#[inline]
pub unsafe extern "C-unwind" fn AECreateList(
factoring_ptr: *const c_void,
factored_size: Size,
is_record: bool,
result_list: *mut AEDescList,
) -> OSErr {
extern "C-unwind" {
fn AECreateList(
factoring_ptr: *const c_void,
factored_size: Size,
is_record: Boolean,
result_list: *mut AEDescList,
) -> OSErr;
}
unsafe { AECreateList(factoring_ptr, factored_size, is_record as _, result_list) }
}
extern "C-unwind" {
pub fn AECountItems(the_ae_desc_list: *const AEDescList, the_count: *mut c_long) -> OSErr;
}
extern "C-unwind" {
pub fn AEPutPtr(
the_ae_desc_list: *mut AEDescList,
index: c_long,
type_code: DescType,
data_ptr: *const c_void,
data_size: Size,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEPutDesc(
the_ae_desc_list: *mut AEDescList,
index: c_long,
the_ae_desc: *const AEDesc,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEGetNthPtr(
the_ae_desc_list: *const AEDescList,
index: c_long,
desired_type: DescType,
the_ae_keyword: *mut AEKeyword,
type_code: *mut DescType,
data_ptr: *mut c_void,
maximum_size: Size,
actual_size: *mut Size,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEGetNthDesc(
the_ae_desc_list: *const AEDescList,
index: c_long,
desired_type: DescType,
the_ae_keyword: *mut AEKeyword,
result: *mut AEDesc,
) -> OSErr;
}
extern "C-unwind" {
pub fn AESizeOfNthItem(
the_ae_desc_list: *const AEDescList,
index: c_long,
type_code: *mut DescType,
data_size: *mut Size,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEGetArray(
the_ae_desc_list: *const AEDescList,
array_type: AEArrayType,
array_ptr: AEArrayDataPointer,
maximum_size: Size,
item_type: *mut DescType,
item_size: *mut Size,
item_count: *mut c_long,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEPutArray(
the_ae_desc_list: *mut AEDescList,
array_type: AEArrayType,
array_ptr: *const AEArrayData,
item_type: DescType,
item_size: Size,
item_count: c_long,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEDeleteItem(the_ae_desc_list: *mut AEDescList, index: c_long) -> OSErr;
}
#[inline]
pub unsafe extern "C-unwind" fn AECheckIsRecord(the_desc: *const AEDesc) -> bool {
extern "C-unwind" {
fn AECheckIsRecord(the_desc: *const AEDesc) -> Boolean;
}
let ret = unsafe { AECheckIsRecord(the_desc) };
ret != 0
}
extern "C-unwind" {
pub fn AECreateAppleEvent(
the_ae_event_class: AEEventClass,
the_ae_event_id: AEEventID,
target: *const AEAddressDesc,
return_id: AEReturnID,
transaction_id: AETransactionID,
result: *mut AppleEvent,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEPutParamPtr(
the_apple_event: *mut AppleEvent,
the_ae_keyword: AEKeyword,
type_code: DescType,
data_ptr: *const c_void,
data_size: Size,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEPutParamDesc(
the_apple_event: *mut AppleEvent,
the_ae_keyword: AEKeyword,
the_ae_desc: *const AEDesc,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEGetParamPtr(
the_apple_event: *const AppleEvent,
the_ae_keyword: AEKeyword,
desired_type: DescType,
actual_type: *mut DescType,
data_ptr: *mut c_void,
maximum_size: Size,
actual_size: *mut Size,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEGetParamDesc(
the_apple_event: *const AppleEvent,
the_ae_keyword: AEKeyword,
desired_type: DescType,
result: *mut AEDesc,
) -> OSErr;
}
extern "C-unwind" {
pub fn AESizeOfParam(
the_apple_event: *const AppleEvent,
the_ae_keyword: AEKeyword,
type_code: *mut DescType,
data_size: *mut Size,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEDeleteParam(the_apple_event: *mut AppleEvent, the_ae_keyword: AEKeyword) -> OSErr;
}
extern "C-unwind" {
pub fn AEGetAttributePtr(
the_apple_event: *const AppleEvent,
the_ae_keyword: AEKeyword,
desired_type: DescType,
type_code: *mut DescType,
data_ptr: *mut c_void,
maximum_size: Size,
actual_size: *mut Size,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEGetAttributeDesc(
the_apple_event: *const AppleEvent,
the_ae_keyword: AEKeyword,
desired_type: DescType,
result: *mut AEDesc,
) -> OSErr;
}
extern "C-unwind" {
pub fn AESizeOfAttribute(
the_apple_event: *const AppleEvent,
the_ae_keyword: AEKeyword,
type_code: *mut DescType,
data_size: *mut Size,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEPutAttributePtr(
the_apple_event: *mut AppleEvent,
the_ae_keyword: AEKeyword,
type_code: DescType,
data_ptr: *const c_void,
data_size: Size,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEPutAttributeDesc(
the_apple_event: *mut AppleEvent,
the_ae_keyword: AEKeyword,
the_ae_desc: *const AEDesc,
) -> OSErr;
}
extern "C-unwind" {
pub fn AESizeOfFlattenedDesc(the_ae_desc: *const AEDesc) -> Size;
}
extern "C-unwind" {
pub fn AEFlattenDesc(
the_ae_desc: *const AEDesc,
buffer: Ptr,
buffer_size: Size,
actual_size: *mut Size,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated]
pub fn AEUnflattenDesc(buffer: *const c_void, result: *mut AEDesc) -> OSStatus;
}
extern "C-unwind" {
pub fn AEUnflattenDescFromBytes(
buffer: *const c_void,
buffer_len: usize,
result: *mut AEDesc,
) -> OSStatus;
}
extern "C-unwind" {
pub fn AEGetDescData(
the_ae_desc: *const AEDesc,
data_ptr: *mut c_void,
maximum_size: Size,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEGetDescDataSize(the_ae_desc: *const AEDesc) -> Size;
}
extern "C-unwind" {
pub fn AEReplaceDescData(
type_code: DescType,
data_ptr: *const c_void,
data_size: Size,
the_ae_desc: *mut AEDesc,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEGetDescDataRange(
data_desc: *const AEDesc,
buffer: *mut c_void,
offset: Size,
length: Size,
) -> OSStatus;
}
pub type AEEventHandlerProcPtr =
Option<unsafe extern "C-unwind" fn(*const AppleEvent, *mut AppleEvent, SRefCon) -> OSErr>;
pub type AEEventHandlerUPP = AEEventHandlerProcPtr;
extern "C-unwind" {
pub fn NewAEDisposeExternalUPP(user_routine: AEDisposeExternalProcPtr) -> AEDisposeExternalUPP;
}
extern "C-unwind" {
pub fn NewAEEventHandlerUPP(user_routine: AEEventHandlerProcPtr) -> AEEventHandlerUPP;
}
extern "C-unwind" {
pub fn DisposeAEDisposeExternalUPP(user_upp: AEDisposeExternalUPP);
}
extern "C-unwind" {
pub fn DisposeAEEventHandlerUPP(user_upp: AEEventHandlerUPP);
}
extern "C-unwind" {
pub fn InvokeAEDisposeExternalUPP(
data_ptr: *const c_void,
data_length: Size,
refcon: SRefCon,
user_upp: AEDisposeExternalUPP,
);
}
extern "C-unwind" {
pub fn InvokeAEEventHandlerUPP(
the_apple_event: *const AppleEvent,
reply: *mut AppleEvent,
handler_refcon: SRefCon,
user_upp: AEEventHandlerUPP,
) -> OSErr;
}