#include <dispatch/base.h> // for HeaderDoc
#endif
+DISPATCH_ASSUME_NONNULL_BEGIN
+
__BEGIN_DECLS
/*!
* the handler function.
* @param handler The handler to enqueue when data is ready to be
* delivered.
- * @param context Application-defined context parameter.
- * @param data The data read from the file descriptor.
- * @param error An errno condition for the read operation or
+ * param context Application-defined context parameter.
+ * param data The data read from the file descriptor.
+ * param error An errno condition for the read operation or
* zero if the read was successful.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0)
dispatch_read_f(dispatch_fd_t fd,
size_t length,
dispatch_queue_t queue,
- void *context,
- void (*handler)(void *context, dispatch_data_t data, int error));
+ void *_Nullable context,
+ void (*handler)(void *_Nullable context, dispatch_data_t data, int error));
/*!
* @function dispatch_write_f
* @param context The application-defined context parameter to pass to
* the handler function.
* @param handler The handler to enqueue when the data has been written.
- * @param context Application-defined context parameter.
- * @param data The data that could not be written to the I/O
+ * param context Application-defined context parameter.
+ * param data The data that could not be written to the I/O
* channel, or NULL.
- * @param error An errno condition for the write operation or
+ * param error An errno condition for the write operation or
* zero if the write was successful.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0)
dispatch_write_f(dispatch_fd_t fd,
dispatch_data_t data,
dispatch_queue_t queue,
- void *context,
- void (*handler)(void *context, dispatch_data_t data, int error));
+ void *_Nullable context,
+ void (*handler)(void *_Nullable context, dispatch_data_t _Nullable data,
+ int error));
/*!
* @function dispatch_io_create_f
* the cleanup handler function.
* @param cleanup_handler The handler to enqueue when the system
* relinquishes control over the file descriptor.
- * @param context Application-defined context parameter.
- * @param error An errno condition if control is relinquished
+ * param context Application-defined context parameter.
+ * param error An errno condition if control is relinquished
* because channel creation failed, zero otherwise.
* @result The newly created dispatch I/O channel or NULL if an error
* occurred (invalid type specified).
dispatch_io_create_f(dispatch_io_type_t type,
dispatch_fd_t fd,
dispatch_queue_t queue,
- void *context,
- void (*cleanup_handler)(void *context, int error));
+ void *_Nullable context,
+ void (*cleanup_handler)(void *_Nullable context, int error));
/*!
* @function dispatch_io_create_with_path_f
* the cleanup handler function.
* @param cleanup_handler The handler to enqueue when the system
* has closed the file at path.
- * @param context Application-defined context parameter.
- * @param error An errno condition if control is relinquished
+ * param context Application-defined context parameter.
+ * param error An errno condition if control is relinquished
* because channel creation or opening of the
* specified file failed, zero otherwise.
* @result The newly created dispatch I/O channel or NULL if an error
dispatch_io_create_with_path_f(dispatch_io_type_t type,
const char *path, int oflag, mode_t mode,
dispatch_queue_t queue,
- void *context,
- void (*cleanup_handler)(void *context, int error));
+ void *_Nullable context,
+ void (*cleanup_handler)(void *_Nullable context, int error));
/*!
* @function dispatch_io_create_with_io_f
* relinquishes control over the file descriptor
* (resp. closes the file at path) associated with
* the existing channel.
- * @param context Application-defined context parameter.
- * @param error An errno condition if control is relinquished
+ * param context Application-defined context parameter.
+ * param error An errno condition if control is relinquished
* because channel creation failed, zero otherwise.
* @result The newly created dispatch I/O channel or NULL if an error
* occurred (invalid type specified).
dispatch_io_create_with_io_f(dispatch_io_type_t type,
dispatch_io_t io,
dispatch_queue_t queue,
- void *context,
- void (*cleanup_handler)(void *context, int error));
+ void *_Nullable context,
+ void (*cleanup_handler)(void *_Nullable context, int error));
/*!
* @typedef dispatch_io_handler_function_t
* @param data The data object to be handled.
* @param error An errno condition for the operation.
*/
-typedef void (*dispatch_io_handler_function_t)(void *context, bool done,
- dispatch_data_t data, int error);
+typedef void (*dispatch_io_handler_function_t)(void *_Nullable context,
+ bool done, dispatch_data_t _Nullable data, int error);
/*!
* @function dispatch_io_read_f
* the handler function.
* @param io_handler The I/O handler to enqueue when data is ready to be
* delivered.
- * @param context Application-defined context parameter.
- * @param done A flag indicating whether the operation is complete.
- * @param data An object with the data most recently read from the
+ * param context Application-defined context parameter.
+ * param done A flag indicating whether the operation is complete.
+ * param data An object with the data most recently read from the
* I/O channel as part of this read operation, or NULL.
- * @param error An errno condition for the read operation or zero if
+ * param error An errno condition for the read operation or zero if
* the read was successful.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0)
off_t offset,
size_t length,
dispatch_queue_t queue,
- void *context,
+ void *_Nullable context,
dispatch_io_handler_function_t io_handler);
/*!
* @param context The application-defined context parameter to pass to
* the handler function.
* @param io_handler The I/O handler to enqueue when data has been delivered.
- * @param context Application-defined context parameter.
- * @param done A flag indicating whether the operation is complete.
- * @param data An object of the data remaining to be
+ * param context Application-defined context parameter.
+ * param done A flag indicating whether the operation is complete.
+ * param data An object of the data remaining to be
* written to the I/O channel as part of this write
* operation, or NULL.
- * @param error An errno condition for the write operation or zero
+ * param error An errno condition for the write operation or zero
* if the write was successful.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0)
off_t offset,
dispatch_data_t data,
dispatch_queue_t queue,
- void *context,
+ void *_Nullable context,
dispatch_io_handler_function_t io_handler);
/*!
DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
void
dispatch_io_barrier_f(dispatch_io_t channel,
- void *context,
+ void *_Nullable context,
dispatch_function_t barrier);
__END_DECLS
+DISPATCH_ASSUME_NONNULL_END
+
#endif /* __DISPATCH_IO_PRIVATE__ */