@@ -44,12 +44,11 @@ * @param length The length of the data that has been read * @param exception An exception which occurred while reading or `nil` on * success * @return A bool whether the same block should be used for the next read */ -typedef bool (^of_stream_async_read_block_t)(size_t length, - id _Nullable exception); +typedef bool (^OFStreamAsyncReadBlock)(size_t length, id _Nullable exception); /** * @brief A block which is called when a line was read asynchronously from a * stream. * @@ -57,11 +56,11 @@ * occurred * @param exception An exception which occurred while reading or `nil` on * success * @return A bool whether the same block should be used for the next read */ -typedef bool (^of_stream_async_read_line_block_t)(OFString *_Nullable line, +typedef bool (^OFStreamAsyncReadLineBlock)(OFString *_Nullable line, id _Nullable exception); /** * @brief A block which is called when data was written asynchronously to a * stream. @@ -72,12 +71,12 @@ * asynchronous write if no exception was encountered. * @param exception An exception which occurred while writing or `nil` on * success * @return The data to repeat the write with or nil if it should not repeat */ -typedef OFData *_Nullable (^of_stream_async_write_data_block_t)( - OFData *_Nonnull data, size_t bytesWritten, id _Nullable exception); +typedef OFData *_Nullable (^OFStreamAsyncWriteDataBlock)(OFData *_Nonnull data, + size_t bytesWritten, id _Nullable exception); /** * @brief A block which is called when a string was written asynchronously to a * stream. * @@ -87,11 +86,11 @@ * asynchronous write if no exception was encountered. * @param exception An exception which occurred while writing or `nil` on * success * @return The string to repeat the write with or nil if it should not repeat */ -typedef OFString *_Nullable (^of_stream_async_write_string_block_t)( +typedef OFString *_Nullable (^OFStreamAsyncWriteStringBlock)( OFString *_Nonnull string, size_t bytesWritten, id _Nullable exception); #endif /** * @protocol OFStreamDelegate OFStream.h ObjFW/OFStream.h @@ -380,11 +379,11 @@ * you want the next block in the queue to handle the data * received next, you need to return false from the block. */ - (void)asyncReadIntoBuffer: (void *)buffer length: (size_t)length - block: (of_stream_async_read_block_t)block; + block: (OFStreamAsyncReadBlock)block; /** * @brief Asynchronously reads *at most* ref size bytes from the stream into a * buffer. * @@ -411,11 +410,11 @@ * received next, you need to return false from the block. */ - (void)asyncReadIntoBuffer: (void *)buffer length: (size_t)length runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_stream_async_read_block_t)block; + block: (OFStreamAsyncReadBlock)block; /** * @brief Asynchronously reads exactly the specified length bytes from the * stream into a buffer. * @@ -436,11 +435,11 @@ * you want the next block in the queue to handle the data * received next, you need to return false from the block. */ - (void)asyncReadIntoBuffer: (void *)buffer exactLength: (size_t)length - block: (of_stream_async_read_block_t)block; + block: (OFStreamAsyncReadBlock)block; /** * @brief Asynchronously reads exactly the specified length bytes from the * stream into a buffer. * @@ -463,11 +462,11 @@ * received next, you need to return false from the block. */ - (void)asyncReadIntoBuffer: (void *)buffer exactLength: (size_t)length runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_stream_async_read_block_t)block; + block: (OFStreamAsyncReadBlock)block; # endif #endif /** * @brief Reads a uint8_t from the stream. @@ -858,11 +857,11 @@ * If the block returns true, it will be called again when the next * line has been received. If you want the next block in the queue * to handle the next line, you need to return false from the * block. */ -- (void)asyncReadLineWithBlock: (of_stream_async_read_line_block_t)block; +- (void)asyncReadLineWithBlock: (OFStreamAsyncReadLineBlock)block; /** * @brief Asynchronously reads with the specified encoding until a newline, * `\0`, end of stream or an exception occurs. * @@ -875,11 +874,11 @@ * line has been received. If you want the next block in the queue * to handle the next line, you need to return false from the * block. */ - (void)asyncReadLineWithEncoding: (OFStringEncoding)encoding - block: (of_stream_async_read_line_block_t)block; + block: (OFStreamAsyncReadLineBlock)block; /** * @brief Asynchronously reads with the specified encoding until a newline, * `\0`, end of stream or an exception occurs. * @@ -894,11 +893,11 @@ * to handle the next line, you need to return false from the * block. */ - (void)asyncReadLineWithEncoding: (OFStringEncoding)encoding runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_stream_async_read_line_block_t)block; + block: (OFStreamAsyncReadLineBlock)block; # endif #endif /** * @brief Tries to read a line from the stream (see @ref readLine) and returns @@ -1055,11 +1054,11 @@ * @param block The block to call when the data has been written. It should * return the data for the next write with the same callback or * nil if it should not repeat. */ - (void)asyncWriteData: (OFData *)data - block: (of_stream_async_write_data_block_t)block; + block: (OFStreamAsyncWriteDataBlock)block; /** * @brief Asynchronously writes data into the stream. * * @note The stream must conform to @ref OFReadyForWritingObserving in order @@ -1071,11 +1070,11 @@ * return the data for the next write with the same callback or * nil if it should not repeat. */ - (void)asyncWriteData: (OFData *)data runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_stream_async_write_data_block_t)block; + block: (OFStreamAsyncWriteDataBlock)block; /** * @brief Asynchronously writes a string into the stream. * * @note The stream must conform to @ref OFReadyForWritingObserving in order @@ -1085,11 +1084,11 @@ * @param block The block to call when the string has been written. It should * return the string for the next write with the same callback or * nil if it should not repeat. */ - (void)asyncWriteString: (OFString *)string - block: (of_stream_async_write_string_block_t)block; + block: (OFStreamAsyncWriteStringBlock)block; /** * @brief Asynchronously writes a string in the specified encoding into the * stream. * @@ -1103,11 +1102,11 @@ * return the string for the next write with the same callback or * nil if it should not repeat. */ - (void)asyncWriteString: (OFString *)string encoding: (OFStringEncoding)encoding - block: (of_stream_async_write_string_block_t)block; + block: (OFStreamAsyncWriteStringBlock)block; /** * @brief Asynchronously writes a string in the specified encoding into the * stream. * @@ -1123,11 +1122,11 @@ * nil if it should not repeat. */ - (void)asyncWriteString: (OFString *)string encoding: (OFStringEncoding)encoding runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_stream_async_write_string_block_t)block; + block: (OFStreamAsyncWriteStringBlock)block; # endif #endif /** * @brief Writes a uint8_t into the stream.