Comment: | Merge trunk into 1.0 branch |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | 1.0 |
Files: | files | file ages | folders |
SHA3-256: |
370ec3dc84fc8fffcf0c8daf7d90e0dc |
User & Date: | js on 2020-05-28 23:31:27 |
Other Links: | branch diff | manifest | tags |
2020-05-28
| ||
23:45 | Remove utils/ofsock, as it is not ready for 1.0 check-in: cc7caa19be user: js tags: 1.0 | |
23:31 | Merge trunk into 1.0 branch check-in: 370ec3dc84 user: js tags: 1.0 | |
23:22 | OFIPXSocket: Minor documentation fix check-in: 2d409b0c35 user: js tags: trunk | |
2020-03-02
| ||
20:24 | Merge branch 'master' into 1.0 check-in: e3bbb35784 user: js tags: 1.0 | |
Added .fossil-settings/clean-glob version [02ac598dea].
|
Added .fossil-settings/ignore-glob version [fea53f5b92].
|
Added .fossil-settings/keep-glob version [421e4b3d79].
1 | + | .git |
Modified .gitignore from [dbd7d8e2dc] to [79c7b883a0].
1 2 3 4 5 6 7 8 9 10 | 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 | + + + - + + - - - - - - + - - - - - + | *.a *.bundle *.dep *.dll *.dylib *.exe *.framework *.library *.map *.o *.orig *.so *.so.* |
Modified .travis.yml from [a4ba9a887a] to [53acd6323f].
1 2 3 4 5 6 7 | 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 | + + + + + - + + + - + + + - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + | language: c matrix: include: # Linux - os: linux compiler: clang dist: precise sudo: required - os: linux compiler: gcc |
︙ | |||
187 188 189 190 191 192 193 | 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 | - - - + + + + + + + + + + + + + + - + - + + + + | - os: linux dist: trusty env: - config=wii before_install: - if [ "$TRAVIS_OS_NAME" = "linux" -a -z "$config" ]; then |
︙ | |||
222 223 224 225 226 227 228 | 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | + + + - + + + + | - if [ "$config" = "amigaos" ]; then wget -q https://franke.ms/download/amiga-gcc.tgz; tar -C / -xzf amiga-gcc.tgz; fi script: # This needs to use ed on macOS, as it has no GNU sed, and sed on Linux, as # some Travis hosts have no ed. - if [ "$TRAVIS_OS_NAME" = "osx" ]; then |
︙ | |||
250 251 252 253 254 255 256 | 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 | + + + - + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + - - + + | exit 1; fi; } - if [ "$TRAVIS_OS_NAME" = "linux" -a -z "$config" ]; then build_32_64() { build OBJC="$CC" $@; case "$TRAVIS_CPU_ARCH" in amd64) |
︙ |
Modified Makefile from [8220802d40] to [c0716d54d0].
︙ | |||
14 15 16 17 18 19 20 | 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 | - + - - - + + - + + - + | utils tests: src tarball: echo "Generating tarball for version ${PACKAGE_VERSION}..." rm -fr objfw-${PACKAGE_VERSION} objfw-${PACKAGE_VERSION}.tar \ objfw-${PACKAGE_VERSION}.tar.gz |
Modified PLATFORMS.md from [d342907c41] to [98e6767a77].
︙ | |||
76 77 78 79 80 81 82 | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | - - + + | * Runtimes: Apple Linux ----- * Architectures: Alpha, ARMv6, ARM64, Itanium, m68k, MIPS (O32), RISC-V 64, |
︙ |
Modified README.md from [826335256c] to [c2eecac5f0].
︙ | |||
10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | + | Table of Contents ================= * [Installation](#installation) * [macOS and iOS](#macos-and-ios) * [Building as a framework](#building-as-a-framework) * [Using the macOS or iOS framework in Xcode](#using-the-macos-or-ios-framework-in-xcode) * [Broken Xcode versions](#broken-xcode-versions) * [Windows](#windows) * [Getting MSYS2](#getting-msys2) * [Updating MSYS2](#updating-msys2) * [Installing MinGW-w64 using MSYS2](#installing-mingw-w64-using-msys2) * [Getting, building and installing ObjFW](#getting-building-and-installing-objfw) * [Nintendo DS, Nintendo 3DS and Wii](#nintendo-ds-nintendo-3ds-and-wii) * [Nintendo DS](#nintendo-ds) |
︙ | |||
69 70 71 72 73 74 75 76 77 78 79 80 81 82 | 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 | + + + + + + + + + + + + + + + + + + + + + + + | ### Using the macOS or iOS framework in Xcode To use the macOS framework in Xcode, you need to add the `.framework`s to your project and add the following flags to `Other C Flags`: -fconstant-string-class=OFConstantString -fno-constant-cfstrings ### Broken Xcode versions Some versions of Xcode shipped with a version of Clang that ignores `-fconstant-string-class=OFConstantString`. This will manifest in an error like this: OFAllocFailedException.m:94:10: error: cannot find interface declaration for 'NSConstantString' return @"Allocating an object failed!"; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Unfortunately, there is no workaround for this other than to upgrade/downgrade Xcode or to build upstream Clang yourself. In particular, Xcode 11 Beta 1 to Beta 3 are known to be affected. While Xcode 11 Beta 4 to Xcode 11.3 work, the bug was unfortunately reintroduced in Xcode 11.4.1 and a fix is not expected before Xcode 11.6. You can get older versions of Xcode [here](https://developer.apple.com/download) by clicking on "More" in the top-right corner. Windows ------- Windows is only officially supported when following these instructions, as there are many MinGW versions that behave slightly differently and often cause problems. |
︙ |
Modified build-aux/m4/buildsys.m4 from [a231c1e9f4] to [90f081db1f].
︙ | |||
180 181 182 183 184 185 186 | 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 | - + - + - - + + | INSTALL_PLUGIN='&& rm -fr ${DESTDIR}${plugindir}/$$i && cp -R $$i ${DESTDIR}${plugindir}/' UNINSTALL_PLUGIN='&& rm -fr ${DESTDIR}${plugindir}/$$i' CLEAN_LIB='' ;; mingw* | cygwin*) AC_MSG_RESULT(MinGW / Cygwin) LIB_CFLAGS='' |
︙ |
Modified buildsys.mk.in from [4053db3b86] to [32c1d977cd].
︙ | |||
123 124 125 126 127 128 129 | 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 | - - - - - - + + + + + + - + | .SILENT: .SUFFIXES: .SUFFIXES: .amigalib.o .beam .c .cc .class .cxx .d .erl .lib.o .java .mo .m .mm .o .plugin.o .po .py .pyc .rc .S .xpm .PHONY: all subdirs subdirs-after pre-depend depend install install-extra uninstall uninstall-extra clean distclean locales copy-headers-into-framework ${SUBDIRS} ${SUBDIRS_AFTER} all: |
︙ | |||
187 188 189 190 191 192 193 | 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 | - + - + | else \ ${LINK_FAILED}; \ fi ${FRAMEWORK} ${FRAMEWORK_NOINST}: ${EXT_DEPS} ${LIB_OBJS} ${LIB_OBJS_EXTRA} ${LINK_STATUS} out="$@"; \ |
︙ | |||
609 610 611 612 613 614 615 | 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 | - + | ${COMPILE_PLUGIN_FAILED}; \ fi install: all install-extra for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ test x"$$i" = x"" && continue; \ ${DIR_ENTER}; \ |
︙ | |||
722 723 724 725 726 727 728 | 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 | - + | install-extra: uninstall: uninstall-extra for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ test x"$$i" = x"" && continue; \ ${DIR_ENTER}; \ |
︙ | |||
837 838 839 840 841 842 843 | 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 | - + - + - + | uninstall-extra: clean: for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ test x"$$i" = x"" && continue; \ ${DIR_ENTER}; \ |
︙ |
Modified configure.ac from [3226ef7f8e] to [59df486ed4].
︙ | |||
35 36 37 38 39 40 41 | 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 | - - | OBJFW_OBJCFLAGS="$OBJFW_OBJCFLAGS $flags" LDFLAGS="$LDFLAGS $flags" enable_shared="no" enable_threads="no" enable_sockets="no" enable_files="no" |
︙ | |||
420 421 422 423 424 425 426 427 | 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | + - + | #include <stdlib.h> #if defined(__GLIBC__) || defined(__MINGW32__) || \ defined(__NEWLIB__) || defined(__MORPHOS__) egrep_cpp_yes #endif ], [ AC_MSG_RESULT(yes) CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" |
︙ | |||
815 816 817 818 819 820 821 | 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 | - - + + + + + - + - - - - - - - - - - - - - - - - - - - + - - - - - | AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) ]) ;; esac |
︙ | |||
1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 | 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ]) AC_CHECK_HEADERS(fcntl.h dirent.h) AC_CHECK_FUNCS([sysconf gmtime_r localtime_r nanosleep fcntl]) AC_CHECK_HEADERS(xlocale.h) AC_CHECK_FUNCS([strtod_l strtof_l asprintf_l]) AS_IF([test x"$gnu_source" != x"yes" -a \( \ x"$ac_cv_func_strtod_l" = x"yes" -o x"$ac_cv_func_strtof_l" = x"yes" -o \ x"$ac_cv_func_asprintf_l" = x"yes" \)], [ AC_MSG_CHECKING(whether *_l functions need _GNU_SOURCE) AC_TRY_COMPILE([ #include <stdlib.h> #include <stdio.h> #include <locale.h> #ifdef HAVE_XLOCALE_H # include <xlocale.h> #endif ], [ #ifdef HAVE_STRTOD_L (void)strtod_l; #endif #ifdef HAVE_STRTOF_L (void)strtof_l; #endif #ifdef HAVE_ASPRINTF_L (void)asprintf_l; #endif ], [ AC_MSG_RESULT(no) ], [ AC_MSG_RESULT(yes) CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" ]) ]) dnl This check needs to happen after the above, as _GNU_SOURCE can change the dnl return type. AC_CHECK_FUNCS(strerror_r, [ AC_MSG_CHECKING(for return type of strerror_r) AC_TRY_COMPILE([ #include <stdio.h> #include <string.h> ], [ switch (strerror_r(0, NULL, 0)) { case 0:; } ], [ AC_MSG_RESULT(int) ], [ AC_MSG_RESULT(char *) AC_DEFINE(STRERROR_R_RETURNS_CHARP, 1, [Whether strerror_r returns char *]) ]) ]) AC_CHECK_HEADERS(sys/utsname.h) AC_CHECK_FUNCS(uname) case "$host_os" in amigaos*) ;; |
︙ | |||
1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 | 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 | + + + + + + + + + + | AC_DEFINE(OF_HAVE_NETINET_IN_H, 1, [Whether we have netinet/in.h]) ]) AC_CHECK_HEADER(netinet/tcp.h, [ AC_DEFINE(OF_HAVE_NETINET_TCP_H, 1, [Whether we have netinet/tcp.h]) ]) AC_CHECK_HEADER(netinet/sctp.h, [ AC_DEFINE(OF_HAVE_SCTP, 1, [Whether we have SCTP]) AC_DEFINE(OF_HAVE_NETINET_SCTP_H, 1, [Whether we have netinet/sctp.h]) AC_SUBST(USE_SRCS_SCTP, '${SRCS_SCTP}') ]) AC_CHECK_HEADERS([arpa/inet.h netdb.h]) AC_CHECK_HEADER(netipx/ipx.h, [ AC_DEFINE(OF_HAVE_NETIPX_IPX_H, 1, [Whether we have netipx/ipx.h]) ]) AC_CHECK_MEMBER([struct sockaddr_in6.sin6_addr], [ AC_EGREP_CPP(egrep_cpp_yes, [ #ifdef _WIN32 typedef int BOOL; #endif |
︙ | |||
1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 | 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + + | # include <winsock2.h> # endif # endif # include <windows.h> # include <ws2tcpip.h> #endif ]) AC_CHECK_MEMBER(struct sockaddr_ipx.sipx_network, [], [ AC_CHECK_MEMBER(struct sockaddr_ipx.sa_netnum, [], [], [ #ifdef _WIN32 typedef int BOOL; #endif #ifdef OF_HAVE_NETIPX_IPX_H # include <netipx/ipx.h> #endif #ifdef _WIN32 # ifdef __MINGW32__ # include <_mingw.h> # ifdef __MINGW64_VERSION_MAJOR # include <winsock2.h> # endif # endif # include <windows.h> # include <wsipx.h> #endif ]) ], [ #ifdef _WIN32 typedef int BOOL; #endif #ifdef OF_HAVE_NETIPX_IPX_H # include <netipx/ipx.h> #endif #ifdef _WIN32 # ifdef __MINGW32__ # include <_mingw.h> # ifdef __MINGW64_VERSION_MAJOR # include <winsock2.h> # endif # endif # include <windows.h> # include <wsipx.h> #endif ]) AS_IF([test x"$ac_cv_member_struct_sockaddr_ipx_sipx_network" = x"yes" \ -o x"$ac_cv_member_struct_sockaddr_ipx_sa_netnum" = x"yes"], [ AC_EGREP_CPP(egrep_cpp_yes, [ #ifdef _WIN32 typedef int BOOL; #endif #ifdef OF_HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef _WIN32 # ifdef __MINGW32__ # include <_mingw.h> # ifdef __MINGW64_VERSION_MAJOR # include <winsock2.h> # endif # endif # include <windows.h> # include <wsipx.h> #endif #ifdef AF_IPX egrep_cpp_yes #endif ], [ AC_DEFINE(OF_HAVE_IPX, 1, [Whether we have IPX/SPX]) AC_SUBST(USE_SRCS_IPX, '${SRCS_IPX}') ]) ]) AC_CHECK_FUNCS(paccept accept4, break) AC_CHECK_FUNCS(kqueue1 kqueue, [ AC_DEFINE(HAVE_KQUEUE, 1, [Whether we have kqueue]) |
︙ | |||
1437 1438 1439 1440 1441 1442 1443 | 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 | - + + | ], [ break ]) ]) ;; esac AS_IF([test x"$have_processes" = x"yes"], [ |
︙ | |||
1477 1478 1479 1480 1481 1482 1483 | 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 | - + | old_OBJCFLAGS="$OBJCFLAGS" OBJCFLAGS="$OBJCFLAGS -Xclang -fblocks" AC_TRY_COMPILE([], [ int (^foo)(int bar); foo = ^ (int bar) { return 0; } ], [ OBJFW_OBJCFLAGS="$OBJFW_OBJCFLAGS -Xclang -fblocks" |
︙ |
Modified extra.mk.in from [0ce90d018a] to [45f41009ef].
︙ | |||
50 51 52 53 54 55 56 | 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 | - - + - - - - - - + + + + + + + + + + | LINKLIB = @LINKLIB@ LOOKUP_ASM_A = @LOOKUP_ASM_A@ LOOKUP_ASM_LIB_A = @LOOKUP_ASM_LIB_A@ LOOKUP_ASM_LOOKUP_ASM_A = @LOOKUP_ASM_LOOKUP_ASM_A@ LOOKUP_ASM_LOOKUP_ASM_LIB_A = @LOOKUP_ASM_LOOKUP_ASM_LIB_A@ MAP_LDFLAGS = @MAP_LDFLAGS@ OFARC = @OFARC@ |
Modified generators/Makefile from [3ca3993514] to [0e25880b06].
1 2 3 4 5 6 7 8 9 | 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 | - + - + - - + + - - + + - + - + | include ../extra.mk PROG_NOINST = gen_tables${PROG_SUFFIX} SRCS = TableGenerator.m .PHONY: run run: all rm -f libobjfw.so.${OBJFW_LIB_MAJOR} rm -f libobjfw.so.${OBJFW_LIB_MAJOR_MINOR} |
Modified src/Makefile from [d8e8488c9d] to [e69692586b].
︙ | |||
51 52 53 54 55 56 57 | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | - + | OFNull.m \ OFNumber.m \ OFObject.m \ OFObject+KeyValueCoding.m \ OFObject+Serialization.m \ OFOptionsParser.m \ OFPair.m \ |
︙ | |||
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | 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 | + + + + + + - + + + | ${USE_SRCS_THREADS} \ ${USE_SRCS_WINDOWS} SRCS_FILES = OFFile.m \ OFINICategory.m \ OFINIFile.m \ OFSettings.m \ OFString+PathAdditions.m SRCS_IPX = OFIPXSocket.m \ OFSPXSocket.m \ OFSPXStreamSocket.m SRCS_PLUGINS = OFPlugin.m SRCS_SCTP = OFSCTPSocket.m SRCS_SOCKETS = OFDNSQuery.m \ OFDNSResolver.m \ OFDNSResourceRecord.m \ OFDNSResponse.m \ OFDatagramSocket.m \ OFHTTPClient.m \ OFHTTPCookie.m \ OFHTTPCookieManager.m \ OFHTTPRequest.m \ OFHTTPResponse.m \ OFHTTPServer.m \ OFSequencedPacketSocket.m \ OFStreamSocket.m \ OFTCPSocket.m \ OFUDPSocket.m \ |
︙ | |||
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 | + - - - - + + + + + | OFUTF8String.m \ ${LIBBASES_M} SRCS_FILES += OFFileURLHandler.m \ OFINIFileSettings.m SRCS_SOCKETS += OFDNSResolverSettings.m \ OFHTTPURLHandler.m \ OFHostAddressResolver.m \ OFIPSocketAsyncConnector.m \ OFKernelEventObserver.m \ |
︙ |
Modified src/OFApplication.h from [d0ae1ccee1] to [ae508719d0].
︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + | */ #include <signal.h> #import "OFObject.h" OF_ASSUME_NONNULL_BEGIN /*! @file */ @class OFArray OF_GENERIC(ObjectType); @class OFDictionary OF_GENERIC(KeyType, ObjectType); @class OFMutableArray OF_GENERIC(ObjectType); @class OFMutableDictionary OF_GENERIC(KeyType, ObjectType); @class OFSandbox; @class OFString; /*! * @brief Specify the class to be used as the application delegate. * * An instance of this class will be created and act as the application * delegate. * * For example, it can be used like this: * * @code * // In MyAppDelegate.h: * @interface MyAppDelegate: OFObject <OFApplicationDelegate> * @end * * // In MyAppDelegate.m: * OF_APPLICATION_DELEGATE(MyAppDelegate) * * @implementation MyAppDelegate * - (void)applicationDidFinishLaunching * { * [OFApplication terminate]; * } * @end * @endcode */ #define OF_APPLICATION_DELEGATE(class_) \ int \ main(int argc, char *argv[]) \ { \ return of_application_main(&argc, &argv, \ (class_ *)[[class_ alloc] init]); \ } |
︙ |
Modified src/OFApplication.m from [7b2e9f847b] to [2e614ff495].
︙ | |||
35 36 37 38 39 40 41 42 43 44 45 46 47 48 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | + | #endif #import "OFLocale.h" #import "OFPair.h" #import "OFRunLoop+Private.h" #import "OFRunLoop.h" #import "OFSandbox.h" #import "OFString.h" #import "OFSystemInfo.h" #import "OFThread+Private.h" #import "OFThread.h" #import "OFInvalidArgumentException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFSandboxActivationFailedException.h" |
︙ | |||
108 109 110 111 112 113 114 | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | - - - + - - - + + + + + + | int wargc, si = 0; #endif [[OFLocale alloc] init]; app = [[OFApplication alloc] of_init]; |
︙ | |||
220 221 222 223 224 225 226 | 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 | + - - + + - - - - + + + + - - - - + + + + - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + + - - - + + + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | @try { _environment = [[OFMutableDictionary alloc] init]; atexit(atexitHandler); #if defined(OF_WINDOWS) if ([OFSystemInfo isWindowsNT]) { |
︙ | |||
434 435 436 437 438 439 440 | 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | - - + - - + + - - + - - - - | [super dealloc]; } - (void)of_setArgumentCount: (int *)argc andArgumentValues: (char ***)argv { |
︙ |
Modified src/OFArray.h from [fea61523da] to [82b5ea76b0].
︙ | |||
384 385 386 387 388 389 390 | 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 | - + | withObject: (nullable id)object; /*! * @brief Returns a copy of the array sorted using the specified selector and * options. * * @param selector The selector to use to sort the array. It's signature |
︙ |
Modified src/OFCharacterSet.m from [6367b81058] to [7a7a3d4551].
︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 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 | + + + + + + + + + - + - - - + + - - + | #include "config.h" #import "OFCharacterSet.h" #import "OFBitSetCharacterSet.h" #import "OFInvertedCharacterSet.h" #import "OFRangeCharacterSet.h" #import "once.h" @interface OFPlaceholderCharacterSet: OFCharacterSet @end @interface OFWhitespaceCharacterSet: OFCharacterSet @end static struct { Class isa; } placeholder; static OFCharacterSet *whitespaceCharacterSet = nil; static void |
︙ | |||
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 | + + + - + | + (instancetype)characterSetWithRange: (of_range_t)range { return [[[self alloc] initWithRange: range] autorelease]; } + (OFCharacterSet *)whitespaceCharacterSet { static of_once_t onceControl = OF_ONCE_INIT; of_once(&onceControl, initWhitespaceCharacterSet); |
︙ | |||
135 136 137 138 139 140 141 | 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | - + - - - - - - - - - - - - - - - - - - - - - - - | { OF_UNRECOGNIZED_SELECTOR } - (OFCharacterSet *)invertedSet { return [[[OFInvertedCharacterSet alloc] |
︙ |
Modified src/OFColor.h from [53dfa6424a] to [59ecd06578].
︙ | |||
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 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | */ @interface OFColor: OFObject { float _red, _green, _blue, _alpha; OF_RESERVE_IVARS(4) } #ifdef OF_HAVE_CLASS_PROPERTIES @property (class, readonly, nonatomic) OFColor *black; @property (class, readonly, nonatomic) OFColor *silver; @property (class, readonly, nonatomic) OFColor *grey; @property (class, readonly, nonatomic) OFColor *white; @property (class, readonly, nonatomic) OFColor *maroon; @property (class, readonly, nonatomic) OFColor *red; @property (class, readonly, nonatomic) OFColor *purple; @property (class, readonly, nonatomic) OFColor *fuchsia; @property (class, readonly, nonatomic) OFColor *green; @property (class, readonly, nonatomic) OFColor *lime; @property (class, readonly, nonatomic) OFColor *olive; @property (class, readonly, nonatomic) OFColor *yellow; @property (class, readonly, nonatomic) OFColor *navy; @property (class, readonly, nonatomic) OFColor *blue; @property (class, readonly, nonatomic) OFColor *teal; @property (class, readonly, nonatomic) OFColor *aqua; #endif /*! * @brief Creates a new color with the specified red, green, blue and alpha * value. * * @param red The red value of the color, between 0.0 and 1.0 * @param green The green value of the color, between 0.0 and 1.0 * @param blue The blue value of the color, between 0.0 and 1.0 * @param alpha The alpha value of the color, between 0.0 and 1.0 * @return A new color with the specified red, green, blue and alpha value */ + (instancetype)colorWithRed: (float)red green: (float)green blue: (float)blue alpha: (float)alpha; /*! * @brief Returns the HTML color `black`. * * The RGBA value is (0, 0, 0, 1). * * @return The HTML color `black` */ + (OFColor *)black; /*! * @brief Returns the HTML color `silver`. * * The RGBA value is (0.75, 0.75, 0.75, 1). * * @return The HTML color `silver` */ + (OFColor *)silver; /*! * @brief Returns the HTML color `grey`. * * The RGBA value is (0.5, 0.5, 0.5, 1). * * @return The HTML color `grey` */ + (OFColor *)grey; /*! * @brief Returns the HTML color `white`. * * The RGBA value is (1, 1, 1, 1). * * @return The HTML color `white` */ + (OFColor *)white; /*! * @brief Returns the HTML color `maroon`. * * The RGBA value is (0.5, 0, 0, 1). * * @return The HTML color `maroon` */ + (OFColor *)maroon; /*! * @brief Returns the HTML color `red`. * * The RGBA value is (1, 0, 0, 1). * * @return The HTML color `red` */ + (OFColor *)red; /*! * @brief Returns the HTML color `purple`. * * The RGBA value is (0.5, 0, 0.5, 1). * * @return The HTML color `purple` */ + (OFColor *)purple; /*! * @brief Returns the HTML color `fuchsia`. * * The RGBA value is (1, 0, 1, 1). * * @return The HTML color `fuchsia` */ + (OFColor *)fuchsia; /*! * @brief Returns the HTML color `green`. * * The RGBA value is (0, 0.5, 0, 1). * * @return The HTML color `green` */ + (OFColor *)green; /*! * @brief Returns the HTML color `lime`. * * The RGBA value is (0, 1, 0, 1). * * @return The HTML color `lime` */ + (OFColor *)lime; /*! * @brief Returns the HTML color `olive`. * * The RGBA value is (0.5, 0.5, 0, 1). * * @return The HTML color `olive` */ + (OFColor *)olive; /*! * @brief Returns the HTML color `yellow`. * * The RGBA value is (1, 1, 0, 1). * * @return The HTML color `yellow` */ + (OFColor *)yellow; /*! * @brief Returns the HTML color `navy`. * * The RGBA value is (0, 0, 0.5, 1). * * @return The HTML color `navy` */ + (OFColor *)navy; /*! * @brief Returns the HTML color `blue`. * * The RGBA value is (0, 0, 1, 1). * * @return The HTML color `blue` */ + (OFColor *)blue; /*! * @brief Returns the HTML color `teal`. * * The RGBA value is (0, 0.5, 0.5, 1). * * @return The HTML color `teal` */ + (OFColor *)teal; /*! * @brief Returns the HTML color `aqua`. * * The RGBA value is (0, 1, 1, 1). * * @return The HTML color `aqua` */ + (OFColor *)aqua; /*! * @brief Initializes an already allocated color with the specified red, green, * blue and alpha value. * * @param red The red value of the color, between 0.0 and 1.0 * @param green The green value of the color, between 0.0 and 1.0 * @param blue The blue value of the color, between 0.0 and 1.0 |
︙ |
Modified src/OFColor.m from [c54ddadacf] to [eeffafbeab].
︙ | |||
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #import "OFColor.h" #import "once.h" #import "OFInvalidArgumentException.h" @implementation OFColor #define PREDEFINED_COLOR(name, r, g, b) \ static OFColor *name##Color = nil; \ \ static void \ initPredefinedColor_##name(void) \ { \ name##Color = [[OFColor alloc] initWithRed: r \ green: g \ blue: b \ alpha: 1]; \ } \ \ + (OFColor *)name \ { \ static of_once_t onceControl = OF_ONCE_INIT; \ of_once(&onceControl, initPredefinedColor_##name); \ \ return name##Color; \ } PREDEFINED_COLOR(black, 0.00, 0.00, 0.00) PREDEFINED_COLOR(silver, 0.75, 0.75, 0.75) PREDEFINED_COLOR(grey, 0.50, 0.50, 0.50) PREDEFINED_COLOR(white, 1.00, 1.00, 1.00) PREDEFINED_COLOR(maroon, 0.50, 0.00, 0.00) PREDEFINED_COLOR(red, 1.00, 0.00, 0.00) PREDEFINED_COLOR(purple, 0.50, 0.00, 0.50) PREDEFINED_COLOR(fuchsia, 1.00, 0.00, 1.00) PREDEFINED_COLOR(green, 0.00, 0.50, 0.00) PREDEFINED_COLOR(lime, 0.00, 1.00, 0.00) PREDEFINED_COLOR(olive, 0.50, 0.50, 0.00) PREDEFINED_COLOR(yellow, 1.00, 1.00, 0.00) PREDEFINED_COLOR(navy, 0.00, 0.00, 0.50) PREDEFINED_COLOR(blue, 0.00, 0.00, 1.00) PREDEFINED_COLOR(teal, 0.00, 0.50, 0.50) PREDEFINED_COLOR(aqua, 0.00, 1.00, 1.00) + (instancetype)colorWithRed: (float)red green: (float)green blue: (float)blue alpha: (float)alpha { return [[[self alloc] initWithRed: red green: green |
︙ | |||
82 83 84 85 86 87 88 | 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 | - - + - - - + - + - + - + - + - + - + - + | return true; } - (uint32_t)hash { uint32_t hash; |
︙ |
Modified src/OFConstantString.h from [a28a2410f5] to [b16809eb56].
︙ | |||
11 12 13 14 15 16 17 | 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 | + + + - + + + + + | * * 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 OBJFW_OF_CONSTANT_STRING_H #define OBJFW_OF_CONSTANT_STRING_H |
Modified src/OFConstantString.m from [743f51b49a] to [1a9a1e4686].
︙ | |||
670 671 672 673 674 675 676 677 678 679 680 681 682 683 | 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 | + + + + + + + + + | - (OFString *)decomposedStringWithCompatibilityMapping { [self finishInitialization]; return self.decomposedStringWithCompatibilityMapping; } #endif #ifdef OF_WINDOWS - (OFString *)stringByExpandingWindowsEnvironmentStrings { [self finishInitialization]; return self.stringByExpandingWindowsEnvironmentStrings; } #endif #ifdef OF_HAVE_FILES - (void)writeToFile: (OFString *)path { [self finishInitialization]; [self writeToFile: path]; |
︙ |
Modified src/OFDNSResolver.h from [8e72b091f6] to [074bf54ace].
︙ | |||
30 31 32 33 34 35 36 37 38 39 40 41 42 43 | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | + | @class OFDNSResolver; @class OFDNSResolverContext; @class OFDNSResolverSettings; @class OFDate; @class OFDictionary OF_GENERIC(KeyType, ObjectType); @class OFMutableDictionary OF_GENERIC(KeyType, ObjectType); @class OFNumber; @class OFTCPSocket; @class OFUDPSocket; /*! * @enum of_dns_resolver_error_t OFDNSResolver.h ObjFW/OFDNSResolver.h * * @brief An enum describing why resolving a host failed. */ |
︙ | |||
127 128 129 130 131 132 133 134 135 136 137 138 139 140 | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | + + | OFUDPSocket *_IPv4Socket; #ifdef OF_HAVE_IPV6 OFUDPSocket *_IPv6Socket; #endif char _buffer[OF_DNS_RESOLVER_BUFFER_LENGTH]; OFMutableDictionary OF_GENERIC(OFNumber *, OFDNSResolverContext *) *_queries; OFMutableDictionary OF_GENERIC(OFTCPSocket *, OFDNSResolverContext *) *_TCPQueries; } /*! * @brief A dictionary of static hosts. * * This dictionary is checked before actually looking up a host. */ |
︙ |
Modified src/OFDNSResolver.m from [8f5030468c] to [5d30f91158].
︙ | |||
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 | 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 | + + - - - - - - - + + + + + | #import "OFData.h" #import "OFDate.h" #import "OFDictionary.h" #import "OFHostAddressResolver.h" #import "OFNumber.h" #import "OFPair.h" #import "OFString.h" #import "OFTCPSocket.h" #import "OFTimer.h" #import "OFUDPSocket.h" #import "OFUDPSocket+Private.h" #import "OFDNSQueryFailedException.h" #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFInvalidServerReplyException.h" #import "OFOutOfRangeException.h" #import "OFTruncatedDataException.h" #ifndef SOCK_DNS # define SOCK_DNS 0 #endif #define BUFFER_LENGTH OF_DNS_RESOLVER_BUFFER_LENGTH #define MAX_DNS_RESPONSE_LENGTH 65536 /* * RFC 1035 doesn't specify if pointers to pointers are allowed, and if so how * many. Since it's unspecified, we have to assume that it might happen, but we * also want to limit it to avoid DoS. Limiting it to 16 levels of pointers and * immediately rejecting pointers to itself seems like a fair balance. */ #define MAX_ALLOWED_POINTERS 16 #define CNAME_RECURSION 3 |
︙ | |||
309 310 311 312 313 314 315 | 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 | + + + + + + + + + + + - - + + + + + + + + - + | return [[[OFMXDNSResourceRecord alloc] initWithName: name DNSClass: DNSClass preference: preference mailExchange: mailExchange TTL: TTL] autorelease]; } else if (recordType == OF_DNS_RECORD_TYPE_TXT) { OFMutableArray *textStrings = [OFMutableArray array]; while (dataLength > 0) { uint_fast8_t stringLength = buffer[i++]; dataLength--; if (stringLength > dataLength) @throw [OFInvalidServerReplyException exception]; [textStrings addObject: |
︙ | |||
535 536 537 538 539 540 541 542 543 544 545 546 547 548 | 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 | + + | - (void)dealloc { [_query release]; [_ID release]; [_settings release]; [_delegate release]; [_queryData release]; [_TCPSocket release]; [_TCPQueryData release]; [_cancelTimer release]; [super dealloc]; } @end @implementation OFDNSResolver |
︙ | |||
566 567 568 569 570 571 572 573 574 575 576 577 578 579 | 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 | + | - (instancetype)init { self = [super init]; @try { _settings = [[OFDNSResolverSettings alloc] init]; _queries = [[OFMutableDictionary alloc] init]; _TCPQueries = [[OFMutableDictionary alloc] init]; [_settings reload]; } @catch (id e) { [self release]; @throw e; } |
︙ | |||
588 589 590 591 592 593 594 595 596 597 598 599 600 601 | 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 | + | [_IPv4Socket cancelAsyncRequests]; [_IPv4Socket release]; #ifdef OF_HAVE_IPV6 [_IPv6Socket cancelAsyncRequests]; [_IPv6Socket release]; #endif [_queries release]; [_TCPQueries release]; [super dealloc]; } - (OFDictionary *)staticHosts { return _settings->_staticHosts; |
︙ | |||
690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 | + + + + + + + + + + + + + + + + + + - + - + | } - (void)of_sendQueryForContext: (OFDNSResolverContext *)context runLoopMode: (of_run_loop_mode_t)runLoopMode { OFUDPSocket *sock; OFString *nameServer; [_queries setObject: context forKey: context->_ID]; [context->_cancelTimer invalidate]; [context->_cancelTimer release]; context->_cancelTimer = nil; context->_cancelTimer = [[OFTimer alloc] initWithFireDate: [OFDate dateWithTimeIntervalSinceNow: context->_settings->_timeout] interval: context->_settings->_timeout target: self selector: @selector(of_contextTimedOut:) object: context repeats: false]; [[OFRunLoop currentRunLoop] addTimer: context->_cancelTimer forMode: runLoopMode]; nameServer = [context->_settings->_nameServers objectAtIndex: context->_nameServersIndex]; if (context->_settings->_usesTCP) { OF_ENSURE(context->_TCPSocket == nil); context->_TCPSocket = [[OFTCPSocket alloc] init]; [_TCPQueries setObject: context forKey: context->_TCPSocket]; context->_TCPSocket.delegate = self; [context->_TCPSocket asyncConnectToHost: nameServer port: 53 runLoopMode: runLoopMode]; return; } context->_usedNameServer = of_socket_address_parse_ip(nameServer, 53); switch (context->_usedNameServer.family) { #ifdef OF_HAVE_IPV6 case OF_SOCKET_ADDRESS_FAMILY_IPV6: if (_IPv6Socket == nil) { of_socket_address_t address = of_socket_address_parse_ip(@"::", 0); _IPv6Socket = [[OFUDPSocket alloc] init]; [_IPv6Socket of_bindToAddress: &address extraType: SOCK_DNS]; |
︙ | |||
781 782 783 784 785 786 787 | 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 | - - - + + + + + + + + + + - + - | @throw [OFOutOfRangeException exception]; context = [[[OFDNSResolverContext alloc] initWithQuery: query ID: ID settings: _settings delegate: delegate] autorelease]; |
︙ | |||
839 840 841 842 843 844 845 | 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 | - - - - + + + - - + - - - + + + - + | @selector(resolver:didPerformQuery:response:exception:)]) [context->_delegate resolver: self didPerformQuery: context->_query response: nil exception: exception]; } |
︙ | |||
899 900 901 902 903 904 905 | 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 | - - + + + + + + + + + + + + | @throw [OFInvalidServerReplyException exception]; /* Opcode */ if ((buffer[2] & 0x78) != (queryDataBuffer[2] & 0x78)) @throw [OFInvalidServerReplyException exception]; /* TC */ |
︙ | |||
991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 | 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | if ([context->_delegate respondsToSelector: @selector(resolver:didPerformQuery:response:exception:)]) [context->_delegate resolver: self didPerformQuery: context->_query response: response exception: exception]; return false; } - (bool)socket: (OFDatagramSocket *)sock didReceiveIntoBuffer: (void *)buffer length: (size_t)length sender: (const of_socket_address_t *)sender exception: (id)exception { if (exception != nil) return true; return [self of_handleResponseBuffer: buffer length: length sender: sender]; } - (void)socket: (OFTCPSocket *)sock didConnectToHost: (OFString *)host port: (uint16_t)port exception: (id)exception { OFDNSResolverContext *context = [_TCPQueries objectForKey: sock]; OF_ENSURE(context != nil); if (exception != nil) { /* * TODO: Handle error immediately instead of waiting for the * timer to try the next nameserver or to retry. */ [_TCPQueries removeObjectForKey: context->_TCPSocket]; [context->_TCPSocket release]; context->_TCPSocket = nil; context->_responseLength = 0; return; } if (context->_TCPQueryData == nil) { size_t queryDataCount = context->_queryData.count; uint16_t tmp; if (queryDataCount > UINT16_MAX) @throw [OFOutOfRangeException exception]; context->_TCPQueryData = [[OFMutableData alloc] initWithCapacity: queryDataCount + 2]; tmp = OF_BSWAP16_IF_LE(queryDataCount); [context->_TCPQueryData addItems: &tmp count: sizeof(tmp)]; [context->_TCPQueryData addItems: context->_queryData.items count: queryDataCount]; } [sock asyncWriteData: context->_TCPQueryData]; } - (OFData *)stream: (OFStream *)stream didWriteData: (OFData *)data bytesWritten: (size_t)bytesWritten exception: (id)exception { OFTCPSocket *sock = (OFTCPSocket *)stream; OFDNSResolverContext *context = [_TCPQueries objectForKey: sock]; OF_ENSURE(context != nil); if (exception != nil) { /* * TODO: Handle error immediately instead of waiting for the * timer to try the next nameserver or to retry. */ [_TCPQueries removeObjectForKey: context->_TCPSocket]; [context->_TCPSocket release]; context->_TCPSocket = nil; context->_responseLength = 0; return nil; } if (context->_TCPBuffer == nil) context->_TCPBuffer = [context allocMemoryWithSize: MAX_DNS_RESPONSE_LENGTH]; [sock asyncReadIntoBuffer: context->_TCPBuffer exactLength: 2]; return nil; } - (bool)stream: (OFStream *)stream didReadIntoBuffer: (void *)buffer length: (size_t)length exception: (id)exception { OFTCPSocket *sock = (OFTCPSocket *)stream; OFDNSResolverContext *context = [_TCPQueries objectForKey: sock]; OF_ENSURE(context != nil); if (exception != nil) { /* * TODO: Handle error immediately instead of waiting for the * timer to try the next nameserver or to retry. */ goto done; } if (context->_responseLength == 0) { unsigned char *ucBuffer = buffer; OF_ENSURE(length == 2); context->_responseLength = (ucBuffer[0] << 8) | ucBuffer[1]; if (context->_responseLength > MAX_DNS_RESPONSE_LENGTH) @throw [OFOutOfRangeException exception]; if (context->_responseLength == 0) goto done; [sock asyncReadIntoBuffer: context->_TCPBuffer exactLength: context->_responseLength]; return false; } if (length != context->_responseLength) /* * The connection was closed before we received the entire * response. */ goto done; [self of_handleResponseBuffer: buffer length: length sender: NULL]; done: [_TCPQueries removeObjectForKey: context->_TCPSocket]; [context->_TCPSocket release]; context->_TCPSocket = nil; context->_responseLength = 0; return false; } - (void)asyncResolveAddressesForHost: (OFString *)host delegate: (id <OFDNSResolverHostDelegate>)delegate { [self asyncResolveAddressesForHost: host |
︙ |
Modified src/OFDNSResolverSettings.m from [67fa5dd9c3] to [995314850c].
︙ | |||
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | + + + | #ifdef OF_WINDOWS # define interface struct # include <iphlpapi.h> # undef interface #endif #ifdef OF_NINTENDO_3DS /* Newer versions of libctru started using id as a parameter name. */ # define id id_3ds # include <3ds.h> # undef id #endif #import "socket_helpers.h" #if defined(OF_HAIKU) # define HOSTS_PATH @"/system/settings/network/hosts" # define RESOLV_CONF_PATH @"/system/settings/network/resolv.conf" |
︙ | |||
481 482 483 484 485 486 487 | 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 | - + - - - - + + + + + + | pool = objc_autoreleasePoolPush(); [self setDefaults]; #if defined(OF_WINDOWS) # ifdef OF_HAVE_FILES |
︙ |
Modified src/OFDNSResourceRecord.h from [eacf6b96e8] to [279eea4da6].
︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | + | #import "socket.h" OF_ASSUME_NONNULL_BEGIN /*! @file */ @class OFArray OF_GENERIC(ObjectType); @class OFData; /*! * @brief The DNS class. */ typedef enum { /*! IN */ |
︙ | |||
586 587 588 589 590 591 592 | 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 | - + - + - + - + | * OFDNSResourceRecord.h ObjFW/OFDNSResourceRecord.h * * @brief A class representing a TXT DNS resource record. */ OF_SUBCLASSING_RESTRICTED @interface OFTXTDNSResourceRecord: OFDNSResourceRecord { |
︙ |
Modified src/OFDNSResourceRecord.m from [95ccb6d631] to [054747ac72].
︙ | |||
14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + | * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #import "OFDNSResourceRecord.h" #import "OFArray.h" #import "OFData.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" OFString * of_dns_class_to_string(of_dns_class_t DNSClass) |
︙ | |||
76 77 78 79 80 81 82 | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | - + | string = string.uppercaseString; if ([string isEqual: @"IN"]) DNSClass = OF_DNS_CLASS_IN; else { @try { |
︙ | |||
116 117 118 119 120 121 122 123 124 125 | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | + + - + | recordType = OF_DNS_RECORD_TYPE_TXT; else if ([string isEqual: @"RP"]) recordType = OF_DNS_RECORD_TYPE_RP; else if ([string isEqual: @"AAAA"]) recordType = OF_DNS_RECORD_TYPE_AAAA; else if ([string isEqual: @"SRV"]) recordType = OF_DNS_RECORD_TYPE_SRV; else if ([string isEqual: @"ALL"]) recordType = OF_DNS_RECORD_TYPE_ALL; else { @try { recordType = |
︙ | |||
1246 1247 1248 1249 1250 1251 1252 | 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 | - + - + - + - + | @"\tTTL = %" PRIu32 "\n" @">", self.className, _name, _priority, _weight, _target, _port, _TTL]; } @end @implementation OFTXTDNSResourceRecord |
︙ | |||
1304 1305 1306 1307 1308 1309 1310 | 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 | - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + + + + + + + | if (record->_DNSClass != _DNSClass) return false; if (record->_recordType != _recordType) return false; |
Modified src/OFDNSResponse.h from [156cc97081] to [12af35aca6].
︙ | |||
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 | 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 | + + | * an array of @ref OFDNSResourceRecord. */ @property (readonly, nonatomic) of_dns_response_records_t additionalRecords; /*! * @brief Creates a new, autoreleased OFDNSResponse. * * @param domainName The domain name the response is for * @param answerRecords The answer records of the response * @param authorityRecords The authority records of the response * @param additionalRecords The additional records of the response * @return A new, autoreleased OFDNSResponse */ + (instancetype) responseWithDomainName: (OFString *)domainName answerRecords: (of_dns_response_records_t)answerRecords authorityRecords: (of_dns_response_records_t)authorityRecords additionalRecords: (of_dns_response_records_t)additionalRecords; /*! * @brief Initializes an already allocated OFDNSResponse. * * @param domainName The domain name the response is for * @param answerRecords The answer records of the response * @param authorityRecords The authority records of the response * @param additionalRecords The additional records of the response * @return An initialized OFDNSResponse */ - (instancetype) initWithDomainName: (OFString *)domainName |
︙ |
Modified src/OFData+MessagePackValue.m from [95748cc907] to [caaaf51219].
︙ | |||
276 277 278 279 280 281 282 | 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 | - - - + - - + - + - - - + - - + - + - | if (length < 9) @throw [OFTruncatedDataException exception]; *object = [OFNumber numberWithInt64: readUInt64(buffer + 1)]; return 9; /* Floating point */ case 0xCA:; /* float 32 */ |
︙ |
Added src/OFDatagramSocket.h version [cb9e65f15c].