objc2_core_services/generated/AE/AppleEvents.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};
6use core::ptr::NonNull;
7#[cfg(feature = "objc2")]
8use objc2::__framework_prelude::*;
9use objc2_core_foundation::*;
10
11use crate::*;
12
13/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keydirectobject?language=objc)
14#[cfg(feature = "AEDataModel")]
15pub const keyDirectObject: AEKeyword = 0x2d2d2d2d;
16/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyerrornumber?language=objc)
17#[cfg(feature = "AEDataModel")]
18pub const keyErrorNumber: AEKeyword = 0x6572726e;
19/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyerrorstring?language=objc)
20#[cfg(feature = "AEDataModel")]
21pub const keyErrorString: AEKeyword = 0x65727273;
22/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyprocessserialnumber?language=objc)
23#[cfg(feature = "AEDataModel")]
24pub const keyProcessSerialNumber: AEKeyword = 0x70736e20;
25/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keypredispatch?language=objc)
26#[cfg(feature = "AEDataModel")]
27pub const keyPreDispatch: AEKeyword = 0x70686163;
28/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyselectproc?language=objc)
29#[cfg(feature = "AEDataModel")]
30pub const keySelectProc: AEKeyword = 0x73656c68;
31/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyaerecordercount?language=objc)
32#[cfg(feature = "AEDataModel")]
33pub const keyAERecorderCount: AEKeyword = 0x72656372;
34/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyaeversion?language=objc)
35#[cfg(feature = "AEDataModel")]
36pub const keyAEVersion: AEKeyword = 0x76657273;
37
38/// in a kAEOpenDocuments/kAEReopenApplication event, a typeBoolean value, if true then the process should expect a request to be frontmost to accompany this AppleEvent
39///
40/// See also [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeapplicationactivationexpected?language=objc)
41#[cfg(feature = "AEDataModel")]
42pub const kAEApplicationActivationExpected: AEKeyword = 0x61617064;
43
44/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kcoreeventclass?language=objc)
45#[cfg(feature = "AEDataModel")]
46pub const kCoreEventClass: DescType = 0x61657674;
47
48/// Event sent as the first AppleEvent to an application which is not launched with a document to open or print or with a URL to open.
49///
50/// See also [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeopenapplication?language=objc)
51#[cfg(feature = "AEDataModel")]
52pub const kAEOpenApplication: AEEventID = 0x6f617070;
53/// Event that provides an application with a list of documents to open.
54///
55/// See also [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeopendocuments?language=objc)
56#[cfg(feature = "AEDataModel")]
57pub const kAEOpenDocuments: AEEventID = 0x6f646f63;
58/// Event that provides an application with a list of documents to print.
59///
60/// See also [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeprintdocuments?language=objc)
61#[cfg(feature = "AEDataModel")]
62pub const kAEPrintDocuments: AEEventID = 0x70646f63;
63/// Event that provides an application with dragged content, such as text or an image.
64///
65/// See also [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeopencontents?language=objc)
66#[cfg(feature = "AEDataModel")]
67pub const kAEOpenContents: AEEventID = 0x6f636f6e;
68/// Event that causes an application to quit. May include a property kAEQuitReason indicating what lead to the quit being sent.
69///
70/// See also [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaequitapplication?language=objc)
71#[cfg(feature = "AEDataModel")]
72pub const kAEQuitApplication: AEEventID = 0x71756974;
73/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeanswer?language=objc)
74#[cfg(feature = "AEDataModel")]
75pub const kAEAnswer: AEEventID = 0x616e7372;
76/// Event sent by the Process Manager to an application that launched another application when the launched application quits or terminates.
77///
78/// See also [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeapplicationdied?language=objc)
79#[cfg(feature = "AEDataModel")]
80pub const kAEApplicationDied: AEEventID = 0x6f626974;
81/// sent by Mac OS X when the user chooses the Preferences item
82///
83/// See also [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeshowpreferences?language=objc)
84#[cfg(feature = "AEDataModel")]
85pub const kAEShowPreferences: AEEventID = 0x70726566;
86
87/// If present in a kAEOpenApplication or kAEReopenApplication AppleEvent, with the value kAEYes, then any saved application state should be restored; if present and kAENo, then any saved application state should not be restored
88///
89/// See also [Apple's documentation](https://developer.apple.com/documentation/coreservices/keyaerestoreappstate?language=objc)
90#[cfg(feature = "AEDataModel")]
91pub const keyAERestoreAppState: DescType = 0x7273746f;
92
93/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaestartrecording?language=objc)
94#[cfg(feature = "AEDataModel")]
95pub const kAEStartRecording: AEEventID = 0x72656361;
96/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaestoprecording?language=objc)
97#[cfg(feature = "AEDataModel")]
98pub const kAEStopRecording: AEEventID = 0x72656363;
99/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaenotifystartrecording?language=objc)
100#[cfg(feature = "AEDataModel")]
101pub const kAENotifyStartRecording: AEEventID = 0x72656331;
102/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaenotifystoprecording?language=objc)
103#[cfg(feature = "AEDataModel")]
104pub const kAENotifyStopRecording: AEEventID = 0x72656330;
105/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaenotifyrecording?language=objc)
106#[cfg(feature = "AEDataModel")]
107pub const kAENotifyRecording: AEEventID = 0x72656372;
108
109/// AEEventSource is defined as an SInt8 for compatability with pascal.
110/// Important note: keyEventSourceAttr is returned by AttributePtr as a typeShortInteger.
111/// Be sure to pass at least two bytes of storage to AEGetAttributePtr - the result can be
112/// compared directly against the following enums.
113///
114/// See also [Apple's documentation](https://developer.apple.com/documentation/coreservices/aeeventsource?language=objc)
115pub type AEEventSource = i8;
116
117/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeunknownsource?language=objc)
118pub const kAEUnknownSource: c_uint = 0;
119/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedirectcall?language=objc)
120pub const kAEDirectCall: c_uint = 1;
121/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaesameprocess?language=objc)
122pub const kAESameProcess: c_uint = 2;
123/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaelocalprocess?language=objc)
124pub const kAELocalProcess: c_uint = 3;
125/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeremoteprocess?language=objc)
126pub const kAERemoteProcess: c_uint = 4;
127
128/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/erraetargetaddressnotpermitted?language=objc)
129pub const errAETargetAddressNotPermitted: c_int = -1742;
130/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/erraeeventnotpermitted?language=objc)
131pub const errAEEventNotPermitted: c_int = -1743;
132
133/// ************************************************************************
134/// These calls are used to set up and modify the event dispatch table.D
135/// ************************************************************************
136///
137/// # Safety
138///
139/// - `handler` must be implemented correctly.
140/// - `handler_refcon` must be a valid pointer.
141#[cfg(feature = "AEDataModel")]
142#[inline]
143pub unsafe extern "C-unwind" fn AEInstallEventHandler(
144 the_ae_event_class: AEEventClass,
145 the_ae_event_id: AEEventID,
146 handler: AEEventHandlerUPP,
147 handler_refcon: SRefCon,
148 is_sys_handler: bool,
149) -> OSErr {
150 extern "C-unwind" {
151 fn AEInstallEventHandler(
152 the_ae_event_class: AEEventClass,
153 the_ae_event_id: AEEventID,
154 handler: AEEventHandlerUPP,
155 handler_refcon: SRefCon,
156 is_sys_handler: Boolean,
157 ) -> OSErr;
158 }
159 unsafe {
160 AEInstallEventHandler(
161 the_ae_event_class,
162 the_ae_event_id,
163 handler,
164 handler_refcon,
165 is_sys_handler as _,
166 )
167 }
168}
169
170/// # Safety
171///
172/// `handler` must be implemented correctly.
173#[cfg(feature = "AEDataModel")]
174#[inline]
175pub unsafe extern "C-unwind" fn AERemoveEventHandler(
176 the_ae_event_class: AEEventClass,
177 the_ae_event_id: AEEventID,
178 handler: AEEventHandlerUPP,
179 is_sys_handler: bool,
180) -> OSErr {
181 extern "C-unwind" {
182 fn AERemoveEventHandler(
183 the_ae_event_class: AEEventClass,
184 the_ae_event_id: AEEventID,
185 handler: AEEventHandlerUPP,
186 is_sys_handler: Boolean,
187 ) -> OSErr;
188 }
189 unsafe {
190 AERemoveEventHandler(
191 the_ae_event_class,
192 the_ae_event_id,
193 handler,
194 is_sys_handler as _,
195 )
196 }
197}
198
199/// # Safety
200///
201/// - `handler` must be a valid pointer.
202/// - `handler_refcon` must be a valid pointer.
203#[cfg(feature = "AEDataModel")]
204#[inline]
205pub unsafe extern "C-unwind" fn AEGetEventHandler(
206 the_ae_event_class: AEEventClass,
207 the_ae_event_id: AEEventID,
208 handler: *mut AEEventHandlerUPP,
209 handler_refcon: *mut SRefCon,
210 is_sys_handler: bool,
211) -> OSErr {
212 extern "C-unwind" {
213 fn AEGetEventHandler(
214 the_ae_event_class: AEEventClass,
215 the_ae_event_id: AEEventID,
216 handler: *mut AEEventHandlerUPP,
217 handler_refcon: *mut SRefCon,
218 is_sys_handler: Boolean,
219 ) -> OSErr;
220 }
221 unsafe {
222 AEGetEventHandler(
223 the_ae_event_class,
224 the_ae_event_id,
225 handler,
226 handler_refcon,
227 is_sys_handler as _,
228 )
229 }
230}
231
232/// ************************************************************************
233/// These calls are used to set up and modify special hooks into the
234/// AppleEvent manager.
235/// ************************************************************************
236///
237/// # Safety
238///
239/// `handler` must be implemented correctly.
240#[cfg(feature = "AEDataModel")]
241#[inline]
242pub unsafe extern "C-unwind" fn AEInstallSpecialHandler(
243 function_class: AEKeyword,
244 handler: AEEventHandlerUPP,
245 is_sys_handler: bool,
246) -> OSErr {
247 extern "C-unwind" {
248 fn AEInstallSpecialHandler(
249 function_class: AEKeyword,
250 handler: AEEventHandlerUPP,
251 is_sys_handler: Boolean,
252 ) -> OSErr;
253 }
254 unsafe { AEInstallSpecialHandler(function_class, handler, is_sys_handler as _) }
255}
256
257/// # Safety
258///
259/// `handler` must be implemented correctly.
260#[cfg(feature = "AEDataModel")]
261#[inline]
262pub unsafe extern "C-unwind" fn AERemoveSpecialHandler(
263 function_class: AEKeyword,
264 handler: AEEventHandlerUPP,
265 is_sys_handler: bool,
266) -> OSErr {
267 extern "C-unwind" {
268 fn AERemoveSpecialHandler(
269 function_class: AEKeyword,
270 handler: AEEventHandlerUPP,
271 is_sys_handler: Boolean,
272 ) -> OSErr;
273 }
274 unsafe { AERemoveSpecialHandler(function_class, handler, is_sys_handler as _) }
275}
276
277/// # Safety
278///
279/// `handler` must be a valid pointer.
280#[cfg(feature = "AEDataModel")]
281#[inline]
282pub unsafe extern "C-unwind" fn AEGetSpecialHandler(
283 function_class: AEKeyword,
284 handler: *mut AEEventHandlerUPP,
285 is_sys_handler: bool,
286) -> OSErr {
287 extern "C-unwind" {
288 fn AEGetSpecialHandler(
289 function_class: AEKeyword,
290 handler: *mut AEEventHandlerUPP,
291 is_sys_handler: Boolean,
292 ) -> OSErr;
293 }
294 unsafe { AEGetSpecialHandler(function_class, handler, is_sys_handler as _) }
295}
296
297extern "C-unwind" {
298 /// ************************************************************************
299 /// This call was added in version 1.0.1. If called with the keyword
300 /// keyAERecorderCount ('recr'), the number of recorders that are
301 /// currently active is returned in 'result'
302 /// (available only in vers 1.0.1 and greater).
303 /// ************************************************************************
304 ///
305 /// # Safety
306 ///
307 /// `result` must be a valid pointer.
308 #[cfg(feature = "AEDataModel")]
309 pub fn AEManagerInfo(key_word: AEKeyword, result: *mut c_long) -> OSErr;
310}
311
312extern "C" {
313 /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeremoteprocessurlkey?language=objc)
314 pub static kAERemoteProcessURLKey: Option<&'static CFString>;
315}
316
317extern "C" {
318 /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeremoteprocessnamekey?language=objc)
319 pub static kAERemoteProcessNameKey: Option<&'static CFString>;
320}
321
322extern "C" {
323 /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeremoteprocessuseridkey?language=objc)
324 pub static kAERemoteProcessUserIDKey: Option<&'static CFString>;
325}
326
327extern "C" {
328 /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaeremoteprocessprocessidkey?language=objc)
329 pub static kAERemoteProcessProcessIDKey: Option<&'static CFString>;
330}
331
332/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aeremoteprocessresolvercontext?language=objc)
333#[repr(C, packed(2))]
334#[allow(unpredictable_function_pointer_comparisons)]
335#[derive(Clone, Copy, Debug, PartialEq)]
336pub struct AERemoteProcessResolverContext {
337 pub version: CFIndex,
338 pub info: *mut c_void,
339 pub retain: CFAllocatorRetainCallBack,
340 pub release: CFAllocatorReleaseCallBack,
341 pub copyDescription: CFAllocatorCopyDescriptionCallBack,
342}
343
344#[cfg(feature = "objc2")]
345unsafe impl Encode for AERemoteProcessResolverContext {
346 const ENCODING: Encoding = Encoding::Struct(
347 "AERemoteProcessResolverContext",
348 &[
349 <CFIndex>::ENCODING,
350 <*mut c_void>::ENCODING,
351 <CFAllocatorRetainCallBack>::ENCODING,
352 <CFAllocatorReleaseCallBack>::ENCODING,
353 <CFAllocatorCopyDescriptionCallBack>::ENCODING,
354 ],
355 );
356}
357
358#[cfg(feature = "objc2")]
359unsafe impl RefEncode for AERemoteProcessResolverContext {
360 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
361}
362
363/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aeremoteprocessresolver?language=objc)
364#[repr(C)]
365#[derive(Debug)]
366pub struct AERemoteProcessResolver {
367 inner: [u8; 0],
368 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
369}
370
371#[cfg(feature = "objc2")]
372unsafe impl RefEncode for AERemoteProcessResolver {
373 const ENCODING_REF: Encoding =
374 Encoding::Pointer(&Encoding::Struct("AERemoteProcessResolver", &[]));
375}
376
377/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aeremoteprocessresolverref?language=objc)
378pub type AERemoteProcessResolverRef = *mut AERemoteProcessResolver;
379
380extern "C-unwind" {
381 /// # Safety
382 ///
383 /// - `allocator` might not allow `None`.
384 /// - `url` might not allow `None`.
385 pub fn AECreateRemoteProcessResolver(
386 allocator: Option<&CFAllocator>,
387 url: Option<&CFURL>,
388 ) -> AERemoteProcessResolverRef;
389}
390
391extern "C-unwind" {
392 /// # Safety
393 ///
394 /// `ref` must be a valid pointer.
395 pub fn AEDisposeRemoteProcessResolver(r#ref: AERemoteProcessResolverRef);
396}
397
398impl AERemoteProcessResolver {
399 /// # Safety
400 ///
401 /// - `ref` must be a valid pointer.
402 /// - `out_error` must be a valid pointer.
403 #[doc(alias = "AERemoteProcessResolverGetProcesses")]
404 #[inline]
405 pub unsafe fn processes(
406 r#ref: AERemoteProcessResolverRef,
407 out_error: *mut CFStreamError,
408 ) -> Option<CFRetained<CFArray>> {
409 extern "C-unwind" {
410 fn AERemoteProcessResolverGetProcesses(
411 r#ref: AERemoteProcessResolverRef,
412 out_error: *mut CFStreamError,
413 ) -> Option<NonNull<CFArray>>;
414 }
415 let ret = unsafe { AERemoteProcessResolverGetProcesses(r#ref, out_error) };
416 ret.map(|ret| unsafe { CFRetained::retain(ret) })
417 }
418}
419
420/// [Apple's documentation](https://developer.apple.com/documentation/coreservices/aeremoteprocessresolvercallback?language=objc)
421pub type AERemoteProcessResolverCallback =
422 Option<unsafe extern "C-unwind" fn(AERemoteProcessResolverRef, *mut c_void)>;
423
424impl AERemoteProcessResolver {
425 /// # Safety
426 ///
427 /// - `ref` must be a valid pointer.
428 /// - `run_loop` possibly has additional threading requirements.
429 /// - `run_loop` might not allow `None`.
430 /// - `run_loop_mode` might not allow `None`.
431 /// - `callback` must be implemented correctly.
432 /// - `ctx` must be a valid pointer.
433 #[doc(alias = "AERemoteProcessResolverScheduleWithRunLoop")]
434 #[inline]
435 pub unsafe fn schedule_with_run_loop(
436 r#ref: AERemoteProcessResolverRef,
437 run_loop: Option<&CFRunLoop>,
438 run_loop_mode: Option<&CFString>,
439 callback: AERemoteProcessResolverCallback,
440 ctx: *const AERemoteProcessResolverContext,
441 ) {
442 extern "C-unwind" {
443 fn AERemoteProcessResolverScheduleWithRunLoop(
444 r#ref: AERemoteProcessResolverRef,
445 run_loop: Option<&CFRunLoop>,
446 run_loop_mode: Option<&CFString>,
447 callback: AERemoteProcessResolverCallback,
448 ctx: *const AERemoteProcessResolverContext,
449 );
450 }
451 unsafe {
452 AERemoteProcessResolverScheduleWithRunLoop(
453 r#ref,
454 run_loop,
455 run_loop_mode,
456 callback,
457 ctx,
458 )
459 }
460 }
461}
462
463/// Determines whether the current application is able to send an AppleEvent with the given eventClass and eventID to the application described as targetAddressDesc.
464///
465/// Mac OS 10.14 and later impose additional requirements on applications when they send AppleEvents to other applications in order
466/// to insure that users are aware of and consent to allowing such control or information exchange. Generally this involves
467/// the user being prompted in a secure fashion the first time an application attempts to send an AppleEvent to another application.
468/// If the user consents then this application can send events to the target. If the user does not consent then any future
469/// attempts to send AppleEvents will result in a failure with errAEEventNotPermitted being returned.
470///
471/// Certain AppleEvents are allowed to be sent without prompting the user. Pass typeWildCard for the eventClass and eventID
472/// to determine if every event is allowed to be sent from this application to the target.
473///
474/// Applications can determine, without sending an AppleEvent to a target application, whether they are allowed to send AppleEvents
475/// to the target with this function. If askUserIfNeeded is true, and this application does not yet have permission to send
476/// AppleEvents to the target, then the user will be asked if permission can be granted; if askUserIfNeeded is false and permission
477/// has not been granted, then errAEEventWouldRequireUserConsent will be returned.
478///
479/// The target AEAddressDesc must refer to an already running application.
480///
481///
482/// Thread safe since version 10.14. Do not call this function on your main thread because it may take arbitrarily long
483/// to return if the user needs to be prompted for consent.
484///
485///
486/// Parameter `target`: A pointer to an address descriptor. Before calling AEDeterminePermissionToAutomateTarget, you set the descriptor to identify
487/// the target application for the Apple event. The target address descriptor must refer to a running application. If
488/// the target application is on another machine, then Remote AppleEvents must be enabled on that machine for the user.
489///
490///
491/// Parameter `theAEEventClass`: The event class of the Apple event to determine permission for.
492///
493///
494/// Parameter `theAEEventID`: The event ID of the Apple event to determine permission for.
495///
496///
497/// Parameter `askUserIfNeeded`: a Boolean; if true, and if this application does not yet have permission to send events to the target application, then
498/// prompt the user to obtain permission. If false, do not prompt the user.
499///
500///
501/// Returns: If the current application is permitted to send the given AppleEvent to the target, then noErr will be returned. If the
502/// current application is not permitted to send the event, errAEEventNotPermitted will be returned. If the target application
503/// is not running, then procNotFound will be returned. If askUserIfNeeded is false, and this application is not yet permitted
504/// to send AppleEvents to the target, then errAEEventWouldRequireUserConsent will be returned.
505///
506/// # Safety
507///
508/// `target` must be a valid pointer.
509#[cfg(feature = "AEDataModel")]
510#[inline]
511pub unsafe extern "C-unwind" fn AEDeterminePermissionToAutomateTarget(
512 target: *const AEAddressDesc,
513 the_ae_event_class: AEEventClass,
514 the_ae_event_id: AEEventID,
515 ask_user_if_needed: bool,
516) -> OSStatus {
517 extern "C-unwind" {
518 fn AEDeterminePermissionToAutomateTarget(
519 target: *const AEAddressDesc,
520 the_ae_event_class: AEEventClass,
521 the_ae_event_id: AEEventID,
522 ask_user_if_needed: Boolean,
523 ) -> OSStatus;
524 }
525 unsafe {
526 AEDeterminePermissionToAutomateTarget(
527 target,
528 the_ae_event_class,
529 the_ae_event_id,
530 ask_user_if_needed as _,
531 )
532 }
533}
534
535/// Determining whether this can be sent would require prompting the user, and the AppleEvent was sent with kAEDoNotPromptForPermission
536///
537/// See also [Apple's documentation](https://developer.apple.com/documentation/coreservices/erraeeventwouldrequireuserconsent?language=objc)
538pub const errAEEventWouldRequireUserConsent: c_int = -1744;
539
540/// If set, and the AppleEvent requires user consent, do not prompt and instead return errAEEventWouldRequireUserConsent
541///
542/// See also [Apple's documentation](https://developer.apple.com/documentation/coreservices/kaedonotpromptforuserconsent?language=objc)
543pub const kAEDoNotPromptForUserConsent: c_uint = 0x00020000;
544
545#[deprecated = "renamed to `AERemoteProcessResolver::processes`"]
546#[inline]
547pub unsafe extern "C-unwind" fn AERemoteProcessResolverGetProcesses(
548 r#ref: AERemoteProcessResolverRef,
549 out_error: *mut CFStreamError,
550) -> Option<CFRetained<CFArray>> {
551 extern "C-unwind" {
552 fn AERemoteProcessResolverGetProcesses(
553 r#ref: AERemoteProcessResolverRef,
554 out_error: *mut CFStreamError,
555 ) -> Option<NonNull<CFArray>>;
556 }
557 let ret = unsafe { AERemoteProcessResolverGetProcesses(r#ref, out_error) };
558 ret.map(|ret| unsafe { CFRetained::retain(ret) })
559}
560
561extern "C-unwind" {
562 #[deprecated = "renamed to `AERemoteProcessResolver::schedule_with_run_loop`"]
563 pub fn AERemoteProcessResolverScheduleWithRunLoop(
564 r#ref: AERemoteProcessResolverRef,
565 run_loop: Option<&CFRunLoop>,
566 run_loop_mode: Option<&CFString>,
567 callback: AERemoteProcessResolverCallback,
568 ctx: *const AERemoteProcessResolverContext,
569 );
570}