Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -297,13 +297,13 @@ - (void)run { void *pool; OFRunLoop *runLoop; - [OFThread _createMainThread]; + [OFThread OF_createMainThread]; runLoop = [OFRunLoop currentRunLoop]; - [OFRunLoop _setMainRunLoop]; + [OFRunLoop OF_setMainRunLoop]; pool = objc_autoreleasePoolPush(); [delegate applicationDidFinishLaunching]; objc_autoreleasePoolPop(pool); Index: src/OFAutoreleasePool.h ================================================================== --- src/OFAutoreleasePool.h +++ src/OFAutoreleasePool.h @@ -37,11 +37,11 @@ * \param object The object to add to the autorelease pool * \return The object */ + (id)addObject: (id)object; -+ (void)_releaseAll; ++ (void)OF_releaseAll; /** * \brief Releases all objects in the autorelease pool. * * This does not free the memory allocated to store pointers to the objects in Index: src/OFAutoreleasePool.m ================================================================== --- src/OFAutoreleasePool.m +++ src/OFAutoreleasePool.m @@ -85,11 +85,11 @@ [[OFAutoreleasePool alloc] init]; return _objc_rootAutorelease(object); } -+ (void)_releaseAll ++ (void)OF_releaseAll { #ifndef OF_COMPILER_TLS void *first = of_tlskey_get(firstKey); #endif Index: src/OFCountedSet_hashtable.m ================================================================== --- src/OFCountedSet_hashtable.m +++ src/OFCountedSet_hashtable.m @@ -168,13 +168,13 @@ exceptionWithClass: [self class]]; number = [OFNumber numberWithSize: (size_t)[[count stringValue] decimalValue]]; - [dictionary _setObject: number - forKey: [object objectByDeserializing] - copyKey: NO]; + [dictionary OF_setObject: number + forKey: [object objectByDeserializing] + copyKey: NO]; objc_autoreleasePoolPop(pool2); } objc_autoreleasePoolPop(pool); @@ -210,13 +210,13 @@ count = [[dictionary objectForKey: object] numberByIncreasing]; if (count == nil) count = [OFNumber numberWithSize: 1]; - [dictionary _setObject: count - forKey: object - copyKey: NO]; + [dictionary OF_setObject: count + forKey: object + copyKey: NO]; mutations++; objc_autoreleasePoolPop(pool); } @@ -231,13 +231,13 @@ pool = objc_autoreleasePoolPush(); count = [count numberByDecreasing]; if ([count sizeValue] > 0) - [dictionary _setObject: count - forKey: object - copyKey: NO]; + [dictionary OF_setObject: count + forKey: object + copyKey: NO]; else [dictionary removeObjectForKey: object]; mutations++; Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -244,18 +244,13 @@ * \return A new, autoreleased OFDictionary */ - (OFDictionary*)filteredDictionaryUsingBlock: (of_dictionary_filter_block_t)block; #endif - -#if defined(OF_SET_M) || defined(OF_COUNTED_SET_M) -- _initWithDictionary: (OFDictionary*)dictionary - copyKeys: (BOOL)copyKeys; -#endif @end #import "OFMutableDictionary.h" #ifndef NSINTEGER_DEFINED /* Required for dictionary literals to work */ @compatibility_alias NSDictionary OFDictionary; #endif Index: src/OFDictionary_hashtable.h ================================================================== --- src/OFDictionary_hashtable.h +++ src/OFDictionary_hashtable.h @@ -27,13 +27,14 @@ struct of_dictionary_hashtable_bucket **data; uint32_t size; size_t count; } -#if defined(OF_SET_HASHTABLE_M) || defined(OF_COUNTED_SET_HASHTABLE_M) -- _initWithDictionary: (OFDictionary*)dictionary - copyKeys: (BOOL)copyKeys; +#if defined(OF_SET_M) || defined(OF_COUNTED_SET_M) || \ + defined(OF_SET_HASHTABLE_M) || defined(OF_COUNTED_SET_HASHTABLE_M) +- OF_initWithDictionary: (OFDictionary*)dictionary + copyKeys: (BOOL)copyKeys; #endif @end @interface OFDictionaryEnumerator_hashtable: OFEnumerator { Index: src/OFDictionary_hashtable.m ================================================================== --- src/OFDictionary_hashtable.m +++ src/OFDictionary_hashtable.m @@ -55,12 +55,12 @@ } return self; } -- _initWithDictionary: (OFDictionary*)dictionary - copyKeys: (BOOL)copyKeys +- OF_initWithDictionary: (OFDictionary*)dictionary + copyKeys: (BOOL)copyKeys { self = [super init]; @try { uint32_t i; @@ -116,12 +116,12 @@ - initWithDictionary: (OFDictionary*)dictionary { if ([dictionary class] == [OFDictionary_hashtable class] || [dictionary class] == [OFMutableDictionary_hashtable class]) - return [self _initWithDictionary: dictionary - copyKeys: YES]; + return [self OF_initWithDictionary: dictionary + copyKeys: YES]; self = [super init]; @try { void *pool; Index: src/OFIntrospection.m ================================================================== --- src/OFIntrospection.m +++ src/OFIntrospection.m @@ -29,11 +29,11 @@ #import "autorelease.h" #import "macros.h" @implementation OFMethod #if defined(OF_OBJFW_RUNTIME) -- _initWithMethod: (struct objc_method*)method +- OF_initWithMethod: (struct objc_method*)method { self = [super init]; @try { selector = (SEL)&method->sel; @@ -47,11 +47,11 @@ } return self; } #elif defined(OF_APPLE_RUNTIME) -- _initWithMethod: (Method)method +- OF_initWithMethod: (Method)method { self = [super init]; @try { selector = method_getName(method); @@ -97,11 +97,11 @@ } @end @implementation OFInstanceVariable #if defined(OF_OBJFW_RUNTIME) -- _initWithIvar: (struct objc_ivar*)ivar +- OF_initWithIvar: (struct objc_ivar*)ivar { self = [super init]; @try { name = [[OFString alloc] @@ -115,11 +115,11 @@ } return self; } #elif defined(OF_APPLE_RUNTIME) -- _initWithIvar: (Ivar)ivar +- OF_initWithIvar: (Ivar)ivar { self = [super init]; @try { name = [[OFString alloc] @@ -195,11 +195,11 @@ int i; for (i = 0; i < methodList->count; i++) { void *pool = objc_autoreleasePoolPush(); OFMethod *method = [[OFMethod alloc] - _initWithMethod: &methodList->methods[i]]; + OF_initWithMethod: &methodList->methods[i]]; [classMethods addObject: [method autorelease]]; objc_autoreleasePoolPop(pool); } } @@ -208,11 +208,11 @@ int i; for (i = 0; i < methodList->count; i++) { void *pool = objc_autoreleasePoolPush(); OFMethod *method = [[OFMethod alloc] - _initWithMethod: &methodList->methods[i]]; + OF_initWithMethod: &methodList->methods[i]]; [instanceMethods addObject: [method autorelease]]; objc_autoreleasePoolPop(pool); } } @@ -223,11 +223,11 @@ for (i = 0; i < class->ivars->count; i++) { void *pool = objc_autoreleasePoolPush(); OFInstanceVariable *ivar; ivar = [[OFInstanceVariable alloc] - _initWithIvar: &class->ivars->ivars[i]]; + OF_initWithIvar: &class->ivars->ivars[i]]; [instanceVariables addObject: [ivar autorelease]]; objc_autoreleasePoolPop(pool); } @@ -237,11 +237,11 @@ &count); @try { for (i = 0; i < count; i++) { void *pool = objc_autoreleasePoolPush(); [classMethods addObject: [[[OFMethod alloc] - _initWithMethod: methodList[i]] + OF_initWithMethod: methodList[i]] autorelease]]; objc_autoreleasePoolPop(pool); } } @finally { free(methodList); @@ -250,11 +250,11 @@ methodList = class_copyMethodList(class, &count); @try { for (i = 0; i < count; i++) { void *pool = objc_autoreleasePoolPush(); [instanceMethods addObject: [[[OFMethod alloc] - _initWithMethod: methodList[i]] + OF_initWithMethod: methodList[i]] autorelease]]; objc_autoreleasePoolPop(pool); } } @finally { free(methodList); @@ -264,11 +264,11 @@ @try { for (i = 0; i < count; i++) { void *pool = objc_autoreleasePoolPush(); [instanceVariables addObject: [[[OFInstanceVariable alloc] - _initWithIvar: ivarList[i]] autorelease]]; + OF_initWithIvar: ivarList[i]] autorelease]]; objc_autoreleasePoolPop(pool); } } @finally { free(ivarList); } Index: src/OFMutableDictionary_hashtable.h ================================================================== --- src/OFMutableDictionary_hashtable.h +++ src/OFMutableDictionary_hashtable.h @@ -22,17 +22,12 @@ uint32_t size; size_t count; unsigned long mutations; } -#if defined(OF_SET_HASHTABLE_M) || defined(OF_COUNTED_SET_HASHTABLE_M) -- _initWithDictionary: (OFDictionary*)dictionary - copyKeys: (BOOL)copyKeys; -#endif - #if defined(OF_SET_HASHTABLE_M) || defined(OF_MUTABLE_SET_HASHTABLE_M) || \ defined(OF_COUNTED_SET_HASHTABLE_M) -- (void)_setObject: (id)object - forKey: (id)key - copyKey: (BOOL)copyKey; +- (void)OF_setObject: (id)object + forKey: (id)key + copyKey: (BOOL)copyKey; #endif @end Index: src/OFMutableDictionary_hashtable.m ================================================================== --- src/OFMutableDictionary_hashtable.m +++ src/OFMutableDictionary_hashtable.m @@ -38,11 +38,11 @@ dictionary = [OFDictionary_hashtable class]; [self inheritMethodsFromClass: dictionary]; } } -- (void)_resizeForCount: (size_t)newCount +- (void)OF_resizeForCount: (size_t)newCount { size_t fullness = newCount * 4 / size; struct of_dictionary_hashtable_bucket **newData; uint32_t i, newSize; @@ -95,13 +95,13 @@ [self freeMemory: data]; data = newData; size = newSize; } -- (void)_setObject: (id)object - forKey: (id)key - copyKey: (BOOL)copyKey +- (void)OF_setObject: (id)object + forKey: (id)key + copyKey: (BOOL)copyKey { uint32_t i, hash, last; id old; if (key == nil || object == nil) @@ -136,11 +136,11 @@ /* Key not in dictionary */ if (i >= last || data[i] == NULL || data[i] == DELETED || ![data[i]->key isEqual: key]) { struct of_dictionary_hashtable_bucket *bucket; - [self _resizeForCount: count + 1]; + [self OF_resizeForCount: count + 1]; mutations++; last = size; for (i = hash & (size - 1); i < last && data[i] != NULL && @@ -185,13 +185,13 @@ } - (void)setObject: (id)object forKey: (id)key { - [self _setObject: object - forKey: key - copyKey: YES]; + [self OF_setObject: object + forKey: key + copyKey: YES]; } - (void)removeObjectForKey: (id)key { uint32_t i, hash, last; @@ -214,11 +214,11 @@ [self freeMemory: data[i]]; data[i] = DELETED; count--; mutations++; - [self _resizeForCount: count]; + [self OF_resizeForCount: count]; return; } } @@ -238,11 +238,11 @@ [self freeMemory: data[i]]; data[i] = DELETED; count--; mutations++; - [self _resizeForCount: count]; + [self OF_resizeForCount: count]; return; } } } Index: src/OFMutableSet_hashtable.m ================================================================== --- src/OFMutableSet_hashtable.m +++ src/OFMutableSet_hashtable.m @@ -30,13 +30,13 @@ [self inheritMethodsFromClass: [OFSet_hashtable class]]; } - (void)addObject: (id)object { - [dictionary _setObject: [OFNumber numberWithSize: 1] - forKey: object - copyKey: NO]; + [dictionary OF_setObject: [OFNumber numberWithSize: 1] + forKey: object + copyKey: NO]; mutations++; } - (void)removeObject: (id)object Index: src/OFMutableString.m ================================================================== --- src/OFMutableString.m +++ src/OFMutableString.m @@ -253,14 +253,14 @@ return (id)&placeholder; return [super alloc]; } -- (void)_convertWithWordStartTable: (const of_unichar_t *const[])startTable - wordMiddleTable: (const of_unichar_t *const[])middleTable - wordStartTableSize: (size_t)startTableSize - wordMiddleTableSize: (size_t)middleTableSize +- (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(); const of_unichar_t *string = [self unicodeString]; size_t i, length = [self length]; BOOL isStart = YES; @@ -408,30 +408,30 @@ } } - (void)uppercase { - [self _convertWithWordStartTable: of_unicode_uppercase_table - wordMiddleTable: of_unicode_uppercase_table - wordStartTableSize: OF_UNICODE_UPPERCASE_TABLE_SIZE - wordMiddleTableSize: OF_UNICODE_UPPERCASE_TABLE_SIZE]; + [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 _convertWithWordStartTable: of_unicode_lowercase_table - wordMiddleTable: of_unicode_lowercase_table - wordStartTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE - wordMiddleTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE]; + [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 _convertWithWordStartTable: of_unicode_titlecase_table - wordMiddleTable: of_unicode_lowercase_table - wordStartTableSize: OF_UNICODE_TITLECASE_TABLE_SIZE - wordMiddleTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE]; + [self OF_convertWithWordStartTable: of_unicode_titlecase_table + wordMiddleTable: of_unicode_lowercase_table + wordStartTableSize: OF_UNICODE_TITLECASE_TABLE_SIZE + wordMiddleTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE]; } - (void)insertString: (OFString*)string atIndex: (size_t)index { Index: src/OFMutableString_UTF8.m ================================================================== --- src/OFMutableString_UTF8.m +++ src/OFMutableString_UTF8.m @@ -48,14 +48,14 @@ freeWhenDone: (BOOL)freeWhenDone { return [self initWithUTF8String: UTF8String]; } -- (void)_convertWithWordStartTable: (const of_unichar_t *const[])startTable - wordMiddleTable: (const of_unichar_t *const[])middleTable - wordStartTableSize: (size_t)startTableSize - wordMiddleTableSize: (size_t)middleTableSize +- (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; size_t unicodeLen, newCStringLength; size_t i, j; char *newCString; Index: src/OFRunLoop.h ================================================================== --- src/OFRunLoop.h +++ src/OFRunLoop.h @@ -48,21 +48,21 @@ * * \return The run loop for the current thread */ + (OFRunLoop*)currentRunLoop; -+ (void)_setMainRunLoop; ++ (void)OF_setMainRunLoop; #ifdef OF_HAVE_BLOCKS -+ (void)_addAsyncReadForStream: (OFStream*)stream - buffer: (void*)buffer - length: (size_t)length - block: (of_stream_async_read_block_t)block; -+ (void)_addAsyncReadLineForStream: (OFStream*)stream - encoding: (of_string_encoding_t)encoding - block: (of_stream_async_read_line_block_t)block; -+ (void)_addAsyncAcceptForTCPSocket: (OFTCPSocket*)socket - block: (of_tcpsocket_async_accept_block_t)block; ++ (void)OF_addAsyncReadForStream: (OFStream*)stream + buffer: (void*)buffer + length: (size_t)length + block: (of_stream_async_read_block_t)block; ++ (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 + block: (of_tcpsocket_async_accept_block_t)block; #endif /** * \brief Adds an OFTimer to the run loop. * Index: src/OFRunLoop.m ================================================================== --- src/OFRunLoop.m +++ src/OFRunLoop.m @@ -108,24 +108,24 @@ if (runLoop != nil) return runLoop; runLoop = [[[OFRunLoop alloc] init] autorelease]; - [currentThread _setRunLoop: runLoop]; + [currentThread OF_setRunLoop: runLoop]; return runLoop; } -+ (void)_setMainRunLoop ++ (void)OF_setMainRunLoop { void *pool = objc_autoreleasePoolPush(); mainRunLoop = [[[OFThread currentThread] runLoop] retain]; objc_autoreleasePoolPop(pool); } #ifdef OF_HAVE_BLOCKS -+ (void)_addAsyncReadForStream: (OFStream*)stream ++ (void)OF_addAsyncReadForStream: (OFStream*)stream buffer: (void*)buffer length: (size_t)length block: (of_stream_async_read_block_t)block { void *pool = objc_autoreleasePoolPush(); @@ -149,13 +149,13 @@ [queue appendObject: queueItem]; objc_autoreleasePoolPop(pool); } -+ (void)_addAsyncReadLineForStream: (OFStream*)stream - encoding: (of_string_encoding_t)encoding - block: (of_stream_async_read_line_block_t)block ++ (void)OF_addAsyncReadLineForStream: (OFStream*)stream + encoding: (of_string_encoding_t)encoding + block: (of_stream_async_read_line_block_t)block { void *pool = objc_autoreleasePoolPush(); OFRunLoop *runLoop = [self currentRunLoop]; OFList *queue = [runLoop->readQueues objectForKey: stream]; OFRunLoop_ReadLineQueueItem *queueItem; @@ -175,12 +175,12 @@ [queue appendObject: queueItem]; objc_autoreleasePoolPop(pool); } -+ (void)_addAsyncAcceptForTCPSocket: (OFTCPSocket*)socket - block: (of_tcpsocket_async_accept_block_t)block ++ (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket*)socket + block: (of_tcpsocket_async_accept_block_t)block { void *pool = objc_autoreleasePoolPush(); OFRunLoop *runLoop = [self currentRunLoop]; OFList *queue = [runLoop->readQueues objectForKey: socket]; OFRunLoop_AcceptQueueItem *queueItem; Index: src/OFSet_hashtable.m ================================================================== --- src/OFSet_hashtable.m +++ src/OFSet_hashtable.m @@ -59,13 +59,13 @@ /* * We can't just copy the dictionary as the specified set might * be a counted set, but we're just a normal set. */ while ((object = [enumerator nextObject]) != nil) - [dictionary _setObject: one - forKey: object - copyKey: NO]; + [dictionary OF_setObject: one + forKey: object + copyKey: NO]; objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; @@ -83,13 +83,13 @@ OFNumber *one = [OFNumber numberWithSize: 1]; id *objects = [array objects]; size_t i, count = [array count]; for (i = 0; i < count; i++) - [dictionary _setObject: one - forKey: objects[i] - copyKey: NO]; + [dictionary OF_setObject: one + forKey: objects[i] + copyKey: NO]; objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; @@ -107,13 +107,13 @@ void *pool = objc_autoreleasePoolPush(); OFNumber *one = [OFNumber numberWithSize: 1]; size_t i; for (i = 0; i < count; i++) - [dictionary _setObject: one - forKey: objects[i] - copyKey: NO]; + [dictionary OF_setObject: one + forKey: objects[i] + copyKey: NO]; objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; @@ -130,18 +130,18 @@ @try { void *pool = objc_autoreleasePoolPush(); OFNumber *one = [OFNumber numberWithSize: 1]; id object; - [dictionary _setObject: one - forKey: firstObject - copyKey: NO]; + [dictionary OF_setObject: one + forKey: firstObject + copyKey: NO]; while ((object = va_arg(arguments, id)) != nil) - [dictionary _setObject: one - forKey: object - copyKey: NO]; + [dictionary OF_setObject: one + forKey: object + copyKey: NO]; objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; @@ -172,13 +172,13 @@ enumerator = [[element elementsForNamespace: OF_SERIALIZATION_NS] objectEnumerator]; while ((child = [enumerator nextObject]) != nil) { void *pool2 = objc_autoreleasePoolPush(); - [dictionary _setObject: one - forKey: [child objectByDeserializing] - copyKey: NO]; + [dictionary OF_setObject: one + forKey: [child objectByDeserializing] + copyKey: NO]; objc_autoreleasePoolPop(pool2); } objc_autoreleasePoolPop(pool); Index: src/OFStream.h ================================================================== --- src/OFStream.h +++ src/OFStream.h @@ -885,7 +885,9 @@ - (size_t)_readIntoBuffer: (void*)buffer length: (size_t)length; - (void)_writeBuffer: (const void*)buffer length: (size_t)length; -- (BOOL)_isWaitingForDelimiter; +- (BOOL)_isAtEndOfStream; + +- (BOOL)OF_isWaitingForDelimiter; @end Index: src/OFStream.m ================================================================== --- src/OFStream.m +++ src/OFStream.m @@ -136,14 +136,14 @@ - (void)asyncReadWithBuffer: (void*)buffer length: (size_t)length block: (of_stream_async_read_block_t)block { - [OFRunLoop _addAsyncReadForStream: self - buffer: buffer - length: length - block: block]; + [OFRunLoop OF_addAsyncReadForStream: self + buffer: buffer + length: length + block: block]; } - (void)readIntoBuffer: (void*)buffer exactLength: (size_t)length { @@ -692,13 +692,13 @@ } - (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding block: (of_stream_async_read_line_block_t)block { - [OFRunLoop _addAsyncReadLineForStream: self - encoding: encoding - block: block]; + [OFRunLoop OF_addAsyncReadLineForStream: self + encoding: encoding + block: block]; } #endif - (OFString*)tryReadLine { @@ -1436,10 +1436,10 @@ { @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } -- (BOOL)_isWaitingForDelimiter +- (BOOL)OF_isWaitingForDelimiter { return waitingForDelimiter; } @end Index: src/OFStreamObserver.h ================================================================== --- src/OFStreamObserver.h +++ src/OFStreamObserver.h @@ -185,15 +185,15 @@ * thread, but in some circumstances, it might be desirable for a thread to * manually stop the observe running in another thread. */ - (void)cancel; -- (void)_addFileDescriptorForReading: (int)fd; -- (void)_addFileDescriptorForWriting: (int)fd; -- (void)_removeFileDescriptorForReading: (int)fd; -- (void)_removeFileDescriptorForWriting: (int)fd; -- (void)_processQueue; -- (BOOL)_processCache; +- (void)OF_addFileDescriptorForReading: (int)fd; +- (void)OF_addFileDescriptorForWriting: (int)fd; +- (void)OF_removeFileDescriptorForReading: (int)fd; +- (void)OF_removeFileDescriptorForWriting: (int)fd; +- (void)OF_processQueue; +- (BOOL)OF_processCache; @end @interface OFObject (OFStreamObserverDelegate) @end Index: src/OFStreamObserver.m ================================================================== --- src/OFStreamObserver.m +++ src/OFStreamObserver.m @@ -260,35 +260,35 @@ OF_ENSURE(sendto(cancelFD[1], "", 1, 0, (struct sockaddr*)&cancelAddr, sizeof(cancelAddr)) > 0); #endif } -- (void)_addFileDescriptorForReading: (int)fd +- (void)OF_addFileDescriptorForReading: (int)fd +{ + @throw [OFNotImplementedException exceptionWithClass: [self class] + selector: _cmd]; +} + +- (void)OF_addFileDescriptorForWriting: (int)fd { @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } -- (void)_addFileDescriptorForWriting: (int)fd +- (void)OF_removeFileDescriptorForReading: (int)fd { @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } -- (void)_removeFileDescriptorForReading: (int)fd +- (void)OF_removeFileDescriptorForWriting: (int)fd { @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } -- (void)_removeFileDescriptorForWriting: (int)fd -{ - @throw [OFNotImplementedException exceptionWithClass: [self class] - selector: _cmd]; -} - -- (void)_processQueue +- (void)OF_processQueue { [mutex lock]; @try { OFStream **queueObjects = [queue objects]; int *queueInfoCArray = [queueInfo cArray]; @@ -319,29 +319,29 @@ switch (action) { case QUEUE_ADD | QUEUE_READ: [readStreams addObject: stream]; - [self _addFileDescriptorForReading: fd]; + [self OF_addFileDescriptorForReading: fd]; break; case QUEUE_ADD | QUEUE_WRITE: [writeStreams addObject: stream]; - [self _addFileDescriptorForWriting: fd]; + [self OF_addFileDescriptorForWriting: fd]; break; case QUEUE_REMOVE | QUEUE_READ: [readStreams removeObjectIdenticalTo: stream]; - [self _removeFileDescriptorForReading: fd]; + [self OF_removeFileDescriptorForReading: fd]; break; case QUEUE_REMOVE | QUEUE_WRITE: [writeStreams removeObjectIdenticalTo: stream]; - [self _removeFileDescriptorForWriting: fd]; + [self OF_removeFileDescriptorForWriting: fd]; break; default: assert(0); } @@ -374,21 +374,21 @@ OF_ENSURE(sendto(cancelFD[1], "", 1, 0, (struct sockaddr*)&cancelAddr, sizeof(cancelAddr)) > 0); #endif } -- (BOOL)_processCache +- (BOOL)OF_processCache { OFStream **objects = [readStreams objects]; size_t i, count = [readStreams count]; BOOL foundInCache = NO; for (i = 0; i < count; i++) { if ([objects[i] pendingBytes] > 0 && - ![objects[i] _isWaitingForDelimiter]) { + ![objects[i] OF_isWaitingForDelimiter]) { void *pool = objc_autoreleasePoolPush(); [delegate streamIsReadyForReading: objects[i]]; foundInCache = YES; objc_autoreleasePoolPop(pool); } Index: src/OFStreamObserver_kqueue.m ================================================================== --- src/OFStreamObserver_kqueue.m +++ src/OFStreamObserver_kqueue.m @@ -47,11 +47,11 @@ exceptionWithClass: [self class]]; changeList = [[OFDataArray alloc] initWithItemSize: sizeof(struct kevent)]; - [self _addFileDescriptorForReading: cancelFD[0]]; + [self OF_addFileDescriptorForReading: cancelFD[0]]; } @catch (id e) { [self release]; @throw e; } @@ -64,35 +64,35 @@ [changeList release]; [super dealloc]; } -- (void)_addFileDescriptorForReading: (int)fd +- (void)OF_addFileDescriptorForReading: (int)fd { struct kevent event; EV_SET(&event, fd, EVFILT_READ, EV_ADD, 0, 0, 0); [changeList addItem: &event]; } -- (void)_addFileDescriptorForWriting: (int)fd +- (void)OF_addFileDescriptorForWriting: (int)fd { struct kevent event; EV_SET(&event, fd, EVFILT_WRITE, EV_ADD, 0, 0, 0); [changeList addItem: &event]; } -- (void)_removeFileDescriptorForReading: (int)fd +- (void)OF_removeFileDescriptorForReading: (int)fd { struct kevent event; EV_SET(&event, fd, EVFILT_READ, EV_DELETE, 0, 0, 0); [changeList addItem: &event]; } -- (void)_removeFileDescriptorForWriting: (int)fd +- (void)OF_removeFileDescriptorForWriting: (int)fd { struct kevent event; EV_SET(&event, fd, EVFILT_WRITE, EV_DELETE, 0, 0, 0); [changeList addItem: &event]; @@ -106,13 +106,13 @@ int i, events, realEvents = 0; timespec.tv_sec = timeout; timespec.tv_nsec = (timeout - timespec.tv_sec) * 1000000000; - [self _processQueue]; + [self OF_processQueue]; - if ([self _processCache]) { + if ([self OF_processCache]) { objc_autoreleasePoolPop(pool); return YES; } objc_autoreleasePoolPop(pool); Index: src/OFStreamObserver_poll.m ================================================================== --- src/OFStreamObserver_poll.m +++ src/OFStreamObserver_poll.m @@ -55,12 +55,12 @@ [FDs release]; [super dealloc]; } -- (void)_addFileDescriptor: (int)fd - withEvents: (short)events +- (void)OF_addFileDescriptor: (int)fd + withEvents: (short)events { struct pollfd *FDsCArray = [FDs cArray]; size_t i, count = [FDs count]; BOOL found = NO; @@ -76,12 +76,12 @@ struct pollfd p = { fd, events | POLLERR, 0 }; [FDs addItem: &p]; } } -- (void)_removeFileDescriptor: (int)fd - withEvents: (short)events +- (void)OF_removeFileDescriptor: (int)fd + withEvents: (short)events { struct pollfd *FDsCArray = [FDs cArray]; size_t i, nFDs = [FDs count]; for (i = 0; i < nFDs; i++) { @@ -94,43 +94,43 @@ break; } } } -- (void)_addFileDescriptorForReading: (int)fd -{ - [self _addFileDescriptor: fd - withEvents: POLLIN]; -} - -- (void)_addFileDescriptorForWriting: (int)fd -{ - [self _addFileDescriptor: fd - withEvents: POLLOUT]; -} - -- (void)_removeFileDescriptorForReading: (int)fd -{ - [self _removeFileDescriptor: fd - withEvents: POLLIN]; -} - -- (void)_removeFileDescriptorForWriting: (int)fd -{ - [self _removeFileDescriptor: fd - withEvents: POLLOUT]; +- (void)OF_addFileDescriptorForReading: (int)fd +{ + [self OF_addFileDescriptor: fd + withEvents: POLLIN]; +} + +- (void)OF_addFileDescriptorForWriting: (int)fd +{ + [self OF_addFileDescriptor: fd + withEvents: POLLOUT]; +} + +- (void)OF_removeFileDescriptorForReading: (int)fd +{ + [self OF_removeFileDescriptor: fd + withEvents: POLLIN]; +} + +- (void)OF_removeFileDescriptorForWriting: (int)fd +{ + [self OF_removeFileDescriptor: fd + withEvents: POLLOUT]; } - (BOOL)observeWithTimeout: (double)timeout { void *pool = objc_autoreleasePoolPush(); struct pollfd *FDsCArray; size_t i, nFDs, realEvents = 0; - [self _processQueue]; + [self OF_processQueue]; - if ([self _processCache]) { + if ([self OF_processCache]) { objc_autoreleasePoolPop(pool); return YES; } objc_autoreleasePoolPop(pool); Index: src/OFStreamObserver_select.m ================================================================== --- src/OFStreamObserver_select.m +++ src/OFStreamObserver_select.m @@ -39,31 +39,31 @@ FD_SET(cancelFD[0], &readFDs); return self; } -- (void)_addFileDescriptorForReading: (int)fd +- (void)OF_addFileDescriptorForReading: (int)fd { FD_SET(fd, &readFDs); FD_SET(fd, &exceptFDs); } -- (void)_addFileDescriptorForWriting: (int)fd +- (void)OF_addFileDescriptorForWriting: (int)fd { FD_SET(fd, &writeFDs); FD_SET(fd, &exceptFDs); } -- (void)_removeFileDescriptorForReading: (int)fd +- (void)OF_removeFileDescriptorForReading: (int)fd { FD_CLR(fd, &readFDs); if (!FD_ISSET(fd, &writeFDs)) FD_CLR(fd, &exceptFDs); } -- (void)_removeFileDescriptorForWriting: (int)fd +- (void)OF_removeFileDescriptorForWriting: (int)fd { FD_CLR(fd, &writeFDs); if (!FD_ISSET(fd, &readFDs)) FD_CLR(fd, &exceptFDs); @@ -77,13 +77,13 @@ fd_set writeFDs_; fd_set exceptFDs_; struct timeval time; size_t i, count, realEvents = 0; - [self _processQueue]; + [self OF_processQueue]; - if ([self _processCache]) { + if ([self OF_processCache]) { objc_autoreleasePoolPop(pool); return YES; } objc_autoreleasePoolPop(pool); Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -276,13 +276,13 @@ length = strlen(UTF8String); string = of_alloc_object([OFString_UTF8 class], length + 1, 1, &storage); - return (id)[string _initWithUTF8String: UTF8String - length: length - storage: storage]; + return (id)[string OF_initWithUTF8String: UTF8String + length: length + storage: storage]; } - initWithUTF8String: (const char*)UTF8String length: (size_t)UTF8StringLength { @@ -290,13 +290,13 @@ void *storage; string = of_alloc_object([OFString_UTF8 class], UTF8StringLength + 1, 1, &storage); - return (id)[string _initWithUTF8String: UTF8String - length: UTF8StringLength - storage: storage]; + return (id)[string OF_initWithUTF8String: UTF8String + length: UTF8StringLength + storage: storage]; } - initWithUTF8StringNoCopy: (const char*)UTF8String freeWhenDone: (BOOL)freeWhenDone { @@ -315,13 +315,13 @@ length = strlen(cString); string = of_alloc_object([OFString_UTF8 class], length + 1, 1, &storage); - return (id)[string _initWithUTF8String: cString - length: length - storage: storage]; + return (id)[string OF_initWithUTF8String: cString + length: length + storage: storage]; } return (id)[[OFString_UTF8 alloc] initWithCString: cString encoding: encoding]; } @@ -335,13 +335,13 @@ void *storage; string = of_alloc_object([OFString_UTF8 class], cStringLength + 1, 1, &storage); - return (id)[string _initWithUTF8String: cString - length: cStringLength - storage: storage]; + return (id)[string OF_initWithUTF8String: cString + length: cStringLength + storage: storage]; } return (id)[[OFString_UTF8 alloc] initWithCString: cString encoding: encoding length: cStringLength]; Index: src/OFString_UTF8.h ================================================================== --- src/OFString_UTF8.h +++ src/OFString_UTF8.h @@ -36,9 +36,9 @@ char *freeWhenDone; } *restrict s; struct of_string_utf8_ivars s_store; } -- _initWithUTF8String: (const char*)UTF8String - length: (size_t)UTF8StringLength - storage: (char*)storage; +- OF_initWithUTF8String: (const char*)UTF8String + length: (size_t)UTF8StringLength + storage: (char*)storage; @end Index: src/OFString_UTF8.m ================================================================== --- src/OFString_UTF8.m +++ src/OFString_UTF8.m @@ -74,13 +74,13 @@ } return self; } -- _initWithUTF8String: (const char*)UTF8String - length: (size_t)UTF8StringLength - storage: (char*)storage +- OF_initWithUTF8String: (const char*)UTF8String + length: (size_t)UTF8StringLength + storage: (char*)storage { self = [super init]; @try { if (UTF8StringLength >= 3 && Index: src/OFTCPSocket+SOCKS5.h ================================================================== --- src/OFTCPSocket+SOCKS5.h +++ src/OFTCPSocket+SOCKS5.h @@ -23,8 +23,8 @@ #ifdef __cplusplus } #endif @interface OFTCPSocket (SOCKS5) -- (void)_SOCKS5ConnectToHost: (OFString*)host - port: (uint16_t)port; +- (void)OF_SOCKS5ConnectToHost: (OFString*)host + port: (uint16_t)port; @end Index: src/OFTCPSocket+SOCKS5.m ================================================================== --- src/OFTCPSocket+SOCKS5.m +++ src/OFTCPSocket+SOCKS5.m @@ -22,12 +22,12 @@ /* Reference for static linking */ int _OFTCPSocket_SOCKS5_reference; @implementation OFTCPSocket (SOCKS5) -- (void)_SOCKS5ConnectToHost: (OFString*)host - port: (uint16_t)port +- (void)OF_SOCKS5ConnectToHost: (OFString*)host + port: (uint16_t)port { const char request[] = { 5, 1, 0, 3 }; char reply[256]; BOOL oldWriteBufferEnabled; Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -284,12 +284,12 @@ socket: self host: host port: port]; if (SOCKS5Host != nil) - [self _SOCKS5ConnectToHost: destinationHost - port: destinationPort]; + [self OF_SOCKS5ConnectToHost: destinationHost + port: destinationPort]; } #ifdef OF_HAVE_BLOCKS - (void)asyncConnectToHost: (OFString*)host port: (uint16_t)port @@ -516,12 +516,12 @@ } #ifdef OF_HAVE_BLOCKS - (void)asyncAcceptWithBlock: (of_tcpsocket_async_accept_block_t)block { - [OFRunLoop _addAsyncAcceptForTCPSocket: self - block: block]; + [OFRunLoop OF_addAsyncAcceptForTCPSocket: self + block: block]; } #endif - (void)setKeepAlivesEnabled: (BOOL)enable { Index: src/OFThread.h ================================================================== --- src/OFThread.h +++ src/OFThread.h @@ -211,11 +211,11 @@ * * \param object The object which the terminated thread will return */ + (void)terminateWithObject: (id)object; -+ (void)_createMainThread; ++ (void)OF_createMainThread; /** * \brief Initializes an already allocated thread with the specified object. * * \param object An object which is passed for use in the main method or nil @@ -279,11 +279,11 @@ * * \return The run loop for the thread or nil if it has no run loop */ - (OFRunLoop*)runLoop; -- (void)_setRunLoop: (OFRunLoop*)runLoop; +- (void)OF_setRunLoop: (OFRunLoop*)runLoop; @end /** * \brief A class for creating mutual exclusions. */ Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -84,11 +84,11 @@ [thread handleTermination]; thread->running = OF_THREAD_WAITING_FOR_JOIN; [OFTLSKey callAllDestructors]; - [OFAutoreleasePool _releaseAll]; + [OFAutoreleasePool OF_releaseAll]; [thread release]; return 0; } @@ -221,18 +221,18 @@ thread->running = OF_THREAD_WAITING_FOR_JOIN; } [OFTLSKey callAllDestructors]; - [OFAutoreleasePool _releaseAll]; + [OFAutoreleasePool OF_releaseAll]; [thread release]; of_thread_exit(); } -+ (void)_createMainThread ++ (void)OF_createMainThread { mainThread = [[OFThread alloc] init]; mainThread->thread = of_thread_current(); if (!of_tlskey_set(threadSelfKey, mainThread)) @@ -326,11 +326,11 @@ - (OFRunLoop*)runLoop { return [[runLoop retain] autorelease]; } -- (void)_setRunLoop: (OFRunLoop*)runLoop_ +- (void)OF_setRunLoop: (OFRunLoop*)runLoop_ { OFRunLoop *old = runLoop; runLoop = [runLoop_ retain]; [old release]; } @@ -462,11 +462,11 @@ initialized = YES; return self; } -- _initWithoutCreatingMutex +- OF_initWithoutCreatingMutex { return [super init]; } - (void)lock @@ -503,11 +503,11 @@ @end @implementation OFRecursiveMutex - init { - self = [super _initWithoutCreatingMutex]; + self = [super OF_initWithoutCreatingMutex]; if (!of_rmutex_new(&rmutex)) { Class c = [self class]; [self release]; @throw [OFInitializationFailedException exceptionWithClass: c]; Index: src/OFThreadPool.m ================================================================== --- src/OFThreadPool.m +++ src/OFThreadPool.m @@ -331,11 +331,11 @@ [countCondition release]; [super dealloc]; } -- (void)_dispatchJob: (OFThreadPoolJob*)job +- (void)OF_dispatchJob: (OFThreadPoolJob*)job { of_atomic_inc_int(&count); [queueCondition lock]; @try { @@ -363,30 +363,30 @@ - (void)dispatchWithTarget: (id)target selector: (SEL)selector object: (id)object { - [self _dispatchJob: [OFThreadPoolJob jobWithTarget: target - selector: selector - object: object]]; + [self OF_dispatchJob: [OFThreadPoolJob jobWithTarget: target + selector: selector + object: object]]; } #ifdef OF_HAVE_BLOCKS - (void)dispatchWithBlock: (of_thread_pool_block_t)block { - [self _dispatchJob: [OFThreadPoolJob jobWithBlock: block - object: nil]]; + [self OF_dispatchJob: [OFThreadPoolJob jobWithBlock: block + object: nil]]; } - (void)dispatchWithBlock: (of_thread_pool_block_t)block object: (id)object { - [self _dispatchJob: [OFThreadPoolJob jobWithBlock: block - object: object]]; + [self OF_dispatchJob: [OFThreadPoolJob jobWithBlock: block + object: object]]; } #endif - (size_t)size { return size; } @end Index: src/OFTimer.m ================================================================== --- src/OFTimer.m +++ src/OFTimer.m @@ -196,18 +196,18 @@ return [timer autorelease]; } #endif -- _initWithFireDate: (OFDate*)fireDate_ - interval: (double)interval_ - target: (id)target_ - selector: (SEL)selector_ - object: (id)object1_ - object: (id)object2_ - arguments: (uint8_t)arguments_ - repeats: (BOOL)repeats_ +- OF_initWithFireDate: (OFDate*)fireDate_ + interval: (double)interval_ + target: (id)target_ + selector: (SEL)selector_ + object: (id)object1_ + object: (id)object2_ + arguments: (uint8_t)arguments_ + repeats: (BOOL)repeats_ { self = [super init]; @try { fireDate = [fireDate_ retain]; @@ -230,35 +230,35 @@ interval: (double)interval_ target: (id)target_ selector: (SEL)selector_ repeats: (BOOL)repeats_ { - return [self _initWithFireDate: fireDate_ - interval: interval_ - target: target_ - selector: selector_ - object: nil - object: nil - arguments: 0 - repeats: repeats_]; + return [self OF_initWithFireDate: fireDate_ + interval: interval_ + target: target_ + selector: selector_ + object: nil + object: nil + arguments: 0 + repeats: repeats_]; } - initWithFireDate: (OFDate*)fireDate_ interval: (double)interval_ target: (id)target_ selector: (SEL)selector_ object: (id)object repeats: (BOOL)repeats_ { - return [self _initWithFireDate: fireDate_ - interval: interval_ - target: target_ - selector: selector_ - object: object - object: nil - arguments: 1 - repeats: repeats_]; + return [self OF_initWithFireDate: fireDate_ + interval: interval_ + target: target_ + selector: selector_ + object: object + object: nil + arguments: 1 + repeats: repeats_]; } - initWithFireDate: (OFDate*)fireDate_ interval: (double)interval_ target: (id)target_ @@ -265,18 +265,18 @@ selector: (SEL)selector_ object: (id)object1_ object: (id)object2_ repeats: (BOOL)repeats_ { - return [self _initWithFireDate: fireDate_ - interval: interval_ - target: target_ - selector: selector_ - object: object1_ - object: object2_ - arguments: 2 - repeats: repeats_]; + return [self OF_initWithFireDate: fireDate_ + interval: interval_ + target: target_ + selector: selector_ + object: object1_ + object: object2_ + arguments: 2 + repeats: repeats_]; } #ifdef OF_HAVE_BLOCKS - initWithFireDate: (OFDate*)fireDate_ interval: (double)interval_ Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -453,14 +453,14 @@ [ret makeImmutable]; return ret; } -- (OFString*)_XMLStringWithParent: (OFXMLElement*)parent - namespaces: (OFDictionary*)allNamespaces - indentation: (unsigned int)indentation - level: (unsigned int)level +- (OFString*)OF_XMLStringWithParent: (OFXMLElement*)parent + namespaces: (OFDictionary*)allNamespaces + indentation: (unsigned int)indentation + level: (unsigned int)level { void *pool; char *cString; size_t length, i, j, attributesCount; OFString *prefix, *parentPrefix; @@ -629,14 +629,14 @@ [tmp addItem: "\n"]; if ([childrenObjects[j] isKindOfClass: [OFXMLElement class]]) child = [childrenObjects[j] - _XMLStringWithParent: self - namespaces: allNamespaces - indentation: ind - level: level + 1]; + OF_XMLStringWithParent: self + namespaces: allNamespaces + indentation: ind + level: level + 1]; else child = [childrenObjects[j] XMLStringWithIndentation: ind level: level + 1]; @@ -703,31 +703,31 @@ return ret; } - (OFString*)XMLString { - return [self _XMLStringWithParent: nil - namespaces: nil - indentation: 0 - level: 0]; + return [self OF_XMLStringWithParent: nil + namespaces: nil + indentation: 0 + level: 0]; } - (OFString*)XMLStringWithIndentation: (unsigned int)indentation { - return [self _XMLStringWithParent: nil - namespaces: nil - indentation: indentation - level: 0]; + return [self OF_XMLStringWithParent: nil + namespaces: nil + indentation: indentation + level: 0]; } - (OFString*)XMLStringWithIndentation: (unsigned int)indentation level: (unsigned int)level { - return [self _XMLStringWithParent: nil - namespaces: nil - indentation: indentation - level: level]; + return [self OF_XMLStringWithParent: nil + namespaces: nil + indentation: indentation + level: level]; } - (OFXMLElement*)XMLElementBySerializing { void *pool = objc_autoreleasePoolPush(); Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -140,29 +140,29 @@ + (void)initialize { size_t i; const SEL selectors_[] = { - @selector(_parseOutsideTagWithBuffer:i:last:), - @selector(_parseTagOpenedWithBuffer:i:last:), - @selector(_parseInProcessingInstructionsWithBuffer:i:last:), - @selector(_parseInTagNameWithBuffer:i:last:), - @selector(_parseInCloseTagNameWithBuffer:i:last:), - @selector(_parseInTagWithBuffer:i:last:), - @selector(_parseInAttributeNameWithBuffer:i:last:), - @selector(_parseExpectDelimiterWithBuffer:i:last:), - @selector(_parseInAttributeValueWithBuffer:i:last:), - @selector(_parseExpectCloseWithBuffer:i:last:), - @selector(_parseExpectSpaceOrCloseWithBuffer:i:last:), - @selector(_parseInExclamationMarkWithBuffer:i:last:), - @selector(_parseInCDATAOpeningWithBuffer:i:last:), - @selector(_parseInCDATA1WithBuffer:i:last:), - @selector(_parseInCDATA2WithBuffer:i:last:), - @selector(_parseInCommentOpeningWithBuffer:i:last:), - @selector(_parseInComment1WithBuffer:i:last:), - @selector(_parseInComment2WithBuffer:i:last:), - @selector(_parseInDoctypeWithBuffer:i:last:), + @selector(OF_parseOutsideTagWithBuffer:i:last:), + @selector(OF_parseTagOpenedWithBuffer:i:last:), + @selector(OF_parseInProcessingInstructionsWithBuffer:i:last:), + @selector(OF_parseInTagNameWithBuffer:i:last:), + @selector(OF_parseInCloseTagNameWithBuffer:i:last:), + @selector(OF_parseInTagWithBuffer:i:last:), + @selector(OF_parseInAttributeNameWithBuffer:i:last:), + @selector(OF_parseExpectDelimiterWithBuffer:i:last:), + @selector(OF_parseInAttributeValueWithBuffer:i:last:), + @selector(OF_parseExpectCloseWithBuffer:i:last:), + @selector(OF_parseExpectSpaceOrCloseWithBuffer:i:last:), + @selector(OF_parseInExclamationMarkWithBuffer:i:last:), + @selector(OF_parseInCDATAOpeningWithBuffer:i:last:), + @selector(OF_parseInCDATA1WithBuffer:i:last:), + @selector(OF_parseInCDATA2WithBuffer:i:last:), + @selector(OF_parseInCommentOpeningWithBuffer:i:last:), + @selector(OF_parseInComment1WithBuffer:i:last:), + @selector(OF_parseInComment2WithBuffer:i:last:), + @selector(OF_parseInDoctypeWithBuffer:i:last:), }; memcpy(selectors, selectors_, sizeof(selectors_)); for (i = 0; i < OF_XMLPARSER_NUM_STATES; i++) { if (![self instancesRespondToSelector: selectors[i]]) @@ -301,13 +301,13 @@ * looked up in +[initialize] and put in a lookup table to speed things up. * One dispatch for every character would be way too slow! */ /* Not in a tag */ -- (void)_parseOutsideTagWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseOutsideTagWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { size_t length; if ((finishedParsing || [previous count] < 1) && buffer[*i] != ' ' && buffer[*i] != '\t' && buffer[*i] != '\n' && buffer[*i] != '\r' && @@ -336,13 +336,13 @@ *last = *i + 1; state = OF_XMLPARSER_TAG_OPENED; } /* Tag was just opened */ -- (void)_parseTagOpenedWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseTagOpenedWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { if (finishedParsing && buffer[*i] != '!' && buffer[*i] != '?') @throw [OFMalformedXMLException exceptionWithClass: [self class] parser: self]; @@ -369,11 +369,11 @@ break; } } /* */ -- (BOOL)_parseXMLProcessingInstructions: (OFString*)pi +- (BOOL)OF_parseXMLProcessingInstructions: (OFString*)pi { const char *cString; size_t i, last, length; int piState = 0; OFString *attribute = nil; @@ -465,13 +465,13 @@ return YES; } /* Inside processing instructions */ -- (void)_parseInProcessingInstructionsWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInProcessingInstructionsWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { if (buffer[*i] == '?') level = 1; else if (level == 1 && buffer[*i] == '>') { void *pool = objc_autoreleasePoolPush(); @@ -481,11 +481,11 @@ pi = transform_string(cache, 1, NO, nil); if ([pi isEqual: @"xml"] || [pi hasPrefix: @"xml "] || [pi hasPrefix: @"xml\t"] || [pi hasPrefix: @"xml\r"] || [pi hasPrefix: @"xml\n"]) - if (![self _parseXMLProcessingInstructions: pi]) + if (![self OF_parseXMLProcessingInstructions: pi]) @throw [OFMalformedXMLException exceptionWithClass: [self class] parser: self]; [delegate parser: self @@ -500,13 +500,13 @@ } else level = 0; } /* Inside a tag, no name yet */ -- (void)_parseInTagNameWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInTagNameWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { void *pool; const char *cacheCString, *tmp; size_t length, cacheLength; OFString *cacheString; @@ -582,13 +582,13 @@ [cache removeAllItems]; *last = *i + 1; } /* Inside a close tag, no name yet */ -- (void)_parseInCloseTagNameWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInCloseTagNameWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { void *pool; const char *cacheCString, *tmp; size_t length, cacheLength; OFString *cacheString; @@ -654,13 +654,13 @@ if ([previous count] == 0) finishedParsing = YES; } /* Inside a tag, name found */ -- (void)_parseInTagWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInTagWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { void *pool; OFString *ns; OFXMLAttribute **attributesObjects; size_t j, attributesCount; @@ -727,13 +727,13 @@ ? OF_XMLPARSER_EXPECT_CLOSE : OF_XMLPARSER_OUTSIDE_TAG); } /* Looking for attribute name */ -- (void)_parseInAttributeNameWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInAttributeNameWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { void *pool; OFMutableString *cacheString; const char *cacheCString, *tmp; size_t length, cacheLength; @@ -774,13 +774,13 @@ *last = *i + 1; state = OF_XMLPARSER_EXPECT_DELIM; } /* Expecting delimiter */ -- (void)_parseExpectDelimiterWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseExpectDelimiterWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { *last = *i + 1; if (buffer[*i] == ' ' || buffer[*i] == '\t' || buffer[*i] == '\n' || buffer[*i] == '\r') @@ -793,13 +793,13 @@ delimiter = buffer[*i]; state = OF_XMLPARSER_IN_ATTR_VALUE; } /* Looking for attribute value */ -- (void)_parseInAttributeValueWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInAttributeValueWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { void *pool; OFString *attributeValue; size_t length; @@ -834,13 +834,13 @@ *last = *i + 1; state = OF_XMLPARSER_IN_TAG; } /* Expecting closing '>' */ -- (void)_parseExpectCloseWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseExpectCloseWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { if (buffer[*i] == '>') { *last = *i + 1; state = OF_XMLPARSER_OUTSIDE_TAG; } else @@ -847,13 +847,13 @@ @throw [OFMalformedXMLException exceptionWithClass: [self class] parser: self]; } /* Expecting closing '>' or space */ -- (void)_parseExpectSpaceOrCloseWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseExpectSpaceOrCloseWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { if (buffer[*i] == '>') { *last = *i + 1; state = OF_XMLPARSER_OUTSIDE_TAG; } else if (buffer[*i] != ' ' && buffer[*i] != '\t' && @@ -861,13 +861,13 @@ @throw [OFMalformedXMLException exceptionWithClass: [self class] parser: self]; } /* In ') { @@ -945,13 +945,13 @@ *last = *i + 1; state = OF_XMLPARSER_OUTSIDE_TAG; } /* Comment */ -- (void)_parseInCommentOpeningWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInCommentOpeningWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { if (buffer[*i] != '-') @throw [OFMalformedXMLException exceptionWithClass: [self class] parser: self]; @@ -958,13 +958,13 @@ *last = *i + 1; state = OF_XMLPARSER_IN_COMMENT_1; level = 0; } -- (void)_parseInComment1WithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInComment1WithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { if (buffer[*i] == '-') level++; else level = 0; @@ -971,13 +971,13 @@ if (level == 2) state = OF_XMLPARSER_IN_COMMENT_2; } -- (void)_parseInComment2WithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInComment2WithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { void *pool; OFString *comment; if (buffer[*i] != '>') @@ -999,13 +999,13 @@ *last = *i + 1; state = OF_XMLPARSER_OUTSIDE_TAG; } /* In */ -- (void)_parseInDoctypeWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInDoctypeWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { if ((level < 6 && buffer[*i] != "OCTYPE"[level]) || (level == 6 && buffer[*i] != ' ' && buffer[*i] != '\t' && buffer[*i] != '\n' && buffer[*i] != '\r')) @throw [OFMalformedXMLException exceptionWithClass: [self class] Index: src/exceptions/OFHTTPRequestFailedException.m ================================================================== --- src/exceptions/OFHTTPRequestFailedException.m +++ src/exceptions/OFHTTPRequestFailedException.m @@ -17,13 +17,14 @@ #include "config.h" #import "OFHTTPRequestFailedException.h" #import "OFString.h" #import "OFHTTPRequest.h" -#import "OFAutoreleasePool.h" #import "OFNotImplementedException.h" + +#import "autorelease.h" @implementation OFHTTPRequestFailedException + exceptionWithClass: (Class)class_ HTTPRequest: (OFHTTPRequest*)request result: (OFHTTPRequestResult*)result @@ -61,11 +62,11 @@ [super dealloc]; } - (OFString*)description { - OFAutoreleasePool *pool; + void *pool; const char *type = "(unknown)"; if (description != nil) return description; @@ -79,17 +80,17 @@ case OF_HTTP_REQUEST_TYPE_POST: type = "POST"; break; } - pool = [[OFAutoreleasePool alloc] init]; + pool = objc_autoreleasePoolPush(); description = [[OFString alloc] initWithFormat: @"A HTTP %s request in class %@ with URL %@ failed with code %d", type, inClass, [HTTPRequest URL], [result statusCode]]; - [pool release]; + objc_autoreleasePoolPop(pool); return description; } - (OFHTTPRequest*)HTTPRequest