Index: src/OFConstantString.m ================================================================== --- src/OFConstantString.m +++ src/OFConstantString.m @@ -596,12 +596,12 @@ [self finishInitialization]; [self writeToURL: URL encoding: encoding]; } #ifdef OF_HAVE_BLOCKS -- (void)enumerateLinesUsingBlock: (of_string_line_enumeration_block_t)block +- (void)enumerateLinesUsingBlock: (OFStringLineEnumerationBlock)block { [self finishInitialization]; [self enumerateLinesUsingBlock: block]; } #endif @end Index: src/OFCountedMapTableSet.m ================================================================== --- src/OFCountedMapTableSet.m +++ src/OFCountedMapTableSet.m @@ -167,12 +167,11 @@ { return (size_t)(uintptr_t)[_mapTable objectForKey: object]; } #ifdef OF_HAVE_BLOCKS -- (void)enumerateObjectsAndCountUsingBlock: - (of_counted_set_enumeration_block_t)block +- (void)enumerateObjectsAndCountUsingBlock: (OFCountedSetEnumerationBlock)block { @try { [_mapTable enumerateKeysAndObjectsUsingBlock: ^ (void *key, void *object, bool *stop) { block(key, (size_t)(uintptr_t)object, stop); Index: src/OFCountedSet.h ================================================================== --- src/OFCountedSet.h +++ src/OFCountedSet.h @@ -26,11 +26,11 @@ * @param object The current object * @param count The count of the object * @param stop A pointer to a variable that can be set to true to stop the * enumeration */ -typedef void (^of_counted_set_enumeration_block_t)(id object, size_t count, +typedef void (^OFCountedSetEnumerationBlock)(id object, size_t count, bool *stop); #endif /** * @class OFCountedSet OFCountedSet.h ObjFW/OFCountedSet.h @@ -57,14 +57,13 @@ /** * @brief Executes a block for each object in the set. * * @param block The block to execute for each object in the set */ -- (void)enumerateObjectsAndCountUsingBlock: - (of_counted_set_enumeration_block_t)block; +- (void)enumerateObjectsAndCountUsingBlock: (OFCountedSetEnumerationBlock)block; #endif #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # undef ObjectType #endif @end OF_ASSUME_NONNULL_END Index: src/OFCountedSet.m ================================================================== --- src/OFCountedSet.m +++ src/OFCountedSet.m @@ -212,12 +212,11 @@ return [element autorelease]; } #ifdef OF_HAVE_BLOCKS -- (void)enumerateObjectsAndCountUsingBlock: - (of_counted_set_enumeration_block_t)block +- (void)enumerateObjectsAndCountUsingBlock: (OFCountedSetEnumerationBlock)block { [self enumerateObjectsUsingBlock: ^ (id object, bool *stop) { block(object, [self countForObject: object], stop); }]; } Index: src/OFDatagramSocket.h ================================================================== --- src/OFDatagramSocket.h +++ src/OFDatagramSocket.h @@ -34,13 +34,12 @@ * @param sender The address of the sender of the packet * @param exception An exception which occurred while receiving or `nil` on * success * @return A bool whether the same block should be used for the next receive */ -typedef bool (^of_datagram_socket_async_receive_block_t)( - size_t length, const of_socket_address_t *_Nonnull sender, - id _Nullable exception); +typedef bool (^OFDatagramSocketAsyncReceiveBlock)(size_t length, + const of_socket_address_t *_Nonnull sender, id _Nullable exception); /** * @brief A block which is called when a packet has been sent. * * @param data The data which was sent @@ -47,11 +46,11 @@ * @param receiver The receiver for the packet * @param exception An exception which occurred while reading or `nil` on * success * @return The data to repeat the send with or nil if it should not repeat */ -typedef OFData *_Nullable (^of_datagram_socket_async_send_data_block_t)( +typedef OFData *_Nullable (^OFDatagramSocketAsyncSendDataBlock)( OFData *_Nonnull data, const of_socket_address_t *_Nonnull receiver, id _Nullable exception); #endif /** @@ -202,11 +201,11 @@ * the datagram received next, you need to return false from the * method. */ - (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length - block: (of_datagram_socket_async_receive_block_t)block; + block: (OFDatagramSocketAsyncReceiveBlock)block; /** * @brief Asynchronously receives a datagram and stores it into the specified * buffer. * @@ -223,11 +222,11 @@ * method. */ - (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_datagram_socket_async_receive_block_t)block; + block: (OFDatagramSocketAsyncReceiveBlock)block; #endif /** * @brief Sends the specified datagram to the specified address. * @@ -273,11 +272,11 @@ * return the data for the next send with the same callback or nil * if it should not repeat. */ - (void)asyncSendData: (OFData *)data receiver: (const of_socket_address_t *)receiver - block: (of_datagram_socket_async_send_data_block_t)block; + block: (OFDatagramSocketAsyncSendDataBlock)block; /** * @brief Asynchronously sends the specified datagram to the specified address. * * @param data The data to send as a datagram @@ -289,11 +288,11 @@ * if it should not repeat. */ - (void)asyncSendData: (OFData *)data receiver: (const of_socket_address_t *)receiver runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_datagram_socket_async_send_data_block_t)block; + block: (OFDatagramSocketAsyncSendDataBlock)block; #endif /** * @brief Cancels all pending asynchronous requests on the socket. */ Index: src/OFDatagramSocket.m ================================================================== --- src/OFDatagramSocket.m +++ src/OFDatagramSocket.m @@ -239,11 +239,11 @@ } #ifdef OF_HAVE_BLOCKS - (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length - block: (of_datagram_socket_async_receive_block_t)block + block: (OFDatagramSocketAsyncReceiveBlock)block { [self asyncReceiveIntoBuffer: buffer length: length runLoopMode: of_run_loop_mode_default block: block]; @@ -250,11 +250,11 @@ } - (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_datagram_socket_async_receive_block_t)block + block: (OFDatagramSocketAsyncReceiveBlock)block { [OFRunLoop of_addAsyncReceiveForDatagramSocket: self buffer: buffer length: length mode: runLoopMode @@ -329,11 +329,11 @@ } #ifdef OF_HAVE_BLOCKS - (void)asyncSendData: (OFData *)data receiver: (const of_socket_address_t *)receiver - block: (of_datagram_socket_async_send_data_block_t)block + block: (OFDatagramSocketAsyncSendDataBlock)block { [self asyncSendData: data receiver: receiver runLoopMode: of_run_loop_mode_default block: block]; @@ -340,11 +340,11 @@ } - (void)asyncSendData: (OFData *)data receiver: (const of_socket_address_t *)receiver runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_datagram_socket_async_send_data_block_t)block + block: (OFDatagramSocketAsyncSendDataBlock)block { [OFRunLoop of_addAsyncSendForDatagramSocket: self data: data receiver: receiver mode: runLoopMode Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -32,14 +32,13 @@ OF_ASSUME_NONNULL_BEGIN @class OFArray OF_GENERIC(ObjectType); #ifdef OF_HAVE_BLOCKS -typedef void (^of_dictionary_enumeration_block_t)(id key, id object, - bool *stop); -typedef bool (^of_dictionary_filter_block_t)(id key, id object); -typedef id _Nonnull (^of_dictionary_map_block_t)(id key, id object); +typedef void (^OFDictionaryEnumerationBlock)(id key, id object, bool *stop); +typedef bool (^OFDictionaryFilterBlock)(id key, id object); +typedef id _Nonnull (^OFDictionaryMapBlock)(id key, id object); #endif /** * @class OFDictionary OFDictionary.h ObjFW/OFDictionary.h * @@ -270,33 +269,32 @@ /** * @brief Executes a block for each key / object pair. * * @param block The block to execute for each key / object pair. */ -- (void)enumerateKeysAndObjectsUsingBlock: - (of_dictionary_enumeration_block_t)block; +- (void)enumerateKeysAndObjectsUsingBlock: (OFDictionaryEnumerationBlock)block; /** * @brief Creates a new dictionary, mapping each object using the specified * block. * * @param block A block which maps an object for each object * @return A new autoreleased OFDictionary */ -- (OFDictionary OF_GENERIC(KeyType, id) *)mappedDictionaryUsingBlock: - (of_dictionary_map_block_t)block; +- (OFDictionary OF_GENERIC(KeyType, id) *) + mappedDictionaryUsingBlock: (OFDictionaryMapBlock)block; /** * @brief Creates a new dictionary, only containing the objects for which the * block returns true. * * @param block A block which determines if the object should be in the new * dictionary * @return A new autoreleased OFDictionary */ -- (OFDictionary OF_GENERIC(KeyType, ObjectType) *)filteredDictionaryUsingBlock: - (of_dictionary_filter_block_t)block; +- (OFDictionary OF_GENERIC(KeyType, ObjectType) *) + filteredDictionaryUsingBlock: (OFDictionaryFilterBlock)block; #endif #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # undef KeyType # undef ObjectType #endif Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -535,12 +535,11 @@ return i; } #ifdef OF_HAVE_BLOCKS -- (void)enumerateKeysAndObjectsUsingBlock: - (of_dictionary_enumeration_block_t)block +- (void)enumerateKeysAndObjectsUsingBlock: (OFDictionaryEnumerationBlock)block { bool stop = false; for (id key in self) { block(key, [self objectForKey: key], &stop); @@ -548,11 +547,11 @@ if (stop) break; } } -- (OFDictionary *)mappedDictionaryUsingBlock: (of_dictionary_map_block_t)block +- (OFDictionary *)mappedDictionaryUsingBlock: (OFDictionaryMapBlock)block { OFMutableDictionary *new = [OFMutableDictionary dictionary]; [self enumerateKeysAndObjectsUsingBlock: ^ (id key, id object, bool *stop) { @@ -562,12 +561,11 @@ [new makeImmutable]; return new; } -- (OFDictionary *)filteredDictionaryUsingBlock: - (of_dictionary_filter_block_t)block +- (OFDictionary *)filteredDictionaryUsingBlock: (OFDictionaryFilterBlock)block { OFMutableDictionary *new = [OFMutableDictionary dictionary]; [self enumerateKeysAndObjectsUsingBlock: ^ (id key, id object, bool *stop) { Index: src/OFIPSocketAsyncConnector.m ================================================================== --- src/OFIPSocketAsyncConnector.m +++ src/OFIPSocketAsyncConnector.m @@ -67,12 +67,11 @@ [_socket setCanBlock: true]; #ifdef OF_HAVE_BLOCKS if (_block != NULL) { if ([_socket isKindOfClass: [OFTCPSocket class]]) - ((of_tcp_socket_async_connect_block_t)_block)( - _exception); + ((OFTCPSocketAsyncConnectBlock)_block)(_exception); else OF_ENSURE(0); } else { #endif if ([_delegate respondsToSelector: Index: src/OFMapTable.h ================================================================== --- src/OFMapTable.h +++ src/OFMapTable.h @@ -45,21 +45,21 @@ * @param key The current key * @param object The current object * @param stop A pointer to a variable that can be set to true to stop the * enumeration */ -typedef void (^of_map_table_enumeration_block_t)(void *_Nullable key, +typedef void (^OFMapTableEnumerationBlock)(void *_Nullable key, void *_Nullable object, bool *stop); /** * @brief A block for replacing objects in an OFMapTable. * * @param key The key of the object to replace * @param object The object to replace * @return The object to replace the object with */ -typedef void *_Nullable (^of_map_table_replace_block_t)(void *_Nullable key, +typedef void *_Nullable (^OFMapTableReplaceBlock)(void *_Nullable key, void *_Nullable object); #endif @class OFMapTableEnumerator; @@ -215,19 +215,18 @@ /** * @brief Executes a block for each key / object pair. * * @param block The block to execute for each key / object pair. */ -- (void)enumerateKeysAndObjectsUsingBlock: - (of_map_table_enumeration_block_t)block; +- (void)enumerateKeysAndObjectsUsingBlock: (OFMapTableEnumerationBlock)block; /** * @brief Replaces each object with the object returned by the block. * * @param block The block which returns a new object for each object */ -- (void)replaceObjectsUsingBlock: (of_map_table_replace_block_t)block; +- (void)replaceObjectsUsingBlock: (OFMapTableReplaceBlock)block; #endif @end /** * @class OFMapTableEnumerator OFMapTable.h ObjFW/OFMapTable.h Index: src/OFMapTable.m ================================================================== --- src/OFMapTable.m +++ src/OFMapTable.m @@ -600,12 +600,11 @@ return i; } #ifdef OF_HAVE_BLOCKS -- (void)enumerateKeysAndObjectsUsingBlock: - (of_map_table_enumeration_block_t)block +- (void)enumerateKeysAndObjectsUsingBlock: (OFMapTableEnumerationBlock)block { bool stop = false; unsigned long mutations = _mutations; for (size_t i = 0; i < _capacity && !stop; i++) { @@ -616,11 +615,11 @@ if (_buckets[i] != NULL && _buckets[i] != &deleted) block(_buckets[i]->key, _buckets[i]->object, &stop); } } -- (void)replaceObjectsUsingBlock: (of_map_table_replace_block_t)block +- (void)replaceObjectsUsingBlock: (OFMapTableReplaceBlock)block { unsigned long mutations = _mutations; for (size_t i = 0; i < _capacity; i++) { if (_mutations != mutations) Index: src/OFMapTableDictionary.m ================================================================== --- src/OFMapTableDictionary.m +++ src/OFMapTableDictionary.m @@ -416,12 +416,11 @@ objects: objects count: count]; } #ifdef OF_HAVE_BLOCKS -- (void)enumerateKeysAndObjectsUsingBlock: - (of_dictionary_enumeration_block_t)block +- (void)enumerateKeysAndObjectsUsingBlock: (OFDictionaryEnumerationBlock)block { @try { [_mapTable enumerateKeysAndObjectsUsingBlock: ^ (void *key, void *object, bool *stop) { block(key, object, stop); Index: src/OFMapTableSet.m ================================================================== --- src/OFMapTableSet.m +++ src/OFMapTableSet.m @@ -284,11 +284,11 @@ objects: objects count: count]; } #ifdef OF_HAVE_BLOCKS -- (void)enumerateObjectsUsingBlock: (of_set_enumeration_block_t)block +- (void)enumerateObjectsUsingBlock: (OFSetEnumerationBlock)block { @try { [_mapTable enumerateKeysAndObjectsUsingBlock: ^ (void *key, void *object, bool *stop) { block(key, stop); Index: src/OFMutableDictionary.h ================================================================== --- src/OFMutableDictionary.h +++ src/OFMutableDictionary.h @@ -25,11 +25,11 @@ * * @param key The key of the object to replace * @param object The object to replace * @return The object to replace the object with */ -typedef id _Nonnull (^of_dictionary_replace_block_t)(id key, id object); +typedef id _Nonnull (^OFDictionaryReplaceBlock)(id key, id object); #endif /** * @class OFMutableDictionary OFDictionary.h ObjFW/OFDictionary.h * @@ -110,11 +110,11 @@ /** * @brief Replaces each object with the object returned by the block. * * @param block The block which returns a new object for each object */ -- (void)replaceObjectsUsingBlock: (of_dictionary_replace_block_t)block; +- (void)replaceObjectsUsingBlock: (OFDictionaryReplaceBlock)block; #endif /** * @brief Converts the mutable dictionary to an immutable dictionary. */ Index: src/OFMutableDictionary.m ================================================================== --- src/OFMutableDictionary.m +++ src/OFMutableDictionary.m @@ -199,11 +199,11 @@ objc_autoreleasePoolPop(pool); } #ifdef OF_HAVE_BLOCKS -- (void)replaceObjectsUsingBlock: (of_dictionary_replace_block_t)block +- (void)replaceObjectsUsingBlock: (OFDictionaryReplaceBlock)block { [self enumerateKeysAndObjectsUsingBlock: ^ (id key, id object, bool *stop) { id new = block(key, object); Index: src/OFMutableMapTableDictionary.m ================================================================== --- src/OFMutableMapTableDictionary.m +++ src/OFMutableMapTableDictionary.m @@ -45,11 +45,11 @@ { [_mapTable removeAllObjects]; } #ifdef OF_HAVE_BLOCKS -- (void)replaceObjectsUsingBlock: (of_dictionary_replace_block_t)block +- (void)replaceObjectsUsingBlock: (OFDictionaryReplaceBlock)block { @try { [_mapTable replaceObjectsUsingBlock: ^ void *(void *key, void *object) { return block(key, object); Index: src/OFRunLoop+Private.h ================================================================== --- src/OFRunLoop+Private.h +++ src/OFRunLoop+Private.h @@ -39,50 +39,45 @@ stream buffer: (void *)buffer length: (size_t)length mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (nullable of_stream_async_read_block_t)block + block: (nullable OFStreamAsyncReadBlock)block # endif delegate: (nullable id )delegate; + (void)of_addAsyncReadForStream: (OFStream *) stream buffer: (void *)buffer exactLength: (size_t)length mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (nullable of_stream_async_read_block_t)block + block: (nullable OFStreamAsyncReadBlock)block # endif delegate: (nullable id )delegate; + (void)of_addAsyncReadLineForStream: (OFStream *) stream encoding: (OFStringEncoding)encoding mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (nullable - of_stream_async_read_line_block_t) - block + block: (nullable OFStreamAsyncReadLineBlock)block # endif delegate: (nullable id )delegate; + (void)of_addAsyncWriteForStream: (OFStream *) stream data: (OFData *)data mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (nullable of_stream_async_write_data_block_t) - block + block: (nullable OFStreamAsyncWriteDataBlock)block # endif delegate: (nullable id )delegate; + (void)of_addAsyncWriteForStream: (OFStream *) stream string: (OFString *)string encoding: (OFStringEncoding)encoding mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (nullable - of_stream_async_write_string_block_t) - block + block: (nullable OFStreamAsyncWriteStringBlock)block # endif delegate: (nullable id )delegate; # if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) + (void)of_addAsyncConnectForSocket: (id)socket mode: (of_run_loop_mode_t)mode @@ -95,40 +90,40 @@ + (void)of_addAsyncReceiveForDatagramSocket: (OFDatagramSocket *)socket buffer: (void *)buffer length: (size_t)length mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (nullable of_datagram_socket_async_receive_block_t)block + block: (nullable OFDatagramSocketAsyncReceiveBlock)block # endif delegate: (nullable id ) delegate; + (void)of_addAsyncSendForDatagramSocket: (OFDatagramSocket *)socket data: (OFData *)data receiver: (const of_socket_address_t *)receiver mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (nullable of_datagram_socket_async_send_data_block_t)block + block: (nullable OFDatagramSocketAsyncSendDataBlock)block # endif delegate: (nullable id )delegate; + (void)of_addAsyncReceiveForSequencedPacketSocket: (OFSequencedPacketSocket *)socket buffer: (void *)buffer length: (size_t)length mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (nullable of_sequenced_packet_socket_async_receive_block_t)block + block: (nullable OFSequencedPacketSocketAsyncReceiveBlock)block # endif delegate: (nullable id ) delegate; + (void)of_addAsyncSendForSequencedPacketSocket: (OFSequencedPacketSocket *)socket data: (OFData *)data mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (nullable of_sequenced_packet_socket_async_send_data_block_t)block + block: (nullable OFSequencedPacketSocketAsyncSendDataBlock)block # endif delegate: (nullable id )delegate; + (void)of_cancelAsyncRequestsForObject: (id)object mode: (of_run_loop_mode_t)mode; #endif - (void)of_removeTimer: (OFTimer *)timer forMode: (of_run_loop_mode_t)mode; @end OF_ASSUME_NONNULL_END Index: src/OFRunLoop.m ================================================================== --- src/OFRunLoop.m +++ src/OFRunLoop.m @@ -88,11 +88,11 @@ @interface OFRunLoopReadQueueItem: OFRunLoopQueueItem { @public # ifdef OF_HAVE_BLOCKS - of_stream_async_read_block_t _block; + OFStreamAsyncReadBlock _block; # endif void *_buffer; size_t _length; } @end @@ -99,11 +99,11 @@ @interface OFRunLoopExactReadQueueItem: OFRunLoopQueueItem { @public # ifdef OF_HAVE_BLOCKS - of_stream_async_read_block_t _block; + OFStreamAsyncReadBlock _block; # endif void *_buffer; size_t _exactLength, _readLength; } @end @@ -110,21 +110,21 @@ @interface OFRunLoopReadLineQueueItem: OFRunLoopQueueItem { @public # ifdef OF_HAVE_BLOCKS - of_stream_async_read_line_block_t _block; + OFStreamAsyncReadLineBlock _block; # endif OFStringEncoding _encoding; } @end @interface OFRunLoopWriteDataQueueItem: OFRunLoopQueueItem { @public # ifdef OF_HAVE_BLOCKS - of_stream_async_write_data_block_t _block; + OFStreamAsyncWriteDataBlock _block; # endif OFData *_data; size_t _writtenLength; } @end @@ -131,11 +131,11 @@ @interface OFRunLoopWriteStringQueueItem: OFRunLoopQueueItem { @public # ifdef OF_HAVE_BLOCKS - of_stream_async_write_string_block_t _block; + OFStreamAsyncWriteStringBlock _block; # endif OFString *_string; OFStringEncoding _encoding; size_t _writtenLength; } @@ -157,11 +157,11 @@ @interface OFRunLoopDatagramReceiveQueueItem: OFRunLoopQueueItem { @public # ifdef OF_HAVE_BLOCKS - of_datagram_socket_async_receive_block_t _block; + OFDatagramSocketAsyncReceiveBlock _block; # endif void *_buffer; size_t _length; } @end @@ -168,11 +168,11 @@ @interface OFRunLoopDatagramSendQueueItem: OFRunLoopQueueItem { @public # ifdef OF_HAVE_BLOCKS - of_datagram_socket_async_send_data_block_t _block; + OFDatagramSocketAsyncSendDataBlock _block; # endif OFData *_data; of_socket_address_t _receiver; } @end @@ -179,11 +179,11 @@ @interface OFRunLoopPacketReceiveQueueItem: OFRunLoopQueueItem { @public # ifdef OF_HAVE_BLOCKS - of_sequenced_packet_socket_async_receive_block_t _block; + OFSequencedPacketSocketAsyncReceiveBlock _block; # endif void *_buffer; size_t _length; } @end @@ -190,11 +190,11 @@ @interface OFRunLoopPacketSendQueueItem: OFRunLoopQueueItem { @public # ifdef OF_HAVE_BLOCKS - of_sequenced_packet_socket_async_send_data_block_t _block; + OFSequencedPacketSocketAsyncSendDataBlock _block; # endif OFData *_data; } @end #endif @@ -752,16 +752,15 @@ } # ifdef OF_HAVE_BLOCKS if (_block != NULL) { if ([object isKindOfClass: [OFStreamSocket class]]) - return ((of_stream_socket_async_accept_block_t) - _block)(acceptedSocket, exception); + return ((OFStreamSocketAsyncAcceptBlock)_block)( + acceptedSocket, exception); else if ([object isKindOfClass: [OFSequencedPacketSocket class]]) - return - ((of_sequenced_packet_socket_async_accept_block_t) + return ((OFSequencedPacketSocketAsyncAcceptBlock) _block)(acceptedSocket, exception); else OF_ENSURE(0); } else { # endif @@ -1088,11 +1087,11 @@ stream buffer: (void *)buffer length: (size_t)length mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (of_stream_async_read_block_t)block + block: (OFStreamAsyncReadBlock)block # endif delegate: (id )delegate { NEW_READ(OFRunLoopReadQueueItem, stream, mode) @@ -1110,11 +1109,11 @@ stream buffer: (void *)buffer exactLength: (size_t)exactLength mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (of_stream_async_read_block_t)block + block: (OFStreamAsyncReadBlock)block # endif delegate: (id )delegate { NEW_READ(OFRunLoopExactReadQueueItem, stream, mode) @@ -1131,11 +1130,11 @@ + (void)of_addAsyncReadLineForStream: (OFStream *) stream encoding: (OFStringEncoding)encoding mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (of_stream_async_read_line_block_t)block + block: (OFStreamAsyncReadLineBlock)block # endif delegate: (id )delegate { NEW_READ(OFRunLoopReadLineQueueItem, stream, mode) @@ -1151,11 +1150,11 @@ + (void)of_addAsyncWriteForStream: (OFStream *) stream data: (OFData *)data mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (of_stream_async_write_data_block_t)block + block: (OFStreamAsyncWriteDataBlock)block # endif delegate: (id )delegate { NEW_WRITE(OFRunLoopWriteDataQueueItem, stream, mode) @@ -1172,11 +1171,11 @@ stream string: (OFString *)string encoding: (OFStringEncoding)encoding mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (of_stream_async_write_string_block_t)block + block: (OFStreamAsyncWriteStringBlock)block # endif delegate: (id )delegate { NEW_WRITE(OFRunLoopWriteStringQueueItem, stream, mode) @@ -1221,11 +1220,11 @@ + (void)of_addAsyncReceiveForDatagramSocket: (OFDatagramSocket *)sock buffer: (void *)buffer length: (size_t)length mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (of_datagram_socket_async_receive_block_t)block + block: (OFDatagramSocketAsyncReceiveBlock)block # endif delegate: (id )delegate { NEW_READ(OFRunLoopDatagramReceiveQueueItem, sock, mode) @@ -1242,11 +1241,11 @@ + (void)of_addAsyncSendForDatagramSocket: (OFDatagramSocket *)sock data: (OFData *)data receiver: (const of_socket_address_t *)receiver mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (of_datagram_socket_async_send_data_block_t)block + block: (OFDatagramSocketAsyncSendDataBlock)block # endif delegate: (id )delegate { NEW_WRITE(OFRunLoopDatagramSendQueueItem, sock, mode) @@ -1264,11 +1263,11 @@ sock buffer: (void *)buffer length: (size_t)length mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (of_sequenced_packet_socket_async_receive_block_t)block + block: (OFSequencedPacketSocketAsyncReceiveBlock)block # endif delegate: (id )delegate { NEW_READ(OFRunLoopPacketReceiveQueueItem, sock, mode) @@ -1284,11 +1283,11 @@ + (void)of_addAsyncSendForSequencedPacketSocket: (OFSequencedPacketSocket *)sock data: (OFData *)data mode: (of_run_loop_mode_t)mode # ifdef OF_HAVE_BLOCKS - block: (of_sequenced_packet_socket_async_send_data_block_t)block + block: (OFSequencedPacketSocketAsyncSendDataBlock)block # endif delegate: (id )delegate { NEW_WRITE(OFRunLoopPacketSendQueueItem, sock, mode) Index: src/OFSPXSocket.h ================================================================== --- src/OFSPXSocket.h +++ src/OFSPXSocket.h @@ -28,11 +28,11 @@ * @brief A block which is called when the socket connected. * * @param exception An exception which occurred while connecting the socket or * `nil` on success */ -typedef void (^of_spx_socket_async_connect_block_t)(id _Nullable exception); +typedef void (^OFSPXSocketAsyncConnectBlock)(id _Nullable exception); #endif /** * @protocol OFSPXSocketDelegate OFSPXSocket.h ObjFW/OFSPXSocket.h * @@ -131,11 +131,11 @@ * @param block The block to execute once the connection has been established */ - (void)asyncConnectToNode: (unsigned char [_Nonnull IPX_NODE_LEN])node network: (uint32_t)network port: (uint16_t)port - block: (of_spx_socket_async_connect_block_t)block; + block: (OFSPXSocketAsyncConnectBlock)block; /** * @brief Asynchronously connect the OFSPXSocket to the specified destination. * * @param node The node to connect to @@ -147,11 +147,11 @@ */ - (void)asyncConnectToNode: (unsigned char [_Nonnull IPX_NODE_LEN])node network: (uint32_t)network port: (uint16_t)port runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_spx_socket_async_connect_block_t)block; + block: (OFSPXSocketAsyncConnectBlock)block; #endif /** * @brief Bind the socket to the specified network, node and port. * Index: src/OFSPXSocket.m ================================================================== --- src/OFSPXSocket.m +++ src/OFSPXSocket.m @@ -49,20 +49,20 @@ OFSPXSocket *_socket; unsigned char _node[IPX_NODE_LEN]; uint32_t _network; uint16_t _port; #ifdef OF_HAVE_BLOCKS - of_spx_socket_async_connect_block_t _block; + OFSPXSocketAsyncConnectBlock _block; #endif } - (instancetype)initWithSocket: (OFSPXSocket *)socket node: (unsigned char [IPX_NODE_LEN])node network: (uint32_t)network port: (uint16_t)port #ifdef OF_HAVE_BLOCKS - block: (of_spx_socket_async_connect_block_t)block + block: (OFSPXSocketAsyncConnectBlock)block #endif ; - (void)startWithRunLoopMode: (of_run_loop_mode_t)runLoopMode; @end @@ -70,11 +70,11 @@ - (instancetype)initWithSocket: (OFSPXSocket *)sock node: (unsigned char [IPX_NODE_LEN])node network: (uint32_t)network port: (uint16_t)port #ifdef OF_HAVE_BLOCKS - block: (of_spx_socket_async_connect_block_t)block + block: (OFSPXSocketAsyncConnectBlock)block #endif { self = [super init]; @try { @@ -279,11 +279,11 @@ #ifdef OF_HAVE_BLOCKS - (void)asyncConnectToNode: (unsigned char [_Nonnull IPX_NODE_LEN])node network: (uint32_t)network port: (uint16_t)port - block: (of_spx_socket_async_connect_block_t)block + block: (OFSPXSocketAsyncConnectBlock)block { [self asyncConnectToNode: node network: network port: port runLoopMode: of_run_loop_mode_default @@ -292,11 +292,11 @@ - (void)asyncConnectToNode: (unsigned char [_Nonnull IPX_NODE_LEN])node network: (uint32_t)network port: (uint16_t)port runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_spx_socket_async_connect_block_t)block + block: (OFSPXSocketAsyncConnectBlock)block { void *pool = objc_autoreleasePoolPush(); [[[[OFSPXSocketAsyncConnectDelegate alloc] initWithSocket: self Index: src/OFSPXStreamSocket.h ================================================================== --- src/OFSPXStreamSocket.h +++ src/OFSPXStreamSocket.h @@ -28,12 +28,11 @@ * @brief A block which is called when the socket connected. * * @param exception An exception which occurred while connecting the socket or * `nil` on success */ -typedef void (^of_spx_stream_socket_async_connect_block_t)( - id _Nullable exception); +typedef void (^OFSPXStreamSocketAsyncConnectBlock)(id _Nullable exception); #endif /** * @protocol OFSPXStreamSocketDelegate OFSPXStreamSocket.h \ * ObjFW/OFSPXStreamSocket.h @@ -136,11 +135,11 @@ * @param block The block to execute once the connection has been established */ - (void)asyncConnectToNode: (unsigned char [_Nonnull IPX_NODE_LEN])node network: (uint32_t)network port: (uint16_t)port - block: (of_spx_stream_socket_async_connect_block_t)block; + block: (OFSPXStreamSocketAsyncConnectBlock)block; /** * @brief Asynchronously connect the OFSPXStreamSocket to the specified * destination. * @@ -153,11 +152,11 @@ */ - (void)asyncConnectToNode: (unsigned char [_Nonnull IPX_NODE_LEN])node network: (uint32_t)network port: (uint16_t)port runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_spx_stream_socket_async_connect_block_t)block; + block: (OFSPXStreamSocketAsyncConnectBlock)block; #endif /** * @brief Bind the socket to the specified network, node and port. * Index: src/OFSPXStreamSocket.m ================================================================== --- src/OFSPXStreamSocket.m +++ src/OFSPXStreamSocket.m @@ -50,21 +50,20 @@ OFSPXStreamSocket *_socket; unsigned char _node[IPX_NODE_LEN]; uint32_t _network; uint16_t _port; #ifdef OF_HAVE_BLOCKS - of_spx_stream_socket_async_connect_block_t _block; + OFSPXStreamSocketAsyncConnectBlock _block; #endif } - (instancetype)initWithSocket: (OFSPXStreamSocket *)socket node: (unsigned char [IPX_NODE_LEN])node network: (uint32_t)network port: (uint16_t)port #ifdef OF_HAVE_BLOCKS - block: (of_spx_stream_socket_async_connect_block_t) - block + block: (OFSPXStreamSocketAsyncConnectBlock)block #endif ; - (void)startWithRunLoopMode: (of_run_loop_mode_t)runLoopMode; @end @@ -72,12 +71,11 @@ - (instancetype)initWithSocket: (OFSPXStreamSocket *)sock node: (unsigned char [IPX_NODE_LEN])node network: (uint32_t)network port: (uint16_t)port #ifdef OF_HAVE_BLOCKS - block: (of_spx_stream_socket_async_connect_block_t) - block + block: (OFSPXStreamSocketAsyncConnectBlock)block #endif { self = [super init]; @try { @@ -283,11 +281,11 @@ #ifdef OF_HAVE_BLOCKS - (void)asyncConnectToNode: (unsigned char [_Nonnull IPX_NODE_LEN])node network: (uint32_t)network port: (uint16_t)port - block: (of_spx_stream_socket_async_connect_block_t)block + block: (OFSPXStreamSocketAsyncConnectBlock)block { [self asyncConnectToNode: node network: network port: port runLoopMode: of_run_loop_mode_default @@ -296,11 +294,11 @@ - (void)asyncConnectToNode: (unsigned char [_Nonnull IPX_NODE_LEN])node network: (uint32_t)network port: (uint16_t)port runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_spx_stream_socket_async_connect_block_t)block + block: (OFSPXStreamSocketAsyncConnectBlock)block { void *pool = objc_autoreleasePoolPush(); [[[[OFSPXStreamSocketAsyncConnectDelegate alloc] initWithSocket: self Index: src/OFSequencedPacketSocket.h ================================================================== --- src/OFSequencedPacketSocket.h +++ src/OFSequencedPacketSocket.h @@ -33,11 +33,11 @@ * @param length The length of the packet * @param exception An exception which occurred while receiving or `nil` on * success * @return A bool whether the same block should be used for the next receive */ -typedef bool (^of_sequenced_packet_socket_async_receive_block_t)(size_t length, +typedef bool (^OFSequencedPacketSocketAsyncReceiveBlock)(size_t length, id _Nullable exception); /** * @brief A block which is called when a packet has been sent. * @@ -44,11 +44,11 @@ * @param data The data which was sent * @param exception An exception which occurred while reading or `nil` on * success * @return The data to repeat the send with or nil if it should not repeat */ -typedef OFData *_Nullable (^of_sequenced_packet_socket_async_send_data_block_t)( +typedef OFData *_Nullable (^OFSequencedPacketSocketAsyncSendDataBlock)( OFData *_Nonnull data, id _Nullable exception); /** * @brief A block which is called when the socket accepted a connection. * @@ -56,11 +56,11 @@ * @param exception An exception which occurred while accepting the socket or * `nil` on success * @return A bool whether the same block should be used for the next incoming * connection */ -typedef bool (^of_sequenced_packet_socket_async_accept_block_t)( +typedef bool (^OFSequencedPacketSocketAsyncAcceptBlock)( OFSequencedPacketSocket *acceptedSocket, id _Nullable exception); #endif /** * @protocol OFSequencedPacketSocketDelegate OFSequencedPacketSocket.h \ @@ -218,15 +218,13 @@ * block returns true, it will be called again with the same * buffer and maximum length when more packets have been received. * If you want the next method in the queue to handle the packet * received next, you need to return false from the method. */ -- (void) - asyncReceiveIntoBuffer: (void *)buffer - length: (size_t)length - block: (of_sequenced_packet_socket_async_receive_block_t) - block; +- (void)asyncReceiveIntoBuffer: (void *)buffer + length: (size_t)length + block: (OFSequencedPacketSocketAsyncReceiveBlock)block; /** * @brief Asynchronously receives a packet and stores it into the specified * buffer. * @@ -239,16 +237,14 @@ * block returns true, it will be called again with the same * buffer and maximum length when more packets have been received. * If you want the next method in the queue to handle the packet * received next, you need to return false from the method. */ -- (void) - asyncReceiveIntoBuffer: (void *)buffer - length: (size_t)length - runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_sequenced_packet_socket_async_receive_block_t) - block; +- (void)asyncReceiveIntoBuffer: (void *)buffer + length: (size_t)length + runLoopMode: (of_run_loop_mode_t)runLoopMode + block: (OFSequencedPacketSocketAsyncReceiveBlock)block; #endif /** * @brief Sends the specified packet. * @@ -281,12 +277,11 @@ * @param block The block to call when the packet has been sent. It should * return the data for the next send with the same callback or nil * if it should not repeat. */ - (void)asyncSendData: (OFData *)data - block: (of_sequenced_packet_socket_async_send_data_block_t) - block; + block: (OFSequencedPacketSocketAsyncSendDataBlock)block; /** * @brief Asynchronously sends the specified packet. * * @param data The data to send as a packet @@ -295,12 +290,11 @@ * return the data for the next send with the same callback or nil * if it should not repeat. */ - (void)asyncSendData: (OFData *)data runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_sequenced_packet_socket_async_send_data_block_t) - block; + block: (OFSequencedPacketSocketAsyncSendDataBlock)block; #endif /** * @brief Listen on the socket. * @@ -338,23 +332,23 @@ * * @param block The block to execute when a new connection has been accepted. * Returns whether the next incoming connection should be accepted * by the specified block as well. */ -- (void)asyncAcceptWithBlock: - (of_sequenced_packet_socket_async_accept_block_t)block; +- (void)asyncAcceptWithBlock: (OFSequencedPacketSocketAsyncAcceptBlock)block; /** * @brief Asynchronously accept an incoming connection. * * @param runLoopMode The run loop mode in which to perform the async accept * @param block The block to execute when a new connection has been accepted. * Returns whether the next incoming connection should be accepted * by the specified block as well. */ -- (void)asyncAcceptWithRunLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_sequenced_packet_socket_async_accept_block_t)block; +- (void) + asyncAcceptWithRunLoopMode: (of_run_loop_mode_t)runLoopMode + block: (OFSequencedPacketSocketAsyncAcceptBlock)block; #endif /** * @brief Cancels all pending asynchronous requests on the socket. */ Index: src/OFSequencedPacketSocket.m ================================================================== --- src/OFSequencedPacketSocket.m +++ src/OFSequencedPacketSocket.m @@ -196,15 +196,13 @@ # endif delegate: _delegate]; } #ifdef OF_HAVE_BLOCKS -- (void) - asyncReceiveIntoBuffer: (void *)buffer - length: (size_t)length - block: (of_sequenced_packet_socket_async_receive_block_t) - block +- (void)asyncReceiveIntoBuffer: (void *)buffer + length: (size_t)length + block: (OFSequencedPacketSocketAsyncReceiveBlock)block { [self asyncReceiveIntoBuffer: buffer length: length runLoopMode: of_run_loop_mode_default block: block]; @@ -212,12 +210,11 @@ - (void) asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_sequenced_packet_socket_async_receive_block_t) - block + block: (OFSequencedPacketSocketAsyncReceiveBlock)block { [OFRunLoop of_addAsyncReceiveForSequencedPacketSocket: self buffer: buffer length: length mode: runLoopMode @@ -281,20 +278,20 @@ delegate: _delegate]; } #ifdef OF_HAVE_BLOCKS - (void)asyncSendData: (OFData *)data - block: (of_sequenced_packet_socket_async_send_data_block_t)block + block: (OFSequencedPacketSocketAsyncSendDataBlock)block { [self asyncSendData: data runLoopMode: of_run_loop_mode_default block: block]; } - (void)asyncSendData: (OFData *)data runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_sequenced_packet_socket_async_send_data_block_t)block + block: (OFSequencedPacketSocketAsyncSendDataBlock)block { [OFRunLoop of_addAsyncSendForSequencedPacketSocket: self data: data mode: runLoopMode block: block @@ -401,19 +398,19 @@ block: NULL delegate: _delegate]; } #ifdef OF_HAVE_BLOCKS -- (void)asyncAcceptWithBlock: (of_sequenced_packet_socket_async_accept_block_t) - block +- (void)asyncAcceptWithBlock: (OFSequencedPacketSocketAsyncAcceptBlock)block { [self asyncAcceptWithRunLoopMode: of_run_loop_mode_default block: block]; } -- (void)asyncAcceptWithRunLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_sequenced_packet_socket_async_accept_block_t)block +- (void) + asyncAcceptWithRunLoopMode: (of_run_loop_mode_t)runLoopMode + block: (OFSequencedPacketSocketAsyncAcceptBlock)block { [OFRunLoop of_addAsyncAcceptForSocket: self mode: runLoopMode block: block delegate: nil]; Index: src/OFSet.h ================================================================== --- src/OFSet.h +++ src/OFSet.h @@ -38,19 +38,19 @@ * * @param object The current object * @param stop A pointer to a variable that can be set to true to stop the * enumeration */ -typedef void (^of_set_enumeration_block_t)(id object, bool *stop); +typedef void (^OFSetEnumerationBlock)(id object, bool *stop); /** * @brief A block for filtering an OFSet. * * @param object The object to inspect * @return Whether the object should be in the filtered set */ -typedef bool (^of_set_filter_block_t)(id object); +typedef bool (^OFSetFilterBlock)(id object); #endif /** * @class OFSet OFSet.h ObjFW/OFSet.h * @@ -252,25 +252,25 @@ /** * @brief Executes a block for each object in the set. * * @param block The block to execute for each object in the set */ -- (void)enumerateObjectsUsingBlock: (of_set_enumeration_block_t)block; +- (void)enumerateObjectsUsingBlock: (OFSetEnumerationBlock)block; /** * @brief Creates a new set, only containing the objects for which the block * returns true. * * @param block A block which determines if the object should be in the new set * @return A new, autoreleased OFSet */ -- (OFSet OF_GENERIC(ObjectType) *)filteredSetUsingBlock: - (of_set_filter_block_t)block; +- (OFSet OF_GENERIC(ObjectType) *) + filteredSetUsingBlock: (OFSetFilterBlock)block; #endif #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # undef ObjectType #endif @end OF_ASSUME_NONNULL_END #import "OFMutableSet.h" Index: src/OFSet.m ================================================================== --- src/OFSet.m +++ src/OFSet.m @@ -426,11 +426,11 @@ objc_autoreleasePoolPop(pool); return [ret autorelease]; } #ifdef OF_HAVE_BLOCKS -- (void)enumerateObjectsUsingBlock: (of_set_enumeration_block_t)block +- (void)enumerateObjectsUsingBlock: (OFSetEnumerationBlock)block { bool stop = false; for (id object in self) { block(object, &stop); @@ -438,11 +438,11 @@ if (stop) break; } } -- (OFSet *)filteredSetUsingBlock: (of_set_filter_block_t)block +- (OFSet *)filteredSetUsingBlock: (OFSetFilterBlock)block { OFMutableSet *ret = [OFMutableSet set]; [self enumerateObjectsUsingBlock: ^ (id object, bool *stop) { if (block(object)) Index: src/OFStream.h ================================================================== --- src/OFStream.h +++ src/OFStream.h @@ -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. Index: src/OFStream.m ================================================================== --- src/OFStream.m +++ src/OFStream.m @@ -245,11 +245,11 @@ } # ifdef OF_HAVE_BLOCKS - (void)asyncReadIntoBuffer: (void *)buffer length: (size_t)length - block: (of_stream_async_read_block_t)block + block: (OFStreamAsyncReadBlock)block { [self asyncReadIntoBuffer: buffer length: length runLoopMode: of_run_loop_mode_default block: block]; @@ -256,11 +256,11 @@ } - (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 { OFStream *stream = (OFStream *)self; [OFRunLoop of_addAsyncReadForStream: stream @@ -271,11 +271,11 @@ delegate: nil]; } - (void)asyncReadIntoBuffer: (void *)buffer exactLength: (size_t)length - block: (of_stream_async_read_block_t)block + block: (OFStreamAsyncReadBlock)block { [self asyncReadIntoBuffer: buffer exactLength: length runLoopMode: of_run_loop_mode_default block: block]; @@ -282,11 +282,11 @@ } - (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 { OFStream *stream = (OFStream *)self; [OFRunLoop of_addAsyncReadForStream: stream @@ -832,28 +832,28 @@ # endif delegate: _delegate]; } # ifdef OF_HAVE_BLOCKS -- (void)asyncReadLineWithBlock: (of_stream_async_read_line_block_t)block +- (void)asyncReadLineWithBlock: (OFStreamAsyncReadLineBlock)block { [self asyncReadLineWithEncoding: OFStringEncodingUTF8 runLoopMode: of_run_loop_mode_default block: block]; } - (void)asyncReadLineWithEncoding: (OFStringEncoding)encoding - block: (of_stream_async_read_line_block_t)block + block: (OFStreamAsyncReadLineBlock)block { [self asyncReadLineWithEncoding: encoding runLoopMode: of_run_loop_mode_default block: block]; } - (void)asyncReadLineWithEncoding: (OFStringEncoding)encoding runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_stream_async_read_line_block_t)block + block: (OFStreamAsyncReadLineBlock)block { OFStream *stream = (OFStream *)self; [OFRunLoop of_addAsyncReadLineForStream: stream @@ -1145,21 +1145,20 @@ # endif delegate: _delegate]; } # ifdef OF_HAVE_BLOCKS -- (void)asyncWriteData: (OFData *)data - block: (of_stream_async_write_data_block_t)block +- (void)asyncWriteData: (OFData *)data block: (OFStreamAsyncWriteDataBlock)block { [self asyncWriteData: data runLoopMode: of_run_loop_mode_default block: block]; } - (void)asyncWriteData: (OFData *)data runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_stream_async_write_data_block_t)block + block: (OFStreamAsyncWriteDataBlock)block { OFStream *stream = (OFStream *)self; [OFRunLoop of_addAsyncWriteForStream: stream @@ -1168,21 +1167,21 @@ block: block delegate: nil]; } - (void)asyncWriteString: (OFString *)string - block: (of_stream_async_write_string_block_t)block + block: (OFStreamAsyncWriteStringBlock)block { [self asyncWriteString: string encoding: OFStringEncodingUTF8 runLoopMode: of_run_loop_mode_default block: block]; } - (void)asyncWriteString: (OFString *)string encoding: (OFStringEncoding)encoding - block: (of_stream_async_write_string_block_t)block + block: (OFStreamAsyncWriteStringBlock)block { [self asyncWriteString: string encoding: encoding runLoopMode: of_run_loop_mode_default block: block]; @@ -1189,11 +1188,11 @@ } - (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 { OFStream *stream = (OFStream *)self; [OFRunLoop of_addAsyncWriteForStream: stream Index: src/OFStreamSocket.h ================================================================== --- src/OFStreamSocket.h +++ src/OFStreamSocket.h @@ -31,12 +31,12 @@ * @param exception An exception which occurred while accepting the socket or * `nil` on success * @return A bool whether the same block should be used for the next incoming * connection */ -typedef bool (^of_stream_socket_async_accept_block_t)( - OFStreamSocket *acceptedSocket, id _Nullable exception); +typedef bool (^OFStreamSocketAsyncAcceptBlock)(OFStreamSocket *acceptedSocket, + id _Nullable exception); #endif /** * @protocol OFStreamSocketDelegate OFStreamSocket.h ObjFW/OFStreamSocket.h * @@ -137,11 +137,11 @@ * * @param block The block to execute when a new connection has been accepted. * Returns whether the next incoming connection should be accepted * by the specified block as well. */ -- (void)asyncAcceptWithBlock: (of_stream_socket_async_accept_block_t)block; +- (void)asyncAcceptWithBlock: (OFStreamSocketAsyncAcceptBlock)block; /** * @brief Asynchronously accept an incoming connection. * * @param runLoopMode The run loop mode in which to perform the async accept @@ -148,11 +148,10 @@ * @param block The block to execute when a new connection has been accepted. * Returns whether the next incoming connection should be accepted * by the specified block as well. */ - (void)asyncAcceptWithRunLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_stream_socket_async_accept_block_t) - block; + block: (OFStreamSocketAsyncAcceptBlock)block; #endif @end OF_ASSUME_NONNULL_END Index: src/OFStreamSocket.m ================================================================== --- src/OFStreamSocket.m +++ src/OFStreamSocket.m @@ -321,18 +321,18 @@ block: NULL delegate: _delegate]; } #ifdef OF_HAVE_BLOCKS -- (void)asyncAcceptWithBlock: (of_stream_socket_async_accept_block_t)block +- (void)asyncAcceptWithBlock: (OFStreamSocketAsyncAcceptBlock)block { [self asyncAcceptWithRunLoopMode: of_run_loop_mode_default block: block]; } - (void)asyncAcceptWithRunLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_stream_socket_async_accept_block_t)block + block: (OFStreamSocketAsyncAcceptBlock)block { [OFRunLoop of_addAsyncAcceptForSocket: self mode: runLoopMode block: block delegate: nil]; Index: src/OFString+XMLUnescaping.h ================================================================== --- src/OFString+XMLUnescaping.h +++ src/OFString+XMLUnescaping.h @@ -34,12 +34,12 @@ * * @param string The XML string which contains an unknown entity * @param entity The XML entity which is unknown * @return A replacement string for the unknown entity */ -typedef OFString *_Nullable (^of_string_xml_unescaping_block_t)( - OFString *string, OFString *entity); +typedef OFString *_Nullable (^OFStringXMLUnescapingBlock)(OFString *string, + OFString *entity); #endif /** * @protocol OFStringXMLUnescapingDelegate OFString.h ObjFW/OFString.h * @@ -83,11 +83,10 @@ * @brief Unescapes XML in the string and uses the specified block for unknown * entities. * * @param block A block which handles unknown entities */ -- (OFString *)stringByXMLUnescapingWithBlock: - (of_string_xml_unescaping_block_t)block; +- (OFString *)stringByXMLUnescapingWithBlock: (OFStringXMLUnescapingBlock)block; #endif @end OF_ASSUME_NONNULL_END Index: src/OFString+XMLUnescaping.m ================================================================== --- src/OFString+XMLUnescaping.m +++ src/OFString+XMLUnescaping.m @@ -188,11 +188,11 @@ #ifdef OF_HAVE_BLOCKS static id lookupUsingBlock(void *context, OFString *self, OFString *entity) { - of_string_xml_unescaping_block_t block = context; + OFStringXMLUnescapingBlock block = context; if (block == NULL) return nil; return block(self, entity); @@ -210,12 +210,11 @@ { return parseEntities(self, lookupUsingDelegate, delegate); } #ifdef OF_HAVE_BLOCKS -- (OFString *)stringByXMLUnescapingWithBlock: - (of_string_xml_unescaping_block_t)block +- (OFString *)stringByXMLUnescapingWithBlock: (OFStringXMLUnescapingBlock)block { return parseEntities(self, lookupUsingBlock, block); } #endif @end Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -128,11 +128,11 @@ * * @param line The current line * @param stop A pointer to a variable that can be set to true to stop the * enumeration */ -typedef void (^of_string_line_enumeration_block_t)(OFString *line, bool *stop); +typedef void (^OFStringLineEnumerationBlock)(OFString *line, bool *stop); #endif #ifdef __OBJC__ @class OFArray OF_GENERIC(ObjectType); @class OFCharacterSet; @@ -1261,11 +1261,11 @@ /** * Enumerates all lines in the receiver using the specified block. * * @brief block The block to call for each line */ -- (void)enumerateLinesUsingBlock: (of_string_line_enumeration_block_t)block; +- (void)enumerateLinesUsingBlock: (OFStringLineEnumerationBlock)block; # endif @end #endif #ifdef __cplusplus Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -2741,11 +2741,11 @@ objc_autoreleasePoolPop(pool); } #ifdef OF_HAVE_BLOCKS -- (void)enumerateLinesUsingBlock: (of_string_line_enumeration_block_t)block +- (void)enumerateLinesUsingBlock: (OFStringLineEnumerationBlock)block { void *pool = objc_autoreleasePoolPush(); const OFUnichar *characters = self.characters; size_t i, last = 0, length = self.length; bool stop = false, lastCarriageReturn = false; Index: src/OFTCPSocket.h ================================================================== --- src/OFTCPSocket.h +++ src/OFTCPSocket.h @@ -28,11 +28,11 @@ * @brief A block which is called when the socket connected. * * @param exception An exception which occurred while connecting the socket or * `nil` on success */ -typedef void (^of_tcp_socket_async_connect_block_t)(id _Nullable exception); +typedef void (^OFTCPSocketAsyncConnectBlock)(id _Nullable exception); #endif /** * @protocol OFTCPSocketDelegate OFTCPSocket.h ObjFW/OFTCPSocket.h * @@ -180,11 +180,11 @@ * @param port The port on the host to connect to * @param block The block to execute once the connection has been established */ - (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port - block: (of_tcp_socket_async_connect_block_t)block; + block: (OFTCPSocketAsyncConnectBlock)block; /** * @brief Asynchronously connect the OFTCPSocket to the specified destination. * * @param host The host to connect to @@ -193,11 +193,11 @@ * @param block The block to execute once the connection has been established */ - (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_tcp_socket_async_connect_block_t)block; + block: (OFTCPSocketAsyncConnectBlock)block; #endif /** * @brief Bind the socket to the specified host and port. * Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -253,11 +253,11 @@ } #ifdef OF_HAVE_BLOCKS - (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port - block: (of_tcp_socket_async_connect_block_t)block + block: (OFTCPSocketAsyncConnectBlock)block { [self asyncConnectToHost: host port: port runLoopMode: of_run_loop_mode_default block: block]; @@ -264,11 +264,11 @@ } - (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port runLoopMode: (of_run_loop_mode_t)runLoopMode - block: (of_tcp_socket_async_connect_block_t)block + block: (OFTCPSocketAsyncConnectBlock)block { void *pool = objc_autoreleasePoolPush(); id delegate = nil; if (_socket != INVALID_SOCKET) Index: src/OFTCPSocketSOCKS5Connector.h ================================================================== --- src/OFTCPSocketSOCKS5Connector.h +++ src/OFTCPSocketSOCKS5Connector.h @@ -24,11 +24,11 @@ OFTCPSocket *_socket; OFString *_host; uint16_t _port; id _Nullable _delegate; #ifdef OF_HAVE_BLOCKS - of_tcp_socket_async_connect_block_t _Nullable _block; + OFTCPSocketAsyncConnectBlock _Nullable _block; #endif id _Nullable _exception; enum { OF_SOCKS5_STATE_SEND_AUTHENTICATION = 1, OF_SOCKS5_STATE_READ_VERSION, @@ -45,13 +45,12 @@ - (instancetype)initWithSocket: (OFTCPSocket *)sock host: (OFString *)host port: (uint16_t)port delegate: (nullable id )delegate #ifdef OF_HAVE_BLOCKS - block: (nullable of_tcp_socket_async_connect_block_t) - block + block: (nullable OFTCPSocketAsyncConnectBlock)block #endif ; - (void)didConnect; @end OF_ASSUME_NONNULL_END Index: src/OFTCPSocketSOCKS5Connector.m ================================================================== --- src/OFTCPSocketSOCKS5Connector.m +++ src/OFTCPSocketSOCKS5Connector.m @@ -29,11 +29,11 @@ - (instancetype)initWithSocket: (OFTCPSocket *)sock host: (OFString *)host port: (uint16_t)port delegate: (id )delegate #ifdef OF_HAVE_BLOCKS - block: (of_tcp_socket_async_connect_block_t)block + block: (OFTCPSocketAsyncConnectBlock)block #endif { self = [super init]; @try { Index: src/OFThread.h ================================================================== --- src/OFThread.h +++ src/OFThread.h @@ -36,11 +36,11 @@ /** * @brief A block to be executed in a new thread. * * @return The object which should be returned when the thread is joined */ -typedef id _Nullable (^of_thread_block_t)(void); +typedef id _Nullable (^OFThreadBlock)(void); #endif /** * @class OFThread OFThread.h ObjFW/OFThread.h * @@ -73,11 +73,11 @@ } _running; # ifndef OF_OBJFW_RUNTIME void *_pool; # endif # ifdef OF_HAVE_BLOCKS - of_thread_block_t _Nullable _threadBlock; + OFThreadBlock _Nullable _threadBlock; # endif jmp_buf _exitEnv; id _returnValue; bool _supportsSockets; OFRunLoop *_Nullable _runLoop; @@ -117,12 +117,11 @@ # ifdef OF_HAVE_BLOCKS /** * @brief The block to execute in the thread. */ -@property OF_NULLABLE_PROPERTY (readonly, nonatomic) - of_thread_block_t threadBlock; +@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFThreadBlock threadBlock; # endif /** * @brief The run loop for the thread. */ @@ -167,11 +166,11 @@ * @brief Creates a new thread with the specified block. * * @param threadBlock A block which is executed by the thread * @return A new, autoreleased thread */ -+ (instancetype)threadWithThreadBlock: (of_thread_block_t)threadBlock; ++ (instancetype)threadWithThreadBlock: (OFThreadBlock)threadBlock; # endif /** * @brief Returns the current thread. * @@ -267,11 +266,11 @@ * @brief Initializes an already allocated thread with the specified block. * * @param threadBlock A block which is executed by the thread * @return An initialized OFThread. */ -- (instancetype)initWithThreadBlock: (of_thread_block_t)threadBlock; +- (instancetype)initWithThreadBlock: (OFThreadBlock)threadBlock; # endif /** * @brief The main routine of the thread. You need to reimplement this! * Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -173,11 +173,11 @@ { return [[[self alloc] init] autorelease]; } # ifdef OF_HAVE_BLOCKS -+ (instancetype)threadWithThreadBlock: (of_thread_block_t)threadBlock ++ (instancetype)threadWithThreadBlock: (OFThreadBlock)threadBlock { return [[[self alloc] initWithThreadBlock: threadBlock] autorelease]; } # endif @@ -374,11 +374,11 @@ return self; } # ifdef OF_HAVE_BLOCKS -- (instancetype)initWithThreadBlock: (of_thread_block_t)threadBlock +- (instancetype)initWithThreadBlock: (OFThreadBlock)threadBlock { self = [self init]; @try { _threadBlock = [threadBlock copy]; Index: src/OFThreadPool.h ================================================================== --- src/OFThreadPool.h +++ src/OFThreadPool.h @@ -21,11 +21,11 @@ #ifdef OF_HAVE_BLOCKS /** * @brief A block for a job which should be executed in a thread pool. */ -typedef void (^of_thread_pool_block_t)(void); +typedef void (^OFThreadPoolBlock)(void); #endif @class OFCondition; @class OFList OF_GENERIC(ObjectType); @class OFMutableArray OF_GENERIC(ObjectType); @@ -102,15 +102,15 @@ /** * @brief Executes the specified block as soon as a thread is ready. * * @param block The block to execute */ -- (void)dispatchWithBlock: (of_thread_pool_block_t)block; +- (void)dispatchWithBlock: (OFThreadPoolBlock)block; #endif /** * @brief Waits until all jobs are done. */ - (void)waitUntilDone; @end OF_ASSUME_NONNULL_END Index: src/OFThreadPool.m ================================================================== --- src/OFThreadPool.m +++ src/OFThreadPool.m @@ -29,19 +29,19 @@ { id _target; SEL _selector; id _object; #ifdef OF_HAVE_BLOCKS - of_thread_pool_block_t _block; + OFThreadPoolBlock _block; #endif } - (instancetype)initWithTarget: (id)target selector: (SEL)selector object: (id)object; #ifdef OF_HAVE_BLOCKS -- (instancetype)initWithBlock: (of_thread_pool_block_t)block; +- (instancetype)initWithBlock: (OFThreadPoolBlock)block; #endif - (void)perform; @end @implementation OFThreadPoolJob @@ -62,11 +62,11 @@ return self; } #ifdef OF_HAVE_BLOCKS -- (instancetype)initWithBlock: (of_thread_pool_block_t)block +- (instancetype)initWithBlock: (OFThreadPoolBlock)block { self = [super init]; @try { _block = [block copy]; @@ -340,11 +340,11 @@ [job release]; } } #ifdef OF_HAVE_BLOCKS -- (void)dispatchWithBlock: (of_thread_pool_block_t)block +- (void)dispatchWithBlock: (OFThreadPoolBlock)block { OFThreadPoolJob *job = [[OFThreadPoolJob alloc] initWithBlock: block]; @try { [self of_dispatchJob: job]; } @finally { Index: src/OFTimer.h ================================================================== --- src/OFTimer.h +++ src/OFTimer.h @@ -30,11 +30,11 @@ /** * @brief A block to execute when a timer fires. * * @param timer The timer which fired */ -typedef void (^of_timer_block_t)(OFTimer *timer); +typedef void (^OFTimerBlock)(OFTimer *timer); #endif /** * @class OFTimer OFTimer.h ObjFW/OFTimer.h * @@ -49,11 +49,11 @@ id _Nullable _object1, _object2, _object3, _object4; SEL _selector; unsigned char _arguments; bool _repeats; #ifdef OF_HAVE_BLOCKS - of_timer_block_t _block; + OFTimerBlock _block; #endif bool _valid; #ifdef OF_HAVE_THREADS OFCondition *_condition; bool _done; @@ -196,11 +196,11 @@ * @param block The block to invoke when the timer fires * @return A new, autoreleased timer */ + (instancetype)scheduledTimerWithTimeInterval: (OFTimeInterval)timeInterval repeats: (bool)repeats - block: (of_timer_block_t)block; + block: (OFTimerBlock)block; #endif /** * @brief Creates a new timer with the specified time interval. * @@ -309,11 +309,11 @@ * @param block The block to invoke when the timer fires * @return A new, autoreleased timer */ + (instancetype)timerWithTimeInterval: (OFTimeInterval)timeInterval repeats: (bool)repeats - block: (of_timer_block_t)block; + block: (OFTimerBlock)block; #endif - (instancetype)init OF_UNAVAILABLE; /** @@ -448,11 +448,11 @@ * @return An initialized timer */ - (instancetype)initWithFireDate: (OFDate *)fireDate interval: (OFTimeInterval)interval repeats: (bool)repeats - block: (of_timer_block_t)block; + block: (OFTimerBlock)block; #endif /** * @brief Compares the timer to another timer. * Index: src/OFTimer.m ================================================================== --- src/OFTimer.m +++ src/OFTimer.m @@ -159,11 +159,11 @@ } #ifdef OF_HAVE_BLOCKS + (instancetype)scheduledTimerWithTimeInterval: (OFTimeInterval)timeInterval repeats: (bool)repeats - block: (of_timer_block_t)block + block: (OFTimerBlock)block { void *pool = objc_autoreleasePoolPush(); OFDate *fireDate = [OFDate dateWithTimeIntervalSinceNow: timeInterval]; id timer = [[[self alloc] initWithFireDate: fireDate interval: timeInterval @@ -295,11 +295,11 @@ } #ifdef OF_HAVE_BLOCKS + (instancetype)timerWithTimeInterval: (OFTimeInterval)timeInterval repeats: (bool)repeats - block: (of_timer_block_t)block + block: (OFTimerBlock)block { void *pool = objc_autoreleasePoolPush(); OFDate *fireDate = [OFDate dateWithTimeIntervalSinceNow: timeInterval]; id timer = [[[self alloc] initWithFireDate: fireDate interval: timeInterval @@ -457,11 +457,11 @@ #ifdef OF_HAVE_BLOCKS - (instancetype)initWithFireDate: (OFDate *)fireDate interval: (OFTimeInterval)interval repeats: (bool)repeats - block: (of_timer_block_t)block + block: (OFTimerBlock)block { self = [super init]; @try { _fireDate = [fireDate retain]; Index: src/OFUTF8String.m ================================================================== --- src/OFUTF8String.m +++ src/OFUTF8String.m @@ -1210,11 +1210,11 @@ itemSize: sizeof(OFChar32) freeWhenDone: true] items]; } #ifdef OF_HAVE_BLOCKS -- (void)enumerateLinesUsingBlock: (of_string_line_enumeration_block_t)block +- (void)enumerateLinesUsingBlock: (OFStringLineEnumerationBlock)block { void *pool; const char *cString = _s->cString; const char *last = cString; bool stop = false, lastCarriageReturn = false;