ObjFW  Changes On Branch 017684aac9fb216c

Changes In Branch 0.5 Through [017684aac9] Excluding Merge-Ins

This is equivalent to a diff from 91d438b5d2 to 017684aac9

2011-04-25
22:39
Fix missing release in OFXMLElement. check-in: d948114b2a user: js tags: 0.5
18:04
Update ChangeLog. check-in: 017684aac9 user: js tags: 0.5, 0.5.2-release
18:04
Set version to 0.5.2. check-in: 4c15904184 user: js tags: 0.5
2011-04-09
15:41
OFXMLParser: Don't allow character data before the document. check-in: 0cc997a1d7 user: js tags: trunk
12:31
Branch for 0.5. check-in: 5203170e82 user: js tags: 0.5
12:30
Also test comments in -[stringValue]. check-in: 91d438b5d2 user: js tags: trunk
2011-04-08
07:05
Add -[isListening] to OFTCPSocket. check-in: 054a38e82d user: js tags: trunk

Modified ChangeLog from [f70c6798b5] to [842b4df9cf].

1
2
3
4





































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






































ObjFW 0.3.1 -> 0.4-alpha1, 03.01.2011
 * ObjFW is now available under the terms of the QPL, GPLv2 and GPLv3.
 + Support for blocks was added, including a blocks runtime.
 + Added support for the new GNU runtime, introduced in GCC 4.6.
 * Objects returned from collections are no longer retained and autoreleased.
 + Added new classes OFXMLParser, OFXMLElement, OFXMLAttribute and
   OFXMLElementBuilder.




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







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

ObjFW 0.5.1 -> ObjFW 0.5.2, 25.4.2011
 * Fix double-retain in OFList.
 * Don't ignore the timeout in OFStreamObserver when using select().
 * Do -[OFURL copy] in a try block to prevent a leak when an exception occurs.
 * Fix too big buffer in -[OFMutableString _applyTable:withSize:].
 * Call madvise() on the correct length variable so it covers the whole string.
 * Fix a warning when sizeof(size_t) < sizeof(long long).
 * Skip possible BOMs when appending strings.

ObjFW 0.5 -> ObjFW 0.5.1, 21.04.2011
 * Work around a wrong warning produced by Apple GCC 4.0.1 which would cause
   the build to fail due to -Werror.
 * Call objc_thread_{add,remove} when using the GNU runtime to make sure the
   runtime knows about our thread.
 * Detach a thread before restarting if it was never joined.
 * Release the old return value when restarting a thread.

ObjFW 0.4-alpha1 -> 0.5, 09.04.2011
 + %@ is now allowed in format strings.
 + Added of_log for easy logging.
 * Exceptions have one header per exception now.
 * Lots of exception improvements.
 * Huge improvements in XML handling.
 * Improvements in socket handling, including improved API.
 * OFStreamObserver is now thread-safe and stops the current observe call when
   the set of streams to observe is modified.
 + New class OFURL.
 + New class OFHTTPRequest.
 + New class OFCondition.
 * Improvements in objfw-compile.
 + Blocks can be used together with Cocoa now.
 + When linking ObjFW and Cocoa, OFAutoreleasePools are used by both now.
 + Support for Base64.
 + Use a real Xcode project instead of just calling make.
 + Add Haiku to the list of supported platforms.
 * Lots of small bugfixes and countless small changes. Read the commits!

ObjFW 0.3.1 -> 0.4-alpha1, 03.01.2011
 * ObjFW is now available under the terms of the QPL, GPLv2 and GPLv3.
 + Support for blocks was added, including a blocks runtime.
 + Added support for the new GNU runtime, introduced in GCC 4.6.
 * Objects returned from collections are no longer retained and autoreleased.
 + Added new classes OFXMLParser, OFXMLElement, OFXMLAttribute and
   OFXMLElementBuilder.

Modified Info.plist from [2784921274] to [ae9a2b96c2].

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.4-dev</string>
	<key>CFBundleShortVersionString</key>
	<string>0.4-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.5.2</string>
	<key>CFBundleShortVersionString</key>
	<string>0.5.2</string>
</dict>
</plist>

Modified README from [2bffcb61ce] to [3ed6345b53].

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

    $ ./autogen.sh


BUILDING AS A MAC OS X FRAMEWORK

  It is also possible to build ObjFW as a Mac OS X framework. To do so,
  just execute xcodebuild in the root directory of ObjFW or open the
  .xcodeproj in Xcode and choose Build -> Build from the menu. Copy the
  resulting ObjFW.framework to /Library/Frameworks and you are done.


USING THE MAC OS X FRAMWORK IN XCODE

  To use the Mac OS X framework in Xcode, you need to add the .framework
  to your project and add the following flags to "Other C Flags":







|
|







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

    $ ./autogen.sh


BUILDING AS A MAC OS X FRAMEWORK

  It is also possible to build ObjFW as a Mac OS X framework. To do so,
  just execute xcodebuild -target ObjFW in the root directory of ObjFW or open
  the .xcodeproj in Xcode and choose Build -> Build from the menu. Copy the
  resulting ObjFW.framework to /Library/Frameworks and you are done.


USING THE MAC OS X FRAMWORK IN XCODE

  To use the Mac OS X framework in Xcode, you need to add the .framework
  to your project and add the following flags to "Other C Flags":

Modified configure.ac from [c2f04c07fa] to [cb274217e0].

