1 {
2 File: CFNetwork/CFHost.h
3
4 Contains: CoreFoundation CFHost header
5
6 Copyright: Copyright (c) 2001-2008, Apple Inc. All rights reserved.
7
8 Bugs?: For bug reports, consult the following page on
9 the World Wide Web:
10
11 http://bugs.freepascal.org
12
13 }
14 { Pascal Translation: Peter N Lewis, <peter@stairways.com.au>, 2004 }
15 { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2009 }
16 { Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2012 }
17 { Pascal Translation Updated: Jonas Maebe <jonas@freepascal.org>, August 2015 }
18 {
19 Modified for use with Free Pascal
20 Version 308
21 Please report any bugs to <gpc@microbizz.nl>
22 }
23
24 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
25 {$mode macpas}
26 {$modeswitch cblocks}
27 {$packenum 1}
28 {$macro on}
29 {$inline on}
30 {$calling mwpascal}
31
32 unit CFHost;
33 interface
34 {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
35 {$setc GAP_INTERFACES_VERSION := $0308}
36
37 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
38 {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
39 {$endc}
40
41 {$ifc defined CPUPOWERPC and defined CPUI386}
42 {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
43 {$endc}
44 {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
45 {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
46 {$endc}
47
48 {$ifc not defined __ppc__ and defined CPUPOWERPC32}
49 {$setc __ppc__ := 1}
50 {$elsec}
51 {$setc __ppc__ := 0}
52 {$endc}
53 {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
54 {$setc __ppc64__ := 1}
55 {$elsec}
56 {$setc __ppc64__ := 0}
57 {$endc}
58 {$ifc not defined __i386__ and defined CPUI386}
59 {$setc __i386__ := 1}
60 {$elsec}
61 {$setc __i386__ := 0}
62 {$endc}
63 {$ifc not defined __x86_64__ and defined CPUX86_64}
64 {$setc __x86_64__ := 1}
65 {$elsec}
66 {$setc __x86_64__ := 0}
67 {$endc}
68 {$ifc not defined __arm__ and defined CPUARM}
69 {$setc __arm__ := 1}
70 {$elsec}
71 {$setc __arm__ := 0}
72 {$endc}
73 {$ifc not defined __arm64__ and defined CPUAARCH64}
74 {$setc __arm64__ := 1}
75 {$elsec}
76 {$setc __arm64__ := 0}
77 {$endc}
78
79 {$ifc defined cpu64}
80 {$setc __LP64__ := 1}
81 {$elsec}
82 {$setc __LP64__ := 0}
83 {$endc}
84
85
86 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
87 {$error Conflicting definitions for __ppc__ and __i386__}
88 {$endc}
89
90 {$ifc defined __ppc__ and __ppc__}
91 {$setc TARGET_CPU_PPC := TRUE}
92 {$setc TARGET_CPU_PPC64 := FALSE}
93 {$setc TARGET_CPU_X86 := FALSE}
94 {$setc TARGET_CPU_X86_64 := FALSE}
95 {$setc TARGET_CPU_ARM := FALSE}
96 {$setc TARGET_CPU_ARM64 := FALSE}
97 {$setc TARGET_OS_MAC := TRUE}
98 {$setc TARGET_OS_IPHONE := FALSE}
99 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
100 {$setc TARGET_OS_EMBEDDED := FALSE}
101 {$elifc defined __ppc64__ and __ppc64__}
102 {$setc TARGET_CPU_PPC := FALSE}
103 {$setc TARGET_CPU_PPC64 := TRUE}
104 {$setc TARGET_CPU_X86 := FALSE}
105 {$setc TARGET_CPU_X86_64 := FALSE}
106 {$setc TARGET_CPU_ARM := FALSE}
107 {$setc TARGET_CPU_ARM64 := FALSE}
108 {$setc TARGET_OS_MAC := TRUE}
109 {$setc TARGET_OS_IPHONE := FALSE}
110 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
111 {$setc TARGET_OS_EMBEDDED := FALSE}
112 {$elifc defined __i386__ and __i386__}
113 {$setc TARGET_CPU_PPC := FALSE}
114 {$setc TARGET_CPU_PPC64 := FALSE}
115 {$setc TARGET_CPU_X86 := TRUE}
116 {$setc TARGET_CPU_X86_64 := FALSE}
117 {$setc TARGET_CPU_ARM := FALSE}
118 {$setc TARGET_CPU_ARM64 := FALSE}
119 {$ifc defined iphonesim}
120 {$setc TARGET_OS_MAC := FALSE}
121 {$setc TARGET_OS_IPHONE := TRUE}
122 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
123 {$elsec}
124 {$setc TARGET_OS_MAC := TRUE}
125 {$setc TARGET_OS_IPHONE := FALSE}
126 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
127 {$endc}
128 {$setc TARGET_OS_EMBEDDED := FALSE}
129 {$elifc defined __x86_64__ and __x86_64__}
130 {$setc TARGET_CPU_PPC := FALSE}
131 {$setc TARGET_CPU_PPC64 := FALSE}
132 {$setc TARGET_CPU_X86 := FALSE}
133 {$setc TARGET_CPU_X86_64 := TRUE}
134 {$setc TARGET_CPU_ARM := FALSE}
135 {$setc TARGET_CPU_ARM64 := FALSE}
136 {$ifc defined iphonesim}
137 {$setc TARGET_OS_MAC := FALSE}
138 {$setc TARGET_OS_IPHONE := TRUE}
139 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
140 {$elsec}
141 {$setc TARGET_OS_MAC := TRUE}
142 {$setc TARGET_OS_IPHONE := FALSE}
143 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
144 {$endc}
145 {$setc TARGET_OS_EMBEDDED := FALSE}
146 {$elifc defined __arm__ and __arm__}
147 {$setc TARGET_CPU_PPC := FALSE}
148 {$setc TARGET_CPU_PPC64 := FALSE}
149 {$setc TARGET_CPU_X86 := FALSE}
150 {$setc TARGET_CPU_X86_64 := FALSE}
151 {$setc TARGET_CPU_ARM := TRUE}
152 {$setc TARGET_CPU_ARM64 := FALSE}
153 {$setc TARGET_OS_MAC := FALSE}
154 {$setc TARGET_OS_IPHONE := TRUE}
155 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
156 {$setc TARGET_OS_EMBEDDED := TRUE}
157 {$elifc defined __arm64__ and __arm64__}
158 {$setc TARGET_CPU_PPC := FALSE}
159 {$setc TARGET_CPU_PPC64 := FALSE}
160 {$setc TARGET_CPU_X86 := FALSE}
161 {$setc TARGET_CPU_X86_64 := FALSE}
162 {$setc TARGET_CPU_ARM := FALSE}
163 {$setc TARGET_CPU_ARM64 := TRUE}
164 {$ifc defined ios}
165 {$setc TARGET_OS_MAC := FALSE}
166 {$setc TARGET_OS_IPHONE := TRUE}
167 {$setc TARGET_OS_EMBEDDED := TRUE}
168 {$elsec}
169 {$setc TARGET_OS_MAC := TRUE}
170 {$setc TARGET_OS_IPHONE := FALSE}
171 {$setc TARGET_OS_EMBEDDED := FALSE}
172 {$endc}
173 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
174 {$elsec}
175 {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
176 {$endc}
177
178 {$ifc defined __LP64__ and __LP64__ }
179 {$setc TARGET_CPU_64 := TRUE}
180 {$elsec}
181 {$setc TARGET_CPU_64 := FALSE}
182 {$endc}
183
184 {$ifc defined FPC_BIG_ENDIAN}
185 {$setc TARGET_RT_BIG_ENDIAN := TRUE}
186 {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
187 {$elifc defined FPC_LITTLE_ENDIAN}
188 {$setc TARGET_RT_BIG_ENDIAN := FALSE}
189 {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
190 {$elsec}
191 {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
192 {$endc}
193 {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
194 {$setc CALL_NOT_IN_CARBON := FALSE}
195 {$setc OLDROUTINENAMES := FALSE}
196 {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
197 {$setc OPAQUE_UPP_TYPES := TRUE}
198 {$setc OTCARBONAPPLICATION := TRUE}
199 {$setc OTKERNEL := FALSE}
200 {$setc PM_USE_SESSION_APIS := TRUE}
201 {$setc TARGET_API_MAC_CARBON := TRUE}
202 {$setc TARGET_API_MAC_OS8 := FALSE}
203 {$setc TARGET_API_MAC_OSX := TRUE}
204 {$setc TARGET_CARBON := TRUE}
205 {$setc TARGET_CPU_68K := FALSE}
206 {$setc TARGET_CPU_MIPS := FALSE}
207 {$setc TARGET_CPU_SPARC := FALSE}
208 {$setc TARGET_OS_UNIX := FALSE}
209 {$setc TARGET_OS_WIN32 := FALSE}
210 {$setc TARGET_RT_MAC_68881 := FALSE}
211 {$setc TARGET_RT_MAC_CFM := FALSE}
212 {$setc TARGET_RT_MAC_MACHO := TRUE}
213 {$setc TYPED_FUNCTION_POINTERS := TRUE}
214 {$setc TYPE_BOOL := FALSE}
215 {$setc TYPE_EXTENDED := FALSE}
216 {$setc TYPE_LONGLONG := TRUE}
217 uses MacTypes,CFBase,CFData,CFArray,CFRunLoop,CFStream;
218 {$endc} {not MACOSALLINCLUDE}
219
220 {$ALIGN MAC68K}
221
222 {
223 * CFHostRef
224 *
225 * Discussion:
226 * This is the type of a reference to a host name or address lookup.
227 }
228 type
229 CFHostRef = ^__CFHost; { an opaque type }
230 __CFHost = record end;
231
232 {
233 * kCFStreamErrorDomainNetDB
234 *
235 * Discussion:
236 * Errors listed in netdb.h
237 *
238 * Availability:
239 * Mac OS X: in version 10.3 and later in CoreServices.framework
240 * CarbonLib: not available
241 * Non-Carbon CFM: not available
242 }
243 var kCFStreamErrorDomainNetDB: SInt32; external name '_kCFStreamErrorDomainNetDB'; (* attribute const *)
244 (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
245
246
247 {
248 * kCFStreamErrorDomainSystemConfiguration
249 *
250 * Discussion:
251 * Errors listed in SystemConfiguration/SystemConfiguration.h
252 *
253 * Availability:
254 * Mac OS X: in version 10.3 and later in CoreServices.framework
255 * CarbonLib: not available
256 * Non-Carbon CFM: not available
257 }
258 var kCFStreamErrorDomainSystemConfiguration: SInt32; external name '_kCFStreamErrorDomainSystemConfiguration'; (* attribute const *)
259 (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
260
261
262 {
263 * CFHostInfoType
264 *
265 * Discussion:
266 * Host information types to be resolved.
267 }
268 type
269 CFHostInfoType = SInt32;
270 const
271 {
272 * Results value is a CFArray of CFData's (each being a struct
273 * sockaddr)
274 }
275 kCFHostAddresses = 0;
276
277 {
278 * Results value is a CFArray of CFString's
279 }
280 kCFHostNames = 1;
281
282 {
283 * Results value is a CFData wrapping SCNetworkConnectionFlags
284 * (defined in SystemConfiguration/SCNetwork.h)
285 }
286 kCFHostReachability = 2;
287
288
289 {
290 * CFHostClientContext
291 *
292 * Discussion:
293 * Structure containing the user-defined data and callbacks for
294 * CFHost objects.
295 }
296 type
297 CFHostClientContext = record
298 {
299 * The version number of the structure type being passed in as a
300 * parameter to the CFHost client function. Valid version number is
301 * currently 0.
302 }
303 version: CFIndex;
304
305 {
306 * An arbitrary pointer to client-defined data, which can be
307 * associated with the host and is passed to the callbacks.
308 }
309 info: UnivPtr;
310
311 {
312 * The callback used to add a retain for the host on the info pointer
313 * for the life of the host, and may be used for temporary references
314 * the host needs to take. This callback returns the actual info
315 * pointer to store in the host, almost always just the pointer
316 * passed as the parameter.
317 }
318 retain: CFAllocatorRetainCallBack;
319
320 {
321 * The callback used to remove a retain previously added for the host
322 * on the info pointer.
323 }
324 release: CFAllocatorReleaseCallBack;
325
326 {
327 * The callback used to create a descriptive string representation of
328 * the info pointer (or the data pointed to by the info pointer) for
329 * debugging purposes. This is used by the CFCopyDescription()
330 * function.
331 }
332 copyDescription: CFAllocatorCopyDescriptionCallBack;
333 end;
334 CFHostClientContextPtr = ^CFHostClientContext;
335
336 {
337 * CFHostClientCallBack
338 *
339 * Discussion:
340 * Callback function which is called upon error or completion of an
341 * asynchronous resolve.
342 *
343 * Parameters:
344 *
345 * theHost:
346 * Host whose resolution is complete.
347 *
348 * typeInfo:
349 * Enum representing which info resolution is complete.
350 *
351 * error:
352 * Reference to an error structure if the resolution failed.
353 *
354 * info:
355 * Client's info reference which was passed into the client
356 * context.
357 }
358 type
359 CFHostClientCallBack = procedure( theHost: CFHostRef; typeInfo: CFHostInfoType; const (*var*) error: CFStreamError; info: UnivPtr );
360
361
362 {
363 * CFHostGetTypeID()
364 *
365 * Discussion:
366 * Returns the type identifier of all CFHost instances.
367 *
368 * Mac OS X threading:
369 * Thread safe
370 *
371 * Availability:
372 * Mac OS X: in version 10.3 and later in CoreServices.framework
373 * CarbonLib: not available
374 * Non-Carbon CFM: not available
375 }
CFHostGetTypeIDnull376 function CFHostGetTypeID: CFTypeID; external name '_CFHostGetTypeID';
377 (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
378
379
380 {
381 * CFHostCreateWithName()
382 *
383 * Discussion:
384 * Creates a new host object with the given name.
385 *
386 * Mac OS X threading:
387 * Thread safe
388 *
389 * Parameters:
390 *
391 * allocator:
392 * The CFAllocator which should be used to allocate memory for the
393 * host. If this reference is not a valid CFAllocator, the
394 * behavior is undefined.
395 *
396 * hostname:
397 * A CFStringRef representing the name of the host. Must be
398 * non-NULL. If this reference is not a valid CFStringRef, the
399 * behavior is undefined.
400 *
401 * Result:
402 * A valid CFHostRef which may now be resolved, or NULL if
403 * unsuccessful.
404 *
405 * Availability:
406 * Mac OS X: in version 10.3 and later in CoreServices.framework
407 * CarbonLib: not available
408 * Non-Carbon CFM: not available
409 }
CFHostCreateWithNamenull410 function CFHostCreateWithName( allocator: CFAllocatorRef; hostname: CFStringRef ): CFHostRef; external name '_CFHostCreateWithName';
411 (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
412
413
414 {
415 * CFHostCreateWithAddress()
416 *
417 * Discussion:
418 * Creates a new host object with the given address.
419 *
420 * Mac OS X threading:
421 * Thread safe
422 *
423 * Parameters:
424 *
425 * allocator:
426 * The CFAllocator which should be used to allocate memory for the
427 * host. If this reference is not a valid CFAllocator, the
428 * behavior is undefined.
429 *
430 * addr:
431 * A CFDataRef containing a struct sockaddr which is the address
432 * of the host. Must be non-NULL. If this reference is not a
433 * valid CFDataRef, the behavior is undefined.
434 *
435 * Result:
436 * A valid CFHostRef which may now be resolved, or NULL if
437 * unsuccessful.
438 *
439 * Availability:
440 * Mac OS X: in version 10.3 and later in CoreServices.framework
441 * CarbonLib: not available
442 * Non-Carbon CFM: not available
443 }
CFHostCreateWithAddressnull444 function CFHostCreateWithAddress( allocator: CFAllocatorRef; addr: CFDataRef ): CFHostRef; external name '_CFHostCreateWithAddress';
445 (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
446
447
448 {
449 * CFHostCreateCopy()
450 *
451 * Discussion:
452 * Creates a new host object as a copy of host argument.
453 *
454 * Mac OS X threading:
455 * Thread safe
456 *
457 * Parameters:
458 *
459 * alloc:
460 * The CFAllocator which should be used to allocate memory for the
461 * new host. If this reference is not a valid CFAllocator, the
462 * behavior is undefined.
463 *
464 * host:
465 * A CFHostRef representing the original host. Must be non-NULL.
466 * If this reference is not a valid CFHostRef, the behavior is
467 * undefined.
468 *
469 * Result:
470 * A valid CFHostRef which contains a copy of all previously
471 * resolved data from the original. NULL is returned in the case of
472 * failure.
473 *
474 * Availability:
475 * Mac OS X: in version 10.3 and later in CoreServices.framework
476 * CarbonLib: not available
477 * Non-Carbon CFM: not available
478 }
CFHostCreateCopynull479 function CFHostCreateCopy( alloc: CFAllocatorRef; host: CFHostRef ): CFHostRef; external name '_CFHostCreateCopy';
480 (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
481
482
483 {
484 * CFHostStartInfoResolution()
485 *
486 * Discussion:
487 * Performs a lookup for the given host. It will search for the
488 * requested information if there is no other active request.
489 * Previously cached information of the given type will be released.
490 *
491 * Mac OS X threading:
492 * Thread safe
493 *
494 * Parameters:
495 *
496 * theHost:
497 * The CFHostRef which should be resolved. Must be non-NULL. If
498 * this reference is not a valid CFHostRef, the behavior is
499 * undefined.
500 *
501 * info:
502 * The enum representing the type of information to be retrieved.
503 * If the value is not a valid type, the behavior is undefined.
504 *
505 * error:
506 * A reference to a CFStreamError structure which will be filled
507 * with any error information should an error occur. May be set
508 * to NULL if error information is not wanted.
509 *
510 * Result:
511 * Returns TRUE on success and FALSE on failure. In asynchronous
512 * mode, this function will return immediately. In synchronous
513 * mode, it will block until the resolve has completed or until the
514 * resolve is cancelled.
515 *
516 * Availability:
517 * Mac OS X: in version 10.3 and later in CoreServices.framework
518 * CarbonLib: not available
519 * Non-Carbon CFM: not available
520 }
CFHostStartInfoResolutionnull521 function CFHostStartInfoResolution( theHost: CFHostRef; info: CFHostInfoType; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFHostStartInfoResolution';
522 (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
523
524
525 {
526 * CFHostGetAddressing()
527 *
528 * Discussion:
529 * Tries to retrieve the known addresses from the given host.
530 * Returns a CFArrayRef of addresses if known and there were some.
531 * NULL is returned otherwise. Each address is a CFDataRef wrapping
532 * a struct sockaddr.
533 *
534 * Mac OS X threading:
535 * Thread safe
536 * The function gets the data in a thread-safe manner, but the
537 * resulting data is not safe. Since it is returned as a matter of
538 * a get opposed to a copy, the data is not safe if the host is
539 * being altered from another thread.
540 *
541 * Parameters:
542 *
543 * theHost:
544 * The CFHostRef which contains the relevant information. Must be
545 * non-NULL. If this reference is not a valid CFHostRef, the
546 * behavior is undefined.
547 *
548 * hasBeenResolved:
549 * A reference to a Boolean which returns FALSE if the information
550 * was not available (e.g. CFHostStartInfoResolution has not been
551 * called), otherwise TRUE will be returned.
552 *
553 * Availability:
554 * Mac OS X: in version 10.3 and later in CoreServices.framework
555 * CarbonLib: not available
556 * Non-Carbon CFM: not available
557 }
CFHostGetAddressingnull558 function CFHostGetAddressing( theHost: CFHostRef; hasBeenResolved: BooleanPtr { can be NULL } ): CFArrayRef; external name '_CFHostGetAddressing';
559 (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
560
561
562 {
563 * CFHostGetNames()
564 *
565 * Discussion:
566 * Tries to retrieve the names/aliases from the given host. Returns
567 * a CFArrayRef of names for the given host. NULL is returned
568 * otherwise.
569 *
570 * Mac OS X threading:
571 * Thread safe
572 * The function gets the data in a thread-safe manner, but the
573 * resulting data is not safe. Since it is returned as a matter of
574 * a get opposed to a copy, the data is not safe if the host is
575 * being altered from another thread.
576 *
577 * Parameters:
578 *
579 * theHost:
580 * The CFHostRef which contains the relevant information. Must be
581 * non-NULL. If this reference is not a valid CFHostRef, the
582 * behavior is undefined.
583 *
584 * hasBeenResolved:
585 * A reference to a Boolean which returns FALSE if the information
586 * was not available (e.g. CFHostStartInfoResolution has not been
587 * called), otherwise TRUE will be returned.
588 *
589 * Availability:
590 * Mac OS X: in version 10.3 and later in CoreServices.framework
591 * CarbonLib: not available
592 * Non-Carbon CFM: not available
593 }
CFHostGetNamesnull594 function CFHostGetNames( theHost: CFHostRef; hasBeenResolved: BooleanPtr { can be NULL } ): CFArrayRef; external name '_CFHostGetNames';
595 (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
596
597
598 {
599 * CFHostGetReachability()
600 *
601 * Discussion:
602 * Tries to retrieve the reachability of the given host. Returns a
603 * CFDataRef which wraps the reachability flags. NULL will be
604 * returned if the value has not been resolved. The possible values
605 * of these flags is declared in SystemConfiguration/SCNetwork.h.
606 * Returns FALSE if the information was not available, otherwise
607 * TRUE will be returned with the results containing the requested
608 * information.
609 *
610 * Mac OS X threading:
611 * Thread safe
612 * The function gets the data in a thread-safe manner, but the
613 * resulting data is not safe. Since it is returned as a matter of
614 * a get opposed to a copy, the data is not safe if the host is
615 * being altered from another thread.
616 *
617 * Parameters:
618 *
619 * theHost:
620 * The CFHostRef which contains the relevant information. Must be
621 * non-NULL. If this reference is not a valid CFHostRef, the
622 * behavior is undefined.
623 *
624 * hasBeenResolved:
625 * A reference to a Boolean which returns FALSE if the information
626 * was not available (e.g. CFHostStartInfoResolution has not been
627 * called), otherwise TRUE will be returned.
628 *
629 * Availability:
630 * Mac OS X: in version 10.3 and later in CoreServices.framework
631 * CarbonLib: not available
632 * Non-Carbon CFM: not available
633 }
CFHostGetReachabilitynull634 function CFHostGetReachability( theHost: CFHostRef; hasBeenResolved: BooleanPtr { can be NULL } ): CFDataRef; external name '_CFHostGetReachability';
635 (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
636
637
638 {
639 * CFHostCancelInfoResolution()
640 *
641 * Discussion:
642 * Cancels an outstanding asynchronous or synchronous resolve.
643 *
644 * Mac OS X threading:
645 * Thread safe
646 *
647 * Parameters:
648 *
649 * theHost:
650 * The CFHostRef which is currently resolving. Must be non-NULL.
651 * If this reference is not a valid CFHostRef, the behavior is
652 * undefined.
653 *
654 * info:
655 * The enum representing which resolution to be canceled. If the
656 * value is not a valid type, the behavior is undefined.
657 *
658 * Availability:
659 * Mac OS X: in version 10.3 and later in CoreServices.framework
660 * CarbonLib: not available
661 * Non-Carbon CFM: not available
662 }
663 procedure CFHostCancelInfoResolution( theHost: CFHostRef; info: CFHostInfoType ); external name '_CFHostCancelInfoResolution';
664 (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
665
666
667 {
668 * CFHostSetClient()
669 *
670 * Discussion:
671 * Associates a client context and callback function with a
672 * CFHostRef. This is required for asynchronous usage. If not set,
673 * resolve will take place synchronously.
674 *
675 * Mac OS X threading:
676 * Thread safe
677 *
678 * Parameters:
679 *
680 * theHost:
681 * The CFHostRef which is getting a client. Must be non-NULL. If
682 * this reference is not a valid CFHostRef, the behavior is
683 * undefined.
684 *
685 * clientCB:
686 * A CFHostClientCallBack which will be called when the resolve
687 * completes or is cancelled. Use NULL to remove the client
688 * association with a host object.
689 *
690 * clientContext:
691 * A CFHostClientContext which is used to set the contextual
692 * information associated with the host object. The info pointer
693 * from the struct will be passed to the callback function. If
694 * setting a client, this value must be non-NULL.
695 *
696 * Result:
697 * Returns TRUE if the procedure was a success, otherwise it returns
698 * FALSE.
699 *
700 * Availability:
701 * Mac OS X: in version 10.3 and later in CoreServices.framework
702 * CarbonLib: not available
703 * Non-Carbon CFM: not available
704 }
CFHostSetClientnull705 function CFHostSetClient( theHost: CFHostRef; clientCB: CFHostClientCallBack { can be NULL }; clientContext: CFHostClientContextPtr { can be NULL } ): Boolean; external name '_CFHostSetClient';
706 (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
707
708
709 {
710 * CFHostScheduleWithRunLoop()
711 *
712 * Discussion:
713 * Schedules the given host on a run loop and mode so the client
714 * will receive its callbacks on that loop and mode.
715 *
716 * Mac OS X threading:
717 * Thread safe
718 *
719 * Parameters:
720 *
721 * theHost:
722 * The CFHostRef which is being scheduled. Must be non-NULL. If
723 * this reference is not a valid CFHostRef, the behavior is
724 * undefined.
725 *
726 * runLoop:
727 * A CFRunLoopRef on which the host should be scheduled. Must be
728 * non-NULL. If this reference is not a valid CFRunLoopRef, the
729 * behavior is undefined.
730 *
731 * runLoopMode:
732 * A CFStringRef which is the mode in which the run loop will be
733 * running when notification occurs. Must be non-NULL. If this
734 * reference is not a valid CFStringRef, the behavior is undefined.
735 *
736 * Availability:
737 * Mac OS X: in version 10.3 and later in CoreServices.framework
738 * CarbonLib: not available
739 * Non-Carbon CFM: not available
740 }
741 procedure CFHostScheduleWithRunLoop( theHost: CFHostRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFHostScheduleWithRunLoop';
742 (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
743
744
745 {
746 * CFHostUnscheduleFromRunLoop()
747 *
748 * Discussion:
749 * Unschedules the given host from a run loop and mode so the client
750 * will not receive its callbacks on that loop and mode.
751 *
752 * Mac OS X threading:
753 * Thread safe
754 *
755 * Parameters:
756 *
757 * theHost:
758 * The CFHostRef which is being unscheduled. Must be non-NULL. If
759 * this reference is not a valid CFHostRef, the behavior is
760 * undefined.
761 *
762 * runLoop:
763 * A CFRunLoopRef on which the host is scheduled and should now be
764 * unscheduled. Must be non-NULL. If this reference is not a
765 * valid CFRunLoopRef, the behavior is undefined.
766 *
767 * runLoopMode:
768 * A CFStringRef which is the mode in which the host is scheduled
769 * and should be unscheduled. Must be non-NULL. If this reference
770 * is not a valid CFStringRef, the behavior is undefined.
771 *
772 * Availability:
773 * Mac OS X: in version 10.3 and later in CoreServices.framework
774 * CarbonLib: not available
775 * Non-Carbon CFM: not available
776 }
777 procedure CFHostUnscheduleFromRunLoop( theHost: CFHostRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ); external name '_CFHostUnscheduleFromRunLoop';
778 (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
779
780
781 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
782
783 end.
784 {$endc} {not MACOSALLINCLUDE}
785