ObjFW  Changes On Branch 0.6

Changes In Branch 0.6 Excluding Merge-Ins

This is equivalent to a diff from 83ad0894c0 to 503226703e

2020-05-23
16:47
Close 0.6 branch Closed-Leaf check-in: 503226703e user: js tags: 0.6
2012-03-21
09:23
Fix of_atomic_{add,sub}_ptr on AMD64. check-in: 10b7f839c5 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 ObjFW.xcodeproj/project.pbxproj from [f41def93c5] to [696c9ac9f5].

200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
		4B3D23E91337FCB000DD29B8 /* of_asprintf.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BB50DCF12F863C700C9393F /* of_asprintf.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23EA1337FCB000DD29B8 /* threading.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B67998B1099E7C50041064A /* threading.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23EB1337FCB000DD29B8 /* unicode.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B67998C1099E7C50041064A /* unicode.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23EE1337FFD000DD29B8 /* of_asprintf.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BB50DD012F863C700C9393F /* of_asprintf.m */; };
		4B3D5694139A617D0010A78F /* OFSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B3D5693139A617D0010A78F /* OFSerializationTests.m */; };
		4B45355313DCFE1E0037AB4D /* OFCountedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B45355113DCFE1E0037AB4D /* OFCountedSet.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B45355413DCFE1E0037AB4D /* OFCountedSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45355213DCFE1E0037AB4D /* OFCountedSet.m */; };
		4B48B95414DC23B100546D39 /* OFXMLProcessingInstructions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B48B95214DC23B100546D39 /* OFXMLProcessingInstructions.h */; };
		4B48B95514DC23B100546D39 /* OFXMLProcessingInstructions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B48B95314DC23B100546D39 /* OFXMLProcessingInstructions.m */; };
		4B49EA66143B39CE0005BBC6 /* OFXMLNodeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B49EA65143B39CE0005BBC6 /* OFXMLNodeTests.m */; };
		4B49EA6D143B3A090005BBC6 /* OFXMLCDATA.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B49EA67143B3A090005BBC6 /* OFXMLCDATA.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B49EA6E143B3A090005BBC6 /* OFXMLCDATA.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B49EA68143B3A090005BBC6 /* OFXMLCDATA.m */; };
		4B49EA6F143B3A090005BBC6 /* OFXMLCharacters.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B49EA69143B3A090005BBC6 /* OFXMLCharacters.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B49EA70143B3A090005BBC6 /* OFXMLCharacters.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B49EA6A143B3A090005BBC6 /* OFXMLCharacters.m */; };
		4B49EA71143B3A090005BBC6 /* OFXMLComment.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B49EA6B143B3A090005BBC6 /* OFXMLComment.h */; settings = {ATTRIBUTES = (Public, ); }; };







|







200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
		4B3D23E91337FCB000DD29B8 /* of_asprintf.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BB50DCF12F863C700C9393F /* of_asprintf.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23EA1337FCB000DD29B8 /* threading.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B67998B1099E7C50041064A /* threading.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23EB1337FCB000DD29B8 /* unicode.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B67998C1099E7C50041064A /* unicode.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23EE1337FFD000DD29B8 /* of_asprintf.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BB50DD012F863C700C9393F /* of_asprintf.m */; };
		4B3D5694139A617D0010A78F /* OFSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B3D5693139A617D0010A78F /* OFSerializationTests.m */; };
		4B45355313DCFE1E0037AB4D /* OFCountedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B45355113DCFE1E0037AB4D /* OFCountedSet.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B45355413DCFE1E0037AB4D /* OFCountedSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45355213DCFE1E0037AB4D /* OFCountedSet.m */; };
		4B48B95414DC23B100546D39 /* OFXMLProcessingInstructions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B48B95214DC23B100546D39 /* OFXMLProcessingInstructions.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B48B95514DC23B100546D39 /* OFXMLProcessingInstructions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B48B95314DC23B100546D39 /* OFXMLProcessingInstructions.m */; };
		4B49EA66143B39CE0005BBC6 /* OFXMLNodeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B49EA65143B39CE0005BBC6 /* OFXMLNodeTests.m */; };
		4B49EA6D143B3A090005BBC6 /* OFXMLCDATA.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B49EA67143B3A090005BBC6 /* OFXMLCDATA.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B49EA6E143B3A090005BBC6 /* OFXMLCDATA.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B49EA68143B3A090005BBC6 /* OFXMLCDATA.m */; };
		4B49EA6F143B3A090005BBC6 /* OFXMLCharacters.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B49EA69143B3A090005BBC6 /* OFXMLCharacters.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B49EA70143B3A090005BBC6 /* OFXMLCharacters.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B49EA6A143B3A090005BBC6 /* OFXMLCharacters.m */; };
		4B49EA71143B3A090005BBC6 /* OFXMLComment.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B49EA6B143B3A090005BBC6 /* OFXMLComment.h */; settings = {ATTRIBUTES = (Public, ); }; };
1181
1182
1183
1184
1185
1186
1187