1
2
3
4
5
6
7
8
AC_INIT(ObjFW, 0.4-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.5.2, 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"

Modified extra.mk.in from [48b5fcc6f3] to [a6cef7bb66].

1
2
3
4
5
6
7
8
9
10
OBJFW_SHARED_LIB = @OBJFW_SHARED_LIB@
OBJFW_STATIC_LIB = @OBJFW_STATIC_LIB@
OBJFW_LIB_MAJOR = 3
OBJFW_LIB_MINOR = 0
OBJFW_LIB_MAJOR_MINOR = ${OBJFW_LIB_MAJOR}.${OBJFW_LIB_MINOR}

ASPRINTF_M = @ASPRINTF_M@
ATOMIC_H = @ATOMIC_H@
BIN_PREFIX = @BIN_PREFIX@
EXCEPTIONS_A = @EXCEPTIONS_A@


|







1
2
3
4
5
6
7
8
9
10
OBJFW_SHARED_LIB = @OBJFW_SHARED_LIB@
OBJFW_STATIC_LIB = @OBJFW_STATIC_LIB@
OBJFW_LIB_MAJOR = 4
OBJFW_LIB_MINOR = 0
OBJFW_LIB_MAJOR_MINOR = ${OBJFW_LIB_MAJOR}.${OBJFW_LIB_MINOR}

ASPRINTF_M = @ASPRINTF_M@
ATOMIC_H = @ATOMIC_H@
BIN_PREFIX = @BIN_PREFIX@
EXCEPTIONS_A = @EXCEPTIONS_A@

Modified src/OFHTTPRequest.m from [5637b3f014] to [c8b35b7eac].

163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
	@try {
		OFString *line, *path;
		OFMutableDictionary *s_headers;
		OFDataArray *data;
		OFEnumerator *enumerator;
		OFString *key;
		int status;
		const char *t;

		[sock connectToHost: [URL host]
			     onPort: [URL port]];

		/*
		 * Work around a bug with packet bisection in lighttpd when
		 * using HTTPS.







|







163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
	@try {
		OFString *line, *path;
		OFMutableDictionary *s_headers;
		OFDataArray *data;
		OFEnumerator *enumerator;
		OFString *key;
		int status;
		const char *t = NULL;

		[sock connectToHost: [URL host]
			     onPort: [URL port]];

		/*
		 * Work around a bug with packet bisection in lighttpd when
		 * using HTTPS.

Modified src/OFList.m from [ca60541ce0] to [80de30a57f].

77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
	lastListObject = o;
	if (firstListObject == NULL)
		firstListObject = o;

	count++;
	mutations++;

	[obj retain];

	return o;
}

- (of_list_object_t*)prependObject: (id)obj
{
	of_list_object_t *o;








<
<







77
78
79
80
81
82
83


84
85
86
87
88
89
90
	lastListObject = o;
	if (firstListObject == NULL)
		firstListObject = o;

	count++;
	mutations++;



	return o;
}

- (of_list_object_t*)prependObject: (id)obj
{
	of_list_object_t *o;

101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
	firstListObject = o;
	if (lastListObject == NULL)
		lastListObject = o;

	count++;
	mutations++;

	[obj retain];

	return o;
}

- (of_list_object_t*)insertObject: (id)obj
		 beforeListObject: (of_list_object_t*)listobj
{
	of_list_object_t *o;







<
<







99
100
101
102
103
104
105


106
107
108
109
110
111
112
	firstListObject = o;
	if (lastListObject == NULL)
		lastListObject = o;

	count++;
	mutations++;



	return o;
}

- (of_list_object_t*)insertObject: (id)obj
		 beforeListObject: (of_list_object_t*)listobj
{
	of_list_object_t *o;
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142

	if (listobj == firstListObject)
		firstListObject = o;

	count++;
	mutations++;

	[obj retain];

	return o;
}

- (of_list_object_t*)insertObject: (id)obj
		  afterListObject: (of_list_object_t*)listobj
{
	of_list_object_t *o;







<
<







123
124
125
126
127
128
129


130
131
132
133
134
135
136

	if (listobj == firstListObject)
		firstListObject = o;

	count++;
	mutations++;



	return o;
}

- (of_list_object_t*)insertObject: (id)obj
		  afterListObject: (of_list_object_t*)listobj
{
	of_list_object_t *o;
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168

	if (listobj == lastListObject)
		lastListObject = o;

	count++;
	mutations++;

	[obj retain];

	return o;
}

- (void)removeListObject: (of_list_object_t*)listobj
{
	if (listobj->prev != NULL)
		listobj->prev->next = listobj->next;







<
<







147
148
149
150
151
152
153


154
155
156
157
158
159
160

	if (listobj == lastListObject)
		lastListObject = o;

	count++;
	mutations++;



	return o;
}

- (void)removeListObject: (of_list_object_t*)listobj
{
	if (listobj->prev != NULL)
		listobj->prev->next = listobj->next;
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
			if (new->firstListObject == NULL)
				new->firstListObject = o;
			if (prev != NULL)
				prev->next = o;

			new->count++;

			[o->object retain];

			prev = o;
		}
	} @catch (id e) {
		[new release];
		@throw e;
	}








<
<







247
248
249
250
251
252
253


254
255
256
257
258
259
260
			if (new->firstListObject == NULL)
				new->firstListObject = o;
			if (prev != NULL)
				prev->next = o;

			new->count++;



			prev = o;
		}
	} @catch (id e) {
		[new release];
		@throw e;
	}

Modified src/OFMutableString.m from [fe52a06baf] to [6944810146].

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
			if ((t = table[0][*p]) != 0)
				*p = t;

		return;
	}

	ulen = [self length];
	ustr = [self allocMemoryForNItems: [self length]
				 withSize: ulen];

	i = 0;
	j = 0;
	nlen = 0;

	while (i < length) {
		clen = of_string_utf8_to_unicode(string + i, length - i, &c);

		if (clen == 0 || c > 0x10FFFF) {
			[self freeMemory: ustr];







|
|

<
|







61
62
63
64
65
66
67
68
69
70

71
72
73
74
75
76
77
78
			if ((t = table[0][*p]) != 0)
				*p = t;

		return;
	}

	ulen = [self length];
	ustr = [self allocMemoryForNItems: ulen
				 withSize: sizeof(of_unichar_t)];


	i = j = 0;
	nlen = 0;

	while (i < length) {
		clen = of_string_utf8_to_unicode(string + i, length - i, &c);

		if (clen == 0 || c > 0x10FFFF) {
			[self freeMemory: ustr];
134
135
136
137
138
139
140





141
142
143
144
145
146
147
- (void)setToCString: (const char*)str
{
	size_t len;

	[self freeMemory: string];

	len = strlen(str);






	switch (of_string_check_utf8(str, len)) {
	case 0:
		isUTF8 = NO;
		break;
	case 1:
		isUTF8 = YES;







>
>
>
>
>







133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
- (void)setToCString: (const char*)str
{
	size_t len;

	[self freeMemory: string];

	len = strlen(str);

	if (len >= 3 && !memcmp(str, "\xEF\xBB\xBF", 3)) {
		str += 3;
		len -= 3;
	}

	switch (of_string_check_utf8(str, len)) {
	case 0:
		isUTF8 = NO;
		break;
	case 1:
		isUTF8 = YES;
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





185
186
187
188
189
190
191
}

- (void)appendCString: (const char*)str
{
	size_t strlength;

	strlength = strlen(str);






	switch (of_string_check_utf8(str, strlength)) {
	case 1:
		isUTF8 = YES;
		break;
	case -1:
		@throw [OFInvalidEncodingException newWithClass: isa];
	}

	string = [self resizeMemory: string
			     toSize: length + strlength + 1];
	memcpy(string + length, str, strlength + 1);
	length += strlength;
}

- (void)appendCString: (const char*)str
	   withLength: (size_t)len
{





	switch (of_string_check_utf8(str, len)) {
	case 1:
		isUTF8 = YES;
		break;
	case -1:
		@throw [OFInvalidEncodingException newWithClass: isa];
	}







>
>
>
>
>


















>
>
>
>
>







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
193
194
195
196
197
198
199
200
201
202
203
204
205
}

- (void)appendCString: (const char*)str
{
	size_t strlength;

	strlength = strlen(str);

	if (strlength >= 3 && !memcmp(str, "\xEF\xBB\xBF", 3)) {
		str += 3;
		strlength -= 3;
	}

	switch (of_string_check_utf8(str, strlength)) {
	case 1:
		isUTF8 = YES;
		break;
	case -1:
		@throw [OFInvalidEncodingException newWithClass: isa];
	}

	string = [self resizeMemory: string
			     toSize: length + strlength + 1];
	memcpy(string + length, str, strlength + 1);
	length += strlength;
}

- (void)appendCString: (const char*)str
	   withLength: (size_t)len
{
	if (len >= 3 && !memcmp(str, "\xEF\xBB\xBF", 3)) {
		str += 3;
		len -= 3;
	}

	switch (of_string_check_utf8(str, len)) {
	case 1:
		isUTF8 = YES;
		break;
	case -1:
		@throw [OFInvalidEncodingException newWithClass: isa];
	}
264
265
266
267
268
269
270
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
			  atIndex: 0];
}

- (void)reverse
{
	size_t i, j, len = length / 2;

	madvise(string, len, MADV_SEQUENTIAL);

	/* We reverse all bytes and restore UTF-8 later, if necessary */
	for (i = 0, j = length - 1; i < len; i++, j--) {
		string[i] ^= string[j];
		string[j] ^= string[i];
		string[i] ^= string[j];
	}

	if (!isUTF8) {
		madvise(string, len, MADV_NORMAL);
		return;
	}

	for (i = 0; i < length; i++) {
		/* ASCII */
		if (OF_LIKELY(!(string[i] & 0x80)))
			continue;

		/* A start byte can't happen first as we reversed everything */
		if (OF_UNLIKELY(string[i] & 0x40)) {
			madvise(string, len, MADV_NORMAL);
			@throw [OFInvalidEncodingException newWithClass: isa];
		}

		/* Next byte must not be ASCII */
		if (OF_UNLIKELY(length < i + 1 || !(string[i + 1] & 0x80))) {
			madvise(string, len, MADV_NORMAL);
			@throw [OFInvalidEncodingException newWithClass: isa];
		}

		/* Next byte is the start byte */
		if (OF_LIKELY(string[i + 1] & 0x40)) {
			string[i] ^= string[i + 1];
			string[i + 1] ^= string[i];
			string[i] ^= string[i + 1];

			i++;
			continue;
		}

		/* Second next byte must not be ASCII */
		if (OF_UNLIKELY(length < i + 2 || !(string[i + 2] & 0x80))) {
			madvise(string, len, MADV_NORMAL);
			@throw [OFInvalidEncodingException newWithClass: isa];
		}

		/* Second next byte is the start byte */
		if (OF_LIKELY(string[i + 2] & 0x40)) {
			string[i] ^= string[i + 2];
			string[i + 2] ^= string[i];
			string[i] ^= string[i + 2];

			i += 2;
			continue;
		}

		/* Third next byte must not be ASCII */
		if (OF_UNLIKELY(length < i + 3 || !(string[i + 3] & 0x80))) {
			madvise(string, len, MADV_NORMAL);
			@throw [OFInvalidEncodingException newWithClass: isa];
		}

		/* Third next byte is the start byte */
		if (OF_LIKELY(string[i + 3] & 0x40)) {
			string[i] ^= string[i + 3];
			string[i + 3] ^= string[i];
			string[i] ^= string[i + 3];

			string[i + 1] ^= string[i + 2];
			string[i + 2] ^= string[i + 1];
			string[i + 1] ^= string[i + 2];

			i += 3;
			continue;
		}

		/* UTF-8 does not allow more than 4 bytes per character */
		madvise(string, len, MADV_NORMAL);
		@throw [OFInvalidEncodingException newWithClass: isa];
	}

	madvise(string, len, MADV_NORMAL);
}

- (void)upper
{
	[self _applyTable: of_unicode_upper_table
		 withSize: OF_UNICODE_UPPER_TABLE_SIZE];
}







|









|










|





|















|















|


















|



|







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
364
365
366
367
368
369
370
371
372
373
374
			  atIndex: 0];
}

