ObjFW  Check-in [5ec11e8b56]

Overview
Comment:Add support for MessagePack extensions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5ec11e8b56acdf2a14523ed5c84236911a8cc2cfb3a592931359f958670c82cc
User & Date: js on 2013-06-20 08:13:46
Other Links: manifest | tags
Context
2013-06-22
12:12
Rework exceptions. check-in: 3d16a30f41 user: js tags: trunk
2013-06-20
08:13
Add support for MessagePack extensions. check-in: 5ec11e8b56 user: js tags: trunk
2013-06-19
22:49
Add -[OFDataArray dataArrayWithCapacity:]. check-in: 925bf9f8b1 user: js tags: trunk
Changes

Modified ObjFW.xcodeproj/project.pbxproj from [005a2e81e7] to [43cc6cc48d].

358
359
360
361
362
363
364


365
366
367
368
369
370
371
		4BB4B54616775FF4002A2DCE /* OFHTTPServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BB4B54116775FF4002A2DCE /* OFHTTPServer.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4BB4B54716775FF4002A2DCE /* OFHTTPServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BB4B54216775FF4002A2DCE /* OFHTTPServer.m */; };
		4BB4B54A16776094002A2DCE /* OFHTTPClientTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BB4B54916776094002A2DCE /* OFHTTPClientTests.m */; };
		4BB524C1143D1E4E0085FBCC /* OFProcess.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BB524BF143D1E4E0085FBCC /* OFProcess.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4BB524C2143D1E4E0085FBCC /* OFProcess.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BB524C0143D1E4E0085FBCC /* OFProcess.m */; settings = {ATTRIBUTES = (Public, ); }; };
		4BC090441584F6760040640F /* OFInvalidJSONException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC090421584F6760040640F /* OFInvalidJSONException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4BC090451584F6760040640F /* OFInvalidJSONException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BC090431584F6760040640F /* OFInvalidJSONException.m */; };


		4BD653C5143B8489006182F0 /* OFTCPSocket+SOCKS5.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD653C3143B8489006182F0 /* OFTCPSocket+SOCKS5.h */; settings = {ATTRIBUTES = (); }; };
		4BD653C6143B8489006182F0 /* OFTCPSocket+SOCKS5.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD653C4143B8489006182F0 /* OFTCPSocket+SOCKS5.m */; };
		4BD77FDE176E4BC40031C497 /* OFUnboundPrefixException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD77FDC176E4BC40031C497 /* OFUnboundPrefixException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4BD77FDF176E4BC40031C497 /* OFUnboundPrefixException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD77FDD176E4BC40031C497 /* OFUnboundPrefixException.m */; };
		4BD98C03133814220048DD5B /* objfw-defs.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD98C011338140B0048DD5B /* objfw-defs.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4BDF37B51338055600F9A81A /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDF37B41338055600F9A81A /* config.h */; };
		4BF33AFB133807590059CEF7 /* ObjFW.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B3D23761337FBC800DD29B8 /* ObjFW.framework */; };







>
>







358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
		4BB4B54616775FF4002A2DCE /* OFHTTPServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BB4B54116775FF4002A2DCE /* OFHTTPServer.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4BB4B54716775FF4002A2DCE /* OFHTTPServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BB4B54216775FF4002A2DCE /* OFHTTPServer.m */; };
		4BB4B54A16776094002A2DCE /* OFHTTPClientTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BB4B54916776094002A2DCE /* OFHTTPClientTests.m */; };
		4BB524C1143D1E4E0085FBCC /* OFProcess.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BB524BF143D1E4E0085FBCC /* OFProcess.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4BB524C2143D1E4E0085FBCC /* OFProcess.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BB524C0143D1E4E0085FBCC /* OFProcess.m */; settings = {ATTRIBUTES = (Public, ); }; };
		4BC090441584F6760040640F /* OFInvalidJSONException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC090421584F6760040640F /* OFInvalidJSONException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4BC090451584F6760040640F /* OFInvalidJSONException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BC090431584F6760040640F /* OFInvalidJSONException.m */; };
		4BCAA9AF1772432F003EF859 /* OFMessagePackExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BCAA9AD1772432E003EF859 /* OFMessagePackExtension.h */; };
		4BCAA9B01772432F003EF859 /* OFMessagePackExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BCAA9AE1772432E003EF859 /* OFMessagePackExtension.m */; };
		4BD653C5143B8489006182F0 /* OFTCPSocket+SOCKS5.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD653C3143B8489006182F0 /* OFTCPSocket+SOCKS5.h */; settings = {ATTRIBUTES = (); }; };
		4BD653C6143B8489006182F0 /* OFTCPSocket+SOCKS5.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD653C4143B8489006182F0 /* OFTCPSocket+SOCKS5.m */; };
		4BD77FDE176E4BC40031C497 /* OFUnboundPrefixException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD77FDC176E4BC40031C497 /* OFUnboundPrefixException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4BD77FDF176E4BC40031C497 /* OFUnboundPrefixException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD77FDD176E4BC40031C497 /* OFUnboundPrefixException.m */; };
		4BD98C03133814220048DD5B /* objfw-defs.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD98C011338140B0048DD5B /* objfw-defs.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4BDF37B51338055600F9A81A /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDF37B41338055600F9A81A /* config.h */; };
		4BF33AFB133807590059CEF7 /* ObjFW.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B3D23761337FBC800DD29B8 /* ObjFW.framework */; };
