@@ -21,10 +21,11 @@ #endif #ifdef OF_OLD_GNU_RUNTIME # import # define sel_getName(x) sel_get_name(x) +# define class_getName class_get_class_name #endif #import "OFExceptions.h" #import "OFString.h" #import "OFTCPSocket.h" @@ -213,15 +214,15 @@ return description; if (requestedSize) description = [[OFString alloc] initWithFormat: @"Could not allocate %zu bytes in class %s!", requestedSize, - [inClass className]]; + class_getName(inClass)]; else description = [[OFString alloc] initWithFormat: @"Could not allocate enough memory in class %s!", - [inClass className]]; + class_getName(inClass)]; return description; } - (size_t)requestedSize @@ -236,11 +237,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Object of class %s was mutated during enumeration!", - [inClass className]]; + class_getName(inClass)]; return description; } @end @@ -277,11 +278,11 @@ description = [[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, [inClass className]]; + pointer, class_getName(inClass)]; return description; } - (void*)pointer @@ -321,11 +322,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"The method %s of class %s is not or not fully implemented!", - sel_getName(selector), [inClass className]]; + sel_getName(selector), class_getName(inClass)]; return description; } - (SEL)selector @@ -339,11 +340,11 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Value out of range in class %s!", [inClass className]]; + @"Value out of range in class %s!", class_getName(inClass)]; return description; } @end @@ -378,11 +379,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"The argument for method %s of class %s is invalid!", - sel_getName(selector), [inClass className]]; + sel_getName(selector), class_getName(inClass)]; return description; } - (SEL)selector @@ -396,11 +397,11 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"The encoding is invalid for class %s!", [inClass className]]; + @"The encoding is invalid for class %s!", class_getName(inClass)]; return description; } @end @@ -409,11 +410,11 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"The format is invalid for class %s!", [inClass className]]; + @"The format is invalid for class %s!", class_getName(inClass)]; return description; } @end @@ -423,11 +424,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"The parser in class %s encountered malformed or invalid XML!", - [inClass className]]; + class_getName(inClass)]; return description; } @end @@ -436,11 +437,11 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Initialization failed for class %s!", [inClass className]]; + @"Initialization failed for class %s!", class_getName(inClass)]; return description; } @end @@ -493,11 +494,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to open file %s with mode %s in class %s! " ERRFMT, - [path cString], [mode cString], [inClass className], ERRPARAM]; + [path cString], [mode cString], class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -564,11 +565,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to read %zu bytes in class %s! " ERRFMT, requestedSize, - [inClass className], ERRPARAM]; + class_getName(inClass), ERRPARAM]; return description; } @end @@ -578,11 +579,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to write %zu bytes in class %s! " ERRFMT, requestedSize, - [inClass className], ERRPARAM]; + class_getName(inClass), ERRPARAM]; return description; } @end @@ -600,11 +601,11 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Seeking failed in class %s! " ERRFMT, [inClass className], + @"Seeking failed in class %s! " ERRFMT, class_getName(inClass), ERRPARAM]; return description; } @@ -658,11 +659,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to create directory %s in class %s! " ERRFMT, - [path cString], [inClass className], ERRPARAM]; + [path cString], class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -725,11 +726,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to change mode for file %s to %d in class %s! " ERRFMT, - [path cString], mode, [inClass className], ERRPARAM]; + [path cString], mode, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -805,21 +806,21 @@ if (group == nil) description = [[OFString alloc] initWithFormat: @"Failed to change owner for file %s to %s in class %s! " ERRFMT, [path cString], [owner cString], - [inClass className], ERRPARAM]; + class_getName(inClass), ERRPARAM]; else if (owner == nil) description = [[OFString alloc] initWithFormat: @"Failed to change group for file %s to %s in class %s! " ERRFMT, [path cString], [group cString], - [inClass className], ERRPARAM]; + class_getName(inClass), ERRPARAM]; else description = [[OFString alloc] initWithFormat: @"Failed to change owner for file %s to %s:%s in class %s! " ERRFMT, [path cString], [owner cString], [group cString], - [inClass className], ERRPARAM]; + class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -894,11 +895,11 @@ return description; description = [[OFString alloc] initWithFormat: @"Failed to copy file %s to %s in class %s! " ERRFMT, [sourcePath cString], [destinationPath cString], - [inClass className], ERRPARAM]; + class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -967,11 +968,11 @@ return description; description = [[OFString alloc] initWithFormat: @"Failed to rename file %s to %s in class %s! " ERRFMT, [sourcePath cString], [destinationPath cString], - [inClass className], ERRPARAM]; + class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -1034,11 +1035,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to delete file %s in class %s! " ERRFMT, [path cString], - [inClass className], ERRPARAM]; + class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -1096,11 +1097,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to delete directory %s in class %s! " ERRFMT, - [path cString], [inClass className], ERRPARAM]; + [path cString], class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -1160,11 +1161,11 @@ return description; description = [[OFString alloc] initWithFormat: @"Failed to link file %s to %s in class %s! " ERRFMT, [sourcePath cString], [destinationPath cString], - [inClass className], ERRPARAM]; + class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -1228,11 +1229,11 @@ return description; description = [[OFString alloc] initWithFormat: @"Failed to symlink file %s to %s in class %s! " ERRFMT, [sourcePath cString], [destinationPath cString], - [inClass className], ERRPARAM]; + class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -1257,11 +1258,11 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Setting an option in class %s failed!", [inClass className]]; + @"Setting an option in class %s failed!", class_getName(inClass)]; return description; } @end @@ -1271,11 +1272,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"The socket of type %s is not connected or bound!", - [inClass className]]; + class_getName(inClass)]; return description; } @end @@ -1285,11 +1286,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"The socket of type %s is already connected or bound and thus " - @"can't be connected or bound again!", [inClass className]]; + @"can't be connected or bound again!", class_getName(inClass)]; return description; } @end @@ -1349,15 +1350,15 @@ @"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], [inClass className], AT_ERRPARAM]; + [node cString], class_getName(inClass), AT_ERRPARAM]; else description = [[OFString alloc] initWithFormat: @"An address translation failed in class %s! " ERRFMT, - [inClass className], AT_ERRPARAM]; + class_getName(inClass), AT_ERRPARAM]; return description; } - (int)errNo @@ -1426,11 +1427,11 @@ return description; description = [[OFString alloc] initWithFormat: @"A connection to service %s on node %s could not be established " @"in class %s! " ERRFMT, [service cString], [node cString], - [inClass className], ERRPARAM]; + class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -1503,11 +1504,11 @@ return description; description = [[OFString alloc] initWithFormat: @"Binding service %s on node %s using family %d failed in class " @"%s! " ERRFMT, [service cString], [node cString], family, - [inClass className], ERRPARAM]; + class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -1563,11 +1564,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to listen in socket of type %s with a back log of %d! " - ERRFMT, [inClass className], backLog, ERRPARAM]; + ERRFMT, class_getName(inClass), backLog, ERRPARAM]; return description; } - (int)errNo @@ -1596,11 +1597,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Failed to accept connection in socket of type %s! " ERRFMT, - [inClass className], ERRPARAM]; + class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -1614,11 +1615,11 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Starting a thread of class %s failed!", [inClass className]]; + @"Starting a thread of class %s failed!", class_getName(inClass)]; return description; } @end @@ -1628,11 +1629,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Joining a thread of class %s failed! Most likely, another thread " - @"already waits for the thread to join.", [inClass className]]; + @"already waits for the thread to join.", class_getName(inClass)]; return description; } @end @@ -1642,11 +1643,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"Deallocation of a thread of type %s was tried, even though it " - @"was still running", [inClass className]]; + @"was still running", class_getName(inClass)]; return description; } @end @@ -1655,11 +1656,11 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"A mutex could not be locked in class %s", [inClass className]]; + @"A mutex could not be locked in class %s", class_getName(inClass)]; return description; } @end @@ -1668,11 +1669,12 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"A mutex could not be unlocked in class %s", [inClass className]]; + @"A mutex could not be unlocked in class %s", + class_getName(inClass)]; return description; } @end @@ -1682,11 +1684,11 @@ if (description != nil) return description; description = [[OFString alloc] initWithFormat: @"The hash has already been calculated in class %s and thus no new " - @"data can be added", [inClass className]]; + @"data can be added", class_getName(inClass)]; return description; } @end @@ -1757,15 +1759,15 @@ return description; if (ns != nil) description = [[OFString alloc] initWithFormat: @"The namespace %s is not bound in class %s", - [inClass className]]; + class_getName(inClass)]; else if (prefix != nil) description = [[OFString alloc] initWithFormat: @"The prefix %s is not bound to any namespace in %s", - [inClass className]]; + class_getName(inClass)]; return description; } - (OFString*)namespace