- (void)reverse
{
	size_t i, j, len = length / 2;

	madvise(string, length, MADV_SEQUENTIAL);

	/* We reverse all bytes and restore UTF-8 later, if necessary */
	for (i = 0, j = length - 1; i < len; i++, j--) {
		string[i] ^= string[j];
		string[j] ^= string[i];
		string[i] ^= string[j];
	}

	if (!isUTF8) {
		madvise(string, length, MADV_NORMAL);
		return;
	}

	for (i = 0; i < length; i++) {
		/* ASCII */
		if (OF_LIKELY(!(string[i] & 0x80)))
			continue;

		/* A start byte can't happen first as we reversed everything */
		if (OF_UNLIKELY(string[i] & 0x40)) {
			madvise(string, length, MADV_NORMAL);
			@throw [OFInvalidEncodingException newWithClass: isa];
		}

		/* Next byte must not be ASCII */
		if (OF_UNLIKELY(length < i + 1 || !(string[i + 1] & 0x80))) {
			madvise(string, length, MADV_NORMAL);
			@throw [OFInvalidEncodingException newWithClass: isa];
		}

		/* Next byte is the start byte */
		if (OF_LIKELY(string[i + 1] & 0x40)) {
			string[i] ^= string[i + 1];
			string[i + 1] ^= string[i];
			string[i] ^= string[i + 1];

			i++;
			continue;
		}

		/* Second next byte must not be ASCII */
		if (OF_UNLIKELY(length < i + 2 || !(string[i + 2] & 0x80))) {
			madvise(string, length, MADV_NORMAL);
			@throw [OFInvalidEncodingException newWithClass: isa];
		}

		/* Second next byte is the start byte */
		if (OF_LIKELY(string[i + 2] & 0x40)) {
			string[i] ^= string[i + 2];
			string[i + 2] ^= string[i];
			string[i] ^= string[i + 2];

			i += 2;
			continue;
		}

		/* Third next byte must not be ASCII */
		if (OF_UNLIKELY(length < i + 3 || !(string[i + 3] & 0x80))) {
			madvise(string, length, MADV_NORMAL);
			@throw [OFInvalidEncodingException newWithClass: isa];
		}

		/* Third next byte is the start byte */
		if (OF_LIKELY(string[i + 3] & 0x40)) {
			string[i] ^= string[i + 3];
			string[i + 3] ^= string[i];
			string[i] ^= string[i + 3];

			string[i + 1] ^= string[i + 2];
			string[i + 2] ^= string[i + 1];
			string[i + 1] ^= string[i + 2];

			i += 3;
			continue;
		}

		/* UTF-8 does not allow more than 4 bytes per character */
		madvise(string, length, MADV_NORMAL);
		@throw [OFInvalidEncodingException newWithClass: isa];
	}

	madvise(string, length, MADV_NORMAL);
}