1188
1189
1190
1191
1192
1193
1194
				4B49EA6F143B3A090005BBC6 /* OFXMLCharacters.h in Headers */,
				4B49EA71143B3A090005BBC6 /* OFXMLComment.h in Headers */,
				4B3D23E11337FCB000DD29B8 /* OFXMLElement.h in Headers */,
				4BB25E8C139C388A00F574EA /* OFXMLElement+Serialization.h in Headers */,
				4B3D23E21337FCB000DD29B8 /* OFXMLElementBuilder.h in Headers */,
				4B11005C14329B9A003A45D8 /* OFXMLNode.h in Headers */,
				4B3D23E31337FCB000DD29B8 /* OFXMLParser.h in Headers */,

				4B3D23E41337FCB000DD29B8 /* ObjFW.h in Headers */,
				4B3D23E51337FCB000DD29B8 /* asprintf.h in Headers */,
				4B3D23E61337FCB000DD29B8 /* atomic.h in Headers */,
				4B3D23E71337FCB000DD29B8 /* base64.h in Headers */,
				4B3D23E81337FCB000DD29B8 /* macros.h in Headers */,
				4BD98C03133814220048DD5B /* objfw-defs.h in Headers */,
				4B3D23E91337FCB000DD29B8 /* of_asprintf.h in Headers */,







>







1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
				4B49EA6F143B3A090005BBC6 /* OFXMLCharacters.h in Headers */,
				4B49EA71143B3A090005BBC6 /* OFXMLComment.h in Headers */,
				4B3D23E11337FCB000DD29B8 /* OFXMLElement.h in Headers */,
				4BB25E8C139C388A00F574EA /* OFXMLElement+Serialization.h in Headers */,
				4B3D23E21337FCB000DD29B8 /* OFXMLElementBuilder.h in Headers */,
				4B11005C14329B9A003A45D8 /* OFXMLNode.h in Headers */,
				4B3D23E31337FCB000DD29B8 /* OFXMLParser.h in Headers */,
				4B48B95414DC23B100546D39 /* OFXMLProcessingInstructions.h in Headers */,
				4B3D23E41337FCB000DD29B8 /* ObjFW.h in Headers */,
				4B3D23E51337FCB000DD29B8 /* asprintf.h in Headers */,
				4B3D23E61337FCB000DD29B8 /* atomic.h in Headers */,
				4B3D23E71337FCB000DD29B8 /* base64.h in Headers */,
				4B3D23E81337FCB000DD29B8 /* macros.h in Headers */,
				4BD98C03133814220048DD5B /* objfw-defs.h in Headers */,
				4B3D23E91337FCB000DD29B8 /* of_asprintf.h in Headers */,
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
				4B552552147AA5DB0003BF47 /* OFMutableString_UTF8.h in Headers */,
				4BA85BCE140ECCE800E91D51 /* OFSet_hashtable.h in Headers */,
				4B83F0F4142FDEFD00E4A821 /* OFStreamObserver_kqueue.h in Headers */,
				4B64D6EF1425381E007BDFB1 /* OFStreamObserver_poll.h in Headers */,
				4B64D6F11425381E007BDFB1 /* OFStreamObserver_select.h in Headers */,
				4B552554147AA5DB0003BF47 /* OFString_UTF8.h in Headers */,
				4BD653C5143B8489006182F0 /* OFTCPSocket+SOCKS5.h in Headers */,
				4B48B95414DC23B100546D39 /* OFXMLProcessingInstructions.h in Headers */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXHeadersBuildPhase section */

