@@ -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