- (void)upper
{
	[self _applyTable: of_unicode_upper_table
		 withSize: OF_UNICODE_UPPER_TABLE_SIZE];
}

Modified src/OFStreamObserver.m from [90468a0a65] to [4bdac00ac8].

485
486
487
488
489
490
491



492
493
494
495
496
497
498
	FD_COPY(&exceptfds, &exceptfds_);
# else
	readfds_ = readfds;
	writefds_ = writefds;
	exceptfds_ = exceptfds;
# endif




	if (select(nfds, &readfds_, &writefds_, &exceptfds_,
	    (timeout != -1 ? &tv : NULL)) < 1)
		return NO;

	if (FD_ISSET(cancelFd[0], &readfds_)) {
		char buf;
#ifndef _WIN32







>
>
>







485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
	FD_COPY(&exceptfds, &exceptfds_);
# else
	readfds_ = readfds;
	writefds_ = writefds;
	exceptfds_ = exceptfds;
# endif

	tv.tv_sec = timeout / 1000;
	tv.tv_usec = (timeout % 1000) * 1000;

	if (select(nfds, &readfds_, &writefds_, &exceptfds_,
	    (timeout != -1 ? &tv : NULL)) < 1)
		return NO;

	if (FD_ISSET(cancelFd[0], &readfds_)) {
		char buf;
#ifndef _WIN32

Modified src/OFString.m from [a034b6e9c4] to [d61077ef08].

662
663
664
665
666
667
668



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
		OFFile *file;

		if (stat([path cString], &s) == -1)
			@throw [OFOpenFileFailedException newWithClass: isa
								  path: path
								  mode: @"rb"];




		file = [[OFFile alloc] initWithPath: path
					       mode: @"rb"];

		@try {
			tmp = [self allocMemoryWithSize: s.st_size];

			[file readExactlyNBytes: s.st_size
				     intoBuffer: tmp];
		} @finally {
			[file release];
		}
	} @catch (id e) {
		[self release];
		@throw e;
	}

	self = [self initWithCString: tmp
			    encoding: encoding
			      length: s.st_size];
	[self freeMemory: tmp];

	return self;
}

