IOStreamLib.h

IOCFPlugin library for using IOStream objects.

Overview

The IOStream plugin provides a convenient set of functions for accessing and manipulating IOStream objects from user programs.

Included Headers

  • <sys/cdefs.h>

  • <IOKit/IOKitLib.h>

  • <IOKit/IOCFPlugIn.h>

  • <CoreFoundation/CoreFoundation.h>

  • <IOKit/stream/IOStreamShared.h>

Topics

Run loop operations

AddToRunLoop

Add the CFRunLoopSource for the notification port to a run loop.

GetRunLoopSource

Gets a CFRunLoopSource for the CFMachPort used for notifications from the kernel that data is ready.

RemoveFromRunLoop

Remove the CFRunLoopSource for the notification port from a run loop.

Opening and closing streams

Close

Closes an IOStream.

Open

Open an IOStream from user space.

Notifications

SendInputNotification

Send a notification to the kernel side of the IOStream that data is available in the input queue.

SendInputSyncNotification

Notify the kernel side of the stream that input is ready by using a fast trap to call directly into the stream user client driver. This will transfer control to the kernel and continue executing on your same thread, rather than sending the notification to a separate thread.

Input and output

GetInputPort

Get the notification port for buffers moving in from user to kernel space.

GetInputQueue

Get the shared memory queue for buffers moving in from user to kernel space.

GetOutputPort

Get the notification port for buffers moving out from kernel to user space.

GetOutputQueue

Get the shared memory queue for buffers moving out from kernel to user space.

SetOutputCallback

Set the callback function to be called when a new buffer is available from the kernel.

Buffer operations on streams

DequeueOutputEntry

Get the next IOStreamBufferQueueEntry available from the output queue.

EnqueueInputBuffer

Send a buffer to the kernel side of the IOStream on the input queue.

Buffer information

GetBufferCount

Gets the number of buffers in the stream.

GetBufferInfo

Gets information about a buffer in an IOStream.

Buffer convenience functions

GetControlBuffer

Get a pointer to the control area of an IOStreamBuffer.

GetControlBufferLength

Get the length of the control area of an IOStreamBuffer.

GetDataBuffer

Get a pointer to the data area of an IOStreamBuffer.

GetDataBufferLength

Get the length of the data area of an IOStreamBuffer.

Callbacks

See the Overview for header-level documentation.

Data Types

See the Overview for header-level documentation.