/* Begin PBXNativeTarget section */
		4B23CA89133811610047A1D9 /* TestPlugin */ = {







<







1258
1259
1260
1261
1262
1263
1264

1265
1266
1267
1268
1269
1270
1271
				4B552552147AA5DB0003BF47 /* OFMutableString_UTF8.h in Headers */,
				4BA85BCE140ECCE800E91D51 /* OFSet_hashtable.h in Headers */,
				4B83F0F4142FDEFD00E4A821 /* OFStreamObserver_kqueue.h in Headers */,
				4B64D6EF1425381E007BDFB1 /* OFStreamObserver_poll.h in Headers */,
				4B64D6F11425381E007BDFB1 /* OFStreamObserver_select.h in Headers */,
				4B552554147AA5DB0003BF47 /* OFString_UTF8.h in Headers */,
				4BD653C5143B8489006182F0 /* OFTCPSocket+SOCKS5.h in Headers */,

			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXHeadersBuildPhase section */

/* Begin PBXNativeTarget section */
		4B23CA89133811610047A1D9 /* TestPlugin */ = {
1475
1476
1477
1478
1479
1480
1481

1482
1483
1484
1485
1486
1487
1488
				4B49EA70143B3A090005BBC6 /* OFXMLCharacters.m in Sources */,
				4B49EA72143B3A090005BBC6 /* OFXMLComment.m in Sources */,
				4B3D23AF1337FC0D00DD29B8 /* OFXMLElement.m in Sources */,
				4BB25E8D139C388A00F574EA /* OFXMLElement+Serialization.m in Sources */,
				4B3D23B01337FC0D00DD29B8 /* OFXMLElementBuilder.m in Sources */,
				4B11005D14329B9A003A45D8 /* OFXMLNode.m in Sources */,
				4B3D23B11337FC0D00DD29B8 /* OFXMLParser.m in Sources */,

				4B3D23B31337FC0D00DD29B8 /* base64.m in Sources */,
				4B3D23B41337FC0D00DD29B8 /* iso_8859_15.m in Sources */,
				4B3D23B51337FC0D00DD29B8 /* foundation-compat.m in Sources */,
				4B3D23EE1337FFD000DD29B8 /* of_asprintf.m in Sources */,
				4BA355BA14879BDD00442EF4 /* of_strptime.m in Sources */,
				4B3D23B91337FC0D00DD29B8 /* unicode.m in Sources */,
				4B3D23BA1337FC0D00DD29B8 /* windows_1252.m in Sources */,







>







1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
				4B49EA70143B3A090005BBC6 /* OFXMLCharacters.m in Sources */,
				4B49EA72143B3A090005BBC6 /* OFXMLComment.m in Sources */,
				4B3D23AF1337FC0D00DD29B8 /* OFXMLElement.m in Sources */,
				4BB25E8D139C388A00F574EA /* OFXMLElement+Serialization.m in Sources */,
				4B3D23B01337FC0D00DD29B8 /* OFXMLElementBuilder.m in Sources */,
				4B11005D14329B9A003A45D8 /* OFXMLNode.m in Sources */,
				4B3D23B11337FC0D00DD29B8 /* OFXMLParser.m in Sources */,
				4B48B95514DC23B100546D39 /* OFXMLProcessingInstructions.m in Sources */,
				4B3D23B31337FC0D00DD29B8 /* base64.m in Sources */,
				4B3D23B41337FC0D00DD29B8 /* iso_8859_15.m in Sources */,
				4B3D23B51337FC0D00DD29B8 /* foundation-compat.m in Sources */,
				4B3D23EE1337FFD000DD29B8 /* of_asprintf.m in Sources */,
				4BA355BA14879BDD00442EF4 /* of_strptime.m in Sources */,
				4B3D23B91337FC0D00DD29B8 /* unicode.m in Sources */,
				4B3D23BA1337FC0D00DD29B8 /* windows_1252.m in Sources */,
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553

1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
				4B55A100133ABEA900B58A93 /* OFThreadJoinFailedException.m in Sources */,
				4B55A102133ABEA900B58A93 /* OFThreadStartFailedException.m in Sources */,
				4B55A104133ABEA900B58A93 /* OFThreadStillRunningException.m in Sources */,
				4B17FFAA133A34E7003E6DCD /* OFTruncatedDataException.m in Sources */,
				4B17FFB6133A375B003E6DCD /* OFUnboundNamespaceException.m in Sources */,
				4B17FFB2133A3664003E6DCD /* OFUnsupportedProtocolException.m in Sources */,
				4B55A117133AC24600B58A93 /* OFWriteFailedException.m in Sources */,
				4B48B95514DC23B100546D39 /* OFXMLProcessingInstructions.m in Sources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
		4BF33AEC133807310059CEF7 /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				4BF33AFC133807A20059CEF7 /* OFArrayTests.m in Sources */,
				4BF33AFD133807A20059CEF7 /* OFBlockTests.m in Sources */,
				4BF33AFE133807A20059CEF7 /* OFDataArrayTests.m in Sources */,
				4BF33AFF133807A20059CEF7 /* OFDateTests.m in Sources */,
				4BF33B00133807A20059CEF7 /* OFDictionaryTests.m in Sources */,
				4BF33B02133807A20059CEF7 /* OFHTTPRequestTests.m in Sources */,

				4BF33B03133807A20059CEF7 /* OFListTests.m in Sources */,
				4BF33B04133807A20059CEF7 /* OFMD5HashTests.m in Sources */,
				4BF33B05133807A20059CEF7 /* OFNumberTests.m in Sources */,
				4BF33B06133807A20059CEF7 /* OFObjectTests.m in Sources */,
				4BF33B07133807A20059CEF7 /* OFPluginTests.m in Sources */,
				4B3D5694139A617D0010A78F /* OFSerializationTests.m in Sources */,
				4B39844A13D3D03000E6F825 /* OFSet.m in Sources */,
				4BF33B08133807A20059CEF7 /* OFSHA1HashTests.m in Sources */,
				4BF33B09133807A20059CEF7 /* OFStreamTests.m in Sources */,
				4BF33B0A133807A20059CEF7 /* OFStringTests.m in Sources */,
				4BF33B0B133807A20059CEF7 /* OFTCPSocketTests.m in Sources */,
				4BF33B0C133807A20059CEF7 /* OFThreadTests.m in Sources */,
				4BF33B0D133807A20059CEF7 /* OFURLTests.m in Sources */,
				4BF33B0E133807A20059CEF7 /* OFXMLElementBuilderTests.m in Sources */,
				4B49EA66143B39CE0005BBC6 /* OFXMLNodeTests.m in Sources */,
				4BF33B10133807A20059CEF7 /* OFXMLParserTests.m in Sources */,
				4BF33B11133807A20059CEF7 /* PropertiesTests.m in Sources */,
				4BF33B12133807A20059CEF7 /* TestsAppDelegate.m in Sources */,
				4BAA60C814D09699006F068D /* OFJSONTests.m in Sources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
		4B23CA8F133811B20047A1D9 /* PBXTargetDependency */ = {







<













>


















<







1534
1535
1536
1537
1538
1539
1540

1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572

1573
1574
1575
1576
1577
1578
1579
				4B55A100133ABEA900B58A93 /* OFThreadJoinFailedException.m in Sources */,
				4B55A102133ABEA900B58A93 /* OFThreadStartFailedException.m in Sources */,
				4B55A104133ABEA900B58A93 /* OFThreadStillRunningException.m in Sources */,
				4B17FFAA133A34E7003E6DCD /* OFTruncatedDataException.m in Sources */,
				4B17FFB6133A375B003E6DCD /* OFUnboundNamespaceException.m in Sources */,
				4B17FFB2133A3664003E6DCD /* OFUnsupportedProtocolException.m in Sources */,
				4B55A117133AC24600B58A93 /* OFWriteFailedException.m in Sources */,

			);
			runOnlyForDeploymentPostprocessing = 0;
		};
		4BF33AEC133807310059CEF7 /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				4BF33AFC133807A20059CEF7 /* OFArrayTests.m in Sources */,
				4BF33AFD133807A20059CEF7 /* OFBlockTests.m in Sources */,
				4BF33AFE133807A20059CEF7 /* OFDataArrayTests.m in Sources */,
				4BF33AFF133807A20059CEF7 /* OFDateTests.m in Sources */,
				4BF33B00133807A20059CEF7 /* OFDictionaryTests.m in Sources */,
				4BF33B02133807A20059CEF7 /* OFHTTPRequestTests.m in Sources */,
				4BAA60C814D09699006F068D /* OFJSONTests.m in Sources */,
				4BF33B03133807A20059CEF7 /* OFListTests.m in Sources */,
				4BF33B04133807A20059CEF7 /* OFMD5HashTests.m in Sources */,
				4BF33B05133807A20059CEF7 /* OFNumberTests.m in Sources */,
				4BF33B06133807A20059CEF7 /* OFObjectTests.m in Sources */,
				4BF33B07133807A20059CEF7 /* OFPluginTests.m in Sources */,
				4B3D5694139A617D0010A78F /* OFSerializationTests.m in Sources */,
				4B39844A13D3D03000E6F825 /* OFSet.m in Sources */,
				4BF33B08133807A20059CEF7 /* OFSHA1HashTests.m in Sources */,
				4BF33B09133807A20059CEF7 /* OFStreamTests.m in Sources */,
				4BF33B0A133807A20059CEF7 /* OFStringTests.m in Sources */,
				4BF33B0B133807A20059CEF7 /* OFTCPSocketTests.m in Sources */,
				4BF33B0C133807A20059CEF7 /* OFThreadTests.m in Sources */,
				4BF33B0D133807A20059CEF7 /* OFURLTests.m in Sources */,
				4BF33B0E133807A20059CEF7 /* OFXMLElementBuilderTests.m in Sources */,
				4B49EA66143B39CE0005BBC6 /* OFXMLNodeTests.m in Sources */,
				4BF33B10133807A20059CEF7 /* OFXMLParserTests.m in Sources */,
				4BF33B11133807A20059CEF7 /* PropertiesTests.m in Sources */,
				4BF33B12133807A20059CEF7 /* TestsAppDelegate.m in Sources */,

			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
		4B23CA8F133811B20047A1D9 /* PBXTargetDependency */ = {

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/OFDataArray.m from [80fa284829] to [f620eb9fde].

536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
		@throw [OFOutOfRangeException exceptionWithClass: isa];

	lastPageByte = of_pagesize - 1;
	newSize = ((count + nItems) * itemSize + lastPageByte) & ~lastPageByte;

	if (size != newSize)
		data = [self resizeMemory: data
				 toNItems: newSize
				   ofSize: itemSize];

	memmove(data + (index + nItems) * itemSize, data + index * itemSize,
	    (count - index) * itemSize);
	memcpy(data + index * itemSize, cArray, nItems * itemSize);

	count += nItems;
	size = newSize;







|
<







536
537
538
539
540
541
542
543

544
545
546
547
548
549
550
		@throw [OFOutOfRangeException exceptionWithClass: isa];

	lastPageByte = of_pagesize - 1;
	newSize = ((count + nItems) * itemSize + lastPageByte) & ~lastPageByte;

	if (size != newSize)
		data = [self resizeMemory: data
				   toSize: newSize];


	memmove(data + (index + nItems) * itemSize, data + index * itemSize,
	    (count - index) * itemSize);
	memcpy(data + index * itemSize, cArray, nItems * itemSize);

	count += nItems;
	size = newSize;

Modified src/OFDate.h from [fba07d4c1f] to [1702b03e5a].

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
 */
+ dateWithTimeIntervalSinceNow: (double)seconds;

/**
 * \brief Creates a new OFDate with the specified string in the specified
 *	  format.
 *
 * The time zone used is UTC. If a time zone is specified anyway, an
 * OFInvalidFormatException is thrown. See +[dateWithLocalDateString:format:]
 * if you want to specify a time zone.
 *
 * See the manpage for strftime for information on the format.
 *
 * \warning The format is currently limited to the following format specifiers:
 *	    %%d, %%e, %%H, %%m, %%M, %%S, %%y, %%Y, %%, %%n and %%t.
 *
 * \param string The string describing the date
 * \param format The format of the string describing the date
 * \return A new, autoreleased OFDate with the specified date and time
 */
+ dateWithDateString: (OFString*)string
	      format: (OFString*)format;

/**
 * \brief Creates a new OFDate with the specified string in the specified
 *	  format.
 *
 * If no time zone is specified, local time is assumed.
 *
 * See the manpage for strftime for information on the format.
 *
 * \warning The format is currently limited to the following format specifiers:
 *	    %%d, %%e, %%H, %%m, %%M, %%S, %%y, %%Y, %%, %%n and %%t.
 *
 * \param string The string describing the date
 * \param format The format of the string describing the date







<
|
|

















<
<







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
 */
+ dateWithTimeIntervalSinceNow: (double)seconds;

/**
 * \brief Creates a new OFDate with the specified string in the specified
 *	  format.
 *

 * The time zone used is UTC. See +[dateWithLocalDateString:format:] if you
 * want local time.
 *
 * See the manpage for strftime for information on the format.
 *
 * \warning The format is currently limited to the following format specifiers:
 *	    %%d, %%e, %%H, %%m, %%M, %%S, %%y, %%Y, %%, %%n and %%t.
 *
 * \param string The string describing the date
 * \param format The format of the string describing the date
 * \return A new, autoreleased OFDate with the specified date and time
 */
+ dateWithDateString: (OFString*)string
	      format: (OFString*)format;

/**
 * \brief Creates a new OFDate with the specified string in the specified
 *	  format.
 *


 * See the manpage for strftime for information on the format.
 *
 * \warning The format is currently limited to the following format specifiers:
 *	    %%d, %%e, %%H, %%m, %%M, %%S, %%y, %%Y, %%, %%n and %%t.
 *
 * \param string The string describing the date
 * \param format The format of the string describing the date

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/OFDictionary.m from [940c27c632] to [b3eb8803f5].

243
244
245
246
247
248
249
250
251

252
253
254
255





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

- mutableCopy
{
	return [[OFMutableDictionary alloc] initWithDictionary: self];
}

- (BOOL)isEqual: (id)dictionary
{

	OFAutoreleasePool *pool;
	OFEnumerator *enumerator;
	id key;






	if ([dictionary count] != [self count])
		return NO;

	pool = [[OFAutoreleasePool alloc] init];

	enumerator = [self keyEnumerator];
	while ((key = [enumerator nextObject]) != nil) {
		id object = [dictionary objectForKey: key];

		if (object == nil ||
		    ![object isEqual: [self objectForKey: key]]) {
			[pool release];
			return NO;
		}
	}







|

>




>
>
>
>
>
|






|







243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
}

- mutableCopy
{
	return [[OFMutableDictionary alloc] initWithDictionary: self];
}

- (BOOL)isEqual: (id)object
{
	OFDictionary *otherDictionary;
	OFAutoreleasePool *pool;
	OFEnumerator *enumerator;
	id key;

	if (![object isKindOfClass: [OFDictionary class]])
		return NO;

	otherDictionary = object;

	if ([otherDictionary count] != [self count])
		return NO;

	pool = [[OFAutoreleasePool alloc] init];

	enumerator = [self keyEnumerator];
	while ((key = [enumerator nextObject]) != nil) {
		id object = [otherDictionary objectForKey: key];

		if (object == nil ||
		    ![object isEqual: [self objectForKey: key]]) {
			[pool release];
			return NO;
		}
	}

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/OFHTTPRequest.m from [29dc6862f8] to [d53d806d31].

184
185
186
187
188
189
190









191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
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
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
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

- (OFHTTPRequestResult*)performWithRedirects: (size_t)redirects
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFString *scheme = [URL scheme];
	OFTCPSocket *sock;
	OFHTTPRequestResult *result;










	if (![scheme isEqual: @"http"] && ![scheme isEqual: @"https"])
		@throw [OFUnsupportedProtocolException exceptionWithClass: isa
								      URL: URL];

	if ([scheme isEqual: @"http"])
		sock = [OFTCPSocket socket];
	else {
		if (of_http_request_tls_socket_class == Nil)
			@throw [OFUnsupportedProtocolException
			    exceptionWithClass: isa
					   URL: URL];

		sock = [[[of_http_request_tls_socket_class alloc] init]
		    autorelease];
	}

	[delegate request: self
	  didCreateSocket: sock];

	@try {
		OFString *line, *path;
		OFMutableDictionary *serverHeaders;
		OFDataArray *data;
		OFEnumerator *keyEnumerator, *objectEnumerator;
		OFString *key, *object, *contentLengthHeader;
		int status;
		const char *type = NULL;
		char *buffer;
		size_t bytesReceived;

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

		/*
		 * Work around a bug with packet bisection in lighttpd when
		 * using HTTPS.
		 */
		[sock setBuffersWrites: YES];

		if (requestType == OF_HTTP_REQUEST_TYPE_GET)
			type = "GET";
		if (requestType == OF_HTTP_REQUEST_TYPE_HEAD)
			type = "HEAD";
		if (requestType == OF_HTTP_REQUEST_TYPE_POST)
			type = "POST";

		if ([(path = [URL path]) isEqual: @""])
			path = @"/";

		if ([URL query] != nil)
			[sock writeFormat: @"%s %@?%@ HTTP/1.0\r\n",
					   type, path, [URL query]];
		else
			[sock writeFormat: @"%s %@ HTTP/1.0\r\n", type, path];

		if ([URL port] == 80)
			[sock writeFormat: @"Host: %@\r\n", [URL host]];
		else
			[sock writeFormat: @"Host: %@:%d\r\n", [URL host],
					   [URL port]];

		keyEnumerator = [headers keyEnumerator];
		objectEnumerator = [headers objectEnumerator];

		while ((key = [keyEnumerator nextObject]) != nil &&
		    (object = [objectEnumerator nextObject]) != nil)
			[sock writeFormat: @"%@: %@\r\n", key, object];

		if (requestType == OF_HTTP_REQUEST_TYPE_POST) {
			if ([headers objectForKey: @"Content-Type"] == nil)
				[sock writeString: @"Content-Type: "
				    @"application/x-www-form-urlencoded; "
				    @"charset=UTF-8\r\n"];

			if ([headers objectForKey: @"Content-Length"] == nil)
				[sock writeFormat: @"Content-Length: %d\r\n",
				    [queryString UTF8StringLength]];
		}

		[sock writeString: @"\r\n"];

		/* Work around a bug in lighttpd, see above */
		[sock flushWriteBuffer];
		[sock setBuffersWrites: NO];

		if (requestType == OF_HTTP_REQUEST_TYPE_POST)
			[sock writeString: queryString];

		/*
		 * We also need to check for HTTP/1.1 since Apache always
		 * declares the reply to be HTTP/1.1.
		 */
		line = [sock readLine];
		if (![line hasPrefix: @"HTTP/1.0 "] &&
		    ![line hasPrefix: @"HTTP/1.1 "])
			@throw [OFInvalidServerReplyException
			    exceptionWithClass: isa];

		status = (int)[[line substringWithRange:
		    of_range(9, 3)] decimalValue];

		serverHeaders = [OFMutableDictionary dictionary];

		while ((line = [sock readLine]) != nil) {
			OFString *key, *value;
			const char *line_c = [line UTF8String], *tmp;

			if ([line isEqual: @""])
				break;

			if ((tmp = strchr(line_c, ':')) == NULL)
				@throw [OFInvalidServerReplyException
				    exceptionWithClass: isa];

			key = [OFString stringWithUTF8String: line_c
						      length: tmp - line_c];
			normalize_key(key);

			do {
				tmp++;
			} while (*tmp == ' ');

			value = [OFString stringWithUTF8String: tmp];

			if ((redirects > 0 && (status == 301 || status == 302 ||
			    status == 303) && [key isEqual: @"Location"]) &&
			    (redirectsFromHTTPSToHTTPAllowed ||
			    [scheme isEqual: @"http"] ||
			    ![value hasPrefix: @"http://"])) {
				OFURL *new;
				BOOL follow;

				new = [OFURL URLWithString: value
					     relativeToURL: URL];

				follow = [delegate request: self
				      willFollowRedirectTo: new];

				if (!follow && delegate != nil) {
					[serverHeaders setObject: value
							  forKey: key];
					continue;
				}

				new = [new retain];
				[URL release];
				URL = new;

				if (status == 303) {
					requestType = OF_HTTP_REQUEST_TYPE_GET;
					[queryString release];
					queryString = nil;
				}

				[pool release];
				pool = nil;

				return [self performWithRedirects:
				    redirects - 1];
			}

			[serverHeaders setObject: value
					  forKey: key];
		}

		[delegate request: self
		didReceiveHeaders: serverHeaders
		   withStatusCode: status];

		if (storesData)
			data = [OFDataArray dataArray];
		else
			data = nil;

		buffer = [self allocMemoryWithSize: of_pagesize];
		bytesReceived = 0;
		@try {
			size_t len;

			while ((len = [sock readNBytes: of_pagesize
					    intoBuffer: buffer]) > 0) {
				[delegate request: self
				   didReceiveData: buffer
				       withLength: len];

				bytesReceived += len;
				[data addNItems: len
				     fromCArray: buffer];
			}
		} @finally {
			[self freeMemory: buffer];
		}

		if ((contentLengthHeader =
		    [serverHeaders objectForKey: @"Content-Length"]) != nil) {
			intmax_t cl = [contentLengthHeader decimalValue];

			if (cl > SIZE_MAX)
				@throw [OFOutOfRangeException
				    exceptionWithClass: isa];

			/*
			 * We only want to throw on these status codes as we
			 * will throw an OFHTTPRequestFailedException for all
			 * other status codes later.
			 */
			if (cl != bytesReceived && (status == 200 ||
			    status == 301 || status == 302 || status == 303))
				@throw [OFTruncatedDataException
				    exceptionWithClass: isa];
		}

		[serverHeaders makeImmutable];

		result = [[OFHTTPRequestResult alloc]
		    initWithStatusCode: status
			       headers: serverHeaders
				  data: data];

		if (status != 200 && status != 301 && status != 302 &&
		    status != 303)

			@throw [OFHTTPRequestFailedException
			    exceptionWithClass: isa
				   HTTPRequest: self
					result: result];

	} @finally {
		[pool release];
	}

	return [result autorelease];
}
@end