- initWithContentsOfURL: (OFURL*)url
{







>
>
>




|

|











|







662
663
664
665
666
667
668
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
		OFFile *file;

		if (stat([path cString], &s) == -1)
			@throw [OFOpenFileFailedException newWithClass: isa
								  path: path
								  mode: @"rb"];

		if (s.st_size > SIZE_MAX)
			@throw [OFOutOfRangeException newWithClass: isa];

		file = [[OFFile alloc] initWithPath: path
					       mode: @"rb"];

		@try {
			tmp = [self allocMemoryWithSize: (size_t)s.st_size];

			[file readExactlyNBytes: (size_t)s.st_size
				     intoBuffer: tmp];
		} @finally {
			[file release];
		}
	} @catch (id e) {
		[self release];
		@throw e;
	}

	self = [self initWithCString: tmp
			    encoding: encoding
			      length: (size_t)s.st_size];
	[self freeMemory: tmp];

	return self;
}

- initWithContentsOfURL: (OFURL*)url
{

Modified src/OFThread.m from [fd76b79d25] to [926b087d59].

18
19
20
21
22
23
24




25
26
27
28
29
30
31

#ifndef _WIN32
# include <unistd.h>
# include <sched.h>
#else
# include <windows.h>
#endif





#import "OFThread.h"
#import "OFList.h"
#import "OFDate.h"
#import "OFAutoreleasePool.h"

#import "OFConditionBroadcastFailedException.h"







>
>
>
>







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

#ifndef _WIN32
# include <unistd.h>
# include <sched.h>
#else
# include <windows.h>
#endif

#if defined(OF_GNU_RUNTIME) || defined(OF_OLD_GNU_RUNTIME)
# import <objc/thr.h>
#endif

#import "OFThread.h"
#import "OFList.h"
#import "OFDate.h"
#import "OFAutoreleasePool.h"

#import "OFConditionBroadcastFailedException.h"
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

static OFList *tlskeys;
static of_tlskey_t thread_self;

static id
call_main(id obj)
{




	if (!of_tlskey_set(thread_self, obj))
		@throw [OFInitializationFailedException
		    newWithClass: [obj class]];

	/*
	 * Nasty workaround for thread implementations which can't return a
	 * value on join.
	 */
	((OFThread*)obj)->retval = [[obj main] retain];

	[obj handleTermination];

	((OFThread*)obj)->running = OF_THREAD_WAITING_FOR_JOIN;

	[OFTLSKey callAllDestructors];
	[OFAutoreleasePool releaseAll];

	[obj release];





	return 0;
}

@implementation OFThread
+ (void)initialize
{







>
>
>
>


















>
>
>
>







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
85
86
87
88
89
90

static OFList *tlskeys;
static of_tlskey_t thread_self;

static id
call_main(id obj)
{
#if defined(OF_GNU_RUNTIME) || defined(OF_OLD_GNU_RUNTIME)
	objc_thread_add();
#endif

	if (!of_tlskey_set(thread_self, obj))
		@throw [OFInitializationFailedException
		    newWithClass: [obj class]];

	/*
	 * Nasty workaround for thread implementations which can't return a
	 * value on join.
	 */
	((OFThread*)obj)->retval = [[obj main] retain];

	[obj handleTermination];

	((OFThread*)obj)->running = OF_THREAD_WAITING_FOR_JOIN;

	[OFTLSKey callAllDestructors];
	[OFAutoreleasePool releaseAll];

	[obj release];

#if defined(OF_GNU_RUNTIME) || defined(OF_OLD_GNU_RUNTIME)
	objc_thread_remove();
#endif

	return 0;
}

@implementation OFThread
+ (void)initialize
{
204
205
206
207
208
209
210




211
212
213
214
215
216
217
		thread->running = OF_THREAD_WAITING_FOR_JOIN;
	}

	[OFTLSKey callAllDestructors];
	[OFAutoreleasePool releaseAll];

	[thread release];





	of_thread_exit();
}

- initWithObject: (id)obj
{
	self = [super init];







>
>
>
>







216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
		thread->running = OF_THREAD_WAITING_FOR_JOIN;
	}

	[OFTLSKey callAllDestructors];
	[OFAutoreleasePool releaseAll];

	[thread release];

#if defined(OF_GNU_RUNTIME) || defined(OF_OLD_GNU_RUNTIME)
	objc_thread_remove();
#endif

	of_thread_exit();
}

- initWithObject: (id)obj
{
	self = [super init];
239
240
241
242
243
244
245





246
247
248
249
250
251
252
}