786
787
788
789
790
791
792


793
794
795
796
797
798
799
		4BB50DD012F863C700C9393F /* of_asprintf.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = of_asprintf.m; path = src/of_asprintf.m; sourceTree = SOURCE_ROOT; };
		4BB524BF143D1E4E0085FBCC /* OFProcess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFProcess.h; path = src/OFProcess.h; sourceTree = "<group>"; };
		4BB524C0143D1E4E0085FBCC /* OFProcess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFProcess.m; path = src/OFProcess.m; sourceTree = "<group>"; };
		4BBA36C411406AB700CBA3AC /* atomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = atomic.h; path = src/atomic.h; sourceTree = "<group>"; };
		4BBA36C511406AB700CBA3AC /* macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macros.h; path = src/macros.h; sourceTree = "<group>"; };
		4BC090421584F6760040640F /* OFInvalidJSONException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFInvalidJSONException.h; path = src/exceptions/OFInvalidJSONException.h; sourceTree = "<group>"; };
		4BC090431584F6760040640F /* OFInvalidJSONException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFInvalidJSONException.m; path = src/exceptions/OFInvalidJSONException.m; sourceTree = "<group>"; };


		4BD653C3143B8489006182F0 /* OFTCPSocket+SOCKS5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "OFTCPSocket+SOCKS5.h"; path = "src/OFTCPSocket+SOCKS5.h"; sourceTree = "<group>"; };
		4BD653C4143B8489006182F0 /* OFTCPSocket+SOCKS5.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "OFTCPSocket+SOCKS5.m"; path = "src/OFTCPSocket+SOCKS5.m"; sourceTree = "<group>"; };
		4BD77FDC176E4BC40031C497 /* OFUnboundPrefixException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFUnboundPrefixException.h; path = src/exceptions/OFUnboundPrefixException.h; sourceTree = "<group>"; };
		4BD77FDD176E4BC40031C497 /* OFUnboundPrefixException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFUnboundPrefixException.m; path = src/exceptions/OFUnboundPrefixException.m; sourceTree = "<group>"; };
		4BD86D801237A6C600ED9912 /* OFBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFBlock.h; path = src/OFBlock.h; sourceTree = SOURCE_ROOT; };
		4BD86D811237A6C600ED9912 /* OFBlock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFBlock.m; path = src/OFBlock.m; sourceTree = SOURCE_ROOT; };
		4BD98C011338140B0048DD5B /* objfw-defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "objfw-defs.h"; path = "src/objfw-defs.h"; sourceTree = SOURCE_ROOT; };







>
>







788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
		4BB50DD012F863C700C9393F /* of_asprintf.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = of_asprintf.m; path = src/of_asprintf.m; sourceTree = SOURCE_ROOT; };
		4BB524BF143D1E4E0085FBCC /* OFProcess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFProcess.h; path = src/OFProcess.h; sourceTree = "<group>"; };
		4BB524C0143D1E4E0085FBCC /* OFProcess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFProcess.m; path = src/OFProcess.m; sourceTree = "<group>"; };
		4BBA36C411406AB700CBA3AC /* atomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = atomic.h; path = src/atomic.h; sourceTree = "<group>"; };
		4BBA36C511406AB700CBA3AC /* macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macros.h; path = src/macros.h; sourceTree = "<group>"; };
		4BC090421584F6760040640F /* OFInvalidJSONException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFInvalidJSONException.h; path = src/exceptions/OFInvalidJSONException.h; sourceTree = "<group>"; };
		4BC090431584F6760040640F /* OFInvalidJSONException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFInvalidJSONException.m; path = src/exceptions/OFInvalidJSONException.m; sourceTree = "<group>"; };
		4BCAA9AD1772432E003EF859 /* OFMessagePackExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMessagePackExtension.h; path = src/OFMessagePackExtension.h; sourceTree = "<group>"; };
		4BCAA9AE1772432E003EF859 /* OFMessagePackExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFMessagePackExtension.m; path = src/OFMessagePackExtension.m; sourceTree = "<group>"; };
		4BD653C3143B8489006182F0 /* OFTCPSocket+SOCKS5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "OFTCPSocket+SOCKS5.h"; path = "src/OFTCPSocket+SOCKS5.h"; sourceTree = "<group>"; };
		4BD653C4143B8489006182F0 /* OFTCPSocket+SOCKS5.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "OFTCPSocket+SOCKS5.m"; path = "src/OFTCPSocket+SOCKS5.m"; sourceTree = "<group>"; };
		4BD77FDC176E4BC40031C497 /* OFUnboundPrefixException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFUnboundPrefixException.h; path = src/exceptions/OFUnboundPrefixException.h; sourceTree = "<group>"; };
		4BD77FDD176E4BC40031C497 /* OFUnboundPrefixException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFUnboundPrefixException.m; path = src/exceptions/OFUnboundPrefixException.m; sourceTree = "<group>"; };
		4BD86D801237A6C600ED9912 /* OFBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFBlock.h; path = src/OFBlock.h; sourceTree = SOURCE_ROOT; };
		4BD86D811237A6C600ED9912 /* OFBlock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFBlock.m; path = src/OFBlock.m; sourceTree = SOURCE_ROOT; };
		4BD98C011338140B0048DD5B /* objfw-defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "objfw-defs.h"; path = "src/objfw-defs.h"; sourceTree = SOURCE_ROOT; };
1127
1128
1129
1130
1131
1132
1133


1134
1135
1136
1137
1138
1139
1140
				4B67996C1099E7C50041064A /* OFList.h */,
				4B67996D1099E7C50041064A /* OFList.m */,
				4B6743F9163C395900EB1E59 /* OFLocking.h */,
				4B3B0796166978780044E634 /* OFMapTable.h */,
				4B3B0797166978780044E634 /* OFMapTable.m */,
				4BF1BCC211C9663F0025511F /* OFMD5Hash.h */,
				4BF1BCC311C9663F0025511F /* OFMD5Hash.m */,


				4B879A8B177231F000EBCEA4 /* OFMessagePackRepresentation.h */,
				4B67996F1099E7C50041064A /* OFMutableArray.h */,
				4B6799701099E7C50041064A /* OFMutableArray.m */,
				4B2B3E77140D430500EC2F7C /* OFMutableArray_adjacent.h */,
				4B2B3E78140D430500EC2F7C /* OFMutableArray_adjacent.m */,
				4B6799711099E7C50041064A /* OFMutableDictionary.h */,
				4B6799721099E7C50041064A /* OFMutableDictionary.m */,







