ObjFW  Changes On Branch 20fff1114475abf6

Changes In Branch 0.6 Through [20fff11144] Excluding Merge-Ins

This is equivalent to a diff from 83ad0894c0 to 20fff11144

2012-03-01
15:03
Fix OFDate documentation. check-in: 3a88ce0e8f user: js tags: 0.6
14:52
Remove dead code. check-in: 20fff11144 user: js tags: 0.6
2012-02-29
21:12
\cond internal is not needed anymore. check-in: 95db0335d8 user: js tags: 0.6
2012-02-20
22:40
Set version to 0.7-dev in default branch. check-in: 584a8dccec user: js tags: trunk
22:38
Create branch for 0.6. check-in: 01ca5677b9 user: js tags: 0.6
2012-02-17
21:15
Create a branch for a bridge to Foundation, integrated into ObjFW. check-in: 7746f5f864 user: js tags: bridge
17:13
Make it possible to handle common signals in OFApplicationDelegate. check-in: 83ad0894c0 user: js tags: trunk
16:25
Fix a very bad typo in OFStreamObserver_poll. check-in: e9b0575094 user: js tags: trunk

Modified ChangeLog from [6f581b20cf] to [33d26b0e3e].

1
2
3
















4
5
6
7
8
9
10
Legend:
 * Changes of existing features or bugfixes.
 + New features.

















ObjFW 0.5.3 -> ObjFW 0.5.4, 30.08.2011
 * The blocks runtime is now working correctly.
 * Documentation fixes.
 * -framework works with objfw-compile now.
 + Support for QNX.
 * Various small fixes.



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
Legend:
 * Changes of existing features or bugfixes.
 + New features.

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.
 + Serialization and deserialization of objects into/from XML and JSON.
 + New class OFIntrospection for introspecting classes.
 + New class OFProcess for working with and controlling child processes.
 * Lots of OFXMLParser and OFXMLElement improvements.
 + OFHTTPRequests can have a delegate now for status updates and processing
   data as soon as it arrives.
 + There are several backends for OFStreamObserver now, including kqueue, poll
   and select.
 + SOCKS5 support for OFTCPSockets (client only).
 * Several API changes.

ObjFW 0.5.3 -> ObjFW 0.5.4, 30.08.2011
 * The blocks runtime is now working correctly.
 * Documentation fixes.
 * -framework works with objfw-compile now.
 + Support for QNX.
 * Various small fixes.

Modified Info.plist from [3303e89e51] to [03babfdb24].

13
14
15
16
17
18
19
20
21
22
23
24
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundlePackageType</key>
	<string>FMWK</string>
	<key>CFBundleSignature</key>
	<string>OBJFW</string>
	<key>CFBundleVersion</key>
	<string>0.6-dev</string>
	<key>CFBundleShortVersionString</key>
	<string>0.6-dev</string>
</dict>
</plist>







|

|


13
14
15
16
17
18
19
20
21
22
23
24
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundlePackageType</key>
	<string>FMWK</string>
	<key>CFBundleSignature</key>
	<string>OBJFW</string>
	<key>CFBundleVersion</key>
	<string>0.6</string>
	<key>CFBundleShortVersionString</key>
	<string>0.6</string>
</dict>
</plist>

Modified PLATFORMS from [fcddfeebcb] to [11908fc1b9].

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
ObjFW is known to work on the following platforms, but should run on
many others as well:

 +--------------------------+--------------+----------------------+---------+
 | OS                       | Architecture | Compiler             | Runtime |
 +--------------------------+--------------+----------------------+---------+
 | FreeBSD 8.0              | x86          |                      | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | Haiku r41078             | x86          | GCC 4.4.4            | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | Linux 2.6.*              | x86          | GCC 4.4.1            | old GNU |
 | Linux 2.6.*              | x86          | GCC 4.6              | GNU     |
 | Linux 2.6.*              | x86          | LLVM/Clang r83252    | old GNU |
 | Linux 2.6.*              | x86_64       | GCC 4.4.1            | old GNU |
 | Maemo 5                  | arm          | GCC 4.5.1            | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | iPhone OS 2.2.1 - 4.2    | arm          | GCC 4.2              | Apple   |
 | Mac OS X 10.5            | ppc          | GCC 4.0 + 4.2        | Apple   |
 | Mac OS X 10.5            | ppc64        | GCC 4.0 + 4.2        | Apple   |
 | Mac OS X 10.5 - 10.6     | x86          | GCC 4.0 + 4.2        | Apple   |
 | Mac OS X 10.5 - 10.6     | x86_64       | GCC 4.0 + 4.2        | Apple   |
 +--------------------------+--------------+----------------------+---------+
 | MirBSD 10uAB - 10uAD     | x86          | GCC 4.4.2            | old GNU |
 | MirBSD 10uAD             | x86          | LLVM/Clang r90573    | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | NetBSD 4.0               | x86          | GCC 4.1.2 prerelease | old GNU |
 | NetBSD 5.1               | x86_64       | GCC 4.1.3 prerelease | old GNU |
 | NetBSD 5.1               | x86_64       | GCC 4.6              | GNU     |
 | NetBSD 5.1               | x86_64       | LLVM/Clang r134860   | old GNU |


 +--------------------------+--------------+----------------------+---------+
 | OpenBSD 4.6 - 4.7        | x86_64       | GCC 4.2.1 - 4.2.4    | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | OpenSolaris 2009.06      | x86          |                      | old GNU |
 | OpenSolaris 2009.06      | x86_64       |                      | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | QNX 6.5.0                | x86          | GCC 4.6.1            | GNU     |
 +--------------------------+--------------+----------------------+---------+
 | Windows XP - 7 / Cygwin  | x86          |                      | old GNU |
 | Windows XP - 7 / MinGW32 | x86          |                      | old GNU |
 | Windows 7 / MinGW64      | x86_64       |                      | old GNU |
 +--------------------------+--------------+----------------------+---------+

Basically, it should run on any POSIX system to which GCC 4 or a recent Clang
version has been ported. If not, please send an e-mail with a bug report.










|
|
|
|