@implementation OFHTTPRequestResult
- initWithStatusCode: (short)status







>
>
>
>
>
>
>
>
>




















<
<
<
<
<
<
<
<
<
<
<
|
|

|
|
|
|
|

|
|
|
|
|
|

|
|

|
|
|
|
|

|
|
|
|
|

|
|

|
|
|

|
|
|
|
|

|
|
|
|

|

|
|
|

|
|

|
|
|
|
|
|
<
|
<

|
<

|

|
|
|

|
|

|
|
|

|
|
|

|
|
|

|

|
|
|
|
|
|
|

|
|

|
|

|
|
|
|
|

|
|
|

|
|
|
|
|

|
<

|
<
|

|
|
|

|
|
|

<
|
<
<

|
|
|
|

|
|
|
|
|

|
|
|
|
|
|
|

|
|
|

|
|
<

|
|
|
|
|
|
|
|
|
|

|

|
<
|
|

|
<
>
|
|
|
|
>
|
|
<







184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219











220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
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
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
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

- (OFHTTPRequestResult*)performWithRedirects: (size_t)redirects
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFString *scheme = [URL scheme];
	OFTCPSocket *sock;
	OFHTTPRequestResult *result;
	OFString *line, *path;
	OFMutableDictionary *serverHeaders;
	OFDataArray *data;
	OFEnumerator *keyEnumerator, *objectEnumerator;
	OFString *key, *object, *contentLengthHeader;
	int status;
	const char *type = NULL;
	char *buffer;
	size_t bytesReceived;

	if (![scheme isEqual: @"http"] && ![scheme isEqual: @"https"])
		@throw [OFUnsupportedProtocolException exceptionWithClass: isa
								      URL: URL];

	if ([scheme isEqual: @"http"])
		sock = [OFTCPSocket socket];
	else {
		if (of_http_request_tls_socket_class == Nil)
			@throw [OFUnsupportedProtocolException
			    exceptionWithClass: isa
					   URL: URL];

		sock = [[[of_http_request_tls_socket_class alloc] init]
		    autorelease];
	}

	[delegate request: self
	  didCreateSocket: sock];












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

	/*
	 * Work around a bug with packet bisection in lighttpd when using
	 * HTTPS.
	 */
	[sock setBuffersWrites: YES];

	if (requestType == OF_HTTP_REQUEST_TYPE_GET)
		type = "GET";
	if (requestType == OF_HTTP_REQUEST_TYPE_HEAD)
		type = "HEAD";
	if (requestType == OF_HTTP_REQUEST_TYPE_POST)
		type = "POST";

	if ([(path = [URL path]) isEqual: @""])
		path = @"/";

	if ([URL query] != nil)
		[sock writeFormat: @"%s %@?%@ HTTP/1.0\r\n",
		    type, path, [URL query]];
	else
		[sock writeFormat: @"%s %@ HTTP/1.0\r\n", type, path];

	if ([URL port] == 80)
		[sock writeFormat: @"Host: %@\r\n", [URL host]];
	else
		[sock writeFormat: @"Host: %@:%d\r\n", [URL host],
		    [URL port]];

	keyEnumerator = [headers keyEnumerator];
	objectEnumerator = [headers objectEnumerator];

	while ((key = [keyEnumerator nextObject]) != nil &&
	    (object = [objectEnumerator nextObject]) != nil)
		[sock writeFormat: @"%@: %@\r\n", key, object];

	if (requestType == OF_HTTP_REQUEST_TYPE_POST) {
		if ([headers objectForKey: @"Content-Type"] == nil)
			[sock writeString: @"Content-Type: "
			    @"application/x-www-form-urlencoded; "
			    @"charset=UTF-8\r\n"];

		if ([headers objectForKey: @"Content-Length"] == nil)
			[sock writeFormat: @"Content-Length: %d\r\n",
			    [queryString UTF8StringLength]];
	}

	[sock writeString: @"\r\n"];

	/* Work around a bug in lighttpd, see above */
	[sock flushWriteBuffer];
	[sock setBuffersWrites: NO];

	if (requestType == OF_HTTP_REQUEST_TYPE_POST)
		[sock writeString: queryString];

	/*
	 * We also need to check for HTTP/1.1 since Apache always declares the
	 * reply to be HTTP/1.1.
	 */
	line = [sock readLine];
	if (![line hasPrefix: @"HTTP/1.0 "] && ![line hasPrefix: @"HTTP/1.1 "])

		@throw [OFInvalidServerReplyException exceptionWithClass: isa];


	status = (int)[[line substringWithRange: of_range(9, 3)] decimalValue];


	serverHeaders = [OFMutableDictionary dictionary];

	while ((line = [sock readLine]) != nil) {
		OFString *key, *value;
		const char *line_c = [line UTF8String], *tmp;

		if ([line isEqual: @""])
			break;

		if ((tmp = strchr(line_c, ':')) == NULL)
			@throw [OFInvalidServerReplyException
			    exceptionWithClass: isa];

		key = [OFString stringWithUTF8String: line_c
					      length: tmp - line_c];
		normalize_key(key);

		do {
			tmp++;
		} while (*tmp == ' ');

		value = [OFString stringWithUTF8String: tmp];

		if ((redirects > 0 && (status == 301 || status == 302 ||
		    status == 303) && [key isEqual: @"Location"]) &&
		    (redirectsFromHTTPSToHTTPAllowed ||
		    [scheme isEqual: @"http"] ||
		    ![value hasPrefix: @"http://"])) {
			OFURL *new;
			BOOL follow;

			new = [OFURL URLWithString: value
				     relativeToURL: URL];

			follow = [delegate request: self
			      willFollowRedirectTo: new];

			if (!follow && delegate != nil) {
				[serverHeaders setObject: value
						  forKey: key];
				continue;
			}

			new = [new retain];
			[URL release];
			URL = new;

			if (status == 303) {
				requestType = OF_HTTP_REQUEST_TYPE_GET;
				[queryString release];
				queryString = nil;
			}

			[pool release];


			return [self performWithRedirects: redirects - 1];

		}

		[serverHeaders setObject: value
				  forKey: key];
	}

	[delegate request: self
	didReceiveHeaders: serverHeaders
	   withStatusCode: status];


	data = (storesData ? [OFDataArray dataArray] : nil);



	buffer = [self allocMemoryWithSize: of_pagesize];
	bytesReceived = 0;
	@try {
		size_t len;

		while ((len = [sock readNBytes: of_pagesize
				    intoBuffer: buffer]) > 0) {
			[delegate request: self
			   didReceiveData: buffer
			       withLength: len];

			bytesReceived += len;
			[data addNItems: len
			     fromCArray: buffer];
		}
	} @finally {
		[self freeMemory: buffer];
	}

	if ((contentLengthHeader =
	    [serverHeaders objectForKey: @"Content-Length"]) != nil) {
		intmax_t cl = [contentLengthHeader decimalValue];

		if (cl > SIZE_MAX)
			@throw [OFOutOfRangeException exceptionWithClass: isa];


		/*
		 * We only want to throw on these status codes as we will throw
		 * an OFHTTPRequestFailedException for all other status codes
		 * later.
		 */
		if (cl != bytesReceived && (status == 200 || status == 301 ||
		    status == 302 || status == 303))
			@throw [OFTruncatedDataException
			    exceptionWithClass: isa];
	}

	[serverHeaders makeImmutable];

	result = [[OFHTTPRequestResult alloc] initWithStatusCode: status

							 headers: serverHeaders
							    data: data];

	if (status != 200 && status != 301 && status != 302 && status != 303) {

		[result release];
		@throw [OFHTTPRequestFailedException
		    exceptionWithClass: isa
			   HTTPRequest: self
				result: result];
	}

	[pool release];


	return [result autorelease];
}
@end

