Index: ChangeLog ================================================================== --- ChangeLog +++ ChangeLog @@ -1,9 +1,42 @@ Legend: * Changes of existing features or bugfixes. + New features. +ObjFW 0.7 -> ObjFW 0.7.1, 12.11.2012 + + Support for Haiku. + * Autorelease pools now work properly without __thread. + * Incorrect framework version in Xcode project fixed. + * Documentation fixes and improvements. + * Blocks now only use 16 bits for the reference count in order to avoid + problems with newer Clang versions. + * More use of OF_SENTINEL. + +ObjFW 0.6 -> ObjFW 0.7, 27.10.2012 + Again, the differences are more than in any release before, thus listing them + all would be too much. The major differences are: + + ObjFW now comes with its own runtime, which greatly increases performance + compared to the GNU runtime and is even faster than the Apple runtime + (using Clang >= 3.2 is recommended, but not necessary). + * Support for the GNU runtime has been dropped. + + New, much faster autorelease pool implementation (now inside the runtime). + + Support for Automatic Reference Counting (requires Clang >= 3.2). + + Forwarding has been implemented. + + Asynchronous stream handling. + + New classes: OFThreadPool, OFRecursiveMutex, OFSortedList, OFTimer, OFRunLoop + + New protocols: OFLocking, OFTLSSocket + * Lots of API changes to make APIs more future-proof. + + Support for the new Objective-C literals. + * OFHTTPRequest now implements HTTP/1.1. + * OFObject's memory handling has been improved, leading to better performance. + * Strings are allocated faster now. + + Support for JSON5. + * All private methods use the prefix OF_ now instead of _, making it possible + to use the _ prefix in applications. + * Most ObjC compiler feature checks are not part of configure anymore, making + it possible to use the same installation with different compilers. + ObjFW 0.5.4 -> ObjFW 0.6, 27.02.2012 The differences between 0.5.4 and 0.6 are too big to list them all. However, the major new features are: * OFString, OFArray, OFDictionary, OFSet and OFCountedSet are now class clusters. Index: ObjFW.xcodeproj/project.pbxproj ================================================================== --- ObjFW.xcodeproj/project.pbxproj +++ ObjFW.xcodeproj/project.pbxproj @@ -1775,12 +1775,12 @@ name = Release; }; 4B3D23871337FBC800DD29B8 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - DYLIB_COMPATIBILITY_VERSION = 5; - DYLIB_CURRENT_VERSION = 5; + DYLIB_COMPATIBILITY_VERSION = 6; + DYLIB_CURRENT_VERSION = 6.1; FRAMEWORK_VERSION = A; INFOPLIST_FILE = Info.plist; OTHER_LDFLAGS = ( "-Wl,-reexport-lobjc", "-lobjc", @@ -1794,12 +1794,12 @@ name = Debug; }; 4B3D23881337FBC800DD29B8 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - DYLIB_COMPATIBILITY_VERSION = 5; - DYLIB_CURRENT_VERSION = 5; + DYLIB_COMPATIBILITY_VERSION = 6; + DYLIB_CURRENT_VERSION = 6.1; FRAMEWORK_VERSION = A; INFOPLIST_FILE = Info.plist; OTHER_LDFLAGS = ( "-Wl,-reexport-lobjc", "-lobjc", Index: PLATFORMS.md ================================================================== --- PLATFORMS.md +++ PLATFORMS.md @@ -11,10 +11,19 @@ * OS versions: 3.0, 3.3-DEVELOPMENT * Architectures: x86, x86_64 * Compilers: GCC 4.4.7 * Runtimes: ObjFW + +Haiku +----- + + * OS version: r1-alpha4 + * Architectures: x86 + * Compilers: Clang 3.2, GCC 4.6.3 + * Runtimes: ObjFW + iOS --- * Architectures: ARM Index: buildsys.mk.in ================================================================== --- buildsys.mk.in +++ buildsys.mk.in @@ -58,10 +58,14 @@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PLUGIN_SUFFIX = @PLUGIN_SUFFIX@ INSTALL_LIB = @INSTALL_LIB@ UNINSTALL_LIB = @UNINSTALL_LIB@ CLEAN_LIB = @CLEAN_LIB@ +CC_DEPENDS = @CC_DEPENDS@ +CXX_DEPENDS = @CXX_DEPENDS@ +OBJC_DEPENDS = @OBJC_DEPENDS@ +OBJCXX_DEPENDS = @OBJCXX_DEPENDS@ LN_S = @LN_S@ MKDIR_P = mkdir -p INSTALL = @INSTALL@ SHELL = @SHELL@ MSGFMT = @MSGFMT@ @@ -124,13 +128,39 @@ regen=0; \ deps=""; \ test -f .deps || regen=1; \ for i in ${SRCS}; do \ case $$i in \ - *.c | *.cc | *.cxx | *.m | *.mm | *.S) \ - test $$i -nt .deps && regen=1; \ - deps="$$deps $$i.dep"; \ + *.c) \ + if test x"${CC_DEPENDS}" = x"yes"; then \ + test $$i -nt .deps && regen=1; \ + deps="$$deps $$i.dep"; \ + fi; \ + ;; \ + *.cc | *.cxx) \ + if test x"${CXX_DEPENDS}" = x"yes"; then \ + test $$i -nt .deps && regen=1; \ + deps="$$deps $$i.dep"; \ + fi; \ + ;; \ + *.m) \ + if test x"${OBJC_DEPENDS}" = x"yes"; then \ + test $$i -nt .deps && regen=1; \ + deps="$$deps $$i.dep"; \ + fi; \ + ;; \ + *.mm) \ + if test x"${OBJCXX_DEPENDS}" = x"yes"; then \ + test $$i -nt .deps && regen=1; \ + deps="$$deps $$i.dep"; \ + fi; \ + ;; \ + *.S) \ + if test x"${AS_DEPENDS}" = x"yes"; then \ + test $$i -nt .deps && regen=1; \ + deps="$$deps $$i.dep"; \ + fi; \ ;; \ esac; \ done; \ if test x"$$regen" = x"1" -a x"$$deps" != x""; then \ ${DEPEND_STATUS}; \ @@ -142,12 +172,32 @@ touch -t 0001010000 .deps; \ ${DEPEND_FAILED}; \ fi; \ fi -.c.c.dep .cc.cc.dep .cxx.cxx.dep .m.m.dep .mm.mm.dep .S.S.dep: - ${CPP} ${CPPFLAGS} -M $< | \ +.c.c.dep: + ${CPP} ${CPPFLAGS} ${CFLAGS} -M $< | \ + sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.plugin.o:/' >$@ || \ + { rm -f $@; false; } + +.cc.cc.dep .cxx.cxx.dep: + ${CPP} ${CPPFLAGS} ${CXXFLAGS} -M $< | \ + sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.plugin.o:/' >$@ || \ + { rm -f $@; false; } + +.m.m.dep: + ${CPP} ${CPPFLAGS} ${OBJCFLAGS} -M $< | \ + sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.plugin.o:/' >$@ || \ + { rm -f $@; false; } + +.mm.mm.dep: + ${CPP} ${CPPFLAGS} ${OBJCPPFLAGS} -M $< | \ + sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.plugin.o:/' >$@ || \ + { rm -f $@; false; } + +.S.S.dep: + ${CPP} ${CPPFLAGS} ${ASFLAGS} -M $< | \ sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.plugin.o:/' >$@ || \ { rm -f $@; false; } pre-depend: Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -1,6 +1,6 @@ -AC_INIT(ObjFW, 0.7-dev, js@webkeks.org) +AC_INIT(ObjFW, 0.7.1, js@webkeks.org) AC_CONFIG_SRCDIR(src) AS_IF([test x"$host" = x"psp"], [ OBJCFLAGS="-G0 $OBJCFLAGS" LIBS="$LIBS -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc" Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -1,9 +1,9 @@ OBJFW_SHARED_LIB = @OBJFW_SHARED_LIB@ OBJFW_STATIC_LIB = @OBJFW_STATIC_LIB@ OBJFW_LIB_MAJOR = 6 -OBJFW_LIB_MINOR = 0 +OBJFW_LIB_MINOR = 1 OBJFW_LIB_MAJOR_MINOR = ${OBJFW_LIB_MAJOR}.${OBJFW_LIB_MINOR} ASPRINTF_M = @ASPRINTF_M@ AUTORELEASE_M = @AUTORELEASE_M@ ATOMIC_H = @ATOMIC_H@ Index: m4/buildsys.m4 ================================================================== --- m4/buildsys.m4 +++ m4/buildsys.m4 @@ -20,10 +20,15 @@ dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE dnl POSSIBILITY OF SUCH DAMAGE. dnl AC_DEFUN([BUILDSYS_INIT], [ + AC_SUBST(CC_DEPENDS, $GCC) + AC_SUBST(CXX_DEPENDS, $GXX) + AC_SUBST(OBJC_DEPENDS, $GOBJC) + AC_SUBST(OBJCXX_DEPENDS, $GOBJCXX) + AC_PATH_PROG(TPUT, tput) AS_IF([test x"$TPUT" != x""], [ if x=$($TPUT el 2>/dev/null); then AC_SUBST(TERM_EL, "$x") Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -82,11 +82,11 @@ /** * \brief Creates a new OFArray with the objects from the specified C array of * the specified length. * * \param objects A C array of objects - * \param length The length of the C array + * \param count The length of the C array * \return A new autoreleased OFArray */ + (instancetype)arrayWithObjects: (id const*)objects count: (size_t)count; @@ -127,11 +127,11 @@ /** * \brief Initializes an OFArray with the objects from the specified C array of * the specified length. * * \param objects A C array of objects - * \param length The length of the C array + * \param count The length of the C array * \return An initialized OFArray */ - initWithObjects: (id const*)objects count: (size_t)count; Index: src/OFBlock.m ================================================================== --- src/OFBlock.m +++ src/OFBlock.m @@ -55,13 +55,11 @@ OF_BLOCK_HAS_CTOR = (1 << 26), OF_BLOCK_IS_GLOBAL = (1 << 28), OF_BLOCK_HAS_STRET = (1 << 29), OF_BLOCK_HAS_SIGNATURE = (1 << 30), }; -#define OF_BLOCK_REFCOUNT_MASK \ - ~(OF_BLOCK_HAS_COPY_DISPOSE | OF_BLOCK_HAS_CTOR | OF_BLOCK_IS_GLOBAL | \ - OF_BLOCK_HAS_STRET | OF_BLOCK_HAS_SIGNATURE) +#define OF_BLOCK_REFCOUNT_MASK 0xFFFF enum { OF_BLOCK_FIELD_IS_OBJECT = 3, OF_BLOCK_FIELD_IS_BLOCK = 7, OF_BLOCK_FIELD_IS_BYREF = 8, Index: src/OFCondition.h ================================================================== --- src/OFCondition.h +++ src/OFCondition.h @@ -31,12 +31,12 @@ * \return A new, autoreleased OFCondition */ + (instancetype)condition; /** - * \brief Blocks the current thread until another thread calls -[signal] or - * -[broadcast]. + * \brief Blocks the current thread until another thread calls \ref signal or + * \ref broadcast. */ - (void)wait; /** * \brief Signals the next waiting thread to continue. Index: src/OFDataArray.h ================================================================== --- src/OFDataArray.h +++ src/OFDataArray.h @@ -91,17 +91,10 @@ * \param string The string with the Base64-encoded data * \return A new autoreleased OFDataArray */ + (instancetype)dataArrayWithBase64EncodedString: (OFString*)string; -/** - * \brief Initializes an already allocated OFDataArray with an item size of 1. - * - * \return A initialized OFDataArray - */ -- init; - /** * \brief Initializes an already allocated OFDataArray whose items all have the * same size. * * \param itemSize The size of each element in the OFDataArray @@ -139,11 +132,11 @@ /** * \brief Initializes an already allocated OFDataArray with an item size of 1, * containing the data of the Base64-encoded string. * * \param string The string with the Base64-encoded data - * \return A initialized OFDataArray + * \return An initialized OFDataArray */ - initWithBase64EncodedString: (OFString*)string; /** * \brief Returns the number of items in the OFDataArray. Index: src/OFDataArray.m ================================================================== --- src/OFDataArray.m +++ src/OFDataArray.m @@ -395,12 +395,12 @@ } } - (void)removeLastItem { - if (count < 1) - @throw [OFOutOfRangeException exceptionWithClass: [self class]]; + if (count == 0) + return; count--; @try { data = [self resizeMemory: data size: itemSize @@ -661,12 +661,12 @@ - (void)removeLastItem { size_t newSize, lastPageByte; - if (count < 1) - @throw [OFOutOfRangeException exceptionWithClass: [self class]]; + if (count == 0) + return; count--; lastPageByte = of_pagesize - 1; newSize = (count * itemSize + lastPageByte) & ~lastPageByte; Index: src/OFDate.h ================================================================== --- src/OFDate.h +++ src/OFDate.h @@ -54,11 +54,11 @@ /** * \brief Creates a new OFDate with the specified string in the specified * format. * - * The time zone used is UTC. See +[dateWithLocalDateString:format:] if you + * The time zone used is UTC. See \ref dateWithLocalDateString:format: if you * want local time. * * See the manpage for strftime for information on the format. * * \warning The format is currently limited to the following format specifiers: @@ -126,11 +126,11 @@ /** * \brief Initializes an already allocated OFDate with the specified string in * the specified format. * * The time zone used is UTC. If a time zone is specified anyway, an - * OFInvalidFormatException is thrown. See -[initWithLocalDateString:format:] + * OFInvalidFormatException is thrown. See \ref initWithLocalDateString:format: * if you want to specify a time zone. * * See the manpage for strftime for information on the format. * * \warning The format is currently limited to the following format specifiers: @@ -287,19 +287,19 @@ - (OFString*)localDateStringWithFormat: (OFConstantString*)format; /** * \brief Returns the earlier of the two dates. * - * \param date Another date + * \param otherDate Another date * \return The earlier date of the two dates */ - (OFDate*)earlierDate: (OFDate*)otherDate; /** * \brief Returns the later of the two dates. * - * \param date Another date + * \param otherDate Another date * \return The later date of the two dates */ - (OFDate*)laterDate: (OFDate*)otherDate; /** @@ -310,11 +310,11 @@ - (double)timeIntervalSince1970; /** * \brief Returns the seconds the receiver is after the date. * - * \param date Date date to generate the difference with receiver + * \param otherDate Date date to generate the difference with receiver * \return The seconds the receiver is after the date. */ - (double)timeIntervalSinceDate: (OFDate*)otherDate; /** Index: src/OFDate.m ================================================================== --- src/OFDate.m +++ src/OFDate.m @@ -28,11 +28,11 @@ #import "OFDate.h" #import "OFString.h" #import "OFDictionary.h" #import "OFXMLElement.h" #ifdef OF_THREADS -# import "OFThread.h" +# import "OFMutex.h" #endif #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -91,27 +91,20 @@ * \param count The number of objects in the arrays * \return A new autoreleased OFDictionary */ + (instancetype)dictionaryWithObjects: (id const*)objects forKeys: (id const*)keys - count: (size_t)count; + count: (size_t)count; /** * \brief Creates a new OFDictionary with the specified keys objects. * * \param firstKey The first key * \return A new autoreleased OFDictionary */ + (instancetype)dictionaryWithKeysAndObjects: (id)firstKey, ... OF_SENTINEL; -/** - * \brief Initializes an already allocated OFDictionary. - * - * \return An initialized OFDictionary - */ -- init; - /** * \brief Initializes an already allocated OFDictionary with the specified * OFDictionary. * * \param dictionary An OFDictionary Index: src/OFIntrospection.m ================================================================== --- src/OFIntrospection.m +++ src/OFIntrospection.m @@ -113,11 +113,13 @@ return NO; if ((otherMethod->typeEncoding == NULL && typeEncoding != NULL) || (otherMethod->typeEncoding != NULL && typeEncoding == NULL)) return NO; - if (strcmp(otherMethod->typeEncoding, typeEncoding)) + + if (otherMethod->typeEncoding != NULL && typeEncoding != NULL && + strcmp(otherMethod->typeEncoding, typeEncoding)) return NO; return YES; } Index: src/OFMutableArray.m ================================================================== --- src/OFMutableArray.m +++ src/OFMutableArray.m @@ -300,12 +300,14 @@ - (void)removeLastObject { size_t count = [self count]; - if (count > 0) - [self removeObjectAtIndex: count - 1]; + if (count == 0) + return; + + [self removeObjectAtIndex: count - 1]; } - (void)removeAllObjects { [self removeObjectsInRange: of_range(0, [self count])]; Index: src/OFMutableArray_adjacent.m ================================================================== --- src/OFMutableArray_adjacent.m +++ src/OFMutableArray_adjacent.m @@ -195,11 +195,17 @@ } } - (void)removeLastObject { - id object = [self objectAtIndex: [array count] - 1]; + size_t count = [array count]; + id object; + + if (count == 0) + return; + + object = [self objectAtIndex: count - 1]; [array removeLastItem]; [object release]; mutations++; } Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -118,11 +118,13 @@ /** * \brief An enum for storing endianess. */ typedef enum of_byte_order_t { + /// Most significant byte first (big endian) OF_BYTE_ORDER_BIG_ENDIAN, + /// Least significant byte first (little endian) OF_BYTE_ORDER_LITTLE_ENDIAN } of_byte_order_t; /** * \brief A range. @@ -136,28 +138,34 @@ /** * \brief A point. */ typedef struct of_point_t { + /// The x coordinate of the point float x; + /// The y coordinate of the point float y; } of_point_t; /** * \brief A dimension. */ typedef struct of_dimension_t { + /// The width of the dimension float width; + /// The height of the dimension float height; } of_dimension_t; /** * \brief A rectangle. */ typedef struct of_rectangle_t { + /// The point from where the rectangle originates of_point_t origin; + /// The size of the rectangle of_dimension_t size; } of_rectangle_t; @class OFString; @class OFThread; @@ -327,11 +335,10 @@ * \brief The root class for all other classes inside ObjFW. */ @interface OFObject { @public - /// The class of the object Class isa; } /** * \brief A method which is called once when the class is loaded into the @@ -363,11 +370,11 @@ * \return The allocated object */ + alloc; /** - * \brief Allocates memory for a new instance and calls -[init] on it. + * \brief Allocates memory for a new instance and calls \ref init on it. * \return An allocated and initialized object */ + new; /** @@ -512,11 +519,11 @@ * done. * * The methods which will be added from the specified class are not allowed to * use super or access instance variables, instead they have to use accessors. * - * \param class The class from which the instance methods should be inherited + * \param class_ The class from which the instance methods should be inherited */ + (void)inheritMethodsFromClass: (Class)class_; /** * \brief Try to resolve the specified class method. @@ -539,13 +546,17 @@ + (BOOL)resolveInstanceMethod: (SEL)selector; /** * \brief Initializes an already allocated object. * - * Derived classes may override this, but need to do self = [super init] before - * they do any initialization themselves. init may never return nil, instead - * an exception (for example OFInitializationFailed) should be thrown. + * Derived classes may override this, but need to do + * \code + * self = [super init] + * \endcode + * before they do any initialization themselves. \ref init may never return nil, + * instead an exception (for example OFInitializationFailedException) should be + * thrown. * * \return An initialized object */ - init; Index: src/OFSeekableStream.h ================================================================== --- src/OFSeekableStream.h +++ src/OFSeekableStream.h @@ -26,17 +26,17 @@ #import "OFStream.h" /** * \brief A stream that supports seeking. * - * \note If you want to subclass this, override lowlevelSeekToOffset:, - * lowlevelSeekForwardWithOffset: and lowlevelSeekToOffsetRelativeToEnd:, - * but nothing else. Those are not defined in the headers, but do the - * actual work. OFSeekableStream uses those and makes them work together - * with the caching of OFStream. If you override these methods without - * the lowlevel prefix, you will break caching, get broken results - * and seek to the wrong position! + * \note If you want to subclass this, override \ref lowlevelSeekToOffset:, + * \ref lowlevelSeekForwardWithOffset: and + * \ref lowlevelSeekToOffsetRelativeToEnd:, but nothing else, as they do + * the actual work. OFSeekableStream uses those and makes them work + * together with the caching of OFStream. If you override these methods + * without the lowlevel prefix, you will break caching, get broken + * results and seek to the wrong position! */ @interface OFSeekableStream: OFStream /** * \brief Seeks to the specified absolute offset. * Index: src/OFSet.h ================================================================== --- src/OFSet.h +++ src/OFSet.h @@ -34,10 +34,13 @@ typedef BOOL (^of_set_filter_block_t)(id object); #endif /** * \brief An abstract class for an unordered set of unique objects. + * + * \warning Do not mutate objects that are in a set! Changing the hash of + * objects in a set breaks the internal representation of the set! */ @interface OFSet: OFObject /** * \brief Creates a new set. Index: src/OFStream.h ================================================================== --- src/OFStream.h +++ src/OFStream.h @@ -45,16 +45,17 @@ * retains it. This is so that the stream can be used as a key for a * dictionary, so context can be associated with a stream. Using a * stream in more than one thread at the same time is not thread-safe, * even if copy was called to create one "instance" for every thread! * - * \note If you want to subclass this, override lowlevelReadIntoBuffer:length:, - * lowlevelWriteBuffer:length: and lowlevelIsAtEndOfStream, but nothing - * else, as those are are the methods that do the actual work. OFStream - * uses those for all other methods and does all the caching and other - * stuff for you. If you override these methods without the lowlevel - * prefix, you will break caching and get broken results! + * \note If you want to subclass this, override + * \ref lowlevelReadIntoBuffer:length:, \ref lowlevelWriteBuffer:length: + * and \ref lowlevelIsAtEndOfStream, but nothing else, as those are are + * the methods that do the actual work. OFStream uses those for all other + * methods and does all the caching and other stuff for you. If you + * override these methods without the lowlevel prefix, you will + * break caching and get broken results! */ @interface OFStream: OFObject { char *cache; char *writeBuffer; @@ -79,29 +80,29 @@ /** * \brief Reads at most size bytes from the stream into a buffer. * * On network streams, this might read less than the specified number of bytes. * If you want to read exactly the specified number of bytes, use - * -readIntoBuffer:exactLength:. Note that a read can even return 0 bytes - + * \ref readIntoBuffer:exactLength:. Note that a read can even return 0 bytes - * this does not necessarily mean that the stream ended, so you still need to - * check isAtEndOfStream. + * check \ref isAtEndOfStream. * * \param buffer The buffer into which the data is read * \param length The length of the data that should be read at most. * The buffer must be at least this big! * \return The number of bytes read */ - (size_t)readIntoBuffer: (void*)buffer - length: (size_t)size; + length: (size_t)length; /** * \brief Reads exactly the specified length bytes from the stream into a * buffer. * - * Unlike readIntoBuffer:length:, this method does not return when less than the - * specified length has been read - instead, it waits until it got exactly the - * specified length. + * Unlike \ref readIntoBuffer:length:, this method does not return when less + * than the specified length has been read - instead, it waits until it got + * exactly the specified length. * * \warning Only call this when you know that specified amount of data is * available! Otherwise you will get an exception! * * \param buffer The buffer into which the data is read @@ -115,13 +116,13 @@ * \brief Asyncronously reads at most size bytes from the stream into a * buffer. * * On network streams, this might read less than the specified number of bytes. * If you want to read exactly the specified number of bytes, use - * asyncReadIntoBuffer:exactLength:block:. Note that a read can even return 0 - * bytes - this does not necessarily mean that the stream ended, so you still - * need to check isAtEndOfStream. + * \ref asyncReadIntoBuffer:exactLength:block:. Note that a read can even + * return 0 bytes - this does not necessarily mean that the stream ended, so + * you still need to check \ref isAtEndOfStream. * * \param buffer The buffer into which the data is read. * The buffer must not be free'd before the async read completed! * \param length The length of the data that should be read at most. * The buffer must be at least this big! @@ -142,11 +143,11 @@ /** * \brief Asyncronously reads exactly the specified length bytes from the * stream into a buffer. * - * Unlike asyncReadIntoBuffer:length:block, this method does not call the + * Unlike \ref asyncReadIntoBuffer:length:block, this method does not call the * method when less than the specified length has been read - instead, it waits * until it got exactly the specified length, the stream has ended or an * exception occurred. * * \param buffer The buffer into which the data is read @@ -172,13 +173,13 @@ * \brief Asyncronously reads at most size bytes from the stream into a * buffer. * * On network streams, this might read less than the specified number of bytes. * If you want to read exactly the specified number of bytes, use - * asyncReadIntoBuffer:exactLength:block:. Note that a read can even return 0 - * bytes - this does not necessarily mean that the stream ended, so you still - * need to check isAtEndOfStream. + * \ref asyncReadIntoBuffer:exactLength:block:. Note that a read can even + * return 0 bytes - this does not necessarily mean that the stream ended, so + * you still need to check \ref isAtEndOfStream. * * \param buffer The buffer into which the data is read. * The buffer must not be free'd before the async read completed! * \param length The length of the data that should be read at most. * The buffer must be at least this big! @@ -194,11 +195,11 @@ /** * \brief Asyncronously reads exactly the specified length bytes from the * stream into a buffer. * - * Unlike asyncReadIntoBuffer:length:block, this method does not invoke the + * Unlike \ref asyncReadIntoBuffer:length:block, this method does not invoke the * block when less than the specified length has been read - instead, it waits * until it got exactly the specified length, the stream has ended or an * exception occurred. * * \param buffer The buffer into which the data is read @@ -280,77 +281,77 @@ * encoded in big endian. * * \warning Only call this when you know that enough data is available! * Otherwise you will get an exception! * - * \param nInt16s The number of uint16_ts to read * \param buffer A buffer of sufficient size to store the specified number of * uint16_ts + * \param count The number of uint16_ts to read * \return The number of bytes read */ - (size_t)readBigEndianInt16sIntoBuffer: (uint16_t*)buffer - count: (size_t)nInt16s; + count: (size_t)count; /** * \brief Reads the specified number of uint32_ts from the stream which are * encoded in big endian. * * \warning Only call this when you know that enough data is available! * Otherwise you will get an exception! * - * \param nInt32s The number of uint32_ts to read * \param buffer A buffer of sufficient size to store the specified number of * uint32_ts + * \param count The number of uint32_ts to read * \return The number of bytes read */ - (size_t)readBigEndianInt32sIntoBuffer: (uint32_t*)buffer - count: (size_t)nInt32s; + count: (size_t)count; /** * \brief Reads the specified number of uint64_ts from the stream which are * encoded in big endian. * * \warning Only call this when you know that enough data is available! * Otherwise you will get an exception! * - * \param nInt64s The number of uint64_ts to read * \param buffer A buffer of sufficient size to store the specified number of * uint64_ts + * \param count The number of uint64_ts to read * \return The number of bytes read */ - (size_t)readBigEndianInt64sIntoBuffer: (uint64_t*)buffer - count: (size_t)nInt64s; + count: (size_t)count; /** * \brief Reads the specified number of floats from the stream which are encoded * in big endian. * * \warning Only call this when you know that enough data is available! * Otherwise you will get an exception! * - * \param nFloatss The number of floats to read * \param buffer A buffer of sufficient size to store the specified number of * floats + * \param count The number of floats to read * \return The number of bytes read */ - (size_t)readBigEndianFloatsIntoBuffer: (float*)buffer - count: (size_t)nFloats; + count: (size_t)count; /** * \brief Reads the specified number of doubles from the stream which are * encoded in big endian. * * \warning Only call this when you know that enough data is available! * Otherwise you will get an exception! * - * \param nDoubles The number of doubles to read * \param buffer A buffer of sufficient size to store the specified number of * doubles + * \param count The number of doubles to read * \return The number of bytes read */ - (size_t)readBigEndianDoublesIntoBuffer: (double*)buffer - count: (size_t)nDoubles; + count: (size_t)count; /** * \brief Reads a uint16_t from the stream which is encoded in little endian. * * \warning Only call this when you know that enough data is available! @@ -405,87 +406,87 @@ * encoded in little endian. * * \warning Only call this when you know that enough data is available! * Otherwise you will get an exception! * - * \param nInt16s The number of uint16_ts to read * \param buffer A buffer of sufficient size to store the specified number of * uint16_ts + * \param count The number of uint16_ts to read * \return The number of bytes read */ - (size_t)readLittleEndianInt16sIntoBuffer: (uint16_t*)buffer - count: (size_t)nInt16s; + count: (size_t)count; /** * \brief Reads the specified number of uint32_ts from the stream which are * encoded in little endian. * * \warning Only call this when you know that enough data is available! * Otherwise you will get an exception! * - * \param nInt32s The number of uint32_ts to read * \param buffer A buffer of sufficient size to store the specified number of * uint32_ts + * \param count The number of uint32_ts to read * \return The number of bytes read */ - (size_t)readLittleEndianInt32sIntoBuffer: (uint32_t*)buffer - count: (size_t)nInt32s; + count: (size_t)count; /** * \brief Reads the specified number of uint64_ts from the stream which are * encoded in little endian. * * \warning Only call this when you know that enough data is available! * Otherwise you will get an exception! * - * \param nInt64s The number of uint64_ts to read * \param buffer A buffer of sufficient size to store the specified number of * uint64_ts + * \param count The number of uint64_ts to read * \return The number of bytes read */ - (size_t)readLittleEndianInt64sIntoBuffer: (uint64_t*)buffer - count: (size_t)nInt64s; + count: (size_t)count; /** * \brief Reads the specified number of floats from the stream which are * encoded in little endian. * * \warning Only call this when you know that enough data is available! * Otherwise you will get an exception! * - * \param nFloats The number of floats to read * \param buffer A buffer of sufficient size to store the specified number of * floats + * \param count The number of floats to read * \return The number of bytes read */ - (size_t)readLittleEndianFloatsIntoBuffer: (float*)buffer - count: (size_t)nFloats; + count: (size_t)count; /** * \brief Reads the specified number of doubles from the stream which are * encoded in little endian. * * \warning Only call this when you know that enough data is available! * Otherwise you will get an exception! * - * \param nDoubles The number of doubles to read * \param buffer A buffer of sufficient size to store the specified number of * doubles + * \param count The number of doubles to read * \return The number of bytes read */ - (size_t)readLittleEndianDoublesIntoBuffer: (double*)buffer - count: (size_t)nDoubles; + count: (size_t)count; /** * \brief Reads the specified number of items with an item size of 1 from the * stream and returns them in an OFDataArray. * * \warning Only call this when you know that enough data is available! * Otherwise you will get an exception! * - * \param nItems The number of items to read - * \return An OFDataArray with at nItems items. + * \param size The number of items to read + * \return An OFDataArray with count items. */ - (OFDataArray*)readDataArrayWithSize: (size_t)size; /** * \brief Reads the specified number of items with the specified item size from @@ -493,15 +494,15 @@ * * \warning Only call this when you know that enough data is available! * Otherwise you will get an exception! * * \param itemSize The size of each item - * \param nItems The number of items to read - * \return An OFDataArray with at nItems items. + * \param count The number of items to read + * \return An OFDataArray with count items. */ - (OFDataArray*)readDataArrayWithItemSize: (size_t)itemSize - count: (size_t)nItems; + count: (size_t)count; /** * \brief Returns an OFDataArray with all the remaining data of the stream. * * \return An OFDataArray with an item size of 1 with all the data of the @@ -630,12 +631,12 @@ */ - (OFString*)tryReadLine; /** * \brief Tries to read a line from the stream with the specified encoding (see - * readLineWithEncoding:) and returns nil if no complete line has been - * received yet. + * \ref readLineWithEncoding:) and returns nil if no complete line has + * been received yet. * * \param encoding The encoding used by the stream * \return The line that was read, autoreleased, or nil if the line is not * complete yet */ @@ -663,23 +664,23 @@ - (OFString*)readTillDelimiter: (OFString*)delimiter encoding: (of_string_encoding_t)encoding; /** * \brief Tries to reads until the specified string or \\0 is found or the end - * of stream (see readTillDelimiter:) and returns nil if not enough data - * has been received yet. + * of stream (see \ref readTillDelimiter:) and returns nil if not enough + * data has been received yet. * * \param delimiter The delimiter * \return The line that was read, autoreleased, or nil if the end of the * stream has been reached. */ - (OFString*)tryReadTillDelimiter: (OFString*)delimiter; /** * \brief Tries to read until the specified string or \\0 is found or the end - * of stream occurs (see readTIllDelimiterWithEncoding:) and returns nil - * if not enough data has been received yet. + * of stream occurs (see \ref readTillDelimiterWithEncoding:) and + * returns nil if not enough data has been received yet. * * \param delimiter The delimiter * \param encoding The encoding used by the stream * \return The line that was read, autoreleased, or nil if the end of the * stream has been reached. @@ -759,65 +760,65 @@ /** * \brief Writes the specified number of uint16_ts into the stream, encoded in * big endian. * - * \param nInt16 The number of uint16_ts to write * \param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary + * \param count The number of uint16_ts to write * \return The number of bytes written to the stream */ - (size_t)writeBigEndianInt16s: (const uint16_t*)buffer - count: (size_t)nInt16s; + count: (size_t)count; /** * \brief Writes the specified number of uint32_ts into the stream, encoded in * big endian. * - * \param nInt32 The number of uint32_ts to write * \param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary + * \param count The number of uint32_ts to write * \return The number of bytes written to the stream */ - (size_t)writeBigEndianInt32s: (const uint32_t*)buffer - count: (size_t)nInt32s; + count: (size_t)count; /** * \brief Writes the specified number of uint64_ts into the stream, encoded in * big endian. * - * \param nInt64 The number of uint64_ts to write * \param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary + * \param count The number of uint64_ts to write * \return The number of bytes written to the stream */ - (size_t)writeBigEndianInt64s: (const uint64_t*)buffer - count: (size_t)nInt64s; + count: (size_t)count; /** * \brief Writes the specified number of floats into the stream, encoded in big * endian. * - * \param nFloats The number of floats to write * \param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary + * \param count The number of floats to write * \return The number of bytes written to the stream */ - (size_t)writeBigEndianFloats: (const float*)buffer - count: (size_t)nFloats; + count: (size_t)count; /** * \brief Writes the specified number of doubles into the stream, encoded in * big endian. * - * \param nDoubles The number of doubles to write * \param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary + * \param count The number of doubles to write * \return The number of bytes written to the stream */ - (size_t)writeBigEndianDoubles: (const double*)buffer - count: (size_t)nDoubles; + count: (size_t)count; /** * \brief Writes a uint16_t into the stream, encoded in little endian. * * \param int16 A uint16_t @@ -854,65 +855,65 @@ /** * \brief Writes the specified number of uint16_ts into the stream, encoded in * little endian. * - * \param nInt16 The number of uint16_ts to write * \param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary + * \param count The number of uint16_ts to write * \return The number of bytes written to the stream */ - (size_t)writeLittleEndianInt16s: (const uint16_t*)buffer - count: (size_t)nInt16s; + count: (size_t)count; /** * \brief Writes the specified number of uint32_ts into the stream, encoded in * little endian. * - * \param nInt32 The number of uint32_ts to write + * \param count The number of uint32_ts to write * \param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary * \return The number of bytes written to the stream */ - (size_t)writeLittleEndianInt32s: (const uint32_t*)buffer - count: (size_t)nInt32s; + count: (size_t)count; /** * \brief Writes the specified number of uint64_ts into the stream, encoded in * little endian. * - * \param nInt64 The number of uint64_ts to write * \param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary + * \param count The number of uint64_ts to write * \return The number of bytes written to the stream */ - (size_t)writeLittleEndianInt64s: (const uint64_t*)buffer - count: (size_t)nInt64s; + count: (size_t)count; /** * \brief Writes the specified number of floats into the stream, encoded in * little endian. * - * \param nFloats The number of floats to write * \param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary + * \param count The number of floats to write * \return The number of bytes written to the stream */ - (size_t)writeLittleEndianFloats: (const float*)buffer - count: (size_t)nFloats; + count: (size_t)count; /** * \brief Writes the specified number of doubles into the stream, encoded in * little endian. * - * \param nDoubles The number of doubles to write * \param buffer The buffer from which the data is written to the stream after * it has been byte swapped if necessary + * \param count The number of doubles to write * \return The number of bytes written to the stream */ - (size_t)writeLittleEndianDoubles: (const double*)buffer - count: (size_t)nDoubles; + count: (size_t)count; /** * \brief Writes from an OFDataArray into the stream. * * \param dataArray The OFDataArray to write into the stream Index: src/OFStream.m ================================================================== --- src/OFStream.m +++ src/OFStream.m @@ -249,93 +249,93 @@ return OF_BSWAP_DOUBLE_IF_LE(ret); } - (size_t)readBigEndianInt16sIntoBuffer: (uint16_t*)buffer - count: (size_t)nInt16s + count: (size_t)count { - size_t size = nInt16s * sizeof(uint16_t); + size_t size = count * sizeof(uint16_t); [self readIntoBuffer: buffer exactLength: size]; #ifndef OF_BIG_ENDIAN size_t i; - for (i = 0; i < nInt16s; i++) + for (i = 0; i < count; i++) buffer[i] = OF_BSWAP16(buffer[i]); #endif return size; } - (size_t)readBigEndianInt32sIntoBuffer: (uint32_t*)buffer - count: (size_t)nInt32s + count: (size_t)count { - size_t size = nInt32s * sizeof(uint32_t); + size_t size = count * sizeof(uint32_t); [self readIntoBuffer: buffer exactLength: size]; #ifndef OF_BIG_ENDIAN size_t i; - for (i = 0; i < nInt32s; i++) + for (i = 0; i < count; i++) buffer[i] = OF_BSWAP32(buffer[i]); #endif return size; } - (size_t)readBigEndianInt64sIntoBuffer: (uint64_t*)buffer - count: (size_t)nInt64s + count: (size_t)count { - size_t size = nInt64s * sizeof(uint64_t); + size_t size = count * sizeof(uint64_t); [self readIntoBuffer: buffer exactLength: size]; #ifndef OF_BIG_ENDIAN size_t i; - for (i = 0; i < nInt64s; i++) + for (i = 0; i < count; i++) buffer[i] = OF_BSWAP64(buffer[i]); #endif return size; } - (size_t)readBigEndianFloatsIntoBuffer: (float*)buffer - count: (size_t)nFloats + count: (size_t)count { - size_t size = nFloats * sizeof(float); + size_t size = count * sizeof(float); [self readIntoBuffer: buffer exactLength: size]; #ifndef OF_FLOAT_BIG_ENDIAN size_t i; - for (i = 0; i < nFloats; i++) + for (i = 0; i < count; i++) buffer[i] = OF_BSWAP_FLOAT(buffer[i]); #endif return size; } - (size_t)readBigEndianDoublesIntoBuffer: (double*)buffer - count: (size_t)nDoubles + count: (size_t)count { - size_t size = nDoubles * sizeof(double); + size_t size = count * sizeof(double); [self readIntoBuffer: buffer exactLength: size]; #ifndef OF_FLOAT_BIG_ENDIAN size_t i; - for (i = 0; i < nDoubles; i++) + for (i = 0; i < count; i++) buffer[i] = OF_BSWAP_DOUBLE(buffer[i]); #endif return size; } @@ -389,121 +389,121 @@ return OF_BSWAP_DOUBLE_IF_BE(ret); } - (size_t)readLittleEndianInt16sIntoBuffer: (uint16_t*)buffer - count: (size_t)nInt16s + count: (size_t)count { - size_t size = nInt16s * sizeof(uint16_t); + size_t size = count * sizeof(uint16_t); [self readIntoBuffer: buffer exactLength: size]; #ifdef OF_BIG_ENDIAN size_t i; - for (i = 0; i < nInt16s; i++) + for (i = 0; i < count; i++) buffer[i] = OF_BSWAP16(buffer[i]); #endif return size; } - (size_t)readLittleEndianInt32sIntoBuffer: (uint32_t*)buffer - count: (size_t)nInt32s + count: (size_t)count { - size_t size = nInt32s * sizeof(uint32_t); + size_t size = count * sizeof(uint32_t); [self readIntoBuffer: buffer exactLength: size]; #ifdef OF_BIG_ENDIAN size_t i; - for (i = 0; i < nInt32s; i++) + for (i = 0; i < count; i++) buffer[i] = OF_BSWAP32(buffer[i]); #endif return size; } - (size_t)readLittleEndianInt64sIntoBuffer: (uint64_t*)buffer - count: (size_t)nInt64s + count: (size_t)count { - size_t size = nInt64s * sizeof(uint64_t); + size_t size = count * sizeof(uint64_t); [self readIntoBuffer: buffer exactLength: size]; #ifdef OF_BIG_ENDIAN size_t i; - for (i = 0; i < nInt64s; i++) + for (i = 0; i < count; i++) buffer[i] = OF_BSWAP64(buffer[i]); #endif return size; } - (size_t)readLittleEndianFloatsIntoBuffer: (float*)buffer - count: (size_t)nFloats + count: (size_t)count { - size_t size = nFloats * sizeof(float); + size_t size = count * sizeof(float); [self readIntoBuffer: buffer exactLength: size]; #ifdef OF_FLOAT_BIG_ENDIAN size_t i; - for (i = 0; i < nFloats; i++) + for (i = 0; i < count; i++) buffer[i] = OF_BSWAP_FLOAT(buffer[i]); #endif return size; } - (size_t)readLittleEndianDoublesIntoBuffer: (double*)buffer - count: (size_t)nDoubles + count: (size_t)count { - size_t size = nDoubles * sizeof(double); + size_t size = count * sizeof(double); [self readIntoBuffer: buffer exactLength: size]; #ifdef OF_FLOAT_BIG_ENDIAN size_t i; - for (i = 0; i < nDoubles; i++) + for (i = 0; i < count; i++) buffer[i] = OF_BSWAP_DOUBLE(buffer[i]); #endif return size; } -- (OFDataArray*)readDataArrayWithSize: (size_t)nItems +- (OFDataArray*)readDataArrayWithSize: (size_t)size { return [self readDataArrayWithItemSize: 1 - count: nItems]; + count: size]; } - (OFDataArray*)readDataArrayWithItemSize: (size_t)itemSize - count: (size_t)nItems + count: (size_t)count { OFDataArray *dataArray; char *tmp; dataArray = [OFDataArray dataArrayWithItemSize: itemSize]; tmp = [self allocMemoryWithSize: itemSize - count: nItems]; + count: count]; @try { [self readIntoBuffer: tmp - exactLength: nItems * itemSize]; + exactLength: count * itemSize]; [dataArray addItemsFromCArray: tmp - count: nItems]; + count: count]; } @finally { [self freeMemory: tmp]; } return dataArray; @@ -1012,27 +1012,27 @@ [self writeBuffer: (char*)&double_ length: 8]; } - (size_t)writeBigEndianInt16s: (const uint16_t*)buffer - count: (size_t)nInt16s + count: (size_t)count { - size_t size = nInt16s * sizeof(uint16_t); + size_t size = count * sizeof(uint16_t); #ifdef OF_BIG_ENDIAN [self writeBuffer: buffer length: size]; #else uint16_t *tmp; tmp = [self allocMemoryWithSize: sizeof(uint16_t) - count: nInt16s]; + count: count]; @try { size_t i; - for (i = 0; i < nInt16s; i++) + for (i = 0; i < count; i++) tmp[i] = OF_BSWAP16(buffer[i]); [self writeBuffer: tmp length: size]; } @finally { @@ -1042,27 +1042,27 @@ return size; } - (size_t)writeBigEndianInt32s: (const uint32_t*)buffer - count: (size_t)nInt32s + count: (size_t)count { - size_t size = nInt32s * sizeof(uint32_t); + size_t size = count * sizeof(uint32_t); #ifdef OF_BIG_ENDIAN [self writeBuffer: buffer length: size]; #else uint32_t *tmp; tmp = [self allocMemoryWithSize: sizeof(uint32_t) - count: nInt32s]; + count: count]; @try { size_t i; - for (i = 0; i < nInt32s; i++) + for (i = 0; i < count; i++) tmp[i] = OF_BSWAP32(buffer[i]); [self writeBuffer: tmp length: size]; } @finally { @@ -1072,27 +1072,27 @@ return size; } - (size_t)writeBigEndianInt64s: (const uint64_t*)buffer - count: (size_t)nInt64s + count: (size_t)count { - size_t size = nInt64s * sizeof(uint64_t); + size_t size = count * sizeof(uint64_t); #ifdef OF_BIG_ENDIAN [self writeBuffer: buffer length: size]; #else uint64_t *tmp; tmp = [self allocMemoryWithSize: sizeof(uint64_t) - count: nInt64s]; + count: count]; @try { size_t i; - for (i = 0; i < nInt64s; i++) + for (i = 0; i < count; i++) tmp[i] = OF_BSWAP64(buffer[i]); [self writeBuffer: tmp length: size]; } @finally { @@ -1102,27 +1102,27 @@ return size; } - (size_t)writeBigEndianFloats: (const float*)buffer - count: (size_t)nFloats + count: (size_t)count { - size_t size = nFloats * sizeof(float); + size_t size = count * sizeof(float); #ifdef OF_FLOAT_BIG_ENDIAN [self writeBuffer: buffer length: size]; #else float *tmp; tmp = [self allocMemoryWithSize: sizeof(float) - count: nFloats]; + count: count]; @try { size_t i; - for (i = 0; i < nFloats; i++) + for (i = 0; i < count; i++) tmp[i] = OF_BSWAP_FLOAT(buffer[i]); [self writeBuffer: tmp length: size]; } @finally { @@ -1132,27 +1132,27 @@ return size; } - (size_t)writeBigEndianDoubles: (const double*)buffer - count: (size_t)nDoubles + count: (size_t)count { - size_t size = nDoubles * sizeof(double); + size_t size = count * sizeof(double); #ifdef OF_FLOAT_BIG_ENDIAN [self writeBuffer: buffer length: size]; #else double *tmp; tmp = [self allocMemoryWithSize: sizeof(double) - count: nDoubles]; + count: count]; @try { size_t i; - for (i = 0; i < nDoubles; i++) + for (i = 0; i < count; i++) tmp[i] = OF_BSWAP_DOUBLE(buffer[i]); [self writeBuffer: tmp length: size]; } @finally { @@ -1202,27 +1202,27 @@ [self writeBuffer: (char*)&double_ length: 8]; } - (size_t)writeLittleEndianInt16s: (const uint16_t*)buffer - count: (size_t)nInt16s + count: (size_t)count { - size_t size = nInt16s * sizeof(uint16_t); + size_t size = count * sizeof(uint16_t); #ifndef OF_BIG_ENDIAN [self writeBuffer: buffer length: size]; #else uint16_t *tmp; tmp = [self allocMemoryWithSize: sizeof(uint16_t) - count: nInt16s]; + count: count]; @try { size_t i; - for (i = 0; i < nInt16s; i++) + for (i = 0; i < count; i++) tmp[i] = OF_BSWAP16(buffer[i]); [self writeBuffer: tmp length: size]; } @finally { @@ -1232,27 +1232,27 @@ return size; } - (size_t)writeLittleEndianInt32s: (const uint32_t*)buffer - count: (size_t)nInt32s + count: (size_t)count { - size_t size = nInt32s * sizeof(uint32_t); + size_t size = count * sizeof(uint32_t); #ifndef OF_BIG_ENDIAN [self writeBuffer: buffer length: size]; #else uint32_t *tmp; tmp = [self allocMemoryWithSize: sizeof(uint32_t) - count: nInt32s]; + count: count]; @try { size_t i; - for (i = 0; i < nInt32s; i++) + for (i = 0; i < count; i++) tmp[i] = OF_BSWAP32(buffer[i]); [self writeBuffer: tmp length: size]; } @finally { @@ -1262,27 +1262,27 @@ return size; } - (size_t)writeLittleEndianInt64s: (const uint64_t*)buffer - count: (size_t)nInt64s + count: (size_t)count { - size_t size = nInt64s * sizeof(uint64_t); + size_t size = count * sizeof(uint64_t); #ifndef OF_BIG_ENDIAN [self writeBuffer: buffer length: size]; #else uint64_t *tmp; tmp = [self allocMemoryWithSize: sizeof(uint64_t) - count: nInt64s]; + count: count]; @try { size_t i; - for (i = 0; i < nInt64s; i++) + for (i = 0; i < count; i++) tmp[i] = OF_BSWAP64(buffer[i]); [self writeBuffer: tmp length: size]; } @finally { @@ -1292,27 +1292,27 @@ return size; } - (size_t)writeLittleEndianFloats: (const float*)buffer - count: (size_t)nFloats + count: (size_t)count { - size_t size = nFloats * sizeof(float); + size_t size = count * sizeof(float); #ifndef OF_FLOAT_BIG_ENDIAN [self writeBuffer: buffer length: size]; #else float *tmp; tmp = [self allocMemoryWithSize: sizeof(float) - count: nFloats]; + count: count]; @try { size_t i; - for (i = 0; i < nFloats; i++) + for (i = 0; i < count; i++) tmp[i] = OF_BSWAP_FLOAT(buffer[i]); [self writeBuffer: tmp length: size]; } @finally { @@ -1322,27 +1322,27 @@ return size; } - (size_t)writeLittleEndianDoubles: (const double*)buffer - count: (size_t)nDoubles + count: (size_t)count { - size_t size = nDoubles * sizeof(double); + size_t size = count * sizeof(double); #ifndef OF_FLOAT_BIG_ENDIAN [self writeBuffer: buffer length: size]; #else double *tmp; tmp = [self allocMemoryWithSize: sizeof(double) - count: nDoubles]; + count: count]; @try { size_t i; - for (i = 0; i < nDoubles; i++) + for (i = 0; i < count; i++) tmp[i] = OF_BSWAP_DOUBLE(buffer[i]); [self writeBuffer: tmp length: size]; } @finally { Index: src/OFStreamObserver.h ================================================================== --- src/OFStreamObserver.h +++ src/OFStreamObserver.h @@ -43,11 +43,11 @@ @optional #endif /** * \brief This callback is called when a stream did get ready for reading. * - * NOTE: When -[tryReadLine] or -[tryReadTillDelimiter:] has been called on the + * \note When \ref tryReadLine or \ref tryReadTillDelimiter: has been called on * the stream, this callback will not be called again until new data has * been received, even though there is still data in the cache. The reason * for this is to prevent spinning in a loop when there is an incomplete * string in the cache. Once the string is complete, the callback will be * called again if there is data in the cache. @@ -72,11 +72,11 @@ @end /** * \brief A class that can observe multiple streams at once. * - * Note: Currently, Win32 can only observe sockets and not files! + * \note Currently, Win32 can only observe sockets and not files! */ @interface OFStreamObserver: OFObject { OFMutableArray *readStreams; OFMutableArray *writeStreams; @@ -123,12 +123,12 @@ * This is also used to observe a listening socket for incoming connections, * which then triggers a read event for the observed stream. * * It is recommended that the stream you add is set to non-blocking mode. * - * If there is an -[observe] call blocking, it will be canceled. The reason for - * this is to prevent blocking even though the new added stream is ready. + * If there is an \ref observe call blocking, it will be canceled. The reason + * for this is to prevent blocking even though the new added stream is ready. * * \param stream The stream to observe for reading */ - (void)addStreamForReading: (OFStream*)stream; @@ -135,32 +135,32 @@ /** * \brief Adds a stream to observe for writing. * * It is recommended that the stream you add is set to non-blocking mode. * - * If there is an -[observe] call blocking, it will be canceled. The reason for - * this is to prevent blocking even though the new added stream is ready. + * If there is an \ref observe call blocking, it will be canceled. The reason + * for this is to prevent blocking even though the new added stream is ready. * * \param stream The stream to observe for writing */ - (void)addStreamForWriting: (OFStream*)stream; /** * \brief Removes a stream to observe for reading. * - * If there is an -[observe] call blocking, it will be canceled. The reason for - * this is to prevent the removed stream from still being observed. + * If there is an \ref observe call blocking, it will be canceled. The reason + * for this is to prevent the removed stream from still being observed. * * \param stream The stream to remove from observing for reading */ - (void)removeStreamForReading: (OFStream*)stream; /** * \brief Removes a stream to observe for writing. * - * If there is an -[observe] call blocking, it will be canceled. The reason for - * this is to prevent the removed stream from still being observed. + * If there is an \ref observe call blocking, it will be canceled. The reason + * for this is to prevent the removed stream from still being observed. * * \param stream The stream to remove from observing for writing */ - (void)removeStreamForWriting: (OFStream*)stream; Index: src/OFString+JSONValue.h ================================================================== --- src/OFString+JSONValue.h +++ src/OFString+JSONValue.h @@ -36,11 +36,11 @@ * this is that most JSON parsers allow JSON data just consisting of a * single primitive, leading to realworld JSON files sometimes only * consisting of a single primitive. Therefore, you should not make any * assumptions about the object returned by this method if you don't * want your program to terminate due to a message not understood, but - * instead check the returned object using -[isKindOfClass:]. + * instead check the returned object using \ref isKindOfClass:. * * \return An object */ - (id)JSONValue; @end Index: src/OFString+XMLUnescaping.h ================================================================== --- src/OFString+XMLUnescaping.h +++ src/OFString+XMLUnescaping.h @@ -23,17 +23,17 @@ #ifdef __cplusplus } #endif #ifdef OF_HAVE_BLOCKS -typedef OFString* (^of_string_xml_unescaping_block_t)(OFString *str, +typedef OFString* (^of_string_xml_unescaping_block_t)(OFString *string, OFString *entity); #endif /** * \brief A protocol that needs to be implemented by delegates for - * -[stringByXMLUnescapingWithHandler:]. + * stringByXMLUnescapingWithHandler:. */ @protocol OFStringXMLUnescapingDelegate /** * \brief This callback is called when an unknown entity was found while trying * to unescape XML. @@ -40,15 +40,15 @@ * * The callback is supposed to return a substitution for the entity or nil if * it is unknown to the callback as well, in which case an exception will be * thrown. * - * \param str The string which contains the unknown entity + * \param string The string which contains the unknown entity * \param entity The name of the entity that is unknown * \return A substitution for the entity or nil */ -- (OFString*)string: (OFString*)str +- (OFString*)string: (OFString*)string containsUnknownEntityNamed: (OFString*)entity; @end /** * \brief A category for unescaping XML in strings. Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -73,16 +73,10 @@ @class OFArray; @class OFURL; /** * \brief A class for handling strings. - * - * Warning: If you add methods to OFString using a category, you are not - * allowed to access the ivars directly, as these might be still uninitialized - * for a constant string and get initialized on the first message! Therefore, - * you should use the corresponding methods to get the ivars, which ensures the - * constant string is initialized. */ @interface OFString: OFObject #ifdef OF_HAVE_PROPERTIES @property (readonly) size_t length; @@ -115,11 +109,11 @@ length: (size_t)UTF8StringLength; /** * \brief Creates a new OFString from a C string with the specified encoding. * - * \param string A C string to initialize the OFString with + * \param cString A C string to initialize the OFString with * \param encoding The encoding of the C string * \return A new autoreleased OFString */ + (instancetype)stringWithCString: (const char*)cString encoding: (of_string_encoding_t)encoding; @@ -247,11 +241,11 @@ * \brief Creates a new OFString containing the constructed specified path. * * \param firstComponent The first component of the path * \return A new autoreleased OFString */ -+ (instancetype)stringWithPath: (OFString*)firstComponent, ...; ++ (instancetype)stringWithPath: (OFString*)firstComponent, ... OF_SENTINEL; /** * \brief Creates a new OFString with the contents of the specified UTF-8 * encoded file. * @@ -479,11 +473,11 @@ * specified path. * * \param firstComponent The first component of the path * \return A new autoreleased OFString */ -- initWithPath: (OFString*)firstComponent, ...; +- initWithPath: (OFString*)firstComponent, ... OF_SENTINEL; /** * \brief Initializes an already allocated OFString with the constructed * specified path. * @@ -626,11 +620,12 @@ /** * \brief Returns the range of the string. * * \param string The string to search * \param options Options modifying search behaviour. - * Possible values: OF_STRING_SEARCH_BACKWARDS + * Possible values: + * * OF_STRING_SEARCH_BACKWARDS * \return The range of the first occurrence of the string or a range with * OF_NOT_FOUND as start position if it was not found */ - (of_range_t)rangeOfString: (OFString*)string options: (int)options; @@ -638,11 +633,12 @@ /** * \brief Returns the range of the string in the specified range. * * \param string The string to search * \param options Options modifying search behaviour. - * Possible values: OF_STRING_SEARCH_BACKWARDS + * Possible values: + * * OF_STRING_SEARCH_BACKWARDS * \param range The range in which to search * \return The range of the first occurrence of the string or a range with * OF_NOT_FOUND as start position if it was not found */ - (of_range_t)rangeOfString: (OFString*)string @@ -705,11 +701,12 @@ * string in the specified range with the specified replacement. * * \param string The string to replace * \param replacement The string with which it should be replaced * \param options Options modifying search behaviour. - * Possible values: None yet + * Possible values: + * * None yet * \param range The range in which to replace the string * \return A new string with the occurrences of the specified string replaced */ - (OFString*)stringByReplacingOccurrencesOfString: (OFString*)string withString: (OFString*)replacement @@ -731,11 +728,11 @@ - (OFString*)lowercaseString; /** * \brief Returns the string capitalized. * - * \note This only considers spaces, tab and newlines to be word delimiters! + * \note This only considers spaces, tabs and newlines to be word delimiters! * Also note that this might change in the future to all word delimiters * specified by Unicode! * * \return The capitalized string */ @@ -789,12 +786,13 @@ /** * \brief Separates an OFString into an OFArray of OFStrings. * * \param delimiter The delimiter for separating - * \param options Options according to which the string should be separated - * Possible values: OF_STRING_SKIP_EMPTY + * \param options Options according to which the string should be separated. + * Possible values: + * * OF_STRING_SKIP_EMPTY * \return An autoreleased OFArray with the separated string */ - (OFArray*)componentsSeparatedByString: (OFString*)delimiter options: (int)options; Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -377,11 +377,11 @@ encoding: encoding] autorelease]; } + (instancetype)stringWithCString: (const char*)cString encoding: (of_string_encoding_t)encoding - length: (size_t)cStringLength + length: (size_t)cStringLength { return [[[self alloc] initWithCString: cString encoding: encoding length: cStringLength] autorelease]; } Index: src/OFTCPSocket.h ================================================================== --- src/OFTCPSocket.h +++ src/OFTCPSocket.h @@ -171,11 +171,11 @@ port: (uint16_t)port; /** * \brief Listen on the socket. * - * \param backlog Maximum length for the queue of pending connections. + * \param backLog Maximum length for the queue of pending connections. */ - (void)listenWithBackLog: (int)backLog; /** * \brief Listen on the socket. @@ -188,11 +188,11 @@ * \return An autoreleased OFTCPSocket for the accepted connection. */ - (OFTCPSocket*)accept; /** - * \brief Asyncronously ccept an incoming connection. + * \brief Asyncronously accept an incoming connection. * * \param target The target on which to execute the selector when a new * connection has been accepted. The method returns whether the * next incoming connection should be accepted by the specified * block as well. @@ -203,11 +203,11 @@ - (void)asyncAcceptWithTarget: (id)target selector: (SEL)selector; #ifdef OF_HAVE_BLOCKS /** - * \brief Asyncronously ccept an incoming connection. + * \brief Asyncronously accept an incoming connection. * * \param block The block to execute when a new connection has been accepted. * Returns whether the next incoming connection should be accepted * by the specified block as well. */ Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -56,11 +56,11 @@ #ifndef INVALID_SOCKET # define INVALID_SOCKET -1 #endif #if defined(OF_THREADS) && !defined(HAVE_THREADSAFE_GETADDRINFO) -# import "OFThread.h" +# import "OFMutex.h" # import "OFDataArray.h" static OFMutex *mutex = nil; #endif Index: src/OFTLSKey.h ================================================================== --- src/OFTLSKey.h +++ src/OFTLSKey.h @@ -16,10 +16,15 @@ #import "OFObject.h" #import "OFList.h" #import "threading.h" + +/* Haiku used to define this for some unknown reason which causes trouble */ +#ifdef protected +# undef protected +#endif /** * \brief A class for Thread Local Storage keys. */ @interface OFTLSKey: OFObject Index: src/OFTLSSocket.h ================================================================== --- src/OFTLSSocket.h +++ src/OFTLSSocket.h @@ -26,12 +26,14 @@ @protocol OFTLSSocketDelegate /** * \brief This callback is called when the TLS socket wants to know if it * should accept the received keychain. * - * \param certificate An array of objects implementing the OFX509Certificate - * protocol + * \param socket The socket which wants to know if it should accept the received + * keychain + * \param keychain An array of objects implementing the OFX509Certificate + * protocol * \return Whether the TLS socket should accept the received keychain */ - (BOOL)socket: (id )socket shouldAcceptKeychain: (OFArray*)keychain; @end Index: src/OFThread.h ================================================================== --- src/OFThread.h +++ src/OFThread.h @@ -16,10 +16,15 @@ #import "OFObject.h" #import "OFTLSKey.h" #import "threading.h" + +/* Haiku used to define this for some unknown reason which causes trouble */ +#ifdef protected +# undef protected +#endif @class OFDate; @class OFSortedList; @class OFRunLoop; Index: src/OFThreadPool.h ================================================================== --- src/OFThreadPool.h +++ src/OFThreadPool.h @@ -62,22 +62,10 @@ * \param size The number of threads for the pool * \return A new thread pool with the specified number of threads */ + (instancetype)threadPoolWithSize: (size_t)size; -/** - * \brief Initializes an already allocated OFThreadPool with one thread for - * each core in the system. - * - * \warning If for some reason the number of cores in the system could not be - * determined, the pool will only have one thread! - * - * \return An initialized OFThreadPool with one thread for each core in the - * system - */ -- init; - /** * \brief Initializes an already allocated OFThreadPool with the specified * number of threads. * * \warning If for some reason the number of cores in the system could not be Index: src/OFTimer.h ================================================================== --- src/OFTimer.h +++ src/OFTimer.h @@ -215,11 +215,11 @@ */ - initWithFireDate: (OFDate*)fireDate interval: (double)interval target: (id)target selector: (SEL)selector - object: (id)object1 + object: (id)object repeats: (BOOL)repeats; /** * \brief Initializes an already allocated timer with the specified time * interval. @@ -227,10 +227,14 @@ * \param fireDate The date at which the timer should fire * \param interval The time interval after which to repeat the timer, if it is * a repeating timer * \param target The target on which to call the selector * \param selector The selector to call on the target + * \param object1 The first object to pass when calling the selector on the + * target + * \param object2 The second object to pass when calling the selector on the + * target * \param repeats Whether the timer repeats after it has been executed * \return An initialized timer */ - initWithFireDate: (OFDate*)fireDate interval: (double)interval Index: src/OFURL.h ================================================================== --- src/OFURL.h +++ src/OFURL.h @@ -80,11 +80,11 @@ * \param string A string describing a URL * \param URL A URL to which the string is relative * \return An initialized OFURL */ - initWithString: (OFString*)string - relativeToURL: (OFURL*)url; + relativeToURL: (OFURL*)URL; /** * \brief Returns the scheme part of the URL. * * \return The scheme part of the URL Index: src/OFXMLElement.h ================================================================== --- src/OFXMLElement.h +++ src/OFXMLElement.h @@ -301,11 +301,11 @@ namespace: (OFString*)attributeNS; /** * \brief Removes the attribute with the specified name. * - * \param attribteName The name of the attribute + * \param attributeName The name of the attribute */ - (void)removeAttributeForName: (OFString*)attributeName; /** * \brief Removes the attribute with the specified name and namespace. Index: src/OFXMLElementBuilder.h ================================================================== --- src/OFXMLElementBuilder.h +++ src/OFXMLElementBuilder.h @@ -36,11 +36,11 @@ * If the OFXMLElementBuilder was used as a delegate for the OFXMLParser since * parsing started, this will return the complete document as an OFXMLElement * with all children. * * \param builder The builder which built an OFXMLElement - * \param elem The OFXMLElement the OFXMLElementBuilder built + * \param element The OFXMLElement the OFXMLElementBuilder built */ - (void)elementBuilder: (OFXMLElementBuilder*)builder didBuildElement: (OFXMLElement*)element; #ifdef OF_HAVE_OPTIONAL_PROTOCOLS @@ -85,10 +85,11 @@ /** * \brief This callback is called when the XML parser for the element builder * found an unknown entity. * + * \param builder The element builder which found an unknown entity * \param entity The name of the entity * \return The substitution for the entity */ - (OFString*)elementBuilder: (OFXMLElementBuilder*)builder foundUnknownEntityNamed: (OFString*)entity; Index: src/OFXMLElementBuilder.m ================================================================== --- src/OFXMLElementBuilder.m +++ src/OFXMLElementBuilder.m @@ -187,11 +187,11 @@ } @end @implementation OFObject (OFXMLElementBuilderDelegate) - (void)elementBuilder: (OFXMLElementBuilder*)builder - didBuildElement: (OFXMLElement*)elem + didBuildElement: (OFXMLElement*)element { } - (void)elementBuilder: (OFXMLElementBuilder*)builder didBuildParentlessNode: (OFXMLNode*)node Index: src/autorelease.m ================================================================== --- src/autorelease.m +++ src/autorelease.m @@ -37,12 +37,12 @@ static void __attribute__((constructor)) init(void) { OF_ENSURE(of_tlskey_new(&objectsKey)); - OF_ENSURE(of_tlskey_new(&sizeKey)); OF_ENSURE(of_tlskey_new(&topKey)); + OF_ENSURE(of_tlskey_new(&sizeKey)); } #endif void* objc_autoreleasePoolPush() @@ -77,12 +77,12 @@ objects = NULL; top = NULL; } #ifndef OF_COMPILER_TLS - OF_ENSURE(of_tlskey_set(objectsKey, objects)); OF_ENSURE(of_tlskey_set(topKey, top)); + OF_ENSURE(of_tlskey_set(objectsKey, objects)); #endif } id _objc_rootAutorelease(id object) @@ -94,18 +94,17 @@ #endif if (objects == NULL) { OF_ENSURE((objects = malloc(of_pagesize)) != NULL); + top = objects; + size = of_pagesize; + #ifndef OF_COMPILER_TLS OF_ENSURE(of_tlskey_set(objectsKey, objects)); - OF_ENSURE(of_tlskey_set(sizeKey, - (void*)(uintptr_t)of_pagesize)); + OF_ENSURE(of_tlskey_set(sizeKey, (void*)(uintptr_t)size)); #endif - - top = objects; - size = of_pagesize; } if ((uintptr_t)top >= (uintptr_t)objects + size) { ptrdiff_t diff = top - objects; @@ -122,10 +121,10 @@ *top = object; top++; #ifndef OF_COMPILER_TLS - OF_ENSURE(of_tlskey_set(topKey, objects)); + OF_ENSURE(of_tlskey_set(topKey, top)); #endif return object; } Index: src/exceptions/OFAcceptFailedException.h ================================================================== --- src/exceptions/OFAcceptFailedException.h +++ src/exceptions/OFAcceptFailedException.h @@ -31,32 +31,38 @@ @property (readonly, retain, nonatomic) OFTCPSocket *socket; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased accept failed exception. + * * \param class_ The class of the object which caused the exception * \param socket The socket which could not accept a connection - * \return A new accept failed exception + * \return A new, autoreleased accept failed exception */ + (instancetype)exceptionWithClass: (Class)class_ socket: (OFTCPSocket*)socket; /** - * Initializes an already allocated accept failed exception. + * \brief Initializes an already allocated accept failed exception. * * \param class_ The class of the object which caused the exception * \param socket The socket which could not accept a connection * \return An initialized accept failed exception */ - initWithClass: (Class)class_ socket: (OFTCPSocket*)socket; /** + * \brief Returns the socket which could not accept a connection. + * * \return The socket which could not accept a connection */ - (OFTCPSocket*)socket; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; @end Index: src/exceptions/OFAddressTranslationFailedException.h ================================================================== --- src/exceptions/OFAddressTranslationFailedException.h +++ src/exceptions/OFAddressTranslationFailedException.h @@ -33,21 +33,23 @@ @property (readonly, copy, nonatomic) OFString *host; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased address translation failed exception. + * * \param class_ The class of the object which caused the exception * \param socket The socket which could not translate the address * \param host The host for which translation was requested - * \return A new address translation failed exception + * \return A new, autoreleased address translation failed exception */ + (instancetype)exceptionWithClass: (Class)class_ socket: (OFTCPSocket*)socket host: (OFString*)host; /** - * Initializes an already allocated address translation failed exception. + * \brief Initializes an already allocated address translation failed exception. * * \param class_ The class of the object which caused the exception * \param socket The socket which could not translate the address * \param host The host for which translation was requested * \return An initialized address translation failed exception @@ -55,19 +57,25 @@ - initWithClass: (Class)class_ socket: (OFTCPSocket*)socket host: (OFString*)host; /** + * \brief Returns the socket which could not translate the address. + * * \return The socket which could not translate the address */ - (OFTCPSocket*)socket; /** - * /return The host for which translation was requested + * \brief Returns the host for which the address translation was requested. + * + * \return The host for which the address translation was requested */ - (OFString*)host; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; @end Index: src/exceptions/OFAllocFailedException.h ================================================================== --- src/exceptions/OFAllocFailedException.h +++ src/exceptions/OFAllocFailedException.h @@ -19,20 +19,22 @@ @class OFString; /** * \brief An exception indicating an object could not be allocated. * - * This exception is preallocated, as if there's no memory, no exception can + * This exception is preallocated, as when there's no memory, no exception can * be allocated of course. That's why you shouldn't and even can't deallocate * it. * * This is the only exception that is not an OFException as it's special. * It does not know for which class allocation failed and it should not be * handled like other exceptions, as the exception handling code is not - * allowed to allocate ANY memory. + * allowed to allocate any memory. */ @interface OFAllocFailedException: OFObject /** + * \brief Returns a description of the exception. + * * \return A description of the exception */ - (OFString*)description; @end Index: src/exceptions/OFAlreadyConnectedException.h ================================================================== --- src/exceptions/OFAlreadyConnectedException.h +++ src/exceptions/OFAlreadyConnectedException.h @@ -30,27 +30,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) OFTCPSocket *socket; #endif /** + * \brief Creates a new, autoreleased already connected exception. + * * \param class_ The class of the object which caused the exception * \param socket The socket which is already connected - * \return A new already connected exception + * \return A new, autoreleased already connected exception */ + (instancetype)exceptionWithClass: (Class)class_ socket: (OFTCPSocket*)socket; /** - * Initializes an already allocated already connected exception. + * \brief Initializes an already allocated already connected exception. * * \param class_ The class of the object which caused the exception * \param socket The socket which is already connected * \return An initialized already connected exception */ - initWithClass: (Class)class_ socket: (OFTCPSocket*)socket; /** + * \brief Returns the socket which is already connected. + * * \return The socket which is already connected */ - (OFTCPSocket*)socket; @end Index: src/exceptions/OFBindFailedException.h ================================================================== --- src/exceptions/OFBindFailedException.h +++ src/exceptions/OFBindFailedException.h @@ -35,23 +35,25 @@ @property (readonly) uint16_t port; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased bind failed exception. + * * \param class_ The class of the object which caused the exception * \param socket The socket which could not be bound * \param host The host on which binding failed * \param port The port on which binding failed - * \return A new bind failed exception + * \return A new, autoreleased bind failed exception */ + (instancetype)exceptionWithClass: (Class)class_ socket: (OFTCPSocket*)socket host: (OFString*)host port: (uint16_t)port; /** - * Initializes an already allocated bind failed exception. + * \brief Initializes an already allocated bind failed exception. * * \param class_ The class of the object which caused the exception * \param socket The socket which could not be bound * \param host The host on which binding failed * \param port The port on which binding failed @@ -61,24 +63,32 @@ socket: (OFTCPSocket*)socket host: (OFString*)host port: (uint16_t)port; /** + * \brief Returns the socket which could not be bound. + * * \return The socket which could not be bound */ - (OFTCPSocket*)socket; /** + * \brief Returns the host on which binding failed. + * * \return The host on which binding failed */ - (OFString*)host; /** + * \brief Return the port on which binding failed. + * * \return The port on which binding failed */ - (uint16_t)port; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; @end Index: src/exceptions/OFChangeDirectoryFailedException.h ================================================================== --- src/exceptions/OFChangeDirectoryFailedException.h +++ src/exceptions/OFChangeDirectoryFailedException.h @@ -29,20 +29,22 @@ @property (readonly, copy, nonatomic) OFString *path; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased change directory failed exception. + * * \param class_ The class of the object which caused the exception * \param path A string with the path of the directory to which couldn't be * changed - * \return A new change directory failed exception + * \return A new, autoreleased change directory failed exception */ + (instancetype)exceptionWithClass: (Class)class_ path: (OFString*)path; /** - * Initializes an already allocated change directory failed exception. + * \brief Initializes an already allocated change directory failed exception. * * \param class_ The class of the object which caused the exception * \param path A string with the path of the directory to which couldn't be * changed * \return An initialized change directory failed exception @@ -49,14 +51,18 @@ */ - initWithClass: (Class)class_ path: (OFString*)path; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; /** - * \return A string with the path of the directory to which couldn't changed + * \brief Returns the path to which changing failed. + * + * \return The path to which changing failed */ - (OFString*)path; @end Index: src/exceptions/OFChangeFileModeFailedException.h ================================================================== --- src/exceptions/OFChangeFileModeFailedException.h +++ src/exceptions/OFChangeFileModeFailedException.h @@ -33,21 +33,23 @@ @property (readonly) mode_t mode; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased change file mode failed exception. + * * \param class_ The class of the object which caused the exception * \param path The path of the file * \param mode The new mode for the file - * \return An initialized change file mode failed exception + * \return A new, autoreleased change file mode failed exception */ + (instancetype)exceptionWithClass: (Class)class_ path: (OFString*)path mode: (mode_t)mode; /** - * Initializes an already allocated change file mode failed exception. + * \brief Initializes an already allocated change file mode failed exception. * * \param class_ The class of the object which caused the exception * \param path The path of the file * \param mode The new mode for the file * \return An initialized change file mode failed exception @@ -55,19 +57,25 @@ - initWithClass: (Class)class_ path: (OFString*)path mode: (mode_t)mode; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; /** + * \brief Returns the path of the file. + * * \return The path of the file */ - (OFString*)path; /** + * \brief Returns the new mode for the file. + * * \return The new mode for the file */ - (mode_t)mode; @end Index: src/exceptions/OFChangeFileOwnerFailedException.h ================================================================== --- src/exceptions/OFChangeFileOwnerFailedException.h +++ src/exceptions/OFChangeFileOwnerFailedException.h @@ -34,23 +34,25 @@ @property (readonly, copy, nonatomic) OFString *group; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased change file owner failed exception. + * * \param class_ The class of the object which caused the exception * \param path The path of the file * \param owner The new owner for the file * \param group The new group for the file - * \return An initialized change file owner failed exception + * \return A new, autoreleased change file owner failed exception */ + (instancetype)exceptionWithClass: (Class)class_ path: (OFString*)path owner: (OFString*)owner group: (OFString*)group; /** - * Initializes an already allocated change file owner failed exception. + * \brief Initializes an already allocated change file owner failed exception. * * \param class_ The class of the object which caused the exception * \param path The path of the file * \param owner The new owner for the file * \param group The new group for the file @@ -60,25 +62,33 @@ path: (OFString*)path owner: (OFString*)owner group: (OFString*)group; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; /** + * \brief Returns the path of the file. + * * \return The path of the file */ - (OFString*)path; /** + * \brief Returns the new owner for the file. + * * \return The new owner for the file */ - (OFString*)owner; /** + * \brief Returns the new group for the file. + * * \return The new group for the file */ - (OFString*)group; @end #endif Index: src/exceptions/OFConditionBroadcastFailedException.h ================================================================== --- src/exceptions/OFConditionBroadcastFailedException.h +++ src/exceptions/OFConditionBroadcastFailedException.h @@ -29,27 +29,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) OFCondition *condition; #endif /** + * \brief Returns a new, autoreleased condition broadcast failed exception. + * * \param class_ The class of the object which caused the exception * \param condition The condition which could not be broadcasted - * \return A new condition broadcast failed exception + * \return A new, autoreleased condition broadcast failed exception */ + (instancetype)exceptionWithClass: (Class)class_ condition: (OFCondition*)condition; /** - * Initializes an already allocated condition broadcast failed exception. + * \brief Initializes an already allocated condition broadcast failed exception. * * \param class_ The class of the object which caused the exception * \param condition The condition which could not be broadcasted * \return An initialized condition broadcast failed exception */ - initWithClass: (Class)class_ condition: (OFCondition*)condition; /** + * \brief Returns the condition which could not be broadcasted. + * * \return The condition which could not be broadcasted */ - (OFCondition*)condition; @end Index: src/exceptions/OFConditionSignalFailedException.h ================================================================== --- src/exceptions/OFConditionSignalFailedException.h +++ src/exceptions/OFConditionSignalFailedException.h @@ -29,27 +29,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) OFCondition *condition; #endif /** + * \brief Creates a new, autoreleased condition signal failed exception. + * * \param class_ The class of the object which caused the exception * \param condition The condition which could not be signaled - * \return A new condition signal failed exception + * \return A new, autoreleased condition signal failed exception */ + (instancetype)exceptionWithClass: (Class)class_ condition: (OFCondition*)condition; /** - * Initializes an already allocated condition signal failed exception. + * \brief Initializes an already allocated condition signal failed exception. * * \param class_ The class of the object which caused the exception * \param condition The condition which could not be signaled * \return An initialized condition signal failed exception */ - initWithClass: (Class)class_ condition: (OFCondition*)condition; /** + * \brief Return the condition which could not be signaled. + * * \return The condition which could not be signaled */ - (OFCondition*)condition; @end Index: src/exceptions/OFConditionStillWaitingException.h ================================================================== --- src/exceptions/OFConditionStillWaitingException.h +++ src/exceptions/OFConditionStillWaitingException.h @@ -30,27 +30,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) OFCondition *condition; #endif /** + * \brief Creates a new, autoreleased condition still waiting exception. + * * \param class_ The class of the object which caused the exception * \param condition The condition for which is still being waited - * \return A new condition still waiting exception + * \return A new, autoreleased condition still waiting exception */ + (instancetype)exceptionWithClass: (Class)class_ condition: (OFCondition*)condition; /** - * Initializes an already allocated condition still waiting exception. + * \brief Initializes an already allocated condition still waiting exception. * * \param class_ The class of the object which caused the exception * \param condition The condition for which is still being waited * \return An initialized condition still waiting exception */ - initWithClass: (Class)class_ condition: (OFCondition*)condition; /** + * \brief Return the condition for which is still being waited. + * * \return The condition for which is still being waited */ - (OFCondition*)condition; @end Index: src/exceptions/OFConditionWaitFailedException.h ================================================================== --- src/exceptions/OFConditionWaitFailedException.h +++ src/exceptions/OFConditionWaitFailedException.h @@ -29,27 +29,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) OFCondition *condition; #endif /** + * \brief Creates a new, autoreleased condition wait failed exception. + * * \param class_ The class of the object which caused the exception * \param condition The condition for which could not be waited - * \return A new condition wait failed exception + * \return A new, autoreleased condition wait failed exception */ + (instancetype)exceptionWithClass: (Class)class_ condition: (OFCondition*)condition; /** - * Initializes an already allocated condition wait failed exception. + * \brief Initializes an already allocated condition wait failed exception. * * \param class_ The class of the object which caused the exception * \param condition The condition for which could not be waited * \return An initialized condition wait failed exception */ - initWithClass: (Class)class_ condition: (OFCondition*)condition; /** + * \brief Return the condition for which could not be waited. + * * \return The condition for which could not be waited */ - (OFCondition*)condition; @end Index: src/exceptions/OFConnectionFailedException.h ================================================================== --- src/exceptions/OFConnectionFailedException.h +++ src/exceptions/OFConnectionFailedException.h @@ -35,23 +35,25 @@ @property (readonly) uint16_t port; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased connection failed exception. + * * \param class_ The class of the object which caused the exception * \param socket The socket which could not connect * \param host The host to which the connection failed * \param port The port on the host to which the connection failed - * \return A new connection failed exception + * \return A new, autoreleased connection failed exception */ + (instancetype)exceptionWithClass: (Class)class_ socket: (OFTCPSocket*)socket host: (OFString*)host port: (uint16_t)port; /** - * Initializes an already allocated connection failed exception. + * \brief Initializes an already allocated connection failed exception. * * \param class_ The class of the object which caused the exception * \param socket The socket which could not connect * \param host The host to which the connection failed * \param port The port on the host to which the connection failed @@ -61,24 +63,32 @@ socket: (OFTCPSocket*)socket host: (OFString*)host port: (uint16_t)port; /** + * \brief Returns the socket which could not connect. + * * \return The socket which could not connect */ - (OFTCPSocket*)socket; /** + * \brief Returns the host to which the connection failed. + * * \return The host to which the connection failed */ - (OFString*)host; /** + * \brief Returns the port on the host to which the connection failed. + * * \return The port on the host to which the connection failed */ - (uint16_t)port; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; @end Index: src/exceptions/OFCopyFileFailedException.h ================================================================== --- src/exceptions/OFCopyFileFailedException.h +++ src/exceptions/OFCopyFileFailedException.h @@ -31,21 +31,23 @@ @property (readonly, copy, nonatomic) OFString *destinationPath; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased copy file failed exception. + * * \param class_ The class of the object which caused the exception * \param source The original path * \param destination The new path - * \return A new copy file failed exception + * \return A new, autoreleased copy file failed exception */ + (instancetype)exceptionWithClass: (Class)class_ sourcePath: (OFString*)source destinationPath: (OFString*)destination; /** - * Initializes an already allocated copy file failed exception. + * \brief Initializes an already allocated copy file failed exception. * * \param class_ The class of the object which caused the exception * \param source The original path * \param destination The new path * \return An initialized copy file failed exception @@ -53,19 +55,25 @@ - initWithClass: (Class)class_ sourcePath: (OFString*)source destinationPath: (OFString*)destination; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; /** + * \brief Returns the path of the source file. + * * \return The path of the source file */ - (OFString*)sourcePath; /** + * \brief Returns the destination path. + * * \return The destination path */ - (OFString*)destinationPath; @end Index: src/exceptions/OFCreateDirectoryFailedException.h ================================================================== --- src/exceptions/OFCreateDirectoryFailedException.h +++ src/exceptions/OFCreateDirectoryFailedException.h @@ -29,32 +29,39 @@ @property (readonly, copy, nonatomic) OFString *path; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased create directory failed exception. + * * \param class_ The class of the object which caused the exception * \param path A string with the path of the directory which couldn't be created - * \return A new create directory failed exception + * \return A new, autoreleased create directory failed exception */ + (instancetype)exceptionWithClass: (Class)class_ path: (OFString*)path; /** - * Initializes an already allocated create directory failed exception. + * \brief Initializes an already allocated create directory failed exception. * * \param class_ The class of the object which caused the exception * \param path A string with the path of the directory which couldn't be created * \return An initialized create directory failed exception */ - initWithClass: (Class)class_ path: (OFString*)path; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; /** + * \brief Returns a string with the path of the directory which couldn't be + * created. + * * \return A string with the path of the directory which couldn't be created */ - (OFString*)path; @end Index: src/exceptions/OFDeleteDirectoryFailedException.h ================================================================== --- src/exceptions/OFDeleteDirectoryFailedException.h +++ src/exceptions/OFDeleteDirectoryFailedException.h @@ -29,32 +29,38 @@ @property (readonly, copy, nonatomic) OFString *path; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased delete directory failed exception. + * * \param class_ The class of the object which caused the exception * \param path The path of the directory - * \return A new delete directory failed exception + * \return A new, autoreleased delete directory failed exception */ + (instancetype)exceptionWithClass: (Class)class_ path: (OFString*)path; /** - * Initializes an already allocated delete directory failed exception. + * \brief Initializes an already allocated delete directory failed exception. * * \param class_ The class of the object which caused the exception * \param path The path of the directory * \return An initialized delete directory failed exception */ - initWithClass: (Class)class_ path: (OFString*)path; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; /** + * \brief Returns the path of the directory. + * * \return The path of the directory */ - (OFString*)path; @end Index: src/exceptions/OFDeleteFileFailedException.h ================================================================== --- src/exceptions/OFDeleteFileFailedException.h +++ src/exceptions/OFDeleteFileFailedException.h @@ -29,32 +29,38 @@ @property (readonly, copy, nonatomic) OFString *path; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased delete file failed exception. + * * \param class_ The class of the object which caused the exception * \param path The path of the file - * \return A new delete file failed exception + * \return A new, autoreleased delete file failed exception */ + (instancetype)exceptionWithClass: (Class)class_ path: (OFString*)path; /** - * Initializes an already allocated delete file failed exception. + * \brief Initializes an already allocated delete file failed exception. * * \param class_ The class of the object which caused the exception * \param path The path of the file * \return An initialized delete file failed exception */ - initWithClass: (Class)class_ path: (OFString*)path; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; /** + * \brief Returns the path of the file. + * * \return The path of the file */ - (OFString*)path; @end Index: src/exceptions/OFEnumerationMutationException.h ================================================================== --- src/exceptions/OFEnumerationMutationException.h +++ src/exceptions/OFEnumerationMutationException.h @@ -28,27 +28,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) id object; #endif /** + * \brief Creates a new, autoreleased enumeration mutation exception. + * * \param class_ The class of the object which caused the exception * \param object The object which was mutated during enumeration - * \return A new enumeration mutation exception + * \return A new, autoreleased enumeration mutation exception */ + (instancetype)exceptionWithClass: (Class)class_ object: (id)object; /** - * Initializes an already allocated enumeration mutation exception. + * \brief Initializes an already allocated enumeration mutation exception. * * \param class_ The class of the object which caused the exception * \param object The object which was mutated during enumeration * \return An initialized enumeration mutation exception */ - initWithClass: (Class)class_ object: (id)object; /** + * \brief Returns the object which was mutated during enumeration. + * * \return The object which was mutated during enumeration */ - (id)object; @end Index: src/exceptions/OFException.h ================================================================== --- src/exceptions/OFException.h +++ src/exceptions/OFException.h @@ -33,30 +33,34 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly) Class inClass; #endif /** - * Creates a new exception. + * \brief Creates a new, autoreleased exception. * * \param class_ The class of the object which caused the exception - * \return A new exception + * \return A new, autoreleased exception */ + (instancetype)exceptionWithClass: (Class)class_; /** - * Initializes an already allocated OFException. + * \brief Initializes an already allocated OFException. * * \param class_ The class of the object which caused the exception * \return An initialized OFException */ - initWithClass: (Class)class_; /** + * \brief Returns the class of the object in which the exception happened. + * * \return The class of the object in which the exception happened */ - (Class)inClass; /** + * \brief Returns a description of the exception. + * * \return A description of the exception */ - (OFString*)description; @end Index: src/exceptions/OFHTTPRequestFailedException.h ================================================================== --- src/exceptions/OFHTTPRequestFailedException.h +++ src/exceptions/OFHTTPRequestFailedException.h @@ -32,21 +32,23 @@ @property (readonly, retain, nonatomic) OFHTTPRequest *request; @property (readonly, retain, nonatomic) OFHTTPRequestResult *result; #endif /** + * \brief Creates a new, autoreleased HTTP request failed exception. + * * \param class_ The class of the object which caused the exception * \param request The HTTP request which failed * \param result The result of the failed HTTP request - * \return A new HTTP request failed exception + * \return A new, autoreleased HTTP request failed exception */ + (instancetype)exceptionWithClass: (Class)class_ request: (OFHTTPRequest*)request result: (OFHTTPRequestResult*)result; /** - * Initializes an already allocated HTTP request failed exception + * \brief Initializes an already allocated HTTP request failed exception. * * \param class_ The class of the object which caused the exception * \param request The HTTP request which failed * \param result The result of the failed HTTP request * \return A new HTTP request failed exception @@ -54,14 +56,18 @@ - initWithClass: (Class)class_ request: (OFHTTPRequest*)request result: (OFHTTPRequestResult*)result; /** + * \brief Returns the HTTP request which failed. + * * \return The HTTP request which failed */ - (OFHTTPRequest*)request; /** + * \brief Returns the result of the failed HTTP request. + * * \return The result of the failed HTTP request */ - (OFHTTPRequestResult*)result; @end Index: src/exceptions/OFHashAlreadyCalculatedException.h ================================================================== --- src/exceptions/OFHashAlreadyCalculatedException.h +++ src/exceptions/OFHashAlreadyCalculatedException.h @@ -29,27 +29,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) OFHash *hashObject; #endif /** + * \brief Creates a new, autoreleased hash already calculated exception. + * * \param class_ The class of the object which caused the exception * \param hash The hash which has already been calculated - * \return A new hash already calculated exception + * \return A new, autoreleased hash already calculated exception */ + (instancetype)exceptionWithClass: (Class)class_ hash: (OFHash*)hash; /** - * Initializes an already allocated hash already calculated exception. + * \brief Initializes an already allocated hash already calculated exception. * * \param class_ The class of the object which caused the exception * \param hash The hash which has already been calculated * \return An initialized hash already calculated exception */ - initWithClass: (Class)class_ hash: (OFHash*)hash; /** + * \brief Returns the hash which has already been calculated. + * * \return The hash which has already been calculated */ - (OFHash*)hashObject; @end Index: src/exceptions/OFInvalidArgumentException.h ================================================================== --- src/exceptions/OFInvalidArgumentException.h +++ src/exceptions/OFInvalidArgumentException.h @@ -27,27 +27,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly) SEL selector; #endif /** + * \brief Creates a new, autoreleased 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 A new invalid argument exception + * \return A new, autoreleased invalid argument exception */ + (instancetype)exceptionWithClass: (Class)class_ selector: (SEL)selector; /** - * Initializes an already allocated invalid argument exception + * \brief 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_ selector: (SEL)selector; /** + * \brief Returns the selector to which an invalid argument was passed. + * * \return The selector to which an invalid argument was passed */ - (SEL)selector; @end Index: src/exceptions/OFInvalidJSONException.h ================================================================== --- src/exceptions/OFInvalidJSONException.h +++ src/exceptions/OFInvalidJSONException.h @@ -27,27 +27,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly) size_t line; #endif /** + * \brief Creates a new, autoreleased invalid JSON exception. + * * \param class_ The class of the object which caused the exception * \param line The line in which the parsing error encountered - * \return A new invalid JSON exception + * \return A new, autoreleased invalid JSON exception */ + (instancetype)exceptionWithClass: (Class)class_ line: (size_t)line; /** - * Initializes an already allocated invalid JSON exception. + * \brief Initializes an already allocated invalid JSON exception. * * \param class_ The class of the object which caused the exception * \param line The line in which the parsing error encountered * \return An initialized invalid JSON exception */ - initWithClass: (Class)class_ line: (size_t)line; /** + * \brief Returns the line in which parsing the JSON representation failed. + * * \return The line in which parsing the JSON representation failed */ - (size_t)line; @end Index: src/exceptions/OFLinkFailedException.h ================================================================== --- src/exceptions/OFLinkFailedException.h +++ src/exceptions/OFLinkFailedException.h @@ -32,21 +32,23 @@ @property (readonly, copy, nonatomic) OFString *destinationPath; @property (readonly) int errNo; # endif /** + * \brief Creates a new, autoreleased link failed exception. + * * \param class_ The class of the object which caused the exception * \param source The source for the link * \param destination The destination for the link - * \return A new link failed exception + * \return A new, autoreleased link failed exception */ + (instancetype)exceptionWithClass: (Class)class_ sourcePath: (OFString*)source destinationPath: (OFString*)destination; /** - * Initializes an already allocated link failed exception. + * \brief Initializes an already allocated link failed exception. * * \param class_ The class of the object which caused the exception * \param source The source for the link * \param destination The destination for the link * \return An initialized link failed exception @@ -54,20 +56,26 @@ - initWithClass: (Class)class_ sourcePath: (OFString*)source destinationPath: (OFString*)destination; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; /** + * \brief Returns a string with the source for the link. + * * \return A string with the source for the link */ - (OFString*)sourcePath; /** + * \brief Returns a string with the destination for the link. + * * \return A string with the destination for the link */ - (OFString*)destinationPath; @end #endif Index: src/exceptions/OFListenFailedException.h ================================================================== --- src/exceptions/OFListenFailedException.h +++ src/exceptions/OFListenFailedException.h @@ -33,21 +33,23 @@ @property (readonly) int backLog; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased listen failed exception. + * * \param class_ The class of the object which caused the exception * \param socket The socket which failed to listen * \param backlog The requested size of the back log - * \return A new listen failed exception + * \return A new, autoreleased listen failed exception */ + (instancetype)exceptionWithClass: (Class)class_ socket: (OFTCPSocket*)socket backLog: (int)backlog; /** - * Initializes an already allocated listen failed exception + * \brief Initializes an already allocated listen failed exception * * \param class_ The class of the object which caused the exception * \param socket The socket which failed to listen * \param backlog The requested size of the back log * \return An initialized listen failed exception @@ -55,19 +57,25 @@ - initWithClass: (Class)class_ socket: (OFTCPSocket*)socket backLog: (int)backlog; /** + * \brief Returns the socket which failed to listen. + * * \return The socket which failed to listen */ - (OFTCPSocket*)socket; /** - * \return The requested back log. + * \brief Returns the requested back log. + * + * \return The requested back log */ - (int)backLog; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; @end Index: src/exceptions/OFLockFailedException.h ================================================================== --- src/exceptions/OFLockFailedException.h +++ src/exceptions/OFLockFailedException.h @@ -28,27 +28,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) id lock; #endif /** + * \brief Creates a new, autoreleased lock failed exception. + * * \param class_ The class of the object which caused the exception * \param lock The lock which could not be locked - * \return A new lock failed exception + * \return A new, autoreleased lock failed exception */ + (instancetype)exceptionWithClass: (Class)class_ lock: (id )lock; /** - * Initializes an already allocated lock failed exception. + * \brief Initializes an already allocated lock failed exception. * * \param class_ The class of the object which caused the exception * \param lock The lock which could not be locked * \return An initialized lock failed exception */ - initWithClass: (Class)class_ lock: (id )lock; /** - * \param The lock which could not be locked + * \brief Returns the lock which could not be locked. + * + * \return The lock which could not be locked */ - (id )lock; @end Index: src/exceptions/OFMalformedXMLException.h ================================================================== --- src/exceptions/OFMalformedXMLException.h +++ src/exceptions/OFMalformedXMLException.h @@ -29,25 +29,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) OFXMLParser *parser; #endif /** + * \brief Creates a new, autoreleased malformed XML exception. + * + * \param class_ The class of the object which caused the exception * \param parser The parser which encountered malformed XML - * \return A new malformed XML exception + * \return A new, autoreleased malformed XML exception */ + (instancetype)exceptionWithClass: (Class)class_ parser: (OFXMLParser*)parser; /** - * Initializes an already allocated malformed XML exception. + * \brief Initializes an already allocated malformed XML exception. * + * \param class_ The class of the object which caused the exception * \param parser The parser which encountered malformed XML * \return An initialized malformed XML exception */ - initWithClass: (Class)class_ parser: (OFXMLParser*)parser; /** + * \brief Returns the parser which encountered malformed XML. + * * \return The parser which encountered malformed XML */ - (OFXMLParser*)parser; @end Index: src/exceptions/OFMemoryNotPartOfObjectException.h ================================================================== --- src/exceptions/OFMemoryNotPartOfObjectException.h +++ src/exceptions/OFMemoryNotPartOfObjectException.h @@ -27,27 +27,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly) void *pointer; #endif /** + * \brief Creates a new, autoreleased 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 A new memory not part of object exception + * \return A new, autoreleased memory not part of object exception */ + (instancetype)exceptionWithClass: (Class)class_ pointer: (void*)ptr; /** - * Initializes an already allocated memory not part of object exception. + * \brief 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_ pointer: (void*)ptr; /** + * \brief Returns a pointer to the memory which is not part of the object. + * * \return A pointer to the memory which is not part of the object */ - (void*)pointer; @end Index: src/exceptions/OFNotConnectedException.h ================================================================== --- src/exceptions/OFNotConnectedException.h +++ src/exceptions/OFNotConnectedException.h @@ -29,27 +29,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) OFStreamSocket *socket; #endif /** + * \brief Creates a new, autoreleased not connected exception. + * * \param class_ The class of the object which caused the exception * \param socket The socket which is not connected - * \return A new not connected exception + * \return A new, autoreleased not connected exception */ + (instancetype)exceptionWithClass: (Class)class_ socket: (OFStreamSocket*)socket; /** - * Initializes an already allocated not connected exception. + * \brief Initializes an already allocated not connected exception. * * \param class_ The class of the object which caused the exception * \param socket The socket which is not connected * \return An initialized not connected exception */ - initWithClass: (Class)class_ socket: (OFStreamSocket*)socket; /** + * \brief Returns the socket which is not connected. + * * \return The socket which is not connected */ - (OFStreamSocket*)socket; @end Index: src/exceptions/OFNotImplementedException.h ================================================================== --- src/exceptions/OFNotImplementedException.h +++ src/exceptions/OFNotImplementedException.h @@ -28,27 +28,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly) SEL selector; #endif /** + * \brief Creates a new, autoreleased 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 A new not implemented exception + * \return A new, autoreleased not implemented exception */ + (instancetype)exceptionWithClass: (Class)class_ selector: (SEL)selector; /** - * Initializes an already allocated not implemented exception. + * \brief 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_ selector: (SEL)selector; /** + * \brief Returns the selector which is not or not fully implemented. + * * \return The selector which is not or not fully implemented */ - (SEL)selector; @end Index: src/exceptions/OFOpenFileFailedException.h ================================================================== --- src/exceptions/OFOpenFileFailedException.h +++ src/exceptions/OFOpenFileFailedException.h @@ -31,21 +31,23 @@ @property (readonly, copy, nonatomic) OFString *mode; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased open file failed exception. + * * \param class_ The class of the object which caused the exception * \param path A string with the path of the file tried to open * \param mode A string with the mode in which the file should have been opened - * \return A new open file failed exception + * \return A new, autoreleased open file failed exception */ + (instancetype)exceptionWithClass: (Class)class_ path: (OFString*)path mode: (OFString*)mode; /** - * Initializes an already allocated open file failed exception. + * \brief Initializes an already allocated open file failed exception. * * \param class_ The class of the object which caused the exception * \param path A string with the path of the file which couldn't be opened * \param mode A string with the mode in which the file should have been opened * \return An initialized open file failed exception @@ -53,19 +55,26 @@ - initWithClass: (Class)class_ path: (OFString*)path mode: (OFString*)mode; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; /** + * \brief Returns a string with the path of the file which couldn't be opened. + * * \return A string with the path of the file which couldn't be opened */ - (OFString*)path; /** + * \brief Returns a string with the mode in which the file should have been + * opened. + * * \return A string with the mode in which the file should have been opened */ - (OFString*)mode; @end Index: src/exceptions/OFOutOfMemoryException.h ================================================================== --- src/exceptions/OFOutOfMemoryException.h +++ src/exceptions/OFOutOfMemoryException.h @@ -27,27 +27,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly) size_t requestedSize; #endif /** + * \brief Creates a new, autoreleased 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 A new no memory exception + * \return A new, autoreleased no memory exception */ + (instancetype)exceptionWithClass: (Class)class_ requestedSize: (size_t)size; /** - * Initializes an already allocated no memory exception. + * \brief 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_ requestedSize: (size_t)size; /** + * \brief Returns the size of the memoory that couldn't be allocated. + * * \return The size of the memoory that couldn't be allocated */ - (size_t)requestedSize; @end Index: src/exceptions/OFReadOrWriteFailedException.h ================================================================== --- src/exceptions/OFReadOrWriteFailedException.h +++ src/exceptions/OFReadOrWriteFailedException.h @@ -34,22 +34,24 @@ @property (readonly) size_t requestedLength; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased read or write failed exception. + * * \param class_ The class of the object which caused the exception * \param stream The stream which caused the read or write failed exception * \param length The requested length of the data that couldn't be read / * written - * \return A new open file failed exception + * \return A new, autoreleased read or write failed exception */ + (instancetype)exceptionWithClass: (Class)class_ stream: (OFStream*)stream requestedLength: (size_t)length; /** - * Initializes an already allocated read or write failed exception. + * \brief Initializes an already allocated read or write failed exception. * * \param class_ The class of the object which caused the exception * \param stream The stream which caused the read or write failed exception * \param length The requested length of the data that couldn't be read / * written @@ -58,19 +60,26 @@ - initWithClass: (Class)class_ stream: (OFStream*)stream requestedLength: (size_t)length; /** + * \brief Returns the stream which caused the read or write failed exception. + * * \return The stream which caused the read or write failed exception */ - (OFStream*)stream; /** + * \brief Returns the requested length of the data that couldn't be read / + * written. + * * \return The requested length of the data that couldn't be read / written */ - (size_t)requestedLength; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; @end Index: src/exceptions/OFRenameFileFailedException.h ================================================================== --- src/exceptions/OFRenameFileFailedException.h +++ src/exceptions/OFRenameFileFailedException.h @@ -31,21 +31,23 @@ @property (readonly, copy, nonatomic) OFString *destinationPath; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased rename file failed exception. + * * \param class_ The class of the object which caused the exception * \param source The original path * \param destination The new path - * \return A new rename file failed exception + * \return A new, autoreleased rename file failed exception */ + (instancetype)exceptionWithClass: (Class)class_ sourcePath: (OFString*)source destinationPath: (OFString*)destination; /** - * Initializes an already allocated rename failed exception. + * \brief Initializes an already allocated rename failed exception. * * \param class_ The class of the object which caused the exception * \param source The original path * \param destination The new path * \return An initialized rename file failed exception @@ -53,19 +55,25 @@ - initWithClass: (Class)class_ sourcePath: (OFString*)source destinationPath: (OFString*)destination; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; /** + * \brief Returns the original path. + * * \return The original path */ - (OFString*)sourcePath; /** + * \brief Returns the new path. + * * \return The new path */ - (OFString*)destinationPath; @end Index: src/exceptions/OFSeekFailedException.h ================================================================== --- src/exceptions/OFSeekFailedException.h +++ src/exceptions/OFSeekFailedException.h @@ -37,23 +37,27 @@ @property (readonly) int whence; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased seek failed exception. + * + * \param class_ The class of the object which caused the exception * \param stream The stream for which seeking failed * \param offset The offset to which seeking failed * \param whence To what the offset is relative - * \return A new seek failed exception + * \return A new, autoreleased seek failed exception */ + (instancetype)exceptionWithClass: (Class)class_ stream: (OFSeekableStream*)stream offset: (off_t)offset whence: (int)whence; /** - * Initializes an already allocated seek failed exception. + * \brief Initializes an already allocated seek failed exception. * + * \param class_ The class of the object which caused the exception * \param stream The stream for which seeking failed * \param offset The offset to which seeking failed * \param whence To what the offset is relative * \return An initialized seek failed exception */ @@ -61,24 +65,32 @@ stream: (OFSeekableStream*)stream offset: (off_t)offset whence: (int)whence; /** + * \brief Returns the stream for which seeking failed. + * * \return The stream for which seeking failed */ - (OFSeekableStream*)stream; /** + * \brief Returns the offset to which seeking failed. + * * \return The offset to which seeking failed */ - (off_t)offset; /** + * \brief Returns to what the offset is relative. + * * \return To what the offset is relative */ - (int)whence; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; @end Index: src/exceptions/OFSetOptionFailedException.h ================================================================== --- src/exceptions/OFSetOptionFailedException.h +++ src/exceptions/OFSetOptionFailedException.h @@ -29,25 +29,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) OFStream *stream; #endif /** + * \brief Creates a new, autoreleased set option failed exception. + * + * \param class_ The class of the object which caused the exception * \param stream The stream for which the option could not be set - * \return A new set option failed exception + * \return A new, autoreleased set option failed exception */ + (instancetype)exceptionWithClass: (Class)class_ stream: (OFStream*)stream; /** - * Initializes an already allocated set option failed exception. + * \brief Initializes an already allocated set option failed exception. * + * \param class_ The class of the object which caused the exception * \param stream The stream for which the option could not be set * \return An initialized set option failed exception */ - initWithClass: (Class)class_ stream: (OFStream*)stream; /** + * \brief Returns the stream for which the option could not be set. + * * \return The stream for which the option could not be set */ - (OFStream*)stream; @end Index: src/exceptions/OFStillLockedException.h ================================================================== --- src/exceptions/OFStillLockedException.h +++ src/exceptions/OFStillLockedException.h @@ -28,27 +28,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) id lock; #endif /** + * \brief Creates a new, autoreleased still locked exception. + * * \param class_ The class of the object which caused the exception * \param lock The lock which is still locked - * \return A new still locked exception + * \return A new, autoreleased still locked exception */ + (instancetype)exceptionWithClass: (Class)class_ lock: (id )lock; /** - * Initializes an already allocated still locked exception. + * \brief Initializes an already allocated still locked exception. * * \param class_ The class of the object which caused the exception * \param lock The lock which is still locked * \return An initialized still locked exception */ - initWithClass: (Class)class_ lock: (id )lock; /** + * \brief Returns the lock which is still locked. + * * \return The lock which is still locked */ - (id )lock; @end Index: src/exceptions/OFSymlinkFailedException.h ================================================================== --- src/exceptions/OFSymlinkFailedException.h +++ src/exceptions/OFSymlinkFailedException.h @@ -32,21 +32,23 @@ @property (readonly, copy, nonatomic) OFString *destinationPath; @property (readonly) int errNo; #endif /** + * \brief Creates a new, autoreleased symlink failed exception. + * * \param class_ The class of the object which caused the exception * \param source The source for the symlink * \param destination The destination for the symlink - * \return A new symlink failed exception + * \return A new, autoreleased symlink failed exception */ + (instancetype)exceptionWithClass: (Class)class_ sourcePath: (OFString*)source destinationPath: (OFString*)destination; /** - * Initializes an already allocated symlink failed exception. + * \brief Initializes an already allocated symlink failed exception. * * \param class_ The class of the object which caused the exception * \param source The source for the symlink * \param destination The destination for the symlink * \return An initialized symlink failed exception @@ -54,20 +56,26 @@ - initWithClass: (Class)class_ sourcePath: (OFString*)source destinationPath: (OFString*)destination; /** + * \brief Returns the errno from when the exception was created. + * * \return The errno from when the exception was created */ - (int)errNo; /** + * \brief Returns a string with the source for the symlink. + * * \return A string with the source for the symlink */ - (OFString*)sourcePath; /** + * \brief Returns a string with the destination for the symlink. + * * \return A string with the destination for the symlink */ - (OFString*)destinationPath; @end #endif Index: src/exceptions/OFThreadJoinFailedException.h ================================================================== --- src/exceptions/OFThreadJoinFailedException.h +++ src/exceptions/OFThreadJoinFailedException.h @@ -29,27 +29,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) OFThread *thread; #endif /** + * \brief Creates a new, autoreleased thread join failed exception. + * * \param class_ The class of the object which caused the exception * \param thread The thread which could not be joined - * \return A new thread join failed exception + * \return A new, autoreleased thread join failed exception */ + (instancetype)exceptionWithClass: (Class)class_ thread: (OFThread*)thread; /** - * Initializes an already allocated thread join failed exception. + * \brief Initializes an already allocated thread join failed exception. * * \param class_ The class of the object which caused the exception * \param thread The thread which could not be joined * \return An initialized thread join failed exception */ - initWithClass: (Class)class_ thread: (OFThread*)thread; /** + * \brief Returns the thread which could not be joined. + * * \return The thread which could not be joined */ - (OFThread*)thread; @end Index: src/exceptions/OFThreadStartFailedException.h ================================================================== --- src/exceptions/OFThreadStartFailedException.h +++ src/exceptions/OFThreadStartFailedException.h @@ -29,27 +29,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) OFThread *thread; #endif /** + * \brief Creates a new, autoreleased thread start failed exception. + * * \param class_ The class of the object which caused the exception * \param thread The thread which could not be started - * \return An initialized thread start failed exception + * \return A new, autoreleased thread start failed exception */ + (instancetype)exceptionWithClass: (Class)class_ thread: (OFThread*)thread; /** - * Initializes an already allocated thread start failed exception. + * \brief Initializes an already allocated thread start failed exception. * * \param class_ The class of the object which caused the exception * \param thread The thread which could not be started * \return An initialized thread start failed exception */ - initWithClass: (Class)class_ thread: (OFThread*)thread; /** + * \brief Returns the thread which could not be started. + * * \return The thread which could not be started */ - (OFThread*)thread; @end Index: src/exceptions/OFThreadStillRunningException.h ================================================================== --- src/exceptions/OFThreadStillRunningException.h +++ src/exceptions/OFThreadStillRunningException.h @@ -29,27 +29,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) OFThread *thread; #endif /** + * \brief Creates a new, autoreleased thread still running exception. + * * \param class_ The class of the object which caused the exception * \param thread The thread which is still running - * \return A new thread still running exception + * \return A new, autoreleased thread still running exception */ + (instancetype)exceptionWithClass: (Class)class_ thread: (OFThread*)thread; /** - * Initializes an already allocated thread still running exception. + * \brief Initializes an already allocated thread still running exception. * * \param class_ The class of the object which caused the exception * \param thread The thread which is still running * \return An initialized thread still running exception */ - initWithClass: (Class)class_ thread: (OFThread*)thread; /** + * \brief Returns the thread which is still running. + * * \return The thread which is still running */ - (OFThread*)thread; @end Index: src/exceptions/OFUnboundNamespaceException.h ================================================================== --- src/exceptions/OFUnboundNamespaceException.h +++ src/exceptions/OFUnboundNamespaceException.h @@ -29,50 +29,58 @@ @property (readonly, copy, nonatomic, getter=namespace) OFString *ns; @property (readonly, copy, nonatomic) OFString *prefix; #endif /** + * \brief Creates a new, autoreleased unbound namespace exception. + * * \param class_ The class of the object which caused the exception * \param ns The namespace which is unbound - * \return A new unbound namespace exception + * \return A new, autoreleased unbound namespace exception */ + (instancetype)exceptionWithClass: (Class)class_ namespace: (OFString*)ns; /** + * \brief Creates a new, autoreleased unbound namespace exception. + * * \param class_ The class of the object which caused the exception * \param prefix The prefix which is unbound - * \return A new unbound namespace exception + * \return A new, autoreleased unbound namespace exception */ + (instancetype)exceptionWithClass: (Class)class_ prefix: (OFString*)prefix; /** - * Initializes an already allocated unbound namespace exception + * \brief Initializes an already allocated unbound namespace exception. * * \param class_ The class of the object which caused the exception * \param ns The namespace which is unbound * \return An initialized unbound namespace exception */ - initWithClass: (Class)class_ namespace: (OFString*)ns; /** - * Initializes an already allocated unbound namespace exception + * \brief Initializes an already allocated unbound namespace exception. * * \param class_ The class of the object which caused the exception * \param prefix The prefix which is unbound * \return An initialized unbound namespace exception */ - initWithClass: (Class)class_ prefix: (OFString*)prefix; /** + * \brief Returns the unbound namespace. + * * \return The unbound namespace */ - (OFString*)namespace; /** + * \brief Returns the unbound prefix. + * * \return The unbound prefix */ - (OFString*)prefix; @end Index: src/exceptions/OFUnlockFailedException.h ================================================================== --- src/exceptions/OFUnlockFailedException.h +++ src/exceptions/OFUnlockFailedException.h @@ -28,27 +28,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) id lock; #endif /** + * \brief Creates a new, autoreleased unlock failed exception. + * * \param class_ The class of the object which caused the exception * \param lock The lock which could not be unlocked - * \return A new unlock failed exception + * \return A new, autoreleased unlock failed exception */ + (instancetype)exceptionWithClass: (Class)class_ lock: (id )lock; /** - * Initializes an already allocated unlock failed exception. + * \brief Initializes an already allocated unlock failed exception. * * \param class_ The class of the object which caused the exception * \param lock The lock which could not be unlocked * \return An initialized unlock failed exception */ - initWithClass: (Class)class_ lock: (id )lock; /** + * \brief Returns the lock which could not be unlocked. + * * \return The lock which could not be unlocked */ - (id )lock; @end Index: src/exceptions/OFUnsupportedProtocolException.h ================================================================== --- src/exceptions/OFUnsupportedProtocolException.h +++ src/exceptions/OFUnsupportedProtocolException.h @@ -30,27 +30,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, retain, nonatomic) OFURL *URL; #endif /** + * \brief Creates a new, autoreleased unsupported protocol exception. + * * \param class_ The class of the object which caused the exception * \param url The URL whose protocol is unsupported - * \return A new unsupported protocol exception + * \return A new, autoreleased unsupported protocol exception */ + (instancetype)exceptionWithClass: (Class)class_ URL: (OFURL*)url; /** - * Initializes an already allocated unsupported protocol exception + * \brief Initializes an already allocated unsupported protocol exception * * \param class_ The class of the object which caused the exception * \param url The URL whose protocol is unsupported * \return An initialized unsupported protocol exception */ - initWithClass: (Class)class_ URL: (OFURL*)url; /** + * \brief Returns the URL whose protocol is unsupported. + * * \return The URL whose protocol is unsupported */ - (OFURL*)URL; @end Index: src/exceptions/OFUnsupportedVersionException.h ================================================================== --- src/exceptions/OFUnsupportedVersionException.h +++ src/exceptions/OFUnsupportedVersionException.h @@ -28,27 +28,31 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, copy, nonatomic) OFString *version; #endif /** + * \brief Creates a new, autoreleased unsupported version exception. + * * \param class_ The class of the object which caused the exception * \param version The version which is unsupported - * \return A new unsupported version exception + * \return A new, autoreleased unsupported version exception */ + (instancetype)exceptionWithClass: (Class)class_ version: (OFString*)version; /** - * Initializes an already allocated unsupported protocol exception + * \brief Initializes an already allocated unsupported protocol exception. * * \param class_ The class of the object which caused the exception * \param version The version which is unsupported * \return An initialized unsupported version exception */ - initWithClass: (Class)class_ version: (OFString*)version; /** + * \brief Returns the version which is unsupported. + * * \return The version which is unsupported */ - (OFString*)version; @end Index: src/runtime/class.m ================================================================== --- src/runtime/class.m +++ src/runtime/class.m @@ -352,11 +352,11 @@ OBJC_ERROR("Not enough memory for load queue!"); } } } -inline Class +Class objc_lookup_class(const char *name) { Class cls = objc_classname_to_class(name); if (cls == NULL) Index: src/runtime/runtime.h ================================================================== --- src/runtime/runtime.h +++ src/runtime/runtime.h @@ -183,12 +183,10 @@ extern IMP objc_msg_lookup(id, SEL); extern IMP objc_msg_lookup_super(struct objc_super*, SEL); extern const char* protocol_getName(Protocol*); extern BOOL protocol_isEqual(Protocol*, Protocol*); extern BOOL protocol_conformsToProtocol(Protocol*, Protocol*); -extern void objc_thread_add(void); -extern void objc_thread_remove(void); extern void objc_exit(void); extern objc_uncaught_exception_handler objc_setUncaughtExceptionHandler( objc_uncaught_exception_handler); extern IMP (*objc_forward_handler)(id, SEL); extern id objc_constructInstance(Class, void*);