CFRunLoopMachPerformCallBack

Callback invoked to process and optionally reply to a message received on a version 1 CFRunLoopSource object (Mach port-based sources).

Declaration

typedef void *(*CFRunLoopMachPerformCallBack) (
   void *msg,
   CFIndex size,
   CFAllocatorRef allocator,
   void *info
);

Parameters

msg

The Mach message received on the Mach port. The pointer is to a mach_msg_header_t structure. A version 0 format trailer (mach_msg_format_0_trailer_t) is at the end of the Mach message.

size

Size of the Mach message in msg, excluding the message trailer.

allocator

The allocator object that should be used to allocate a reply message.

info

The info member of the CFRunLoopSourceContext1 structure that was used when creating the run loop source.

Return Value

An optional Mach message to be sent in response to the received message. The message must be allocated using allocator. Return NULL if you want an empty reply returned to the sender.

Overview

You only need to provide this callback if you create your own version 1 run loop source. CFMachPort and CFMessagePort run loop sources already implement this callback to forward the received message to the CFMachPort’s or CFMessagePort’s own callback function, which you do need to implement.

You specify this callback in the CFRunLoopSourceContext1 structure when creating the run loop source.

See Also

Callbacks

CFRunLoopCancelCallBack

Callback invoked when a version 0 CFRunLoopSource object is removed from a run loop mode.

CFRunLoopEqualCallBack

Callback invoked to test two CFRunLoopSource objects for equality.

CFRunLoopGetPortCallBack

Callback invoked to obtain the native Mach port represented by a version 1 CFRunLoopSource object.

CFRunLoopHashCallBack

Callback invoked to compute a hash code for the info pointer of a CFRunLoopSource object.

CFRunLoopPerformCallBack

Callback invoked when a message is received on a version 0 CFRunLoopSource object.

CFRunLoopScheduleCallBack

Callback invoked when a version 0 CFRunLoopSource object is added to a run loop mode.