- (void)start
{
	if (running == OF_THREAD_RUNNING)
		@throw [OFThreadStillRunningException newWithClass: isa
							    thread: self];






	[self retain];

	if (!of_thread_new(&thread, call_main, self)) {
		[self release];
		@throw [OFThreadStartFailedException newWithClass: isa
							   thread: self];







>
>
>
>
>







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

- (void)start
{
	if (running == OF_THREAD_RUNNING)
		@throw [OFThreadStillRunningException newWithClass: isa
							    thread: self];

	if (running == OF_THREAD_WAITING_FOR_JOIN) {
		of_thread_detach(thread);
		[retval release];
	}

	[self retain];

	if (!of_thread_new(&thread, call_main, self)) {
		[self release];
		@throw [OFThreadStartFailedException newWithClass: isa
							   thread: self];
268
269
270
271
272
273
274







275
276
277
278
279
280
281

- (void)dealloc
{
	if (running == OF_THREAD_RUNNING)
		@throw [OFThreadStillRunningException newWithClass: isa
							    thread: self];








	[object release];
	[retval release];

	[super dealloc];
}
@end








>
>
>
>
>
>
>







289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309

- (void)dealloc
{
	if (running == OF_THREAD_RUNNING)
		@throw [OFThreadStillRunningException newWithClass: isa
							    thread: self];

	/*
	 * We should not be running anymore, but call detach in order to free
	 * the resources.
	 */
	if (running == OF_THREAD_WAITING_FOR_JOIN)
		of_thread_detach(thread);

	[object release];
	[retval release];

	[super dealloc];
}
@end

Modified src/OFURL.m from [ae9145fa4e] to [0a4862ec8c].

358
359
360
361
362
363
364

365
366
367
368
369
370
371
372
373




374
375
376
377
378
379
380
	return hash;
}

- copy
{
	OFURL *new = [[OFURL alloc] init];


	new->scheme = [scheme copy];
	new->host = [host copy];
	new->port = port;
	new->user = [user copy];
	new->password = [password copy];
	new->path = [path copy];
	new->parameters = [parameters copy];
	new->query = [query copy];
	new->fragment = [fragment copy];





	return new;
}

- (OFString*)scheme
{
	OF_GETTER(scheme, YES)







>
|
|
|
|
|
|
|
|
|
>
>
>
>







358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
	return hash;
}

- copy
{
	OFURL *new = [[OFURL alloc] init];

	@try {
		new->scheme = [scheme copy];
		new->host = [host copy];
		new->port = port;
		new->user = [user copy];
		new->password = [password copy];
		new->path = [path copy];
		new->parameters = [parameters copy];
		new->query = [query copy];
		new->fragment = [fragment copy];
	} @catch (id e) {
		[new release];
		@throw e;
	}

	return new;
}

- (OFString*)scheme
{
	OF_GETTER(scheme, YES)

Modified src/OFXMLParser.h from [4bfeec9a6e] to [0a269ecfb6].

175
176
177
178
179
180
181

182
183
184
185
186
187
188
	of_xml_parser_element_end_block_t elementEndHandler;
	of_xml_parser_string_block_t charactersHandler;
	of_xml_parser_string_block_t CDATAHandler;
	of_xml_parser_string_block_t commentHandler;
	of_xml_parser_unknown_entity_block_t unknownEntityHandler;
#endif
	size_t level;

	size_t lineNumber;
	BOOL lastCarriageReturn;
	BOOL finishedParsing;
}

#ifdef OF_HAVE_PROPERTIES
@property (retain) id <OFXMLParserDelegate> delegate;







>







175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
	of_xml_parser_element_end_block_t elementEndHandler;
	of_xml_parser_string_block_t charactersHandler;
	of_xml_parser_string_block_t CDATAHandler;
	of_xml_parser_string_block_t commentHandler;
	of_xml_parser_unknown_entity_block_t unknownEntityHandler;
#endif
	size_t level;
	BOOL acceptProlog;
	size_t lineNumber;
	BOOL lastCarriageReturn;
	BOOL finishedParsing;
}

#ifdef OF_HAVE_PROPERTIES
@property (retain) id <OFXMLParserDelegate> delegate;

Modified src/OFXMLParser.m from [e1f46dcc8c] to [669b34c861].

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
	[cache replaceOccurrencesOfString: @"\r\n"
			       withString: @"\n"];
	[cache replaceOccurrencesOfString: @"\r"
			       withString: @"\n"];
	return [cache stringByXMLUnescapingWithDelegate: delegate];
}

static OF_INLINE OFString*
namespace_for_prefix(OFString *prefix, OFArray *namespaces)
{
	OFDictionary **carray = [namespaces cArray];
	ssize_t i;

	if (prefix == nil)
		prefix = @"";







|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
	[cache replaceOccurrencesOfString: @"\r\n"
			       withString: @"\n"];
	[cache replaceOccurrencesOfString: @"\r"
			       withString: @"\n"];
	return [cache stringByXMLUnescapingWithDelegate: delegate];
}

static OFString*
namespace_for_prefix(OFString *prefix, OFArray *namespaces)
{
	OFDictionary **carray = [namespaces cArray];
	ssize_t i;

	if (prefix == nil)
		prefix = @"";
153
154
155
156
157
158
159

160
161
162
163
164
165
166

		pool = [[OFAutoreleasePool alloc] init];
		dict = [OFMutableDictionary dictionaryWithKeysAndObjects:
		    @"xml", @"http://www.w3.org/XML/1998/namespace",
		    @"xmlns", @"http://www.w3.org/2000/xmlns/", nil];
		[namespaces addObject: dict];


		lineNumber = 1;

		[pool release];
	} @catch (id e) {
		[self release];
		@throw e;
	}







>







153
154
155
156
157
158
159
160
161
162
163
164
165
166
167

		pool = [[OFAutoreleasePool alloc] init];
		dict = [OFMutableDictionary dictionaryWithKeysAndObjects:
		    @"xml", @"http://www.w3.org/XML/1998/namespace",
		    @"xmlns", @"http://www.w3.org/2000/xmlns/", nil];
		[namespaces addObject: dict];

		acceptProlog = YES;
		lineNumber = 1;

		[pool release];
	} @catch (id e) {
		[self release];
		@throw e;
	}
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282

283
284
285
286
287
288
289
	} @finally {
		[file release];
	}
}

/*
 * The following methods handle the different states of the parser. They are
 * lookup up in +[initialize] and put in a lookup table to speed things up.
 * One dispatch for every character would be way too slow!
 */

