Function

CFHostGetNames(_:_:)

Gets the names from a CFHost.

Declaration

func CFHostGetNames(_ theHost: CFHost, _ hasBeenResolved: UnsafeMutablePointer<DarwinBoolean>?) -> Unmanaged<CFArray>?

Parameters

theHost

The host to examine. The host must have been previously resolved. (To resolve a host, call CFHostStartInfoResolution(_:_:_:).) This value must not be NULL.

hasBeenResolved

On return, contains TRUE if names were available, otherwise FALSE. This value may be NULL.

Return Value

An array containing the of names of theHost, or NULL if no names were available.

Discussion

This function gets the names in a thread-safe way, but the resulting data is not thread-safe. The data is returned as a “get” as opposed to a copy, so the data is not safe if the CFHost is altered from another thread.

See Also

Hosts

class CFHost

An opaque reference representing an CFHost object.

enum CFHostInfoType

Values indicating the type of data that is to be resolved or the type of data that was resolved.

struct CFHostClientContext

A structure containing user-defined data and callbacks for CFHost objects.

func CFHostCreateWithAddress(CFAllocator?, CFData) -> Unmanaged<CFHost>

Uses an address to create an instance of a host object.

func CFHostCreateWithName(CFAllocator?, CFString) -> Unmanaged<CFHost>

Uses a name to create an instance of a host object.

func CFHostGetTypeID() -> CFTypeID

Gets the Core Foundation type identifier for the CFHost opaque type.

func CFHostSetClient(CFHost, CFHostClientCallBack?, UnsafeMutablePointer<CFHostClientContext>?) -> Bool

Associates a client context and a callback function with a CFHost object or disassociates a client context and callback function that were previously set.