>
>







1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
				4B67996C1099E7C50041064A /* OFList.h */,
				4B67996D1099E7C50041064A /* OFList.m */,
				4B6743F9163C395900EB1E59 /* OFLocking.h */,
				4B3B0796166978780044E634 /* OFMapTable.h */,
				4B3B0797166978780044E634 /* OFMapTable.m */,
				4BF1BCC211C9663F0025511F /* OFMD5Hash.h */,
				4BF1BCC311C9663F0025511F /* OFMD5Hash.m */,
				4BCAA9AD1772432E003EF859 /* OFMessagePackExtension.h */,
				4BCAA9AE1772432E003EF859 /* OFMessagePackExtension.m */,
				4B879A8B177231F000EBCEA4 /* OFMessagePackRepresentation.h */,
				4B67996F1099E7C50041064A /* OFMutableArray.h */,
				4B6799701099E7C50041064A /* OFMutableArray.m */,
				4B2B3E77140D430500EC2F7C /* OFMutableArray_adjacent.h */,
				4B2B3E78140D430500EC2F7C /* OFMutableArray_adjacent.m */,
				4B6799711099E7C50041064A /* OFMutableDictionary.h */,
				4B6799721099E7C50041064A /* OFMutableDictionary.m */,
1531
1532
1533
1534
1535
1536
1537

1538
1539
1540
1541
1542
1543
1544
				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 */,
				4BDF37B51338055600F9A81A /* config.h in Headers */,

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