@implementation OFHTTPRequestResult
- initWithStatusCode: (short)status

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/atomic.h from [1848f8ec6b] to [6e23ade0bb].

79
80
81
82
83
84
85
86
87
88
89
90










91
92
93
94
95
96
97
}

static OF_INLINE void*
of_atomic_add_ptr(void* volatile *p, intptr_t i)
{
#if !defined(OF_THREADS)
	return (*(char* volatile*)p += i);
#elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM)
	__asm__ (
	    "lock\n\t"
	    "xaddl	%0, %2\n\t"
	    "addl	%1, %0"










	    : "+&r"(i)
	    : "r"(i), "m"(*p)
	);

	return (void*)i;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_add_and_fetch(p, i);







|




>
>
>
>
>
>
>
>
>
>







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
}

static OF_INLINE void*
of_atomic_add_ptr(void* volatile *p, intptr_t i)
{
#if !defined(OF_THREADS)
	return (*(char* volatile*)p += i);
#elif defined(OF_X86_ASM)
	__asm__ (
	    "lock\n\t"
	    "xaddl	%0, %2\n\t"
	    "addl	%1, %0"
	    : "+&r"(i)
	    : "r"(i), "m"(*p)
	);

	return (void*)i;
#elif defined(OF_AMD64_ASM)
	__asm__ (
	    "lock\n\t"
	    "xaddq	%0, %2\n\t"
	    "addq	%1, %0"
	    : "+&r"(i)
	    : "r"(i), "m"(*p)
	);

	return (void*)i;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_add_and_fetch(p, i);
161
162
163
164
165
166
167
168
169
170
171
172
173











174
175
176
177
178
179
180
}

