---
title: "CFRunLoopSourceGetContext(_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfrunloopsourcegetcontext(_:_:)"
---

# CFRunLoopSourceGetContext(_:_:)

Returns the context information for a CFRunLoopSource object.

## Declaration

```swift
func CFRunLoopSourceGetContext(_ source: CFRunLoopSource!, _ context: UnsafeMutablePointer<CFRunLoopSourceContext>!)
```

## Parameters

- `source`: The run loop source to examine.
- `context`: A pointer to the structure into which the context information for source is to be copied. The information being returned is the same information passed to doc://com.apple.corefoundation/documentation/CoreFoundation/CFRunLoopSourceCreate(_:_:_:) when creating source.

## Discussion

Discussion Run loop sources come in two versions with different-sized context structures. context must point to the correct version of the structure for source. Before calling this function, you need to initialize the version member of context with the version number (either 0 or 1) of source.

## See Also

### CFRunLoopSource Miscellaneous Functions

- [CFRunLoopSourceCreate(_:_:_:)](corefoundation/cfrunloopsourcecreate(_:_:_:).md)
- [CFRunLoopSourceGetOrder(_:)](corefoundation/cfrunloopsourcegetorder(_:).md)
- [CFRunLoopSourceGetTypeID()](corefoundation/cfrunloopsourcegettypeid().md)
- [CFRunLoopSourceInvalidate(_:)](corefoundation/cfrunloopsourceinvalidate(_:).md)
- [CFRunLoopSourceIsValid(_:)](corefoundation/cfrunloopsourceisvalid(_:).md)
- [CFRunLoopSourceSignal(_:)](corefoundation/cfrunloopsourcesignal(_:).md)
