Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -66,18 +66,18 @@ # define SA_RESTART 0 # endif #endif @interface OFApplication () -- (instancetype)OF_init OF_METHOD_FAMILY(init); -- (void)OF_setArgumentCount: (int *)argc +- (instancetype)of_init OF_METHOD_FAMILY(init); +- (void)of_setArgumentCount: (int *)argc andArgumentValues: (char **[])argv; #ifdef OF_WINDOWS -- (void)OF_setArgumentCount: (int)argc +- (void)of_setArgumentCount: (int)argc andWideArgumentValues: (wchar_t *[])argv; #endif -- (void)OF_run; +- (void)of_run; @end static OFApplication *app = nil; static void @@ -129,25 +129,25 @@ "with OF_APPLICATION_DELEGATE().\n", class_getName(cls), class_getName(cls)); exit(1); } - app = [[OFApplication alloc] OF_init]; + app = [[OFApplication alloc] of_init]; - [app OF_setArgumentCount: argc + [app of_setArgumentCount: argc andArgumentValues: argv]; #ifdef OF_WINDOWS __wgetmainargs(&wargc, &wargv, &wenvp, _CRT_glob, &si); - [app OF_setArgumentCount: wargc + [app of_setArgumentCount: wargc andWideArgumentValues: wargv]; #endif delegate = [[cls alloc] init]; [app setDelegate: delegate]; - [app OF_run]; + [app of_run]; [delegate release]; return 0; } @@ -204,11 +204,11 @@ - init { OF_INVALID_INIT_METHOD } -- OF_init +- of_init { self = [super init]; @try { void *pool; @@ -363,11 +363,11 @@ [_environment release]; [super dealloc]; } -- (void)OF_setArgumentCount: (int *)argc +- (void)of_setArgumentCount: (int *)argc andArgumentValues: (char ***)argv { #ifndef OF_WINDOWS void *pool = objc_autoreleasePoolPush(); OFMutableArray *arguments; @@ -403,11 +403,11 @@ _argv = argv; #endif } #ifdef OF_WINDOWS -- (void)OF_setArgumentCount: (int)argc +- (void)of_setArgumentCount: (int)argc andWideArgumentValues: (wchar_t **)argv { void *pool = objc_autoreleasePoolPush(); OFMutableArray *arguments; @@ -483,29 +483,29 @@ #endif #undef REGISTER_SIGNAL } -- (void)OF_run +- (void)of_run { void *pool = objc_autoreleasePoolPush(); OFRunLoop *runLoop; #ifdef OF_HAVE_THREADS - [OFThread OF_createMainThread]; + [OFThread of_createMainThread]; runLoop = [OFRunLoop currentRunLoop]; #else runLoop = [[[OFRunLoop alloc] init] autorelease]; #endif - [OFRunLoop OF_setMainRunLoop: runLoop]; + [OFRunLoop of_setMainRunLoop: runLoop]; objc_autoreleasePoolPop(pool); /* * Note: runLoop is still valid after the release of the pool, as - * OF_setMainRunLoop: retained it. However, we only have a weak + * of_setMainRunLoop: retained it. However, we only have a weak * reference to it now, whereas we had a strong reference before. */ pool = objc_autoreleasePoolPush(); [_delegate applicationDidFinishLaunching]; Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -36,11 +36,11 @@ static struct { Class isa; } placeholder; @interface OFArray () -- (OFString *)OF_JSONRepresentationWithOptions: (int)options +- (OFString *)of_JSONRepresentationWithOptions: (int)options depth: (size_t)depth; @end @interface OFArray_placeholder: OFArray @end @@ -586,21 +586,21 @@ return [element autorelease]; } - (OFString *)JSONRepresentation { - return [self OF_JSONRepresentationWithOptions: 0 + return [self of_JSONRepresentationWithOptions: 0 depth: 0]; } - (OFString *)JSONRepresentationWithOptions: (int)options { - return [self OF_JSONRepresentationWithOptions: options + return [self of_JSONRepresentationWithOptions: options depth: 0]; } -- (OFString *)OF_JSONRepresentationWithOptions: (int)options +- (OFString *)of_JSONRepresentationWithOptions: (int)options depth: (size_t)depth { OFMutableString *JSON = [OFMutableString stringWithString: @"["]; void *pool = objc_autoreleasePoolPush(); size_t i, count = [self count]; @@ -618,11 +618,11 @@ void *pool2 = objc_autoreleasePoolPush(); [JSON appendString: indentation]; [JSON appendString: @"\t"]; [JSON appendString: [object - OF_JSONRepresentationWithOptions: options + of_JSONRepresentationWithOptions: options depth: depth + 1]]; if (++i < count) [JSON appendString: @",\n"]; else @@ -636,11 +636,11 @@ i = 0; for (id object in self) { void *pool2 = objc_autoreleasePoolPush(); [JSON appendString: [object - OF_JSONRepresentationWithOptions: options + of_JSONRepresentationWithOptions: options depth: depth + 1]]; if (++i < count) [JSON appendString: @","]; Index: src/OFAutoreleasePool+Private.h ================================================================== --- src/OFAutoreleasePool+Private.h +++ src/OFAutoreleasePool+Private.h @@ -17,10 +17,10 @@ #import "OFAutoreleasePool.h" OF_ASSUME_NONNULL_BEGIN @interface OFAutoreleasePool () -+ (void)OF_handleThreadTermination; -- (void)OF_super_dealloc; ++ (void)of_handleThreadTermination; +- (void)of_super_dealloc; @end OF_ASSUME_NONNULL_END Index: src/OFAutoreleasePool.m ================================================================== --- src/OFAutoreleasePool.m +++ src/OFAutoreleasePool.m @@ -70,19 +70,19 @@ + (id)addObject: (id)object { return _objc_rootAutorelease(object); } -+ (void)OF_handleThreadTermination ++ (void)of_handleThreadTermination { #if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS) OFAutoreleasePool **cache = of_tlskey_get(cacheKey); #endif if (cache != NULL) { for (size_t i = 0; i < MAX_CACHE_SIZE; i++) - [cache[i] OF_super_dealloc]; + [cache[i] of_super_dealloc]; free(cache); cache = NULL; } } @@ -123,11 +123,11 @@ - (void)drain { [self dealloc]; } -- (void)OF_super_dealloc +- (void)of_super_dealloc { [super dealloc]; } - (void)dealloc Index: src/OFDataArray+CryptoHashing.m ================================================================== --- src/OFDataArray+CryptoHashing.m +++ src/OFDataArray+CryptoHashing.m @@ -28,11 +28,11 @@ #import "OFSHA512Hash.h" int _OFDataArray_CryptoHashing_reference; @implementation OFDataArray (Hashing) -- (OFString *)OF_cryptoHashWithClass: (Class )class +- (OFString *)of_cryptoHashWithClass: (Class )class { void *pool = objc_autoreleasePoolPush(); id hash = [class cryptoHash]; size_t digestSize = [class digestSize]; const unsigned char *digest; @@ -59,38 +59,38 @@ length: digestSize * 2]; } - (OFString *)MD5Hash { - return [self OF_cryptoHashWithClass: [OFMD5Hash class]]; + return [self of_cryptoHashWithClass: [OFMD5Hash class]]; } - (OFString *)RIPEMD160Hash { - return [self OF_cryptoHashWithClass: [OFRIPEMD160Hash class]]; + return [self of_cryptoHashWithClass: [OFRIPEMD160Hash class]]; } - (OFString *)SHA1Hash { - return [self OF_cryptoHashWithClass: [OFSHA1Hash class]]; + return [self of_cryptoHashWithClass: [OFSHA1Hash class]]; } - (OFString *)SHA224Hash { - return [self OF_cryptoHashWithClass: [OFSHA224Hash class]]; + return [self of_cryptoHashWithClass: [OFSHA224Hash class]]; } - (OFString *)SHA256Hash { - return [self OF_cryptoHashWithClass: [OFSHA256Hash class]]; + return [self of_cryptoHashWithClass: [OFSHA256Hash class]]; } - (OFString *)SHA384Hash { - return [self OF_cryptoHashWithClass: [OFSHA384Hash class]]; + return [self of_cryptoHashWithClass: [OFSHA384Hash class]]; } - (OFString *)SHA512Hash { - return [self OF_cryptoHashWithClass: [OFSHA512Hash class]]; + return [self of_cryptoHashWithClass: [OFSHA512Hash class]]; } @end Index: src/OFDeflateStream.m ================================================================== --- src/OFDeflateStream.m +++ src/OFDeflateStream.m @@ -61,11 +61,11 @@ struct huffman_tree *leafs[2]; uint16_t value; }; @interface OFDeflateStream () -- (void)OF_initDecompression; +- (void)of_initDecompression; @end #ifndef DEFLATE64 static const uint8_t numDistanceCodes = 30; static const uint8_t lengthCodes[29] = { @@ -324,11 +324,11 @@ [super dealloc]; } #endif -- (void)OF_initDecompression +- (void)of_initDecompression { _decompression = [self allocMemoryWithSize: sizeof(*_decompression)]; memset(_decompression, 0, sizeof(*_decompression)); /* 0-7 address the bit, 8 means fetch next byte */ @@ -350,11 +350,11 @@ size_t bytesWritten = 0; uint8_t *slidingWindow; uint16_t slidingWindowIndex; if (ivars == NULL) { - [self OF_initDecompression]; + [self of_initDecompression]; ivars = _decompression; } if (ivars->atEndOfStream) @throw [OFReadFailedException exceptionWithObject: self Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -34,11 +34,11 @@ static struct { Class isa; } placeholder; @interface OFDictionary () -- (OFString *)OF_JSONRepresentationWithOptions: (int)options +- (OFString *)of_JSONRepresentationWithOptions: (int)options depth: (size_t)depth; @end @interface OFDictionary_placeholder: OFDictionary @end @@ -614,22 +614,22 @@ return [element autorelease]; } - (OFString *)JSONRepresentation { - return [self OF_JSONRepresentationWithOptions: 0 + return [self of_JSONRepresentationWithOptions: 0 depth: 0]; } - (OFString *)JSONRepresentationWithOptions: (int)options { - return [self OF_JSONRepresentationWithOptions: options + return [self of_JSONRepresentationWithOptions: options depth: 0]; } -- (OFString *)OF_JSONRepresentationWithOptions: (int)options - depth: (size_t)depth +- (OFString *)of_JSONRepresentationWithOptions: (int)options + depth: (size_t)depth { OFMutableString *JSON = [OFMutableString stringWithString: @"{"]; void *pool = objc_autoreleasePoolPush(); OFEnumerator *keyEnumerator = [self keyEnumerator]; OFEnumerator *objectEnumerator = [self objectEnumerator]; @@ -655,15 +655,15 @@ @throw [OFInvalidArgumentException exception]; [JSON appendString: indentation]; [JSON appendString: @"\t"]; [JSON appendString: [key - OF_JSONRepresentationWithOptions: identifierOptions + of_JSONRepresentationWithOptions: identifierOptions depth: depth + 1]]; [JSON appendString: @": "]; [JSON appendString: [object - OF_JSONRepresentationWithOptions: options + of_JSONRepresentationWithOptions: options depth: depth + 1]]; if (++i < count) [JSON appendString: @",\n"]; else @@ -683,15 +683,15 @@ if (![key isKindOfClass: [OFString class]]) @throw [OFInvalidArgumentException exception]; [JSON appendString: [key - OF_JSONRepresentationWithOptions: identifierOptions + of_JSONRepresentationWithOptions: identifierOptions depth: depth + 1]]; [JSON appendString: @":"]; [JSON appendString: [object - OF_JSONRepresentationWithOptions: options + of_JSONRepresentationWithOptions: options depth: depth + 1]]; if (++i < count) [JSON appendString: @","]; Index: src/OFHTTPClient.m ================================================================== --- src/OFHTTPClient.m +++ src/OFHTTPClient.m @@ -68,29 +68,27 @@ OFTCPSocket *_socket; bool _hasContentLength, _chunked, _keepAlive, _atEndOfStream; size_t _toRead; } +@property (nonatomic, setter=of_setKeepAlive:) bool of_keepAlive; + - initWithSocket: (OFTCPSocket *)socket; -- (void)OF_setKeepAlive: (bool)keepAlive; @end @implementation OFHTTPClientResponse +@synthesize of_keepAlive = _keepAlive; + - initWithSocket: (OFTCPSocket *)socket { self = [super init]; _socket = [socket retain]; return self; } -- (void)OF_setKeepAlive: (bool)keepAlive -{ - _keepAlive = keepAlive; -} - - (void)dealloc { [_socket release]; [super dealloc]; @@ -281,11 +279,11 @@ { return [self performRequest: request redirects: 10]; } -- (OFTCPSocket *)OF_closeAndCreateSocketForRequest: (OFHTTPRequest *)request +- (OFTCPSocket *)of_closeAndCreateSocketForRequest: (OFHTTPRequest *)request { OFURL *URL = [request URL]; OFTCPSocket *socket; [self close]; @@ -367,11 +365,11 @@ } @finally { [_lastResponse release]; _lastResponse = nil; } } else - socket = [self OF_closeAndCreateSocketForRequest: request]; + socket = [self of_closeAndCreateSocketForRequest: request]; /* * As a work around for a bug with split packets in lighttpd when using * HTTPS, we construct the complete request in a buffer string and then * send it all at once. @@ -474,11 +472,11 @@ } @catch (OFWriteFailedException *e) { if ([e errNo] != ECONNRESET && [e errNo] != EPIPE) @throw e; /* Reconnect in case a keep-alive connection timed out */ - socket = [self OF_closeAndCreateSocketForRequest: request]; + socket = [self of_closeAndCreateSocketForRequest: request]; [socket writeString: requestString]; } if (body != nil) [socket writeBuffer: [body items] @@ -494,11 +492,11 @@ * It's possible that the write succeeds on a connection that is * keep-alive, but the connection has already been closed by the remote * end due to a timeout. In this case, we need to reconnect. */ if (line == nil) { - socket = [self OF_closeAndCreateSocketForRequest: request]; + socket = [self of_closeAndCreateSocketForRequest: request]; [socket writeString: requestString]; if (body != nil) [socket writeBuffer: [body items] length: [body count] * @@ -605,11 +603,11 @@ else keepAlive = false; } if (keepAlive) { - [response OF_setKeepAlive: true]; + [response of_setKeepAlive: true]; _socket = [socket retain]; _lastURL = [URL copy]; _lastWasHEAD = (method == OF_HTTP_REQUEST_METHOD_HEAD); _lastResponse = [response retain]; Index: src/OFHTTPServer.m ================================================================== --- src/OFHTTPServer.m +++ src/OFHTTPServer.m @@ -45,11 +45,11 @@ * FIXME: Key normalization replaces headers like "DNT" with "Dnt". * FIXME: Errors are not reported to the user. */ @interface OFHTTPServer () -- (bool)OF_socket: (OFTCPSocket *)socket +- (bool)of_socket: (OFTCPSocket *)socket didAcceptSocket: (OFTCPSocket *)clientSocket exception: (OFException *)exception; @end static const char * @@ -208,11 +208,11 @@ [_request release]; [super dealloc]; } -- (void)OF_sendHeaders +- (void)of_sendHeaders { void *pool = objc_autoreleasePoolPush(); OFMutableDictionary OF_GENERIC(OFString *, OFString *) *headers; OFEnumerator *keyEnumerator, *valueEnumerator; OFString *key, *value; @@ -261,11 +261,11 @@ if (_socket == nil) @throw [OFNotOpenException exceptionWithObject: self]; if (!_headersSent) - [self OF_sendHeaders]; + [self of_sendHeaders]; if (!_chunked) { [_socket writeBuffer: buffer length: length]; return; @@ -286,11 +286,11 @@ if (_socket == nil) @throw [OFNotOpenException exceptionWithObject: self]; @try { if (!_headersSent) - [self OF_sendHeaders]; + [self of_sendHeaders]; if (_chunked) [_socket writeBuffer: "0\r\n\r\n" length: 5]; } @catch (OFWriteFailedException *e) { @@ -717,11 +717,11 @@ _port = [_listeningSocket bindToHost: _host port: _port]; [_listeningSocket listen]; [_listeningSocket asyncAcceptWithTarget: self - selector: @selector(OF_socket: + selector: @selector(of_socket: didAcceptSocket: exception:)]; } - (void)stop @@ -729,11 +729,11 @@ [_listeningSocket cancelAsyncRequests]; [_listeningSocket release]; _listeningSocket = nil; } -- (bool)OF_socket: (OFTCPSocket *)socket +- (bool)of_socket: (OFTCPSocket *)socket didAcceptSocket: (OFTCPSocket *)clientSocket exception: (OFException *)exception { OFHTTPServer_Connection *connection; Index: src/OFINICategory+Private.h ================================================================== --- src/OFINICategory+Private.h +++ src/OFINICategory+Private.h @@ -20,13 +20,13 @@ OF_ASSUME_NONNULL_BEGIN @class OFStream; @interface OFINICategory () -- (instancetype)OF_init OF_METHOD_FAMILY(init); -- (void)OF_parseLine: (OFString *)line; -- (bool)OF_writeToStream: (OFStream *)stream +- (instancetype)of_init OF_METHOD_FAMILY(init); +- (void)of_parseLine: (OFString *)line; +- (bool)of_writeToStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding first: (bool)first; @end OF_ASSUME_NONNULL_END Index: src/OFINICategory.m ================================================================== --- src/OFINICategory.m +++ src/OFINICategory.m @@ -119,11 +119,11 @@ @end @implementation OFINICategory @synthesize name = _name; -- (instancetype)OF_init +- (instancetype)of_init { self = [super init]; @try { _lines = [[OFMutableArray alloc] init]; @@ -146,11 +146,11 @@ [_lines release]; [super dealloc]; } -- (void)OF_parseLine: (OFString *)line +- (void)of_parseLine: (OFString *)line { if (![line hasPrefix: @";"]) { OFINICategory_Pair *pair = [[[OFINICategory_Pair alloc] init] autorelease]; OFString *key, *value; @@ -487,11 +487,11 @@ } objc_autoreleasePoolPop(pool); } -- (bool)OF_writeToStream: (OFStream *)stream +- (bool)of_writeToStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding first: (bool)first { if ([_lines count] == 0) return false; Index: src/OFINIFile.m ================================================================== --- src/OFINIFile.m +++ src/OFINIFile.m @@ -27,11 +27,11 @@ #import "OFInvalidFormatException.h" #import "OFOpenItemFailedException.h" @interface OFINIFile () -- (void)OF_parseFile: (OFString *)path +- (void)of_parseFile: (OFString *)path encoding: (of_string_encoding_t)encoding; @end static bool isWhitespaceLine(OFString *line) @@ -84,11 +84,11 @@ self = [super init]; @try { _categories = [[OFMutableArray alloc] init]; - [self OF_parseFile: path + [self of_parseFile: path encoding: encoding]; } @catch (id e) { [self release]; @throw e; } @@ -110,20 +110,20 @@ for (category in _categories) if ([[category name] isEqual: name]) return category; - category = [[[OFINICategory alloc] OF_init] autorelease]; + category = [[[OFINICategory alloc] of_init] autorelease]; [category setName: name]; [_categories addObject: category]; objc_autoreleasePoolPop(pool); return category; } -- (void)OF_parseFile: (OFString *)path +- (void)of_parseFile: (OFString *)path encoding: (of_string_encoding_t)encoding { void *pool = objc_autoreleasePoolPush(); OFFile *file; OFINICategory *category = nil; @@ -152,18 +152,18 @@ categoryName = [line substringWithRange: of_range(1, [line length] - 2)]; category = [[[OFINICategory alloc] - OF_init] autorelease]; + of_init] autorelease]; [category setName: categoryName]; [_categories addObject: category]; } else { if (category == nil) @throw [OFInvalidFormatException exception]; - [category OF_parseLine: line]; + [category of_parseLine: line]; } } objc_autoreleasePoolPop(pool); } @@ -181,13 +181,13 @@ OFFile *file = [OFFile fileWithPath: path mode: @"w"]; bool first = true; for (OFINICategory *category in _categories) - if ([category OF_writeToStream: file + if ([category of_writeToStream: file encoding: encoding first: first]) first = false; objc_autoreleasePoolPop(pool); } @end Index: src/OFIntrospection.m ================================================================== --- src/OFIntrospection.m +++ src/OFIntrospection.m @@ -31,11 +31,11 @@ { OF_INVALID_INIT_METHOD } #if defined(OF_OBJFW_RUNTIME) -- (instancetype)OF_initWithMethod: (struct objc_method *)method +- (instancetype)of_initWithMethod: (struct objc_method *)method { self = [super init]; @try { _selector = (SEL)&method->sel; @@ -48,11 +48,11 @@ } return self; } #elif defined(OF_APPLE_RUNTIME) -- (instancetype)OF_initWithMethod: (Method)method +- (instancetype)of_initWithMethod: (Method)method { self = [super init]; @try { _selector = method_getName(method); @@ -138,11 +138,11 @@ { OF_INVALID_INIT_METHOD } #if defined(OF_OBJFW_RUNTIME) -- (instancetype)OF_initWithProperty: (struct objc_property *)property +- (instancetype)of_initWithProperty: (struct objc_property *)property { self = [super init]; @try { _name = [[OFString alloc] initWithUTF8String: property->name]; @@ -161,11 +161,11 @@ } return self; } #elif defined(OF_APPLE_RUNTIME) -- (instancetype)OF_initWithProperty: (objc_property_t)property +- (instancetype)of_initWithProperty: (objc_property_t)property { self = [super init]; @try { const char *attributes; @@ -364,11 +364,11 @@ { OF_INVALID_INIT_METHOD } #if defined(OF_OBJFW_RUNTIME) -- (instancetype)OF_initWithIvar: (struct objc_ivar *)ivar +- (instancetype)of_initWithIvar: (struct objc_ivar *)ivar { self = [super init]; @try { _name = [[OFString alloc] initWithUTF8String: ivar->name]; @@ -380,11 +380,11 @@ } return self; } #elif defined(OF_APPLE_RUNTIME) -- (instancetype)OF_initWithIvar: (Ivar)ivar +- (instancetype)of_initWithIvar: (Ivar)ivar { self = [super init]; @try { _name = [[OFString alloc] @@ -457,11 +457,11 @@ methodList != NULL; methodList = methodList->next) { pool = objc_autoreleasePoolPush(); for (unsigned int i = 0; i < methodList->count; i++) [_classMethods addObject: [[[OFMethod alloc] - OF_initWithMethod: + of_initWithMethod: &methodList->methods[i]] autorelease]]; objc_autoreleasePoolPop(pool); } @@ -469,11 +469,11 @@ methodList = methodList->next) { pool = objc_autoreleasePoolPush(); for (unsigned int i = 0; i < methodList->count; i++) [_instanceMethods addObject: [[[OFMethod alloc] - OF_initWithMethod: + of_initWithMethod: &methodList->methods[i]] autorelease]]; objc_autoreleasePoolPop(pool); } @@ -481,11 +481,11 @@ propertyList = propertyList->next) { pool = objc_autoreleasePoolPush(); for (unsigned int i = 0; i < propertyList->count; i++) [_properties addObject: [[[OFProperty alloc] - OF_initWithProperty: + of_initWithProperty: &propertyList->properties[i]] autorelease]]; objc_autoreleasePoolPop(pool); } @@ -493,11 +493,11 @@ pool = objc_autoreleasePoolPush(); for (unsigned int i = 0; i < class->ivars->count; i++) [_instanceVariables addObject: [[[OFInstanceVariable alloc] - OF_initWithIvar: + of_initWithIvar: &class->ivars->ivars[i]] autorelease]]; objc_autoreleasePoolPop(pool); } #elif defined(OF_APPLE_RUNTIME) @@ -506,11 +506,11 @@ @try { pool = objc_autoreleasePoolPush(); for (unsigned int i = 0; i < count; i++) [_classMethods addObject: [[[OFMethod alloc] - OF_initWithMethod: methodList[i]] + of_initWithMethod: methodList[i]] autorelease]]; objc_autoreleasePoolPop(pool); } @finally { free(methodList); @@ -520,11 +520,11 @@ @try { pool = objc_autoreleasePoolPush(); for (unsigned int i = 0; i < count; i++) [_instanceMethods addObject: [[[OFMethod alloc] - OF_initWithMethod: methodList[i]] + of_initWithMethod: methodList[i]] autorelease]]; objc_autoreleasePoolPop(pool); } @finally { free(methodList); @@ -534,11 +534,11 @@ @try { pool = objc_autoreleasePoolPush(); for (unsigned int i = 0; i < count; i++) [_properties addObject: [[[OFProperty alloc] - OF_initWithProperty: propertyList[i]] + of_initWithProperty: propertyList[i]] autorelease]]; objc_autoreleasePoolPop(pool); } @finally { free(propertyList); @@ -549,11 +549,11 @@ pool = objc_autoreleasePoolPush(); for (unsigned int i = 0; i < count; i++) [_instanceVariables addObject: [[[OFInstanceVariable alloc] - OF_initWithIvar: ivarList[i]] autorelease]]; + of_initWithIvar: ivarList[i]] autorelease]]; objc_autoreleasePoolPop(pool); } @finally { free(ivarList); } Index: src/OFKernelEventObserver+Private.h ================================================================== --- src/OFKernelEventObserver+Private.h +++ src/OFKernelEventObserver+Private.h @@ -17,14 +17,14 @@ #import "OFKernelEventObserver.h" OF_ASSUME_NONNULL_BEGIN @interface OFKernelEventObserver () -- (void)OF_addObjectForReading: (id )object; -- (void)OF_addObjectForWriting: (id )object; -- (void)OF_removeObjectForReading: (id )object; -- (void)OF_removeObjectForWriting: (id )object; -- (void)OF_processQueue; -- (bool)OF_processReadBuffers; +- (void)of_addObjectForReading: (id )object; +- (void)of_addObjectForWriting: (id )object; +- (void)of_removeObjectForReading: (id )object; +- (void)of_removeObjectForWriting: (id )object; +- (void)of_processQueue; +- (bool)of_processReadBuffers; @end OF_ASSUME_NONNULL_END Index: src/OFKernelEventObserver.m ================================================================== --- src/OFKernelEventObserver.m +++ src/OFKernelEventObserver.m @@ -271,31 +271,31 @@ #endif [self cancel]; } -- (void)OF_addObjectForReading: (id )object +- (void)of_addObjectForReading: (id )object +{ + OF_UNRECOGNIZED_SELECTOR +} + +- (void)of_addObjectForWriting: (id )object { OF_UNRECOGNIZED_SELECTOR } -- (void)OF_addObjectForWriting: (id )object +- (void)of_removeObjectForReading: (id )object { OF_UNRECOGNIZED_SELECTOR } -- (void)OF_removeObjectForReading: (id )object +- (void)of_removeObjectForWriting: (id )object { OF_UNRECOGNIZED_SELECTOR } -- (void)OF_removeObjectForWriting: (id )object -{ - OF_UNRECOGNIZED_SELECTOR -} - -- (void)OF_processQueue +- (void)of_processQueue { void *pool = objc_autoreleasePoolPush(); #ifdef OF_HAVE_THREADS [_mutex lock]; @@ -314,11 +314,11 @@ switch (action) { case QUEUE_ADD | QUEUE_READ: [_readObjects addObject: object]; @try { - [self OF_addObjectForReading: object]; + [self of_addObjectForReading: object]; } @catch (id e) { [_readObjects removeObjectIdenticalTo: object]; @throw e; @@ -327,27 +327,27 @@ break; case QUEUE_ADD | QUEUE_WRITE: [_writeObjects addObject: object]; @try { - [self OF_addObjectForWriting: object]; + [self of_addObjectForWriting: object]; } @catch (id e) { [_writeObjects removeObjectIdenticalTo: object]; @throw e; } break; case QUEUE_REMOVE | QUEUE_READ: - [self OF_removeObjectForReading: object]; + [self of_removeObjectForReading: object]; [_readObjects removeObjectIdenticalTo: object]; break; case QUEUE_REMOVE | QUEUE_WRITE: - [self OF_removeObjectForWriting: object]; + [self of_removeObjectForWriting: object]; [_writeObjects removeObjectIdenticalTo: object]; break; default: @@ -364,20 +364,20 @@ #endif objc_autoreleasePoolPop(pool); } -- (bool)OF_processReadBuffers +- (bool)of_processReadBuffers { bool foundInReadBuffer = false; for (id object in _readObjects) { void *pool = objc_autoreleasePoolPush(); if ([object isKindOfClass: [OFStream class]] && [object hasDataInReadBuffer] && - ![object OF_isWaitingForDelimiter]) { + ![object of_isWaitingForDelimiter]) { if ([_delegate respondsToSelector: @selector(objectIsReadyForReading:)]) [_delegate objectIsReadyForReading: object]; foundInReadBuffer = true; Index: src/OFKernelEventObserver_epoll.m ================================================================== --- src/OFKernelEventObserver_epoll.m +++ src/OFKernelEventObserver_epoll.m @@ -90,11 +90,11 @@ [_FDToEvents release]; [super dealloc]; } -- (void)OF_addObject: (id)object +- (void)of_addObject: (id)object fileDescriptor: (int)fd events: (int)addEvents { struct epoll_event event; intptr_t events; @@ -113,11 +113,11 @@ [_FDToEvents setObject: (void *)(events | addEvents) forKey: (void *)((intptr_t)fd + 1)]; } -- (void)OF_removeObject: (id)object +- (void)of_removeObject: (id)object fileDescriptor: (int)fd events: (int)removeEvents { intptr_t events; @@ -147,34 +147,34 @@ [_FDToEvents setObject: (void *)events forKey: (void *)((intptr_t)fd + 1)]; } } -- (void)OF_addObjectForReading: (id )object +- (void)of_addObjectForReading: (id )object { - [self OF_addObject: object + [self of_addObject: object fileDescriptor: [object fileDescriptorForReading] events: EPOLLIN]; } -- (void)OF_addObjectForWriting: (id )object +- (void)of_addObjectForWriting: (id )object { - [self OF_addObject: object + [self of_addObject: object fileDescriptor: [object fileDescriptorForWriting] events: EPOLLOUT]; } -- (void)OF_removeObjectForReading: (id )object +- (void)of_removeObjectForReading: (id )object { - [self OF_removeObject: object + [self of_removeObject: object fileDescriptor: [object fileDescriptorForReading] events: EPOLLIN]; } -- (void)OF_removeObjectForWriting: (id )object +- (void)of_removeObjectForWriting: (id )object { - [self OF_removeObject: object + [self of_removeObject: object fileDescriptor: [object fileDescriptorForWriting] events: EPOLLOUT]; } - (void)observeForTimeInterval: (of_time_interval_t)timeInterval @@ -181,13 +181,13 @@ { OFNull *nullObject = [OFNull null]; struct epoll_event eventList[EVENTLIST_SIZE]; int events; - [self OF_processQueue]; + [self of_processQueue]; - if ([self OF_processReadBuffers]) + if ([self of_processReadBuffers]) return; events = epoll_wait(_epfd, eventList, EVENTLIST_SIZE, (timeInterval != -1 ? timeInterval * 1000 : -1)); Index: src/OFKernelEventObserver_kqueue.m ================================================================== --- src/OFKernelEventObserver_kqueue.m +++ src/OFKernelEventObserver_kqueue.m @@ -83,11 +83,11 @@ close(_kernelQueue); [super dealloc]; } -- (void)OF_addObjectForReading: (id )object +- (void)of_addObjectForReading: (id )object { struct kevent event; memset(&event, 0, sizeof(event)); event.ident = [object fileDescriptorForReading]; @@ -102,11 +102,11 @@ if (kevent(_kernelQueue, &event, 1, NULL, 0, NULL) != 0) @throw [OFObserveFailedException exceptionWithObserver: self errNo: errno]; } -- (void)OF_addObjectForWriting: (id )object +- (void)of_addObjectForWriting: (id )object { struct kevent event; memset(&event, 0, sizeof(event)); event.ident = [object fileDescriptorForWriting]; @@ -121,11 +121,11 @@ if (kevent(_kernelQueue, &event, 1, NULL, 0, NULL) != 0) @throw [OFObserveFailedException exceptionWithObserver: self errNo: errno]; } -- (void)OF_removeObjectForReading: (id )object +- (void)of_removeObjectForReading: (id )object { struct kevent event; memset(&event, 0, sizeof(event)); event.ident = [object fileDescriptorForReading]; @@ -135,11 +135,11 @@ if (kevent(_kernelQueue, &event, 1, NULL, 0, NULL) != 0) @throw [OFObserveFailedException exceptionWithObserver: self errNo: errno]; } -- (void)OF_removeObjectForWriting: (id )object +- (void)of_removeObjectForWriting: (id )object { struct kevent event; memset(&event, 0, sizeof(event)); event.ident = [object fileDescriptorForWriting]; @@ -155,13 +155,13 @@ { struct timespec timeout; struct kevent eventList[EVENTLIST_SIZE]; int events; - [self OF_processQueue]; + [self of_processQueue]; - if ([self OF_processReadBuffers]) + if ([self of_processReadBuffers]) return; timeout.tv_sec = (time_t)timeInterval; timeout.tv_nsec = lrint((timeInterval - timeout.tv_sec) * 1000000000); Index: src/OFKernelEventObserver_poll.m ================================================================== --- src/OFKernelEventObserver_poll.m +++ src/OFKernelEventObserver_poll.m @@ -68,11 +68,11 @@ [_FDs release]; [super dealloc]; } -- (void)OF_addObject: (id)object +- (void)of_addObject: (id)object fileDescriptor: (int)fd events: (short)events { struct pollfd *FDs = [_FDs items]; size_t count = [_FDs count]; @@ -99,11 +99,11 @@ _FDToObject[fd] = object; [_FDs addItem: &p]; } } -- (void)OF_removeObject: (id)object +- (void)of_removeObject: (id)object fileDescriptor: (int)fd events: (short)events { struct pollfd *FDs = [_FDs items]; size_t nFDs = [_FDs count]; @@ -123,34 +123,34 @@ break; } } } -- (void)OF_addObjectForReading: (id )object +- (void)of_addObjectForReading: (id )object { - [self OF_addObject: object + [self of_addObject: object fileDescriptor: [object fileDescriptorForReading] events: POLLIN]; } -- (void)OF_addObjectForWriting: (id )object +- (void)of_addObjectForWriting: (id )object { - [self OF_addObject: object + [self of_addObject: object fileDescriptor: [object fileDescriptorForWriting] events: POLLOUT]; } -- (void)OF_removeObjectForReading: (id )object +- (void)of_removeObjectForReading: (id )object { - [self OF_removeObject: object + [self of_removeObject: object fileDescriptor: [object fileDescriptorForReading] events: POLLIN]; } -- (void)OF_removeObjectForWriting: (id )object +- (void)of_removeObjectForWriting: (id )object { - [self OF_removeObject: object + [self of_removeObject: object fileDescriptor: [object fileDescriptorForWriting] events: POLLOUT]; } - (void)observeForTimeInterval: (of_time_interval_t)timeInterval @@ -157,13 +157,13 @@ { struct pollfd *FDs; int events; size_t nFDs; - [self OF_processQueue]; + [self of_processQueue]; - if ([self OF_processReadBuffers]) + if ([self of_processReadBuffers]) return; FDs = [_FDs items]; nFDs = [_FDs count]; Index: src/OFKernelEventObserver_select.m ================================================================== --- src/OFKernelEventObserver_select.m +++ src/OFKernelEventObserver_select.m @@ -63,11 +63,11 @@ _maxFD = (int)_cancelFD[0]; return self; } -- (void)OF_addObjectForReading: (id )object +- (void)of_addObjectForReading: (id )object { int fd = [object fileDescriptorForReading]; if (fd < 0 || fd > INT_MAX - 1) @throw [OFOutOfRangeException exception]; @@ -81,11 +81,11 @@ _maxFD = fd; FD_SET((of_socket_t)fd, &_readFDs); } -- (void)OF_addObjectForWriting: (id )object +- (void)of_addObjectForWriting: (id )object { int fd = [object fileDescriptorForWriting]; if (fd < 0 || fd > INT_MAX - 1) @throw [OFOutOfRangeException exception]; @@ -99,11 +99,11 @@ _maxFD = fd; FD_SET((of_socket_t)fd, &_writeFDs); } -- (void)OF_removeObjectForReading: (id )object +- (void)of_removeObjectForReading: (id )object { /* TODO: Adjust _maxFD */ int fd = [object fileDescriptorForReading]; @@ -116,11 +116,11 @@ #endif FD_CLR((of_socket_t)fd, &_readFDs); } -- (void)OF_removeObjectForWriting: (id )object +- (void)of_removeObjectForWriting: (id )object { /* TODO: Adjust _maxFD */ int fd = [object fileDescriptorForWriting]; @@ -142,13 +142,13 @@ fd_set writeFDs; struct timeval timeout; int events; size_t count; - [self OF_processQueue]; + [self of_processQueue]; - if ([self OF_processReadBuffers]) + if ([self of_processReadBuffers]) return; #ifdef FD_COPY FD_COPY(&_readFDs, &readFDs); FD_COPY(&_writeFDs, &writeFDs); Index: src/OFMD5Hash.h ================================================================== --- src/OFMD5Hash.h +++ src/OFMD5Hash.h @@ -32,10 +32,8 @@ uint32_t words[16]; } _buffer; size_t _bufferLength; bool _calculated; } - -- (void)OF_resetState; @end OF_ASSUME_NONNULL_END Index: src/OFMD5Hash.m ================================================================== --- src/OFMD5Hash.m +++ src/OFMD5Hash.m @@ -19,10 +19,14 @@ #include #import "OFMD5Hash.h" #import "OFHashAlreadyCalculatedException.h" + +@interface OFMD5Hash () +- (void)of_resetState; +@end #define F(a, b, c) (((a) & (b)) | (~(a) & (c))) #define G(a, b, c) (((a) & (c)) | ((b) & ~(c))) #define H(a, b, c) ((a) ^ (b) ^ (c)) #define I(a, b, c) ((b) ^ ((a) | ~(c))) @@ -132,11 +136,11 @@ - init { self = [super init]; - [self OF_resetState]; + [self of_resetState]; return self; } - (void)dealloc @@ -157,11 +161,11 @@ copy->_calculated = _calculated; return copy; } -- (void)OF_resetState +- (void)of_resetState { _state[0] = 0x67452301; _state[1] = 0xEFCDAB89; _state[2] = 0x98BADCFE; _state[3] = 0x10325476; @@ -221,12 +225,12 @@ return (const uint8_t *)_state; } - (void)reset { - [self OF_resetState]; + [self of_resetState]; _bits = 0; memset(&_buffer, 0, sizeof(_buffer)); _bufferLength = 0; _calculated = false; } @end Index: src/OFMapTable.m ================================================================== --- src/OFMapTable.m +++ src/OFMapTable.m @@ -59,17 +59,17 @@ { return (object1 == object2); } @interface OFMapTable () -- (void)OF_setObject: (void *)object +- (void)of_setObject: (void *)object forKey: (void *)key hash: (uint32_t)hash; @end @interface OFMapTableEnumerator () -- (instancetype)OF_initWithMapTable: (OFMapTable *)mapTable +- (instancetype)of_initWithMapTable: (OFMapTable *)mapTable buckets: (struct of_map_table_bucket **)buckets capacity: (uint32_t)capacity mutationsPointer: (unsigned long *)mutationsPtr OF_METHOD_FAMILY(init); @end @@ -243,11 +243,11 @@ capacity: _capacity]; @try { for (uint32_t i = 0; i < _capacity; i++) if (_buckets[i] != NULL && _buckets[i] != &deleted) - [copy OF_setObject: _buckets[i]->object + [copy of_setObject: _buckets[i]->object forKey: _buckets[i]->key hash: OF_ROR(_buckets[i]->hash, _rotate)]; } @catch (id e) { [copy release]; @@ -295,11 +295,11 @@ } return NULL; } -- (void)OF_resizeForCount: (uint32_t)count +- (void)of_resizeForCount: (uint32_t)count { uint32_t fullness, capacity; struct of_map_table_bucket **buckets; if (count > UINT32_MAX / sizeof(*_buckets) || count > UINT32_MAX / 8) @@ -356,11 +356,11 @@ [self freeMemory: _buckets]; _buckets = buckets; _capacity = capacity; } -- (void)OF_setObject: (void *)object +- (void)of_setObject: (void *)object forKey: (void *)key hash: (uint32_t)hash { uint32_t i, last; void *old; @@ -395,11 +395,11 @@ /* Key not in map table */ if (i >= last || _buckets[i] == NULL || _buckets[i] == &deleted || !_keyFunctions.equal(_buckets[i]->key, key)) { struct of_map_table_bucket *bucket; - [self OF_resizeForCount: _count + 1]; + [self of_resizeForCount: _count + 1]; _mutations++; last = _capacity; for (i = hash & (_capacity - 1); i < last && @@ -447,11 +447,11 @@ } - (void)setObject: (void *)object forKey: (void *)key { - [self OF_setObject: object + [self of_setObject: object forKey: key hash: _keyFunctions.hash(key)]; } - (void)removeObjectForKey: (void *)key @@ -476,11 +476,11 @@ [self freeMemory: _buckets[i]]; _buckets[i] = &deleted; _count--; - [self OF_resizeForCount: _count]; + [self of_resizeForCount: _count]; return; } } @@ -501,11 +501,11 @@ [self freeMemory: _buckets[i]]; _buckets[i] = &deleted; _count--; _mutations++; - [self OF_resizeForCount: _count]; + [self of_resizeForCount: _count]; return; } } } @@ -574,20 +574,20 @@ } - (OFMapTableEnumerator *)keyEnumerator { return [[[OFMapTableKeyEnumerator alloc] - OF_initWithMapTable: self + of_initWithMapTable: self buckets: _buckets capacity: _capacity mutationsPointer: &_mutations] autorelease]; } - (OFMapTableEnumerator *)objectEnumerator { return [[[OFMapTableObjectEnumerator alloc] - OF_initWithMapTable: self + of_initWithMapTable: self buckets: _buckets capacity: _capacity mutationsPointer: &_mutations] autorelease]; } @@ -664,11 +664,11 @@ - init { OF_INVALID_INIT_METHOD } -- (instancetype)OF_initWithMapTable: (OFMapTable *)mapTable +- (instancetype)of_initWithMapTable: (OFMapTable *)mapTable buckets: (struct of_map_table_bucket **)buckets capacity: (uint32_t)capacity mutationsPointer: (unsigned long *)mutationsPtr { self = [super init]; Index: src/OFMutableString.m ================================================================== --- src/OFMutableString.m +++ src/OFMutableString.m @@ -238,11 +238,11 @@ return [super alloc]; } #ifdef OF_HAVE_UNICODE_TABLES -- (void)OF_convertWithWordStartTable: (const of_unichar_t *const[])startTable +- (void)of_convertWithWordStartTable: (const of_unichar_t *const[])startTable wordMiddleTable: (const of_unichar_t *const[])middleTable wordStartTableSize: (size_t)startTableSize wordMiddleTableSize: (size_t)middleTableSize { void *pool = objc_autoreleasePoolPush(); @@ -281,11 +281,11 @@ } objc_autoreleasePoolPop(pool); } #else -- (void)OF_convertWithWordStartFunction: (char (*)(char))startFunction +- (void)of_convertWithWordStartFunction: (char (*)(char))startFunction wordMiddleFunction: (char (*)(char))middleFunction { void *pool = objc_autoreleasePoolPush(); const of_unichar_t *characters = [self characters]; size_t length = [self length]; @@ -444,47 +444,47 @@ } #ifdef OF_HAVE_UNICODE_TABLES - (void)uppercase { - [self OF_convertWithWordStartTable: of_unicode_uppercase_table + [self of_convertWithWordStartTable: of_unicode_uppercase_table wordMiddleTable: of_unicode_uppercase_table wordStartTableSize: OF_UNICODE_UPPERCASE_TABLE_SIZE wordMiddleTableSize: OF_UNICODE_UPPERCASE_TABLE_SIZE]; } - (void)lowercase { - [self OF_convertWithWordStartTable: of_unicode_lowercase_table + [self of_convertWithWordStartTable: of_unicode_lowercase_table wordMiddleTable: of_unicode_lowercase_table wordStartTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE wordMiddleTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE]; } - (void)capitalize { - [self OF_convertWithWordStartTable: of_unicode_titlecase_table + [self of_convertWithWordStartTable: of_unicode_titlecase_table wordMiddleTable: of_unicode_lowercase_table wordStartTableSize: OF_UNICODE_TITLECASE_TABLE_SIZE wordMiddleTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE]; } #else - (void)uppercase { - [self OF_convertWithWordStartFunction: of_ascii_toupper + [self of_convertWithWordStartFunction: of_ascii_toupper wordMiddleFunction: of_ascii_toupper]; } - (void)lowercase { - [self OF_convertWithWordStartFunction: of_ascii_tolower + [self of_convertWithWordStartFunction: of_ascii_tolower wordMiddleFunction: of_ascii_tolower]; } - (void)capitalize { - [self OF_convertWithWordStartFunction: of_ascii_toupper + [self of_convertWithWordStartFunction: of_ascii_toupper wordMiddleFunction: of_ascii_tolower]; } #endif - (void)insertString: (OFString *)string Index: src/OFMutableString_UTF8.m ================================================================== --- src/OFMutableString_UTF8.m +++ src/OFMutableString_UTF8.m @@ -52,11 +52,11 @@ } return self; } -- (void)OF_convertWithWordStartTable: (const of_unichar_t *const[])startTable +- (void)of_convertWithWordStartTable: (const of_unichar_t *const[])startTable wordMiddleTable: (const of_unichar_t *const[])middleTable wordStartTableSize: (size_t)startTableSize wordMiddleTableSize: (size_t)middleTableSize { of_unichar_t *unicodeString; Index: src/OFNull.m ================================================================== --- src/OFNull.m +++ src/OFNull.m @@ -22,11 +22,11 @@ #import "OFDataArray.h" #import "OFInvalidArgumentException.h" @interface OFNull () -- (OFString *)OF_JSONRepresentationWithOptions: (int)options +- (OFString *)of_JSONRepresentationWithOptions: (int)options depth: (size_t)depth; @end static OFNull *null = nil; @@ -83,22 +83,22 @@ return [element autorelease]; } - (OFString *)JSONRepresentation { - return [self OF_JSONRepresentationWithOptions: 0 + return [self of_JSONRepresentationWithOptions: 0 depth: 0]; } - (OFString *)JSONRepresentationWithOptions: (int)options { - return [self OF_JSONRepresentationWithOptions: options + return [self of_JSONRepresentationWithOptions: options depth: 0]; } -- (OFString *)OF_JSONRepresentationWithOptions: (int)options - depth: (size_t)depth +- (OFString *)of_JSONRepresentationWithOptions: (int)options + depth: (size_t)depth { return @"null"; } - (OFDataArray *)messagePackRepresentation Index: src/OFNumber.m ================================================================== --- src/OFNumber.m +++ src/OFNumber.m @@ -90,11 +90,11 @@ default: \ @throw [OFInvalidFormatException exception]; \ } @interface OFNumber () -- (OFString *)OF_JSONRepresentationWithOptions: (int)options +- (OFString *)of_JSONRepresentationWithOptions: (int)options depth: (size_t)depth; @end @implementation OFNumber @synthesize type = _type; @@ -1014,21 +1014,21 @@ return [element autorelease]; } - (OFString *)JSONRepresentation { - return [self OF_JSONRepresentationWithOptions: 0 + return [self of_JSONRepresentationWithOptions: 0 depth: 0]; } - (OFString *)JSONRepresentationWithOptions: (int)options { - return [self OF_JSONRepresentationWithOptions: options + return [self of_JSONRepresentationWithOptions: options depth: 0]; } -- (OFString *)OF_JSONRepresentationWithOptions: (int)options +- (OFString *)of_JSONRepresentationWithOptions: (int)options depth: (size_t)depth { double doubleValue; if (_type == OF_NUMBER_TYPE_BOOL) Index: src/OFProcess.m ================================================================== --- src/OFProcess.m +++ src/OFProcess.m @@ -56,16 +56,16 @@ extern char **environ; #endif @interface OFProcess () #ifndef OF_WINDOWS -- (void)OF_getArgV: (char ***)argv +- (void)of_getArgv: (char ***)argv forProgramName: (OFString *)programName andArguments: (OFArray *)arguments; -- (char **)OF_environmentForDictionary: (OFDictionary *)dictionary; +- (char **)of_environmentForDictionary: (OFDictionary *)dictionary; #else -- (char16_t *)OF_environmentForDictionary: (OFDictionary *)dictionary; +- (char16_t *)of_environmentForDictionary: (OFDictionary *)dictionary; #endif @end @implementation OFProcess + (instancetype)processWithProgram: (OFString *)program @@ -148,17 +148,17 @@ if (pipe(_readPipe) != 0 || pipe(_writePipe) != 0) @throw [OFInitializationFailedException exceptionWithClass: [self class]]; path = [program cStringWithEncoding: [OFLocalization encoding]]; - [self OF_getArgV: &argv + [self of_getArgv: &argv forProgramName: programName andArguments: arguments]; @try { char **env = [self - OF_environmentForDictionary: environment]; + of_environmentForDictionary: environment]; # ifdef HAVE_POSIX_SPAWNP posix_spawn_file_actions_t actions; posix_spawnattr_t attr; if (posix_spawn_file_actions_init(&actions) != 0) @@ -304,11 +304,11 @@ ([argumentsString UTF16StringLength] + 1) * 2); @try { if (!CreateProcessW([program UTF16String], argumentsCopy, NULL, NULL, TRUE, CREATE_UNICODE_ENVIRONMENT, - [self OF_environmentForDictionary: environment], + [self of_environmentForDictionary: environment], NULL, &si, &pi)) @throw [OFInitializationFailedException exceptionWithClass: [self class]]; } @finally { [self freeMemory: argumentsCopy]; @@ -336,11 +336,11 @@ [super dealloc]; } #ifndef OF_WINDOWS -- (void)OF_getArgV: (char ***)argv +- (void)of_getArgv: (char ***)argv forProgramName: (OFString *)programName andArguments: (OFArray *)arguments { OFString *const *objects = [arguments objects]; size_t i, count = [arguments count]; @@ -358,11 +358,11 @@ (char *)[objects[i] cStringWithEncoding: encoding]; (*argv)[i + 1] = NULL; } -- (char **)OF_environmentForDictionary: (OFDictionary *)environment +- (char **)of_environmentForDictionary: (OFDictionary *)environment { OFEnumerator *keyEnumerator, *objectEnumerator; char **envp; size_t i, count; of_string_encoding_t encoding; @@ -402,11 +402,11 @@ envp[i] = NULL; return envp; } #else -- (char16_t *)OF_environmentForDictionary: (OFDictionary *)environment +- (char16_t *)of_environmentForDictionary: (OFDictionary *)environment { OFDataArray *env; OFEnumerator *keyEnumerator, *objectEnumerator; OFString *key, *object; const char16_t equal = '='; Index: src/OFRIPEMD160Hash.h ================================================================== --- src/OFRIPEMD160Hash.h +++ src/OFRIPEMD160Hash.h @@ -32,10 +32,8 @@ uint32_t words[16]; } _buffer; size_t _bufferLength; bool _calculated; } - -- (void)OF_resetState; @end OF_ASSUME_NONNULL_END Index: src/OFRIPEMD160Hash.m ================================================================== --- src/OFRIPEMD160Hash.m +++ src/OFRIPEMD160Hash.m @@ -19,10 +19,14 @@ #include #import "OFRIPEMD160Hash.h" #import "OFHashAlreadyCalculatedException.h" + +@interface OFRIPEMD160Hash () +- (void)of_resetState; +@end #define F(a, b, c) ((a) ^ (b) ^ (c)) #define G(a, b, c) (((a) & (b)) | (~(a) & (c))) #define H(a, b, c) (((a) | ~(b)) ^ (c)) #define I(a, b, c) (((a) & (c)) | ((b) & ~(c))) @@ -146,11 +150,11 @@ - init { self = [super init]; - [self OF_resetState]; + [self of_resetState]; return self; } - (void)dealloc @@ -171,11 +175,11 @@ copy->_calculated = _calculated; return copy; } -- (void)OF_resetState +- (void)of_resetState { _state[0] = 0x67452301; _state[1] = 0xEFCDAB89; _state[2] = 0x98BADCFE; _state[3] = 0x10325476; @@ -236,12 +240,12 @@ return (const uint8_t *)_state; } - (void)reset { - [self OF_resetState]; + [self of_resetState]; _bits = 0; memset(&_buffer, 0, sizeof(_buffer)); _bufferLength = 0; _calculated = false; } @end Index: src/OFRunLoop+Private.h ================================================================== --- src/OFRunLoop+Private.h +++ src/OFRunLoop+Private.h @@ -21,56 +21,56 @@ #endif OF_ASSUME_NONNULL_BEGIN @interface OFRunLoop () -+ (void)OF_setMainRunLoop: (OFRunLoop *)runLoop; ++ (void)of_setMainRunLoop: (OFRunLoop *)runLoop; #ifdef OF_HAVE_SOCKETS -+ (void)OF_addAsyncReadForStream: (OFStream *)stream ++ (void)of_addAsyncReadForStream: (OFStream *)stream buffer: (void *)buffer length: (size_t)length target: (id)target selector: (SEL)selector; -+ (void)OF_addAsyncReadForStream: (OFStream *)stream ++ (void)of_addAsyncReadForStream: (OFStream *)stream buffer: (void *)buffer exactLength: (size_t)length target: (id)target selector: (SEL)selector; -+ (void)OF_addAsyncReadLineForStream: (OFStream *)stream ++ (void)of_addAsyncReadLineForStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding target: (id)target selector: (SEL)selector; -+ (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket *)socket ++ (void)of_addAsyncAcceptForTCPSocket: (OFTCPSocket *)socket target: (id)target selector: (SEL)selector; -+ (void)OF_addAsyncReceiveForUDPSocket: (OFUDPSocket *)socket ++ (void)of_addAsyncReceiveForUDPSocket: (OFUDPSocket *)socket buffer: (void *)buffer length: (size_t)length target: (id)target selector: (SEL)selector; # ifdef OF_HAVE_BLOCKS -+ (void)OF_addAsyncReadForStream: (OFStream *)stream ++ (void)of_addAsyncReadForStream: (OFStream *)stream buffer: (void *)buffer length: (size_t)length block: (of_stream_async_read_block_t)block; -+ (void)OF_addAsyncReadForStream: (OFStream *)stream ++ (void)of_addAsyncReadForStream: (OFStream *)stream buffer: (void *)buffer exactLength: (size_t)length block: (of_stream_async_read_block_t)block; -+ (void)OF_addAsyncReadLineForStream: (OFStream *)stream ++ (void)of_addAsyncReadLineForStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding block: (of_stream_async_read_line_block_t)block; -+ (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket *)socket ++ (void)of_addAsyncAcceptForTCPSocket: (OFTCPSocket *)socket block: (of_tcp_socket_async_accept_block_t) block; -+ (void)OF_addAsyncReceiveForUDPSocket: (OFUDPSocket *)socket ++ (void)of_addAsyncReceiveForUDPSocket: (OFUDPSocket *)socket buffer: (void *)buffer length: (size_t)length block: (of_udp_socket_async_receive_block_t) block; # endif -+ (void)OF_cancelAsyncRequestsForObject: (id)object; ++ (void)of_cancelAsyncRequestsForObject: (id)object; #endif -- (void)OF_removeTimer: (OFTimer *)timer; +- (void)of_removeTimer: (OFTimer *)timer; @end OF_ASSUME_NONNULL_END Index: src/OFRunLoop.m ================================================================== --- src/OFRunLoop.m +++ src/OFRunLoop.m @@ -347,11 +347,11 @@ #else return [self mainRunLoop]; #endif } -+ (void)OF_setMainRunLoop: (OFRunLoop *)runLoop ++ (void)of_setMainRunLoop: (OFRunLoop *)runLoop { mainRunLoop = [runLoop retain]; } #ifdef OF_HAVE_SOCKETS @@ -375,11 +375,11 @@ code \ [queue appendObject: queueItem]; \ \ objc_autoreleasePoolPop(pool); -+ (void)OF_addAsyncReadForStream: (OFStream *)stream ++ (void)of_addAsyncReadForStream: (OFStream *)stream buffer: (void *)buffer length: (size_t)length target: (id)target selector: (SEL)selector { @@ -389,11 +389,11 @@ queueItem->_buffer = buffer; queueItem->_length = length; }) } -+ (void)OF_addAsyncReadForStream: (OFStream *)stream ++ (void)of_addAsyncReadForStream: (OFStream *)stream buffer: (void *)buffer exactLength: (size_t)exactLength target: (id)target selector: (SEL)selector { @@ -403,11 +403,11 @@ queueItem->_buffer = buffer; queueItem->_exactLength = exactLength; }) } -+ (void)OF_addAsyncReadLineForStream: (OFStream *)stream ++ (void)of_addAsyncReadLineForStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding target: (id)target selector: (SEL)selector { ADD_READ(OFRunLoop_ReadLineQueueItem, stream, { @@ -415,21 +415,21 @@ queueItem->_selector = selector; queueItem->_encoding = encoding; }) } -+ (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket *)stream ++ (void)of_addAsyncAcceptForTCPSocket: (OFTCPSocket *)stream target: (id)target selector: (SEL)selector { ADD_READ(OFRunLoop_AcceptQueueItem, stream, { queueItem->_target = [target retain]; queueItem->_selector = selector; }) } -+ (void)OF_addAsyncReceiveForUDPSocket: (OFUDPSocket *)socket ++ (void)of_addAsyncReceiveForUDPSocket: (OFUDPSocket *)socket buffer: (void *)buffer length: (size_t)length target: (id)target selector: (SEL)selector { @@ -440,11 +440,11 @@ queueItem->_selector = selector; }) } # ifdef OF_HAVE_BLOCKS -+ (void)OF_addAsyncReadForStream: (OFStream *)stream ++ (void)of_addAsyncReadForStream: (OFStream *)stream buffer: (void *)buffer length: (size_t)length block: (of_stream_async_read_block_t)block { ADD_READ(OFRunLoop_ReadQueueItem, stream, { @@ -452,11 +452,11 @@ queueItem->_buffer = buffer; queueItem->_length = length; }) } -+ (void)OF_addAsyncReadForStream: (OFStream *)stream ++ (void)of_addAsyncReadForStream: (OFStream *)stream buffer: (void *)buffer exactLength: (size_t)exactLength block: (of_stream_async_read_block_t)block { ADD_READ(OFRunLoop_ExactReadQueueItem, stream, { @@ -464,29 +464,29 @@ queueItem->_buffer = buffer; queueItem->_exactLength = exactLength; }) } -+ (void)OF_addAsyncReadLineForStream: (OFStream *)stream ++ (void)of_addAsyncReadLineForStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding block: (of_stream_async_read_line_block_t)block { ADD_READ(OFRunLoop_ReadLineQueueItem, stream, { queueItem->_block = [block copy]; queueItem->_encoding = encoding; }) } -+ (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket *)stream ++ (void)of_addAsyncAcceptForTCPSocket: (OFTCPSocket *)stream block: (of_tcp_socket_async_accept_block_t)block { ADD_READ(OFRunLoop_AcceptQueueItem, stream, { queueItem->_block = [block copy]; }) } -+ (void)OF_addAsyncReceiveForUDPSocket: (OFUDPSocket *)socket ++ (void)of_addAsyncReceiveForUDPSocket: (OFUDPSocket *)socket buffer: (void *)buffer length: (size_t)length block: (of_udp_socket_async_receive_block_t) block { @@ -497,11 +497,11 @@ }) } # endif # undef ADD_READ -+ (void)OF_cancelAsyncRequestsForObject: (id)object ++ (void)of_cancelAsyncRequestsForObject: (id)object { void *pool = objc_autoreleasePoolPush(); OFRunLoop *runLoop = [self currentRunLoop]; OFList *queue; @@ -575,20 +575,20 @@ } @finally { [_timersQueueLock unlock]; } #endif - [timer OF_setInRunLoop: self]; + [timer of_setInRunLoop: self]; #if defined(OF_HAVE_SOCKETS) [_kernelEventObserver cancel]; #elif defined(OF_HAVE_THREADS) [_condition signal]; #endif } -- (void)OF_removeTimer: (OFTimer *)timer +- (void)of_removeTimer: (OFTimer *)timer { #ifdef OF_HAVE_THREADS [_timersQueueLock lock]; @try { #endif @@ -677,11 +677,11 @@ retain] autorelease]; [_timersQueue removeListObject: listObject]; - [timer OF_setInRunLoop: nil]; + [timer of_setInRunLoop: nil]; } else break; #ifdef OF_HAVE_THREADS } @finally { [_timersQueueLock unlock]; Index: src/OFSHA1Hash.h ================================================================== --- src/OFSHA1Hash.h +++ src/OFSHA1Hash.h @@ -32,10 +32,8 @@ uint32_t words[80]; } _buffer; size_t _bufferLength; bool _calculated; } - -- (void)OF_resetState; @end OF_ASSUME_NONNULL_END Index: src/OFSHA1Hash.m ================================================================== --- src/OFSHA1Hash.m +++ src/OFSHA1Hash.m @@ -19,10 +19,14 @@ #include #import "OFSHA1Hash.h" #import "OFHashAlreadyCalculatedException.h" + +@interface OFSHA1Hash () +- (void)of_resetState; +@end #define F(a, b, c, d) ((d) ^ ((b) & ((c) ^ (d)))) #define G(a, b, c, d) ((b) ^ (c) ^ (d)) #define H(a, b, c, d) (((b) & (c)) | ((d) & ((b) | (c)))) #define I(a, b, c, d) ((b) ^ (c) ^ (d)) @@ -106,11 +110,11 @@ - init { self = [super init]; - [self OF_resetState]; + [self of_resetState]; return self; } - (void)dealloc @@ -131,11 +135,11 @@ copy->_calculated = _calculated; return copy; } -- (void)OF_resetState +- (void)of_resetState { _state[0] = 0x67452301; _state[1] = 0xEFCDAB89; _state[2] = 0x98BADCFE; _state[3] = 0x10325476; @@ -196,12 +200,12 @@ return (const uint8_t *)_state; } - (void)reset { - [self OF_resetState]; + [self of_resetState]; _bits = 0; memset(&_buffer, 0, sizeof(_buffer)); _bufferLength = 0; _calculated = false; } @end Index: src/OFSHA224Hash.m ================================================================== --- src/OFSHA224Hash.m +++ src/OFSHA224Hash.m @@ -22,11 +22,11 @@ + (size_t)digestSize { return 28; } -- (void)OF_resetState +- (void)of_resetState { _state[0] = 0xC1059ED8; _state[1] = 0x367CD507; _state[2] = 0x3070DD17; _state[3] = 0xF70E5939; Index: src/OFSHA224Or256Hash.h ================================================================== --- src/OFSHA224Or256Hash.h +++ src/OFSHA224Or256Hash.h @@ -32,10 +32,8 @@ uint32_t words[64]; } _buffer; size_t _bufferLength; bool _calculated; } - -- (void)OF_resetState; @end OF_ASSUME_NONNULL_END Index: src/OFSHA224Or256Hash.m ================================================================== --- src/OFSHA224Or256Hash.m +++ src/OFSHA224Or256Hash.m @@ -20,10 +20,14 @@ #include #import "OFSHA224Or256Hash.h" #import "OFHashAlreadyCalculatedException.h" + +@interface OFSHA224Or256Hash () +- (void)of_resetState; +@end static const uint32_t table[] = { 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, @@ -134,11 +138,11 @@ if ([self class] == [OFSHA224Or256Hash class]) { [self doesNotRecognizeSelector: _cmd]; abort(); } - [self OF_resetState]; + [self of_resetState]; } @catch (id e) { [self release]; @throw e; } @@ -219,17 +223,17 @@ return (const uint8_t *)_state; } - (void)reset { - [self OF_resetState]; + [self of_resetState]; _bits = 0; memset(&_buffer, 0, sizeof(_buffer)); _bufferLength = 0; _calculated = false; } -- (void)OF_resetState +- (void)of_resetState { OF_UNRECOGNIZED_SELECTOR } @end Index: src/OFSHA256Hash.m ================================================================== --- src/OFSHA256Hash.m +++ src/OFSHA256Hash.m @@ -22,11 +22,11 @@ + (size_t)digestSize { return 32; } -- (void)OF_resetState +- (void)of_resetState { _state[0] = 0x6A09E667; _state[1] = 0xBB67AE85; _state[2] = 0x3C6EF372; _state[3] = 0xA54FF53A; Index: src/OFSHA384Hash.m ================================================================== --- src/OFSHA384Hash.m +++ src/OFSHA384Hash.m @@ -22,11 +22,11 @@ + (size_t)digestSize { return 48; } -- (void)OF_resetState +- (void)of_resetState { _state[0] = 0xCBBB9D5DC1059ED8; _state[1] = 0x629A292A367CD507; _state[2] = 0x9159015A3070DD17; _state[3] = 0x152FECD8F70E5939; Index: src/OFSHA384Or512Hash.h ================================================================== --- src/OFSHA384Or512Hash.h +++ src/OFSHA384Or512Hash.h @@ -32,10 +32,8 @@ uint64_t words[80]; } _buffer; size_t _bufferLength; bool _calculated; } - -- (void)OF_resetState; @end OF_ASSUME_NONNULL_END Index: src/OFSHA384Or512Hash.m ================================================================== --- src/OFSHA384Or512Hash.m +++ src/OFSHA384Or512Hash.m @@ -20,10 +20,14 @@ #include #import "OFSHA384Or512Hash.h" #import "OFHashAlreadyCalculatedException.h" + +@interface OFSHA384Or512Hash () +- (void)of_resetState; +@end static const uint64_t table[] = { 0x428A2F98D728AE22, 0x7137449123EF65CD, 0xB5C0FBCFEC4D3B2F, 0xE9B5DBA58189DBBC, 0x3956C25BF348B538, 0x59F111F1B605D019, 0x923F82A4AF194F9B, 0xAB1C5ED5DA6D8118, 0xD807AA98A3030242, @@ -145,11 +149,11 @@ if ([self class] == [OFSHA384Or512Hash class]) { [self doesNotRecognizeSelector: _cmd]; abort(); } - [self OF_resetState]; + [self of_resetState]; } @catch (id e) { [self release]; @throw e; } @@ -232,17 +236,17 @@ return (const uint8_t *)_state; } - (void)reset { - [self OF_resetState]; + [self of_resetState]; memset(_bits, 0, sizeof(_bits)); memset(&_buffer, 0, sizeof(_buffer)); _bufferLength = 0; _calculated = false; } -- (void)OF_resetState +- (void)of_resetState { OF_UNRECOGNIZED_SELECTOR } @end Index: src/OFSHA512Hash.m ================================================================== --- src/OFSHA512Hash.m +++ src/OFSHA512Hash.m @@ -22,11 +22,11 @@ + (size_t)digestSize { return 64; } -- (void)OF_resetState +- (void)of_resetState { _state[0] = 0x6A09E667F3BCC908; _state[1] = 0xBB67AE8584CAA73B; _state[2] = 0x3C6EF372FE94F82B; _state[3] = 0xA54FF53A5F1D36F1; Index: src/OFSettings_INIFile.m ================================================================== --- src/OFSettings_INIFile.m +++ src/OFSettings_INIFile.m @@ -51,11 +51,11 @@ [_INIFile release]; [super dealloc]; } -- (void)OF_getCategory: (OFString **)category +- (void)of_getCategory: (OFString **)category andKey: (OFString **)key forPath: (OFString *)path { size_t pos = [path rangeOfString: @"." options: OF_STRING_SEARCH_BACKWARDS].location; @@ -75,11 +75,11 @@ forPath: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; - [self OF_getCategory: &category + [self of_getCategory: &category andKey: &key forPath: path]; [[_INIFile categoryForName: category] setString: string forKey: key]; @@ -91,11 +91,11 @@ forPath: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; - [self OF_getCategory: &category + [self of_getCategory: &category andKey: &key forPath: path]; [[_INIFile categoryForName: category] setInteger: integer forKey: key]; @@ -107,11 +107,11 @@ forPath: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; - [self OF_getCategory: &category + [self of_getCategory: &category andKey: &key forPath: path]; [[_INIFile categoryForName: category] setBool: bool_ forKey: key]; @@ -123,11 +123,11 @@ forPath: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; - [self OF_getCategory: &category + [self of_getCategory: &category andKey: &key forPath: path]; [[_INIFile categoryForName: category] setFloat: float_ forKey: key]; @@ -139,11 +139,11 @@ forPath: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; - [self OF_getCategory: &category + [self of_getCategory: &category andKey: &key forPath: path]; [[_INIFile categoryForName: category] setDouble: double_ forKey: key]; @@ -155,11 +155,11 @@ forPath: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; - [self OF_getCategory: &category + [self of_getCategory: &category andKey: &key forPath: path]; [[_INIFile categoryForName: category] setArray: array forKey: key]; @@ -171,11 +171,11 @@ defaultValue: (OFString *)defaultValue { void *pool = objc_autoreleasePoolPush(); OFString *category, *key, *ret; - [self OF_getCategory: &category + [self of_getCategory: &category andKey: &key forPath: path]; ret = [[_INIFile categoryForName: category] stringForKey: key defaultValue: defaultValue]; @@ -190,11 +190,11 @@ { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; intmax_t ret; - [self OF_getCategory: &category + [self of_getCategory: &category andKey: &key forPath: path]; ret = [[_INIFile categoryForName: category] integerForKey: key @@ -210,11 +210,11 @@ { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; bool ret; - [self OF_getCategory: &category + [self of_getCategory: &category andKey: &key forPath: path]; ret = [[_INIFile categoryForName: category] boolForKey: key defaultValue: defaultValue]; @@ -229,11 +229,11 @@ { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; float ret; - [self OF_getCategory: &category + [self of_getCategory: &category andKey: &key forPath: path]; ret = [[_INIFile categoryForName: category] floatForKey: key defaultValue: defaultValue]; @@ -248,11 +248,11 @@ { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; double ret; - [self OF_getCategory: &category + [self of_getCategory: &category andKey: &key forPath: path]; ret = [[_INIFile categoryForName: category] doubleForKey: key defaultValue: defaultValue]; @@ -266,11 +266,11 @@ { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; OFArray *ret; - [self OF_getCategory: &category + [self of_getCategory: &category andKey: &key forPath: path]; ret = [[_INIFile categoryForName: category] arrayForKey: key]; @@ -282,11 +282,11 @@ - (void)removeValueForPath: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; - [self OF_getCategory: &category + [self of_getCategory: &category andKey: &key forPath: path]; [[_INIFile categoryForName: category] removeValueForKey: key]; Index: src/OFStdIOStream+Private.h ================================================================== --- src/OFStdIOStream+Private.h +++ src/OFStdIOStream+Private.h @@ -17,9 +17,9 @@ #import "OFStdIOStream.h" OF_ASSUME_NONNULL_BEGIN @interface OFStdIOStream () -- (instancetype)OF_initWithFileDescriptor: (int)fd OF_METHOD_FAMILY(init); +- (instancetype)of_initWithFileDescriptor: (int)fd OF_METHOD_FAMILY(init); @end OF_ASSUME_NONNULL_END Index: src/OFStdIOStream.m ================================================================== --- src/OFStdIOStream.m +++ src/OFStdIOStream.m @@ -82,22 +82,22 @@ @implementation OFStdIOStream #ifndef OF_WINDOWS + (void)load { - of_stdin = [[OFStdIOStream alloc] OF_initWithFileDescriptor: 0]; - of_stdout = [[OFStdIOStream alloc] OF_initWithFileDescriptor: 1]; - of_stderr = [[OFStdIOStream alloc] OF_initWithFileDescriptor: 2]; + of_stdin = [[OFStdIOStream alloc] of_initWithFileDescriptor: 0]; + of_stdout = [[OFStdIOStream alloc] of_initWithFileDescriptor: 1]; + of_stderr = [[OFStdIOStream alloc] of_initWithFileDescriptor: 2]; } #endif - init { OF_INVALID_INIT_METHOD } -- (instancetype)OF_initWithFileDescriptor: (int)fd +- (instancetype)of_initWithFileDescriptor: (int)fd { self = [super init]; _fd = fd; Index: src/OFStdIOStream_Win32Console.m ================================================================== --- src/OFStdIOStream_Win32Console.m +++ src/OFStdIOStream_Win32Console.m @@ -59,20 +59,20 @@ @implementation OFStdIOStream_Win32Console + (void)load { of_stdin = [[OFStdIOStream_Win32Console alloc] - OF_initWithFileDescriptor: 0]; + of_initWithFileDescriptor: 0]; of_stdout = [[OFStdIOStream_Win32Console alloc] - OF_initWithFileDescriptor: 1]; + of_initWithFileDescriptor: 1]; of_stderr = [[OFStdIOStream_Win32Console alloc] - OF_initWithFileDescriptor: 2]; + of_initWithFileDescriptor: 2]; } -- (instancetype)OF_initWithFileDescriptor: (int)fd +- (instancetype)of_initWithFileDescriptor: (int)fd { - self = [super OF_initWithFileDescriptor: fd]; + self = [super of_initWithFileDescriptor: fd]; @try { DWORD mode; switch (fd) { Index: src/OFStream+Private.h ================================================================== --- src/OFStream+Private.h +++ src/OFStream+Private.h @@ -17,10 +17,10 @@ #import "OFStream.h" OF_ASSUME_NONNULL_BEGIN @interface OFStream () -@property (readonly, nonatomic, getter=OF_isWaitingForDelimiter) - bool OF_waitingForDelimiter; +@property (readonly, nonatomic, getter=of_isWaitingForDelimiter) + bool of_waitingForDelimiter; @end OF_ASSUME_NONNULL_END Index: src/OFStream.m ================================================================== --- src/OFStream.m +++ src/OFStream.m @@ -52,11 +52,11 @@ #import "of_asprintf.h" #define MIN_READ_SIZE 512 @implementation OFStream -@synthesize OF_waitingForDelimiter = _waitingForDelimiter; +@synthesize of_waitingForDelimiter = _waitingForDelimiter; #ifndef OF_WINDOWS + (void)initialize { if (self == [OFStream class]) @@ -185,11 +185,11 @@ - (void)asyncReadIntoBuffer: (void *)buffer length: (size_t)length target: (id)target selector: (SEL)selector { - [OFRunLoop OF_addAsyncReadForStream: self + [OFRunLoop of_addAsyncReadForStream: self buffer: buffer length: length target: target selector: selector]; } @@ -197,11 +197,11 @@ - (void)asyncReadIntoBuffer: (void *)buffer exactLength: (size_t)length target: (id)target selector: (SEL)selector { - [OFRunLoop OF_addAsyncReadForStream: self + [OFRunLoop of_addAsyncReadForStream: self buffer: buffer exactLength: length target: target selector: selector]; } @@ -209,21 +209,21 @@ # ifdef OF_HAVE_BLOCKS - (void)asyncReadIntoBuffer: (void *)buffer length: (size_t)length block: (of_stream_async_read_block_t)block { - [OFRunLoop OF_addAsyncReadForStream: self + [OFRunLoop of_addAsyncReadForStream: self buffer: buffer length: length block: block]; } - (void)asyncReadIntoBuffer: (void *)buffer exactLength: (size_t)length block: (of_stream_async_read_block_t)block { - [OFRunLoop OF_addAsyncReadForStream: self + [OFRunLoop of_addAsyncReadForStream: self buffer: buffer exactLength: length block: block]; } # endif @@ -760,11 +760,11 @@ - (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding target: (id)target selector: (SEL)selector { - [OFRunLoop OF_addAsyncReadLineForStream: self + [OFRunLoop of_addAsyncReadLineForStream: self encoding: encoding target: target selector: selector]; } @@ -776,11 +776,11 @@ } - (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding block: (of_stream_async_read_line_block_t)block { - [OFRunLoop OF_addAsyncReadLineForStream: self + [OFRunLoop of_addAsyncReadLineForStream: self encoding: encoding block: block]; } # endif #endif @@ -1515,11 +1515,11 @@ } #ifdef OF_HAVE_SOCKETS - (void)cancelAsyncRequests { - [OFRunLoop OF_cancelAsyncRequestsForObject: self]; + [OFRunLoop of_cancelAsyncRequestsForObject: self]; } #endif - (void)unreadFromBuffer: (const void *)buffer length: (size_t)length Index: src/OFString+CryptoHashing.m ================================================================== --- src/OFString+CryptoHashing.m +++ src/OFString+CryptoHashing.m @@ -27,11 +27,11 @@ #import "OFSHA512Hash.h" int _OFString_CryptoHashing_reference; @implementation OFString (CryptoHashing) -- (OFString *)OF_cryptoHashWithClass: (Class )class +- (OFString *)of_cryptoHashWithClass: (Class )class { void *pool = objc_autoreleasePoolPush(); id hash = [class cryptoHash]; size_t digestSize = [class digestSize]; const unsigned char *digest; @@ -58,38 +58,38 @@ length: digestSize * 2]; } - (OFString *)MD5Hash { - return [self OF_cryptoHashWithClass: [OFMD5Hash class]]; + return [self of_cryptoHashWithClass: [OFMD5Hash class]]; } - (OFString *)RIPEMD160Hash { - return [self OF_cryptoHashWithClass: [OFRIPEMD160Hash class]]; + return [self of_cryptoHashWithClass: [OFRIPEMD160Hash class]]; } - (OFString *)SHA1Hash { - return [self OF_cryptoHashWithClass: [OFSHA1Hash class]]; + return [self of_cryptoHashWithClass: [OFSHA1Hash class]]; } - (OFString *)SHA224Hash { - return [self OF_cryptoHashWithClass: [OFSHA224Hash class]]; + return [self of_cryptoHashWithClass: [OFSHA224Hash class]]; } - (OFString *)SHA256Hash { - return [self OF_cryptoHashWithClass: [OFSHA256Hash class]]; + return [self of_cryptoHashWithClass: [OFSHA256Hash class]]; } - (OFString *)SHA384Hash { - return [self OF_cryptoHashWithClass: [OFSHA384Hash class]]; + return [self of_cryptoHashWithClass: [OFSHA384Hash class]]; } - (OFString *)SHA512Hash { - return [self OF_cryptoHashWithClass: [OFSHA512Hash class]]; + return [self of_cryptoHashWithClass: [OFSHA512Hash class]]; } @end Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -78,17 +78,17 @@ #if defined(HAVE_STRTOF_L) || defined(HAVE_STRTOD_L) static locale_t cLocale; #endif @interface OFString () -- (size_t)OF_getCString: (char *)cString +- (size_t)of_getCString: (char *)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding lossy: (bool)lossy; -- (const char *)OF_cStringWithEncoding: (of_string_encoding_t)encoding +- (const char *)of_cStringWithEncoding: (of_string_encoding_t)encoding lossy: (bool)lossy; -- (OFString *)OF_JSONRepresentationWithOptions: (int)options +- (OFString *)of_JSONRepresentationWithOptions: (int)options depth: (size_t)depth; @end extern bool of_unicode_to_iso_8859_2(const of_unichar_t *, unsigned char *, size_t, bool); @@ -369,11 +369,11 @@ length = strlen(UTF8String); string = of_alloc_object([OFString_UTF8 class], length + 1, 1, &storage); - return (id)[string OF_initWithUTF8String: UTF8String + return (id)[string of_initWithUTF8String: UTF8String length: length storage: storage]; } - initWithUTF8String: (const char *)UTF8String @@ -383,11 +383,11 @@ void *storage; string = of_alloc_object([OFString_UTF8 class], UTF8StringLength + 1, 1, &storage); - return (id)[string OF_initWithUTF8String: UTF8String + return (id)[string of_initWithUTF8String: UTF8String length: UTF8StringLength storage: storage]; } - initWithUTF8StringNoCopy: (char *)UTF8String @@ -408,11 +408,11 @@ length = strlen(cString); string = of_alloc_object([OFString_UTF8 class], length + 1, 1, &storage); - return (id)[string OF_initWithUTF8String: cString + return (id)[string of_initWithUTF8String: cString length: length storage: storage]; } return (id)[[OFString_UTF8 alloc] initWithCString: cString @@ -428,11 +428,11 @@ void *storage; string = of_alloc_object([OFString_UTF8 class], cStringLength + 1, 1, &storage); - return (id)[string OF_initWithUTF8String: cString + return (id)[string of_initWithUTF8String: cString length: cStringLength storage: storage]; } return (id)[[OFString_UTF8 alloc] initWithCString: cString @@ -1046,11 +1046,11 @@ } return self; } -- (size_t)OF_getCString: (char *)cString +- (size_t)of_getCString: (char *)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding lossy: (bool)lossy { const of_unichar_t *characters = [self characters]; @@ -1281,27 +1281,27 @@ - (size_t)getCString: (char *)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding { - return [self OF_getCString: cString + return [self of_getCString: cString maxLength: maxLength encoding: encoding lossy: false]; } - (size_t)getLossyCString: (char *)cString maxLength: (size_t)maxLength encoding: (of_string_encoding_t)encoding { - return [self OF_getCString: cString + return [self of_getCString: cString maxLength: maxLength encoding: encoding lossy: true]; } -- (const char *)OF_cStringWithEncoding: (of_string_encoding_t)encoding +- (const char *)of_cStringWithEncoding: (of_string_encoding_t)encoding lossy: (bool)lossy { OFObject *object = [[[OFObject alloc] init] autorelease]; size_t length = [self length]; char *cString; @@ -1310,11 +1310,11 @@ case OF_STRING_ENCODING_UTF_8:; size_t cStringLength; cString = [object allocMemoryWithSize: (length * 4) + 1]; - cStringLength = [self OF_getCString: cString + cStringLength = [self of_getCString: cString maxLength: (length * 4) + 1 encoding: OF_STRING_ENCODING_UTF_8 lossy: lossy]; @try { @@ -1338,11 +1338,11 @@ case OF_STRING_ENCODING_MAC_ROMAN: case OF_STRING_ENCODING_KOI8_R: case OF_STRING_ENCODING_KOI8_U: cString = [object allocMemoryWithSize: length + 1]; - [self OF_getCString: cString + [self of_getCString: cString maxLength: length + 1 encoding: encoding lossy: lossy]; break; @@ -1353,17 +1353,17 @@ return cString; } - (const char *)cStringWithEncoding: (of_string_encoding_t)encoding { - return [self OF_cStringWithEncoding: encoding + return [self of_cStringWithEncoding: encoding lossy: false]; } - (const char *)lossyCStringWithEncoding: (of_string_encoding_t)encoding { - return [self OF_cStringWithEncoding: encoding + return [self of_cStringWithEncoding: encoding lossy: true]; } - (const char *)UTF8String { @@ -1630,21 +1630,21 @@ return [element autorelease]; } - (OFString *)JSONRepresentation { - return [self OF_JSONRepresentationWithOptions: 0 + return [self of_JSONRepresentationWithOptions: 0 depth: 0]; } - (OFString *)JSONRepresentationWithOptions: (int)options { - return [self OF_JSONRepresentationWithOptions: options + return [self of_JSONRepresentationWithOptions: options depth: 0]; } -- (OFString *)OF_JSONRepresentationWithOptions: (int)options +- (OFString *)of_JSONRepresentationWithOptions: (int)options depth: (size_t)depth { OFMutableString *JSON = [[self mutableCopy] autorelease]; /* FIXME: This is slow! Write it in pure C! */ Index: src/OFString_UTF8+Private.h ================================================================== --- src/OFString_UTF8+Private.h +++ src/OFString_UTF8+Private.h @@ -17,11 +17,11 @@ #import "OFString_UTF8.h" OF_ASSUME_NONNULL_BEGIN @interface OFString_UTF8 () -- (instancetype)OF_initWithUTF8String: (const char *)UTF8String +- (instancetype)of_initWithUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength storage: (char *)storage OF_METHOD_FAMILY(init); @end OF_ASSUME_NONNULL_END Index: src/OFString_UTF8.m ================================================================== --- src/OFString_UTF8.m +++ src/OFString_UTF8.m @@ -185,11 +185,11 @@ } return self; } -- (instancetype)OF_initWithUTF8String: (const char *)UTF8String +- (instancetype)of_initWithUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength storage: (char *)storage { self = [super init]; Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -571,19 +571,19 @@ } - (void)asyncAcceptWithTarget: (id)target selector: (SEL)selector { - [OFRunLoop OF_addAsyncAcceptForTCPSocket: self + [OFRunLoop of_addAsyncAcceptForTCPSocket: self target: target selector: selector]; } #ifdef OF_HAVE_BLOCKS - (void)asyncAcceptWithBlock: (of_tcp_socket_async_accept_block_t)block { - [OFRunLoop OF_addAsyncAcceptForTCPSocket: self + [OFRunLoop of_addAsyncAcceptForTCPSocket: self block: block]; } #endif - (OFString *)remoteAddress Index: src/OFTarArchive.m ================================================================== --- src/OFTarArchive.m +++ src/OFTarArchive.m @@ -77,11 +77,11 @@ char c[512]; uint32_t u32[512 / sizeof(uint32_t)]; } buffer; bool empty = true; - [_lastReturnedEntry OF_skip]; + [_lastReturnedEntry of_skip]; [_lastReturnedEntry close]; [_lastReturnedEntry release]; _lastReturnedEntry = nil; if ([_stream isAtEndOfStream]) @@ -104,11 +104,11 @@ return nil; } _lastReturnedEntry = [[OFTarArchiveEntry alloc] - OF_initWithHeader: buffer.c + of_initWithHeader: buffer.c stream: _stream]; return _lastReturnedEntry; } @end Index: src/OFTarArchiveEntry+Private.h ================================================================== --- src/OFTarArchiveEntry+Private.h +++ src/OFTarArchiveEntry+Private.h @@ -17,11 +17,11 @@ #import "OFTarArchiveEntry.h" OF_ASSUME_NONNULL_BEGIN @interface OFTarArchiveEntry () -- (instancetype)OF_initWithHeader: (char[_Nonnull 512])header +- (instancetype)of_initWithHeader: (char [_Nonnull 512])header stream: (OFStream *)stream OF_METHOD_FAMILY(init); -- (void)OF_skip; +- (void)of_skip; @end OF_ASSUME_NONNULL_END Index: src/OFTarArchiveEntry.m ================================================================== --- src/OFTarArchiveEntry.m +++ src/OFTarArchiveEntry.m @@ -60,11 +60,11 @@ - init { OF_INVALID_INIT_METHOD } -- (instancetype)OF_initWithHeader: (char[512])header +- (instancetype)of_initWithHeader: (char [512])header stream: (OFStream *)stream { self = [super init]; @try { @@ -163,11 +163,11 @@ _atEndOfStream = true; [super close]; } -- (void)OF_skip +- (void)of_skip { char buffer[512]; while (_toRead >= 512) { [_stream readIntoBuffer: buffer Index: src/OFThread+Private.h ================================================================== --- src/OFThread+Private.h +++ src/OFThread+Private.h @@ -18,10 +18,10 @@ OF_ASSUME_NONNULL_BEGIN #ifdef OF_HAVE_THREADS @interface OFThread () -+ (void)OF_createMainThread; ++ (void)of_createMainThread; @end #endif OF_ASSUME_NONNULL_END Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -120,11 +120,11 @@ [thread handleTermination]; thread->_running = OF_THREAD_WAITING_FOR_JOIN; objc_autoreleasePoolPop(thread->_pool); - [OFAutoreleasePool OF_handleThreadTermination]; + [OFAutoreleasePool of_handleThreadTermination]; [thread release]; } #endif @@ -259,18 +259,18 @@ thread->_running = OF_THREAD_WAITING_FOR_JOIN; objc_autoreleasePoolPop(thread->_pool); } - [OFAutoreleasePool OF_handleThreadTermination]; + [OFAutoreleasePool of_handleThreadTermination]; [thread release]; of_thread_exit(); } -+ (void)OF_createMainThread ++ (void)of_createMainThread { mainThread = [[OFThread alloc] init]; mainThread->_thread = of_thread_current(); if (!of_tlskey_set(threadSelfKey, mainThread)) Index: src/OFThreadPool.m ================================================================== --- src/OFThreadPool.m +++ src/OFThreadPool.m @@ -314,11 +314,11 @@ [_countCondition release]; [super dealloc]; } -- (void)OF_dispatchJob: (OFThreadPoolJob *)job +- (void)of_dispatchJob: (OFThreadPoolJob *)job { [_countCondition lock]; _count++; [_countCondition unlock]; @@ -348,22 +348,22 @@ - (void)dispatchWithTarget: (id)target selector: (SEL)selector object: (id)object { - [self OF_dispatchJob: [OFThreadPoolJob jobWithTarget: target + [self of_dispatchJob: [OFThreadPoolJob jobWithTarget: target selector: selector object: object]]; } #ifdef OF_HAVE_BLOCKS - (void)dispatchWithBlock: (of_thread_pool_block_t)block { - [self OF_dispatchJob: [OFThreadPoolJob jobWithBlock: block]]; + [self of_dispatchJob: [OFThreadPoolJob jobWithBlock: block]]; } #endif - (size_t)size { return _size; } @end Index: src/OFTimer+Private.h ================================================================== --- src/OFTimer+Private.h +++ src/OFTimer+Private.h @@ -17,10 +17,10 @@ #import "OFTimer.h" OF_ASSUME_NONNULL_BEGIN @interface OFTimer () -@property OF_NULLABLE_PROPERTY (nonatomic, retain, setter=OF_setInRunLoop:) - OFRunLoop *OF_inRunLoop; +@property OF_NULLABLE_PROPERTY (nonatomic, retain, setter=of_setInRunLoop:) + OFRunLoop *of_inRunLoop; @end OF_ASSUME_NONNULL_END Index: src/OFTimer.m ================================================================== --- src/OFTimer.m +++ src/OFTimer.m @@ -31,11 +31,11 @@ #import "OFInvalidArgumentException.h" @implementation OFTimer @synthesize timeInterval = _interval, repeating = _repeats, valid = _valid; -@synthesize OF_inRunLoop = _inRunLoop; +@synthesize of_inRunLoop = _inRunLoop; + (instancetype)scheduledTimerWithTimeInterval: (of_time_interval_t)timeInterval target: (id)target selector: (SEL)selector repeats: (bool)repeats @@ -210,18 +210,18 @@ - init { OF_INVALID_INIT_METHOD } -- (instancetype)OF_initWithFireDate: (OFDate *)fireDate +- (instancetype)of_initWithFireDate: (OFDate *)fireDate interval: (of_time_interval_t)interval target: (id)target selector: (SEL)selector object: (id)object1 object: (id)object2 arguments: (uint8_t)arguments - repeats: (bool)repeats + repeats: (bool)repeats OF_METHOD_FAMILY(init) { self = [super init]; @try { _fireDate = [fireDate retain]; @@ -248,11 +248,11 @@ interval: (of_time_interval_t)interval target: (id)target selector: (SEL)selector repeats: (bool)repeats { - return [self OF_initWithFireDate: fireDate + return [self of_initWithFireDate: fireDate interval: interval target: target selector: selector object: nil object: nil @@ -265,11 +265,11 @@ target: (id)target selector: (SEL)selector object: (id)object repeats: (bool)repeats { - return [self OF_initWithFireDate: fireDate + return [self of_initWithFireDate: fireDate interval: interval target: target selector: selector object: object object: nil @@ -283,11 +283,11 @@ selector: (SEL)selector object: (id)object1 object: (id)object2 repeats: (bool)repeats { - return [self OF_initWithFireDate: fireDate + return [self of_initWithFireDate: fireDate interval: interval target: target selector: selector object: object1 object: object2 @@ -420,11 +420,11 @@ [self retain]; @try { @synchronized (self) { OFDate *old; - [_inRunLoop OF_removeTimer: self]; + [_inRunLoop of_removeTimer: self]; old = _fireDate; _fireDate = [fireDate copy]; [old release]; Index: src/OFUDPSocket.m ================================================================== --- src/OFUDPSocket.m +++ src/OFUDPSocket.m @@ -557,11 +557,11 @@ - (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length target: (id)target selector: (SEL)selector { - [OFRunLoop OF_addAsyncReceiveForUDPSocket: self + [OFRunLoop of_addAsyncReceiveForUDPSocket: self buffer: buffer length: length target: target selector: selector]; } @@ -569,11 +569,11 @@ #ifdef OF_HAVE_BLOCKS - (void)asyncReceiveIntoBuffer: (void *)buffer length: (size_t)length block: (of_udp_socket_async_receive_block_t)block { - [OFRunLoop OF_addAsyncReceiveForUDPSocket: self + [OFRunLoop of_addAsyncReceiveForUDPSocket: self buffer: buffer length: length block: block]; } #endif @@ -610,11 +610,11 @@ #endif } - (void)cancelAsyncRequests { - [OFRunLoop OF_cancelAsyncRequestsForObject: self]; + [OFRunLoop of_cancelAsyncRequestsForObject: self]; } - (int)fileDescriptorForReading { #ifndef OF_WINDOWS Index: src/OFXMLAttribute.m ================================================================== --- src/OFXMLAttribute.m +++ src/OFXMLAttribute.m @@ -53,11 +53,11 @@ - initWithName: (OFString *)name namespace: (OFString *)namespace stringValue: (OFString *)stringValue { - self = [super OF_init]; + self = [super of_init]; @try { _name = [name copy]; _namespace = [namespace copy]; _stringValue = [stringValue copy]; @@ -69,11 +69,11 @@ return self; } - initWithSerialization: (OFXMLElement *)element { - self = [super OF_init]; + self = [super of_init]; @try { void *pool = objc_autoreleasePoolPush(); if (![[element name] isEqual: [self className]] || Index: src/OFXMLCDATA.m ================================================================== --- src/OFXMLCDATA.m +++ src/OFXMLCDATA.m @@ -29,11 +29,11 @@ return [[[self alloc] initWithString: string] autorelease]; } - initWithString: (OFString *)string { - self = [super OF_init]; + self = [super of_init]; @try { _CDATA = [string copy]; } @catch (id e) { [self release]; @@ -43,11 +43,11 @@ return self; } - initWithSerialization: (OFXMLElement *)element { - self = [super OF_init]; + self = [super of_init]; @try { void *pool = objc_autoreleasePoolPush(); if (![[element name] isEqual: [self className]] || Index: src/OFXMLCharacters.m ================================================================== --- src/OFXMLCharacters.m +++ src/OFXMLCharacters.m @@ -29,11 +29,11 @@ return [[[self alloc] initWithString: string] autorelease]; } - initWithString: (OFString *)string { - self = [super OF_init]; + self = [super of_init]; @try { _characters = [string copy]; } @catch (id e) { [self release]; @@ -43,11 +43,11 @@ return self; } - initWithSerialization: (OFXMLElement *)element { - self = [super OF_init]; + self = [super of_init]; @try { void *pool = objc_autoreleasePoolPush(); if (![[element name] isEqual: [self className]] || Index: src/OFXMLComment.m ================================================================== --- src/OFXMLComment.m +++ src/OFXMLComment.m @@ -31,11 +31,11 @@ return [[[self alloc] initWithString: string] autorelease]; } - initWithString: (OFString *)string { - self = [super OF_init]; + self = [super of_init]; @try { _comment = [string copy]; } @catch (id e) { [self release]; @@ -45,11 +45,11 @@ return self; } - initWithSerialization: (OFXMLElement *)element { - self = [super OF_init]; + self = [super of_init]; @try { void *pool = objc_autoreleasePoolPush(); if (![[element name] isEqual: [self className]] || Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -159,11 +159,11 @@ - initWithName: (OFString *)name namespace: (OFString *)namespace stringValue: (OFString *)stringValue { - self = [super OF_init]; + self = [super of_init]; @try { if (name == nil) @throw [OFInvalidArgumentException exception]; @@ -185,11 +185,11 @@ return self; } - initWithElement: (OFXMLElement *)element { - self = [super OF_init]; + self = [super of_init]; @try { if (element == nil) @throw [OFInvalidArgumentException exception]; @@ -274,11 +274,11 @@ } #endif - initWithSerialization: (OFXMLElement *)element { - self = [super OF_init]; + self = [super of_init]; @try { void *pool = objc_autoreleasePoolPush(); OFXMLElement *attributesElement, *namespacesElement; OFXMLElement *childrenElement; @@ -420,11 +420,11 @@ [ret makeImmutable]; return ret; } -- (OFString *)OF_XMLStringWithParent: (OFXMLElement *)parent +- (OFString *)of_XMLStringWithParent: (OFXMLElement *)parent namespaces: (OFDictionary *)allNamespaces indentation: (unsigned int)indentation level: (unsigned int)level { void *pool; @@ -589,11 +589,11 @@ if (ind) [tmp addItem: "\n"]; if ([child isKindOfClass: [OFXMLElement class]]) childString = [(OFXMLElement *)child - OF_XMLStringWithParent: self + of_XMLStringWithParent: self namespaces: allNamespaces indentation: ind level: level + 1]; else childString = [child @@ -664,28 +664,28 @@ return ret; } - (OFString *)XMLString { - return [self OF_XMLStringWithParent: nil + return [self of_XMLStringWithParent: nil namespaces: nil indentation: 0 level: 0]; } - (OFString *)XMLStringWithIndentation: (unsigned int)indentation { - return [self OF_XMLStringWithParent: nil + return [self of_XMLStringWithParent: nil namespaces: nil indentation: indentation level: 0]; } - (OFString *)XMLStringWithIndentation: (unsigned int)indentation level: (unsigned int)level { - return [self OF_XMLStringWithParent: nil + return [self of_XMLStringWithParent: nil namespaces: nil indentation: indentation level: level]; } Index: src/OFXMLNode+Private.h ================================================================== --- src/OFXMLNode+Private.h +++ src/OFXMLNode+Private.h @@ -17,9 +17,9 @@ #import "OFXMLNode.h" OF_ASSUME_NONNULL_BEGIN @interface OFXMLNode () -- (instancetype)OF_init; +- (instancetype)of_init OF_METHOD_FAMILY(init); @end OF_ASSUME_NONNULL_END Index: src/OFXMLNode.m ================================================================== --- src/OFXMLNode.m +++ src/OFXMLNode.m @@ -18,11 +18,11 @@ #import "OFXMLNode.h" #import "OFString.h" @implementation OFXMLNode -- (instancetype)OF_init +- (instancetype)of_init { return [super init]; } - init Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -145,30 +145,30 @@ @synthesize delegate = _delegate, depthLimit = _depthLimit; + (void)initialize { const SEL selectors_[OF_XMLPARSER_NUM_STATES] = { - @selector(OF_inByteOrderMarkState), - @selector(OF_outsideTagState), - @selector(OF_tagOpenedState), - @selector(OF_inProcessingInstructionsState), - @selector(OF_inTagNameState), - @selector(OF_inCloseTagNameState), - @selector(OF_inTagState), - @selector(OF_inAttributeNameState), - @selector(OF_expectAttributeEqualSignState), - @selector(OF_expectAttributeDelimiterState), - @selector(OF_inAttributeValueState), - @selector(OF_expectTagCloseState), - @selector(OF_expectSpaceOrTagCloseState), - @selector(OF_inExclamationMarkState), - @selector(OF_inCDATAOpeningState), - @selector(OF_inCDATAState), - @selector(OF_inCommentOpeningState), - @selector(OF_inCommentState1), - @selector(OF_inCommentState2), - @selector(OF_inDOCTYPEState) + @selector(of_inByteOrderMarkState), + @selector(of_outsideTagState), + @selector(of_tagOpenedState), + @selector(of_inProcessingInstructionsState), + @selector(of_inTagNameState), + @selector(of_inCloseTagNameState), + @selector(of_inTagState), + @selector(of_inAttributeNameState), + @selector(of_expectAttributeEqualSignState), + @selector(of_expectAttributeDelimiterState), + @selector(of_inAttributeValueState), + @selector(of_expectTagCloseState), + @selector(of_expectSpaceOrTagCloseState), + @selector(of_inExclamationMarkState), + @selector(of_inCDATAOpeningState), + @selector(of_inCDATAState), + @selector(of_inCommentOpeningState), + @selector(of_inCommentState1), + @selector(of_inCommentState2), + @selector(of_inDOCTYPEState) }; memcpy(selectors, selectors_, sizeof(selectors_)); for (size_t i = 0; i < OF_XMLPARSER_NUM_STATES; i++) { if (![self instancesRespondToSelector: selectors[i]]) @@ -300,11 +300,11 @@ * The following methods handle the different states of the parser. They are * looked up in +[initialize] and put in a lookup table to speed things up. * One dispatch for every character would be way too slow! */ -- (void)OF_inByteOrderMarkState +- (void)of_inByteOrderMarkState { if (_data[_i] != "\xEF\xBB\xBF"[_level]) { if (_level == 0) { _state = OF_XMLPARSER_OUTSIDE_TAG; _i--; @@ -319,11 +319,11 @@ _last = _i + 1; } /* Not in a tag */ -- (void)OF_outsideTagState +- (void)of_outsideTagState { size_t length; if ((_finishedParsing || [_previous count] < 1) && _data[_i] != ' ' && _data[_i] != '\t' && _data[_i] != '\n' && _data[_i] != '\r' && @@ -353,11 +353,11 @@ _last = _i + 1; _state = OF_XMLPARSER_TAG_OPENED; } /* Tag was just opened */ -- (void)OF_tagOpenedState +- (void)of_tagOpenedState { if (_finishedParsing && _data[_i] != '!' && _data[_i] != '?') @throw [OFMalformedXMLException exceptionWithParser: self]; switch (_data[_i]) { @@ -387,11 +387,11 @@ break; } } /* */ -- (bool)OF_parseXMLProcessingInstructions: (OFString *)pi +- (bool)of_parseXMLProcessingInstructions: (OFString *)pi { const char *cString; size_t length, last; int PIState = 0; OFString *attribute = nil; @@ -475,11 +475,11 @@ return true; } /* Inside processing instructions */ -- (void)OF_inProcessingInstructionsState +- (void)of_inProcessingInstructionsState { if (_data[_i] == '?') _level = 1; else if (_level == 1 && _data[_i] == '>') { void *pool = objc_autoreleasePoolPush(); @@ -489,11 +489,11 @@ PI = transformString(self, _buffer, 1, false); if ([PI isEqual: @"xml"] || [PI hasPrefix: @"xml "] || [PI hasPrefix: @"xml\t"] || [PI hasPrefix: @"xml\r"] || [PI hasPrefix: @"xml\n"]) - if (![self OF_parseXMLProcessingInstructions: PI]) + if (![self of_parseXMLProcessingInstructions: PI]) @throw [OFMalformedXMLException exceptionWithParser: self]; if ([_delegate respondsToSelector: @selector(parser:foundProcessingInstructions:)]) @@ -509,11 +509,11 @@ } else _level = 0; } /* Inside a tag, no name yet */ -- (void)OF_inTagNameState +- (void)of_inTagNameState { void *pool; const char *bufferCString, *tmp; size_t length, bufferLength; OFString *bufferString; @@ -594,11 +594,11 @@ [_buffer removeAllItems]; _last = _i + 1; } /* Inside a close tag, no name yet */ -- (void)OF_inCloseTagNameState +- (void)of_inCloseTagNameState { void *pool; const char *bufferCString, *tmp; size_t length, bufferLength; OFString *bufferString, *namespace; @@ -664,11 +664,11 @@ if ([_previous count] == 0) _finishedParsing = true; } /* Inside a tag, name found */ -- (void)OF_inTagState +- (void)of_inTagState { void *pool; OFString *namespace; OFXMLAttribute *const *attributesObjects; size_t attributesCount; @@ -738,11 +738,11 @@ ? OF_XMLPARSER_EXPECT_TAG_CLOSE : OF_XMLPARSER_OUTSIDE_TAG); } /* Looking for attribute name */ -- (void)OF_inAttributeNameState +- (void)of_inAttributeNameState { void *pool; OFString *bufferString; const char *bufferCString, *tmp; size_t length, bufferLength; @@ -784,11 +784,11 @@ ? OF_XMLPARSER_EXPECT_ATTRIBUTE_DELIMITER : OF_XMLPARSER_EXPECT_ATTRIBUTE_EQUAL_SIGN); } /* Expecting equal sign of an attribute */ -- (void)OF_expectAttributeEqualSignState +- (void)of_expectAttributeEqualSignState { if (_data[_i] == '=') { _last = _i + 1; _state = OF_XMLPARSER_EXPECT_ATTRIBUTE_DELIMITER; return; @@ -798,11 +798,11 @@ _data[_i] != '\r') @throw [OFMalformedXMLException exceptionWithParser: self]; } /* Expecting name/value delimiter of an attribute */ -- (void)OF_expectAttributeDelimiterState +- (void)of_expectAttributeDelimiterState { _last = _i + 1; if (_data[_i] == ' ' || _data[_i] == '\t' || _data[_i] == '\n' || _data[_i] == '\r') @@ -814,11 +814,11 @@ _delimiter = _data[_i]; _state = OF_XMLPARSER_IN_ATTRIBUTE_VALUE; } /* Looking for attribute value */ -- (void)OF_inAttributeValueState +- (void)of_inAttributeValueState { void *pool; OFString *attributeValue; size_t length; @@ -853,21 +853,21 @@ _last = _i + 1; _state = OF_XMLPARSER_IN_TAG; } /* Expecting closing '>' */ -- (void)OF_expectTagCloseState +- (void)of_expectTagCloseState { if (_data[_i] == '>') { _last = _i + 1; _state = OF_XMLPARSER_OUTSIDE_TAG; } else @throw [OFMalformedXMLException exceptionWithParser: self]; } /* Expecting closing '>' or space */ -- (void)OF_expectSpaceOrTagCloseState +- (void)of_expectSpaceOrTagCloseState { if (_data[_i] == '>') { _last = _i + 1; _state = OF_XMLPARSER_OUTSIDE_TAG; } else if (_data[_i] != ' ' && _data[_i] != '\t' && @@ -874,11 +874,11 @@ _data[_i] != '\n' && _data[_i] != '\r') @throw [OFMalformedXMLException exceptionWithParser: self]; } /* In ' && _level >= 2) { @@ -935,21 +935,21 @@ } else _level = 0; } /* Comment */ -- (void)OF_inCommentOpeningState +- (void)of_inCommentOpeningState { if (_data[_i] != '-') @throw [OFMalformedXMLException exceptionWithParser: self]; _last = _i + 1; _state = OF_XMLPARSER_IN_COMMENT_1; _level = 0; } -- (void)OF_inCommentState1 +- (void)of_inCommentState1 { if (_data[_i] == '-') _level++; else _level = 0; @@ -956,11 +956,11 @@ if (_level == 2) _state = OF_XMLPARSER_IN_COMMENT_2; } -- (void)OF_inCommentState2 +- (void)of_inCommentState2 { void *pool; OFString *comment; if (_data[_i] != '>') @@ -982,11 +982,11 @@ _last = _i + 1; _state = OF_XMLPARSER_OUTSIDE_TAG; } /* In */ -- (void)OF_inDOCTYPEState +- (void)of_inDOCTYPEState { if ((_level < 6 && _data[_i] != "OCTYPE"[_level]) || (_level == 6 && _data[_i] != ' ' && _data[_i] != '\t' && _data[_i] != '\n' && _data[_i] != '\r')) @throw [OFMalformedXMLException exceptionWithParser: self]; Index: src/OFXMLProcessingInstructions.m ================================================================== --- src/OFXMLProcessingInstructions.m +++ src/OFXMLProcessingInstructions.m @@ -31,11 +31,11 @@ return [[[self alloc] initWithString: string] autorelease]; } - initWithString: (OFString *)string { - self = [super OF_init]; + self = [super of_init]; @try { _processingInstructions = [string copy]; } @catch (id e) { [self release]; @@ -45,11 +45,11 @@ return self; } - initWithSerialization: (OFXMLElement *)element { - self = [super OF_init]; + self = [super of_init]; @try { void *pool = objc_autoreleasePoolPush(); if (![[element name] isEqual: [self className]] || Index: src/OFZIPArchive.m ================================================================== --- src/OFZIPArchive.m +++ src/OFZIPArchive.m @@ -49,12 +49,12 @@ * - Write support is missing. * - Encrypted files cannot be read. */ @interface OFZIPArchive () -- (void)OF_readZIPInfo; -- (void)OF_readEntries; +- (void)of_readZIPInfo; +- (void)of_readEntries; @end @interface OFZIPArchive_LocalFileHeader: OFObject { @public @@ -158,12 +158,12 @@ self = [super init]; @try { _stream = [stream retain]; - [self OF_readZIPInfo]; - [self OF_readEntries]; + [self of_readZIPInfo]; + [self of_readEntries]; } @catch (id e) { [self release]; @throw e; } @@ -194,11 +194,11 @@ [_lastReturnedStream release]; [super dealloc]; } -- (void)OF_readZIPInfo +- (void)of_readZIPInfo { void *pool = objc_autoreleasePoolPush(); uint16_t commentLength; of_offset_t offset = -22; bool valid = false; @@ -283,11 +283,11 @@ } objc_autoreleasePoolPop(pool); } -- (void)OF_readEntries +- (void)of_readEntries { void *pool = objc_autoreleasePoolPush(); if (_centralDirectoryOffset < 0 || (of_offset_t)_centralDirectoryOffset != _centralDirectoryOffset) @@ -299,11 +299,11 @@ _entries = [[OFMutableArray alloc] init]; _pathToEntryMap = [[OFMutableDictionary alloc] init]; for (size_t i = 0; i < _centralDirectoryEntries; i++) { OFZIPArchiveEntry *entry = [[[OFZIPArchiveEntry alloc] - OF_initWithStream: _stream] autorelease]; + of_initWithStream: _stream] autorelease]; if ([_pathToEntryMap objectForKey: [entry fileName]] != nil) @throw [OFInvalidFormatException exception]; [_entries addObject: entry]; @@ -336,11 +336,11 @@ [_lastReturnedStream close]; [_lastReturnedStream release]; _lastReturnedStream = nil; - offset64 = [entry OF_localFileHeaderOffset]; + offset64 = [entry of_localFileHeaderOffset]; if (offset64 < 0 || (of_offset_t)offset64 != offset64) @throw [OFOutOfRangeException exception]; seekOrThrowInvalidFormat(_stream, (of_offset_t)offset64, SEEK_SET); localFileHeader = [[[OFZIPArchive_LocalFileHeader alloc] @@ -432,12 +432,12 @@ } - (bool)matchesEntry: (OFZIPArchiveEntry *)entry { if (_compressionMethod != [entry compressionMethod] || - _lastModifiedFileTime != [entry OF_lastModifiedFileTime] || - _lastModifiedFileDate != [entry OF_lastModifiedFileDate]) + _lastModifiedFileTime != [entry of_lastModifiedFileTime] || + _lastModifiedFileDate != [entry of_lastModifiedFileDate]) return false; if (!(_generalPurposeBitFlag & (1 << 3))) if (_CRC32 != [entry CRC32] || _compressedSize != [entry compressedSize] || Index: src/OFZIPArchiveEntry+Private.h ================================================================== --- src/OFZIPArchiveEntry+Private.h +++ src/OFZIPArchiveEntry+Private.h @@ -18,12 +18,12 @@ OF_ASSUME_NONNULL_BEGIN @interface OFZIPArchiveEntry () @property (readonly, nonatomic) - uint16_t OF_lastModifiedFileTime, OF_lastModifiedFileDate; -@property (readonly, nonatomic) int64_t OF_localFileHeaderOffset; + uint16_t of_lastModifiedFileTime, of_lastModifiedFileDate; +@property (readonly, nonatomic) int64_t of_localFileHeaderOffset; -- (instancetype)OF_initWithStream: (OFStream *)stream OF_METHOD_FAMILY(init); +- (instancetype)of_initWithStream: (OFStream *)stream OF_METHOD_FAMILY(init); @end OF_ASSUME_NONNULL_END Index: src/OFZIPArchiveEntry.m ================================================================== --- src/OFZIPArchiveEntry.m +++ src/OFZIPArchiveEntry.m @@ -149,20 +149,20 @@ @synthesize compressedSize = _compressedSize; @synthesize uncompressedSize = _uncompressedSize; @synthesize CRC32 = _CRC32; @synthesize versionSpecificAttributes = _versionSpecificAttributes; @synthesize generalPurposeBitFlag = _generalPurposeBitFlag; -@synthesize OF_lastModifiedFileTime = _lastModifiedFileTime; -@synthesize OF_lastModifiedFileDate = _lastModifiedFileDate; -@synthesize OF_localFileHeaderOffset = _localFileHeaderOffset; +@synthesize of_lastModifiedFileTime = _lastModifiedFileTime; +@synthesize of_lastModifiedFileDate = _lastModifiedFileDate; +@synthesize of_localFileHeaderOffset = _localFileHeaderOffset; - init { OF_INVALID_INIT_METHOD } -- (instancetype)OF_initWithStream: (OFStream *)stream +- (instancetype)of_initWithStream: (OFStream *)stream { self = [super init]; @try { void *pool = objc_autoreleasePoolPush();