static OF_INLINE void*
of_atomic_sub_ptr(void* volatile *p, intptr_t i)
{
#if !defined(OF_THREADS)
	return (*(char* volatile*)p -= i);
#elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM)
	__asm__ (
	    "negl	%0\n\t"
	    "lock\n\t"
	    "xaddl	%0, %2\n\t"
	    "subl	%1, %0"











	    : "+&r"(i)
	    : "r"(i), "m"(*p)
	);

	return (void*)i;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_sub_and_fetch(p, i);







|





>
>
>
>
>
>
>
>
>
>
>







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
}

static OF_INLINE void*
of_atomic_sub_ptr(void* volatile *p, intptr_t i)
{
#if !defined(OF_THREADS)
	return (*(char* volatile*)p -= i);
#elif defined(OF_X86_ASM)
	__asm__ (
	    "negl	%0\n\t"
	    "lock\n\t"
	    "xaddl	%0, %2\n\t"
	    "subl	%1, %0"
	    : "+&r"(i)
	    : "r"(i), "m"(*p)
	);

	return (void*)i;
#elif defined(OF_AMD64_ASM)
	__asm__ (
	    "negq	%0\n\t"
	    "lock\n\t"
	    "xaddq	%0, %2\n\t"
	    "subq	%1, %0"
	    : "+&r"(i)
	    : "r"(i), "m"(*p)
	);

	return (void*)i;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_sub_and_fetch(p, i);

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