/* Begin PBXNativeTarget section */
		4B187E0D163EA29F0049A832 /* ObjFW-Bridge */ = {







>







1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
				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 */,
				4BDF37B51338055600F9A81A /* config.h in Headers */,
				4BCAA9AF1772432F003EF859 /* OFMessagePackExtension.h in Headers */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXHeadersBuildPhase section */

/* Begin PBXNativeTarget section */
		4B187E0D163EA29F0049A832 /* ObjFW-Bridge */ = {
1737
1738
1739
1740
1741
1742
1743

1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756

1757
1758
1759
1760
1761
1762
1763
				4B3D238E1337FC0D00DD29B8 /* OFBlock.m in Sources */,
				4B674401163C395900EB1E59 /* OFCondition.m in Sources */,
				4B3D238F1337FC0D00DD29B8 /* OFConstantString.m in Sources */,
				4B45355413DCFE1E0037AB4D /* OFCountedSet.m in Sources */,
				4BA85BCB140ECCE800E91D51 /* OFCountedSet_hashtable.m in Sources */,
				4B3D23901337FC0D00DD29B8 /* OFDataArray.m in Sources */,
				4B3D23911337FC0D00DD29B8 /* OFDataArray+Hashing.m in Sources */,

				4B3D23921337FC0D00DD29B8 /* OFDate.m in Sources */,
				4B3D23931337FC0D00DD29B8 /* OFDictionary.m in Sources */,
				4B2B3E80140D430500EC2F7C /* OFDictionary_hashtable.m in Sources */,
				4B3D23941337FC0D00DD29B8 /* OFEnumerator.m in Sources */,
				4B3D23961337FC0D00DD29B8 /* OFFile.m in Sources */,
				4BB4B54516775FF4002A2DCE /* OFHTTPClient.m in Sources */,
				4B3D23981337FC0D00DD29B8 /* OFHTTPRequest.m in Sources */,
				4BFDB4D2168B93CB006A4027 /* OFHTTPRequestReply.m in Sources */,
				4BB4B54716775FF4002A2DCE /* OFHTTPServer.m in Sources */,
				4BA49D9113DB113B00381CDB /* OFIntrospection.m in Sources */,
				4B3D23991337FC0D00DD29B8 /* OFList.m in Sources */,
				4B3B0799166978780044E634 /* OFMapTable.m in Sources */,
				4B3D239A1337FC0D00DD29B8 /* OFMD5Hash.m in Sources */,

				4B3D239B1337FC0D00DD29B8 /* OFMutableArray.m in Sources */,
				4B2B3E82140D430500EC2F7C /* OFMutableArray_adjacent.m in Sources */,
				4B3D239C1337FC0D00DD29B8 /* OFMutableDictionary.m in Sources */,
				4B2B3E84140D430500EC2F7C /* OFMutableDictionary_hashtable.m in Sources */,
				4B39844813D3AFB400E6F825 /* OFMutableSet.m in Sources */,
				4BA85BCD140ECCE800E91D51 /* OFMutableSet_hashtable.m in Sources */,
				4B3D239D1337FC0D00DD29B8 /* OFMutableString.m in Sources */,







>













>







1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
				4B3D238E1337FC0D00DD29B8 /* OFBlock.m in Sources */,
				4B674401163C395900EB1E59 /* OFCondition.m in Sources */,
				4B3D238F1337FC0D00DD29B8 /* OFConstantString.m in Sources */,
				4B45355413DCFE1E0037AB4D /* OFCountedSet.m in Sources */,
				4BA85BCB140ECCE800E91D51 /* OFCountedSet_hashtable.m in Sources */,
				4B3D23901337FC0D00DD29B8 /* OFDataArray.m in Sources */,
				4B3D23911337FC0D00DD29B8 /* OFDataArray+Hashing.m in Sources */,
				4B879A8D177231F000EBCEA4 /* OFDataArray+MessagePackValue.m in Sources */,
				4B3D23921337FC0D00DD29B8 /* OFDate.m in Sources */,
				4B3D23931337FC0D00DD29B8 /* OFDictionary.m in Sources */,
				4B2B3E80140D430500EC2F7C /* OFDictionary_hashtable.m in Sources */,
				4B3D23941337FC0D00DD29B8 /* OFEnumerator.m in Sources */,
				4B3D23961337FC0D00DD29B8 /* OFFile.m in Sources */,
				4BB4B54516775FF4002A2DCE /* OFHTTPClient.m in Sources */,
				4B3D23981337FC0D00DD29B8 /* OFHTTPRequest.m in Sources */,
				4BFDB4D2168B93CB006A4027 /* OFHTTPRequestReply.m in Sources */,
				4BB4B54716775FF4002A2DCE /* OFHTTPServer.m in Sources */,
				4BA49D9113DB113B00381CDB /* OFIntrospection.m in Sources */,
				4B3D23991337FC0D00DD29B8 /* OFList.m in Sources */,
				4B3B0799166978780044E634 /* OFMapTable.m in Sources */,
				4B3D239A1337FC0D00DD29B8 /* OFMD5Hash.m in Sources */,
				4BCAA9B01772432F003EF859 /* OFMessagePackExtension.m in Sources */,
				4B3D239B1337FC0D00DD29B8 /* OFMutableArray.m in Sources */,
				4B2B3E82140D430500EC2F7C /* OFMutableArray_adjacent.m in Sources */,
				4B3D239C1337FC0D00DD29B8 /* OFMutableDictionary.m in Sources */,
				4B2B3E84140D430500EC2F7C /* OFMutableDictionary_hashtable.m in Sources */,
				4B39844813D3AFB400E6F825 /* OFMutableSet.m in Sources */,
				4BA85BCD140ECCE800E91D51 /* OFMutableSet_hashtable.m in Sources */,
				4B3D239D1337FC0D00DD29B8 /* OFMutableString.m in Sources */,
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
				4B17FFAA133A34E7003E6DCD /* OFTruncatedDataException.m in Sources */,
				4B17FFB6133A375B003E6DCD /* OFUnboundNamespaceException.m in Sources */,
				4BD77FDF176E4BC40031C497 /* OFUnboundPrefixException.m in Sources */,
				4B6743F6163C384A00EB1E59 /* OFUnlockFailedException.m in Sources */,
				4B17FFB2133A3664003E6DCD /* OFUnsupportedProtocolException.m in Sources */,
				4BA4846315CC9F1E00D75360 /* OFUnsupportedVersionException.m in Sources */,
				4B55A117133AC24600B58A93 /* OFWriteFailedException.m in Sources */,
				4B879A8D177231F000EBCEA4 /* OFDataArray+MessagePackValue.m in Sources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
		4BF33AEC133807310059CEF7 /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (







<







1876
1877
1878
1879
1880
1881
1882

1883
1884
1885
1886
1887
1888
1889
				4B17FFAA133A34E7003E6DCD /* OFTruncatedDataException.m in Sources */,
				4B17FFB6133A375B003E6DCD /* OFUnboundNamespaceException.m in Sources */,
				4BD77FDF176E4BC40031C497 /* OFUnboundPrefixException.m in Sources */,
				4B6743F6163C384A00EB1E59 /* OFUnlockFailedException.m in Sources */,
				4B17FFB2133A3664003E6DCD /* OFUnsupportedProtocolException.m in Sources */,
				4BA4846315CC9F1E00D75360 /* OFUnsupportedVersionException.m in Sources */,
				4B55A117133AC24600B58A93 /* OFWriteFailedException.m in Sources */,

			);
			runOnlyForDeploymentPostprocessing = 0;
		};
		4BF33AEC133807310059CEF7 /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (

Modified src/Makefile from [531eea0d6e] to [f0e6e1c6f7].

21
22
23
24
25
26
27

28
29
30
31
32
33
34
       OFDictionary.m			\
       OFEnumerator.m			\
       OFFile.m				\
       OFIntrospection.m		\
       OFList.m				\
       OFMapTable.m			\
       OFMD5Hash.m			\

       OFMutableArray.m			\
       OFMutableDictionary.m		\
       OFMutableSet.m			\
       OFMutableString.m		\
       OFNull.m				\
       OFNumber.m			\
       OFObject.m			\







>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
       OFDictionary.m			\
       OFEnumerator.m			\
       OFFile.m				\
       OFIntrospection.m		\
       OFList.m				\
       OFMapTable.m			\
       OFMD5Hash.m			\
       OFMessagePackExtension.m		\
       OFMutableArray.m			\
       OFMutableDictionary.m		\
       OFMutableSet.m			\
       OFMutableString.m		\
       OFNull.m				\
       OFNumber.m			\
       OFObject.m			\

Modified src/OFDataArray+MessagePackValue.m from [c84f6d8cdf] to [b3b35d004c].

17
18
19
20
21
22
23

24
25
26
27
28
29
30
#import "OFDataArray+MessagePackValue.h"
#import "OFNumber.h"
#import "OFNull.h"
#import "OFDataArray.h"
#import "OFString.h"
#import "OFArray.h"
#import "OFDictionary.h"


#import "OFInvalidFormatException.h"

#import "autorelease.h"
#import "macros.h"

int _OFDataArray_MessagePackValue_reference;







>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#import "OFDataArray+MessagePackValue.h"
#import "OFNumber.h"
#import "OFNull.h"
#import "OFDataArray.h"
#import "OFString.h"
#import "OFArray.h"
#import "OFDictionary.h"
#import "OFMessagePackExtension.h"

#import "OFInvalidFormatException.h"

#import "autorelease.h"
#import "macros.h"

int _OFDataArray_MessagePackValue_reference;
137
138
139
140
141
142
143


144
145
146
147
148
149
150
	return pos;
}