/* Not in a tag */
- (void)_parseOutsideTagWithBuffer: (const char*)buf
				 i: (size_t*)i
			      last: (size_t*)last
{
	size_t len;

	if (finishedParsing && buf[*i] != ' ' && buf[*i] != '\t' &&
	    buf[*i] != '\n' && buf[*i] != '\r' && buf[*i] != '<')

		@throw [OFMalformedXMLException newWithClass: isa
						      parser: self];

	if (buf[*i] != '<')
		return;

	if ((len = *i - *last) > 0)







|










|
|
>







264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
	} @finally {
		[file release];
	}
}

/*
 * The following methods handle the different states of the parser. They are
 * looked up in +[initialize] and put in a lookup table to speed things up.
 * One dispatch for every character would be way too slow!
 */

/* Not in a tag */
- (void)_parseOutsideTagWithBuffer: (const char*)buf
				 i: (size_t*)i
			      last: (size_t*)last
{
	size_t len;

	if ((finishedParsing || [previous count] < 1) && buf[*i] != ' ' &&
	    buf[*i] != '\t' && buf[*i] != '\n' && buf[*i] != '\r' &&
	    buf[*i] != '<')
		@throw [OFMalformedXMLException newWithClass: isa
						      parser: self];

	if (buf[*i] != '<')
		return;

	if ((len = *i - *last) > 0)
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
}

/* Tag was just opened */
- (void)_parseTagOpenedWithBuffer: (const char*)buf
				i: (size_t*)i
			     last: (size_t*)last
{
	if (finishedParsing && buf[*i] != '!')
		@throw [OFMalformedXMLException newWithClass: isa
						      parser: self];

	switch (buf[*i]) {
		case '?':
			*last = *i + 1;
			state = OF_XMLPARSER_IN_PROCESSING_INSTRUCTIONS;
			level = 0;
			break;
		case '/':
			*last = *i + 1;
			state = OF_XMLPARSER_IN_CLOSE_TAG_NAME;

			break;
		case '!':
			*last = *i + 1;
			state = OF_XMLPARSER_IN_EXCLAMATIONMARK;

			break;
		default:
			state = OF_XMLPARSER_IN_TAG_NAME;

			(*i)--;
			break;
	}
}



















































































