Index: src/OFApplication.h ================================================================== --- src/OFApplication.h +++ src/OFApplication.h @@ -41,11 +41,11 @@ /** * \brief Represents the application as an object. */ @interface OFApplication: OFObject { - OFString *progname; + OFString *programName; OFMutableArray *arguments; id delegate; } /** Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -92,14 +92,14 @@ andArgumentValues: (char**)argv { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; int i; - [progname release]; + [programName release]; [arguments release]; - progname = [[OFString alloc] initWithCString: argv[0]]; + programName = [[OFString alloc] initWithCString: argv[0]]; arguments = [[OFMutableArray alloc] init]; for (i = 1; i < argc; i++) [arguments addObject: [OFString stringWithCString: argv[i]]]; @@ -106,11 +106,11 @@ [pool release]; } - (OFString*)programName { - return [[progname retain] autorelease]; + return [[programName retain] autorelease]; } - (OFArray*)arguments { return [[arguments retain] autorelease]; Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -175,15 +175,15 @@ @interface OFArrayEnumerator: OFEnumerator { OFDataArray *array; size_t count; unsigned long mutations; - unsigned long *mutations_ptr; + unsigned long *mutationsPtr; size_t pos; } - initWithDataArray: (OFDataArray*)data mutationsPointer: (unsigned long*)mutations_ptr; @end /// \endcond #import "OFMutableArray.h" Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -366,25 +366,25 @@ @end /// \cond internal @implementation OFArrayEnumerator - initWithDataArray: (OFDataArray*)array_ - mutationsPointer: (unsigned long*)mutations_ptr_; + mutationsPointer: (unsigned long*)mutationsPtr_; { self = [super init]; array = array_; count = [array_ count]; - mutations = *mutations_ptr_; - mutations_ptr = mutations_ptr_; + mutations = *mutationsPtr_; + mutationsPtr = mutationsPtr_; return self; } - (id)nextObject { - if (mutations_ptr != NULL && *mutations_ptr != mutations) + if (mutationsPtr != NULL && *mutationsPtr != mutations) @throw [OFEnumerationMutationException newWithClass: isa]; if (pos < count) return *(OFObject**)[array itemAtIndex: pos++]; @@ -391,12 +391,12 @@ return nil; } - (void)reset { - if (mutations_ptr != NULL && *mutations_ptr != mutations) + if (mutationsPtr != NULL && *mutationsPtr != mutations) @throw [OFEnumerationMutationException newWithClass: isa]; pos = 0; } @end /// \endcond Index: src/OFAutoreleasePool.h ================================================================== --- src/OFAutoreleasePool.h +++ src/OFAutoreleasePool.h @@ -21,11 +21,11 @@ * * Every thread has its own stack of autorelease pools. */ @interface OFAutoreleasePool: OFObject { - OFMutableArray *objects; + OFMutableArray *objects; OFAutoreleasePool *next, *prev; } /** * Adds an object to the autorelease pool at the top of the thread-specific Index: src/OFDataArray.h ================================================================== --- src/OFDataArray.h +++ src/OFDataArray.h @@ -18,11 +18,11 @@ * OFBigDataArray, which allocates the memory in pages rather than in bytes. */ @interface OFDataArray: OFObject { char *data; - size_t itemsize; + size_t itemSize; size_t count; } /** * Creates a new OFDataArray whose items all have the same size. Index: src/OFDataArray.m ================================================================== --- src/OFDataArray.m +++ src/OFDataArray.m @@ -43,11 +43,11 @@ @throw [OFInvalidArgumentException newWithClass: c selector: _cmd]; } data = NULL; - itemsize = is; + itemSize = is; return self; } - (size_t)count @@ -55,11 +55,11 @@ return count; } - (size_t)itemSize { - return itemsize; + return itemSize; } - (void*)cArray { return data; @@ -68,11 +68,11 @@ - (void*)itemAtIndex: (size_t)index { if (index >= count) @throw [OFOutOfRangeException newWithClass: isa]; - return data + index * itemsize; + return data + index * itemSize; } - (void*)firstItem { if (data == NULL || count == 0) @@ -84,23 +84,23 @@ - (void*)lastItem { if (data == NULL || count == 0) return NULL; - return data + (count - 1) * itemsize; + return data + (count - 1) * itemSize; } - (void)addItem: (void*)item { if (SIZE_MAX - count < 1) @throw [OFOutOfRangeException newWithClass: isa]; data = [self resizeMemory: data toNItems: count + 1 - withSize: itemsize]; + withSize: itemSize]; - memcpy(data + count * itemsize, item, itemsize); + memcpy(data + count * itemSize, item, itemSize); count++; } - (void)addItem: (void*)item @@ -117,13 +117,13 @@ if (nitems > SIZE_MAX - count) @throw [OFOutOfRangeException newWithClass: isa]; data = [self resizeMemory: data toNItems: count + nitems - withSize: itemsize]; + withSize: itemSize]; - memcpy(data + count * itemsize, carray, nitems * itemsize); + memcpy(data + count * itemSize, carray, nitems * itemSize); count += nitems; } - (void)addNItems: (size_t)nitems fromCArray: (void*)carray @@ -132,15 +132,15 @@ if (nitems > SIZE_MAX - count) @throw [OFOutOfRangeException newWithClass: isa]; data = [self resizeMemory: data toNItems: count + nitems - withSize: itemsize]; + withSize: itemSize]; - memmove(data + (index + nitems) * itemsize, data + index * itemsize, - (count - index) * itemsize); - memcpy(data + index * itemsize, carray, nitems * itemsize); + memmove(data + (index + nitems) * itemSize, data + index * itemSize, + (count - index) * itemSize); + memcpy(data + index * itemSize, carray, nitems * itemSize); count += nitems; } - (void)removeItemAtIndex: (size_t)index @@ -157,11 +157,11 @@ count -= nitems; @try { data = [self resizeMemory: data toNItems: count - withSize: itemsize]; + withSize: itemSize]; } @catch (OFOutOfMemoryException *e) { /* We don't really care, as we only made it smaller */ [e dealloc]; } } @@ -170,27 +170,27 @@ atIndex: (size_t)index { if (nitems > count) @throw [OFOutOfRangeException newWithClass: isa]; - memmove(data + index * itemsize, data + (index + nitems) * itemsize, - (count - index - nitems) * itemsize); + memmove(data + index * itemSize, data + (index + nitems) * itemSize, + (count - index - nitems) * itemSize); count -= nitems; @try { data = [self resizeMemory: data toNItems: count - withSize: itemsize]; + withSize: itemSize]; } @catch (OFOutOfMemoryException *e) { /* We don't really care, as we only made it smaller */ [e dealloc]; } } - copy { - OFDataArray *new = [[OFDataArray alloc] initWithItemSize: itemsize]; + OFDataArray *new = [[OFDataArray alloc] initWithItemSize: itemSize]; [new addNItems: count fromCArray: data]; return new; } @@ -198,13 +198,13 @@ - (BOOL)isEqual: (OFObject*)obj { if (![obj isKindOfClass: [OFDataArray class]]) return NO; if ([(OFDataArray*)obj count] != count || - [(OFDataArray*)obj itemSize] != itemsize) + [(OFDataArray*)obj itemSize] != itemSize) return NO; - if (memcmp([(OFDataArray*)obj cArray], data, count * itemsize)) + if (memcmp([(OFDataArray*)obj cArray], data, count * itemSize)) return NO; return YES; } @@ -214,18 +214,18 @@ size_t ary_count, min_count; if (![ary isKindOfClass: [OFDataArray class]]) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; - if ([ary itemSize] != itemsize) + if ([ary itemSize] != itemSize) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; ary_count = [ary count]; min_count = (count > ary_count ? ary_count : count); - if ((cmp = memcmp(data, [ary cArray], min_count * itemsize)) == 0) { + if ((cmp = memcmp(data, [ary cArray], min_count * itemSize)) == 0) { if (count > ary_count) return OF_ORDERED_DESCENDING; if (count < ary_count) return OF_ORDERED_ASCENDING; return OF_ORDERED_SAME; @@ -241,11 +241,11 @@ { uint32_t hash; size_t i; OF_HASH_INIT(hash); - for (i = 0; i < count * itemsize; i++) + for (i = 0; i < count * itemSize; i++) OF_HASH_ADD(hash, ((char*)data)[i]); OF_HASH_FINALIZE(hash); return hash; } @@ -254,21 +254,21 @@ @implementation OFBigDataArray - (void)addItem: (void*)item { size_t nsize, lastpagebyte; - if (SIZE_MAX - count < 1 || count + 1 > SIZE_MAX / itemsize) + if (SIZE_MAX - count < 1 || count + 1 > SIZE_MAX / itemSize) @throw [OFOutOfRangeException newWithClass: isa]; lastpagebyte = of_pagesize - 1; - nsize = ((count + 1) * itemsize + lastpagebyte) & ~lastpagebyte; + nsize = ((count + 1) * itemSize + lastpagebyte) & ~lastpagebyte; if (size != nsize) data = [self resizeMemory: data toSize: nsize]; - memcpy(data + count * itemsize, item, itemsize); + memcpy(data + count * itemSize, item, itemSize); count++; size = nsize; } @@ -275,21 +275,21 @@ - (void)addNItems: (size_t)nitems fromCArray: (void*)carray { size_t nsize, lastpagebyte; - if (nitems > SIZE_MAX - count || count + nitems > SIZE_MAX / itemsize) + if (nitems > SIZE_MAX - count || count + nitems > SIZE_MAX / itemSize) @throw [OFOutOfRangeException newWithClass: isa]; lastpagebyte = of_pagesize - 1; - nsize = ((count + nitems) * itemsize + lastpagebyte) & ~lastpagebyte; + nsize = ((count + nitems) * itemSize + lastpagebyte) & ~lastpagebyte; if (size != nsize) data = [self resizeMemory: data toSize: nsize]; - memcpy(data + count * itemsize, carray, nitems * itemsize); + memcpy(data + count * itemSize, carray, nitems * itemSize); count += nitems; size = nsize; } @@ -297,24 +297,24 @@ fromCArray: (void*)carray atIndex: (size_t)index { size_t nsize, lastpagebyte; - if (nitems > SIZE_MAX - count || count + nitems > SIZE_MAX / itemsize) + if (nitems > SIZE_MAX - count || count + nitems > SIZE_MAX / itemSize) @throw [OFOutOfRangeException newWithClass: isa]; lastpagebyte = of_pagesize - 1; - nsize = ((count + nitems) * itemsize + lastpagebyte) & ~lastpagebyte; + nsize = ((count + nitems) * itemSize + lastpagebyte) & ~lastpagebyte; if (size != nsize) data = [self resizeMemory: data toNItems: nsize - withSize: itemsize]; + withSize: itemSize]; - memmove(data + (index + nitems) * itemsize, data + index * itemsize, - (count - index) * itemsize); - memcpy(data + index * itemsize, carray, nitems * itemsize); + memmove(data + (index + nitems) * itemSize, data + index * itemSize, + (count - index) * itemSize); + memcpy(data + index * itemSize, carray, nitems * itemSize); count += nitems; size = nsize; } @@ -325,11 +325,11 @@ if (nitems > count) @throw [OFOutOfRangeException newWithClass: isa]; count -= nitems; lastpagebyte = of_pagesize - 1; - nsize = (count * itemsize + lastpagebyte) & ~lastpagebyte; + nsize = (count * itemSize + lastpagebyte) & ~lastpagebyte; if (size != nsize) data = [self resizeMemory: data toSize: nsize]; size = nsize; @@ -341,28 +341,28 @@ size_t nsize, lastpagebyte; if (nitems > count) @throw [OFOutOfRangeException newWithClass: isa]; - memmove(data + index * itemsize, data + (index + nitems) * itemsize, - (count - index - nitems) * itemsize); + memmove(data + index * itemSize, data + (index + nitems) * itemSize, + (count - index - nitems) * itemSize); count -= nitems; lastpagebyte = of_pagesize - 1; - nsize = (count * itemsize + lastpagebyte) & ~lastpagebyte; + nsize = (count * itemSize + lastpagebyte) & ~lastpagebyte; if (size != nsize) data = [self resizeMemory: data toSize: nsize]; size = nsize; } - copy { - OFDataArray *new = [[OFBigDataArray alloc] initWithItemSize: itemsize]; + OFDataArray *new = [[OFBigDataArray alloc] initWithItemSize: itemSize]; [new addNItems: count fromCArray: data]; return new; } @end Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -163,11 +163,11 @@ @interface OFDictionaryEnumerator: OFEnumerator { struct of_dictionary_bucket **data; uint32_t size; unsigned long mutations; - unsigned long *mutations_ptr; + unsigned long *mutationsPtr; uint32_t pos; } - initWithData: (struct of_dictionary_bucket**)data size: (uint32_t)size Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -682,35 +682,35 @@ /// \cond internal @implementation OFDictionaryEnumerator - initWithData: (struct of_dictionary_bucket**)data_ size: (uint32_t)size_ - mutationsPointer: (unsigned long*)mutations_ptr_ + mutationsPointer: (unsigned long*)mutationsPtr_ { self = [super init]; data = data_; size = size_; - mutations = *mutations_ptr_; - mutations_ptr = mutations_ptr_; + mutations = *mutationsPtr_; + mutationsPtr = mutationsPtr_; return self; } - (void)reset { - if (mutations_ptr != NULL && *mutations_ptr != mutations) + if (mutationsPtr != NULL && *mutationsPtr != mutations) @throw [OFEnumerationMutationException newWithClass: isa]; pos = 0; } @end @implementation OFDictionaryObjectEnumerator - (id)nextObject { - if (mutations_ptr != NULL && *mutations_ptr != mutations) + if (mutationsPtr != NULL && *mutationsPtr != mutations) @throw [OFEnumerationMutationException newWithClass: isa]; for (; pos < size && (data[pos] == NULL || data[pos] == DELETED); pos++); @@ -722,11 +722,11 @@ @end @implementation OFDictionaryKeyEnumerator - (id)nextObject { - if (mutations_ptr != NULL && *mutations_ptr != mutations) + if (mutationsPtr != NULL && *mutationsPtr != mutations) @throw [OFEnumerationMutationException newWithClass: isa]; for (; pos < size && (data[pos] == NULL || data[pos] == DELETED); pos++); Index: src/OFExceptions.h ================================================================== --- src/OFExceptions.h +++ src/OFExceptions.h @@ -49,11 +49,11 @@ * IMPORTANT: Exceptions do NOT use OFAutoreleasePools and can't be autoreleased * either! You have to make sure to dealloc the exception in your \@catch block! */ @interface OFException: OFObject { - Class class_; + Class inClass; OFString *string; } /** * Creates a new exception. @@ -85,11 +85,11 @@ /** * \brief An exception indicating there is not enough memory available. */ @interface OFOutOfMemoryException: OFException { - size_t req_size; + size_t requestedSize; } /** * \param class_ The class of the object which caused the exception * \param size The size of the memory that couldn't be allocated @@ -244,11 +244,11 @@ */ @interface OFOpenFileFailedException: OFException { OFString *path; OFString *mode; - int err; + int errNo; } /** * \param class_ The class of the object which caused the exception * \param path A string with the path of the file tried to open @@ -290,12 +290,12 @@ /** * \brief An exception indicating a read or write to a stream failed. */ @interface OFReadOrWriteFailedException: OFException { - size_t req_size; - int err; + size_t requestedSize; + int errNo; } /** * \param class_ The class of the object which caused the exception * \param size The requested size of the data that couldn't be read / written @@ -340,11 +340,11 @@ /** * \brief An exception indicating that seeking in a stream failed. */ @interface OFSeekFailedException: OFException { - int err; + int errNo; } /** * \return The errno from when the exception was created */ @@ -355,11 +355,11 @@ * \brief An exception indicating a directory couldn't be created. */ @interface OFCreateDirectoryFailedException: OFException { OFString *path; - int err; + int errNo; } /** * \param class_ The class of the object which caused the exception * \param path A string with the path of the directory which couldn't be created @@ -394,11 +394,11 @@ */ @interface OFChangeFileModeFailedException: OFException { OFString *path; mode_t mode; - int err; + int errNo; } /** * \param class_ The class of the object which caused the exception * \param path The path of the file @@ -444,11 +444,11 @@ @interface OFChangeFileOwnerFailedException: OFException { OFString *path; uid_t owner; gid_t group; - int err; + int errNo; } /** * \param class_ The class of the object which caused the exception * \param path The path of the file @@ -500,13 +500,13 @@ /** * \brief An exception indicating that renaming a file failed. */ @interface OFRenameFileFailedException: OFException { - OFString *src; - OFString *dst; - int err; + OFString *sourcePath; + OFString *destinationPath; + int errNo; } /** * \param class_ The class of the object which caused the exception * \param src The original path @@ -549,11 +549,11 @@ * \brief An exception indicating that deleting a file failed. */ @interface OFDeleteFileFailedException: OFException { OFString *path; - int err; + int errNo; } /** * \param class_ The class of the object which caused the exception * \param path The path of the file @@ -587,13 +587,13 @@ /** * \brief An exception indicating that creating a link failed. */ @interface OFLinkFailedException: OFException { - OFString *src; - OFString *dest; - int err; + OFString *sourcePath; + OFString *destinationPath; + int errNo; } /** * \param class_ The class of the object which caused the exception * \param src The source for the link @@ -635,13 +635,13 @@ /** * \brief An exception indicating that creating a symlink failed. */ @interface OFSymlinkFailedException: OFException { - OFString *src; - OFString *dest; - int err; + OFString *sourcePath; + OFString *destinationPath; + int errNo; } /** * \param class_ The class of the object which caused the exception * \param src The source for the symlink @@ -705,11 +705,11 @@ */ @interface OFAddressTranslationFailedException: OFException { OFString *node; OFString *service; - int err; + int errNo; } /** * \param class_ The class of the object which caused the exception * \param node The node for which translation was requested @@ -753,11 +753,11 @@ */ @interface OFConnectionFailedException: OFException { OFString *node; OFString *service; - int err; + int errNo; } /** * \param class_ The class of the object which caused the exception * \param node The node to which the connection failed @@ -802,11 +802,11 @@ @interface OFBindFailedException: OFException { OFString *node; OFString *service; int family; - int err; + int errNo; } /** * \param class_ The class of the object which caused the exception * \param node The node on which binding failed @@ -857,12 +857,12 @@ /** * \brief An exception indicating that listening on the socket failed. */ @interface OFListenFailedException: OFException { - int backlog; - int err; + int backLog; + int errNo; } /** * \param class_ The class of the object which caused the exception * \param backlog The requested size of the back log @@ -895,11 +895,11 @@ /** * \brief An exception indicating that accepting a connection failed. */ @interface OFAcceptFailedException: OFException { - int err; + int errNo; } /** * \return The errno from when the exception was created */ Index: src/OFExceptions.m ================================================================== --- src/OFExceptions.m +++ src/OFExceptions.m @@ -30,32 +30,32 @@ #import "OFString.h" #import "OFTCPSocket.h" #ifndef _WIN32 # include -# define GET_ERR errno +# define GET_ERRNO errno # ifndef HAVE_THREADSAFE_GETADDRINFO -# define GET_AT_ERR h_errno +# define GET_AT_ERRNO h_errno # else -# define GET_AT_ERR errno +# define GET_AT_ERRNO errno # endif -# define GET_SOCK_ERR errno +# define GET_SOCK_ERRNO errno # define ERRFMT "Error string was: %s" -# define ERRPARAM strerror(err) +# define ERRPARAM strerror(errNo) # ifndef HAVE_THREADSAFE_GETADDRINFO -# define AT_ERRPARAM hstrerror(err) +# define AT_ERRPARAM hstrerror(errNo) # else -# define AT_ERRPARAM strerror(err) +# define AT_ERRPARAM strerror(errNo) # endif #else # include -# define GET_ERR GetLastError() -# define GET_AT_ERR WSAGetLastError() -# define GET_SOCK_ERR WSAGetLastError() +# define GET_ERRNO GetLastError() +# define GET_AT_ERRNO WSAGetLastError() +# define GET_SOCK_ERRNO WSAGetLastError() # define ERRFMT "Error code was: %d" -# define ERRPARAM err -# define AT_ERRPARAM err +# define ERRPARAM errNo +# define AT_ERRPARAM errNo #endif #import "asprintf.h" @implementation OFAllocFailedException @@ -69,26 +69,26 @@ return @"Allocating an object failed!"; } @end @implementation OFException -+ newWithClass: (Class)class__ ++ newWithClass: (Class)class_ { - return [[self alloc] initWithClass: class__]; + return [[self alloc] initWithClass: class_]; } - init { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { self = [super init]; - class_ = class__; + class_ = class_; return self; } - (void)dealloc @@ -98,11 +98,11 @@ [super dealloc]; } - (Class)inClass { - return class_; + return inClass; } - (OFString*)string { return string; @@ -114,47 +114,47 @@ selector: _cmd]; } @end @implementation OFOutOfMemoryException -+ newWithClass: (Class)class__ ++ newWithClass: (Class)class_ size: (size_t)size { - return [[self alloc] initWithClass: class__ + return [[self alloc] initWithClass: class_ size: size]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ size: (size_t)size { - self = [super initWithClass: class__]; + self = [super initWithClass: class_]; - req_size = size; + requestedSize = size; return self; } - (OFString*)string { if (string != nil) return string; - if (req_size) + if (requestedSize) string = [[OFString alloc] initWithFormat: - @"Could not allocate %zu bytes in class %s!", req_size, - [class_ className]]; + @"Could not allocate %zu bytes in class %s!", requestedSize, + [inClass className]]; else string = [[OFString alloc] initWithFormat: @"Could not allocate enough memory in class %s!", - [class_ className]]; + [inClass className]]; return string; } - (size_t)requestedSize { - return req_size; + return requestedSize; } @end @implementation OFEnumerationMutationException - (OFString*)string @@ -162,34 +162,34 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Object of class %s was mutated during enumeration!", - [class_ className]]; + [inClass className]]; return string; } @end @implementation OFMemoryNotPartOfObjectException -+ newWithClass: (Class)class__ ++ newWithClass: (Class)class_ pointer: (void*)ptr { - return [[self alloc] initWithClass: class__ + return [[self alloc] initWithClass: class_ pointer: ptr]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ pointer: (void*)ptr { - self = [super initWithClass: class__]; + self = [super initWithClass: class_]; pointer = ptr; return self; } @@ -201,11 +201,11 @@ string = [[OFString alloc] initWithFormat: @"Memory at %p was not allocated as part of object of class %s, " @"thus the memory allocation was not changed! It is also possible " @"that there was an attempt to free the same memory twice.", - pointer, [class_ className]]; + pointer, [inClass className]]; return string; } - (void*)pointer @@ -213,27 +213,27 @@ return pointer; } @end @implementation OFNotImplementedException -+ newWithClass: (Class)class__ - selector: (SEL)selector_ -{ - return [[self alloc] initWithClass: class__ - selector: selector_]; -} - -- initWithClass: (Class)class__ -{ - @throw [OFNotImplementedException newWithClass: isa - selector: _cmd]; -} - -- initWithClass: (Class)class__ - selector: (SEL)selector_ -{ - self = [super initWithClass: class__]; ++ newWithClass: (Class)class_ + selector: (SEL)selector +{ + return [[self alloc] initWithClass: class_ + selector: selector]; +} + +- initWithClass: (Class)class_ +{ + @throw [OFNotImplementedException newWithClass: isa + selector: _cmd]; +} + +- initWithClass: (Class)class_ + selector: (SEL)selector_ +{ + self = [super initWithClass: class_]; selector = selector_; return self; } @@ -243,11 +243,11 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The method %s of class %s is not or not fully implemented!", - sel_getName(selector), [class_ className]]; + sel_getName(selector), [inClass className]]; return string; } @end @@ -256,34 +256,34 @@ { if (string != nil) return string; string = [[OFString alloc] initWithFormat: - @"Value out of range in class %s!", [class_ className]]; + @"Value out of range in class %s!", [inClass className]]; return string; } @end @implementation OFInvalidArgumentException -+ newWithClass: (Class)class__ ++ newWithClass: (Class)class_ selector: (SEL)selector_ { - return [[self alloc] initWithClass: class__ + return [[self alloc] initWithClass: class_ selector: selector_]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ selector: (SEL)selector_ { - self = [super initWithClass: class__]; + self = [super initWithClass: class_]; selector = selector_; return self; } @@ -293,11 +293,11 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The argument for method %s of class %s is invalid!", - sel_getName(selector), [class_ className]]; + sel_getName(selector), [inClass className]]; return string; } @end @@ -306,11 +306,11 @@ { if (string != nil) return string; string = [[OFString alloc] initWithFormat: - @"The encoding is invalid for class %s!", [class_ className]]; + @"The encoding is invalid for class %s!", [inClass className]]; return string; } @end @@ -319,11 +319,11 @@ { if (string != nil) return string; string = [[OFString alloc] initWithFormat: - @"The format is invalid for class %s!", [class_ className]]; + @"The format is invalid for class %s!", [inClass className]]; return string; } @end @@ -333,11 +333,11 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The parser in class %s encountered malformed or invalid XML!", - [class_ className]]; + [inClass className]]; return string; } @end @@ -346,41 +346,41 @@ { if (string != nil) return string; string = [[OFString alloc] initWithFormat: - @"Initialization failed for class %s!", [class_ className]]; + @"Initialization failed for class %s!", [inClass className]]; return string; } @end @implementation OFOpenFileFailedException -+ newWithClass: (Class)class__ - path: (OFString*)path_ - mode: (OFString*)mode_ -{ - return [(OFOpenFileFailedException*)[self alloc] initWithClass: class__ - path: path_ - mode: mode_]; -} - -- initWithClass: (Class)class__ -{ - @throw [OFNotImplementedException newWithClass: isa - selector: _cmd]; -} - -- initWithClass: (Class)class__ - path: (OFString*)path_ - mode: (OFString*)mode_ -{ - self = [super initWithClass: class__]; - - path = [path_ copy]; - mode = [mode_ copy]; - err = GET_ERR; ++ newWithClass: (Class)class_ + path: (OFString*)path + mode: (OFString*)mode +{ + return [(OFOpenFileFailedException*)[self alloc] initWithClass: class_ + path: path + mode: mode]; +} + +- initWithClass: (Class)class_ +{ + @throw [OFNotImplementedException newWithClass: isa + selector: _cmd]; +} + +- initWithClass: (Class)class_ + path: (OFString*)path_ + mode: (OFString*)mode_ +{ + self = [super initWithClass: class_]; + + path = [path_ copy]; + mode = [mode_ copy]; + errNo = GET_ERRNO; return self; } - (void)dealloc @@ -396,18 +396,18 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to open file %s with mode %s in class %s! " ERRFMT, - [path cString], [mode cString], [class_ className], ERRPARAM]; + [path cString], [mode cString], [inClass className], ERRPARAM]; return string; } - (int)errNo { - return err; + return errNo; } - (OFString*)path { return path; @@ -418,46 +418,46 @@ return mode; } @end @implementation OFReadOrWriteFailedException -+ newWithClass: (Class)class__ ++ newWithClass: (Class)class_ size: (size_t)size { - return [[self alloc] initWithClass: class__ + return [[self alloc] initWithClass: class_ size: size]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ size: (size_t)size { - self = [super initWithClass: class__]; + self = [super initWithClass: class_]; - req_size = size; + requestedSize = size; - if ([class__ isSubclassOfClass: [OFSocket class]]) - err = GET_SOCK_ERR; + if ([class_ isSubclassOfClass: [OFSocket class]]) + errNo = GET_SOCK_ERRNO; else - err = GET_ERR; + errNo = GET_ERRNO; return self; } - (int)errNo { - return err; + return errNo; } - (size_t)requestedSize { - return req_size; + return requestedSize; } @end @implementation OFReadFailedException - (OFString*)string @@ -464,12 +464,12 @@ { if (string != nil) return string;; string = [[OFString alloc] initWithFormat: - @"Failed to read %zu bytes in class %s! " ERRFMT, req_size, - [class_ className], ERRPARAM]; + @"Failed to read %zu bytes in class %s! " ERRFMT, requestedSize, + [inClass className], ERRPARAM]; return string; } @end @@ -478,23 +478,23 @@ { if (string != nil) return string; string = [[OFString alloc] initWithFormat: - @"Failed to write %zu bytes in class %s! " ERRFMT, req_size, - [class_ className], ERRPARAM]; + @"Failed to write %zu bytes in class %s! " ERRFMT, requestedSize, + [inClass className], ERRPARAM]; return string; } @end @implementation OFSeekFailedException -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { - self = [super initWithClass: class__]; + self = [super initWithClass: class_]; - err = GET_ERR; + errNo = GET_ERRNO; return self; } - (OFString*)string @@ -501,43 +501,43 @@ { if (string != nil) return string; string = [[OFString alloc] initWithFormat: - @"Seeking failed in class %s! " ERRFMT, [class_ className], + @"Seeking failed in class %s! " ERRFMT, [inClass className], ERRPARAM]; return string; } - (int)errNo { - return err; + return errNo; } @end @implementation OFCreateDirectoryFailedException -+ newWithClass: (Class)class__ ++ newWithClass: (Class)class_ path: (OFString*)path_ { - return [[self alloc] initWithClass: class__ + return [[self alloc] initWithClass: class_ path: path_]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ path: (OFString*)path_ { - self = [super initWithClass: class__]; + self = [super initWithClass: class_]; - path = [path_ copy]; - err = GET_ERR; + path = [path_ copy]; + errNo = GET_ERRNO; return self; } - (void)dealloc @@ -552,52 +552,52 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to create directory %s in class %s! " ERRFMT, - [path cString], [class_ className], ERRPARAM]; + [path cString], [inClass className], ERRPARAM]; return string; } - (int)errNo { - return err; + return errNo; } - (OFString*)path { return path; } @end @implementation OFChangeFileModeFailedException -+ newWithClass: (Class)class__ - path: (OFString*)path_ - mode: (mode_t)mode_ -{ - return [(OFChangeFileModeFailedException*)[self alloc] - initWithClass: class__ - path: path_ - mode: mode_]; -} - -- initWithClass: (Class)class__ -{ - @throw [OFNotImplementedException newWithClass: isa - selector: _cmd]; -} - -- initWithClass: (Class)class__ - path: (OFString*)path_ - mode: (mode_t)mode_ -{ - self = [super initWithClass: class__]; - - path = [path_ copy]; - mode = mode_; - err = GET_ERR; ++ newWithClass: (Class)class_ + path: (OFString*)path + mode: (mode_t)mode +{ + return [(OFChangeFileModeFailedException*)[self alloc] + initWithClass: class_ + path: path + mode: mode]; +} + +- initWithClass: (Class)class_ +{ + @throw [OFNotImplementedException newWithClass: isa + selector: _cmd]; +} + +- initWithClass: (Class)class_ + path: (OFString*)path_ + mode: (mode_t)mode_ +{ + self = [super initWithClass: class_]; + + path = [path_ copy]; + mode = mode_; + errNo = GET_ERRNO; return self; } - (void)dealloc @@ -612,18 +612,18 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to change mode for file %s to %d in class %s! " ERRFMT, - [path cString], mode, [class_ className], ERRPARAM]; + [path cString], mode, [inClass className], ERRPARAM]; return string; } - (int)errNo { - return err; + return errNo; } - (OFString*)path { return path; @@ -635,38 +635,38 @@ } @end #ifndef _WIN32 @implementation OFChangeFileOwnerFailedException -+ newWithClass: (Class)class__ - path: (OFString*)path_ - owner: (uid_t)owner_ - group: (gid_t)group_ -{ - return [[self alloc] initWithClass: class__ - path: path_ - owner: owner_ - group: group_]; ++ newWithClass: (Class)class_ + path: (OFString*)path + owner: (uid_t)owner + group: (gid_t)group +{ + return [[self alloc] initWithClass: class_ + path: path + owner: owner + group: group]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ path: (OFString*)path_ owner: (uid_t)owner_ group: (gid_t)group_ { - self = [super initWithClass: class__]; + self = [super initWithClass: class_]; path = [path_ copy]; owner = owner_; group = group_; - err = GET_ERR; + errNo = GET_ERRNO; return self; } - (void)dealloc @@ -681,18 +681,18 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to change owner for file %s to %d:%d in class %s! " ERRFMT, - [path cString], owner, group, [class_ className], ERRPARAM]; + [path cString], owner, group, [inClass className], ERRPARAM]; return string; } - (int)errNo { - return err; + return errNo; } - (OFString*)path { return path; @@ -709,42 +709,42 @@ } @end #endif @implementation OFRenameFileFailedException -+ newWithClass: (Class)class__ - sourcePath: (OFString*)src_ - destinationPath: (OFString*)dst_ ++ newWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dst { - return [[self alloc] initWithClass: class__ - sourcePath: src_ - destinationPath: dst_]; + return [[self alloc] initWithClass: class_ + sourcePath: src + destinationPath: dst]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ - sourcePath: (OFString*)src_ - destinationPath: (OFString*)dst_ -{ - self = [super initWithClass: class__]; - - src = [src_ copy]; - dst = [dst_ copy]; - err = GET_ERR; +- initWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dst +{ + self = [super initWithClass: class_]; + + sourcePath = [src copy]; + destinationPath = [dst copy]; + errNo = GET_ERRNO; return self; } - (void)dealloc { - [src release]; - [dst release]; + [sourcePath release]; + [destinationPath release]; [super dealloc]; } - (OFString*)string @@ -752,52 +752,53 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to rename file %s to %s in class %s! " ERRFMT, - [src cString], [dst cString], [class_ className], ERRPARAM]; + [sourcePath cString], [destinationPath cString], + [inClass className], ERRPARAM]; return string; } - (int)errNo { - return err; + return errNo; } - (OFString*)sourcePath { - return src; + return sourcePath; } - (OFString*)destinationPath; { - return dst; + return destinationPath; } @end @implementation OFDeleteFileFailedException -+ newWithClass: (Class)class__ ++ newWithClass: (Class)class_ path: (OFString*)path_ { - return [[self alloc] initWithClass: class__ + return [[self alloc] initWithClass: class_ path: path_]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ path: (OFString*)path_ { - self = [super initWithClass: class__]; + self = [super initWithClass: class_]; - path = [path_ copy]; - err = GET_ERR; + path = [path_ copy]; + errNo = GET_ERRNO; return self; } - (void)dealloc @@ -812,18 +813,18 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to delete file %s in class %s! " ERRFMT, [path cString], - [class_ className], ERRPARAM]; + [inClass className], ERRPARAM]; return string; } - (int)errNo { - return err; + return errNo; } - (OFString*)path { return path; @@ -830,42 +831,42 @@ } @end #ifndef _WIN32 @implementation OFLinkFailedException -+ newWithClass: (Class)class__ - sourcePath: (OFString*)src_ - destinationPath: (OFString*)dest_ ++ newWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest { - return [[self alloc] initWithClass: class__ - sourcePath: src_ - destinationPath: dest_]; + return [[self alloc] initWithClass: class_ + sourcePath: src + destinationPath: dest]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ - sourcePath: (OFString*)src_ - destinationPath: (OFString*)dest_ -{ - self = [super initWithClass: class__]; - - src = [src_ copy]; - dest = [dest_ copy]; - err = GET_ERR; +- initWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest +{ + self = [super initWithClass: class_]; + + sourcePath = [src copy]; + destinationPath = [dest copy]; + errNo = GET_ERRNO; return self; } - (void)dealloc { - [src release]; - [dest release]; + [sourcePath release]; + [destinationPath release]; [super dealloc]; } - (OFString*)string @@ -873,64 +874,65 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to link file %s to %s in class %s! " ERRFMT, - [src cString], [dest cString], [class_ className], ERRPARAM]; + [sourcePath cString], [destinationPath cString], + [inClass className], ERRPARAM]; return string; } - (int)errNo { - return err; + return errNo; } - (OFString*)sourcePath { - return src; + return sourcePath; } - (OFString*)destinationPath { - return dest; + return destinationPath; } @end @implementation OFSymlinkFailedException -+ newWithClass: (Class)class__ - sourcePath: (OFString*)src_ - destinationPath: (OFString*)dest_ ++ newWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest { - return [[self alloc] initWithClass: class__ - sourcePath: src_ - destinationPath: dest_]; + return [[self alloc] initWithClass: class_ + sourcePath: src + destinationPath: dest]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ - sourcePath: (OFString*)src_ - destinationPath: (OFString*)dest_ -{ - self = [super initWithClass: class__]; - - src = [src_ copy]; - dest = [dest_ copy]; - err = GET_ERR; +- initWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest +{ + self = [super initWithClass: class_]; + + sourcePath = [src copy]; + destinationPath = [dest copy]; + errNo = GET_ERRNO; return self; } - (void)dealloc { - [src release]; - [dest release]; + [sourcePath release]; + [destinationPath release]; [super dealloc]; } - (OFString*)string @@ -938,28 +940,29 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to symlink file %s to %s in class %s! " ERRFMT, - [src cString], [dest cString], [class_ className], ERRPARAM]; + [sourcePath cString], [destinationPath cString], + [inClass className], ERRPARAM]; return string; } - (int)errNo { - return err; + return errNo; } - (OFString*)sourcePath { - return src; + return sourcePath; } - (OFString*)destinationPath { - return dest; + return destinationPath; } @end #endif @implementation OFSetOptionFailedException @@ -967,11 +970,11 @@ { if (string != nil) return string; string = [[OFString alloc] initWithFormat: - @"Setting an option in class %s failed!", [class_ className]]; + @"Setting an option in class %s failed!", [inClass className]]; return string; } @end @@ -981,11 +984,11 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The socket of type %s is not connected or bound!", - [class_ className]]; + [inClass className]]; return string; } @end @@ -995,44 +998,44 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The socket of type %s is already connected or bound and thus " - @"can't be connected or bound again!", [class_ className]]; + @"can't be connected or bound again!", [inClass className]]; return string; } @end @implementation OFAddressTranslationFailedException -+ newWithClass: (Class)class__ - node: (OFString*)node_ - service: (OFString*)service_ ++ newWithClass: (Class)class_ + node: (OFString*)node + service: (OFString*)service { - return [[self alloc] initWithClass: class__ - node: node_ - service: service_]; + return [[self alloc] initWithClass: class_ + node: node + service: service]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { - self = [super initWithClass: class__]; + self = [super initWithClass: class_]; - err = GET_AT_ERR; + errNo = GET_AT_ERRNO; return self; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ node: (OFString*)node_ service: (OFString*)service_ { - self = [super initWithClass: class__]; + self = [super initWithClass: class_]; node = [node_ copy]; service = [service_ copy]; - err = GET_AT_ERR; + errNo = GET_AT_ERRNO; return self; } - (void)dealloc @@ -1054,22 +1057,22 @@ @"address in class %s. This means that either the node was " @"not found, there is no such service on the node, there " @"was a problem with the name server, there was a problem " @"with your network connection or you specified an invalid " @"node or service. " ERRFMT, [service cString], - [node cString], [class_ className], AT_ERRPARAM]; + [node cString], [inClass className], AT_ERRPARAM]; else string = [[OFString alloc] initWithFormat: @"An address translation failed in class %s! " ERRFMT, - [class_ className], AT_ERRPARAM]; + [inClass className], AT_ERRPARAM]; return string; } - (int)errNo { - return err; + return errNo; } - (OFString*)node { return node; @@ -1080,34 +1083,34 @@ return service; } @end @implementation OFConnectionFailedException -+ newWithClass: (Class)class__ - node: (OFString*)node_ - service: (OFString*)service_ ++ newWithClass: (Class)class_ + node: (OFString*)node + service: (OFString*)service { - return [[self alloc] initWithClass: class__ - node: node_ - service: service_]; + return [[self alloc] initWithClass: class_ + node: node + service: service]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ node: (OFString*)node_ service: (OFString*)service_ { - self = [super initWithClass: class__]; + self = [super initWithClass: class_]; node = [node_ copy]; service = [service_ copy]; - err = GET_SOCK_ERR; + errNo = GET_SOCK_ERRNO; return self; } - (void)dealloc @@ -1124,18 +1127,18 @@ return string; string = [[OFString alloc] initWithFormat: @"A connection to service %s on node %s could not be established " @"in class %s! " ERRFMT, [node cString], [service cString], - [class_ className], ERRPARAM]; + [inClass className], ERRPARAM]; return string; } - (int)errNo { - return err; + return errNo; } - (OFString*)node { return node; @@ -1146,38 +1149,38 @@ return service; } @end @implementation OFBindFailedException -+ newWithClass: (Class)class__ - node: (OFString*)node_ - service: (OFString*)service_ - family: (int)family_ -{ - return [[self alloc] initWithClass: class__ - node: node_ - service: service_ - family: family_]; ++ newWithClass: (Class)class_ + node: (OFString*)node + service: (OFString*)service + family: (int)family +{ + return [[self alloc] initWithClass: class_ + node: node + service: service + family: family]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ node: (OFString*)node_ service: (OFString*)service_ family: (int)family_ { - self = [super initWithClass: class__]; + self = [super initWithClass: class_]; node = [node_ copy]; service = [service_ copy]; family = family_; - err = GET_SOCK_ERR; + errNo = GET_SOCK_ERRNO; return self; } - (void)dealloc @@ -1194,18 +1197,18 @@ return string; string = [[OFString alloc] initWithFormat: @"Binding service %s on node %s using family %d failed in class " @"%s! " ERRFMT, [service cString], [node cString], family, - [class_ className], ERRPARAM]; + [inClass className], ERRPARAM]; return string; } - (int)errNo { - return err; + return errNo; } - (OFString*)node { return node; @@ -1221,30 +1224,30 @@ return family; } @end @implementation OFListenFailedException -+ newWithClass: (Class)class__ - backLog: (int)backlog_ ++ newWithClass: (Class)class_ + backLog: (int)backlog { - return [[self alloc] initWithClass: class__ - backLog: backlog_]; + return [[self alloc] initWithClass: class_ + backLog: backlog]; } -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ - backLog: (int)backlog_ +- initWithClass: (Class)class_ + backLog: (int)backlog { - self = [super initWithClass: class__]; + self = [super initWithClass: class_]; - backlog = backlog_; - err = GET_SOCK_ERR; + backLog = backlog; + errNo = GET_SOCK_ERRNO; return self; } - (OFString*)string @@ -1252,32 +1255,32 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to listen in socket of type %s with a back log of %d! " - ERRFMT, [class_ className], backlog, ERRPARAM]; + ERRFMT, [inClass className], backLog, ERRPARAM]; return string; } - (int)errNo { - return err; + return errNo; } - (int)backLog { - return backlog; + return backLog; } @end @implementation OFAcceptFailedException -- initWithClass: (Class)class__ +- initWithClass: (Class)class_ { - self = [super initWithClass: class__]; + self = [super initWithClass: class_]; - err = GET_SOCK_ERR; + errNo = GET_SOCK_ERRNO; return self; } - (OFString*)string @@ -1285,18 +1288,18 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to accept connection in socket of type %s! " ERRFMT, - [class_ className], ERRPARAM]; + [inClass className], ERRPARAM]; return string; } - (int)errNo { - return err; + return errNo; } @end @implementation OFThreadStartFailedException - (OFString*)string @@ -1303,11 +1306,11 @@ { if (string != nil) return string; string = [[OFString alloc] initWithFormat: - @"Starting a thread of class %s failed!", [class_ className]]; + @"Starting a thread of class %s failed!", [inClass className]]; return string; } @end @@ -1317,11 +1320,11 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Joining a thread of class %s failed! Most likely, another thread " - @"already waits for the thread to join.", [class_ className]]; + @"already waits for the thread to join.", [inClass className]]; return string; } @end @@ -1331,11 +1334,11 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Deallocation of a thread of type %s was tried, even though it " - @"was still running", [class_ className]]; + @"was still running", [inClass className]]; return string; } @end @@ -1344,11 +1347,11 @@ { if (string != nil) return string; string = [[OFString alloc] initWithFormat: - @"A mutex could not be locked in class %s", [class_ className]]; + @"A mutex could not be locked in class %s", [inClass className]]; return string; } @end @@ -1357,11 +1360,11 @@ { if (string != nil) return string; string = [[OFString alloc] initWithFormat: - @"A mutex could not be unlocked in class %s", [class_ className]]; + @"A mutex could not be unlocked in class %s", [inClass className]]; return string; } @end @@ -1371,10 +1374,10 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The hash has already been calculated in class %s and thus no new " - @"data can be added", [class_ className]]; + @"data can be added", [inClass className]]; return string; } @end Index: src/OFMutableString.m ================================================================== --- src/OFMutableString.m +++ src/OFMutableString.m @@ -39,11 +39,11 @@ of_unichar_t *ustr; size_t ulen, nlen, clen; size_t i, j, d; char *nstr; - if (!is_utf8) { + if (!isUTF8) { assert(table_size >= 1); uint8_t *p = (uint8_t*)string + length; uint8_t t; @@ -129,19 +129,19 @@ len = strlen(str); switch (of_string_check_utf8(str, len)) { case 0: - is_utf8 = NO; + isUTF8 = NO; break; case 1: - is_utf8 = YES; + isUTF8 = YES; break; case -1: string = NULL; length = 0; - is_utf8 = NO; + isUTF8 = NO; @throw [OFInvalidEncodingException newWithClass: isa]; } length = len; @@ -155,11 +155,11 @@ strlength = strlen(str); switch (of_string_check_utf8(str, strlength)) { case 1: - is_utf8 = YES; + isUTF8 = YES; break; case -1: @throw [OFInvalidEncodingException newWithClass: isa]; } @@ -175,11 +175,11 @@ if (len > strlen(str)) @throw [OFOutOfRangeException newWithClass: isa]; switch (of_string_check_utf8(str, len)) { case 1: - is_utf8 = YES; + isUTF8 = YES; break; case -1: @throw [OFInvalidEncodingException newWithClass: isa]; } @@ -264,11 +264,11 @@ string[i] ^= string[j]; string[j] ^= string[i]; string[i] ^= string[j]; } - if (!is_utf8) { + if (!isUTF8) { madvise(string, len, MADV_NORMAL); return; } for (i = 0; i < length; i++) { @@ -355,11 +355,11 @@ } - (void)removeCharactersFromIndex: (size_t)start toIndex: (size_t)end { - if (is_utf8) { + if (isUTF8) { start = of_string_index_to_position(string, start, length); end = of_string_index_to_position(string, end, length); } if (start > end) Index: src/OFSeekableStream.h ================================================================== --- src/OFSeekableStream.h +++ src/OFSeekableStream.h @@ -21,11 +21,11 @@ * Those are not defined in the headers, but do the actual work. * OFSeekableStream uses those and makes them work together with the caching of * OFStream. If you override these methods without the _ prefix, you *WILL* * break caching, get broken results and seek to the wrong position! */ -@interface OFSeekableStream: OFStream +@interface OFSeekableStream: OFStream {} /** * Seeks to the specified absolute offset. * * \param offset The offset in bytes */ Index: src/OFSeekableStream.m ================================================================== --- src/OFSeekableStream.m +++ src/OFSeekableStream.m @@ -36,23 +36,23 @@ [self flushWriteBuffer]; [self _seekToOffset: offset]; [self freeMemory: cache]; cache = NULL; - cache_len = 0; + cacheLen = 0; } - (off_t)seekForwardWithOffset: (off_t)offset { off_t ret; [self flushWriteBuffer]; - ret = [self _seekForwardWithOffset: offset - cache_len]; + ret = [self _seekForwardWithOffset: offset - cacheLen]; [self freeMemory: cache]; cache = NULL; - cache_len = 0; + cacheLen = 0; return ret; } - (off_t)seekToOffsetRelativeToEnd: (off_t)offset @@ -62,10 +62,10 @@ [self flushWriteBuffer]; ret = [self _seekToOffsetRelativeToEnd: offset]; [self freeMemory: cache]; cache = NULL; - cache_len = 0; + cacheLen = 0; return ret; } @end Index: src/OFStream.h ================================================================== --- src/OFStream.h +++ src/OFStream.h @@ -25,13 +25,13 @@ * all the caching and other stuff. If you override these methods without the * _ prefix, you *WILL* break caching and get broken results! */ @interface OFStream: OFObject { - char *cache, *wbuffer; - size_t cache_len, wbuffer_len; - BOOL use_wbuffer; + char *cache, *wBuffer; + size_t cacheLen, wBufferLen; + BOOL useWBuffer; } /** * Returns a boolean whether the end of the stream has been reached. * Index: src/OFStream.m ================================================================== --- src/OFStream.m +++ src/OFStream.m @@ -35,11 +35,11 @@ if (isa == [OFStream class]) @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; cache = NULL; - wbuffer = NULL; + wBuffer = NULL; return self; } - (BOOL)_atEndOfStream @@ -75,28 +75,28 @@ { if (cache == NULL) return [self _readNBytes: size intoBuffer: buf]; - if (size >= cache_len) { - size_t ret = cache_len; - memcpy(buf, cache, cache_len); + if (size >= cacheLen) { + size_t ret = cacheLen; + memcpy(buf, cache, cacheLen); [self freeMemory: cache]; cache = NULL; - cache_len = 0; + cacheLen = 0; return ret; } else { - char *tmp = [self allocMemoryWithSize: cache_len - size]; - memcpy(tmp, cache + size, cache_len - size); + char *tmp = [self allocMemoryWithSize: cacheLen - size]; + memcpy(tmp, cache + size, cacheLen - size); memcpy(buf, cache, size); [self freeMemory: cache]; cache = tmp; - cache_len -= size; + cacheLen -= size; return size; } } @@ -238,11 +238,11 @@ char *ret_c, *tmp, *tmp2; OFString *ret; /* Look if there's a line or \0 in our cache */ if (cache != NULL) { - for (i = 0; i < cache_len; i++) { + for (i = 0; i < cacheLen; i++) { if (OF_UNLIKELY(cache[i] == '\n' || cache[i] == '\0')) { ret_len = i; if (i > 0 && cache[i - 1] == '\r') @@ -250,19 +250,19 @@ ret = [OFString stringWithCString: cache encoding: encoding length: ret_len]; - tmp = [self allocMemoryWithSize: cache_len - + tmp = [self allocMemoryWithSize: cacheLen - i - 1]; if (tmp != NULL) memcpy(tmp, cache + i + 1, - cache_len - i - 1); + cacheLen - i - 1); [self freeMemory: cache]; cache = tmp; - cache_len -= i + 1; + cacheLen -= i + 1; return ret; } } } @@ -274,11 +274,11 @@ for (;;) { if ([self _atEndOfStream]) { if (cache == NULL) return nil; - ret_len = cache_len; + ret_len = cacheLen; if (ret_len > 0 && cache[ret_len - 1] == '\r') ret_len--; ret = [OFString stringWithCString: cache @@ -285,11 +285,11 @@ encoding: encoding length: ret_len]; [self freeMemory: cache]; cache = NULL; - cache_len = 0; + cacheLen = 0; return ret; } len = [self _readNBytes: of_pagesize @@ -297,17 +297,17 @@ /* Look if there's a newline or \0 */ for (i = 0; i < len; i++) { if (OF_UNLIKELY(tmp[i] == '\n' || tmp[i] == '\0')) { - ret_len = cache_len + i; + ret_len = cacheLen + i; ret_c = [self allocMemoryWithSize: ret_len]; if (cache != NULL) - memcpy(ret_c, cache, cache_len); - memcpy(ret_c + cache_len, tmp, i); + memcpy(ret_c, cache, cacheLen); + memcpy(ret_c + cacheLen, tmp, i); if (ret_len > 0 && ret_c[ret_len - 1] == '\r') ret_len--; @@ -326,28 +326,28 @@ memcpy(tmp2, tmp + i + 1, len - i - 1); [self freeMemory: cache]; cache = tmp2; - cache_len = len - i - 1; + cacheLen = len - i - 1; return ret; } } /* There was no newline or \0 */ cache = [self resizeMemory: cache - toSize: cache_len + len]; + toSize: cacheLen + len]; /* - * It's possible that cache_len + len is 0 and thus + * It's possible that cacheLen + len is 0 and thus * cache was set to NULL by resizeMemory:toSize:. */ if (cache != NULL) - memcpy(cache + cache_len, tmp, len); + memcpy(cache + cacheLen, tmp, len); - cache_len += len; + cacheLen += len; } } @finally { [self freeMemory: tmp]; } @@ -378,11 +378,11 @@ @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; /* Look if there's something in our cache */ if (cache != NULL) { - for (i = 0; i < cache_len; i++) { + for (i = 0; i < cacheLen; i++) { if (cache[i] != delim[j++]) j = 0; if (j == delim_len || cache[i] == '\0') { if (cache[i] == '\0') @@ -391,19 +391,19 @@ ret = [OFString stringWithCString: cache encoding: encoding length: i + 1 - delim_len]; - tmp = [self allocMemoryWithSize: cache_len - i - + tmp = [self allocMemoryWithSize: cacheLen - i - 1]; if (tmp != NULL) memcpy(tmp, cache + i + 1, - cache_len - i - 1); + cacheLen - i - 1); [self freeMemory: cache]; cache = tmp; - cache_len -= i + 1; + cacheLen -= i + 1; return ret; } } } @@ -417,15 +417,15 @@ if (cache == NULL) return nil; ret = [OFString stringWithCString: cache encoding: encoding - length: cache_len]; + length: cacheLen]; [self freeMemory: cache]; cache = NULL; - cache_len = 0; + cacheLen = 0; return ret; } len = [self _readNBytes: of_pagesize @@ -438,21 +438,21 @@ if (j == delim_len || tmp[i] == '\0') { if (tmp[i] == '\0') delim_len = 1; - ret_len = cache_len + i + 1 - delim_len; + ret_len = cacheLen + i + 1 - delim_len; ret_c = [self allocMemoryWithSize: ret_len]; if (cache != NULL && - cache_len <= ret_len) - memcpy(ret_c, cache, cache_len); + cacheLen <= ret_len) + memcpy(ret_c, cache, cacheLen); else if (cache != NULL) memcpy(ret_c, cache, ret_len); if (i >= delim_len) - memcpy(ret_c + cache_len, tmp, + memcpy(ret_c + cacheLen, tmp, i + 1 - delim_len); @try { ret = [OFString stringWithCString: ret_c @@ -468,28 +468,28 @@ memcpy(tmp2, tmp + i + 1, len - i - 1); [self freeMemory: cache]; cache = tmp2; - cache_len = len - i - 1; + cacheLen = len - i - 1; return ret; } } /* Neither the delimiter nor \0 was found */ cache = [self resizeMemory: cache - toSize: cache_len + len]; + toSize: cacheLen + len]; /* - * It's possible that cache_len + len is 0 and thus + * It's possible that cacheLen + len is 0 and thus * cache was set to NULL by resizeMemory:toSize:. */ if (cache != NULL) - memcpy(cache + cache_len, tmp, len); + memcpy(cache + cacheLen, tmp, len); - cache_len += len; + cacheLen += len; } } @finally { [self freeMemory: tmp]; } @@ -497,38 +497,38 @@ assert(0); } - (void)bufferWrites { - use_wbuffer = YES; + useWBuffer = YES; } - (void)flushWriteBuffer { - if (wbuffer == NULL) + if (wBuffer == NULL) return; - [self _writeNBytes: wbuffer_len - fromBuffer: wbuffer]; + [self _writeNBytes: wBufferLen + fromBuffer: wBuffer]; - [self freeMemory: wbuffer]; - wbuffer = NULL; - wbuffer_len = 0; - use_wbuffer = NO; + [self freeMemory: wBuffer]; + wBuffer = NULL; + wBufferLen = 0; + useWBuffer = NO; } - (size_t)writeNBytes: (size_t)size fromBuffer: (const char*)buf { - if (!use_wbuffer) + if (!useWBuffer) return [self _writeNBytes: size fromBuffer: buf]; else { - wbuffer = [self resizeMemory: wbuffer - toSize: wbuffer_len + size]; - memcpy(wbuffer + wbuffer_len, buf, size); - wbuffer_len += size; + wBuffer = [self resizeMemory: wBuffer + toSize: wBufferLen + size]; + memcpy(wBuffer + wBufferLen, buf, size); + wBufferLen += size; return size; } } Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -39,11 +39,11 @@ char *string; unsigned int length; #if defined(OF_APPLE_RUNTIME) && __LP64__ int _unused; #endif - BOOL is_utf8; + BOOL isUTF8; } /** * \return A new autoreleased OFString */ Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -340,11 +340,11 @@ switch (encoding) { case OF_STRING_ENCODING_UTF_8: switch (of_string_check_utf8(str, length)) { case 1: - is_utf8 = YES; + isUTF8 = YES; break; case -1:; /* * We can't use [super dealloc] on OS X here. * Compiler bug? Anyway, [self dealloc] will do here as @@ -404,11 +404,11 @@ [self dealloc]; @throw [OFInvalidEncodingException newWithClass: c]; } - is_utf8 = YES; + isUTF8 = YES; chr_bytes = of_string_unicode_to_utf8(chr, buf); if (chr_bytes == 0) { /* * We can't use [super dealloc] on OS X @@ -507,11 +507,11 @@ } length = t; switch (of_string_check_utf8(string, length)) { case 1: - is_utf8 = YES; + isUTF8 = YES; break; case -1:; Class c = isa; free(string); [super dealloc]; @@ -552,11 +552,11 @@ self = [super init]; len = [first cStringLength]; switch (of_string_check_utf8([first cString], len)) { case 1: - is_utf8 = YES; + isUTF8 = YES; break; case -1: c = isa; [self dealloc]; @throw [OFInvalidEncodingException newWithClass: c]; @@ -568,11 +568,11 @@ len = [component cStringLength]; length += 1 + len; switch (of_string_check_utf8([component cString], len)) { case 1: - is_utf8 = YES; + isUTF8 = YES; break; case -1: c = isa; [self dealloc]; @throw [OFInvalidEncodingException newWithClass: c]; @@ -609,11 +609,11 @@ string = (char*)[str cString]; length = [str cStringLength]; switch (of_string_check_utf8(string, length)) { case 1: - is_utf8 = YES; + isUTF8 = YES; break; case -1:; Class c = isa; [self dealloc]; @throw [OFInvalidEncodingException newWithClass: c]; Index: src/OFTCPSocket.h ================================================================== --- src/OFTCPSocket.h +++ src/OFTCPSocket.h @@ -26,12 +26,12 @@ /** * \brief A class which provides functions to create and use TCP sockets. */ @interface OFTCPSocket: OFSocket { - struct sockaddr *saddr; - socklen_t saddr_len; + struct sockaddr *sockAddr; + socklen_t sockAddrLen; } /** * Connect the OFTCPSocket to the specified destination. * Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -51,11 +51,11 @@ - init { self = [super init]; sock = INVALID_SOCKET; - saddr = NULL; + sockAddr = NULL; return self; } - (void)connectToService: (OFString*)service @@ -347,12 +347,12 @@ [newsock dealloc]; @throw [OFAcceptFailedException newWithClass: isa]; } newsock->sock = s; - newsock->saddr = addr; - newsock->saddr_len = addrlen; + newsock->sockAddr = addr; + newsock->sockAddrLen = addrlen; return newsock; } - (void)setKeepAlivesEnabled: (BOOL)enable @@ -363,20 +363,20 @@ @throw [OFSetOptionFailedException newWithClass: isa]; } - (OFString*)remoteAddress { - if (saddr == NULL || saddr_len == 0) + if (sockAddr == NULL || sockAddrLen == 0) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; #ifdef HAVE_THREADSAFE_GETADDRINFO char *node = [self allocMemoryWithSize: NI_MAXHOST]; @try { - if (getnameinfo(saddr, saddr_len, node, NI_MAXHOST, NULL, 0, - NI_NUMERICHOST)) + if (getnameinfo(sockAddr, sockAddrLen, node, NI_MAXHOST, NULL, + 0, NI_NUMERICHOST)) @throw [OFAddressTranslationFailedException newWithClass: isa]; return [OFString stringWithCString: node]; } @finally { @@ -388,11 +388,11 @@ # ifdef OF_THREADS [mutex lock]; @try { # endif - node = inet_ntoa(((struct sockaddr_in*)saddr)->sin_addr); + node = inet_ntoa(((struct sockaddr_in*)sockAddr)->sin_addr); if (node == NULL) @throw [OFAddressTranslationFailedException newWithClass: isa]; @@ -414,13 +414,13 @@ @throw [OFNotConnectedException newWithClass: isa]; close(sock); sock = INVALID_SOCKET; - [self freeMemory: saddr]; - saddr = NULL; - saddr_len = 0; + [self freeMemory: sockAddr]; + sockAddr = NULL; + sockAddrLen = 0; } - (void)dealloc { if (sock != INVALID_SOCKET) Index: src/OFXMLElement.h ================================================================== --- src/OFXMLElement.h +++ src/OFXMLElement.h @@ -22,12 +22,12 @@ */ @interface OFXMLAttribute: OFObject { OFString *prefix; OFString *name; - OFString *ns; - OFString *value; + OFString *namespace; + OFString *stringValue; } /** * \param name The name of the attribute * \param prefix The prefix of the attribute @@ -82,12 +82,12 @@ * modified and converted back to XML again. */ @interface OFXMLElement: OFObject { OFString *name; - OFMutableArray *attrs; - OFString *stringval; + OFMutableArray *attributes; + OFString *stringValue; OFMutableArray *children; } /** * \param name The name for the element Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -22,42 +22,42 @@ #import "OFExceptions.h" int _OFXMLElement_reference; @implementation OFXMLAttribute -+ attributeWithName: (OFString*)name_ - prefix: (OFString*)prefix_ - namespace: (OFString*)ns_ - stringValue: (OFString*)value_ -{ - return [[[self alloc] initWithName: name_ - prefix: prefix_ - namespace: ns_ - stringValue: value_] autorelease]; ++ attributeWithName: (OFString*)name + prefix: (OFString*)prefix + namespace: (OFString*)ns + stringValue: (OFString*)value +{ + return [[[self alloc] initWithName: name + prefix: prefix + namespace: ns + stringValue: value] autorelease]; } - initWithName: (OFString*)name_ prefix: (OFString*)prefix_ - namespace: (OFString*)ns_ - stringValue: (OFString*)value_ + namespace: (OFString*)ns + stringValue: (OFString*)value { self = [super init]; name = [name_ copy]; prefix = [prefix_ copy]; - ns = [ns_ copy]; - value = [value_ copy]; + namespace = [ns copy]; + stringValue = [value copy]; return self; } - (void)dealloc { [name release]; [prefix release]; - [ns release]; - [value release]; + [namespace release]; + [stringValue release]; [super dealloc]; } - (OFString*)name @@ -70,30 +70,30 @@ return [[prefix copy] autorelease]; } - (OFString*)namespace { - return [[ns copy] autorelease]; + return [[namespace copy] autorelease]; } - (OFString*)stringValue { - return [[value copy] autorelease]; + return [[stringValue copy] autorelease]; } @end @implementation OFXMLElement + elementWithName: (OFString*)name_ { return [[[self alloc] initWithName: name_] autorelease]; } -+ elementWithName: (OFString*)name_ - stringValue: (OFString*)stringval_ ++ elementWithName: (OFString*)name + stringValue: (OFString*)stringval { - return [[[self alloc] initWithName: name_ - stringValue: stringval_] autorelease]; + return [[[self alloc] initWithName: name + stringValue: stringval] autorelease]; } - init { @throw [OFNotImplementedException newWithClass: isa @@ -108,16 +108,16 @@ return self; } - initWithName: (OFString*)name_ - stringValue: (OFString*)stringval_ + stringValue: (OFString*)stringval { self = [super init]; name = [name_ copy]; - stringval = [stringval_ copy]; + stringValue = [stringval copy]; return self; } - (OFString*)string @@ -135,12 +135,12 @@ *str_c = '<'; memcpy(str_c + 1, [name cString], [name cStringLength]); i = [name cStringLength] + 1; /* Attributes */ - attrs_carray = [attrs cArray]; - attrs_count = [attrs count]; + attrs_carray = [attributes cArray]; + attrs_count = [attributes count]; for (j = 0; j < attrs_count; j++) { /* FIXME: Add namespace support */ OFString *attr_name = [attrs_carray[j] name]; tmp = [[attrs_carray[j] stringValue] stringByXMLEscaping]; @@ -166,13 +166,13 @@ [pool releaseObjects]; } /* Childen */ - if (stringval != nil || children != nil) { - if (stringval != nil) - tmp = [stringval stringByXMLEscaping]; + if (stringValue != nil || children != nil) { + if (stringValue != nil) + tmp = [stringValue stringByXMLEscaping]; else if (children != nil) { OFXMLElement **children_carray = [children cArray]; size_t children_count = [children count]; IMP append; @@ -219,16 +219,16 @@ return ret; } - (void)addAttribute: (OFXMLAttribute*)attr { - if (attrs == nil) - attrs = [[OFMutableArray alloc] init]; + if (attributes == nil) + attributes = [[OFMutableArray alloc] init]; /* FIXME: Prevent having it twice! */ - [attrs addObject: attr]; + [attributes addObject: attr]; } - (void)addAttributeWithName: (OFString*)name_ stringValue: (OFString*)value { @@ -243,11 +243,11 @@ /* TODO: Replace attribute */ /* TODO: Remove attribute */ - (void)addChild: (OFXMLElement*)child { - if (stringval != nil) + if (stringValue != nil) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; if (children == nil) children = [[OFMutableArray alloc] init]; @@ -256,12 +256,12 @@ } - (void)dealloc { [name release]; - [attrs release]; - [stringval release]; + [attributes release]; + [stringValue release]; [children release]; [super dealloc]; } @end Index: src/OFXMLParser.h ================================================================== --- src/OFXMLParser.h +++ src/OFXMLParser.h @@ -127,12 +127,12 @@ OFMutableString *cache; OFString *name; OFString *prefix; OFString *ns; OFMutableArray *attrs; - OFString *attr_name; - OFString *attr_prefix; + OFString *attrName; + OFString *attrPrefix; char delim; OFMutableArray *previous; } /** Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -109,12 +109,12 @@ [cache release]; [name release]; [prefix release]; [ns release]; [attrs release]; - [attr_name release]; - [attr_prefix release]; + [attrName release]; + [attrPrefix release]; [previous release]; [super dealloc]; } @@ -357,20 +357,20 @@ cache_c = [cache cString]; cache_len = [cache cStringLength]; if ((tmp = memchr(cache_c, ':', cache_len)) != NULL ) { - attr_name = [[OFString alloc] + attrName = [[OFString alloc] initWithCString: tmp + 1 length: cache_len - (tmp - cache_c) - 1]; - attr_prefix = [[OFString alloc] + attrPrefix = [[OFString alloc] initWithCString: cache_c length: tmp - cache_c]; } else { - attr_name = [cache copy]; - attr_prefix = nil; + attrName = [cache copy]; + attrPrefix = nil; } [cache setToCString: ""]; last = i + 1; @@ -404,20 +404,20 @@ pool = [[OFAutoreleasePool alloc] init]; attr_val = [cache stringByXMLUnescapingWithHandler: self]; [attrs addObject: [OFXMLAttribute - attributeWithName: attr_name - prefix: attr_prefix + attributeWithName: attrName + prefix: attrPrefix namespace: nil stringValue: attr_val]]; [pool release]; [cache setToCString: ""]; - [attr_name release]; - [attr_prefix release]; - attr_name = attr_prefix = nil; + [attrName release]; + [attrPrefix release]; + attrName = attrPrefix = nil; last = i + 1; state = OF_XMLPARSER_IN_TAG; } break; @@ -510,11 +510,11 @@ OFMutableString *ret; last = 0; in_entity = NO; ret = [OFMutableString string]; - ((OFString*)ret)->is_utf8 = is_utf8; + ((OFString*)ret)->isUTF8 = isUTF8; for (i = 0; i < length; i++) { if (!in_entity && string[i] == '&') { [ret appendCStringWithoutUTF8Checking: string + last length: i - last];