Comment: | Make it possible to disable sockets. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
590c377d8a61164272a1c2c6270c7041 |
User & Date: | js on 2013-04-26 19:42:52 |
Other Links: | manifest | tags |
2013-04-26
| ||
20:18 | Only build OFProcess if available. check-in: 9965b1550e user: js tags: trunk | |
19:42 | Make it possible to disable sockets. check-in: 590c377d8a user: js tags: trunk | |
2013-04-25
| ||
01:09 | OFSystemInfo: Fix fallback pageSize. check-in: 9c1da35543 user: js tags: trunk | |
Modified configure.ac from [1dac072c32] to [851bfdbc5a].
︙ | ︙ | |||
569 570 571 572 573 574 575 | AC_MSG_CHECKING(for atomic operations) AS_IF([test x"$atomic_ops" != x"none"], [ AC_DEFINE(OF_HAVE_ATOMIC_OPS, 1, [Whether we have atomic operations]) AC_SUBST(ATOMIC_H, "atomic.h") ]) AC_MSG_RESULT($atomic_ops) | < < < < > > > > > > > > > > | 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 | AC_MSG_CHECKING(for atomic operations) AS_IF([test x"$atomic_ops" != x"none"], [ AC_DEFINE(OF_HAVE_ATOMIC_OPS, 1, [Whether we have atomic operations]) AC_SUBST(ATOMIC_H, "atomic.h") ]) AC_MSG_RESULT($atomic_ops) AC_CHECK_FUNC(gmtime_r, [ AC_DEFINE(HAVE_GMTIME_R, 1, [Whether we have gmtime_r]) ]) AC_CHECK_FUNC(localtime_r, [ AC_DEFINE(HAVE_LOCALTIME_R, 1, [Whether we have localtime_r]) ]) AC_ARG_ENABLE(sockets, AS_HELP_STRING([--disable-sockets], [disable socket support])) AS_IF([test x"$enable_sockets" != x"no"], [ AC_DEFINE(OF_HAVE_SOCKETS, 1, [Whether we have sockets]) AC_SUBST(USE_SRCS_SOCKETS, '${SRCS_SOCKETS}') AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket") AC_CHECK_LIB(network, socket, LIBS="$LIBS -lnetwork") AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32") AC_CHECK_FUNC(kqueue, [ AC_DEFINE(HAVE_KQUEUE, 1, [Whether we have kqueue]) AC_SUBST(OFSTREAMOBSERVER_KQUEUE_M, "OFStreamObserver_kqueue.m") ]) AC_CHECK_HEADER(poll.h, [ AC_DEFINE(HAVE_POLL_H, 1, [Whether we have poll.h]) AC_SUBST(OFSTREAMOBSERVER_POLL_M, "OFStreamObserver_poll.m") |
︙ | ︙ | |||
647 648 649 650 651 652 653 | have_threadsafe_getaddrinfo="yes" ;; *) have_threadsafe_getaddrinfo="unknown" ;; esac | | > | 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 | have_threadsafe_getaddrinfo="yes" ;; *) have_threadsafe_getaddrinfo="unknown" ;; esac AS_IF([test x"$have_threadsafe_getaddrinfo" = \ x"unknown"], [ AC_EGREP_CPP(yes, [ #ifndef _WIN32 # include <sys/types.h> # include <sys/socket.h> # include <netdb.h> #else # define _WIN32_WINNT 0x0501 |
︙ | ︙ | |||
679 680 681 682 683 684 685 686 687 688 689 690 691 692 | ]) AC_MSG_RESULT($have_threadsafe_getaddrinfo) ]) ], [ AC_MSG_RESULT(no) ]) AS_IF([test x"$objc_runtime" = x"Apple runtime"], [ AC_CHECK_HEADER(Foundation/NSObject.h, [ AC_SUBST(FOUNDATION_COMPAT_M, "foundation-compat.m") AC_SUBST(BRIDGE, "bridge") AS_IF([test x"$enable_shared" != x"no"], [ | > > > > > | 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 | ]) AC_MSG_RESULT($have_threadsafe_getaddrinfo) ]) ], [ AC_MSG_RESULT(no) ]) ]) AS_IF([test x"$enable_sockets" != x"no" -a x"$enable_threads" != x"no"], [ AC_SUBST(OFHTTPCLIENTTESTS_M, "OFHTTPClientTests.m") ]) AS_IF([test x"$objc_runtime" = x"Apple runtime"], [ AC_CHECK_HEADER(Foundation/NSObject.h, [ AC_SUBST(FOUNDATION_COMPAT_M, "foundation-compat.m") AC_SUBST(BRIDGE, "bridge") AS_IF([test x"$enable_shared" != x"no"], [ |
︙ | ︙ |
Modified extra.mk.in from [ee1481108e] to [48485659ad].
︙ | ︙ | |||
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | EXCEPTIONS_EXCEPTIONS_LIB_A = @EXCEPTIONS_EXCEPTIONS_LIB_A@ EXCEPTIONS_LIB_A = @EXCEPTIONS_LIB_A@ FORWARDING_S = @FORWARDING_S@ FOUNDATION_COMPAT_M = @FOUNDATION_COMPAT_M@ INSTANCE_M = @INSTANCE_M@ LOOKUP_S = @LOOKUP_S@ OFBLOCKTESTS_M = @OFBLOCKTESTS_M@ OFSTREAMOBSERVER_KQUEUE_M = @OFSTREAMOBSERVER_KQUEUE_M@ OFSTREAMOBSERVER_POLL_M = @OFSTREAMOBSERVER_POLL_M@ OFSTREAMOBSERVER_SELECT_M = @OFSTREAMOBSERVER_SELECT_M@ PROPERTIESTESTS_M = @PROPERTIESTESTS_M@ REEXPORT_LIBOBJC = @REEXPORT_LIBOBJC@ RUNTIME = @RUNTIME@ RUNTIME_A = @RUNTIME_A@ RUNTIME_RUNTIME_A = @RUNTIME_RUNTIME_A@ RUNTIME_RUNTIME_LIB_A = @RUNTIME_RUNTIME_LIB_A@ RUNTIME_LIB_A = @RUNTIME_LIB_A@ TESTPLUGIN = @TESTPLUGIN@ TESTS = @TESTS@ TEST_LAUNCHER = @TEST_LAUNCHER@ USE_INCLUDES_THREADS = @USE_INCLUDES_THREADS@ USE_SRCS_PLUGINS = @USE_SRCS_PLUGINS@ USE_SRCS_THREADS = @USE_SRCS_THREADS@ | > > | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | EXCEPTIONS_EXCEPTIONS_LIB_A = @EXCEPTIONS_EXCEPTIONS_LIB_A@ EXCEPTIONS_LIB_A = @EXCEPTIONS_LIB_A@ FORWARDING_S = @FORWARDING_S@ FOUNDATION_COMPAT_M = @FOUNDATION_COMPAT_M@ INSTANCE_M = @INSTANCE_M@ LOOKUP_S = @LOOKUP_S@ OFBLOCKTESTS_M = @OFBLOCKTESTS_M@ OFHTTPCLIENTTESTS_M = @OFHTTPCLIENTTESTS_M@ OFSTREAMOBSERVER_KQUEUE_M = @OFSTREAMOBSERVER_KQUEUE_M@ OFSTREAMOBSERVER_POLL_M = @OFSTREAMOBSERVER_POLL_M@ OFSTREAMOBSERVER_SELECT_M = @OFSTREAMOBSERVER_SELECT_M@ PROPERTIESTESTS_M = @PROPERTIESTESTS_M@ REEXPORT_LIBOBJC = @REEXPORT_LIBOBJC@ RUNTIME = @RUNTIME@ RUNTIME_A = @RUNTIME_A@ RUNTIME_RUNTIME_A = @RUNTIME_RUNTIME_A@ RUNTIME_RUNTIME_LIB_A = @RUNTIME_RUNTIME_LIB_A@ RUNTIME_LIB_A = @RUNTIME_LIB_A@ TESTPLUGIN = @TESTPLUGIN@ TESTS = @TESTS@ TEST_LAUNCHER = @TEST_LAUNCHER@ USE_INCLUDES_THREADS = @USE_INCLUDES_THREADS@ USE_SRCS_PLUGINS = @USE_SRCS_PLUGINS@ USE_SRCS_SOCKETS = @USE_SRCS_SOCKETS@ USE_SRCS_THREADS = @USE_SRCS_THREADS@ |
Modified src/Makefile from [ba9ed93830] to [8e894e6dc5].
︙ | ︙ | |||
17 18 19 20 21 22 23 | OFDataArray.m \ OFDataArray+BinaryPackValue.m \ OFDataArray+Hashing.m \ OFDate.m \ OFDictionary.m \ OFEnumerator.m \ OFFile.m \ | < < < < < < < > > > > > > > > | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | OFDataArray.m \ OFDataArray+BinaryPackValue.m \ OFDataArray+Hashing.m \ OFDate.m \ OFDictionary.m \ OFEnumerator.m \ OFFile.m \ OFIntrospection.m \ OFList.m \ OFMapTable.m \ OFMD5Hash.m \ OFMutableArray.m \ OFMutableDictionary.m \ OFMutableSet.m \ OFMutableString.m \ OFNull.m \ OFNumber.m \ OFObject.m \ OFObject+Serialization.m \ OFProcess.m \ OFRunLoop.m \ OFSeekableStream.m \ OFSet.m \ OFSHA1Hash.m \ OFSortedList.m \ OFStream.m \ OFString.m \ OFString+Hashing.m \ OFString+JSONValue.m \ OFString+Serialization.m \ OFString+URLEncoding.m \ OFString+XMLEscaping.m \ OFString+XMLUnescaping.m \ OFSystemInfo.m \ OFTimer.m \ OFURL.m \ OFXMLAttribute.m \ OFXMLCDATA.m \ OFXMLCharacters.m \ OFXMLComment.m \ OFXMLElement.m \ OFXMLElement+Serialization.m \ OFXMLElementBuilder.m \ OFXMLNode.m \ OFXMLParser.m \ OFXMLProcessingInstructions.m \ base64.m \ of_asprintf.m \ of_strptime.m \ unicode.m \ ${USE_SRCS_PLUGINS} \ ${USE_SRCS_SOCKETS} \ ${USE_SRCS_THREADS} SRCS_PLUGINS = OFPlugin.m SRCS_SOCKETS = OFHTTPClient.m \ OFHTTPRequest.m \ OFHTTPRequestReply.m \ OFHTTPServer.m \ OFStreamObserver.m \ OFStreamSocket.m \ OFTCPSocket.m SRCS_THREADS = OFCondition.m \ OFMutex.m \ OFRecursiveMutex.m \ OFThread.m \ OFThreadPool.m \ OFTLSKey.m |
︙ | ︙ | |||
107 108 109 110 111 112 113 | OFCountedSet_hashtable.m \ OFDictionary_hashtable.m \ OFMutableArray_adjacent.m \ OFMutableDictionary_hashtable.m \ OFMutableSet_hashtable.m \ OFMutableString_UTF8.m \ OFSet_hashtable.m \ | < < < < > > > > | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | OFCountedSet_hashtable.m \ OFDictionary_hashtable.m \ OFMutableArray_adjacent.m \ OFMutableDictionary_hashtable.m \ OFMutableSet_hashtable.m \ OFMutableString_UTF8.m \ OFSet_hashtable.m \ OFString_UTF8.m \ ${ASPRINTF_M} \ ${FORWARDING_S} \ ${FOUNDATION_COMPAT_M} \ iso_8859_15.m \ windows_1252.m SRCS_SOCKETS += ${OFSTREAMOBSERVER_KQUEUE_M} \ ${OFSTREAMOBSERVER_POLL_M} \ ${OFSTREAMOBSERVER_SELECT_M} \ OFTCPSocket+SOCKS5.m OBJS_EXTRA = ${EXCEPTIONS_EXCEPTIONS_A} ${RUNTIME_RUNTIME_A} LIB_OBJS_EXTRA = ${EXCEPTIONS_EXCEPTIONS_LIB_A} ${RUNTIME_RUNTIME_LIB_A} include ../buildsys.mk CPPFLAGS += -I. -I.. -Iexceptions -Iruntime LD = ${OBJC} LDFLAGS += ${REEXPORT_LIBOBJC} ${BRIDGE}: ${SHARED_LIB} |
Modified src/OFDataArray.m from [cc46586b15] to [fc3aaeaea9].
︙ | ︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #include <string.h> #include <limits.h> #import "OFDataArray.h" #import "OFString.h" #import "OFFile.h" #import "OFURL.h" #import "OFHTTPClient.h" #import "OFHTTPRequest.h" #import "OFHTTPRequestReply.h" #import "OFDictionary.h" #import "OFXMLElement.h" #import "OFSystemInfo.h" #import "OFHTTPRequestFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFTruncatedDataException.h" #import "autorelease.h" #import "base64.h" #import "macros.h" /* References for static linking */ void _references_to_categories_of_OFDataArray(void) | > > > > > | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | #include <string.h> #include <limits.h> #import "OFDataArray.h" #import "OFString.h" #import "OFFile.h" #import "OFURL.h" #ifdef OF_HAVE_SOCKETS #import "OFHTTPClient.h" #import "OFHTTPRequest.h" #import "OFHTTPRequestReply.h" #endif #import "OFDictionary.h" #import "OFXMLElement.h" #import "OFSystemInfo.h" #ifdef OF_HAVE_SOCKETS #import "OFHTTPRequestFailedException.h" #endif #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFTruncatedDataException.h" #import "OFUnsupportedProtocolException.h" #import "autorelease.h" #import "base64.h" #import "macros.h" /* References for static linking */ void _references_to_categories_of_OFDataArray(void) |
︙ | ︙ | |||
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | return self; } - initWithContentsOfURL: (OFURL*)URL { void *pool; OFHTTPClient *client; OFHTTPRequest *request; OFHTTPRequestReply *reply; OFDictionary *headers; OFString *contentLength; Class c; c = [self class]; [self release]; pool = objc_autoreleasePoolPush(); if ([[URL scheme] isEqual: @"file"]) { self = [[c alloc] initWithContentsOfFile: [URL path]]; objc_autoreleasePoolPop(pool); return self; } client = [OFHTTPClient client]; | > > > | 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | return self; } - initWithContentsOfURL: (OFURL*)URL { void *pool; #ifdef OF_HAVE_SOCKETS OFHTTPClient *client; OFHTTPRequest *request; OFHTTPRequestReply *reply; OFDictionary *headers; OFString *contentLength; #endif Class c; c = [self class]; [self release]; pool = objc_autoreleasePoolPush(); #ifdef OF_HAVE_SOCKETS if ([[URL scheme] isEqual: @"file"]) { self = [[c alloc] initWithContentsOfFile: [URL path]]; objc_autoreleasePoolPop(pool); return self; } client = [OFHTTPClient client]; |
︙ | ︙ | |||
198 199 200 201 202 203 204 205 206 207 208 209 210 211 | self = [[reply readDataArrayTillEndOfStream] retain]; headers = [reply headers]; if ((contentLength = [headers objectForKey: @"Content-Length"]) != nil) if ([self count] != (size_t)[contentLength decimalValue]) @throw [OFTruncatedDataException exceptionWithClass: [self class]]; objc_autoreleasePoolPop(pool); return self; } - initWithStringRepresentation: (OFString*)string | > > > | 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | self = [[reply readDataArrayTillEndOfStream] retain]; headers = [reply headers]; if ((contentLength = [headers objectForKey: @"Content-Length"]) != nil) if ([self count] != (size_t)[contentLength decimalValue]) @throw [OFTruncatedDataException exceptionWithClass: [self class]]; #else @throw [OFUnsupportedProtocolException exceptionWithClass: c]; #endif objc_autoreleasePoolPop(pool); return self; } - initWithStringRepresentation: (OFString*)string |
︙ | ︙ |
Modified src/OFHTTPClient.h from [838f77c97e] to [630572f8e2].
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" @class OFHTTPClient; @class OFHTTPRequest; @class OFHTTPRequestReply; @class OFURL; @class OFTCPSocket; @class OFDictionary; | > > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFHTTPClient; @class OFHTTPRequest; @class OFHTTPRequestReply; @class OFURL; @class OFTCPSocket; @class OFDictionary; |
︙ | ︙ |
Modified src/OFHTTPRequest.h from [f26f1fecd0] to [daf0e520ee].
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" @class OFURL; @class OFDictionary; @class OFDataArray; @class OFString; /*! @file */ | > > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFURL; @class OFDictionary; @class OFDataArray; @class OFString; /*! @file */ |
︙ | ︙ |
Modified src/OFHTTPRequestReply.h from [bdd473d229] to [274b2bd401].
︙ | ︙ | |||
12 13 14 15 16 17 18 19 20 21 22 23 24 25 | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFStream.h" #import "OFHTTPRequest.h" @class OFDictionary; /*! * @brief A class for representing an HTTP request reply as a stream. */ @interface OFHTTPRequestReply: OFStream | > > > > | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFStream.h" #import "OFHTTPRequest.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFDictionary; /*! * @brief A class for representing an HTTP request reply as a stream. */ @interface OFHTTPRequestReply: OFStream |
︙ | ︙ |
Modified src/OFHTTPServer.h from [ffe70c28fb] to [6142f7e628].
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" @class OFHTTPServer; @class OFHTTPRequest; @class OFHTTPRequestReply; @class OFTCPSocket; @class OFException; | > > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFHTTPServer; @class OFHTTPRequest; @class OFHTTPRequestReply; @class OFTCPSocket; @class OFException; |
︙ | ︙ |
Modified src/OFRunLoop.h from [af319d727b] to [879bd22002].
︙ | ︙ | |||
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #import "OFStream.h" #import "OFTCPSocket.h" @class OFSortedList; #ifdef OF_HAVE_THREADS @class OFMutex; #endif @class OFTimer; @class OFMutableDictionary; @class OFStreamObserver; /*! * @brief A class providing a run loop for the application and its processes. */ @interface OFRunLoop: OFObject { OFSortedList *_timersQueue; #ifdef OF_HAVE_THREADS OFMutex *_timersQueueLock; #endif OFStreamObserver *_streamObserver; OFMutableDictionary *_readQueues; volatile bool _running; } /*! * @brief Returns the main run loop. * * @return The main run loop */ + (OFRunLoop*)mainRunLoop; /*! * @brief Returns the run loop for the current thread. * * @return The run loop for the current thread */ + (OFRunLoop*)currentRunLoop; + (void)OF_setMainRunLoop: (OFRunLoop*)runLoop; + (void)OF_addAsyncReadForStream: (OFStream*)stream buffer: (void*)buffer length: (size_t)length target: (id)target selector: (SEL)selector; + (void)OF_addAsyncReadForStream: (OFStream*)stream buffer: (void*)buffer | > > > > > | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #import "OFStream.h" #ifdef OF_HAVE_SOCKETS #import "OFTCPSocket.h" #endif @class OFSortedList; #ifdef OF_HAVE_THREADS @class OFMutex; #endif @class OFTimer; @class OFMutableDictionary; @class OFStreamObserver; /*! * @brief A class providing a run loop for the application and its processes. */ @interface OFRunLoop: OFObject { OFSortedList *_timersQueue; #ifdef OF_HAVE_THREADS OFMutex *_timersQueueLock; #endif #ifdef OF_HAVE_SOCKETS OFStreamObserver *_streamObserver; OFMutableDictionary *_readQueues; #endif volatile bool _running; } /*! * @brief Returns the main run loop. * * @return The main run loop */ + (OFRunLoop*)mainRunLoop; /*! * @brief Returns the run loop for the current thread. * * @return The run loop for the current thread */ + (OFRunLoop*)currentRunLoop; + (void)OF_setMainRunLoop: (OFRunLoop*)runLoop; #ifdef OF_HAVE_SOCKETS + (void)OF_addAsyncReadForStream: (OFStream*)stream buffer: (void*)buffer length: (size_t)length target: (id)target selector: (SEL)selector; + (void)OF_addAsyncReadForStream: (OFStream*)stream buffer: (void*)buffer |
︙ | ︙ | |||
84 85 86 87 88 89 90 91 92 93 94 95 96 97 | + (void)OF_addAsyncReadLineForStream: (OFStream*)stream encoding: (of_string_encoding_t)encoding block: (of_stream_async_read_line_block_t)block; + (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket*)socket block: (of_tcpsocket_async_accept_block_t)block; #endif + (void)OF_cancelAsyncRequestsForStream: (OFStream*)stream; /*! * @brief Adds an OFTimer to the run loop. * * @param timer The timer to add */ - (void)addTimer: (OFTimer*)timer; | > | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | + (void)OF_addAsyncReadLineForStream: (OFStream*)stream encoding: (of_string_encoding_t)encoding block: (of_stream_async_read_line_block_t)block; + (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket*)socket block: (of_tcpsocket_async_accept_block_t)block; #endif + (void)OF_cancelAsyncRequestsForStream: (OFStream*)stream; #endif /*! * @brief Adds an OFTimer to the run loop. * * @param timer The timer to add */ - (void)addTimer: (OFTimer*)timer; |
︙ | ︙ |
Modified src/OFRunLoop.m from [9ced28ca2c] to [e463b5f0e9].
︙ | ︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #include "config.h" #include <assert.h> #import "OFRunLoop.h" #import "OFDictionary.h" #import "OFStreamObserver.h" #ifdef OF_HAVE_THREADS # import "OFThread.h" # import "OFMutex.h" #endif #import "OFSortedList.h" #import "OFTimer.h" #import "OFDate.h" #import "autorelease.h" #import "macros.h" static OFRunLoop *mainRunLoop = nil; @interface OFRunLoop_QueueItem: OFObject { @public id _target; SEL _selector; } @end | > > > | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #include "config.h" #include <assert.h> #import "OFRunLoop.h" #import "OFDictionary.h" #ifdef OF_HAVE_SOCKETS #import "OFStreamObserver.h" #endif #ifdef OF_HAVE_THREADS # import "OFThread.h" # import "OFMutex.h" #endif #import "OFSortedList.h" #import "OFTimer.h" #import "OFDate.h" #import "autorelease.h" #import "macros.h" static OFRunLoop *mainRunLoop = nil; #ifdef OF_HAVE_SOCKETS @interface OFRunLoop_QueueItem: OFObject { @public id _target; SEL _selector; } @end |
︙ | ︙ | |||
131 132 133 134 135 136 137 138 139 140 141 142 143 144 | { [_block release]; [super dealloc]; } #endif @end @implementation OFRunLoop + (OFRunLoop*)mainRunLoop { return [[mainRunLoop retain] autorelease]; } | > | 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | { [_block release]; [super dealloc]; } #endif @end #endif @implementation OFRunLoop + (OFRunLoop*)mainRunLoop { return [[mainRunLoop retain] autorelease]; } |
︙ | ︙ | |||
152 153 154 155 156 157 158 159 160 161 162 163 164 165 | } + (void)OF_setMainRunLoop: (OFRunLoop*)runLoop { mainRunLoop = [runLoop retain]; } #define ADD(type, code) \ void *pool = objc_autoreleasePoolPush(); \ OFRunLoop *runLoop = [self currentRunLoop]; \ OFList *queue = [runLoop->_readQueues objectForKey: stream]; \ type *queueItem; \ \ if (queue == nil) { \ | > | 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | } + (void)OF_setMainRunLoop: (OFRunLoop*)runLoop { mainRunLoop = [runLoop retain]; } #ifdef OF_HAVE_SOCKETS #define ADD(type, code) \ void *pool = objc_autoreleasePoolPush(); \ OFRunLoop *runLoop = [self currentRunLoop]; \ OFList *queue = [runLoop->_readQueues objectForKey: stream]; \ type *queueItem; \ \ if (queue == nil) { \ |
︙ | ︙ | |||
266 267 268 269 270 271 272 | block: (of_tcpsocket_async_accept_block_t)block { ADD(OFRunLoop_AcceptQueueItem, { queueItem->_block = [block copy]; }) } #endif | < > > > > > > > > > > > | 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 | block: (of_tcpsocket_async_accept_block_t)block { ADD(OFRunLoop_AcceptQueueItem, { queueItem->_block = [block copy]; }) } #endif #undef ADD + (void)OF_cancelAsyncRequestsForStream: (OFStream*)stream { void *pool = objc_autoreleasePoolPush(); OFRunLoop *runLoop = [self currentRunLoop]; OFList *queue; if ((queue = [runLoop->_readQueues objectForKey: stream]) != nil) { assert([queue count] > 0); [runLoop->_streamObserver removeStreamForReading: stream]; [runLoop->_readQueues removeObjectForKey: stream]; } objc_autoreleasePoolPop(pool); } #endif - init { self = [super init]; @try { _timersQueue = [[OFSortedList alloc] init]; #ifdef OF_HAVE_THREADS _timersQueueLock = [[OFMutex alloc] init]; #endif #ifdef OF_HAVE_SOCKETS _streamObserver = [[OFStreamObserver alloc] init]; [_streamObserver setDelegate: self]; _readQueues = [[OFMutableDictionary alloc] init]; #endif } @catch (id e) { [self release]; @throw e; } return self; } - (void)dealloc { [_timersQueue release]; #ifdef OF_HAVE_THREADS [_timersQueueLock release]; #endif #ifdef OF_HAVE_SOCKETS [_streamObserver release]; [_readQueues release]; #endif [super dealloc]; } - (void)addTimer: (OFTimer*)timer { #ifdef OF_HAVE_THREADS [_timersQueueLock lock]; @try { #endif [_timersQueue insertObject: timer]; #ifdef OF_HAVE_THREADS } @finally { [_timersQueueLock unlock]; } #endif [timer OF_setInRunLoop: self]; #ifdef OF_HAVE_SOCKETS [_streamObserver cancel]; #endif #if defined(OF_HAVE_THREADS) && !defined(OF_HAVE_SOCKETS) /* FIXME: No way to cancel waiting! What to do? */ #endif } - (void)OF_removeTimer: (OFTimer*)timer { #ifdef OF_HAVE_THREADS [_timersQueueLock lock]; @try { |
︙ | ︙ | |||
359 360 361 362 363 364 365 366 367 368 369 370 371 372 | #ifdef OF_HAVE_THREADS } @finally { [_timersQueueLock unlock]; } #endif } - (void)streamIsReadyForReading: (OFStream*)stream { OFList *queue = [_readQueues objectForKey: stream]; of_list_object_t *listObject; OF_ENSURE(queue != nil); | > | 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | #ifdef OF_HAVE_THREADS } @finally { [_timersQueueLock unlock]; } #endif } #ifdef OF_HAVE_SOCKETS - (void)streamIsReadyForReading: (OFStream*)stream { OFList *queue = [_readQueues objectForKey: stream]; of_list_object_t *listObject; OF_ENSURE(queue != nil); |
︙ | ︙ | |||
589 590 591 592 593 594 595 596 597 598 599 600 601 602 | } #ifdef OF_HAVE_BLOCKS } #endif } else OF_ENSURE(0); } - (void)run { _running = true; for (;;) { void *pool; | > | 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 | } #ifdef OF_HAVE_BLOCKS } #endif } else OF_ENSURE(0); } #endif - (void)run { _running = true; for (;;) { void *pool; |
︙ | ︙ | |||
652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 | #endif /* Watch for stream events until the next timer is due */ if (nextTimer != nil) { double timeout = [nextTimer timeIntervalSinceNow]; if (timeout > 0) [_streamObserver observeWithTimeout: timeout]; } else { /* * No more timers: Just watch for streams until we get * an event. If a timer is added by another thread, it * cancels the observe. */ [_streamObserver observe]; } objc_autoreleasePoolPop(pool); } } - (void)stop { _running = false; #ifdef OF_HAVE_THREADS of_memory_write_barrier(); #endif [_streamObserver cancel]; | > > > > > > > > > > | > > > > | 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 | #endif /* Watch for stream events until the next timer is due */ if (nextTimer != nil) { double timeout = [nextTimer timeIntervalSinceNow]; if (timeout > 0) #ifdef OF_HAVE_SOCKETS [_streamObserver observeWithTimeout: timeout]; #else [OFThread sleepForTimeInterval: timeout]; #endif } else { /* * No more timers: Just watch for streams until we get * an event. If a timer is added by another thread, it * cancels the observe. */ #ifdef OF_HAVE_SOCKETS [_streamObserver observe]; #else [OFThread sleepForTimeInterval: 86400]; #endif } objc_autoreleasePoolPop(pool); } } - (void)stop { _running = false; #ifdef OF_HAVE_THREADS of_memory_write_barrier(); #endif #ifdef OF_HAVE_SOCKETS [_streamObserver cancel]; #endif #if defined(OF_HAVE_THREADS) && !defined(OF_HAVE_SOCKETS) /* FIXME: No way to cancel waiting! What to do? */ #endif } @end |
Modified src/OFStream.h from [05795f4687] to [b114d5af52].
︙ | ︙ | |||
28 29 30 31 32 33 34 | /*! @file */ @class OFStream; @class OFDataArray; @class OFException; | | | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | /*! @file */ @class OFStream; @class OFDataArray; @class OFException; #if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_BLOCKS) /*! * @brief A block which is called when data was read from the stream. * * @param stream The stream on which data was read * @param buffer A buffer with the data that has been read * @param length The length of the data that has been read * @param exception An exception which occurred while reading or nil on success |
︙ | ︙ | |||
126 127 128 129 130 131 132 133 134 135 136 137 138 139 | * @param buffer The buffer into which the data is read * @param length The length of the data that should be read. * The buffer *must* be *at least* this big! */ - (void)readIntoBuffer: (void*)buffer exactLength: (size_t)length; /*! * @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 * @ref asyncReadIntoBuffer:exactLength:block:. Note that a read can even | > | 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | * @param buffer The buffer into which the data is read * @param length The length of the data that should be read. * The buffer *must* be *at least* this big! */ - (void)readIntoBuffer: (void*)buffer exactLength: (size_t)length; #ifdef OF_HAVE_SOCKETS /*! * @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 * @ref asyncReadIntoBuffer:exactLength:block:. Note that a read can even |
︙ | ︙ | |||
229 230 231 232 233 234 235 236 237 238 239 240 241 242 | * you want the next block in the queue to handle the data * received next, you need to return false from the block. */ - (void)asyncReadIntoBuffer: (void*)buffer exactLength: (size_t)length block: (of_stream_async_read_block_t)block; #endif /*! * @brief Reads a uint8_t from the stream. * * @warning Only call this when you know that enough data is available! * Otherwise you will get an exception! * | > | 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | * you want the next block in the queue to handle the data * received next, you need to return false from the block. */ - (void)asyncReadIntoBuffer: (void*)buffer exactLength: (size_t)length block: (of_stream_async_read_block_t)block; #endif #endif /*! * @brief Reads a uint8_t from the stream. * * @warning Only call this when you know that enough data is available! * Otherwise you will get an exception! * |
︙ | ︙ | |||
576 577 578 579 580 581 582 583 584 585 586 587 588 589 | * * @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. */ - (OFString*)readLineWithEncoding: (of_string_encoding_t)encoding; /*! * @brief Asyncronously reads until a newline, \\0, end of stream or an * exception occurs. * * @param target The target on which to call the selector when the data has * been received. If the method returns true, it will be called * again when the next line has been received. If you want the | > | 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 | * * @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. */ - (OFString*)readLineWithEncoding: (of_string_encoding_t)encoding; #ifdef OF_HAVE_SOCKETS /*! * @brief Asyncronously reads until a newline, \\0, end of stream or an * exception occurs. * * @param target The target on which to call the selector when the data has * been received. If the method returns true, it will be called * again when the next line has been received. If you want the |
︙ | ︙ | |||
637 638 639 640 641 642 643 644 645 646 647 648 649 650 | * line has been received. If you want the next block in the queue * to handle the next line, you need to return false from the * block. */ - (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding block: (of_stream_async_read_line_block_t)block; #endif /*! * @brief Tries to read a line from the stream (see readLine) and returns nil if * no complete line has been received yet. * * @return The line that was read, autoreleased, or nil if the line is not * complete yet | > | 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 | * line has been received. If you want the next block in the queue * to handle the next line, you need to return false from the * block. */ - (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding block: (of_stream_async_read_line_block_t)block; #endif #endif /*! * @brief Tries to read a line from the stream (see readLine) and returns nil if * no complete line has been received yet. * * @return The line that was read, autoreleased, or nil if the line is not * complete yet |
︙ | ︙ | |||
1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 | /*! * @brief Returns the file descriptor for the write end of the stream. * * @return The file descriptor for the write end of the stream */ - (int)fileDescriptorForWriting; /*! * @brief Cancels all pending asyncronous requests on the stream. */ - (void)cancelAsyncRequests; /*! * @brief Closes the stream. */ - (void)close; /*! | > > | 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 | /*! * @brief Returns the file descriptor for the write end of the stream. * * @return The file descriptor for the write end of the stream */ - (int)fileDescriptorForWriting; #ifdef OF_HAVE_SOCKETS /*! * @brief Cancels all pending asyncronous requests on the stream. */ - (void)cancelAsyncRequests; #endif /*! * @brief Closes the stream. */ - (void)close; /*! |
︙ | ︙ |
Modified src/OFStream.m from [401460f5bb] to [f3e5357ad2].
︙ | ︙ | |||
144 145 146 147 148 149 150 151 152 153 154 155 156 157 | size_t readLength = 0; while (readLength < length) readLength += [self readIntoBuffer: (char*)buffer + readLength length: length - readLength]; } - (void)asyncReadIntoBuffer: (void*)buffer length: (size_t)length target: (id)target selector: (SEL)selector { [OFRunLoop OF_addAsyncReadForStream: self buffer: buffer | > | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | size_t readLength = 0; while (readLength < length) readLength += [self readIntoBuffer: (char*)buffer + readLength length: length - readLength]; } #ifdef OF_HAVE_SOCKETS - (void)asyncReadIntoBuffer: (void*)buffer length: (size_t)length target: (id)target selector: (SEL)selector { [OFRunLoop OF_addAsyncReadForStream: self buffer: buffer |
︙ | ︙ | |||
189 190 191 192 193 194 195 196 197 198 199 200 201 202 | { [OFRunLoop OF_addAsyncReadForStream: self buffer: buffer exactLength: length block: block]; } #endif - (uint8_t)readInt8 { uint8_t ret; [self readIntoBuffer: (char*)&ret exactLength: 1]; | > | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | { [OFRunLoop OF_addAsyncReadForStream: self buffer: buffer exactLength: length block: block]; } #endif #endif - (uint8_t)readInt8 { uint8_t ret; [self readIntoBuffer: (char*)&ret exactLength: 1]; |
︙ | ︙ | |||
729 730 731 732 733 734 735 736 737 738 739 740 741 742 | while ((line = [self tryReadLineWithEncoding: encoding]) == nil) if ([self isAtEndOfStream]) return nil; return line; } - (void)asyncReadLineWithTarget: (id)target selector: (SEL)selector { [self asyncReadLineWithEncoding: OF_STRING_ENCODING_UTF_8 target: target selector: selector]; } | > | 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 | while ((line = [self tryReadLineWithEncoding: encoding]) == nil) if ([self isAtEndOfStream]) return nil; return line; } #ifdef OF_HAVE_SOCKETS - (void)asyncReadLineWithTarget: (id)target selector: (SEL)selector { [self asyncReadLineWithEncoding: OF_STRING_ENCODING_UTF_8 target: target selector: selector]; } |
︙ | ︙ | |||
762 763 764 765 766 767 768 769 770 771 772 773 774 775 | block: (of_stream_async_read_line_block_t)block { [OFRunLoop OF_addAsyncReadLineForStream: self encoding: encoding block: block]; } #endif - (OFString*)tryReadLine { return [self tryReadLineWithEncoding: OF_STRING_ENCODING_UTF_8]; } - (OFString*)tryReadTillDelimiter: (OFString*)delimiter | > | 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 | block: (of_stream_async_read_line_block_t)block { [OFRunLoop OF_addAsyncReadLineForStream: self encoding: encoding block: block]; } #endif #endif - (OFString*)tryReadLine { return [self tryReadLineWithEncoding: OF_STRING_ENCODING_UTF_8]; } - (OFString*)tryReadTillDelimiter: (OFString*)delimiter |
︙ | ︙ | |||
1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 | - (int)fileDescriptorForWriting { [self doesNotRecognizeSelector: _cmd]; abort(); } - (void)cancelAsyncRequests { [OFRunLoop OF_cancelAsyncRequestsForStream: self]; } - (void)close { [self doesNotRecognizeSelector: _cmd]; abort(); } - (bool)OF_isWaitingForDelimiter { return _waitingForDelimiter; } @end | > > | 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 | - (int)fileDescriptorForWriting { [self doesNotRecognizeSelector: _cmd]; abort(); } #ifdef OF_HAVE_SOCKETS - (void)cancelAsyncRequests { [OFRunLoop OF_cancelAsyncRequestsForStream: self]; } #endif - (void)close { [self doesNotRecognizeSelector: _cmd]; abort(); } - (bool)OF_isWaitingForDelimiter { return _waitingForDelimiter; } @end |
Modified src/OFStreamObserver.h from [4cd46fa418] to [7fc7495bc7].
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #ifdef _WIN32 # include <winsock2.h> #endif @class OFStream; @class OFMutableArray; | > > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif #ifdef _WIN32 # include <winsock2.h> #endif @class OFStream; @class OFMutableArray; |
︙ | ︙ |
Modified src/OFStreamSocket.h from [9529543da1] to [0eb6c65989].
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFStream.h" #ifdef _WIN32 # include <winsock2.h> #endif /*! * @brief A class which provides functions to create and use stream sockets. | > > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFStream.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif #ifdef _WIN32 # include <winsock2.h> #endif /*! * @brief A class which provides functions to create and use stream sockets. |
︙ | ︙ |
Modified src/OFString.m from [76e87b40ed] to [250db502f2].
︙ | ︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | #import "OFString.h" #import "OFString_UTF8.h" #import "OFArray.h" #import "OFDictionary.h" #import "OFFile.h" #import "OFURL.h" #import "OFHTTPClient.h" #import "OFHTTPRequest.h" #import "OFHTTPRequestReply.h" #import "OFDataArray.h" #import "OFXMLElement.h" #import "OFHTTPRequestFailedException.h" #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidEncodingException.h" #import "OFInvalidFormatException.h" #import "OFNotImplementedException.h" #import "OFOpenFileFailedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFTruncatedDataException.h" #import "autorelease.h" #import "macros.h" #import "of_asprintf.h" #import "unicode.h" /* | > > > > > | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | #import "OFString.h" #import "OFString_UTF8.h" #import "OFArray.h" #import "OFDictionary.h" #import "OFFile.h" #import "OFURL.h" #ifdef OF_HAVE_SOCKETS #import "OFHTTPClient.h" #import "OFHTTPRequest.h" #import "OFHTTPRequestReply.h" #endif #import "OFDataArray.h" #import "OFXMLElement.h" #ifdef OF_HAVE_SOCKETS #import "OFHTTPRequestFailedException.h" #endif #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidEncodingException.h" #import "OFInvalidFormatException.h" #import "OFNotImplementedException.h" #import "OFOpenFileFailedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFTruncatedDataException.h" #import "OFUnsupportedProtocolException.h" #import "autorelease.h" #import "macros.h" #import "of_asprintf.h" #import "unicode.h" /* |
︙ | ︙ | |||
903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 | encoding: OF_STRING_ENCODING_AUTODETECT]; } - initWithContentsOfURL: (OFURL*)URL encoding: (of_string_encoding_t)encoding { void *pool; OFHTTPClient *client; OFHTTPRequest *request; OFHTTPRequestReply *reply; OFDictionary *headers; OFString *contentType, *contentLength; OFDataArray *data; Class c; c = [self class]; [self release]; pool = objc_autoreleasePoolPush(); if ([[URL scheme] isEqual: @"file"]) { if (encoding == OF_STRING_ENCODING_AUTODETECT) encoding = OF_STRING_ENCODING_UTF_8; self = [[c alloc] initWithContentsOfFile: [URL path] encoding: encoding]; objc_autoreleasePoolPop(pool); return self; } client = [OFHTTPClient client]; request = [OFHTTPRequest requestWithURL: URL]; reply = [client performRequest: request]; if ([reply statusCode] != 200) @throw [OFHTTPRequestFailedException exceptionWithClass: [request class] | > > > | 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 | encoding: OF_STRING_ENCODING_AUTODETECT]; } - initWithContentsOfURL: (OFURL*)URL encoding: (of_string_encoding_t)encoding { void *pool; #ifdef OF_HAVE_SOCKETS OFHTTPClient *client; OFHTTPRequest *request; OFHTTPRequestReply *reply; OFDictionary *headers; OFString *contentType, *contentLength; OFDataArray *data; #endif Class c; c = [self class]; [self release]; pool = objc_autoreleasePoolPush(); if ([[URL scheme] isEqual: @"file"]) { if (encoding == OF_STRING_ENCODING_AUTODETECT) encoding = OF_STRING_ENCODING_UTF_8; self = [[c alloc] initWithContentsOfFile: [URL path] encoding: encoding]; objc_autoreleasePoolPop(pool); return self; } #ifdef OF_HAVE_SOCKETS client = [OFHTTPClient client]; request = [OFHTTPRequest requestWithURL: URL]; reply = [client performRequest: request]; if ([reply statusCode] != 200) @throw [OFHTTPRequestFailedException exceptionWithClass: [request class] |
︙ | ︙ | |||
965 966 967 968 969 970 971 972 973 974 975 976 977 978 | if ([data count] != (size_t)[contentLength decimalValue]) @throw [OFTruncatedDataException exceptionWithClass: [self class]]; self = [[c alloc] initWithCString: (char*)[data items] encoding: encoding length: [data count]]; objc_autoreleasePoolPop(pool); return self; } - initWithSerialization: (OFXMLElement*)element | > > > | 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 | if ([data count] != (size_t)[contentLength decimalValue]) @throw [OFTruncatedDataException exceptionWithClass: [self class]]; self = [[c alloc] initWithCString: (char*)[data items] encoding: encoding length: [data count]]; #else @throw [OFUnsupportedProtocolException exceptionWithClass: c]; #endif objc_autoreleasePoolPop(pool); return self; } - initWithSerialization: (OFXMLElement*)element |
︙ | ︙ |
Modified src/ObjFW.h from [409806974f] to [fbd2428681].
︙ | ︙ | |||
42 43 44 45 46 47 48 49 50 51 | #import "OFNumber.h" #import "OFDate.h" #import "OFURL.h" #import "OFStream.h" #import "OFFile.h" #import "OFStreamSocket.h" #import "OFTCPSocket.h" #import "OFTLSSocket.h" | > < > > > | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | #import "OFNumber.h" #import "OFDate.h" #import "OFURL.h" #import "OFStream.h" #import "OFFile.h" #ifdef OF_HAVE_SOCKETS #import "OFStreamSocket.h" #import "OFTCPSocket.h" #import "OFTLSSocket.h" #import "OFStreamObserver.h" #import "OFHTTPRequest.h" #import "OFHTTPRequestReply.h" #import "OFHTTPClient.h" #import "OFHTTPServer.h" #endif #import "OFProcess.h" #import "OFHash.h" #import "OFMD5Hash.h" #import "OFSHA1Hash.h" #import "OFXMLAttribute.h" #import "OFXMLElement.h" |
︙ | ︙ | |||
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | #import "OFApplication.h" #import "OFSystemInfo.h" #import "OFTimer.h" #import "OFRunLoop.h" #import "OFAllocFailedException.h" #import "OFException.h" #import "OFAcceptFailedException.h" #import "OFAddressTranslationFailedException.h" #import "OFAlreadyConnectedException.h" #import "OFBindFailedException.h" #import "OFChangeDirectoryFailedException.h" #import "OFChangeFileModeFailedException.h" #import "OFChangeFileOwnerFailedException.h" #ifdef OF_HAVE_THREADS # import "OFConditionBroadcastFailedException.h" # import "OFConditionSignalFailedException.h" # import "OFConditionStillWaitingException.h" # import "OFConditionWaitFailedException.h" #endif #import "OFConnectionFailedException.h" #import "OFCopyFileFailedException.h" #import "OFCreateDirectoryFailedException.h" #import "OFDeleteDirectoryFailedException.h" #import "OFDeleteFileFailedException.h" #import "OFEnumerationMutationException.h" #import "OFHashAlreadyCalculatedException.h" #import "OFHTTPRequestFailedException.h" #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidEncodingException.h" #import "OFInvalidFormatException.h" #import "OFInvalidJSONException.h" #import "OFInvalidServerReplyException.h" #import "OFLinkFailedException.h" #import "OFListenFailedException.h" #import "OFLockFailedException.h" #import "OFMalformedXMLException.h" #import "OFMemoryNotPartOfObjectException.h" #import "OFNotConnectedException.h" #import "OFNotImplementedException.h" #import "OFOpenFileFailedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFReadOrWriteFailedException.h" #import "OFRenameFileFailedException.h" | > > > > > > > > > > | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | #import "OFApplication.h" #import "OFSystemInfo.h" #import "OFTimer.h" #import "OFRunLoop.h" #import "OFAllocFailedException.h" #import "OFException.h" #ifdef OF_HAVE_SOCKETS #import "OFAcceptFailedException.h" #import "OFAddressTranslationFailedException.h" #import "OFAlreadyConnectedException.h" #import "OFBindFailedException.h" #endif #import "OFChangeDirectoryFailedException.h" #import "OFChangeFileModeFailedException.h" #import "OFChangeFileOwnerFailedException.h" #ifdef OF_HAVE_THREADS # import "OFConditionBroadcastFailedException.h" # import "OFConditionSignalFailedException.h" # import "OFConditionStillWaitingException.h" # import "OFConditionWaitFailedException.h" #endif #ifdef OF_HAVE_SOCKETS #import "OFConnectionFailedException.h" #endif #import "OFCopyFileFailedException.h" #import "OFCreateDirectoryFailedException.h" #import "OFDeleteDirectoryFailedException.h" #import "OFDeleteFileFailedException.h" #import "OFEnumerationMutationException.h" #import "OFHashAlreadyCalculatedException.h" #ifdef OF_HAVE_SOCKETS #import "OFHTTPRequestFailedException.h" #endif #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidEncodingException.h" #import "OFInvalidFormatException.h" #import "OFInvalidJSONException.h" #import "OFInvalidServerReplyException.h" #import "OFLinkFailedException.h" #ifdef OF_HAVE_SOCKETS #import "OFListenFailedException.h" #endif #import "OFLockFailedException.h" #import "OFMalformedXMLException.h" #import "OFMemoryNotPartOfObjectException.h" #ifdef OF_HAVE_SOCKETS #import "OFNotConnectedException.h" #endif #import "OFNotImplementedException.h" #import "OFOpenFileFailedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFReadOrWriteFailedException.h" #import "OFRenameFileFailedException.h" |
︙ | ︙ |
Modified src/exceptions/Makefile from [08074185ef] to [556668b48e].
1 2 3 4 5 | include ../../extra.mk STATIC_PIC_LIB_NOINST = ${EXCEPTIONS_LIB_A} STATIC_LIB_NOINST = ${EXCEPTIONS_A} | < < | < < < < < < > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | include ../../extra.mk STATIC_PIC_LIB_NOINST = ${EXCEPTIONS_LIB_A} STATIC_LIB_NOINST = ${EXCEPTIONS_A} SRCS = OFAllocFailedException.m \ OFChangeDirectoryFailedException.m \ OFChangeFileModeFailedException.m \ OFChangeFileOwnerFailedException.m \ OFCopyFileFailedException.m \ OFCreateDirectoryFailedException.m \ OFDeleteDirectoryFailedException.m \ OFDeleteFileFailedException.m \ OFEnumerationMutationException.m \ OFException.m \ OFHashAlreadyCalculatedException.m \ OFInitializationFailedException.m \ OFInvalidArgumentException.m \ OFInvalidEncodingException.m \ OFInvalidFormatException.m \ OFInvalidJSONException.m \ OFInvalidServerReplyException.m \ OFLinkFailedException.m \ OFLockFailedException.m \ OFMalformedXMLException.m \ OFMemoryNotPartOfObjectException.m \ OFNotImplementedException.m \ OFOpenFileFailedException.m \ OFOutOfMemoryException.m \ OFOutOfRangeException.m \ OFReadFailedException.m \ OFReadOrWriteFailedException.m \ OFRenameFileFailedException.m \ OFSeekFailedException.m \ OFSetOptionFailedException.m \ OFStillLockedException.m \ OFSymlinkFailedException.m \ OFTruncatedDataException.m \ OFUnboundNamespaceException.m \ OFUnlockFailedException.m \ OFUnsupportedProtocolException.m \ OFUnsupportedVersionException.m \ OFWriteFailedException.m \ ${USE_SRCS_SOCKETS} \ ${USE_SRCS_THREADS} SRCS_SOCKETS = OFAcceptFailedException.m \ OFAddressTranslationFailedException.m \ OFAlreadyConnectedException.m \ OFBindFailedException.m \ OFConnectionFailedException.m \ OFHTTPRequestFailedException.m \ OFListenFailedException.m \ OFNotConnectedException.m SRCS_THREADS = OFConditionBroadcastFailedException.m \ OFConditionSignalFailedException.m \ OFConditionStillWaitingException.m \ OFConditionWaitFailedException.m \ OFThreadJoinFailedException.m \ OFThreadStartFailedException.m \ OFThreadStillRunningException.m |
︙ | ︙ |
Modified src/exceptions/OFAcceptFailedException.h from [f828728a28] to [ede346dfd9].
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" @class OFTCPSocket; /*! * @brief An exception indicating that accepting a connection failed. */ @interface OFAcceptFailedException: OFException | > > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFTCPSocket; /*! * @brief An exception indicating that accepting a connection failed. */ @interface OFAcceptFailedException: OFException |
︙ | ︙ |
Modified src/exceptions/OFAddressTranslationFailedException.h from [9eb5a36411] to [1027254cc2].
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" @class OFTCPSocket; /*! * @brief An exception indicating the translation of an address failed. */ @interface OFAddressTranslationFailedException: OFException | > > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFTCPSocket; /*! * @brief An exception indicating the translation of an address failed. */ @interface OFAddressTranslationFailedException: OFException |
︙ | ︙ |
Modified src/exceptions/OFAlreadyConnectedException.h from [5e96c85485] to [a1bbdc5954].
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" @class OFTCPSocket; /*! * @brief An exception indicating an attempt to connect or bind an already * connected or bound socket. */ | > > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFTCPSocket; /*! * @brief An exception indicating an attempt to connect or bind an already * connected or bound socket. */ |
︙ | ︙ |
Modified src/exceptions/OFBindFailedException.h from [3324f93c42] to [08e07c93e0].
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" @class OFTCPSocket; /*! * @brief An exception indicating that binding a socket failed. */ @interface OFBindFailedException: OFException | > > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFTCPSocket; /*! * @brief An exception indicating that binding a socket failed. */ @interface OFBindFailedException: OFException |
︙ | ︙ |
Modified src/exceptions/OFConnectionFailedException.h from [6e0a8c3716] to [7bbe937501].
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" @class OFTCPSocket; /*! * @brief An exception indicating that a connection could not be established. */ @interface OFConnectionFailedException: OFException | > > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFTCPSocket; /*! * @brief An exception indicating that a connection could not be established. */ @interface OFConnectionFailedException: OFException |
︙ | ︙ |
Modified src/exceptions/OFHTTPRequestFailedException.h from [e63622a3c6] to [ca95dac731].
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" @class OFHTTPRequest; @class OFHTTPRequestReply; /*! * @brief An exception indicating that a HTTP request failed. */ | > > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFHTTPRequest; @class OFHTTPRequestReply; /*! * @brief An exception indicating that a HTTP request failed. */ |
︙ | ︙ |
Modified src/exceptions/OFListenFailedException.h from [9a332b8a67] to [1610493659].
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" @class OFTCPSocket; /*! * @brief An exception indicating that listening on the socket failed. */ @interface OFListenFailedException: OFException | > > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFTCPSocket; /*! * @brief An exception indicating that listening on the socket failed. */ @interface OFListenFailedException: OFException |
︙ | ︙ |
Modified src/exceptions/OFNotConnectedException.h from [281c34dc5e] to [78d1f92282].
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" @class OFStreamSocket; /*! * @brief An exception indicating a socket is not connected or bound. */ @interface OFNotConnectedException: OFException | > > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFStreamSocket; /*! * @brief An exception indicating a socket is not connected or bound. */ @interface OFNotConnectedException: OFException |
︙ | ︙ |
Modified src/exceptions/OFReadOrWriteFailedException.m from [74aee00696] to [a5ac8c3823].
︙ | ︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #include "config.h" #include <stdlib.h> #import "OFReadOrWriteFailedException.h" #import "OFString.h" #import "OFStreamSocket.h" #import "common.h" @implementation OFReadOrWriteFailedException + (instancetype)exceptionWithClass: (Class)class stream: (OFStream*)stream requestedLength: (size_t)requestedLength | > > | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #include "config.h" #include <stdlib.h> #import "OFReadOrWriteFailedException.h" #import "OFString.h" #ifdef OF_HAVE_SOCKETS #import "OFStreamSocket.h" #endif #import "common.h" @implementation OFReadOrWriteFailedException + (instancetype)exceptionWithClass: (Class)class stream: (OFStream*)stream requestedLength: (size_t)requestedLength |
︙ | ︙ | |||
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | requestedLength: (size_t)requestedLength { self = [super initWithClass: class]; _stream = [stream retain]; _requestedLength = requestedLength; if ([class isSubclassOfClass: [OFStreamSocket class]]) _errNo = GET_SOCK_ERRNO; else _errNo = GET_ERRNO; return self; } - (void)dealloc { | > > | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | requestedLength: (size_t)requestedLength { self = [super initWithClass: class]; _stream = [stream retain]; _requestedLength = requestedLength; #ifdef OF_HAVE_SOCKETS if ([class isSubclassOfClass: [OFStreamSocket class]]) _errNo = GET_SOCK_ERRNO; else #endif _errNo = GET_ERRNO; return self; } - (void)dealloc { |
︙ | ︙ |
Modified src/exceptions/common.h from [258ae8e83b] to [19aae6e6f7].
︙ | ︙ | |||
15 16 17 18 19 20 21 | */ #include <string.h> #import "macros.h" #ifndef _WIN32 | | > > > | > > > > > | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | */ #include <string.h> #import "macros.h" #ifndef _WIN32 # if defined(OF_HAVE_SOCKETS) && !defined(HAVE_THREADSAFE_GETADDRINFO) # include <netdb.h> # endif # include <errno.h> # define GET_ERRNO errno # ifdef OF_HAVE_SOCKETS # ifndef HAVE_THREADSAFE_GETADDRINFO # define GET_AT_ERRNO h_errno # else # define GET_AT_ERRNO errno # endif # define GET_SOCK_ERRNO errno # endif # define ERRFMT "Error string was: %s" # define ERRPARAM strerror(_errNo) # ifdef OF_HAVE_SOCKETS # ifndef HAVE_THREADSAFE_GETADDRINFO # define AT_ERRPARAM hstrerror(_errNo) # else # define AT_ERRPARAM strerror(_errNo) # endif # endif #else # include <windows.h> # define GET_ERRNO GetLastError() # ifdef OF_HAVE_SOCKETS # define GET_AT_ERRNO WSAGetLastError() # define GET_SOCK_ERRNO WSAGetLastError() # endif # define ERRFMT "Error code was: %d" # define ERRPARAM _errNo # ifdef OF_HAVE_SOCKETS # define AT_ERRPARAM _errNo # endif #endif |
Modified src/objfw-defs.h.in from [f518fd1de0] to [63a737d4f3].
︙ | ︙ | |||
9 10 11 12 13 14 15 16 17 18 | #undef OF_HAVE_OSATOMIC #undef OF_HAVE_OSATOMIC_64 #undef OF_HAVE_PTHREADS #undef OF_HAVE_PLUGINS #undef OF_HAVE_PTHREAD_SPINLOCKS #undef OF_HAVE_RECURSIVE_PTHREAD_MUTEXES #undef OF_HAVE_SCHED_YIELD #undef OF_HAVE_THREADS #undef OF_OBJFW_RUNTIME #undef SIZE_MAX | > | 9 10 11 12 13 14 15 16 17 18 19 | #undef OF_HAVE_OSATOMIC #undef OF_HAVE_OSATOMIC_64 #undef OF_HAVE_PTHREADS #undef OF_HAVE_PLUGINS #undef OF_HAVE_PTHREAD_SPINLOCKS #undef OF_HAVE_RECURSIVE_PTHREAD_MUTEXES #undef OF_HAVE_SCHED_YIELD #undef OF_HAVE_SOCKETS #undef OF_HAVE_THREADS #undef OF_OBJFW_RUNTIME #undef SIZE_MAX |
Modified tests/Makefile from [9b8d4ab488] to [6d4f7847a4].
︙ | ︙ | |||
15 16 17 18 19 20 21 | OFNumberTests.m \ OFObjectTests.m \ OFSerializationTests.m \ OFSet.m \ OFSHA1HashTests.m \ OFStreamTests.m \ OFStringTests.m \ | < > | > > | < | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | OFNumberTests.m \ OFObjectTests.m \ OFSerializationTests.m \ OFSet.m \ OFSHA1HashTests.m \ OFStreamTests.m \ OFStringTests.m \ OFURLTests.m \ OFXMLElementBuilderTests.m \ OFXMLNodeTests.m \ OFXMLParserTests.m \ ${PROPERTIESTESTS_M} \ TestsAppDelegate.m \ ${USE_SRCS_PLUGINS} \ ${USE_SRCS_SOCKETS} \ ${USE_SRCS_THREADS} \ ${OFHTTPCLIENTTESTS_M} SRCS_PLUGINS = OFPluginTests.m SRCS_SOCKETS = OFTCPSocketTests.m SRCS_THREADS = OFThreadTests.m IOS_USER ?= mobile IOS_TMP ?= /tmp/objfw-test .PHONY: run run-tests run-on-ios run: all if [ -z "${DONT_RUN_TESTS}" ]; then ${MAKE} ${MFLAGS} run-tests; fi |
︙ | ︙ |
Modified tests/TestsAppDelegate.m from [d190941fab] to [f5a2a05389].
︙ | ︙ | |||
137 138 139 140 141 142 143 144 145 146 147 148 | [self arrayTests]; [self dictionaryTests]; [self listTests]; [self setTests]; [self dateTests]; [self numberTests]; [self streamTests]; [self TCPSocketTests]; #ifdef OF_HAVE_THREADS [self threadTests]; #endif [self URLTests]; | > > | | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | [self arrayTests]; [self dictionaryTests]; [self listTests]; [self setTests]; [self dateTests]; [self numberTests]; [self streamTests]; #ifdef OF_HAVE_SOCKETS [self TCPSocketTests]; #endif #ifdef OF_HAVE_THREADS [self threadTests]; #endif [self URLTests]; #if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_THREADS) [self HTTPClientTests]; #endif [self XMLParserTests]; [self XMLNodeTests]; [self XMLElementBuilderTests]; [self serializationTests]; [self JSONTests]; |
︙ | ︙ |