Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -67,11 +67,11 @@ * \param first The first object * \param args A va_list * \return An initialized OFArray */ - initWithObject: (OFObject*)first - andArgList: (va_list)args; + argList: (va_list)args; /** * Initializes an OFArray with the objects from the specified C array. * * \param objs A C array of objects Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -32,11 +32,11 @@ id ret; va_list args; va_start(args, first); ret = [[[self alloc] initWithObject: first - andArgList: args] autorelease]; + argList: args] autorelease]; va_end(args); return ret; } @@ -85,18 +85,18 @@ id ret; va_list args; va_start(args, first); ret = [self initWithObject: first - andArgList: args]; + argList: args]; va_end(args); return ret; } - initWithObject: (OFObject*)first - andArgList: (va_list)args + argList: (va_list)args { id obj; self = [self init]; @@ -219,14 +219,14 @@ } - addObject: (OFObject*)obj { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - removeNObjects: (size_t)nobjects { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } @end Index: src/OFAutoreleasePool.m ================================================================== --- src/OFAutoreleasePool.m +++ src/OFAutoreleasePool.m @@ -151,14 +151,14 @@ } - retain { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - autorelease { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } @end Index: src/OFConstString.m ================================================================== --- src/OFConstString.m +++ src/OFConstString.m @@ -28,45 +28,45 @@ #endif - addMemoryToPool: (void*)ptr { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - (void*)allocMemoryWithSize: (size_t)size { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - (void*)allocMemoryForNItems: (size_t)nitems withSize: (size_t)size { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - (void*)resizeMemory: (void*)ptr toSize: (size_t)size { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - (void*)resizeMemory: (void*)ptr toNItems: (size_t)nitems withSize: (size_t)size { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - freeMemory: (void*)ptr { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - retain { return self; @@ -87,9 +87,9 @@ } - (void)dealloc { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; [super dealloc]; /* Get rid of stupid warning */ } @end Index: src/OFDataArray.m ================================================================== --- src/OFDataArray.m +++ src/OFDataArray.m @@ -40,11 +40,11 @@ if (is == 0) { c = isa; [super dealloc]; @throw [OFInvalidArgumentException newWithClass: c - andSelector: _cmd]; + selector: _cmd]; } data = NULL; itemsize = is; @@ -148,14 +148,14 @@ { int ret; if (![obj isKindOfClass: [OFDataArray class]]) @throw [OFInvalidArgumentException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; if ([obj itemsize] != itemsize) @throw [OFInvalidArgumentException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; if ([obj count] == count) return memcmp(data, [obj data], count * itemsize); if (count > [obj count]) { Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -63,22 +63,22 @@ * * \param key The key * \param obj The object * \return A new autoreleased OFDictionary */ -+ dictionaryWithKey: (OFObject *)key - andObject: (OFObject*)obj; ++ dictionaryWithObject: (OFObject*)obj + forKey: (OFObject *)key; /** * Creates a new OFDictionary with the specified keys and objects. * * \param keys An array of keys * \param objs An array of objects * \return A new autoreleased OFDictionary */ -+ dictionaryWithKeys: (OFArray*)keys - andObjects: (OFArray*)objs; ++ dictionaryWithObjects: (OFArray*)objs + forKeys: (OFArray*)keys; /** * Creates a new OFDictionary with the specified keys objects. * * \param first The first key @@ -116,23 +116,23 @@ * * \param key The key * \param obj The object * \return A new initialized OFDictionary */ -- initWithKey: (OFObject *)key - andObject: (OFObject*)obj; +- initWithObject: (OFObject*)obj + forKey: (OFObject *)key; /** * Initializes an already allocated OFDictionary with the specified keys and * objects. * * \param keys An array of keys * \param objs An array of objects * \return A new initialized OFDictionary */ -- initWithKeys: (OFArray*)keys - andObjects: (OFArray*)objs; +- initWithObjects: (OFArray*)objs + forKeys: (OFArray*)keys; /** * Initializes an already allocated OFDictionary with the specified keys and * objects. * @@ -147,11 +147,11 @@ * * \param first The first key * \return A new initialized OFDictionary */ - initWithKey: (OFObject *)first - andArgList: (va_list)args; + argList: (va_list)args; /** * \return The average number of items in a used bucket. Buckets that are * completely empty are not in the calculation. If this value is >= 2.0, * you should resize the dictionary, in most cases even earlier! Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -38,32 +38,32 @@ + dictionaryWithHashSize: (int)hashsize { return [[[self alloc] initWithHashSize: hashsize] autorelease]; } -+ dictionaryWithKey: (OFObject *)key - andObject: (OFObject*)obj -{ - return [[[self alloc] initWithKey: key - andObject: obj] autorelease]; -} - -+ dictionaryWithKeys: (OFArray*)keys - andObjects: (OFArray*)objs -{ - return [[[self alloc] initWithKeys: keys - andObjects: objs] autorelease]; ++ dictionaryWithObject: (OFObject*)obj + forKey: (OFObject *)key +{ + return [[[self alloc] initWithObject: obj + forKey: key] autorelease]; +} + ++ dictionaryWithObjects: (OFArray*)objs + forKeys: (OFArray*)keys +{ + return [[[self alloc] initWithObjects: objs + forKeys: keys] autorelease]; } + dictionaryWithKeysAndObjects: (OFObject *)first, ... { id ret; va_list args; va_start(args, first); ret = [[[self alloc] initWithKey: first - andArgList: args] autorelease]; + argList: args] autorelease]; va_end(args); return ret; } @@ -102,11 +102,11 @@ if (dict == nil) { Class c = isa; size = 0; [self dealloc]; @throw [OFInvalidArgumentException newWithClass: c - andSelector: _cmd]; + selector: _cmd]; } size = dict->size; @try { @@ -176,11 +176,11 @@ if (hashsize < 8 || hashsize >= 28) { Class c = isa; [super dealloc]; @throw [OFInvalidArgumentException newWithClass: c - andSelector: _cmd]; + selector: _cmd]; } size = (size_t)1 << hashsize; @try { @@ -198,12 +198,12 @@ memset(data, 0, size * sizeof(OFList*)); return self; } -- initWithKey: (OFObject *)key - andObject: (OFObject*)obj +- initWithObject: (OFObject*)obj + forKey: (OFObject *)key { Class c; uint32_t fullhash, hash; self = [self init]; @@ -210,11 +210,11 @@ if (key == nil || obj == nil) { c = isa; [self dealloc]; @throw [OFInvalidArgumentException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } fullhash = [key hash]; hash = fullhash & (size - 1); @@ -241,12 +241,12 @@ } return self; } -- initWithKeys: (OFArray*)keys - andObjects: (OFArray*)objs +- initWithObjects: (OFArray*)objs + forKeys: (OFArray*)keys { Class c; OFObject **keys_data; OFObject **objs_data; size_t count, i; @@ -256,11 +256,11 @@ if (keys == nil || objs == nil || count != [objs count]) { c = isa; [self dealloc]; @throw [OFInvalidArgumentException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } keys_data = [keys data]; objs_data = [objs data]; @@ -270,11 +270,11 @@ if (keys_data[i] == nil || objs_data[i] == nil) { c = isa; [self dealloc]; @throw [OFInvalidArgumentException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } fullhash = [keys_data[i] hash]; hash = fullhash & (size - 1); @@ -312,18 +312,18 @@ id ret; va_list args; va_start(args, first); ret = [self initWithKey: first - andArgList: args]; + argList: args]; va_end(args); return ret; } - initWithKey: (OFObject *)first - andArgList: (va_list)args + argList: (va_list)args { OFObject *key; OFObject *obj; Class c; uint32_t fullhash, hash; @@ -333,11 +333,11 @@ if (first == nil || obj == nil) { c = isa; [self dealloc]; @throw [OFInvalidArgumentException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } fullhash = [first hash]; hash = fullhash & (size - 1); @@ -367,11 +367,11 @@ while ((key = va_arg(args, OFObject *)) != nil) { if ((obj = va_arg(args, OFObject*)) == nil) { c = isa; [self dealloc]; @throw [OFInvalidArgumentException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } fullhash = [key hash]; hash = fullhash & (size - 1); @@ -426,11 +426,11 @@ uint32_t hash; of_dictionary_list_object_t *iter; if (key == nil) @throw [OFInvalidArgumentException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; hash = [key hash] & (size - 1); if (data[hash] == nil) return nil; @@ -480,20 +480,20 @@ - setObject: (OFObject*)obj forKey: (OFObject *)key { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - removeObjectForKey: (OFObject*)key { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - changeHashSize: (int)hashsize { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } @end Index: src/OFExceptions.h ================================================================== --- src/OFExceptions.h +++ src/OFExceptions.h @@ -87,21 +87,21 @@ * \param class The class of the object which caused the exception * \param size The size of the memory that couldn't be allocated * \return A new no memory exception */ + newWithClass: (Class)class - andSize: (size_t)size; + size: (size_t)size; /** * Initializes an already allocated no memory exception. * * \param class The class of the object which caused the exception * \param size The size of the memory that couldn't be allocated * \return An initialized no memory exception */ - initWithClass: (Class)class - andSize: (size_t)size; + size: (size_t)size; /** * \return The size of the memoory that couldn't be allocated */ - (size_t)requestedSize; @@ -119,21 +119,21 @@ * \param class The class of the object which caused the exception * \param ptr A pointer to the memory that is not part of the object * \return A new memory not part of object exception */ + newWithClass: (Class)class - andPointer: (void*)ptr; + pointer: (void*)ptr; /** * Initializes an already allocated memory not part of object exception. * * \param class The class of the object which caused the exception * \param ptr A pointer to the memory that is not part of the object * \return An initialized memory not part of object exception */ - initWithClass: (Class)class - andPointer: (void*)ptr; + pointer: (void*)ptr; /** * \return A pointer to the memory which is not part of the object */ - (void*)pointer; @@ -151,21 +151,21 @@ * \param class The class of the object which caused the exception * \param selector The selector which is not or not fully implemented * \return A new not implemented exception */ + newWithClass: (Class)class - andSelector: (SEL)selector; + selector: (SEL)selector; /** * Initializes an already allocated not implemented exception. * * \param class The class of the object which caused the exception * \param selector The selector which is not or not fully implemented * \return An initialized not implemented exception */ - initWithClass: (Class)class - andSelector: (SEL)selector; + selector: (SEL)selector; @end /** * An OFException indicating the given value is out of range. */ @@ -184,21 +184,21 @@ * \param class The class of the object which caused the exception * \param selector The selector which doesn't accept the argument * \return A new invalid argument exception */ + newWithClass: (Class)class - andSelector: (SEL)selector; + selector: (SEL)selector; /** * Initializes an already allocated invalid argument exception * * \param class The class of the object which caused the exception * \param selector The selector which doesn't accept the argument * \return An initialized invalid argument exception */ - initWithClass: (Class)class - andSelector: (SEL)selector; + selector: (SEL)selector; @end /** * An OFException indicating that the encoding is invalid for this object. */ @@ -232,12 +232,12 @@ * \param path A string of the path to the file tried to open * \param mode A string of the mode in which the file should have been opened * \return A new open file failed exception */ + newWithClass: (Class)class - andPath: (OFString*)path - andMode: (OFString*)mode; + path: (OFString*)path + mode: (OFString*)mode; /** * Initializes an already allocated open file failed exception. * * \param class The class of the object which caused the exception @@ -244,12 +244,12 @@ * \param path A string of the path to the file which couldn't be opened * \param mode A string of the mode in which the file should have been opened * \return An initialized open file failed exception */ - initWithClass: (Class)class - andPath: (OFString*)path - andMode: (OFString*)mode; + path: (OFString*)path + mode: (OFString*)mode; /** * \return The errno from when the exception was created */ - (int)errNo; @@ -277,46 +277,46 @@ } /** * \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 - * \param nitems The requested number of items that couldn't be read / written + * \param items The requested number of items that couldn't be read / written * \return A new open file failed exception */ + newWithClass: (Class)class - andSize: (size_t)size - andNItems: (size_t)nitems; + size: (size_t)size + items: (size_t)items; /** * \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 * \return A new open file failed exception */ + newWithClass: (Class)class - andSize: (size_t)size; + size: (size_t)size; /** * Initializes an already allocated read or write failed exception. * * \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 - * \param nitems The requested number of items that couldn't be read / written + * \param items The requested number of items that couldn't be read / written * \return A new open file failed exception */ - initWithClass: (Class)class - andSize: (size_t)size - andNItems: (size_t)nitems; + size: (size_t)size + items: (size_t)items; /** * Initializes an already allocated read or write failed exception. * * \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 * \return A new open file failed exception */ - initWithClass: (Class)class - andSize: (size_t)size; + size: (size_t)size; /** * \return The errno from when the exception was created */ - (int)errNo; @@ -383,12 +383,12 @@ * \param node The node for which translation was requested * \param service The service of the node for which translation was requested * \return A new address translation failed exception */ + newWithClass: (Class)class - andNode: (OFString*)node - andService: (OFString*)service; + node: (OFString*)node + service: (OFString*)service; /** * Initializes an already allocated address translation failed exception. * * \param class The class of the object which caused the exception @@ -395,12 +395,12 @@ * \param node The node for which translation was requested * \param service The service of the node for which translation was requested * \return An initialized address translation failed exception */ - initWithClass: (Class)class - andNode: (OFString*)node - andService: (OFString*)service; + node: (OFString*)node + service: (OFString*)service; /** * \return The errno from when the exception was created */ - (int)errNo; @@ -431,12 +431,12 @@ * \param node The node to which the connection failed * \param service The service on the node to which the connection failed * \return A new connection failed exception */ + newWithClass: (Class)class - andNode: (OFString*)node - andService: (OFString*)service; + node: (OFString*)node + service: (OFString*)service; /** * Initializes an already allocated connection failed exception. * * \param class The class of the object which caused the exception @@ -443,12 +443,12 @@ * \param node The node to which the connection failed * \param service The service on the node to which the connection failed * \return An initialized connection failed exception */ - initWithClass: (Class)class - andNode: (OFString*)node - andService: (OFString*)service; + node: (OFString*)node + service: (OFString*)service; /** * \return The errno from when the exception was created */ - (int)errNo; @@ -481,13 +481,13 @@ * \param service The service on which binding failed * \param family The family for which binnding failed * \return A new bind failed exception */ + newWithClass: (Class)class - andNode: (OFString*)node - andService: (OFString*)service - andFamily: (int)family; + node: (OFString*)node + service: (OFString*)service + family: (int)family; /** * Initializes an already allocated bind failed exception. * * \param class The class of the object which caused the exception @@ -495,13 +495,13 @@ * \param service The service on which binding failed * \param family The family for which binnding failed * \return An initialized bind failed exception */ - initWithClass: (Class)class - andNode: (OFString*)node - andService: (OFString*)service - andFamily: (int)family; + node: (OFString*)node + service: (OFString*)service + family: (int)family; /** * \return The errno from when the exception was created */ - (int)errNo; @@ -535,21 +535,21 @@ * \param class The class of the object which caused the exception * \param backlog The requested size of the back log * \return A new listen failed exception */ + newWithClass: (Class)class - andBackLog: (int)backlog; + backLog: (int)backlog; /** * Initializes an already allocated listen failed exception * * \param class The class of the object which caused the exception * \param backlog The requested size of the back log * \return An initialized listen failed exception */ - initWithClass: (Class)class - andBackLog: (int)backlog; + backLog: (int)backlog; /** * \return The errno from when the exception was created */ - (int)errNo; Index: src/OFExceptions.m ================================================================== --- src/OFExceptions.m +++ src/OFExceptions.m @@ -100,18 +100,18 @@ } @end @implementation OFOutOfMemoryException + newWithClass: (Class)class_ - andSize: (size_t)size + size: (size_t)size { return [[self alloc] initWithClass: class_ - andSize: size]; + size: size]; } - initWithClass: (Class)class_ - andSize: (size_t)size + size: (size_t)size { self = [super initWithClass: class_]; req_size = size; @@ -136,18 +136,18 @@ } @end @implementation OFMemoryNotPartOfObjectException + newWithClass: (Class)class_ - andPointer: (void*)ptr + pointer: (void*)ptr { return [[self alloc] initWithClass: class_ - andPointer: ptr]; + pointer: ptr]; } - initWithClass: (Class)class_ - andPointer: (void*)ptr + pointer: (void*)ptr { self = [super initWithClass: class_]; pointer = ptr; @@ -174,18 +174,18 @@ } @end @implementation OFNotImplementedException + newWithClass: (Class)class_ - andSelector: (SEL)selector_ + selector: (SEL)selector_ { return [[self alloc] initWithClass: class_ - andSelector: selector_]; + selector: selector_]; } - initWithClass: (Class)class_ - andSelector: (SEL)selector_ + selector: (SEL)selector_ { self = [super initWithClass: class_]; selector = selector_; @@ -218,18 +218,18 @@ } @end @implementation OFInvalidArgumentException + newWithClass: (Class)class_ - andSelector: (SEL)selector_ + selector: (SEL)selector_ { return [[self alloc] initWithClass: class_ - andSelector: selector_]; + selector: selector_]; } - initWithClass: (Class)class_ - andSelector: (SEL)selector_ + selector: (SEL)selector_ { self = [super initWithClass: class_]; selector = selector_; @@ -288,21 +288,21 @@ } @end @implementation OFOpenFileFailedException + newWithClass: (Class)class_ - andPath: (OFString*)path_ - andMode: (OFString*)mode_ + path: (OFString*)path_ + mode: (OFString*)mode_ { return [[self alloc] initWithClass: class_ - andPath: path_ - andMode: mode_]; + path: path_ + mode: mode_]; } - initWithClass: (Class)class_ - andPath: (OFString*)path_ - andMode: (OFString*)mode_ + path: (OFString*)path_ + mode: (OFString*)mode_ { self = [super initWithClass: class_]; path = [path_ retain]; mode = [mode_ retain]; @@ -347,33 +347,33 @@ } @end @implementation OFReadOrWriteFailedException + newWithClass: (Class)class_ - andSize: (size_t)size - andNItems: (size_t)nitems + size: (size_t)size + items: (size_t)items { return [[self alloc] initWithClass: class_ - andSize: size - andNItems: nitems]; + size: size + items: items]; } + newWithClass: (Class)class_ - andSize: (size_t)size + size: (size_t)size { return [[self alloc] initWithClass: class_ - andSize: size]; + size: size]; } - initWithClass: (Class)class_ - andSize: (size_t)size - andNItems: (size_t)nitems + size: (size_t)size + items: (size_t)items { self = [super initWithClass: class_]; req_size = size; - req_items = nitems; + req_items = items; has_items = YES; if (class_ == [OFTCPSocket class]) err = GET_SOCK_ERR; else @@ -381,11 +381,11 @@ return self; } - initWithClass: (Class)class_ - andSize: (size_t)size + size: (size_t)size { self = [super initWithClass: class_]; req_size = size; req_items = 0; @@ -498,21 +498,21 @@ } @end @implementation OFAddressTranslationFailedException + newWithClass: (Class)class_ - andNode: (OFString*)node_ - andService: (OFString*)service_ + node: (OFString*)node_ + service: (OFString*)service_ { return [[self alloc] initWithClass: class_ - andNode: node_ - andService: service_]; + node: node_ + service: service_]; } - initWithClass: (Class)class_ - andNode: (OFString*)node_ - andService: (OFString*)service_ + node: (OFString*)node_ + service: (OFString*)service_ { self = [super initWithClass: class_]; node = [node_ retain]; service = [service_ retain]; @@ -561,21 +561,21 @@ } @end @implementation OFConnectionFailedException + newWithClass: (Class)class_ - andNode: (OFString*)node_ - andService: (OFString*)service_ + node: (OFString*)node_ + service: (OFString*)service_ { return [[self alloc] initWithClass: class_ - andNode: node_ - andService: service_]; + node: node_ + service: service_]; } - initWithClass: (Class)class_ - andNode: (OFString*)node_ - andService: (OFString*)service_ + node: (OFString*)node_ + service: (OFString*)service_ { self = [super initWithClass: class_]; node = [node_ retain]; service = [service_ retain]; @@ -621,24 +621,24 @@ } @end @implementation OFBindFailedException + newWithClass: (Class)class_ - andNode: (OFString*)node_ - andService: (OFString*)service_ - andFamily: (int)family_ + node: (OFString*)node_ + service: (OFString*)service_ + family: (int)family_ { return [[self alloc] initWithClass: class_ - andNode: node_ - andService: service_ - andFamily: family_]; + node: node_ + service: service_ + family: family_]; } - initWithClass: (Class)class_ - andNode: (OFString*)node_ - andService: (OFString*)service_ - andFamily: (int)family_ + node: (OFString*)node_ + service: (OFString*)service_ + family: (int)family_ { self = [super initWithClass: class_]; node = [node_ retain]; service = [service_ retain]; @@ -690,18 +690,18 @@ } @end @implementation OFListenFailedException + newWithClass: (Class)class_ - andBackLog: (int)backlog_ + backLog: (int)backlog_ { return [[self alloc] initWithClass: class_ - andBackLog: backlog_]; + backLog: backlog_]; } - initWithClass: (Class)class_ - andBackLog: (int)backlog_ + backLog: (int)backlog_ { self = [super initWithClass: class_]; backlog = backlog_; err = GET_SOCK_ERR; Index: src/OFFile.h ================================================================== --- src/OFFile.h +++ src/OFFile.h @@ -33,11 +33,11 @@ * \param path The path to the file to open as a string * \param mode The mode in which the file should be opened as a string * \return A new autoreleased OFFile */ + fileWithPath: (OFString*)path - andMode: (OFString*)mode; + mode: (OFString*)mode; /** * \return An OFFile singleton for stdin */ + standardInput; @@ -75,12 +75,12 @@ * \param owner The new owner for the file * \param group The new group for the file * \return A boolean whether the operation succeeded */ + (void)changeOwnerOfFile: (OFString*)path - toOwner: (uid_t)owner - andGroup: (gid_t)group; + owner: (uid_t)owner + group: (gid_t)group; /** * Deletes a file. * * \param path The path to the file of which should be deleted as a string @@ -118,11 +118,11 @@ * \param path The path to the file to open as a string * \param mode The mode in which the file should be opened as a string * \return An initialized OFFile */ - initWithPath: (OFString*)path - andMode: (OFString*)mode; + mode: (OFString*)mode; /** * Reads from the file into a buffer. * * \param buf The buffer into which the data is read Index: src/OFFile.m ================================================================== --- src/OFFile.m +++ src/OFFile.m @@ -27,14 +27,14 @@ static OFFileSingleton *of_file_stdout = nil; static OFFileSingleton *of_file_stderr = nil; @implementation OFFile + fileWithPath: (OFString*)path - andMode: (OFString*)mode + mode: (OFString*)mode { return [[[self alloc] initWithPath: path - andMode: mode] autorelease]; + mode: mode] autorelease]; } + standardInput { if (of_file_stdin == nil) @@ -73,12 +73,12 @@ chmod([path cString], mode); #endif } + (void)changeOwnerOfFile: (OFString*)path - toOwner: (uid_t)owner - andGroup: (gid_t)group + owner: (uid_t)owner + group: (gid_t)group { /* FIXME: On error, throw exception */ #ifndef _WIN32 chown([path cString], owner, group); #endif @@ -107,22 +107,22 @@ symlink([src cString], [dest cString]); #endif } - initWithPath: (OFString*)path - andMode: (OFString*)mode + mode: (OFString*)mode { Class c; self = [super init]; if ((fp = fopen([path cString], [mode cString])) == NULL) { c = isa; [super dealloc]; @throw [OFOpenFileFailedException newWithClass: c - andPath: path - andMode: mode]; + path: path + mode: mode]; } return self; } @@ -150,12 +150,12 @@ if (fp == NULL || feof(fp) || ((ret = fread(buf, size, nitems, fp)) == 0 && size != 0 && nitems != 0 && !feof(fp))) @throw [OFReadFailedException newWithClass: isa - andSize: size - andNItems: nitems]; + size: size + items: nitems]; return ret; } - (size_t)readNBytes: (size_t)size @@ -174,12 +174,12 @@ if (fp == NULL || feof(fp) || ((ret = fwrite(buf, size, nitems, fp)) < nitems && size != 0 && nitems != 0)) @throw [OFWriteFailedException newWithClass: isa - andSize: size - andNItems: nitems]; + size: size + items: nitems]; return ret; } - (size_t)writeNBytes: (size_t)size @@ -236,9 +236,9 @@ } - (void)dealloc { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; [super dealloc]; /* Get rid of stupid warning */ } @end Index: src/OFIterator.h ================================================================== --- src/OFIterator.h +++ src/OFIterator.h @@ -31,11 +31,11 @@ size_t pos; of_dictionary_list_object_t *last; } - initWithData: (OFList**)data - andSize: (size_t)size; + size: (size_t)size; /** * \return A struct containing the next key and object */ - (of_iterator_pair_t)nextKeyObjectPair; Index: src/OFIterator.m ================================================================== --- src/OFIterator.m +++ src/OFIterator.m @@ -18,11 +18,11 @@ /* Reference for static linking */ int _OFIterator_reference; @implementation OFIterator - initWithData: (OFList**)data_ - andSize: (size_t)size_ + size: (size_t)size_ { self = [super init]; data = data_; size = size_; @@ -74,8 +74,8 @@ @implementation OFDictionary (OFIterator) - (OFIterator*)iterator { return [[[OFIterator alloc] initWithData: data - andSize: size] autorelease]; + size: size] autorelease]; } @end Index: src/OFMutableDictionary.m ================================================================== --- src/OFMutableDictionary.m +++ src/OFMutableDictionary.m @@ -24,11 +24,11 @@ uint32_t fullhash, hash; of_dictionary_list_object_t *iter; if (key == nil || obj == nil) @throw [OFInvalidArgumentException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; fullhash = [key hash]; hash = fullhash & (size - 1); if (data[hash] == nil) @@ -66,11 +66,11 @@ uint32_t hash; of_dictionary_list_object_t *iter; if (key == nil) @throw [OFInvalidArgumentException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; hash = [key hash] & (size - 1); if (data[hash] == nil) return self; @@ -99,11 +99,11 @@ size_t newsize, i; of_dictionary_list_object_t *iter; if (hashsize < 8 || hashsize >= 28) @throw [OFInvalidArgumentException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; newsize = (size_t)1 << hashsize; newdata = [self allocMemoryForNItems: newsize withSize: sizeof(OFList*)]; memset(newdata, 0, newsize * sizeof(OFList*)); Index: src/OFMutableString.h ================================================================== --- src/OFMutableString.h +++ src/OFMutableString.h @@ -61,11 +61,11 @@ * * \param str A UTF-8 encoded C string to append * \param len The length of the UTF-8 encoded C string */ - appendCStringWithoutUTF8Checking: (const char*)str - andLength: (size_t)len; + length: (size_t)len; /** * Appends another OFString to the OFString. * * \param str An OFString to append @@ -86,11 +86,11 @@ * * \param fmt A format string which generates the string to append * \param args The arguments used in the format string */ - appendWithFormat: (OFString*)fmt - andArguments: (va_list)args; + arguments: (va_list)args; /** * Reverse the OFString. */ - reverse; Index: src/OFMutableString.m ================================================================== --- src/OFMutableString.m +++ src/OFMutableString.m @@ -116,11 +116,11 @@ return self; } - appendCStringWithoutUTF8Checking: (const char*)str - andLength: (size_t)len + length: (size_t)len { if (len > strlen(str)) @throw [OFOutOfRangeException newWithClass: isa]; string = [self resizeMemory: string @@ -142,18 +142,18 @@ id ret; va_list args; va_start(args, fmt); ret = [self appendWithFormat: fmt - andArguments: args]; + arguments: args]; va_end(args); return ret; } - appendWithFormat: (OFString*)fmt - andArguments: (va_list)args + arguments: (va_list)args { char *t; if (fmt == NULL) @throw [OFInvalidFormatException newWithClass: isa]; Index: src/OFNumber.m ================================================================== --- src/OFNumber.m +++ src/OFNumber.m @@ -746,11 +746,11 @@ case OF_NUMBER_FLOAT: case OF_NUMBER_DOUBLE: return ([obj asDouble] == [self asDouble] ? YES : NO); default: @throw [OFInvalidArgumentException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } } - (uint32_t)hash { Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -147,15 +147,15 @@ Method_t method = class_get_instance_method(self, selector); IMP oldimp; if (method == NULL) @throw [OFInvalidArgumentException newWithClass: self - andSelector: _cmd]; + selector: _cmd]; if ((oldimp = method_get_imp(method)) == (IMP)0 || newimp == (IMP)0) @throw [OFInvalidArgumentException newWithClass: self - andSelector: _cmd]; + selector: _cmd]; method->method_imp = newimp; /* Update the dtable if necessary */ if (sarray_get_safe(((Class)self)->dtable, @@ -167,11 +167,11 @@ #else Method method; if ((method = class_getInstanceMethod(self, selector)) == NULL) @throw [OFInvalidArgumentException newWithClass: self - andSelector: _cmd]; + selector: _cmd]; return method_setImplementation(method, newimp); #endif } @@ -277,11 +277,11 @@ @throw [OFOutOfRangeException newWithClass: isa]; if ((memchunks = realloc(PRE_IVAR->memchunks, memchunks_size * sizeof(void*))) == NULL) @throw [OFOutOfMemoryException newWithClass: isa - andSize: memchunks_size]; + size: memchunks_size]; PRE_IVAR->memchunks = memchunks; PRE_IVAR->memchunks[PRE_IVAR->memchunks_size] = ptr; PRE_IVAR->memchunks_size = memchunks_size; @@ -302,17 +302,17 @@ memchunks_size > SIZE_MAX / sizeof(void*)) @throw [OFOutOfRangeException newWithClass: isa]; if ((ptr = malloc(size)) == NULL) @throw [OFOutOfMemoryException newWithClass: isa - andSize: size]; + size: size]; if ((memchunks = realloc(PRE_IVAR->memchunks, memchunks_size * sizeof(void*))) == NULL) { free(ptr); @throw [OFOutOfMemoryException newWithClass: isa - andSize: memchunks_size]; + size: memchunks_size]; } PRE_IVAR->memchunks = memchunks; PRE_IVAR->memchunks[PRE_IVAR->memchunks_size] = ptr; PRE_IVAR->memchunks_size = memchunks_size; @@ -350,19 +350,19 @@ while (iter-- > PRE_IVAR->memchunks) { if (OF_UNLIKELY(*iter == ptr)) { if (OF_UNLIKELY((ptr = realloc(ptr, size)) == NULL)) @throw [OFOutOfMemoryException newWithClass: isa - andSize: size]; + size: size]; *iter = ptr; return ptr; } } @throw [OFMemoryNotPartOfObjectException newWithClass: isa - andPointer: ptr]; + pointer: ptr]; } - (void*)resizeMemory: (void*)ptr toNItems: (size_t)nitems withSize: (size_t)size @@ -424,11 +424,11 @@ return self; } } @throw [OFMemoryNotPartOfObjectException newWithClass: isa - andPointer: ptr]; + pointer: ptr]; } - retain { PRE_IVAR->retain_count++; @@ -472,45 +472,45 @@ * metaclass and thus instance methods can be sent to class objects as well. */ + addMemoryToPool: (void*)ptr { @throw [OFNotImplementedException newWithClass: self - andSelector: _cmd]; + selector: _cmd]; } + (void*)allocMemoryWithSize: (size_t)size { @throw [OFNotImplementedException newWithClass: self - andSelector: _cmd]; + selector: _cmd]; } + (void*)allocMemoryForNItems: (size_t)nitems withSize: (size_t)size { @throw [OFNotImplementedException newWithClass: self - andSelector: _cmd]; + selector: _cmd]; } + (void*)resizeMemory: (void*)ptr toSize: (size_t)size { @throw [OFNotImplementedException newWithClass: self - andSelector: _cmd]; + selector: _cmd]; } + (void*)resizeMemory: (void*)ptr toNItems: (size_t)nitems withSize: (size_t)size { @throw [OFNotImplementedException newWithClass: self - andSelector: _cmd]; + selector: _cmd]; } + freeMemory: (void*)ptr { @throw [OFNotImplementedException newWithClass: self - andSelector: _cmd]; + selector: _cmd]; } + retain { return self; Index: src/OFPlugin.m ================================================================== --- src/OFPlugin.m +++ src/OFPlugin.m @@ -30,11 +30,11 @@ pathlen = [path length]; suffixlen = strlen(PLUGIN_SUFFIX); if ((file = malloc(pathlen + suffixlen + 1)) == NULL) { @throw [OFOutOfMemoryException newWithClass: self - andSize: pathlen + + size: pathlen + suffixlen + 1]; } memcpy(file, [path cString], pathlen); memcpy(file + pathlen, PLUGIN_SUFFIX, suffixlen); file[pathlen + suffixlen] = 0; Index: src/OFSocket.m ================================================================== --- src/OFSocket.m +++ src/OFSocket.m @@ -80,11 +80,11 @@ if (sock == INVALID_SOCKET) @throw [OFNotConnectedException newWithClass: isa]; if ((ret = send(sock, buf, size, 0)) == -1) @throw [OFWriteFailedException newWithClass: isa - andSize: size]; + size: size]; /* This is safe, as we already checked for -1 */ return ret; } @@ -124,46 +124,46 @@ - connectToService: (OFString*)service onNode: (OFString*)node { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - bindService: (OFString*)service onNode: (OFString*)node withFamily: (int)family { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - listenWithBackLog: (int)backlog { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - listen { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - (OFSocket*)accept { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - enableKeepAlives: (BOOL)enable { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - close { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } @end Index: src/OFStream.m ================================================================== --- src/OFStream.m +++ src/OFStream.m @@ -47,18 +47,18 @@ } - (BOOL)atEndOfStream { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - (size_t)readNBytes: (size_t)size intoBuffer: (char*)buf { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - (OFString*)readLine { size_t i, len; @@ -69,11 +69,11 @@ if (cache != NULL) { for (i = 0; i < cache_len; i++) { if (OF_UNLIKELY(cache[i] == '\n' || cache[i] == '\0')) { ret = [OFString stringWithCString: cache - andLength: i]; + length: i]; tmp = [self allocMemoryWithSize: cache_len - i - 1]; memcpy(tmp, cache + i + 1, cache_len - i - 1); @@ -95,11 +95,11 @@ if (cache == NULL) return nil; ret = [OFString stringWithCString: cache - andLength: cache_len]; + length: cache_len]; [self freeMemory: cache]; cache = NULL; cache_len = 0; @@ -186,11 +186,11 @@ - (size_t)writeNBytes: (size_t)size fromBuffer: (const char*)buf { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - (size_t)writeString: (OFString*)str { return [self writeNBytes: [str length] @@ -217,8 +217,8 @@ } - close { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } @end Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -55,11 +55,11 @@ * \param str A UTF-8 encoded C string to initialize the OFString with * \param len The length of the string * \return A new autoreleased OFString */ + stringWithCString: (const char*)str - andLength: (size_t)len; + length: (size_t)len; /** * Creates a new OFString from a format string. * See printf for the format syntax. * @@ -98,11 +98,11 @@ * \param str A UTF-8 encoded C string to initialize the OFString with * \param len The length of the string * \return An initialized OFString */ - initWithCString: (const char*)str - andLength: (size_t)len; + length: (size_t)len; /** * Initializes an already allocated OFString with a format string. * See printf for the format syntax. * @@ -118,11 +118,11 @@ * \param fmt A string used as format to initialize the OFString * \param args The arguments used in the format string * \return An initialized OFString */ - initWithFormat: (OFString*)fmt - andArguments: (va_list)args; + arguments: (va_list)args; /** * Initializes an already allocated OFString with another string. * * \param str A string to initialize the OFString with @@ -208,15 +208,15 @@ - appendCString: (const char*)str; - appendCString: (const char*)str withLength: (size_t)len; - appendCStringWithoutUTF8Checking: (const char*)str; - appendCStringWithoutUTF8Checking: (const char*)str - andLength: (size_t)len; + length: (size_t)len; - appendString: (OFString*)str; - appendWithFormat: (OFString*)fmt, ...; - appendWithFormat: (OFString*)fmt - andArguments: (va_list)args; + arguments: (va_list)args; - reverse; - upper; - lower; - replaceOccurrencesOfString: (OFString*)str withString: (OFString*)repl; Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -147,24 +147,24 @@ { return [[[self alloc] initWithCString: str] autorelease]; } + stringWithCString: (const char*)str - andLength: (size_t)len + length: (size_t)len { return [[[self alloc] initWithCString: str - andLength: len] autorelease]; + length: len] autorelease]; } + stringWithFormat: (OFString*)fmt, ... { id ret; va_list args; va_start(args, fmt); ret = [[[self alloc] initWithFormat: fmt - andArguments: args] autorelease]; + arguments: args] autorelease]; va_end(args); return ret; } @@ -217,11 +217,11 @@ return self; } - initWithCString: (const char*)str - andLength: (size_t)len + length: (size_t)len { Class c; self = [super init]; @@ -265,18 +265,18 @@ id ret; va_list args; va_start(args, fmt); ret = [self initWithFormat: fmt - andArguments: args]; + arguments: args]; va_end(args); return ret; } - initWithFormat: (OFString*)fmt - andArguments: (va_list)args + arguments: (va_list)args { int t; Class c; self = [super init]; @@ -370,11 +370,11 @@ - (int)compare: (id)obj { if (![obj isKindOfClass: [OFString class]]) @throw [OFInvalidArgumentException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; return strcmp(string, [obj cString]); } - (uint32_t)hash @@ -434,17 +434,17 @@ - (OFString*)substringFromIndex: (size_t)start toIndex: (size_t)end { if (start > end) @throw [OFInvalidArgumentException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; if (end > length) @throw [OFOutOfRangeException newWithClass: isa]; return [OFString stringWithCString: string + start - andLength: end - start]; + length: end - start]; } - (OFString*)stringByAppendingString: (OFString*)str { return [[OFMutableString stringWithString: self] appendString: str]; @@ -492,11 +492,11 @@ for (i = 0, last = 0; i <= length - delim_len; i++) { if (memcmp(string + i, delim, delim_len)) continue; [array addObject: [OFString stringWithCString: string + last - andLength: i - last]]; + length: i - last]]; i += delim_len - 1; last = i + 1; } [array addObject: [OFString stringWithCString: string + last]]; @@ -506,96 +506,96 @@ } - setToCString: (const char*)str { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - appendCString: (const char*)str { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - appendCString: (const char*)str withLength: (size_t)len { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - appendCStringWithoutUTF8Checking: (const char*)str { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - appendCStringWithoutUTF8Checking: (const char*)str - andLength: (size_t)len + length: (size_t)len { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - appendString: (OFString*)str { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - appendWithFormat: (OFString*)fmt, ... { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - appendWithFormat: (OFString*)fmt - andArguments: (va_list)args + arguments: (va_list)args { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - reverse { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - upper { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - lower { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - replaceOccurrencesOfString: (OFString*)str withString: (OFString*)repl { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - removeLeadingWhitespaces { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - removeTrailingWhitespaces { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } - removeLeadingAndTrailingWhitespaces { @throw [OFNotImplementedException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; } @end Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -66,12 +66,12 @@ hints.ai_socktype = SOCK_STREAM; if (getaddrinfo([node cString], [service cString], &hints, &res0)) @throw [OFAddressTranslationFailedException newWithClass: isa - andNode: node - andService: service]; + node: node + service: service]; for (res = res0; res != NULL; res = res->ai_next) { if ((sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) == INVALID_SOCKET) continue; @@ -98,22 +98,22 @@ if ((he = gethostbyname([node cString])) == NULL) { [mutex unlock]; @throw [OFAddressTranslationFailedException newWithClass: isa - andNode: node - andService: service]; + node: node + service: service]; } if ((se = getservbyname([service cString], "TCP")) != NULL) port = se->s_port; else if ((port = htons(atoi([service cString]))) == 0) { [mutex unlock]; @throw [OFAddressTranslationFailedException newWithClass: isa - andNode: node - andService: service]; + node: node + service: service]; } memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_port = port; @@ -121,12 +121,12 @@ if (he->h_addrtype != AF_INET || (sock = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { [mutex unlock]; @throw [OFConnectionFailedException newWithClass: isa - andNode: node - andService: service]; + node: node + service: service]; } for (ip = he->h_addr_list; *ip != NULL; ip++) { memcpy(&addr.sin_addr.s_addr, *ip, he->h_length); @@ -145,12 +145,12 @@ } #endif if (sock == INVALID_SOCKET) @throw [OFConnectionFailedException newWithClass: isa - andNode: node - andService: service]; + node: node + service: service]; return self; } - bindService: (OFString*)service @@ -160,13 +160,13 @@ if (sock != INVALID_SOCKET) @throw [OFAlreadyConnectedException newWithClass: isa]; if ((sock = socket(family, SOCK_STREAM, 0)) == INVALID_SOCKET) @throw [OFBindFailedException newWithClass: isa - andNode: node - andService: service - andFamily: family]; + node: node + service: service + family: family]; #ifdef HAVE_GETADDRINFO struct addrinfo hints, *res; memset(&hints, 0, sizeof(struct addrinfo)); @@ -174,19 +174,19 @@ hints.ai_socktype = SOCK_STREAM; if (getaddrinfo([node cString], [service cString], &hints, &res)) @throw [OFAddressTranslationFailedException newWithClass: isa - andNode: node - andService: service]; + node: node + service: service]; if (bind(sock, res->ai_addr, res->ai_addrlen) == -1) { freeaddrinfo(res); @throw [OFBindFailedException newWithClass: isa - andNode: node - andService: service - andFamily: family]; + node: node + service: service + family: family]; } freeaddrinfo(res); #else struct hostent *he; @@ -194,32 +194,32 @@ struct sockaddr_in addr; uint16_t port; if (family != AF_INET) @throw [OFBindFailedException newWithClass: isa - andNode: node - andService: service - andFamily: family]; + node: node + service: service + family: family]; [mutex lock]; if ((he = gethostbyname([node cString])) == NULL) { [mutex unlock]; @throw [OFAddressTranslationFailedException newWithClass: isa - andNode: node - andService: service]; + node: node + service: service]; } if ((se = getservbyname([service cString], "TCP")) != NULL) port = se->s_port; else if ((port = htons(atoi([service cString]))) == 0) { [mutex unlock]; @throw [OFAddressTranslationFailedException newWithClass: isa - andNode: node - andService: service]; + node: node + service: service]; } memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_port = port; @@ -226,23 +226,23 @@ if (he->h_addrtype != AF_INET || he->h_addr_list[0] == NULL) { [mutex lock]; @throw [OFAddressTranslationFailedException newWithClass: isa - andNode: node - andService: service]; + node: node + service: service]; } memcpy(&addr.sin_addr.s_addr, he->h_addr_list[0], he->h_length); [mutex unlock]; if (bind(sock, (struct sockaddr*)&addr, sizeof(addr)) == -1) @throw [OFBindFailedException newWithClass: isa - andNode: node - andService: service - andFamily: family]; + node: node + service: service + family: family]; #endif return self; } @@ -251,11 +251,11 @@ if (sock == INVALID_SOCKET) @throw [OFNotConnectedException newWithClass: isa]; if (listen(sock, backlog) == -1) @throw [OFListenFailedException newWithClass: isa - andBackLog: backlog]; + backLog: backlog]; return self; } - listen @@ -263,11 +263,11 @@ if (sock == INVALID_SOCKET) @throw [OFNotConnectedException newWithClass: isa]; if (listen(sock, 5) == -1) @throw [OFListenFailedException newWithClass: isa - andBackLog: 5]; + backLog: 5]; return self; } - (OFSocket*)accept Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -47,11 +47,11 @@ #else if (!TlsSetValue(key->key, obj)) #endif /* FIXME: Maybe another exception would be better */ @throw [OFInvalidArgumentException newWithClass: self - andSelector: _cmd]; + selector: _cmd]; [obj retain]; [old release]; return self; Index: src/OFURLEncoding.m ================================================================== --- src/OFURLEncoding.m +++ src/OFURLEncoding.m @@ -36,11 +36,11 @@ * Oh, and we can't use [self allocWithSize:] here as self might be a * @"" literal. */ if ((ret_c = malloc((length * 3) + 1)) == NULL) @throw [OFOutOfMemoryException newWithClass: isa - andSize: (length * 3) + 1]; + size: (length * 3) + 1]; for (i = 0; *s != '\0'; s++) { if (isalnum(*s) || *s == '-' || *s == '_' || *s == '.' || *s == '~') ret_c[i++] = *s; @@ -76,11 +76,11 @@ s = string; if ((ret_c = malloc(length + 1)) == NULL) @throw [OFOutOfMemoryException newWithClass: isa - andSize: length + 1]; + size: length + 1]; for (st = 0, i = 0, c = 0; *s; s++) { switch (st) { case 0: if (*s == '%') Index: src/OFXMLElement.h ================================================================== --- src/OFXMLElement.h +++ src/OFXMLElement.h @@ -39,11 +39,11 @@ * \param stringval The value for the element * \return A new autorelease OFXMLElement with the specified element name and * value */ + elementWithName: (OFString*)name - andStringValue: (OFString*)stringval; + stringValue: (OFString*)stringval; /** * Initializes an already allocated OFXMLElement with the specified name. * * \param name The name for the element @@ -58,12 +58,12 @@ * \param name The name for the element * \param stringval The value for the element * \return An initialized OFXMLElement with the specified element name and * value */ -- initWithName: (OFString*)name - andStringValue: (OFString*)stringval; +- initWithName: (OFString*)name + stringValue: (OFString*)stringval; /** * \return A new autoreleased OFString representing the OFXMLElement as an * XML string */ @@ -74,11 +74,11 @@ * * \param name The name of the attribute * \param value The value of the attribute */ - addAttributeWithName: (OFString*)name - andValue: (OFString*)value; + stringValue: (OFString*)value; /** * Adds a child to the OFXMLElement. * * \param child Another OFXMLElement which is added as a child Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -26,14 +26,14 @@ { return [[[self alloc] initWithName: name_] autorelease]; } + elementWithName: (OFString*)name_ - andStringValue: (OFString*)stringval_ + stringValue: (OFString*)stringval_ { return [[[self alloc] initWithName: name_ - andStringValue: stringval_] autorelease]; + stringValue: stringval_] autorelease]; } - initWithName: (OFString*)name_ { self = [super init]; @@ -41,12 +41,12 @@ name = [name_ retain]; return self; } -- initWithName: (OFString*)name_ - andStringValue: (OFString*)stringval_ +- initWithName: (OFString*)name_ + stringValue: (OFString*)stringval_ { self = [super init]; name = [name_ retain]; stringval = [stringval_ retain]; @@ -158,11 +158,11 @@ return ret; } - addAttributeWithName: (OFString*)name_ - andValue: (OFString*)value_ + stringValue: (OFString*)value_ { if (attrs == nil) attrs = [[OFMutableDictionary alloc] init]; [attrs setObject: value_ @@ -173,11 +173,11 @@ - addChild: (OFXMLElement*)child { if (stringval != nil) @throw [OFInvalidArgumentException newWithClass: isa - andSelector: _cmd]; + selector: _cmd]; if (children == nil) children = [[OFMutableArray alloc] init]; [children addObject: child]; @@ -210,11 +210,11 @@ /* * We can't use allocMemoryWithSize: here as it might be a @"" literal */ if ((str_c = malloc(len + 1)) == NULL) @throw [OFOutOfMemoryException newWithClass: isa - andSize: len]; + size: len]; for (i = 0; i < length; i++) { switch (string[i]) { case '<': append = "<"; @@ -244,11 +244,11 @@ if (append != NULL) { if ((tmp = realloc(str_c, len + append_len)) == NULL) { free(str_c); @throw [OFOutOfMemoryException newWithClass: isa - andSize: len + append_len]; + size: len + append_len]; } str_c = tmp; len += append_len - 1; memcpy(str_c + j, append, append_len); Index: src/OFXMLParser.h ================================================================== --- src/OFXMLParser.h +++ src/OFXMLParser.h @@ -18,17 +18,17 @@ @class OFXMLParser; @protocol OFXMLParserDelegate - (BOOL)xmlParser: (OFXMLParser*)parser didStartTagWithName: (OFString*)name - andPrefix: (OFString*)prefix - andNamespace: (OFString*)ns - andAttributes: (OFDictionary*)attrs; + prefix: (OFString*)prefix + namespace: (OFString*)ns + attributes: (OFDictionary*)attrs; - (BOOL)xmlParser: (OFXMLParser*)parser didEndTagWithName: (OFString*)name - andPrefix: (OFString*)prefix - andNamespace: (OFString*)ns; + prefix: (OFString*)prefix + namespace: (OFString*)ns; - (BOOL)xmlParser: (OFXMLParser*)parser foundString: (OFString*)string; @end @interface OFXMLParser: OFObject Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -62,11 +62,11 @@ if ((i = of_string_unicode_to_utf8(c, buf)) == 0) return nil; return [OFString stringWithCString: buf - andLength: i]; + length: i]; } @implementation OFXMLParser + xmlParser { @@ -177,38 +177,38 @@ if ((tmp = memchr(cache_c, ':', cache_len)) != NULL) { prefix = [[OFString alloc] initWithCString: cache_c - andLength: tmp - cache_c]; + length: tmp - cache_c]; name = [[OFString alloc] initWithCString: tmp + 1 - andLength: cache_len - (tmp - + length: cache_len - (tmp - cache_c) - 1]; } else { prefix = nil; name = [[OFString alloc] initWithCString: cache_c - andLength: cache_len]; + length: cache_len]; } [cache setToCString: ""]; if (buf[i] == '>' || buf[i] == '/') { pool = [[OFAutoreleasePool alloc] init]; [delegate xmlParser: self didStartTagWithName: name - andPrefix: prefix - andNamespace: ns - andAttributes: nil]; + prefix: prefix + namespace: ns + attributes: nil]; if (buf[i] == '/') [delegate xmlParser: self didEndTagWithName: name - andPrefix: prefix - andNamespace: ns]; + prefix: prefix + namespace: ns]; [pool release]; [name release]; [prefix release]; @@ -239,30 +239,30 @@ if ((tmp = memchr(cache_c, ':', cache_len)) != NULL) { prefix = [[OFString alloc] initWithCString: cache_c - andLength: tmp - cache_c]; + length: tmp - cache_c]; name = [[OFString alloc] initWithCString: tmp + 1 - andLength: cache_len - (tmp - + length: cache_len - (tmp - cache_c) - 1]; } else { prefix = nil; name = [[OFString alloc] initWithCString: cache_c - andLength: cache_len]; + length: cache_len]; } [cache setToCString: ""]; pool = [[OFAutoreleasePool alloc] init]; [delegate xmlParser: self didEndTagWithName: name - andPrefix: prefix - andNamespace: ns]; + prefix: prefix + namespace: ns]; [pool release]; [name release]; [prefix release]; @@ -280,19 +280,19 @@ if (buf[i] == '>' || buf[i] == '/') { pool = [[OFAutoreleasePool alloc] init]; [delegate xmlParser: self didStartTagWithName: name - andPrefix: prefix - andNamespace: ns - andAttributes: attrs]; + prefix: prefix + namespace: ns + attributes: attrs]; if (buf[i] == '/') [delegate xmlParser: self didEndTagWithName: name - andPrefix: prefix - andNamespace: ns]; + prefix: prefix + namespace: ns]; [pool release]; [name release]; [prefix release]; @@ -413,11 +413,11 @@ ret = [OFMutableString string]; for (i = 0; i < length; i++) { if (!in_entity && string[i] == '&') { [ret appendCStringWithoutUTF8Checking: string + last - andLength: i - last]; + length: i - last]; last = i + 1; in_entity = YES; } else if (in_entity && string[i] == ';') { char *entity = string + last; @@ -451,11 +451,11 @@ OFString *n, *tmp; pool = [[OFAutoreleasePool alloc] init]; n = [OFString stringWithCString: entity - andLength: len]; + length: len]; tmp = [h foundUnknownEntityNamed: n]; if (tmp == nil) @throw [OFInvalidEncodingException newWithClass: isa]; @@ -473,10 +473,10 @@ if (in_entity) @throw [OFInvalidEncodingException newWithClass: isa]; [ret appendCStringWithoutUTF8Checking: string + last - andLength: i - last]; + length: i - last]; return ret; } @end Index: tests/OFDictionary/OFDictionary.m ================================================================== --- tests/OFDictionary/OFDictionary.m +++ tests/OFDictionary/OFDictionary.m @@ -26,10 +26,11 @@ { int i = 0; OFDictionary *dict = [OFMutableDictionary dictionaryWithHashSize: 16]; OFDictionary *dict2; + OFArray *keys, *objs; OFIterator *iter = [dict iterator]; of_iterator_pair_t pair[2]; OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFString *key1 = [OFString stringWithCString: "key1"]; @@ -114,22 +115,23 @@ return 1; } i++; [dict release]; - dict = [OFDictionary dictionaryWithKey: @"foo" - andObject: @"bar"]; + dict = [OFDictionary dictionaryWithObject: @"bar" + forKey: @"foo"]; if (![[dict objectForKey: @"foo"] isEqual: @"bar"]) { printf("\033[K\033[1;31mTest %d/%d failed!\033[m\n", i, TESTS); return 1; } i++; [dict release]; - dict = [OFDictionary - dictionaryWithKeys: [OFArray arrayWithObjects: @"k1", @"k2", nil] - andObjects: [OFArray arrayWithObjects: @"o1", @"o2", nil]]; + keys = [OFArray arrayWithObjects: @"k1", @"k2", nil]; + objs = [OFArray arrayWithObjects: @"o1", @"o2", nil]; + dict = [OFDictionary dictionaryWithObjects: objs + forKeys: keys]; if (![[dict objectForKey: @"k1"] isEqual: @"o1"]) { printf("\033[K\033[1;31mTest %d/%d failed!\033[m\n", i, TESTS); return 1; } Index: tests/OFHashes/OFHashes.m ================================================================== --- tests/OFHashes/OFHashes.m +++ tests/OFHashes/OFHashes.m @@ -30,11 +30,11 @@ size_t len; OFMD5Hash *md5 = [OFMD5Hash md5Hash]; OFSHA1Hash *sha1 = [OFSHA1Hash sha1Hash]; OFFile *f = [OFFile fileWithPath: @"testfile" - andMode: @"rb"]; + mode: @"rb"]; while (![f atEndOfStream]) { len = [f readNBytes: 64 intoBuffer: buf]; [md5 updateWithBuffer: buf Index: tests/OFString/OFString.m ================================================================== --- tests/OFString/OFString.m +++ tests/OFString/OFString.m @@ -96,11 +96,11 @@ /* Also clears all the memory of the returned C strings */ [pool release]; s1 = [OFMutableString stringWithCString: "foobar" - andLength: 3]; + length: 3]; CHECK([s1 isEqual: @"foo"]) [s1 appendCString: "foobarqux" + 3 withLength: 3]; CHECK([s1 isEqual: @"foobar"]) Index: tests/OFXMLElement/OFXMLElement.m ================================================================== --- tests/OFXMLElement/OFXMLElement.m +++ tests/OFXMLElement/OFXMLElement.m @@ -55,23 +55,23 @@ elem = [OFXMLElement elementWithName: @"foo"]; CHECK([[elem string] isEqual: @""]); [elem addAttributeWithName: @"foo" - andValue: @"b&ar"]; + stringValue: @"b&ar"]; CHECK([[elem string] isEqual: @""]) [elem addChild: [OFXMLElement elementWithName: @"bar"]]; CHECK([[elem string] isEqual: @""]) elem = [OFXMLElement elementWithName: @"foo" - andStringValue: @"b&ar"]; + stringValue: @"b&ar"]; CHECK([[elem string] isEqual: @"b&ar"]) [elem addAttributeWithName: @"foo" - andValue: @"b&ar"]; + stringValue: @"b&ar"]; CHECK([[elem string] isEqual: @"b&ar"]) puts(""); return 0; } Index: tests/OFXMLParser/OFXMLParser.m ================================================================== --- tests/OFXMLParser/OFXMLParser.m +++ tests/OFXMLParser/OFXMLParser.m @@ -20,13 +20,13 @@ @end @implementation ParserDelegate - (BOOL)xmlParser: (OFXMLParser*)parser didStartTagWithName: (OFString*)name - andPrefix: (OFString*)prefix - andNamespace: (OFString*)ns - andAttributes: (OFDictionary*)attrs + prefix: (OFString*)prefix + namespace: (OFString*)ns + attributes: (OFDictionary*)attrs { printf("START\nname=\"%s\"\nprefix=\"%s\"\nns=\"%s\"\n", [name cString], [prefix cString], [ns cString]); if (attrs) { @@ -50,12 +50,12 @@ return YES; } - (BOOL)xmlParser: (OFXMLParser*)parser didEndTagWithName: (OFString*)name - andPrefix: (OFString*)prefix - andNamespace: (OFString*)ns + prefix: (OFString*)prefix + namespace: (OFString*)ns { printf("END\nname=\"%s\"\nprefix=\"%s\"\nns=\"%s\"\n\n", [name cString], [prefix cString], [ns cString]); return YES;