|


|
|








>
>

|













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
ObjFW is known to work on the following platforms, but should run on
many others as well:

 +--------------------------+--------------+----------------------+---------+
 | OS                       | Architecture | Compiler             | Runtime |
 +--------------------------+--------------+----------------------+---------+
 | FreeBSD 8.0              | x86          |                      | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | Haiku r41078             | x86          | GCC 4.4.4            | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | Linux 2.6.* / 3.*        | x86          | GCC 4.4.1            | old GNU |
 | Linux 2.6.* / 3.*        | x86          | GCC 4.6              | GNU     |
 | Linux 2.6.* / 3.*        | x86          | LLVM/Clang r83252    | old GNU |
 | Linux 2.6.* / 3.*        | x86_64       | GCC 4.4.1            | old GNU |
 | Maemo 5                  | arm          | GCC 4.5.1            | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | iPhone OS 2.2.1 - 5.0    | arm          | GCC 4.2              | Apple   |
 | Mac OS X 10.5            | ppc          | GCC 4.0 + 4.2        | Apple   |
 | Mac OS X 10.5            | ppc64        | GCC 4.0 + 4.2        | Apple   |
 | Mac OS X 10.5 - 10.7     | x86          | GCC 4.0 + 4.2        | Apple   |
 | Mac OS X 10.5 - 10.7     | x86_64       | GCC 4.0 + 4.2        | Apple   |
 +--------------------------+--------------+----------------------+---------+
 | MirBSD 10uAB - 10uAD     | x86          | GCC 4.4.2            | old GNU |
 | MirBSD 10uAD             | x86          | LLVM/Clang r90573    | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | NetBSD 4.0               | x86          | GCC 4.1.2 prerelease | old GNU |
 | NetBSD 5.1               | x86_64       | GCC 4.1.3 prerelease | old GNU |
 | NetBSD 5.1               | x86_64       | GCC 4.6              | GNU     |
 | NetBSD 5.1               | x86_64       | LLVM/Clang r134860   | old GNU |
 | NetBSD 5.99.56           | x86_64       | GCC 4.5.3            | old GNU |
 | NetBSD 5.99.56           | x86_64       | LLVM/Clang 2.9       | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | OpenBSD 4.6 - 5.0        | x86_64       | GCC 4.2.1 - 4.2.4    | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | OpenSolaris 2009.06      | x86          |                      | old GNU |
 | OpenSolaris 2009.06      | x86_64       |                      | old GNU |
 +--------------------------+--------------+----------------------+---------+
 | QNX 6.5.0                | x86          | GCC 4.6.1            | GNU     |
 +--------------------------+--------------+----------------------+---------+
 | Windows XP - 7 / Cygwin  | x86          |                      | old GNU |
 | Windows XP - 7 / MinGW32 | x86          |                      | old GNU |
 | Windows 7 / MinGW64      | x86_64       |                      | old GNU |
 +--------------------------+--------------+----------------------+---------+

Basically, it should run on any POSIX system to which GCC 4 or a recent Clang
version has been ported. If not, please send an e-mail with a bug report.

Modified configure.ac from [8cb5bd7e2a] to [5de95df3b4].