/* Inside prolog */
- (void)_parseInProcessingInstructionsWithBuffer: (const char*)buf
					       i: (size_t*)i
					    last: (size_t*)last
{
	if (buf[*i] == '?')
		level = 1;
	else if (level == 1 && buf[*i] == '>') {







|












>




>



>





>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|







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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
}

/* Tag was just opened */
- (void)_parseTagOpenedWithBuffer: (const char*)buf
				i: (size_t*)i
			     last: (size_t*)last
{
	if (finishedParsing && buf[*i] != '!' && buf[*i] != '?')
		@throw [OFMalformedXMLException newWithClass: isa
						      parser: self];

	switch (buf[*i]) {
		case '?':
			*last = *i + 1;
			state = OF_XMLPARSER_IN_PROCESSING_INSTRUCTIONS;
			level = 0;
			break;
		case '/':
			*last = *i + 1;
			state = OF_XMLPARSER_IN_CLOSE_TAG_NAME;
			acceptProlog = NO;
			break;
		case '!':
			*last = *i + 1;
			state = OF_XMLPARSER_IN_EXCLAMATIONMARK;
			acceptProlog = NO;
			break;
		default:
			state = OF_XMLPARSER_IN_TAG_NAME;
			acceptProlog = NO;
			(*i)--;
			break;
	}
}

/* <?xml […]?> */
- (BOOL)_parseXMLProcessingInstructions: (OFString*)pi
{
	const char *pi_c;
	size_t i, last, pi_len;
	int xstate = 0;
	OFString *attr = nil;
	OFString *val = nil;
	char xdelim = 0;

	if (!acceptProlog)
		return NO;

	acceptProlog = NO;

	pi = [pi substringFromIndex: 3
			    toIndex: [pi length]];
	pi = [pi stringByDeletingLeadingAndTrailingWhitespaces];

	pi_c = [pi cString];
	pi_len = [pi cStringLength];

	for (i = last = 0; i < pi_len; i++) {
		switch (xstate) {
		case 0:
			if (pi_c[i] == ' ' || pi_c[i] == '\t' ||
			    pi_c[i] == '\r' || pi_c[i] == '\n')
				continue;

			last = i;
			xstate = 1;
			i--;

			break;
		case 1:
			if (pi_c[i] != '=')
				continue;

			attr = [OFString stringWithCString: pi_c + last
						    length: i - last];
			last = i + 1;
			xstate = 2;

			break;
		case 2:
			if (pi_c[i] != '\'' && pi_c[i] != '"')
				return NO;

			xdelim = pi_c[i];
			last = i + 1;
			xstate = 3;

			break;
		case 3:
			if (pi_c[i] != xdelim)
				continue;

			val = [OFString stringWithCString: pi_c + last
						   length: i - last];

			if ([attr isEqual: @"version"])
				if (![val hasPrefix: @"1."])
					return NO;

			if ([attr isEqual: @"encoding"])
				if ([val caseInsensitiveCompare: @"utf-8"] !=
				    OF_ORDERED_SAME)
					return NO;

			last = i + 1;
			xstate = 0;

			break;
		}
	}

	if (xstate != 0)
		return NO;

	return YES;
}

/* Inside processing instructions */
- (void)_parseInProcessingInstructionsWithBuffer: (const char*)buf
					       i: (size_t*)i
					    last: (size_t*)last
{
	if (buf[*i] == '?')
		level = 1;
	else if (level == 1 && buf[*i] == '>') {
366
367
368
369
370
371
372








373
374
375
376
377
378
379

		/*
		 * Class swizzle the string to be immutable. We pass it as
		 * OFString*, so it can't be modified anyway. But not swizzling
		 * it would create a real copy each time -[copy] is called.
		 */
		pi->isa = [OFString class];









		[delegate parser: self
		    foundProcessingInstructions: pi];

		[pool release];

		[cache setToCString: ""];







>
>
>
>
>
>
>
>







453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474

		/*
		 * Class swizzle the string to be immutable. We pass it as
		 * OFString*, so it can't be modified anyway. But not swizzling
		 * it would create a real copy each time -[copy] is called.
		 */
		pi->isa = [OFString class];

		if ([pi isEqual: @"xml"] || [pi hasPrefix: @"xml "] ||
		    [pi hasPrefix: @"xml\t"] || [pi hasPrefix: @"xml\r"] ||
		    [pi hasPrefix: @"xml\n"])
			if (![self _parseXMLProcessingInstructions: pi])
				@throw [OFMalformedXMLException
				    newWithClass: isa
					parser: self];

		[delegate parser: self
		    foundProcessingInstructions: pi];

		[pool release];

		[cache setToCString: ""];

Modified src/threading.h from [ad9f8119e0] to [ed61fa08de].

86
87
88
89
90
91
92











93
94
95
96
97
98
99
		return NO;

	CloseHandle(thread);

	return YES;
#endif
}












static OF_INLINE void
of_thread_exit()
{
#if defined(OF_HAVE_PTHREADS)
	pthread_exit(NULL);
#elif defined(_WIN32)







>
>
>
>
>
>
>
>
>
>
>







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
		return NO;

	CloseHandle(thread);

	return YES;
#endif
}

static OF_INLINE BOOL
of_thread_detach(of_thread_t thread)
{
#if defined(OF_HAVE_PTHREADS)
	return !pthread_detach(thread);
#elif defined(_WIN32)
	/* FIXME */
	return YES;
#endif
}

static OF_INLINE void
of_thread_exit()
{
#if defined(OF_HAVE_PTHREADS)
	pthread_exit(NULL);
#elif defined(_WIN32)

Modified tests/OFStringTests.m from [f41872f1e2] to [ac5088ce3b].

133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
	TEST(@"+[stringWithContentsOfURL:encoding]", (s[1] = [OFString
	    stringWithContentsOfURL: [OFURL URLWithString:
					 @"file://testfile.txt"]
			   encoding: OF_STRING_ENCODING_ISO_8859_1]) &&
	    [s[1] isEqual: @"testäöü"])

	TEST(@"-[appendCStringWithLength:]",
	    R([s[0] appendCString: "foobarqux" + 3
		       withLength: 3]) && [s[0] isEqual: @"foobar"])

	EXPECT_EXCEPTION(@"Detection of invalid UTF-8 encoding #1",
	    OFInvalidEncodingException,
	    [OFString stringWithCString: "\xE0\x80"])
	EXPECT_EXCEPTION(@"Detection of invalid UTF-8 encoding #2",
	    OFInvalidEncodingException,
	    [OFString stringWithCString: "\xF0\x80\x80\xC0"])







|
|







133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
	TEST(@"+[stringWithContentsOfURL:encoding]", (s[1] = [OFString
	    stringWithContentsOfURL: [OFURL URLWithString:
					 @"file://testfile.txt"]
			   encoding: OF_STRING_ENCODING_ISO_8859_1]) &&
	    [s[1] isEqual: @"testäöü"])

	TEST(@"-[appendCStringWithLength:]",
	    R([s[0] appendCString: "foo\xEF\xBB\xBF" "barqux" + 3
		       withLength: 6]) && [s[0] isEqual: @"foobar"])

	EXPECT_EXCEPTION(@"Detection of invalid UTF-8 encoding #1",
	    OFInvalidEncodingException,
	    [OFString stringWithCString: "\xE0\x80"])
	EXPECT_EXCEPTION(@"Detection of invalid UTF-8 encoding #2",
	    OFInvalidEncodingException,
	    [OFString stringWithCString: "\xF0\x80\x80\xC0"])

Modified tests/OFXMLParserTests.m from [1ef5f83edf] to [1a865f21e8].

372
373
374
375
376
377
378















379
380
381

	EXPECT_EXCEPTION(@"Detection of junk after the document #1",
	    OFMalformedXMLException, [parser parseString: @"a"])

	EXPECT_EXCEPTION(@"Detection of junk after the document #2",
	    OFMalformedXMLException, [parser parseString: @"<!["])
















	[pool drain];
}
@end







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



372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396

	EXPECT_EXCEPTION(@"Detection of junk after the document #1",
	    OFMalformedXMLException, [parser parseString: @"a"])

	EXPECT_EXCEPTION(@"Detection of junk after the document #2",
	    OFMalformedXMLException, [parser parseString: @"<!["])

	parser = [OFXMLParser parser];
	EXPECT_EXCEPTION(@"Detection of invalid XML processing instructions #1",
	    OFMalformedXMLException,
	    [parser parseString: @"<?xml version='2.0'?>"])

	parser = [OFXMLParser parser];
	EXPECT_EXCEPTION(@"Detection of invalid XML processing instructions #2",
	    OFMalformedXMLException,
	    [parser parseString: @"<?xml encoding='UTF-7'?>"])

	parser = [OFXMLParser parser];
	EXPECT_EXCEPTION(@"Detection of invalid XML processing instructions #3",
	    OFMalformedXMLException,
	    [parser parseString: @"<x><?xml?></x>"])

	[pool drain];
}
@end

Modified utils/objfw-config.in from [a79a727b4f] to [90a48cf7e6].

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.4-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.5.2"

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

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