static size_t
parse_object(const uint8_t *buffer, size_t length, id *object)
{
	size_t i, count;



	if (length < 1)
		goto error;

	/* positive fixint */
	if ((buffer[0] & 0x80) == 0) {
		*object = [OFNumber numberWithUInt8: buffer[0] & 0x7F];







>
>







138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
	return pos;
}

static size_t
parse_object(const uint8_t *buffer, size_t length, id *object)
{
	size_t i, count;
	int8_t type;
	OFDataArray *data;

	if (length < 1)
		goto error;

	/* positive fixint */
	if ((buffer[0] & 0x80) == 0) {
		*object = [OFNumber numberWithUInt8: buffer[0] & 0x7F];
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
			goto error;

		count = buffer[1];

		if (length < count + 2)
			goto error;

		*object = [OFDataArray dataArrayWithItemSize: 1
						    capacity: count];
		[*object addItems: buffer + 2
			    count: count];

		return count + 2;
	case 0xC5: /* bin 16 */
		if (length < 3)
			goto error;

		count = read_uint16(buffer + 1);

		if (length < count + 3)
			goto error;

		*object = [OFDataArray dataArrayWithItemSize: 1
						    capacity: count];
		[*object addItems: buffer + 3
			    count: count];

		return count + 3;
	case 0xC6: /* bin 32 */
		if (length < 5)
			goto error;

		count = read_uint32(buffer + 1);

		if (length < count + 5)
			goto error;

		*object = [OFDataArray dataArrayWithItemSize: 1

						    capacity: count];
















		[*object addItems: buffer + 5
			    count: count];








		return count + 5;














































































































































	/* Strings */
	case 0xD9: /* str 8 */
		if (length < 2)
			goto error;

		count = buffer[1];








|
<













|
<













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

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







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
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
			goto error;

		count = buffer[1];

		if (length < count + 2)
			goto error;

		*object = [OFDataArray dataArrayWithCapacity: count];

		[*object addItems: buffer + 2
			    count: count];

		return count + 2;
	case 0xC5: /* bin 16 */
		if (length < 3)
			goto error;

		count = read_uint16(buffer + 1);

		if (length < count + 3)
			goto error;

		*object = [OFDataArray dataArrayWithCapacity: count];

		[*object addItems: buffer + 3
			    count: count];

		return count + 3;
	case 0xC6: /* bin 32 */
		if (length < 5)
			goto error;

		count = read_uint32(buffer + 1);

		if (length < count + 5)
			goto error;

		*object = [OFDataArray dataArrayWithCapacity: count];
		[*object addItems: buffer + 5
			    count: count];

		return count + 5;
	/* Extensions */
	case 0xC7: /* ext 8 */
		if (length < 3)
			goto error;

		count = buffer[1];

		if (length < count + 3)
			goto error;

		type = buffer[2];

		data = [[OFDataArray alloc] initWithCapacity: count];
		@try {
			[data addItems: buffer + 3
				 count: count];

			*object = [OFMessagePackExtension
			    extensionWithType: type
					 data: data];
		} @finally {
			[data release];
		}

		return count + 3;
	case 0xC8: /* ext 16 */
		if (length < 4)
			goto error;

		count = read_uint16(buffer + 1);

		if (length < count + 4)
			goto error;

		type = buffer[3];

		data = [[OFDataArray alloc] initWithCapacity: count];
		@try {
			[data addItems: buffer + 4
				 count: count];

			*object = [OFMessagePackExtension
			    extensionWithType: type
					 data: data];
		} @finally {
			[data release];
		}

		return count + 4;
	case 0xC9: /* ext 32 */
		if (length < 6)
			goto error;

		count = read_uint32(buffer + 1);

		if (length < count + 6)
			goto error;

		type = buffer[5];

		data = [[OFDataArray alloc] initWithCapacity: count];
		@try {
			[data addItems: buffer + 6
				 count: count];

			*object = [OFMessagePackExtension
			    extensionWithType: type
					 data: data];
		} @finally {
			[data release];
		}

		return count + 6;
	case 0xD4: /* fixext 1 */
		if (length < 3)
			goto error;

		type = buffer[1];

		data = [[OFDataArray alloc] initWithCapacity: 1];
		@try {
			[data addItem: buffer + 2];

			*object = [OFMessagePackExtension
			    extensionWithType: type
					 data: data];
		} @finally {
			[data release];
		}

		return 3;
	case 0xD5: /* fixext 2 */
		if (length < 4)
			goto error;

		type = buffer[1];

		data = [[OFDataArray alloc] initWithCapacity: 2];
		@try {
			[data addItems: buffer + 2
				 count: 2];

			*object = [OFMessagePackExtension
			    extensionWithType: type
					 data: data];
		} @finally {
			[data release];
		}

		return 4;
	case 0xD6: /* fixtext 4 */
		if (length < 6)
			goto error;

		type = buffer[1];

		data = [[OFDataArray alloc] initWithCapacity: 4];
		@try {
			[data addItems: buffer + 2
				 count: 4];

			*object = [OFMessagePackExtension
			    extensionWithType: type
					 data: data];
		} @finally {
			[data release];
		}

		return 6;
	case 0xD7: /* fixtext 8 */
		if (length < 10)
			goto error;

		type = buffer[1];

		data = [[OFDataArray alloc] initWithCapacity: 8];
		@try {
			[data addItems: buffer + 2
				 count: 8];

			*object = [OFMessagePackExtension
			    extensionWithType: type
					 data: data];
		} @finally {
			[data release];
		}

		return 10;
	case 0xD8: /* fixext 16 */
		if (length < 18)
			goto error;

		type = buffer[1];

		data = [[OFDataArray alloc] initWithCapacity: 16];
		@try {
			[data addItems: buffer + 2
				 count: 16];

			*object = [OFMessagePackExtension
			    extensionWithType: type
					 data: data];
		} @finally {
			[data release];
		}

		return 18;
	/* Strings */
	case 0xD9: /* str 8 */
		if (length < 2)
			goto error;

		count = buffer[1];

Modified src/OFMapTable.h from [aa28d14053] to [bef3845de0].

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

#import "OFObject.h"
#import "OFEnumerator.h"

/*! @file */

/**
 * @brief A struct describing the functions to be used by the map table.
 */
typedef struct of_map_table_functions_t {
	/// The function to retain keys / values
	void* (*retain)(void *value);
	/// The function to release keys / values
	void (*release)(void *value);







|







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

#import "OFObject.h"
#import "OFEnumerator.h"

/*! @file */

/*!
 * @brief A struct describing the functions to be used by the map table.
 */
typedef struct of_map_table_functions_t {
	/// The function to retain keys / values
	void* (*retain)(void *value);
	/// The function to release keys / values
	void (*release)(void *value);
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
 * @return The value to replace the value with
 */
typedef void* (^of_map_table_replace_block_t)(void *key, void *value);
#endif

@class OFMapTableEnumerator;

/**
 * @brief A class similar to OFDictionary, but providing more options how keys
 *	  and values should be retained, released, compared and hashed.
 */
@interface OFMapTable: OFObject <OFCopying, OFFastEnumeration>
{
	of_map_table_functions_t _keyFunctions, _valueFunctions;
	struct of_map_table_bucket **_buckets;







|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
 * @return The value to replace the value with
 */
typedef void* (^of_map_table_replace_block_t)(void *key, void *value);
#endif

@class OFMapTableEnumerator;

/*!
 * @brief A class similar to OFDictionary, but providing more options how keys
 *	  and values should be retained, released, compared and hashed.
 */
@interface OFMapTable: OFObject <OFCopying, OFFastEnumeration>
{
	of_map_table_functions_t _keyFunctions, _valueFunctions;
	struct of_map_table_bucket **_buckets;
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
 * @brief Replaces each value with the value returned by the block.
 *
 * @param block The block which returns a new value for each value
 */
- (void)replaceValuesUsingBlock: (of_map_table_replace_block_t)block;
#endif

/**
 * @brief Returns the key functions used by the map table.
 *
 * @return The key functions used by the map table
 */
- (of_map_table_functions_t)keyFunctions;

/**
 * @brief Returns the value functions used by the map table.
 *
 * @return The value functions used by the map table
 */
- (of_map_table_functions_t)valueFunctions;
@end








|






|







204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
 * @brief Replaces each value with the value returned by the block.
 *
 * @param block The block which returns a new value for each value
 */
- (void)replaceValuesUsingBlock: (of_map_table_replace_block_t)block;
#endif

/*!
 * @brief Returns the key functions used by the map table.
 *
 * @return The key functions used by the map table
 */
- (of_map_table_functions_t)keyFunctions;

/*!
 * @brief Returns the value functions used by the map table.
 *
 * @return The value functions used by the map table
 */
- (of_map_table_functions_t)valueFunctions;
@end

Added src/OFMessagePackExtension.h version [c22f0a2e3b].

















































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * 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.
 */

#import "OFObject.h"
#import "OFMessagePackRepresentation.h"

@class OFDataArray;

/*!
 * @brief A class for representing the MessagePack extension type.
 */
@interface OFMessagePackExtension: OFObject <OFMessagePackRepresentation,
    OFCopying>
{
	int8_t _type;
	OFDataArray *_data;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly) int8_t type;
@property (readonly, retain) OFDataArray *data;
#endif

/*!
 * @brief Creates a new OFMessagePackRepresentation with the specified type and
 *	  data.
 *
 * @param type The MessagePack extension type
 * @param data The data for the extension
 * @return A new, autoreleased OFMessagePackRepresentation
 */
+ (instancetype)extensionWithType: (int8_t)type
			     data: (OFDataArray*)data;

/*!
 * @brief Initializes an already allocated OFMessagePackRepresentation with the
 *	  specified type and data.
 *
 * @param type The MessagePack extension type
 * @param data The data for the extension
 * @return An initialized OFMessagePackRepresentation
 */
- initWithType: (int8_t)type
	  data: (OFDataArray*)data;

/*!
 * @brief Returns the MessagePack extension type.
 *
 * @return The MessagePack extension type
 */
- (int8_t)type;

/*!
 * @brief Returns the data of the extension.
 *
 * @return The data of the extension
 */
- (OFDataArray*)data;
@end

Added src/OFMessagePackExtension.m version [5710c5d5b2].

































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
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
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * 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 "config.h"

#include <stdlib.h>

#import "OFMessagePackExtension.h"
#import "OFDataArray.h"
#import "OFString.h"

#import "OFInvalidArgumentException.h"

#import "macros.h"

@implementation OFMessagePackExtension
+ (instancetype)extensionWithType: (int8_t)type
			     data: (OFDataArray*)data
{
	return [[[self alloc] initWithType: type
				      data: data] autorelease];
}

- init
{
	@try {
		[self doesNotRecognizeSelector: _cmd];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	abort();
}

- initWithType: (int8_t)type
	  data: (OFDataArray*)data
{
	self = [super init];

	@try {
		if (data == nil || [data itemSize] != 1)
			@throw [OFInvalidArgumentException
			    exceptionWithClass: [self class]
				      selector: _cmd];

		_type = type;
		_data = [data retain];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[_data release];

	[super dealloc];
}

- (int8_t)type
{
	return _type;
}

- (OFDataArray*)data
{
	OF_GETTER(_data, true)
}

- (OFDataArray*)messagePackRepresentation
{
	OFDataArray *ret;
	int8_t prefix;
	size_t count = [_data count];

	if (count == 1) {
		ret = [OFDataArray dataArrayWithCapacity: 3];

		prefix = 0xD4;
		[ret addItem: &prefix];

		[ret addItem: &_type];
	} else if (count == 2) {
		ret = [OFDataArray dataArrayWithCapacity: 4];

		prefix = 0xD5;
		[ret addItem: &prefix];

		[ret addItem: &_type];
	} else if (count == 4) {
		ret = [OFDataArray dataArrayWithCapacity: 6];

		prefix = 0xD6;
		[ret addItem: &prefix];

		[ret addItem: &_type];
	} else if (count == 8) {
		ret = [OFDataArray dataArrayWithCapacity: 10];

		prefix = 0xD7;
		[ret addItem: &prefix];

		[ret addItem: &_type];
	} else if (count == 16) {
		ret = [OFDataArray dataArrayWithCapacity: 18];

		prefix = 0xD8;
		[ret addItem: &prefix];

		[ret addItem: &_type];
	} else if (count < 0x100) {
		uint8_t length;

		ret = [OFDataArray dataArrayWithCapacity: count + 3];

		prefix = 0xC7;
		[ret addItem: &prefix];

		length = (uint8_t)count;
		[ret addItem: &length];

		[ret addItem: &_type];
	} else if (count < 0x10000) {
		uint16_t length;

		ret = [OFDataArray dataArrayWithCapacity: count + 4];

		prefix = 0xC8;
		[ret addItem: &prefix];

		length = OF_BSWAP16((uint16_t)count);
		[ret addItems: &length
			count: 2];

		[ret addItem: &_type];
	} else {
		uint32_t length;

		ret = [OFDataArray dataArrayWithCapacity: count + 6];

		prefix = 0xC9;
		[ret addItem: &prefix];

		length = OF_BSWAP32((uint32_t)count);
		[ret addItems: &length
			count: 4];

		[ret addItem: &_type];
	}

	[ret addItems: [_data items]
		count: [_data count]];

	return ret;
}

- (OFString*)description
{
	return [OFString stringWithFormat: @"<OFMessagePackExtension: %d, %@>",
					   _type, _data];
}

- (bool)isEqual: (id)object
{
	OFMessagePackExtension *extension;

	if (![object isKindOfClass: [OFMessagePackExtension class]])
		return false;

	extension = object;

	if (extension->_type != _type || ![extension->_data isEqual: _data])
		return false;

	return true;
}

- (uint32_t)hash
{
	uint32_t hash;

	OF_HASH_INIT(hash);

	OF_HASH_ADD(hash, (uint8_t)_type);
	OF_HASH_ADD_HASH(hash, [_data hash]);

	OF_HASH_FINALIZE(hash);

	return hash;
}

- copy
{
	OFMessagePackExtension *ret;
	OFDataArray *data;

	data = [_data copy];
	@try {
		ret = [[OFMessagePackExtension alloc] initWithType: _type
							      data: data];
	} @finally {
		[data release];
	}

	return ret;
}
@end

Modified src/ObjFW.h from [a29c563823] to [67fde4ef09].

73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#import "OFXMLCharacters.h"
#import "OFXMLCDATA.h"
#import "OFXMLComment.h"
#import "OFXMLProcessingInstructions.h"
#import "OFXMLParser.h"
#import "OFXMLElementBuilder.h"

#import "OFSerialization.h"

#import "OFApplication.h"
#import "OFSystemInfo.h"
#import "OFTimer.h"
#import "OFRunLoop.h"

#import "OFAllocFailedException.h"







|







73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#import "OFXMLCharacters.h"
#import "OFXMLCDATA.h"
#import "OFXMLComment.h"
#import "OFXMLProcessingInstructions.h"
#import "OFXMLParser.h"
#import "OFXMLElementBuilder.h"

#import "OFMessagePackExtension.h"

#import "OFApplication.h"
#import "OFSystemInfo.h"
#import "OFTimer.h"
#import "OFRunLoop.h"

#import "OFAllocFailedException.h"