1
2
3
4
5
6
7
8
AC_INIT(ObjFW, 0.6-dev, 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"
	LIBS="$LIBS -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver"
	LIBS="$LIBS -lpsputility -lpspuser -lpspkernel"
|







1
2
3
4
5
6
7
8
AC_INIT(ObjFW, 0.6, 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"
	LIBS="$LIBS -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver"
	LIBS="$LIBS -lpsputility -lpspuser -lpspkernel"
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
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_MSG_CHECKING(for tm_gmtoff in struct tm)
AC_TRY_COMPILE([
	#define _GNU_SOURCE
	#include <time.h>
], [
	struct tm tm;
	tm.tm_gmtoff = 0;
], [
	AC_DEFINE(STRUCT_TM_HAS_TM_GMTOFF, 1, [Whether struct tm has tm_gmtoff])
	AC_MSG_RESULT(yes)
], [
	AC_MSG_RESULT(no)
])

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")







<
<
<
<
<
<
<
<
<
<
<
<
<
<







473
474
475
476
477
478
479














480
481
482
483
484
485
486
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_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")

Modified src/OFApplication.h from [1bcf3be869] to [1aa58a5990].

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
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
 * \warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do
 *	    signal-safe operations like setting a variable or calling a
 *	    signal-safe function!
 */
- (void)applicationDidReceiveSIGINT;


/**
 * \brief A method which is called when the application received a SIGHUP.


 *
 * \warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do
 *	    signal-safe operations like setting a variable or calling a
 *	    signal-safe function!
 */
- (void)applicationDidReceiveSIGHUP;

/**
 * \brief A method which is called when the application received a SIGUSR1.


 *
 * \warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do
 *	    signal-safe operations like setting a variable or calling a
 *	    signal-safe function!
 */
- (void)applicationDidReceiveSIGUSR1;

/**
 * \brief A method which is called when the application received a SIGUSR2.


 *
 * \warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do
 *	    signal-safe operations like setting a variable or calling a
 *	    signal-safe function!
 */
- (void)applicationDidReceiveSIGUSR2;

@end

/**
 * \brief Represents the application as an object.
 */
@interface OFApplication: OFObject
{
	OFString *programName;
	OFMutableArray *arguments;
	OFMutableDictionary *environment;
	int *argc;
	char ***argv;
@public
	id <OFApplicationDelegate> delegate;
	void (*SIGINTHandler)(id, SEL);

	void (*SIGHUPHandler)(id, SEL);
	void (*SIGUSR1Handler)(id, SEL);
	void (*SIGUSR2Handler)(id, SEL);

}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, assign) OFString *programName;
@property (readonly, assign) OFArray *arguments;
@property (readonly, assign) OFDictionary *environment;
@property (assign) id <OFApplicationDelegate> delegate;







>


>
>










>
>










>
>







>















>



>







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
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
 * \warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do
 *	    signal-safe operations like setting a variable or calling a
 *	    signal-safe function!
 */
- (void)applicationDidReceiveSIGINT;

#ifndef _WIN32
/**
 * \brief A method which is called when the application received a SIGHUP.
 *
 * This signal is not available on Windows.
 *
 * \warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do
 *	    signal-safe operations like setting a variable or calling a
 *	    signal-safe function!
 */
- (void)applicationDidReceiveSIGHUP;

/**
 * \brief A method which is called when the application received a SIGUSR1.
 *
 * This signal is not available on Windows.
 *
 * \warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do
 *	    signal-safe operations like setting a variable or calling a
 *	    signal-safe function!
 */
- (void)applicationDidReceiveSIGUSR1;

/**
 * \brief A method which is called when the application received a SIGUSR2.
 *
 * This signal is not available on Windows.
 *
 * \warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do
 *	    signal-safe operations like setting a variable or calling a
 *	    signal-safe function!
 */
- (void)applicationDidReceiveSIGUSR2;
#endif
@end

/**
 * \brief Represents the application as an object.
 */
@interface OFApplication: OFObject
{
	OFString *programName;
	OFMutableArray *arguments;
	OFMutableDictionary *environment;
	int *argc;
	char ***argv;
@public
	id <OFApplicationDelegate> delegate;
	void (*SIGINTHandler)(id, SEL);
#ifndef _WIN32
	void (*SIGHUPHandler)(id, SEL);
	void (*SIGUSR1Handler)(id, SEL);
	void (*SIGUSR2Handler)(id, SEL);
#endif
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, assign) OFString *programName;
@property (readonly, assign) OFArray *arguments;
@property (readonly, assign) OFDictionary *environment;
@property (assign) id <OFApplicationDelegate> delegate;

Modified src/OFApplication.m from [14e0a7d129] to [68b2ca804c].

14
15
16
17
18
19
20

21
22


23
24
25
26
27
28
29
 * file.
 */

#include "config.h"

#define OF_APPLICATION_M


#include <stdlib.h>
#include <string.h>



#import "OFApplication.h"
#import "OFString.h"
#import "OFArray.h"
#import "OFDictionary.h"
#import "OFAutoreleasePool.h"








>


>
>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 * file.
 */

#include "config.h"

#define OF_APPLICATION_M

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <signal.h>

#import "OFApplication.h"
#import "OFString.h"
#import "OFArray.h"
#import "OFDictionary.h"
#import "OFAutoreleasePool.h"

51
52
53
54
55
56
57

58
59
60

61
62
63
64
65
66
67
	static void						\
	handle##sig(int signal)					\
	{							\
		app->sig##Handler(app->delegate,		\
		    @selector(applicationDidReceive##sig));	\
	}
SIGNAL_HANDLER(SIGINT)

SIGNAL_HANDLER(SIGHUP)
SIGNAL_HANDLER(SIGUSR1)
SIGNAL_HANDLER(SIGUSR2)

#undef SIGNAL_HANDLER

int
of_application_main(int *argc, char **argv[], Class cls)
{
	OFApplication *app = [OFApplication sharedApplication];
	id <OFApplicationDelegate> delegate = [[cls alloc] init];







>



>







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
	static void						\
	handle##sig(int signal)					\
	{							\
		app->sig##Handler(app->delegate,		\
		    @selector(applicationDidReceive##sig));	\
	}
SIGNAL_HANDLER(SIGINT)
#ifndef _WIN32
SIGNAL_HANDLER(SIGHUP)
SIGNAL_HANDLER(SIGUSR1)
SIGNAL_HANDLER(SIGUSR2)
#endif
#undef SIGNAL_HANDLER

int
of_application_main(int *argc, char **argv[], Class cls)
{
	OFApplication *app = [OFApplication sharedApplication];
	id <OFApplicationDelegate> delegate = [[cls alloc] init];
256
257
258
259
260
261
262

263
264
265

266
267
268
269
270
271
272
	if (sig##Handler != (void(*)(id, SEL))[OFObject			  \
	    instanceMethodForSelector:					  \
	    @selector(applicationDidReceive##sig)])			  \
		signal(sig, handle##sig);				  \
	else								  \
		signal(sig, SIG_DFL);
	REGISTER_SIGNAL(SIGINT)

	REGISTER_SIGNAL(SIGHUP)
	REGISTER_SIGNAL(SIGUSR1)
	REGISTER_SIGNAL(SIGUSR2)

#undef REGISTER_SIGNAL
}

- (void)run
{
	[delegate applicationDidFinishLaunching];
}







>



>







261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
	if (sig##Handler != (void(*)(id, SEL))[OFObject			  \
	    instanceMethodForSelector:					  \
	    @selector(applicationDidReceive##sig)])			  \
		signal(sig, handle##sig);				  \
	else								  \
		signal(sig, SIG_DFL);
	REGISTER_SIGNAL(SIGINT)
#ifndef _WIN32
	REGISTER_SIGNAL(SIGHUP)
	REGISTER_SIGNAL(SIGUSR1)
	REGISTER_SIGNAL(SIGUSR2)
#endif
#undef REGISTER_SIGNAL
}

- (void)run
{
	[delegate applicationDidFinishLaunching];
}

Modified src/OFArray.h from [b566a4920c] to [526bbf0b50].

9
10
11
12
13
14
15







16
17
18
19
20
21
22
 * the packaging of this file.
 *
 * 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.
 */








#include <stdarg.h>

#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.h"
#import "OFSerialization.h"







>
>
>
>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * the packaging of this file.
 *
 * 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.
 */

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <stdarg.h>

#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.h"
#import "OFSerialization.h"

Modified src/OFAutoreleasePool.h from [859d666060] to [ed23b75b52].

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
 * \brief Adds an object to the autorelease pool at the top of the
 *	  thread-specific autorelease pool stack.
 *
 * \param object The object to add to the autorelease pool
 */
+ (void)addObject: (id)object;

/// \cond internal
+ (void)_releaseAll;
- (void)_addObject: (id)object;
/// \endcond

/**
 * \brief Releases all objects in the autorelease pool.
 *
 * This does not free the memory allocated to store pointers to the objects in
 * the pool, so reusing the pool does not allocate any memory until the previous
 * number of objects is exceeded. It behaves this way to optimize loops that







<


<







35
36
37
38
39
40
41

42
43

44
45
46
47
48
49
50
 * \brief Adds an object to the autorelease pool at the top of the
 *	  thread-specific autorelease pool stack.
 *
 * \param object The object to add to the autorelease pool
 */
+ (void)addObject: (id)object;


+ (void)_releaseAll;
- (void)_addObject: (id)object;


/**
 * \brief Releases all objects in the autorelease pool.
 *
 * This does not free the memory allocated to store pointers to the objects in
 * the pool, so reusing the pool does not allocate any memory until the previous
 * number of objects is exceeded. It behaves this way to optimize loops that

Modified src/OFDate.m from [683d9127f2] to [eecbbd56be].

246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
		tm.tm_isdst = -1;

		if (of_strptime([string UTF8String], [format UTF8String],
		    &tm) == NULL)
			@throw [OFInvalidFormatException
			    exceptionWithClass: isa];

#ifdef STRUCT_TM_HAS_TM_GMTOFF
		if (tm.tm_gmtoff != 0)
			@throw [OFInvalidFormatException
			    exceptionWithClass: isa];
#endif

		/* Years */
		seconds = (int64_t)(tm.tm_year - 70) * 31536000;
		/* Days of leap years, excluding the year to look at */
		seconds += (((tm.tm_year + 1899) / 4) - 492) * 86400;
		seconds -= (((tm.tm_year + 1899) / 100) - 19) * 86400;
		seconds += (((tm.tm_year + 1899) / 400) - 4) * 86400;
		/* Leap day */







<
<
<
<
<
<







246
247
248
249
250
251
252






253
254
255
256
257
258
259
		tm.tm_isdst = -1;

		if (of_strptime([string UTF8String], [format UTF8String],
		    &tm) == NULL)
			@throw [OFInvalidFormatException
			    exceptionWithClass: isa];







		/* Years */
		seconds = (int64_t)(tm.tm_year - 70) * 31536000;
		/* Days of leap years, excluding the year to look at */
		seconds += (((tm.tm_year + 1899) / 4) - 492) * 86400;
		seconds -= (((tm.tm_year + 1899) / 100) - 19) * 86400;
		seconds += (((tm.tm_year + 1899) / 400) - 4) * 86400;
		/* Leap day */

Modified src/OFDictionary.h from [ec3b983162] to [747799a643].

9
10
11
12
13
14
15







16
17
18
19
20
21
22
 * the packaging of this file.
 *
 * 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.
 */








#include <stdarg.h>

#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.h"
#import "OFSerialization.h"







>
>
>
>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * the packaging of this file.
 *
 * 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.
 */

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <stdarg.h>

#import "OFObject.h"
#import "OFCollection.h"
#import "OFEnumerator.h"
#import "OFSerialization.h"

Modified src/OFFile.h from [fd26f8d0e7] to [c75eb39d48].

9
10
11
12
13
14
15







16
17
18
19
20
21
22
 * the packaging of this file.
 *
 * 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.
 */








#include <sys/types.h>

#import "OFSeekableStream.h"

@class OFArray;
@class OFDate;







>
>
>
>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * the packaging of this file.
 *
 * 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.
 */

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <sys/types.h>

#import "OFSeekableStream.h"

@class OFArray;
@class OFDate;

Modified src/OFHTTPRequest.h from [915ec7bd0b] to [62c4ad9368].

278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296

#ifdef OF_HAVE_PROPERTIES
@property (readonly) short statusCode;
@property (readonly, copy) OFDictionary *headers;
@property (readonly, retain) OFDataArray *data;
#endif

/// \cond internal
- initWithStatusCode: (short)status
	     headers: (OFDictionary*)headers
		data: (OFDataArray*)data;
/// \endcond

/**
 * \brief Returns the state code of the result of the HTTP request.
 *
 * \return The status code of the result of the HTTP request
 */
- (short)statusCode;







<



<







278
279
280
281
282
283
284

285
286
287

288
289
290
291
292
293
294

#ifdef OF_HAVE_PROPERTIES
@property (readonly) short statusCode;
@property (readonly, copy) OFDictionary *headers;
@property (readonly, retain) OFDataArray *data;
#endif


- initWithStatusCode: (short)status
	     headers: (OFDictionary*)headers
		data: (OFDataArray*)data;


/**
 * \brief Returns the state code of the result of the HTTP request.
 *
 * \return The status code of the result of the HTTP request
 */
- (short)statusCode;

Modified src/OFMutableString.h from [33da247c32] to [dc84b0036c].

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 *
 * 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.
 */

#include <stdio.h>
#include <stdarg.h>

#import "OFString.h"

/**
 * \brief A class for storing and modifying strings.
 */
@interface OFMutableString: OFString
/**







<
<
<







10
11
12
13
14
15
16



17
18
19
20
21
22
23
 *
 * 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 "OFString.h"

/**
 * \brief A class for storing and modifying strings.
 */
@interface OFMutableString: OFString
/**

Modified src/OFMutableString.m from [9d0d0e1c5d] to [13cf3f76d3].

15
16
17
18
19
20
21


22
23
24
25
26
27
28
 */

#include "config.h"

#include <stdarg.h>
#include <stdlib.h>
#include <string.h>



#import "OFString.h"
#import "OFMutableString_UTF8.h"
#import "OFAutoreleasePool.h"

#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"







>
>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 */

#include "config.h"

#include <stdarg.h>
#include <stdlib.h>
#include <string.h>

#include <sys/types.h>

#import "OFString.h"
#import "OFMutableString_UTF8.h"
#import "OFAutoreleasePool.h"

#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"

Modified src/OFNumber.h from [2829df2028] to [2ab0482390].

9
10
11
12
13
14
15







16
17
18
19
20
21
22
 * the packaging of this file.
 *
 * 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.
 */








#include <sys/types.h>

#import "OFObject.h"
#import "OFSerialization.h"
#import "OFJSONEncoding.h"








>
>
>
>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * the packaging of this file.
 *
 * 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.
 */

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <sys/types.h>

#import "OFObject.h"
#import "OFSerialization.h"
#import "OFJSONEncoding.h"

Modified src/OFPlugin.h from [fdcaea100c] to [5291cd6c54].

30
31
32
33
34
35
36
37
38
39
40
41
42
43
 */
@interface OFPlugin: OFObject
{
	of_plugin_handle_t handle;
}

/**
 * \brief Loads an OFPlugin from a file.
 *
 * \param path Path to the OFPlugin file. The suffix is appended automatically.
 * \return The loaded OFPlugin
 */
+ pluginFromFile: (OFString*)path;
@end







|

|
|

|

30
31
32
33
34
35
36
37
38
39
40
41
42
43
 */
@interface OFPlugin: OFObject
{
	of_plugin_handle_t handle;
}

/**
 * \brief Loads a plugin from a file.
 *
 * \param path Path to the plugin file. The suffix is appended automatically.
 * \return The loaded plugin
 */
+ (id)pluginFromFile: (OFString*)path;
@end

Modified src/OFPlugin.m from [c9d1104dc0] to [77231c2582].

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifdef _WIN32
# define dlopen(file, mode) LoadLibrary(file)
# define dlsym(handle, symbol) GetProcAddress(handle, symbol)
# define dlclose(handle) FreeLibrary(handle)
#endif

@implementation OFPlugin
+ pluginFromFile: (OFString*)path
{
	OFAutoreleasePool *pool;
	OFMutableString *file;
	of_plugin_handle_t handle;
	OFPlugin *(*initPlugin)();
	OFPlugin *plugin;








|







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifdef _WIN32
# define dlopen(file, mode) LoadLibrary(file)
# define dlsym(handle, symbol) GetProcAddress(handle, symbol)
# define dlclose(handle) FreeLibrary(handle)
#endif

@implementation OFPlugin
+ (id)pluginFromFile: (OFString*)path
{
	OFAutoreleasePool *pool;
	OFMutableString *file;
	of_plugin_handle_t handle;
	OFPlugin *(*initPlugin)();
	OFPlugin *plugin;

Modified src/OFProcess.h from [23a37e20f3] to [f3d3f9f669].

10
11
12
13
14
15
16
17
18
19





20
21
22
23
24
25
26
 *
 * 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.
 */

#ifndef _WIN32
# include <sys/types.h>
#endif






#import "OFStream.h"

#ifdef _WIN32
# include <windows.h>
#endif








|
|

>
>
>
>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 *
 * 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.
 */

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <sys/types.h>

#import "OFStream.h"

#ifdef _WIN32
# include <windows.h>
#endif

Modified src/OFProcess.m from [be6e10ea82] to [39656659f7].

85
86
87
88
89
90
91
92



93
94
95
96
97
98
99
			@throw [OFInitializationFailedException
			    exceptionWithClass: isa];

		switch ((pid = fork())) {
		case 0:;
			OFString **cArray = [arguments cArray];
			size_t i, count = [arguments count];
			char **argv = alloca((count + 2) * sizeof(char*));




			argv[0] = (char*)[programName cStringWithEncoding:
			    OF_STRING_ENCODING_NATIVE];

			for (i = 0; i < count; i++)
				argv[i + 1] = (char*)[cArray[i]
				    cStringWithEncoding:







|
>
>
>







85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
			@throw [OFInitializationFailedException
			    exceptionWithClass: isa];

		switch ((pid = fork())) {
		case 0:;
			OFString **cArray = [arguments cArray];
			size_t i, count = [arguments count];
			char **argv;

			argv = [self allocMemoryForNItems: count + 2
						   ofSize: sizeof(char*)];

			argv[0] = (char*)[programName cStringWithEncoding:
			    OF_STRING_ENCODING_NATIVE];

			for (i = 0; i < count; i++)
				argv[i + 1] = (char*)[cArray[i]
				    cStringWithEncoding:

Modified src/OFSeekableStream.h from [c604c2e013] to [7d6bf274be].

9
10
11
12
13
14
15







16
17
18
19
20
21
22
 * the packaging of this file.
 *
 * 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.
 */








#include <sys/types.h>

#import "OFStream.h"

/**
 * \brief A stream that supports seeking.







>
>
>
>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * the packaging of this file.
 *
 * 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.
 */

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <sys/types.h>

#import "OFStream.h"

/**
 * \brief A stream that supports seeking.

Modified src/OFSet.h from [bd79d5f4f9] to [889864d837].

9
10
11
12
13
14
15







16
17
18
19
20
21
22
 * the packaging of this file.
 *
 * 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.
 */








#include <stdarg.h>

#import "OFObject.h"
#import "OFCollection.h"
#import "OFSerialization.h"








>
>
>
>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * the packaging of this file.
 *
 * 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.
 */

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <stdarg.h>

#import "OFObject.h"
#import "OFCollection.h"
#import "OFSerialization.h"

Modified src/OFStream.h from [cedd7eb4aa] to [5cd3180445].

9
10
11
12
13
14
15







16
17
18
19
20
21
22
 * the packaging of this file.
 *
 * 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.
 */








#include <stdarg.h>

#import "OFObject.h"
#import "OFString.h"

@class OFDataArray;







>
>
>
>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * the packaging of this file.
 *
 * 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.
 */

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <stdarg.h>

#import "OFObject.h"
#import "OFString.h"

@class OFDataArray;
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
- (int)fileDescriptor;

/**
 * \brief Closes the stream.
 */
- (void)close;

/// \cond internal
- (size_t)_readNBytes: (size_t)length
	   intoBuffer: (void*)buffer;
- (void)_writeNBytes: (size_t)length
	  fromBuffer: (const void*)buffer;
- (BOOL)_isWaitingForDelimiter;
/// \endcond
@end







<





<

817
818
819
820
821
822
823

824
825
826
827
828

829
- (int)fileDescriptor;

/**
 * \brief Closes the stream.
 */
- (void)close;


- (size_t)_readNBytes: (size_t)length
	   intoBuffer: (void*)buffer;
- (void)_writeNBytes: (size_t)length
	  fromBuffer: (const void*)buffer;
- (BOOL)_isWaitingForDelimiter;

@end

Modified src/OFStreamObserver.h from [4c22db2fe5] to [d71501a357].

174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
 *	  timeout is reached.
 *
 * \param timeout The time to wait for an event, in milliseconds
 * \return A boolean whether events occurred during the timeinterval
 */
- (BOOL)observeWithTimeout: (int)timeout;

/// \cond internal
- (void)_addFileDescriptorForReading: (int)fd;
- (void)_addFileDescriptorForWriting: (int)fd;
- (void)_removeFileDescriptorForReading: (int)fd;
- (void)_removeFileDescriptorForWriting: (int)fd;
- (void)_processQueue;
- (BOOL)_processCache;
/// \endcond
@end

@interface OFObject (OFStreamObserverDelegate) <OFStreamObserverDelegate>
@end







<






<




174
175
176
177
178
179
180

181
182
183
184
185
186

187
188
189
190
 *	  timeout is reached.
 *
 * \param timeout The time to wait for an event, in milliseconds
 * \return A boolean whether events occurred during the timeinterval
 */
- (BOOL)observeWithTimeout: (int)timeout;


- (void)_addFileDescriptorForReading: (int)fd;
- (void)_addFileDescriptorForWriting: (int)fd;
- (void)_removeFileDescriptorForReading: (int)fd;
- (void)_removeFileDescriptorForWriting: (int)fd;
- (void)_processQueue;
- (BOOL)_processCache;

@end

@interface OFObject (OFStreamObserverDelegate) <OFStreamObserverDelegate>
@end

Modified src/OFStreamObserver_select.h from [89b22e67b3] to [9d16306410].

9
10
11
12
13
14
15







16
17
18
19
20
21
22
 * the packaging of this file.
 *
 * 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.
 */








#ifdef OF_HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif

#import "OFStreamObserver.h"








>
>
>
>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * the packaging of this file.
 *
 * 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.
 */

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#ifdef OF_HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif

#import "OFStreamObserver.h"

Modified src/OFString+JSONValue.m from [887f63d0ca] to [9190d7a166].

92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
		old = *pointer;

		skipWhitespaces(pointer, stop);
		skipComment(pointer, stop);
	}
}

static OF_INLINE uint16_t
parseUnicodeEscape(const char *pointer, const char *stop)
{
	uint16_t ret = 0;
	char i;

	if (pointer + 5 >= stop)
		return 0xFFFF;







|







92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
		old = *pointer;

		skipWhitespaces(pointer, stop);
		skipComment(pointer, stop);
	}
}

static inline uint16_t
parseUnicodeEscape(const char *pointer, const char *stop)
{
	uint16_t ret = 0;
	char i;

	if (pointer + 5 >= stop)
		return 0xFFFF;
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
		else
			return 0xFFFF;
	}

	return ret;
}

static OF_INLINE OFString*
parseString(const char *restrict *pointer, const char *stop)
{
	char *buffer;
	size_t i = 0;

	if (++(*pointer) + 1 >= stop)
		return nil;







|







121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
		else
			return 0xFFFF;
	}

	return ret;
}

static inline OFString*
parseString(const char *restrict *pointer, const char *stop)
{
	char *buffer;
	size_t i = 0;

	if (++(*pointer) + 1 >= stop)
		return nil;
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
		}
	}

	free(buffer);
	return nil;
}

static OF_INLINE OFMutableArray*
parseArray(const char *restrict *pointer, const char *stop)
{
	OFMutableArray *array = [OFMutableArray array];

	if (++(*pointer) >= stop)
		return nil;








|







255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
		}
	}

	free(buffer);
	return nil;
}

static inline OFMutableArray*
parseArray(const char *restrict *pointer, const char *stop)
{
	OFMutableArray *array = [OFMutableArray array];

	if (++(*pointer) >= stop)
		return nil;

297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
	}

	(*pointer)++;

	return array;
}

static OF_INLINE OFMutableDictionary*
parseDictionary(const char *restrict *pointer, const char *stop)
{
	OFMutableDictionary *dictionary = [OFMutableDictionary dictionary];

	if (++(*pointer) >= stop)
		return nil;








|







297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
	}

	(*pointer)++;

	return array;
}

static inline OFMutableDictionary*
parseDictionary(const char *restrict *pointer, const char *stop)
{
	OFMutableDictionary *dictionary = [OFMutableDictionary dictionary];

	if (++(*pointer) >= stop)
		return nil;

349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
	}

	(*pointer)++;

	return dictionary;
}

static OF_INLINE OFNumber*
parseNumber(const char *restrict *pointer, const char *stop)
{
	BOOL hasDecimal = NO;
	size_t i;
	OFString *string;
	OFNumber *number;








|







349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
	}

	(*pointer)++;

	return dictionary;
}

static inline OFNumber*
parseNumber(const char *restrict *pointer, const char *stop)
{
	BOOL hasDecimal = NO;
	size_t i;
	OFString *string;
	OFNumber *number;

Modified src/OFString.h from [14c6115375] to [3d66e4ea15].

10
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.
 */







#include <stdio.h>
#include <stdarg.h>
#include <inttypes.h>

#import "OFObject.h"
#import "OFSerialization.h"
#import "OFJSONEncoding.h"








>
>
>
>
>
>
|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 *
 * 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.
 */

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <stdarg.h>
#include <inttypes.h>

#import "OFObject.h"
#import "OFSerialization.h"
#import "OFJSONEncoding.h"

Modified src/OFString.m from [793d434ba8] to [be0c82cd5b].

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

#include <stdarg.h>
#include <stdlib.h>
#include <string.h>

#include <sys/stat.h>

#ifdef _WIN32
# include <malloc.h>
#endif

#import "OFString.h"
#import "OFString_UTF8.h"
#import "OFArray.h"
#import "OFDictionary.h"
#import "OFFile.h"
#import "OFURL.h"
#import "OFHTTPRequest.h"







<
<
<
<







18
19
20
21
22
23
24




25
26
27
28
29
30
31

#include <stdarg.h>
#include <stdlib.h>
#include <string.h>

#include <sys/stat.h>





#import "OFString.h"
#import "OFString_UTF8.h"
#import "OFArray.h"
#import "OFDictionary.h"
#import "OFFile.h"
#import "OFURL.h"
#import "OFHTTPRequest.h"
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482

1483



1484
1485
1486
1487
1488
1489
1490
1491
1492
1493



1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510

1511



1512
1513

1514
1515
1516
1517
1518
1519
1520
1521



1522
1523
1524
1525
1526
1527
1528
	[new makeImmutable];

	return new;
}

- (BOOL)hasPrefix: (OFString*)prefix
{
	OFAutoreleasePool *pool;
	of_unichar_t *tmp;
	const of_unichar_t *prefixString;
	size_t prefixLength;
	int compare;

	if ((prefixLength = [prefix length]) > [self length])
		return NO;


	tmp = alloca(prefixLength * sizeof(of_unichar_t));



	[self getCharacters: tmp
		    inRange: of_range(0, prefixLength)];

	pool = [[OFAutoreleasePool alloc] init];

	prefixString = [prefix unicodeString];
	compare = memcmp(tmp, prefixString,
	    prefixLength * sizeof(of_unichar_t));

	[pool release];




	return !compare;
}

- (BOOL)hasSuffix: (OFString*)suffix
{
	OFAutoreleasePool *pool;
	of_unichar_t *tmp;
	const of_unichar_t *suffixString;
	size_t length, suffixLength;
	int compare;

	if ((suffixLength = [suffix length]) > [self length])
		return NO;

	length = [self length];


	tmp = alloca(suffixLength * sizeof(of_unichar_t));



	[self getCharacters: tmp
		    inRange: of_range(length - suffixLength, suffixLength)];


	pool = [[OFAutoreleasePool alloc] init];

	suffixString = [suffix unicodeString];
	compare = memcmp(tmp, suffixString,
	    suffixLength * sizeof(of_unichar_t));

	[pool release];




	return !compare;
}

- (OFArray*)componentsSeparatedByString: (OFString*)delimiter
{
	OFAutoreleasePool *pool;







<








>
|
>
>
>
|
|

|

|
|
|

|
>
>
>






<










>
|
>
>
>
|
|
>

|

|
|
|

|
>
>
>







1463
1464
1465
1466
1467
1468
1469

1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501

1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
	[new makeImmutable];

	return new;
}

- (BOOL)hasPrefix: (OFString*)prefix
{

	of_unichar_t *tmp;
	const of_unichar_t *prefixString;
	size_t prefixLength;
	int compare;

	if ((prefixLength = [prefix length]) > [self length])
		return NO;

	tmp = [self allocMemoryForNItems: prefixLength
				  ofSize: sizeof(of_unichar_t)];
	@try {
		OFAutoreleasePool *pool;

		[self getCharacters: tmp
			    inRange: of_range(0, prefixLength)];

		pool = [[OFAutoreleasePool alloc] init];

		prefixString = [prefix unicodeString];
		compare = memcmp(tmp, prefixString,
		    prefixLength * sizeof(of_unichar_t));

		[pool release];
	} @finally {
		[self freeMemory: tmp];
	}

	return !compare;
}

- (BOOL)hasSuffix: (OFString*)suffix
{

	of_unichar_t *tmp;
	const of_unichar_t *suffixString;
	size_t length, suffixLength;
	int compare;

	if ((suffixLength = [suffix length]) > [self length])
		return NO;

	length = [self length];

	tmp = [self allocMemoryForNItems: suffixLength
				  ofSize: sizeof(of_unichar_t)];
	@try {
		OFAutoreleasePool *pool;

		[self getCharacters: tmp
			    inRange: of_range(length - suffixLength,
					 suffixLength)];

		pool = [[OFAutoreleasePool alloc] init];

		suffixString = [suffix unicodeString];
		compare = memcmp(tmp, suffixString,
		    suffixLength * sizeof(of_unichar_t));

		[pool release];
	} @finally {
		[self freeMemory: tmp];
	}

	return !compare;
}

- (OFArray*)componentsSeparatedByString: (OFString*)delimiter
{
	OFAutoreleasePool *pool;

Modified src/OFString_UTF8.m from [2b9e572a06] to [6c7986d6d1].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>



#import "OFString_UTF8.h"
#import "OFMutableString_UTF8.h"
#import "OFArray.h"
#import "OFAutoreleasePool.h"

#import "OFInitializationFailedException.h"







>
>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

#include "config.h"

#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

#include <sys/types.h>

#import "OFString_UTF8.h"
#import "OFMutableString_UTF8.h"
#import "OFArray.h"
#import "OFAutoreleasePool.h"

#import "OFInitializationFailedException.h"

Modified src/OFTCPSocket+SOCKS5.h from [2d18a97d74] to [557a0e6c87].

21
22
23
24
25
26
27
28
29
30
31
32
#endif
extern int _OFTCPSocket_SOCKS5_reference;
#ifdef __cplusplus
}
#endif

@interface OFTCPSocket (SOCKS5)
/// \cond internal
- (void)_SOCKS5ConnectToHost: (OFString*)host
			port: (uint16_t)port;
/// \endcond
@end







<


<

21
22
23
24
25
26
27

28
29

30
#endif
extern int _OFTCPSocket_SOCKS5_reference;
#ifdef __cplusplus
}
#endif

@interface OFTCPSocket (SOCKS5)

- (void)_SOCKS5ConnectToHost: (OFString*)host
			port: (uint16_t)port;

@end

Modified src/OFTCPSocket.h from [44007219ff] to [df788899f8].

9
10
11
12
13
14
15







16
17
18
19
20
21
22
 * the packaging of this file.
 *
 * 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.
 */








#ifndef _WIN32
# include <sys/types.h>
# include <sys/socket.h>
# include <netdb.h>
#endif








>
>
>
>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * the packaging of this file.
 *
 * 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.
 */

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#ifndef _WIN32
# include <sys/types.h>
# include <sys/socket.h>
# include <netdb.h>
#endif

Modified src/asprintf.h from [c174ede3f2] to [a62194f12d].

11
12
13
14
15
16
17







18
19
20
21
22
23
24
25
26
27
28
29
30
 * 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 "objfw-defs.h"








#ifndef OF_HAVE_ASPRINTF
# include <stdarg.h>

# ifdef __cplusplus
extern "C" {
# endif
extern int asprintf(char**, const char*, ...);
extern int vasprintf(char**, const char*, va_list);
# ifdef __cplusplus
}
# endif
#endif







>
>
>
>
>
>
>













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
 * 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 "objfw-defs.h"

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#ifndef OF_HAVE_ASPRINTF
# include <stdarg.h>

# ifdef __cplusplus
extern "C" {
# endif
extern int asprintf(char**, const char*, ...);
extern int vasprintf(char**, const char*, va_list);
# ifdef __cplusplus
}
# endif
#endif

Modified src/base64.h from [013d2fc062] to [1cfc5e7ce8].

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 "objfw-defs.h"








#ifdef OF_OBJFW_RUNTIME
# import <objfw-rt.h>
#else
# import <objc/objc.h>
#endif








>
>
>
>
>
>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 * 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 "objfw-defs.h"

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#ifdef OF_OBJFW_RUNTIME
# import <objfw-rt.h>
#else
# import <objc/objc.h>
#endif

Modified src/macros.h from [e095ab78b7] to [d255a09914].

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 * 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 __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <stddef.h>
#include <stdint.h>

#if defined(OF_APPLE_RUNTIME) || defined(OF_GNU_RUNTIME)
# import <objc/runtime.h>
#elif defined(OF_OLD_GNU_RUNTIME)
# import <objc/objc-api.h>







<
<
<
<
<
<
<







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 "OFObject.h"








#include <stddef.h>
#include <stdint.h>

#if defined(OF_APPLE_RUNTIME) || defined(OF_GNU_RUNTIME)
# import <objc/runtime.h>
#elif defined(OF_OLD_GNU_RUNTIME)
# import <objc/objc-api.h>

Modified src/of_asprintf.h from [72f2853142] to [1ac911f233].

9
10
11
12
13
14
15







16
17
18
19
20
21
22
23
24
25
26
27
28
 * the packaging of this file.
 *
 * 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.
 */








#include <stdarg.h>

#import "macros.h"

#ifdef __cplusplus
extern "C" {
#endif
extern int of_asprintf(char**, const char*, ...);
extern int of_vasprintf(char**, const char*, va_list);
#ifdef __cplusplus
}
#endif







>
>
>
>
>
>
>













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
 * the packaging of this file.
 *
 * 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.
 */

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <stdarg.h>

#import "macros.h"

#ifdef __cplusplus
extern "C" {
#endif
extern int of_asprintf(char**, const char*, ...);
extern int of_vasprintf(char**, const char*, va_list);
#ifdef __cplusplus
}
#endif

Modified src/of_strptime.h from [525a635a44] to [1317791ecd].

9
10
11
12
13
14
15







16
17
18
19
20
21
22
23
24
25
 * the packaging of this file.
 *
 * 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.
 */








#include <time.h>

#ifdef __cplusplus
extern "C" {
#endif
extern const char* of_strptime(const char*, const char*, struct tm *tm);
#ifdef __cplusplus
}
#endif







>
>
>
>
>
>
>










9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 * the packaging of this file.
 *
 * 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.
 */

#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <time.h>

#ifdef __cplusplus
extern "C" {
#endif
extern const char* of_strptime(const char*, const char*, struct tm *tm);
#ifdef __cplusplus
}
#endif

Modified utils/objfw-compile from [a3e6a7fd23] to [950c191148].

82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
			if test x"$plugin" = x"yes"; then
				echo "You can't use --lib and --plugin!"
				exit 1
			fi

			shift

			if ! echo "$1" | grep "^[0-9]\+\.[0-9]\+" >/dev/null
			then
				echo "$1 is not a valid library version!"
				exit 1
			fi

			export LIB_MAJOR="${1%.*}"
			export LIB_MINOR="${1#*.}"







|







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
			if test x"$plugin" = x"yes"; then
				echo "You can't use --lib and --plugin!"
				exit 1
			fi

			shift

			if ! echo "$1" | grep "^[0-9]\+\.[0-9]\+$" >/dev/null
			then
				echo "$1 is not a valid library version!"
				exit 1
			fi

			export LIB_MAJOR="${1%.*}"
			export LIB_MINOR="${1#*.}"

Modified utils/objfw-config.in from [d7871a7cf4] to [a869d05900].

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
LDFLAGS_REEXPORT="@LDFLAGS_REEXPORT@"
LDFLAGS_RPATH="@LDFLAGS_RPATH@"
LIBS="-L${libdir} -lobjfw @LIBS@"
PLUGIN_CFLAGS="@PLUGIN_CFLAGS@"
PLUGIN_LDFLAGS="@PLUGIN_LDFLAGS@"
PLUGIN_SUFFIX="@PLUGIN_SUFFIX@"
PROG_SUFFIX="@EXEEXT@"
VERSION="0.6-dev"

show_help() {
	cat <<__EOF__
objfw-config: Available arguments are:

	--all		Outputs all flags + libs
	--cflags	Outputs the required CFLAGS







|







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
LDFLAGS_REEXPORT="@LDFLAGS_REEXPORT@"
LDFLAGS_RPATH="@LDFLAGS_RPATH@"
LIBS="-L${libdir} -lobjfw @LIBS@"
PLUGIN_CFLAGS="@PLUGIN_CFLAGS@"
PLUGIN_LDFLAGS="@PLUGIN_LDFLAGS@"
PLUGIN_SUFFIX="@PLUGIN_SUFFIX@"
PROG_SUFFIX="@EXEEXT@"
VERSION="0.6"

show_help() {
	cat <<__EOF__
objfw-config: Available arguments are:

	--all		Outputs all flags + libs
	--cflags	Outputs the required CFLAGS