ADDED .github/workflows/macos-13.yml Index: .github/workflows/macos-13.yml ================================================================== --- .github/workflows/macos-13.yml +++ .github/workflows/macos-13.yml @@ -0,0 +1,31 @@ +name: macos-13 +on: [push, pull_request] +jobs: + tests: + runs-on: macos-13 + strategy: + matrix: + configure_flags: + - + - --disable-threads + - --disable-threads --disable-sockets + - --disable-threads --disable-files + - --disable-threads --disable-sockets --disable-files + - --disable-sockets + - --disable-sockets --disable-files + - --disable-files + - --disable-shared + steps: + - name: Install dependencies + run: brew install autoconf automake + - uses: actions/checkout@v2 + - name: autogen.sh + run: ./autogen.sh + - name: configure + run: ./configure ${{ matrix.configure_flags }} + - name: make + run: make -j$(sysctl -n hw.logicalcpu) + - name: make check + run: make check + - name: make install + run: sudo make install Index: ChangeLog ================================================================== --- ChangeLog +++ ChangeLog @@ -2,11 +2,16 @@ * Changes of existing features or bugfixes + New features This file only contains the most significant changes. -ObjFW 0.90.1 -> ObjFW 0.90.2, 23.10.2017 +ObjFW 0.90.2 -> ObjFW 1.0, 2023-08-29 + + First stable release with stable API and ABI + * Too many changes to list, as it has been almost 6 years since the last + release. See commits in the repository for details. + +ObjFW 0.90.1 -> ObjFW 0.90.2, 2017-10-23 * Fix shadowed variables which caused many bugs (e.g. using the wrong object) * Many, many nullability fixes * OFTCPSocket: Fix exception not being retained for async connect * OFThread: Fix setting the name on the wrong thread * OFMutableSet: Fix missing override for -[copy] @@ -13,11 +18,11 @@ * configure: Fix posix_spawnp check * Xcode project: Set the correct version for the bridge * Better check for iOS * tests: Fix testing the wrong OFKernelEventObserver -ObjFW 0.90 -> ObjFW 0.90.1, 20.08.2017 +ObjFW 0.90 -> ObjFW 0.90.1, 2017-08-20 * OFData: Fix -[description] * OFFileManager: Set errno to 0 before readdir() * OFDate: Add -[localMinute] * OFTarArchiveEntry: Fix prefix handling for ustar * OFZIPArchive: Fix uncompressed + data descriptor @@ -26,11 +31,11 @@ * OFGZIPStream: Add missing documentation * Fix a linker warning on OpenBSD/SPARC64 * Remove the OFFile b modes from MorphOS (they were already removed for all other OSes) -ObjFW 0.8.1 -> ObjFW 0.90, 01.08.2017 +ObjFW 0.8.1 -> ObjFW 0.90, 2017-08-01 + New classes: OFFileManager, OFGZIPStream, OFTarArchive, OFTarArchiveEntry OFHMAC, OFSandbox, OFHTTPCookie, OFHTTPCookieManager, OFLocalization + New platforms: Nintendo 3DS, MorphOS + New lookup assembly for platforms: SPARC64/ELF, ARM64/ELF @@ -58,11 +63,11 @@ + scrypt + Xcode project to build for iOS + String decomposition to NFD * OFFile modes simplified ('b' removed) -ObjFW 0.8 -> ObjFW 0.8.1, 04.10.2015 +ObjFW 0.8 -> ObjFW 0.8.1, 2015-10-04 * Adjust to __nullable / __nonnull being changed to _Nullable / _Nonnull in Clang 3.7 (this fixes compilation with Clang 3.7) * Blocks: Proper handling when called from a byref handler * Fix compilation on Solaris * Fix compilation for Wii, PSP and Nintendo DS @@ -72,11 +77,11 @@ * Special cases for the Wii's weird network stack (fixes the tests) * Better length checks for write / send calls * Don't use -pedantic on platforms where it's broken by the system headers * Documentation fixes -ObjFW 0.7.1 -> ObjFW 0.8, 14.08.2015 +ObjFW 0.7.1 -> ObjFW 0.8, 2015-08-14 + An insanely huge amount of new APIs + New classes: OFHTTPServer, OFINICategory, OFINIFile, OFInflate64Stream, OFInflateStream, OFMapTable, OFRIPEMD160Hash, OFSHA224Hash, OFSHA256Hash, OFSHA384Hash, OFSHA512Hash, OFSettings, OFStdIOStream, OFSystemInfo, @@ -121,20 +126,20 @@ * Rewritten OFMD5Hash and OFSHA1Hash * Reworked OFTLSSocket API (easier verification) * Unicode support updated to Unicode 8.0 * OFURL: Proper escaping and unescaping -ObjFW 0.7 -> ObjFW 0.7.1, 12.11.2012 +ObjFW 0.7 -> ObjFW 0.7.1, 2012-11-12 + Support for Haiku * Autorelease pools now work properly without __thread * Incorrect framework version in Xcode project fixed * Documentation fixes and improvements * Blocks now only use 16 bits for the reference count in order to avoid problems with newer Clang versions * More use of OF_SENTINEL -ObjFW 0.6 -> ObjFW 0.7, 27.10.2012 +ObjFW 0.6 -> ObjFW 0.7, 2012-10-27 Again, the differences are more than in any release before, thus listing them all would be too much. The major differences are: + ObjFW now comes with its own runtime, which greatly increases performance compared to the GNU runtime and is even faster than the Apple runtime (using Clang >= 3.2 is recommended, but not necessary) @@ -154,11 +159,11 @@ * All private methods use the prefix OF_ now instead of _, making it possible to use the _ prefix in applications * Most ObjC compiler feature checks are not part of configure anymore, making it possible to use the same installation with different compilers -ObjFW 0.5.4 -> ObjFW 0.6, 27.02.2012 +ObjFW 0.5.4 -> ObjFW 0.6, 2012-02-27 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 @@ -170,38 +175,38 @@ + 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 +ObjFW 0.5.3 -> ObjFW 0.5.4, 2011-08-30 * The blocks runtime is now working correctly * Documentation fixes * -framework works with objfw-compile now + Support for QNX * Various small fixes -ObjFW 0.5.2 -> ObjFW 0.5.3, 01.07.2011 +ObjFW 0.5.2 -> ObjFW 0.5.3, 2011-07-01 * Lots of bugfixes, see Git log for details -ObjFW 0.5.1 -> ObjFW 0.5.2, 25.04.2011 +ObjFW 0.5.1 -> ObjFW 0.5.2, 2011-04-25 * Fix double-retain in OFList * Don't ignore the timeout in OFStreamObserver when using select() * Do -[OFURL copy] in a try block to prevent a leak when an exception occurs * Fix too big buffer in -[OFMutableString _applyTable:withSize:] * Call madvise() on the correct length variable so it covers the whole string * Fix a warning when sizeof(size_t) < sizeof(long long) * Skip possible BOMs when appending strings -ObjFW 0.5 -> ObjFW 0.5.1, 21.04.2011 +ObjFW 0.5 -> ObjFW 0.5.1, 2011-04-21 * Work around a wrong warning produced by Apple GCC 4.0.1 which would cause the build to fail due to -Werror * Call objc_thread_{add,remove} when using the GNU runtime to make sure the runtime knows about our thread * Detach a thread before restarting if it was never joined * Release the old return value when restarting a thread -ObjFW 0.4-alpha1 -> 0.5, 09.04.2011 +ObjFW 0.4-alpha1 -> 0.5, 2011-04-09 + %@ is now allowed in format strings + Added of_log for easy logging * Exceptions have one header per exception now * Lots of exception improvements * Huge improvements in XML handling @@ -217,11 +222,11 @@ + Support for Base64 + Use a real Xcode project instead of just calling make + Add Haiku to the list of supported platforms * Lots of small bugfixes and countless small changes. Read the commits! -ObjFW 0.3.1 -> 0.4-alpha1, 03.01.2011 +ObjFW 0.3.1 -> 0.4-alpha1, 2011-01-03 * ObjFW is now available under the terms of the QPL, GPLv2 and GPLv3 + Support for blocks was added, including a blocks runtime + Added support for the new GNU runtime, introduced in GCC 4.6 * Objects returned from collections are no longer retained and autoreleased + Added new classes OFXMLParser, OFXMLElement, OFXMLAttribute and @@ -236,20 +241,20 @@ * objfw-compile now has a new syntax + objfw-compile can now compile libraries and plugins * Many small changes and new features that would be too much to list here The diff between 0.3.1 and 0.4-alpha1 has almost 24000 lines! -ObjFW 0.3 -> 0.3.1, 19.06.2010 +ObjFW 0.3 -> 0.3.1, 2010-06-19 * Fix a typo in OFMutableDictionary that prevented termination in case the last bucket is already used when the dictionary is resized * The mutations pointer is now correctly initialized in enumerators for immutable collections * The objc_sync test was still using the old threads API and was updated to use the new one now * PLATFORMS has been updated to be more specific -ObjFW 0.2.1 -> 0.3, 09.05.2010 +ObjFW 0.2.1 -> 0.3, 2010-05-09 + Many new methods were added to different classes + A huge amount of methods was added to OFStream, allowing easy binary stream handling and even mixing string-based and binary operations + An optional write buffer was added to OFStream + OFSeekableStream was added for streams that allow seeking, for example @@ -286,19 +291,19 @@ by the compiler + The library version is now included in the resulting dylib and libobjc is reexported now. Additionally, objfw-config offers --reexport now to produce libraries that link against ObjFW and reexport it -ObjFW 0.2 -> 0.2.1, 14.03.2010 +ObjFW 0.2 -> 0.2.1, 2010-03-14 * Fix for OFNumbers not doing calculations * Improved -[hash] for OFNumbers with floats and doubles + Tests for OFNumber * Small optimization for OFArray's -[componentsJoinedByString:] * Documentation improvements * Updated copyright -ObjFW 0.1.2 -> 0.2, 01.02.2010 +ObjFW 0.1.2 -> 0.2, 2010-02-01 + Support for ObjC 2 Fast Enumerations on every platform which has compiler support for fast enumerations + Support for ObjC 2 properties on every platform with compiler support + Fast Enumeration through arrays and dictionaries * OFIterator has been removed @@ -323,17 +328,17 @@ * File methods unavailable on Windows don't throw an exception at runtime anymore, but instead are not even in the interface on Windows. This way, it is a compile time error instead of a runtime error -ObjFW 0.1.1 -> 0.1.2, 15.01.2010 +ObjFW 0.1.1 -> 0.1.2, 2010-01-15 * Fix a bug in OFMutableArray's -[removeObject:] and -[removeObjectIdenticalTo:] that could lead to not removing all occurrences of the object from the array and to out of bounds reads * Change the URL in the framework plist to the homepage -ObjFW 0.1 -> 0.1.1, 04.01.2010 +ObjFW 0.1 -> 0.1.1, 2010-01-04 * Fix a missing out of range check for -[removeNItems:atIndex:] that allowed the programmer to specify too big ranges so it would crash instead of throwing an exception * Fix missing calls to -[retain] and -[autorelease] when getting objects from an OFArray or OFDictionary @@ -344,7 +349,7 @@ this is a serious programmer error * -[readLineWithEncoding:] is more fault-tolerant now and does not lose data when it stumbles upon invalid encoding. Instead, it allows recalling with the correct encoding now -ObjFW 0.1, 24.12.2009 +ObjFW 0.1, 2009-12-24 + Initial release Index: Doxyfile ================================================================== --- Doxyfile +++ Doxyfile @@ -6,12 +6,11 @@ HAVE_DOT = NO GENERATE_LATEX = NO HIDE_UNDOC_CLASSES = YES HIDE_UNDOC_MEMBERS = YES TYPEDEF_HIDES_STRUCT = YES -PREDEFINED = __OBJC__ \ - _Nonnull= \ +PREDEFINED = _Nonnull= \ _Nullable= \ DOXYGEN \ OF_BOXABLE= \ OF_CONSUMED= \ OF_DESIGNATED_INITIALIZER= \ @@ -24,13 +23,15 @@ OF_HAVE_APPLETALK \ OF_HAVE_BLOCKS \ OF_HAVE_FILES \ OF_HAVE_IPV6 \ OF_HAVE_IPX \ + OF_HAVE_PLUGINS \ OF_HAVE_SANDBOX \ OF_HAVE_SOCKETS \ OF_HAVE_THREADS \ + OF_HAVE_UNICODE_TABLES \ OF_KINDOF(...)= \ OF_NO_RETURN= \ OF_NO_RETURN_FUNC= \ OF_NULLABLE_PROPERTY(...)= \ OF_NULL_RESETTABLE_PROPERTY(...)= \ Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -26,20 +26,17 @@ release: docs echo "Generating tarball for version ${PACKAGE_VERSION}..." rm -fr objfw-${PACKAGE_VERSION} objfw-${PACKAGE_VERSION}.tar \ objfw-${PACKAGE_VERSION}.tar.gz fossil tarball --name objfw-${PACKAGE_VERSION} current - \ - --exclude '.fossil*,.git*' | ofarc -ttgz -xq - + --exclude '.fossil*,.git*,objfw.spec' | ofarc -ttgz -xq - cp configure config.h.in objfw-${PACKAGE_VERSION}/ ofarc -cq objfw-${PACKAGE_VERSION}.tar objfw-${PACKAGE_VERSION} rm -fr objfw-${PACKAGE_VERSION} gzip -9 objfw-${PACKAGE_VERSION}.tar rm -f objfw-${PACKAGE_VERSION}.tar gpg -b objfw-${PACKAGE_VERSION}.tar.gz || true - echo "Generating documentation..." - rm -fr docs - doxygen >/dev/null rm -fr objfw-docs-${PACKAGE_VERSION} objfw-docs-${PACKAGE_VERSION}.tar \ objfw-docs-${PACKAGE_VERSION}.tar.gz mv docs objfw-docs-${PACKAGE_VERSION} echo "Generating docs tarball for version ${PACKAGE_VERSION}..." ofarc -cq objfw-docs-${PACKAGE_VERSION}.tar \ Index: PLATFORMS.md ================================================================== --- PLATFORMS.md +++ PLATFORMS.md @@ -64,12 +64,10 @@ * OS Versions: 0.9 * Architectures: i686 * Compilers: Clang 14.0.6 * Runtimes: ObjFW - * Limitations: No support for UNIX sockets (`AF_UNIX` with `SOCK_DGRAM` is - currently broken in Hurd) Haiku ----- @@ -80,11 +78,11 @@ HP-UX ----- - * OS versions: 11i v1 (PA-RISC 2.0), 11i v3 (Itanium) + * OS versions: 11i v1, 11i v3 * Architectures: Itanium, PA-RISC 2.0 * Compilers: GCC 4.7.2, GCC 7.5.0 * Runtimes: ObjFW * Notes: Exception handling on Itanium in 32 bit mode is broken, you need to use 64 bit mode by passing `OBJC="gcc -mlp64"` to `configure`. @@ -235,12 +233,11 @@ Windows ------- - * OS Versions: 98 SE, NT 4.0, XP (x86), 7 (x64), 8 (x64), 8.1 (x64), 10, 11, - Wine (x86 & x64) + * OS Versions: 98 SE, NT 4.0, XP, 7, 8, 8.1, 10, 11, Wine * Architectures: AArch64, AMD64, x86 * Compilers: GCC 5.3.0 & 6.2.0 from msys2 (AMD64 & x86), Clang 3.9.0 from msys2 (x86), Clang 10.0 from msys2 (AMD64 & x86), Clang 14.0.4 from msys2 (AArch64) Index: README.md ================================================================== --- README.md +++ README.md @@ -391,14 +391,14 @@ * Thank you to [Jonathan Neuschäfer](https://github.com/neuschaefer) for reviewing the *entirety* (all 84k LoC at the time) of ObjFW's codebase in 2017! * Thank you to [Hill Ma](https://github.com/mahiuchun) for donating an M1 Mac - Mini to the project! + Mini to the project in 2022!

Commercial use

If for whatever reason neither the terms of the QPL nor those of the GPL work for you, a proprietary license for ObjFW including support is available upon request. Just write a mail to js@nil.im and we can find a reasonable solution for both parties. Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -35,11 +35,11 @@ enable_threads="no" enable_sockets="no" enable_files="no" ;; m68k-*-amigaos*) - AS_IF([test x"$OBJCFLAGS" = x""], [OBJCFLAGS="-O0"]) + AS_IF([test x"$OBJCFLAGS" = x""], [OBJCFLAGS="-O0 -g"]) OBJCFLAGS="$OBJCFLAGS -noixemul" OBJFW_OBJCFLAGS="$OBJFW_OBJCFLAGS -noixemul" CPPFLAGS="$CPPFLAGS -D__NO_NET_API" LDFLAGS="$LDFLAGS -noixemul" LIBS="$LIBS -ldebug" @@ -1468,20 +1468,35 @@ ]) AC_CHECK_HEADER(netinet/tcp.h, [ AC_DEFINE(OF_HAVE_NETINET_TCP_H, 1, [Whether we have netinet/tcp.h]) ]) - AC_CHECK_HEADERS([arpa/inet.h netdb.h]) - AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h net/if_types.h]) - AC_CHECK_FUNCS([if_indextoname if_nametoindex]) + AC_CHECK_HEADERS([arpa/inet.h netdb.h sys/sockio.h]) + AC_CHECK_HEADERS([net/if.h], [], [], [ + #ifdef OF_HAVE_SYS_SOCKET_H + # include + #endif + ]) + AC_CHECK_HEADERS([net/if_arp.h net/if_dl.h net/if_types.h]) + AC_CHECK_FUNCS([if_indextoname if_nametoindex if_nameindex]) AC_CHECK_TYPES([struct sockaddr_dl], [], [], [ - #ifdef HAVAE_SYS_TYPES_H + #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_NET_IF_DL_H # include #endif + ]) + AC_CHECK_TYPES([struct lifconf], [], [], [ + #ifdef HAVE_NET_IF_H + # include + #endif + ]) + AC_CHECK_MEMBERS([struct ifreq.ifr_hwaddr], [], [], [ + #ifdef HAVE_NET_IF_H + # include + #endif ]) AC_CHECK_HEADER(sys/un.h, [ AC_DEFINE(OF_HAVE_SYS_UN_H, 1, [Whether we have sys/un.h]) ]) AC_CHECK_MEMBER([struct sockaddr_in6.sin6_addr], [ @@ -1508,10 +1523,12 @@ #ifdef AF_INET6 egrep_cpp_yes #endif ], [ AC_DEFINE(OF_HAVE_IPV6, 1, [Whether we have IPv6]) + + AC_CHECK_FUNCS(inet6_getscopeid) ]) ], [ dnl Work around a bug in autoconf 2.61 that creates a broken dnl configure if this branch is empty. : @@ -1581,24 +1598,20 @@ #endif #ifdef __MINT__ # error Gives invalid argument at runtime #endif - - #ifdef __gnu_hurd__ - # error Empty sun_path in the source given by recvfrom() - #endif ]) 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_ipx.sipx_network, [], [ AC_CHECK_MEMBER(struct sockaddr_ipx.sa_netnum, [], [ - AC_CHECK_MEMBER(struct sockaddr_ipx.sipx_addr.x_port, [ - ], [], [ + AC_CHECK_MEMBER(struct sockaddr_ipx.sipx_addr.x_port, + [], [], [ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef OF_HAVE_NETIPX_IPX_H @@ -1819,13 +1832,10 @@ "OFSelectKernelEventObserver.m") ]) ;; esac - AC_CHECK_HEADERS(net/if.h) - AC_CHECK_FUNCS(if_nameindex) - AC_ARG_WITH(tls, AS_HELP_STRING([--with-tls], [ enable TLS support using the specified library (yes, openssl, gnutls, securetransport or no)])) AS_IF([test x"$with_tls" = x""], [with_tls="yes"]) @@ -1850,25 +1860,10 @@ LIBS="$old_LIBS" ]) ]) - AS_IF([test x"$with_tls" = x"gnutls" \ - -o \( x"$with_tls" = x"yes" -a x"$tls_support" = x"no" \)], [ - PKG_CHECK_MODULES(gnutls, [gnutls >= 3.5.0], [ - tls_support="GnuTLS" - TLS_CPPFLAGS="$gnutls_CFLAGS $TLS_CPPFLAGS" - TLS_LIBS="$gnutls_LIBS $TLS_LIBS" - - AC_SUBST(OF_GNUTLS_TLS_STREAM_M, "OFGnuTLSTLSStream.m") - ], [ - dnl Disable default action-if-not-found, which exits - dnl configure with an error. - : - ]) - ]) - AS_IF([test x"$with_tls" = x"openssl" \ -o \( x"$with_tls" = x"yes" -a x"$tls_support" = x"no" \)], [ case "$host_os" in morphos*) ssl="ssl_shared" @@ -1888,10 +1883,25 @@ AC_SUBST(OF_OPENSSL_TLS_STREAM_M, "OFOpenSSLTLSStream.m") ]) ], [], [-l$crypto]) ]) + + AS_IF([test x"$with_tls" = x"gnutls" \ + -o \( x"$with_tls" = x"yes" -a x"$tls_support" = x"no" \)], [ + PKG_CHECK_MODULES(gnutls, [gnutls >= 3.5.0], [ + tls_support="GnuTLS" + TLS_CPPFLAGS="$gnutls_CFLAGS $TLS_CPPFLAGS" + TLS_LIBS="$gnutls_LIBS $TLS_LIBS" + + AC_SUBST(OF_GNUTLS_TLS_STREAM_M, "OFGnuTLSTLSStream.m") + ], [ + dnl Disable default action-if-not-found, which exits + dnl configure with an error. + : + ]) + ]) AS_IF([test x"$tls_support" != x"no"], [ AC_SUBST(TLS, "tls") AC_SUBST(TLS_CPPFLAGS) AC_SUBST(TLS_LIBS) @@ -2055,12 +2065,20 @@ AC_MSG_RESULT(no) OBJCFLAGS="$old_OBJCFLAGS" ]) AS_IF([test x"$GOBJC" = x"yes"], [ - OBJCFLAGS="$OBJCFLAGS -Wwrite-strings -Wpointer-arith -Werror" + OBJCFLAGS="$OBJCFLAGS -Wwrite-strings -Wpointer-arith" + + AC_ARG_ENABLE(werror, + AS_HELP_STRING([--disable-werror], [do not build with -Werror])) + AS_IF([test x"$enable_werror" != x"no"], [ + OBJCFLAGS="$OBJCFLAGS -Werror" + ]) + old_OBJCFLAGS="$OBJCFLAGS" + OBJCFLAGS="$OBJCFLAGS -Werror" AC_MSG_CHECKING(whether we need -Wno-strict-aliasing due to GCC bugs) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #ifdef __has_attribute # if __has_attribute(objc_root_class) @@ -2080,15 +2098,18 @@ Foo *test = (Foo *)&object; (void)test; /* Get rid of unused variable warning */ ]) ], [ AC_MSG_RESULT(no) + OBJCFLAGS="$old_OBJCFLAGS" ], [ AC_MSG_RESULT(yes) - OBJCFLAGS="$OBJCFLAGS -Wno-strict-aliasing" + OBJCFLAGS="$old_OBJCFLAGS -Wno-strict-aliasing" ]) + old_OBJCFLAGS="$OBJCFLAGS" + OBJCFLAGS="$OBJCFLAGS -Werror" AC_MSG_CHECKING( whether we need -Wno-unused-property-ivar due to Clang bugs) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([ #ifdef __has_attribute @@ -2116,17 +2137,18 @@ } @end ]) ], [ AC_MSG_RESULT(no) + OBJCFLAGS="$old_OBJCFLAGS" ], [ AC_MSG_RESULT(yes) - OBJCFLAGS="$OBJCFLAGS -Wno-unused-property-ivar" + OBJCFLAGS="$old_OBJCFLAGS -Wno-unused-property-ivar" ]) old_OBJCFLAGS="$OBJCFLAGS" - OBJCFLAGS="$OBJCFLAGS -Wcast-align" + OBJCFLAGS="$OBJCFLAGS -Wcast-align -Werror" AC_MSG_CHECKING(whether -Wcast-align is buggy) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([ #ifdef __has_attribute # if __has_attribute(objc_root_class) @@ -2147,17 +2169,18 @@ } @end ]) ], [ AC_MSG_RESULT(no) + OBJCFLAGS="$old_OBJCFLAGS -Wcast-align" ], [ AC_MSG_RESULT(yes) OBJCFLAGS="$old_OBJCFLAGS" ]) old_OBJCFLAGS="$OBJCFLAGS" - OBJCFLAGS="$OBJCFLAGS -Wunreachable-code" + OBJCFLAGS="$OBJCFLAGS -Wunreachable-code -Werror" AC_MSG_CHECKING(whether -Wunreachable-code can be used) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ #include @@ -2223,17 +2246,18 @@ } @end ]]) ], [ AC_MSG_RESULT(yes) + OBJCFLAGS="$old_OBJCFLAGS -Wunreachable-code" ], [ AC_MSG_RESULT(no) OBJCFLAGS="$old_OBJCFLAGS" ]) old_OBJCFLAGS="$OBJCFLAGS" - OBJCFLAGS="$OBJCFLAGS -Wdocumentation" + OBJCFLAGS="$OBJCFLAGS -Wdocumentation -Werror" AC_MSG_CHECKING(whether -Wdocumentation works correctly) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([ /** * @class Test conftest.m conftest.m @@ -2251,18 +2275,19 @@ */ typedef struct {} Foo; ]) ], [ AC_MSG_RESULT(yes) + OBJCFLAGS="$old_OBJCFLAGS -Wdocumentation" ], [ AC_MSG_RESULT(no) OBJCFLAGS="$old_OBJCFLAGS" ]) AS_IF([test x"$check_pedantic" = x"yes"], [ old_OBJCFLAGS="$OBJCFLAGS" - OBJCFLAGS="$OBJCFLAGS -pedantic" + OBJCFLAGS="$OBJCFLAGS -pedantic -Werror" AC_MSG_CHECKING(whether -pedantic is buggy) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([ #include @@ -2294,31 +2319,37 @@ } @end ]) ], [ AC_MSG_RESULT(no) + OBJCFLAGS="$old_OBJCFLAGS -pedantic" ], [ AC_MSG_RESULT(yes) OBJCFLAGS="$old_OBJCFLAGS" ]) ]) + old_OBJCFLAGS="$OBJCFLAGS" + OBJCFLAGS="$OBJCFLAGS -Werror" AC_MSG_CHECKING(whether we need -Wno-strict-prototypes) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #include ], [ signal(SIGINT, SIG_DFL); ]) ], [ AC_MSG_RESULT(no) + OBJCFLAGS="$old_OBJCFLAGS" ], [ AC_MSG_RESULT(yes) - OBJCFLAGS="$OBJCFLAGS -Wno-strict-prototypes" + OBJCFLAGS="$old_OBJCFLAGS -Wno-strict-prototypes" ]) AS_IF([test x"$ac_cv_header_complex_h" = x"yes"], [ + old_OBJCFLAGS="$OBJCFLAGS" + OBJCFLAGS="$OBJCFLAGS -Werror" AC_MSG_CHECKING(whether we need -Wno-gnu-imaginary-constant) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #include ], [ @@ -2325,13 +2356,14 @@ complex float f = 0.5 + 0.5 * I; (void)f; ]) ], [ AC_MSG_RESULT(no) + OBJCFLAGS="$old_OBJCFLAGS" ], [ AC_MSG_RESULT(yes) - OBJCFLAGS="$OBJCFLAGS -Wno-gnu-imaginary-constant" + OBJCFLAGS="$old_OBJCFLAGS -Wno-gnu-imaginary-constant" ]) ]) ]) AS_IF([test x"$cross_compiling" = x"yes"], [ Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -1,18 +1,18 @@ OBJFW_SHARED_LIB = @OBJFW_SHARED_LIB@ OBJFW_STATIC_LIB = @OBJFW_STATIC_LIB@ OBJFW_FRAMEWORK = @OBJFW_FRAMEWORK@ OBJFW_AMIGA_LIB = @OBJFW_AMIGA_LIB@ -OBJFW_LIB_MAJOR = 0 +OBJFW_LIB_MAJOR = 1 OBJFW_LIB_MINOR = 0 OBJFW_LIB_MAJOR_MINOR = ${OBJFW_LIB_MAJOR}.${OBJFW_LIB_MINOR} OBJFWRT_SHARED_LIB = @OBJFWRT_SHARED_LIB@ OBJFWRT_STATIC_LIB = @OBJFWRT_STATIC_LIB@ OBJFWRT_FRAMEWORK = @OBJFWRT_FRAMEWORK@ OBJFWRT_AMIGA_LIB = @OBJFWRT_AMIGA_LIB@ -OBJFWRT_LIB_MAJOR = 0 +OBJFWRT_LIB_MAJOR = 1 OBJFWRT_LIB_MINOR = 0 OBJFWRT_LIB_MAJOR_MINOR = ${OBJFWRT_LIB_MAJOR}.${OBJFWRT_LIB_MINOR} OBJFWBRIDGE_SHARED_LIB = @OBJFWBRIDGE_SHARED_LIB@ OBJFWBRIDGE_STATIC_LIB = @OBJFWBRIDGE_STATIC_LIB@ Index: generators/unicode/TableGenerator.h ================================================================== --- generators/unicode/TableGenerator.h +++ generators/unicode/TableGenerator.h @@ -24,32 +24,25 @@ OFHTTPClient *_HTTPClient; OFUnichar _uppercaseTable[0x110000]; OFUnichar _lowercaseTable[0x110000]; OFUnichar _titlecaseTable[0x110000]; OFUnichar _caseFoldingTable[0x110000]; - OFString *_decompositionTable[0x110000]; - OFString *_decompositionCompatTable[0x110000]; char _uppercaseTableUsed[0x1100]; char _lowercaseTableUsed[0x1100]; char _titlecaseTableUsed[0x1100]; char _caseFoldingTableUsed[0x1100]; - char _decompositionTableUsed[0x1100]; - char _decompositionCompatTableUsed[0x1100]; size_t _uppercaseTableSize; size_t _lowercaseTableSize; size_t _titlecaseTableSize; size_t _caseFoldingTableSize; - size_t _decompositionTableSize; - size_t _decompositionCompatTableSize; enum { stateUnicodeData, stateCaseFolding } _state; } - (void)parseUnicodeData: (OFHTTPResponse *)response; - (void)parseCaseFolding: (OFHTTPResponse *)response; -- (void)applyDecompositionRecursivelyForTable: (OFString *[0x110000])table; - (void)writeFiles; - (void)writeTablesToFile: (OFString *)path; - (void)writeHeaderToFile: (OFString *)path; @end Index: generators/unicode/TableGenerator.m ================================================================== --- generators/unicode/TableGenerator.m +++ generators/unicode/TableGenerator.m @@ -50,12 +50,10 @@ _uppercaseTableSize = SIZE_MAX; _lowercaseTableSize = SIZE_MAX; _titlecaseTableSize = SIZE_MAX; _caseFoldingTableSize = SIZE_MAX; - _decompositionTableSize = SIZE_MAX; - _decompositionCompatTableSize = SIZE_MAX; } @catch (id e) { [self release]; @throw e; } @@ -127,45 +125,13 @@ _lowercaseTable[codePoint] = (OFUnichar)[[components objectAtIndex: 13] unsignedLongLongValueWithBase: 16]; _titlecaseTable[codePoint] = (OFUnichar)[[components objectAtIndex: 14] unsignedLongLongValueWithBase: 16]; - if ([[components objectAtIndex: 5] length] > 0) { - OFArray *decomposed = [[components objectAtIndex: 5] - componentsSeparatedByString: @" "]; - bool compat = false; - OFMutableString *string; - - if ([decomposed.firstObject hasPrefix: @"<"]) { - decomposed = [decomposed objectsInRange: - OFMakeRange(1, decomposed.count - 1)]; - compat = true; - } - - string = [OFMutableString string]; - - for (OFString *character in decomposed) { - OFUnichar unichar = (OFUnichar)[character - unsignedLongLongValueWithBase: 16]; - - [string appendCharacters: &unichar - length: 1]; - } - - [string makeImmutable]; - - if (!compat) - _decompositionTable[codePoint] = [string copy]; - _decompositionCompatTable[codePoint] = [string copy]; - } - objc_autoreleasePoolPop(pool2); } - [self applyDecompositionRecursivelyForTable: _decompositionTable]; - [self applyDecompositionRecursivelyForTable: _decompositionCompatTable]; - [OFStdOut writeLine: @" done"]; [OFStdOut writeString: @"Downloading CaseFolding.txt…"]; _state = stateCaseFolding; request = [OFHTTPRequest requestWithIRI: @@ -214,62 +180,10 @@ [OFStdOut writeLine: @" done"]; [self writeFiles]; } -- (void)applyDecompositionRecursivelyForTable: (OFString *[0x110000])table -{ - bool done; - - do { - done = true; - - for (OFUnichar i = 0; i < 0x110000; i++) { - void *pool; - const OFUnichar *characters; - size_t length; - OFMutableString *replacement; - bool changed = false; - - if (table[i] == nil) - continue; - - pool = objc_autoreleasePoolPush(); - characters = table[i].characters; - length = table[i].length; - replacement = [OFMutableString string]; - - for (size_t j = 0; j < length; j++) { - if (characters[j] > 0x10FFFF) - @throw [OFOutOfRangeException - exception]; - - if (table[characters[j]] == nil) - [replacement - appendCharacters: &characters[j] - length: 1]; - else { - [replacement - appendString: table[characters[j]]]; - changed = true; - } - } - - [replacement makeImmutable]; - - if (changed) { - [table[i] release]; - table[i] = [replacement copy]; - - done = false; - } - - objc_autoreleasePoolPop(pool); - } - } while (!done); -} - - (void)writeFiles { OFIRI *IRI; [OFStdOut writeString: @"Writing files…"]; @@ -294,11 +208,10 @@ [file writeString: COPYRIGHT @"#include \"config.h\"\n" @"\n" @"#import \"OFString.h\"\n\n" @"static const OFUnichar emptyPage[0x100] = { 0 };\n" - @"static const char *emptyDecompositionPage[0x100] = { NULL };\n" @"\n"]; /* Write uppercasePage%u */ for (OFUnichar i = 0; i < 0x110000; i += 0x100) { bool isEmpty = true; @@ -455,139 +368,18 @@ objc_autoreleasePoolPop(pool2); } } - /* Write decompositionPage%u */ - for (OFUnichar i = 0; i < 0x110000; i += 0x100) { - bool isEmpty = true; - - for (OFUnichar j = i; j < i + 0x100; j++) { - if (_decompositionTable[j] != nil) { - isEmpty = false; - _decompositionTableSize = i >> 8; - _decompositionTableUsed[ - _decompositionTableSize] = 1; - break; - } - } - - if (!isEmpty) { - void *pool2 = objc_autoreleasePoolPush(); - - [file writeFormat: @"static const char *const " - @"decompositionPage%u[0x100] = {\n", - i >> 8]; - - for (OFUnichar j = i; j < i + 0x100; j++) { - if ((j - i) % 2 == 0) - [file writeString: @"\t"]; - else - [file writeString: @" "]; - - if (_decompositionTable[j] != nil) { - const char *UTF8String = - _decompositionTable[j].UTF8String; - size_t length = _decompositionTable[j] - .UTF8StringLength; - - [file writeString: @"\""]; - - for (size_t k = 0; k < length; k++) - [file writeFormat: - @"\\x%02X", - (uint8_t)UTF8String[k]]; - - [file writeString: @"\","]; - } else - [file writeString: @"NULL,"]; - - if ((j - i) % 2 == 1) - [file writeString: @"\n"]; - } - - [file writeString: @"};\n\n"]; - - objc_autoreleasePoolPop(pool2); - } - } - - /* Write decompCompatPage%u if it does NOT match decompositionPage%u */ - for (OFUnichar i = 0; i < 0x110000; i += 0x100) { - bool isEmpty = true; - - for (OFUnichar j = i; j < i + 0x100; j++) { - if (_decompositionCompatTable[j] != 0) { - /* - * We bulk-compare pointers via memcmp here. - * This is safe, as we always set the same - * pointer in both tables if both are the same. - */ - isEmpty = !memcmp(_decompositionTable + i, - _decompositionCompatTable + i, - 256 * sizeof(const char *)); - _decompositionCompatTableSize = i >> 8; - _decompositionCompatTableUsed[ - _decompositionCompatTableSize] = - (isEmpty ? 2 : 1); - - break; - } - } - - if (!isEmpty) { - void *pool2 = objc_autoreleasePoolPush(); - - [file writeFormat: @"static const char *const " - @"decompCompatPage%u[0x100] = {\n", - i >> 8]; - - for (OFUnichar j = i; j < i + 0x100; j++) { - if ((j - i) % 2 == 0) - [file writeString: @"\t"]; - else - [file writeString: @" "]; - - if (_decompositionCompatTable[j] != nil) { - const char *UTF8String = - _decompositionCompatTable[j] - .UTF8String; - size_t length = - _decompositionCompatTable[j] - .UTF8StringLength; - - [file writeString: @"\""]; - - for (size_t k = 0; k < length; k++) - [file writeFormat: - @"\\x%02X", - (uint8_t)UTF8String[k]]; - - [file writeString: @"\","]; - } else - [file writeString: @"NULL,"]; - - if ((j - i) % 2 == 1) - [file writeString: @"\n"]; - } - - [file writeString: @"};\n\n"]; - - objc_autoreleasePoolPop(pool2); - } - } - /* * Those are currently set to the last index. * But from now on, we need the size. */ _uppercaseTableSize++; _lowercaseTableSize++; _titlecaseTableSize++; _caseFoldingTableSize++; - _decompositionTableSize++; - _decompositionCompatTableSize++; /* Write OFUnicodeUppercaseTable */ [file writeFormat: @"const OFUnichar *const " @"OFUnicodeUppercaseTable[0x%X] = {\n\t", _uppercaseTableSize]; @@ -673,55 +465,10 @@ } } [file writeString: @"\n};\n\n"]; - /* Write OFUnicodeDecompositionTable */ - [file writeFormat: @"const char *const " - @"*OFUnicodeDecompositionTable[0x%X] = {\n\t", - _decompositionTableSize]; - - for (OFUnichar i = 0; i < _decompositionTableSize; i++) { - if (_decompositionTableUsed[i]) - [file writeFormat: @"decompositionPage%u", i]; - else - [file writeString: @"emptyDecompositionPage"]; - - if (i + 1 < _decompositionTableSize) { - if ((i + 1) % 3 == 0) - [file writeString: @",\n\t"]; - else - [file writeString: @", "]; - } - } - - [file writeString: @"\n};\n\n"]; - - /* Write OFUnicodeDecompositionCompatTable */ - [file writeFormat: @"const char *const " - @"*OFUnicodeDecompositionCompatTable[0x%X] = {" - @"\n\t", - _decompositionCompatTableSize]; - - for (OFUnichar i = 0; i < _decompositionCompatTableSize; i++) { - if (_decompositionCompatTableUsed[i] == 1) - [file writeFormat: @"decompCompatPage%u", i]; - else if (_decompositionCompatTableUsed[i] == 2) - [file writeFormat: @"decompositionPage%u", i]; - else - [file writeString: @"emptyDecompositionPage"]; - - if (i + 1 < _decompositionCompatTableSize) { - if ((i + 1) % 3 == 0) - [file writeString: @",\n\t"]; - else - [file writeString: @", "]; - } - } - - [file writeString: @"\n};\n"]; - objc_autoreleasePoolPop(pool); } - (void)writeHeaderToFile: (OFString *)path { @@ -734,16 +481,13 @@ [file writeFormat: @"#define OFUnicodeUppercaseTableSize 0x%X\n" @"#define OFUnicodeLowercaseTableSize 0x%X\n" @"#define OFUnicodeTitlecaseTableSize 0x%X\n" - @"#define OFUnicodeCaseFoldingTableSize 0x%X\n" - @"#define OFUnicodeDecompositionTableSize 0x%X\n" - @"#define OFUnicodeDecompositionCompatTableSize 0x%X\n\n", + @"#define OFUnicodeCaseFoldingTableSize 0x%X\n\n", _uppercaseTableSize, _lowercaseTableSize, _titlecaseTableSize, - _caseFoldingTableSize, _decompositionTableSize, - _decompositionCompatTableSize]; + _caseFoldingTableSize]; [file writeString: @"#ifdef __cplusplus\n" @"extern \"C\" {\n" @"#endif\n" @@ -753,18 +497,12 @@ @" OFUnicodeLowercaseTable[OFUnicodeLowercaseTableSize];\n" @"extern const OFUnichar *const _Nonnull\n" @" OFUnicodeTitlecaseTable[OFUnicodeTitlecaseTableSize];\n" @"extern const OFUnichar *const _Nonnull\n" @" OFUnicodeCaseFoldingTable[OFUnicodeCaseFoldingTableSize];\n" - @"extern const char *const _Nullable *const _Nonnull\n" - @" OFUnicodeDecompositionTable[" - @"OFUnicodeDecompositionTableSize];\n" - @"extern const char *const _Nullable *const _Nonnull\n" - @" OFUnicodeDecompositionCompatTable[" - @"OFUnicodeDecompositionCompatTableSize];\n" @"#ifdef __cplusplus\n" @"}\n" @"#endif\n"]; objc_autoreleasePoolPop(pool); } @end DELETED objfw.spec Index: objfw.spec ================================================================== --- objfw.spec +++ objfw.spec @@ -1,244 +0,0 @@ -%global libobjfw_major 0 -%global libobjfw_minor 0 -%global libobjfwrt_major 0 -%global libobjfwrt_minor 0 -%global libobjfwtls_major 0 -%global libobjfwtls_minor 0 -%if 0%{?suse_version} -%global libobjfw_pkgname libobjfw%{libobjfw_major} -%global libobjfwrt_pkgname libobjfwrt%{libobjfwrt_major} -%global libobjfwtls_pkgname libobjfwtls%{libobjfwtls_major} -%else -%global libobjfw_pkgname libobjfw -%global libobjfwrt_pkgname libobjfwrt -%global libobjfwtls_pkgname libobjfwtls -%endif - -Name: objfw -Version: 1.1dev -Release: 1%{?dist} -Summary: Portable, lightweight framework for the Objective-C language - -%if 0%{?suse_version} -License: QPL-1.0 or GPL-3.0 or GPL-2.0 -Group: Development/Languages/C and C++ -%else -License: QPL or GPLv3 or GPLv2 -%endif -URL: https://objfw.nil.im -Source0: objfw-%{version}.tar.gz - -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: clang -BuildRequires: make -BuildRequires: pkgconfig(gnutls) -Requires: %{libobjfw_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfw_pkgname}-devel = %{version}-%{release} -Requires: %{libobjfwrt_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfwrt_pkgname}-devel = %{version}-%{release} -Requires: ofarc%{_isa} = %{version}-%{release} -Requires: ofdns%{_isa} = %{version}-%{release} -Requires: ofhash%{_isa} = %{version}-%{release} -Requires: ofhttp%{_isa} = %{version}-%{release} - -%description -ObjFW is a portable, lightweight framework for the Objective-C language. It -enables you to write an application in Objective-C that will run on any -platform supported by ObjFW without having to worry about differences between -operating systems or various frameworks you would otherwise need if you want to -be portable. - -It supports all modern Objective-C features when using Clang, but is also -compatible with GCC ≥ 4.6 to allow maximum portability. - -ObjFW also comes with its own lightweight and extremely fast Objective-C -runtime, which in real world use cases was found to be significantly faster -than both GNU's and Apple's runtime. - -%package -n %{libobjfw_pkgname} -Summary: ObjFW library -Requires: %{libobjfwrt_pkgname}%{_isa} = %{version}-%{release} - -%description -n %{libobjfw_pkgname} -The %{libobjfw_pkgname} package contains the library needed by programs using -ObjFW. - -%package -n %{libobjfw_pkgname}-devel -Summary: Header files, libraries and tools for %{libobjfw_pkgname} -Requires: %{libobjfw_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfwrt_pkgname}-devel = %{version}-%{release} - -%description -n %{libobjfw_pkgname}-devel -The %{libobjfw_pkgname}-devel package contains the header files, libraries and -tools to develop programs using ObjFW. - -%package -n %{libobjfwrt_pkgname} -Summary: ObjFW Objective-C runtime library - -%description -n %{libobjfwrt_pkgname} -The %{libobjfwrt_pkgname} package contains ObjFW's Objective-C runtime library. - -%package -n %{libobjfwrt_pkgname}-devel -Summary: Header files and libraries for %{libobjfwrt_pkgname} -Requires: %{libobjfwrt_pkgname}%{_isa} = %{version}-%{release} - -%description -n %{libobjfwrt_pkgname}-devel -The %{libobjfwrt_pkgname}-devel package contains header files and libraries for -ObjFW's Objective-C runtime library. - -%package -n %{libobjfwtls_pkgname} -Summary: TLS support for ObjFW -Requires: gnutls%{_isa} >= 3.0.5 - -%description -n %{libobjfwtls_pkgname} -The %{libobjfwtls_pkgname} package contains TLS support for ObjFW - -%package -n %{libobjfwtls_pkgname}-devel -Summary: Header files and libraries for %{libobjfwtls_pkgname} -Requires: %{libobjfwtls_pkgname}%{_isa} = %{version}-%{release} - -%description -n %{libobjfwtls_pkgname}-devel -The %{libobjfwtls_pkgname}-devel package contains header files and libraries -for TLS support for ObjFW. - -%package -n ofarc -Summary: Utility for handling ZIP, Tar and LHA archives -Requires: %{libobjfw_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfwrt_pkgname}%{_isa} = %{version}-%{release} - -%description -n ofarc -ofarc is a multi-format archive utility that allows creating, listing, -extracting and modifying ZIP, Tar and LHA archives using ObjFW's classes for -various archive types. - -%package -n ofdns -Summary: Utility for performing DNS requests on the command line -Requires: %{libobjfw_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfwrt_pkgname}%{_isa} = %{version}-%{release} - -%description -n ofdns -ofdns is an utility for performing DNS requests on the command line using -ObjFW's DNS resolver. - -%package -n ofhash -Summary: Utility to hash files with various cryptographic hash functions -Requires: %{libobjfw_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfwrt_pkgname}%{_isa} = %{version}-%{release} - -%description -n ofhash -ofhash is an utility to hash files with various cryptographic hash functions -(even using different algorithms at once) using ObjFW's classes for various -cryptographic hashes. - -%package -n ofhttp -Summary: Command line downloader for HTTP(S) -Requires: %{libobjfw_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfwrt_pkgname}%{_isa} = %{version}-%{release} -Requires: %{libobjfwtls_pkgname}%{_isa} = %{version}-%{release} - -%description -n ofhttp -ofhttp is a command line downloader for HTTP and HTTPS using ObjFW's -OFHTTPClient class. It supports all features one would expect from a modern -command line downloader such as resuming of downloads, using a SOCKS5 proxy, a -modern terminal-based UI, etc. - -%prep -%autosetup -./autogen.sh - -%build -%configure OBJC=clang --disable-rpath -%make_build - -%install -%make_install - -%check -make -C tests run - -%if 0%{?suse_version} -%post -n %{libobjfw_pkgname} -p /sbin/ldconfig -%postun -n %{libobjfw_pkgname} -p /sbin/ldconfig -%post -n %{libobjfwrt_pkgname} -p /sbin/ldconfig -%postun -n %{libobjfwrt_pkgname} -p /sbin/ldconfig -%endif - -%files -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL - -%files -n %{libobjfw_pkgname} -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_libdir}/libobjfw.so.%{libobjfw_major} -%{_libdir}/libobjfw.so.%{libobjfw_major}.%{libobjfw_minor}.0 - -%files -n %{libobjfw_pkgname}-devel -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_bindir}/objfw-compile -%{_bindir}/objfw-config -%{_bindir}/objfw-embed -%{_bindir}/objfw-new -%{_includedir}/ObjFW -%{_libdir}/libobjfw.so - -%files -n %{libobjfwrt_pkgname} -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_libdir}/libobjfwrt.so.%{libobjfwrt_major} -%{_libdir}/libobjfwrt.so.%{libobjfwrt_major}.%{libobjfwrt_minor}.0 - -%files -n %{libobjfwrt_pkgname}-devel -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_includedir}/ObjFWRT -%{_libdir}/libobjfwrt.so - -%files -n %{libobjfwtls_pkgname} -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_libdir}/libobjfwtls.so.%{libobjfwtls_major} -%{_libdir}/libobjfwtls.so.%{libobjfwtls_major}.%{libobjfwtls_minor}.0 - -%files -n %{libobjfwtls_pkgname}-devel -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_includedir}/ObjFWTLS -%{_libdir}/libobjfwtls.so - -%files -n ofarc -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_bindir}/ofarc -%{_datadir}/ofarc - -%files -n ofdns -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_bindir}/ofdns -%{_datadir}/ofdns - -%files -n ofhash -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_bindir}/ofhash -%{_datadir}/ofhash - -%files -n ofhttp -%license LICENSE.GPLv2 -%license LICENSE.GPLv3 -%license LICENSE.QPL -%{_bindir}/ofhttp -%{_datadir}/ofhttp Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -181,40 +181,44 @@ objfw-defs.h \ platform.h \ ${USE_INCLUDES_ATOMIC} SRCS += OFASPrintF.m \ - OFAdjacentArray.m \ - OFAdjacentSubarray.m \ OFArchiveIRIHandler.m \ OFBase64.m \ OFBitSetCharacterSet.m \ - OFBytesValue.m \ OFCRC16.m \ OFCRC32.m \ - OFCountedMapTableSet.m \ + OFConcreteArray.m \ + OFConcreteColor.m \ + OFConcreteCountedSet.m \ + OFConcreteData.m \ + OFConcreteDate.m \ + OFConcreteDictionary.m \ + OFConcreteMutableArray.m \ + OFConcreteMutableData.m \ + OFConcreteMutableDictionary.m \ + OFConcreteMutableSet.m \ + OFConcreteNumber.m \ + OFConcreteSet.m \ + OFConcreteSubarray.m \ + OFConcreteValue.m \ OFEmbeddedIRIHandler.m \ OFHuffmanTree.m \ OFINIFileSettings.m \ OFInvertedCharacterSet.m \ OFLHADecompressingStream.m \ - OFMapTableDictionary.m \ - OFMapTableSet.m \ - OFMutableAdjacentArray.m \ - OFMutableMapTableDictionary.m \ - OFMutableMapTableSet.m \ OFMutableUTF8String.m \ - OFNonretainedObjectValue.m \ - OFPointValue.m \ - OFPointerValue.m \ OFRangeCharacterSet.m \ - OFRangeValue.m \ - OFRectValue.m \ OFSandbox.m \ - OFSizeValue.m \ + OFStrFTime.m \ OFStrPTime.m \ OFSubarray.m \ + OFSubdata.m \ + OFTaggedPointerColor.m \ + OFTaggedPointerDate.m \ + OFTaggedPointerNumber.m \ OFUTF8String.m \ ${LIBBASES_M} \ ${RUNTIME_AUTORELEASE_M} \ ${RUNTIME_INSTANCE_M} \ ${UNICODE_M} Index: src/OFASPrintF.m ================================================================== --- src/OFASPrintF.m +++ src/OFASPrintF.m @@ -34,10 +34,11 @@ #ifdef OF_HAVE_SYS_TYPES_H # include #endif +#import "OFASPrintF.h" #import "OFString.h" #import "OFLocale.h" #import "OFInitializationFailedException.h" DELETED src/OFAdjacentArray.h Index: src/OFAdjacentArray.h ================================================================== --- src/OFAdjacentArray.h +++ src/OFAdjacentArray.h @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFArray.h" - -OF_ASSUME_NONNULL_BEGIN - -@class OFMutableData; - -@interface OFAdjacentArray: OFArray -{ - OFMutableData *_array; -} -@end - -OF_ASSUME_NONNULL_END DELETED src/OFAdjacentArray.m Index: src/OFAdjacentArray.m ================================================================== --- src/OFAdjacentArray.m +++ src/OFAdjacentArray.m @@ -1,334 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 - -#import "OFAdjacentArray.h" -#import "OFAdjacentSubarray.h" -#import "OFData.h" -#import "OFMutableAdjacentArray.h" -#import "OFString.h" - -#import "OFEnumerationMutationException.h" -#import "OFInvalidArgumentException.h" -#import "OFOutOfRangeException.h" - -@implementation OFAdjacentArray -- (instancetype)init -{ - self = [super init]; - - @try { - _array = [[OFMutableData alloc] initWithItemSize: sizeof(id)]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithObject: (id)object -{ - self = [self init]; - - @try { - if (object == nil) - @throw [OFInvalidArgumentException exception]; - - [_array addItem: &object]; - [object retain]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments -{ - self = [self init]; - - @try { - id object; - - [_array addItem: &firstObject]; - [firstObject retain]; - - while ((object = va_arg(arguments, id)) != nil) { - [_array addItem: &object]; - [object retain]; - } - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithArray: (OFArray *)array -{ - id const *objects; - size_t count; - - self = [super init]; - - if (array == nil) - return self; - - @try { - objects = array.objects; - count = array.count; - - _array = [[OFMutableData alloc] initWithItemSize: sizeof(id) - capacity: count]; - } @catch (id e) { - [self release]; - @throw e; - } - - @try { - for (size_t i = 0; i < count; i++) - [objects[i] retain]; - - [_array addItems: objects count: count]; - } @catch (id e) { - for (size_t i = 0; i < count; i++) - [objects[i] release]; - - /* Prevent double-release of objects */ - [_array release]; - _array = nil; - - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithObjects: (id const *)objects count: (size_t)count -{ - self = [self init]; - - @try { - bool ok = true; - - for (size_t i = 0; i < count; i++) { - if (objects[i] == nil) - ok = false; - - [objects[i] retain]; - } - - if (!ok) - @throw [OFInvalidArgumentException exception]; - - [_array addItems: objects count: count]; - } @catch (id e) { - for (size_t i = 0; i < count; i++) - [objects[i] release]; - - [self release]; - @throw e; - } - - return self; -} - -- (size_t)count -{ - return _array.count; -} - -- (id const *)objects -{ - return _array.items; -} - -- (id)objectAtIndex: (size_t)idx -{ - return *((id *)[_array itemAtIndex: idx]); -} - -- (id)objectAtIndexedSubscript: (size_t)idx -{ - return *((id *)[_array itemAtIndex: idx]); -} - -- (void)getObjects: (id *)buffer inRange: (OFRange)range -{ - id const *objects = _array.items; - size_t count = _array.count; - - if (range.length > SIZE_MAX - range.location || - range.location + range.length > count) - @throw [OFOutOfRangeException exception]; - - for (size_t i = 0; i < range.length; i++) - buffer[i] = objects[range.location + i]; -} - -- (size_t)indexOfObject: (id)object -{ - id const *objects; - size_t count; - - if (object == nil) - return OFNotFound; - - objects = _array.items; - count = _array.count; - - for (size_t i = 0; i < count; i++) - if ([objects[i] isEqual: object]) - return i; - - return OFNotFound; -} - -- (size_t)indexOfObjectIdenticalTo: (id)object -{ - id const *objects; - size_t count; - - if (object == nil) - return OFNotFound; - - objects = _array.items; - count = _array.count; - - for (size_t i = 0; i < count; i++) - if (objects[i] == object) - return i; - - return OFNotFound; -} - - -- (OFArray *)objectsInRange: (OFRange)range -{ - if (range.length > SIZE_MAX - range.location || - range.location + range.length > _array.count) - @throw [OFOutOfRangeException exception]; - - if ([self isKindOfClass: [OFMutableArray class]]) - return [OFArray - arrayWithObjects: (id *)_array.items + range.location - count: range.length]; - - return [OFAdjacentSubarray arrayWithArray: self range: range]; -} - -- (bool)isEqual: (id)object -{ - OFArray *otherArray; - id const *objects, *otherObjects; - size_t count; - - if (object == self) - return true; - - if (![object isKindOfClass: [OFAdjacentArray class]] && - ![object isKindOfClass: [OFMutableAdjacentArray class]]) - return [super isEqual: object]; - - otherArray = object; - - count = _array.count; - - if (count != otherArray.count) - return false; - - objects = _array.items; - otherObjects = otherArray.objects; - - for (size_t i = 0; i < count; i++) - if (![objects[i] isEqual: otherObjects[i]]) - return false; - - return true; -} - -- (unsigned long)hash -{ - id const *objects = _array.items; - size_t count = _array.count; - unsigned long hash; - - OFHashInit(&hash); - - for (size_t i = 0; i < count; i++) - OFHashAddHash(&hash, [objects[i] hash]); - - OFHashFinalize(&hash); - - return hash; -} - -- (int)countByEnumeratingWithState: (OFFastEnumerationState *)state - objects: (id *)objects - count: (int)count_ -{ - size_t count = _array.count; - - if (count > INT_MAX) - /* - * Use the implementation from OFArray, which is slower, but can - * enumerate in chunks. - */ - return [super countByEnumeratingWithState: state - objects: objects - count: count_]; - - if (state->state >= count) - return 0; - - state->state = (unsigned long)count; - state->itemsPtr = (id *)_array.items; - state->mutationsPtr = (unsigned long *)self; - - return (int)count; -} - -#ifdef OF_HAVE_BLOCKS -- (void)enumerateObjectsUsingBlock: (OFArrayEnumerationBlock)block -{ - id const *objects = _array.items; - size_t count = _array.count; - bool stop = false; - - for (size_t i = 0; i < count && !stop; i++) - block(objects[i], i, &stop); -} -#endif - -- (void)dealloc -{ - id const *objects = _array.items; - size_t count = _array.count; - - for (size_t i = 0; i < count; i++) - [objects[i] release]; - - [_array release]; - - [super dealloc]; -} -@end DELETED src/OFAdjacentSubarray.h Index: src/OFAdjacentSubarray.h ================================================================== --- src/OFAdjacentSubarray.h +++ src/OFAdjacentSubarray.h @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFSubarray.h" - -OF_ASSUME_NONNULL_BEGIN - -@interface OFAdjacentSubarray: OFSubarray -@end - -OF_ASSUME_NONNULL_END DELETED src/OFAdjacentSubarray.m Index: src/OFAdjacentSubarray.m ================================================================== --- src/OFAdjacentSubarray.m +++ src/OFAdjacentSubarray.m @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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" - -#import "OFAdjacentSubarray.h" -#import "OFAdjacentArray.h" -#import "OFMutableAdjacentArray.h" - -@implementation OFAdjacentSubarray -- (const id *)objects -{ - return _array.objects + _range.location; -} - -- (bool)isEqual: (id)object -{ - OFArray *otherArray; - id const *objects, *otherObjects; - - if (object == self) - return true; - - if (![object isKindOfClass: [OFAdjacentArray class]] && - ![object isKindOfClass: [OFMutableAdjacentArray class]]) - return [super isEqual: object]; - - otherArray = object; - - if (_range.length != otherArray.count) - return false; - - objects = self.objects; - otherObjects = otherArray.objects; - - for (size_t i = 0; i < _range.length; i++) - if (![objects[i] isEqual: otherObjects[i]]) - return false; - - return true; -} - -#ifdef OF_HAVE_BLOCKS -- (void)enumerateObjectsUsingBlock: (OFArrayEnumerationBlock)block -{ - id const *objects = self.objects; - bool stop = false; - - for (size_t i = 0; i < _range.length && !stop; i++) - block(objects[i], i, &stop); -} -#endif -@end Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -115,22 +115,21 @@ } int OFApplicationMain(int *argc, char **argv[], id delegate) { -#ifdef OF_WINDOWS - wchar_t **wargv, **wenvp; - int wargc, si = 0; -#endif - [[OFLocale alloc] init]; app = [[OFApplication alloc] of_init]; #ifdef OF_WINDOWS if ([OFSystemInfo isWindowsNT]) { + wchar_t **wargv, **wenvp; + int wargc, si = 0; + __wgetmainargs(&wargc, &wargv, &wenvp, _CRT_glob, &si); + [app of_setArgumentCount: argc andArgumentValues: argv andWideArgumentCount: wargc andWideArgumentValues: wargv]; } else Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -182,10 +182,17 @@ * @return A new autoreleased OFArray */ + (instancetype)arrayWithObjects: (ObjectType const _Nonnull *_Nonnull)objects count: (size_t)count; +/** + * @brief Initializes an OFArray with no objects. + * + * @return An initialized OFArray + */ +- (instancetype)init OF_DESIGNATED_INITIALIZER; + /** * @brief Initializes an OFArray with the specified object. * * @param object An object * @return An initialized OFArray @@ -225,11 +232,11 @@ * @param objects A C array of objects * @param count The length of the C array * @return An initialized OFArray */ - (instancetype)initWithObjects: (ObjectType const _Nonnull *_Nonnull)objects - count: (size_t)count; + count: (size_t)count OF_DESIGNATED_INITIALIZER; /** * @brief Returns an OFEnumerator to enumerate through all objects of the array. * * @return An OFEnumerator to enumerate through all objects of the array Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -18,11 +18,11 @@ #include #include #import "OFArray.h" #import "OFArray+Private.h" -#import "OFAdjacentArray.h" +#import "OFConcreteArray.h" #import "OFData.h" #import "OFNull.h" #import "OFString.h" #import "OFSubarray.h" @@ -42,77 +42,69 @@ @interface OFPlaceholderArray: OFArray @end @implementation OFPlaceholderArray +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif - (instancetype)init { - return (id)[[OFAdjacentArray alloc] init]; + return (id)[[OFConcreteArray alloc] init]; } - (instancetype)initWithObject: (id)object { - return (id)[[OFAdjacentArray alloc] initWithObject: object]; + return (id)[[OFConcreteArray alloc] initWithObject: object]; } - (instancetype)initWithObjects: (id)firstObject, ... { id ret; va_list arguments; va_start(arguments, firstObject); - ret = [[OFAdjacentArray alloc] initWithObject: firstObject + ret = [[OFConcreteArray alloc] initWithObject: firstObject arguments: arguments]; va_end(arguments); return ret; } - (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments { - return (id)[[OFAdjacentArray alloc] initWithObject: firstObject + return (id)[[OFConcreteArray alloc] initWithObject: firstObject arguments: arguments]; } - (instancetype)initWithArray: (OFArray *)array { - return (id)[[OFAdjacentArray alloc] initWithArray: array]; + return (id)[[OFConcreteArray alloc] initWithArray: array]; } - (instancetype)initWithObjects: (id const *)objects count: (size_t)count { - return (id)[[OFAdjacentArray alloc] initWithObjects: objects + return (id)[[OFConcreteArray alloc] initWithObjects: objects count: count]; } - -- (instancetype)retain -{ - return self; -} - -- (instancetype)autorelease -{ - return self; -} - -- (void)release -{ -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + +OF_SINGLETON_METHODS @end @implementation OFArray + (void)initialize { if (self == [OFArray class]) - placeholder.isa = [OFPlaceholderArray class]; + object_setClass((id)&placeholder, [OFPlaceholderArray class]); } + (instancetype)alloc { if (self == [OFArray class]) @@ -156,11 +148,12 @@ count: count] autorelease]; } - (instancetype)init { - if ([self isMemberOfClass: [OFArray class]]) { + if ([self isMemberOfClass: [OFArray class]] || + [self isMemberOfClass: [OFMutableArray class]]) { @try { [self doesNotRecognizeSelector: _cmd]; } @catch (id e) { [self release]; @throw e; @@ -172,16 +165,11 @@ return [super init]; } - (instancetype)initWithObject: (id)object { - if (object == nil) { - [self release]; - @throw [OFInvalidArgumentException exception]; - } - - return [self initWithObjects: object, nil]; + return [self initWithObjects: &object count: 1]; } - (instancetype)initWithObjects: (id)firstObject, ... { id ret; @@ -192,26 +180,85 @@ va_end(arguments); return ret; } -- (instancetype)initWithObject: (id)firstObject - arguments: (va_list)arguments +- (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments { - OF_INVALID_INIT_METHOD + size_t count = 1; + va_list argumentsCopy; + id *objects; + + if (firstObject == nil) + return [self init]; + + va_copy(argumentsCopy, arguments); + while (va_arg(argumentsCopy, id) != nil) + count++; + + @try { + objects = OFAllocMemory(count, sizeof(id)); + } @catch (id e) { + [self release]; + @throw e; + } + + @try { + objects[0] = firstObject; + + for (size_t i = 1; i < count; i++) { + objects[i] = va_arg(arguments, id); + OFEnsure(objects[i] != nil); + } + + self = [self initWithObjects: objects count: count]; + } @finally { + OFFreeMemory(objects); + } + + return self; } - (instancetype)initWithArray: (OFArray *)array { - OF_INVALID_INIT_METHOD + id *objects; + size_t count; + + @try { + count = array.count; + objects = OFAllocMemory(count, sizeof(id)); + + [array getObjects: objects + inRange: OFMakeRange(0, count)]; + } @catch (id e) { + [self release]; + @throw e; + } + + @try { + self = [self initWithObjects: objects count: count]; + } @finally { + OFFreeMemory(objects); + } + + return self; } +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif - (instancetype)initWithObjects: (id const *)objects count: (size_t)count { OF_INVALID_INIT_METHOD } +#ifdef __clang__ +# pragma clang diagnostic pop +#endif - (size_t)count { OF_UNRECOGNIZED_SELECTOR } @@ -362,11 +409,12 @@ if (range.length > SIZE_MAX - range.location || range.location + range.length < self.count) @throw [OFOutOfRangeException exception]; if (![self isKindOfClass: [OFMutableArray class]]) - return [OFSubarray arrayWithArray: self range: range]; + return [[[OFSubarray alloc] initWithArray: self + range: range] autorelease]; buffer = OFAllocMemory(range.length, sizeof(*buffer)); @try { [self getObjects: buffer inRange: range]; @@ -719,10 +767,11 @@ - (int)countByEnumeratingWithState: (OFFastEnumerationState *)state objects: (id *)objects count: (int)count { + static unsigned long dummyMutations; OFRange range = OFMakeRange(state->state, count); if (range.length > SIZE_MAX - range.location) @throw [OFOutOfRangeException exception]; @@ -734,11 +783,11 @@ if (range.location + range.length > ULONG_MAX) @throw [OFOutOfRangeException exception]; state->state = (unsigned long)(range.location + range.length); state->itemsPtr = objects; - state->mutationsPtr = (unsigned long *)self; + state->mutationsPtr = &dummyMutations; return (int)range.length; } - (OFEnumerator *)objectEnumerator Index: src/OFBlock.m ================================================================== --- src/OFBlock.m +++ src/OFBlock.m @@ -162,11 +162,11 @@ # endif #endif static struct { Class isa; -} alloc_failed_exception; +} allocFailedException; #ifndef OF_HAVE_ATOMIC_OPS # define numSpinlocks 8 /* needs to be a power of 2 */ # define SPINLOCK_HASH(p) ((uintptr_t)p >> 4) & (numSpinlocks - 1) static OFSpinlock blockSpinlocks[numSpinlocks]; @@ -180,14 +180,13 @@ if ([(id)block isMemberOfClass: (Class)&_NSConcreteStackBlock]) { struct Block *copy; if ((copy = malloc(block->descriptor->size)) == NULL) { - alloc_failed_exception.isa = - [OFAllocFailedException class]; - @throw (OFAllocFailedException *) - &alloc_failed_exception; + object_setClass((id)&allocFailedException, + [OFAllocFailedException class]); + @throw (OFAllocFailedException *)&allocFailedException; } memcpy(copy, block, block->descriptor->size); object_setClass((id)copy, (Class)&_NSConcreteMallocBlock); copy->flags++; @@ -269,14 +268,14 @@ src = src->forwarding; if ((src->flags & OFBlockRefCountMask) == 0) { if ((*dst = malloc(src->size)) == NULL) { - alloc_failed_exception.isa = - [OFAllocFailedException class]; + object_setClass((id)&allocFailedException, + [OFAllocFailedException class]); @throw (OFAllocFailedException *) - &alloc_failed_exception; + &allocFailedException; } memcpy(*dst, src, src->size); (*dst)->flags = ((*dst)->flags & ~OFBlockRefCountMask) | 1; DELETED src/OFBytesValue.h Index: src/OFBytesValue.h ================================================================== --- src/OFBytesValue.h +++ src/OFBytesValue.h @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFValue.h" - -OF_ASSUME_NONNULL_BEGIN - -@interface OFBytesValue: OFValue -{ - size_t _size; - void *_bytes; - const char *_objCType; -} -@end - -OF_ASSUME_NONNULL_END DELETED src/OFBytesValue.m Index: src/OFBytesValue.m ================================================================== --- src/OFBytesValue.m +++ src/OFBytesValue.m @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFBytesValue.h" -#import "OFMethodSignature.h" - -#import "OFOutOfRangeException.h" - -@implementation OFBytesValue -@synthesize objCType = _objCType; - -- (instancetype)initWithBytes: (const void *)bytes - objCType: (const char *)objCType -{ - self = [super init]; - - @try { - _size = OFSizeOfTypeEncoding(objCType); - _objCType = objCType; - _bytes = OFAllocMemory(1, _size); - - memcpy(_bytes, bytes, _size); - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - OFFreeMemory(_bytes); - - [super dealloc]; -} - -- (void)getValue: (void *)value size: (size_t)size -{ - if (size != _size) - @throw [OFOutOfRangeException exception]; - - memcpy(value, _bytes, _size); -} -@end Index: src/OFCharacterSet.m ================================================================== --- src/OFCharacterSet.m +++ src/OFCharacterSet.m @@ -54,37 +54,19 @@ - (instancetype)initWithRange: (OFRange)range { return (id)[[OFRangeCharacterSet alloc] initWithRange: range]; } -- (instancetype)retain -{ - return self; -} - -- (instancetype)autorelease -{ - return self; -} - -- (void)release -{ -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} +OF_SINGLETON_METHODS @end @implementation OFCharacterSet + (void)initialize { - if (self != [OFCharacterSet class]) - return; - - placeholder.isa = [OFPlaceholderCharacterSet class]; + if (self == [OFCharacterSet class]) + object_setClass((id)&placeholder, + [OFPlaceholderCharacterSet class]); } + (instancetype)alloc { if (self == [OFCharacterSet class]) @@ -149,29 +131,10 @@ initWithCharacterSet: self] autorelease]; } @end @implementation OFWhitespaceCharacterSet -- (instancetype)autorelease -{ - return self; -} - -- (instancetype)retain -{ - return self; -} - -- (void)release -{ -} - -- (unsigned int)retainCount -{ - return OFMaxRetainCount; -} - - (bool)characterIsMember: (OFUnichar)character { switch (character) { case 0x0009: case 0x0020: @@ -194,6 +157,8 @@ return true; default: return false; } } + +OF_SINGLETON_METHODS @end Index: src/OFColor.h ================================================================== --- src/OFColor.h +++ src/OFColor.h @@ -21,15 +21,10 @@ * @class OFColor OFColor.h ObjFW/OFColor.h * * @brief A class for storing a color. */ @interface OFColor: OFObject -{ - float _red, _green, _blue, _alpha; - OF_RESERVE_IVARS(OFColor, 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; Index: src/OFColor.m ================================================================== --- src/OFColor.m +++ src/OFColor.m @@ -16,62 +16,30 @@ #include "config.h" #include #import "OFColor.h" -#import "OFOnce.h" -#import "OFString.h" - -#import "OFInvalidArgumentException.h" - -@interface OFColor () -+ (instancetype)of_alloc; -@end - -@interface OFColorSingleton: OFColor -@end - -@interface OFColorPlaceholder: OFColorSingleton -@end - -#ifdef OF_OBJFW_RUNTIME -@interface OFTaggedPointerColor: OFColorSingleton -@end - -static const float allowedImprecision = 0.0000001; -#endif +#import "OFConcreteColor.h" +#import "OFOnce.h" +#import "OFString.h" +#import "OFTaggedPointerColor.h" + +@interface OFPlaceholderColor: OFColor +@end + +@interface OFConcreteColorSingleton: OFConcreteColor +@end static struct { Class isa; } placeholder; #ifdef OF_OBJFW_RUNTIME -static int colorTag; +static const float allowedImprecision = 0.0000001; #endif -@implementation OFColorSingleton -- (instancetype)autorelease -{ - return self; -} - -- (instancetype)retain -{ - return self; -} - -- (void)release -{ -} - -- (unsigned int)retainCount -{ - return OFMaxRetainCount; -} -@end - -@implementation OFColorPlaceholder +@implementation OFPlaceholderColor - (instancetype)initWithRed: (float)red green: (float)green blue: (float)blue alpha: (float)alpha { @@ -81,61 +49,37 @@ uint8_t blueInt = nearbyintf(blue * 255); if (fabsf(red * 255 - redInt) < allowedImprecision && fabsf(green * 255 - greenInt) < allowedImprecision && fabsf(blue * 255 - blueInt) < allowedImprecision && alpha == 1) { - id ret = objc_createTaggedPointer(colorTag, - (uintptr_t)redInt << 16 | (uintptr_t)greenInt << 8 | - (uintptr_t)blueInt); + id ret = [OFTaggedPointerColor colorWithRed: redInt + green: greenInt + blue: blueInt]; if (ret != nil) return ret; } #endif - return (id)[[OFColor of_alloc] initWithRed: red - green: green - blue: blue - alpha: alpha]; -} -@end - -#ifdef OF_OBJFW_RUNTIME -@implementation OFTaggedPointerColor -- (void)getRed: (float *)red - green: (float *)green - blue: (float *)blue - alpha: (float *)alpha -{ - uintptr_t value = object_getTaggedPointerValue(self); - - *red = (float)(value >> 16) / 255; - *green = (float)((value >> 8) & 0xFF) / 255; - *blue = (float)(value & 0xFF) / 255; - - if (alpha != NULL) - *alpha = 1; -} -@end -#endif + return (id)[[OFConcreteColor alloc] initWithRed: red + green: green + blue: blue + alpha: alpha]; +} + +OF_SINGLETON_METHODS +@end + +@implementation OFConcreteColorSingleton +OF_SINGLETON_METHODS +@end @implementation OFColor + (void)initialize { - if (self != [OFColor class]) - return; - - placeholder.isa = [OFColorPlaceholder class]; -#ifdef OF_OBJFW_RUNTIME - colorTag = - objc_registerTaggedPointerClass([OFTaggedPointerColor class]); -#endif -} - -+ (instancetype)of_alloc -{ - return [super alloc]; + if (self == [OFColor class]) + object_setClass((id)&placeholder, [OFPlaceholderColor class]); } + (instancetype)alloc { if (self == [OFColor class]) @@ -148,11 +92,11 @@ static OFColor *name##Color = nil; \ \ static void \ initPredefinedColor_##name(void) \ { \ - name##Color = [[OFColorSingleton alloc] \ + name##Color = [[OFConcreteColorSingleton alloc] \ initWithRed: redValue \ green: greenValue \ blue: blueValue \ alpha: 1]; \ } \ @@ -196,75 +140,78 @@ - (instancetype)initWithRed: (float)red green: (float)green blue: (float)blue alpha: (float)alpha { - self = [super init]; - - @try { - if (red < 0.0 || red > 1.0 || - green < 0.0 || green > 1.0 || - blue < 0.0 || blue > 1.0 || - alpha < 0.0 || alpha > 1.0) - @throw [OFInvalidArgumentException exception]; - - _red = red; - _green = green; - _blue = blue; - _alpha = alpha; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; + if ([self isMemberOfClass: [OFColor class]]) { + @try { + [self doesNotRecognizeSelector: _cmd]; + } @catch (id e) { + [self release]; + @throw e; + } + + abort(); + } + + return [super init]; } - (bool)isEqual: (id)object { OFColor *other; + float red, green, blue, alpha; + float otherRed, otherGreen, otherBlue, otherAlpha; if (object == self) return true; if (![object isKindOfClass: [OFColor class]]) return false; other = object; - - if (other->_red != _red) - return false; - if (other->_green != _green) - return false; - if (other->_blue != _blue) - return false; - if (other->_alpha != _alpha) + [self getRed: &red green: &green blue: &blue alpha: &alpha]; + [other getRed: &otherRed + green: &otherGreen + blue: &otherBlue + alpha: &otherAlpha]; + + if (otherRed != red) + return false; + if (otherGreen != green) + return false; + if (otherBlue != blue) + return false; + if (otherAlpha != alpha) return false; return true; } - (unsigned long)hash { + float red, green, blue, alpha; unsigned long hash; float tmp; + [self getRed: &red green: &green blue: &blue alpha: &alpha]; + OFHashInit(&hash); - tmp = OFToLittleEndianFloat(_red); + tmp = OFToLittleEndianFloat(red); + for (uint_fast8_t i = 0; i < sizeof(float); i++) + OFHashAddByte(&hash, ((char *)&tmp)[i]); + + tmp = OFToLittleEndianFloat(green); for (uint_fast8_t i = 0; i < sizeof(float); i++) OFHashAddByte(&hash, ((char *)&tmp)[i]); - tmp = OFToLittleEndianFloat(_green); + tmp = OFToLittleEndianFloat(blue); for (uint_fast8_t i = 0; i < sizeof(float); i++) OFHashAddByte(&hash, ((char *)&tmp)[i]); - tmp = OFToLittleEndianFloat(_blue); - for (uint_fast8_t i = 0; i < sizeof(float); i++) - OFHashAddByte(&hash, ((char *)&tmp)[i]); - - tmp = OFToLittleEndianFloat(_alpha); + tmp = OFToLittleEndianFloat(alpha); for (uint_fast8_t i = 0; i < sizeof(float); i++) OFHashAddByte(&hash, ((char *)&tmp)[i]); OFHashFinalize(&hash); @@ -274,16 +221,11 @@ - (void)getRed: (float *)red green: (float *)green blue: (float *)blue alpha: (float *)alpha { - *red = _red; - *green = _green; - *blue = _blue; - - if (alpha != NULL) - *alpha = _alpha; + OF_UNRECOGNIZED_SELECTOR } - (OFString *)description { float red, green, blue, alpha; ADDED src/OFConcreteArray.h Index: src/OFConcreteArray.h ================================================================== --- src/OFConcreteArray.h +++ src/OFConcreteArray.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFArray.h" + +OF_ASSUME_NONNULL_BEGIN + +@class OFMutableData; + +@interface OFConcreteArray: OFArray +{ + OFMutableData *_array; +} +@end + +OF_ASSUME_NONNULL_END ADDED src/OFConcreteArray.m Index: src/OFConcreteArray.m ================================================================== --- src/OFConcreteArray.m +++ src/OFConcreteArray.m @@ -0,0 +1,338 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 + +#import "OFConcreteArray.h" +#import "OFConcreteMutableArray.h" +#import "OFConcreteSubarray.h" +#import "OFData.h" +#import "OFString.h" + +#import "OFEnumerationMutationException.h" +#import "OFInvalidArgumentException.h" +#import "OFOutOfRangeException.h" + +@implementation OFConcreteArray +- (instancetype)init +{ + self = [super init]; + + @try { + _array = [[OFMutableData alloc] initWithItemSize: sizeof(id)]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithObject: (id)object +{ + self = [self init]; + + @try { + if (object == nil) + @throw [OFInvalidArgumentException exception]; + + [_array addItem: &object]; + [object retain]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments +{ + self = [self init]; + + @try { + id object; + + [_array addItem: &firstObject]; + [firstObject retain]; + + while ((object = va_arg(arguments, id)) != nil) { + [_array addItem: &object]; + [object retain]; + } + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithArray: (OFArray *)array +{ + id const *objects; + size_t count; + + self = [super init]; + + if (array == nil) + return self; + + @try { + objects = array.objects; + count = array.count; + + _array = [[OFMutableData alloc] initWithItemSize: sizeof(id) + capacity: count]; + } @catch (id e) { + [self release]; + @throw e; + } + + @try { + for (size_t i = 0; i < count; i++) + [objects[i] retain]; + + [_array addItems: objects count: count]; + } @catch (id e) { + for (size_t i = 0; i < count; i++) + [objects[i] release]; + + /* Prevent double-release of objects */ + [_array release]; + _array = nil; + + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithObjects: (id const *)objects count: (size_t)count +{ + self = [super init]; + + @try { + bool ok = true; + + for (size_t i = 0; i < count; i++) { + if (objects[i] == nil) + ok = false; + + [objects[i] retain]; + } + + if (!ok) + @throw [OFInvalidArgumentException exception]; + + _array = [[OFMutableData alloc] initWithItemSize: sizeof(id) + capacity: count]; + [_array addItems: objects count: count]; + } @catch (id e) { + for (size_t i = 0; i < count; i++) + [objects[i] release]; + + [self release]; + @throw e; + } + + return self; +} + +- (size_t)count +{ + return _array.count; +} + +- (id const *)objects +{ + return _array.items; +} + +- (id)objectAtIndex: (size_t)idx +{ + return *((id *)[_array itemAtIndex: idx]); +} + +- (id)objectAtIndexedSubscript: (size_t)idx +{ + return *((id *)[_array itemAtIndex: idx]); +} + +- (void)getObjects: (id *)buffer inRange: (OFRange)range +{ + id const *objects = _array.items; + size_t count = _array.count; + + if (range.length > SIZE_MAX - range.location || + range.location + range.length > count) + @throw [OFOutOfRangeException exception]; + + for (size_t i = 0; i < range.length; i++) + buffer[i] = objects[range.location + i]; +} + +- (size_t)indexOfObject: (id)object +{ + id const *objects; + size_t count; + + if (object == nil) + return OFNotFound; + + objects = _array.items; + count = _array.count; + + for (size_t i = 0; i < count; i++) + if ([objects[i] isEqual: object]) + return i; + + return OFNotFound; +} + +- (size_t)indexOfObjectIdenticalTo: (id)object +{ + id const *objects; + size_t count; + + if (object == nil) + return OFNotFound; + + objects = _array.items; + count = _array.count; + + for (size_t i = 0; i < count; i++) + if (objects[i] == object) + return i; + + return OFNotFound; +} + + +- (OFArray *)objectsInRange: (OFRange)range +{ + if (range.length > SIZE_MAX - range.location || + range.location + range.length > _array.count) + @throw [OFOutOfRangeException exception]; + + if ([self isKindOfClass: [OFMutableArray class]]) + return [OFArray + arrayWithObjects: (id *)_array.items + range.location + count: range.length]; + + return [[[OFConcreteSubarray alloc] initWithArray: self + range: range] autorelease]; +} + +- (bool)isEqual: (id)object +{ + OFArray *otherArray; + id const *objects, *otherObjects; + size_t count; + + if (object == self) + return true; + + if (![object isKindOfClass: [OFConcreteArray class]] && + ![object isKindOfClass: [OFConcreteMutableArray class]]) + return [super isEqual: object]; + + otherArray = object; + + count = _array.count; + + if (count != otherArray.count) + return false; + + objects = _array.items; + otherObjects = otherArray.objects; + + for (size_t i = 0; i < count; i++) + if (![objects[i] isEqual: otherObjects[i]]) + return false; + + return true; +} + +- (unsigned long)hash +{ + id const *objects = _array.items; + size_t count = _array.count; + unsigned long hash; + + OFHashInit(&hash); + + for (size_t i = 0; i < count; i++) + OFHashAddHash(&hash, [objects[i] hash]); + + OFHashFinalize(&hash); + + return hash; +} + +- (int)countByEnumeratingWithState: (OFFastEnumerationState *)state + objects: (id *)objects + count: (int)count_ +{ + static unsigned long dummyMutations; + size_t count = _array.count; + + if (count > INT_MAX) + /* + * Use the implementation from OFArray, which is slower, but can + * enumerate in chunks. + */ + return [super countByEnumeratingWithState: state + objects: objects + count: count_]; + + if (state->state >= count) + return 0; + + state->state = (unsigned long)count; + state->itemsPtr = (id *)_array.items; + state->mutationsPtr = &dummyMutations; + + return (int)count; +} + +#ifdef OF_HAVE_BLOCKS +- (void)enumerateObjectsUsingBlock: (OFArrayEnumerationBlock)block +{ + id const *objects = _array.items; + size_t count = _array.count; + bool stop = false; + + for (size_t i = 0; i < count && !stop; i++) + block(objects[i], i, &stop); +} +#endif + +- (void)dealloc +{ + id const *objects = _array.items; + size_t count = _array.count; + + for (size_t i = 0; i < count; i++) + [objects[i] release]; + + [_array release]; + + [super dealloc]; +} +@end ADDED src/OFConcreteColor.h Index: src/OFConcreteColor.h ================================================================== --- src/OFConcreteColor.h +++ src/OFConcreteColor.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFColor.h" + +OF_ASSUME_NONNULL_BEGIN + +@interface OFConcreteColor: OFColor +{ + float _red, _green, _blue, _alpha; +} +@end + +OF_ASSUME_NONNULL_END ADDED src/OFConcreteColor.m Index: src/OFConcreteColor.m ================================================================== --- src/OFConcreteColor.m +++ src/OFConcreteColor.m @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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" + +#import "OFConcreteColor.h" + +#import "OFInvalidArgumentException.h" + +@implementation OFConcreteColor +- (instancetype)initWithRed: (float)red + green: (float)green + blue: (float)blue + alpha: (float)alpha +{ + self = [super init]; + + @try { + if (red < 0.0 || red > 1.0 || + green < 0.0 || green > 1.0 || + blue < 0.0 || blue > 1.0 || + alpha < 0.0 || alpha > 1.0) + @throw [OFInvalidArgumentException exception]; + + _red = red; + _green = green; + _blue = blue; + _alpha = alpha; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)getRed: (float *)red + green: (float *)green + blue: (float *)blue + alpha: (float *)alpha +{ + *red = _red; + *green = _green; + *blue = _blue; + + if (alpha != NULL) + *alpha = _alpha; +} +@end + ADDED src/OFConcreteCountedSet.h Index: src/OFConcreteCountedSet.h ================================================================== --- src/OFConcreteCountedSet.h +++ src/OFConcreteCountedSet.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFCountedSet.h" + +OF_ASSUME_NONNULL_BEGIN + +@class OFMapTable; + +@interface OFConcreteCountedSet: OFCountedSet +{ + OFMapTable *_mapTable; +} +@end + +OF_ASSUME_NONNULL_END ADDED src/OFConcreteCountedSet.m Index: src/OFConcreteCountedSet.m ================================================================== --- src/OFConcreteCountedSet.m +++ src/OFConcreteCountedSet.m @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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" + +#import "OFConcreteCountedSet.h" +#import "OFArray.h" +#import "OFConcreteMutableSet.h" +#import "OFMapTable.h" +#import "OFString.h" +#import "OFXMLAttribute.h" + +#import "OFInvalidArgumentException.h" +#import "OFInvalidFormatException.h" +#import "OFEnumerationMutationException.h" +#import "OFOutOfRangeException.h" + +@implementation OFConcreteCountedSet ++ (void)initialize +{ + if (self == [OFConcreteCountedSet class]) + [self inheritMethodsFromClass: [OFConcreteMutableSet class]]; +} + +- (instancetype)initWithSet: (OFSet *)set +{ + self = [self init]; + + @try { + void *pool = objc_autoreleasePoolPush(); + + if ([set isKindOfClass: [OFCountedSet class]]) { + OFCountedSet *countedSet = (OFCountedSet *)set; + + for (id object in countedSet) { + size_t count = + [countedSet countForObject: object]; + + for (size_t i = 0; i < count; i++) + [self addObject: object]; + } + } else + for (id object in set) + [self addObject: object]; + + objc_autoreleasePoolPop(pool); + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithArray: (OFArray *)array +{ + self = [self init]; + + @try { + id const *objects = array.objects; + size_t count = array.count; + + for (size_t i = 0; i < count; i++) + [self addObject: objects[i]]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithObjects: (id const *)objects count: (size_t)count +{ + self = [self init]; + + @try { + for (size_t i = 0; i < count; i++) + [self addObject: objects[i]]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments +{ + self = [self init]; + + @try { + id object; + + [self addObject: firstObject]; + + while ((object = va_arg(arguments, id)) != nil) + [self addObject: object]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (size_t)countForObject: (id)object +{ + return (size_t)(uintptr_t)[_mapTable objectForKey: object]; +} + +#ifdef OF_HAVE_BLOCKS +- (void)enumerateObjectsAndCountUsingBlock: (OFCountedSetEnumerationBlock)block +{ + @try { + [_mapTable enumerateKeysAndObjectsUsingBlock: + ^ (void *key, void *object, bool *stop) { + block(key, (size_t)(uintptr_t)object, stop); + }]; + } @catch (OFEnumerationMutationException *e) { + @throw [OFEnumerationMutationException + exceptionWithObject: self]; + } +} +#endif + +- (void)addObject: (id)object +{ + size_t count = (size_t)(uintptr_t)[_mapTable objectForKey: object]; + + if (SIZE_MAX - count < 1 || UINTPTR_MAX - count < 1) + @throw [OFOutOfRangeException exception]; + + [_mapTable setObject: (void *)(uintptr_t)(count + 1) forKey: object]; +} + +- (void)removeObject: (id)object +{ + size_t count = (size_t)(uintptr_t)[_mapTable objectForKey: object]; + + if (count == 0) + return; + + count--; + + if (count > 0) + [_mapTable setObject: (void *)(uintptr_t)count forKey: object]; + else + [_mapTable removeObjectForKey: object]; +} + +- (void)removeAllObjects +{ + [_mapTable removeAllObjects]; +} + +- (void)makeImmutable +{ +} +@end ADDED src/OFConcreteData.h Index: src/OFConcreteData.h ================================================================== --- src/OFConcreteData.h +++ src/OFConcreteData.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFData.h" + +OF_ASSUME_NONNULL_BEGIN + +@interface OFConcreteData: OFData +{ + unsigned char *_Nullable _items; + size_t _capacity, _count, _itemSize; + bool _freeWhenDone; +} +@end + +OF_ASSUME_NONNULL_END ADDED src/OFConcreteData.m Index: src/OFConcreteData.m ================================================================== --- src/OFConcreteData.m +++ src/OFConcreteData.m @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 +#include + +#import "OFConcreteData.h" + +#import "OFInvalidArgumentException.h" +#import "OFOutOfRangeException.h" + +@implementation OFConcreteData +- (instancetype)init +{ + return [self initWithItemSize: 1]; +} + +- (instancetype)initWithItemSize: (size_t)itemSize +{ + self = [super init]; + + @try { + if (itemSize == 0) + @throw [OFInvalidArgumentException exception]; + + _itemSize = itemSize; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithItems: (const void *)items + count: (size_t)count + itemSize: (size_t)itemSize +{ + self = [super init]; + + @try { + if (itemSize == 0) + @throw [OFInvalidArgumentException exception]; + + _items = OFAllocMemory(count, itemSize); + _capacity = _count = count; + _itemSize = itemSize; + _freeWhenDone = true; + + memcpy(_items, items, count * itemSize); + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithItemsNoCopy: (void *)items + count: (size_t)count + itemSize: (size_t)itemSize + freeWhenDone: (bool)freeWhenDone +{ + self = [super init]; + + @try { + if (itemSize == 0) + @throw [OFInvalidArgumentException exception]; + + _items = (unsigned char *)items; + _capacity = _count = count; + _itemSize = itemSize; + _freeWhenDone = freeWhenDone; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + if (_freeWhenDone) + OFFreeMemory(_items); + + [super dealloc]; +} + +- (size_t)count +{ + return _count; +} + +- (size_t)itemSize +{ + return _itemSize; +} + +- (const void *)items +{ + return _items; +} +@end ADDED src/OFConcreteDate.h Index: src/OFConcreteDate.h ================================================================== --- src/OFConcreteDate.h +++ src/OFConcreteDate.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFDate.h" + +OF_ASSUME_NONNULL_BEGIN + +@interface OFConcreteDate: OFDate +{ + OFTimeInterval _seconds; +} +@end + +OF_ASSUME_NONNULL_END ADDED src/OFConcreteDate.m Index: src/OFConcreteDate.m ================================================================== --- src/OFConcreteDate.m +++ src/OFConcreteDate.m @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFConcreteDate.h" + +@implementation OFConcreteDate +- (instancetype)initWithTimeIntervalSince1970: (OFTimeInterval)seconds +{ + self = [super initWithTimeIntervalSince1970: seconds]; + + _seconds = seconds; + + return self; +} + +- (OFTimeInterval)timeIntervalSince1970 +{ + return _seconds; +} +@end ADDED src/OFConcreteDictionary.h Index: src/OFConcreteDictionary.h ================================================================== --- src/OFConcreteDictionary.h +++ src/OFConcreteDictionary.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFDictionary.h" + +OF_ASSUME_NONNULL_BEGIN + +@class OFMapTable; +@class OFMapTableEnumerator; + +@interface OFConcreteDictionary: OFDictionary +{ + OFMapTable *_mapTable; +} + +- (instancetype)initWithCapacity: (size_t)capacity; +@end + +OF_ASSUME_NONNULL_END ADDED src/OFConcreteDictionary.m Index: src/OFConcreteDictionary.m ================================================================== --- src/OFConcreteDictionary.m +++ src/OFConcreteDictionary.m @@ -0,0 +1,383 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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" + +#import "OFConcreteDictionary.h" +#import "OFArray.h" +#import "OFConcreteMutableDictionary.h" +#import "OFMapTable+Private.h" +#import "OFMapTable.h" +#import "OFString.h" + +#import "OFEnumerationMutationException.h" +#import "OFInvalidArgumentException.h" +#import "OFInvalidFormatException.h" + +static void * +copy(void *object) +{ + return [(id)object copy]; +} + +static void * +retain(void *object) +{ + return [(id)object retain]; +} + +static void +release(void *object) +{ + [(id)object release]; +} + +static unsigned long +hash(void *object) +{ + return [(id)object hash]; +} + +static bool +equal(void *object1, void *object2) +{ + return [(id)object1 isEqual: (id)object2]; +} + +static const OFMapTableFunctions keyFunctions = { + .retain = copy, + .release = release, + .hash = hash, + .equal = equal +}; +static const OFMapTableFunctions objectFunctions = { + .retain = retain, + .release = release, + .hash = hash, + .equal = equal +}; + +@implementation OFConcreteDictionary +- (instancetype)init +{ + return [self initWithCapacity: 0]; +} + +- (instancetype)initWithCapacity: (size_t)capacity +{ + self = [super init]; + + @try { + _mapTable = [[OFMapTable alloc] + initWithKeyFunctions: keyFunctions + objectFunctions: objectFunctions + capacity: capacity]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithDictionary: (OFDictionary *)dictionary +{ + size_t count; + + if (dictionary == nil) + return [self init]; + + if ([dictionary isKindOfClass: [OFConcreteDictionary class]] || + [dictionary isKindOfClass: [OFConcreteMutableDictionary class]]) { + self = [super init]; + + @try { + OFConcreteDictionary *dictionary_ = + (OFConcreteDictionary *)dictionary; + + _mapTable = [dictionary_->_mapTable copy]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; + } + + @try { + count = dictionary.count; + } @catch (id e) { + [self release]; + @throw e; + } + + self = [self initWithCapacity: count]; + + @try { + void *pool = objc_autoreleasePoolPush(); + OFEnumerator *keyEnumerator, *objectEnumerator; + id key, object; + + keyEnumerator = [dictionary keyEnumerator]; + objectEnumerator = [dictionary objectEnumerator]; + while ((key = [keyEnumerator nextObject]) != nil && + (object = [objectEnumerator nextObject]) != nil) + [_mapTable setObject: object forKey: key]; + + objc_autoreleasePoolPop(pool); + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithObject: (id)object forKey: (id)key +{ + self = [self initWithCapacity: 1]; + + @try { + [_mapTable setObject: object forKey: key]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithObjects: (id const *)objects + forKeys: (id const *)keys + count: (size_t)count +{ + self = [self initWithCapacity: count]; + + @try { + size_t i; + + for (i = 0; i < count; i++) + [_mapTable setObject: objects[i] forKey: keys[i]]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithKey: (id)firstKey arguments: (va_list)arguments +{ + self = [super init]; + + @try { + va_list argumentsCopy; + id key, object; + size_t i, count; + + va_copy(argumentsCopy, arguments); + + if (firstKey == nil) + @throw [OFInvalidArgumentException exception]; + + key = firstKey; + + if ((object = va_arg(arguments, id)) == nil) + @throw [OFInvalidArgumentException exception]; + + count = 1; + for (; va_arg(argumentsCopy, id) != nil; count++); + + if (count % 2 != 0) + @throw [OFInvalidArgumentException exception]; + + count /= 2; + + _mapTable = [[OFMapTable alloc] + initWithKeyFunctions: keyFunctions + objectFunctions: objectFunctions + capacity: count]; + + [_mapTable setObject: object forKey: key]; + + for (i = 1; i < count; i++) { + key = va_arg(arguments, id); + object = va_arg(arguments, id); + + if (key == nil || object == nil) + @throw [OFInvalidArgumentException exception]; + + [_mapTable setObject: object forKey: key]; + } + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [_mapTable release]; + + [super dealloc]; +} + +- (id)objectForKey: (id)key +{ + return [_mapTable objectForKey: key]; +} + +- (size_t)count +{ + return _mapTable.count; +} + +- (bool)isEqual: (id)object +{ + OFConcreteDictionary *dictionary; + + if (object == self) + return true; + + if (![object isKindOfClass: [OFConcreteDictionary class]] && + ![object isKindOfClass: [OFConcreteMutableDictionary class]]) + return [super isEqual: object]; + + dictionary = (OFConcreteDictionary *)object; + + return [dictionary->_mapTable isEqual: _mapTable]; +} + +- (bool)containsObject: (id)object +{ + return [_mapTable containsObject: object]; +} + +- (bool)containsObjectIdenticalTo: (id)object +{ + return [_mapTable containsObjectIdenticalTo: object]; +} + +- (OFArray *)allKeys +{ + OFArray *ret; + id *keys; + size_t count; + + count = _mapTable.count; + keys = OFAllocMemory(count, sizeof(*keys)); + + @try { + void *pool = objc_autoreleasePoolPush(); + OFMapTableEnumerator *enumerator; + void **keyPtr; + size_t i; + + i = 0; + enumerator = [_mapTable keyEnumerator]; + while ((keyPtr = [enumerator nextObject]) != NULL) { + OFAssert(i < count); + + keys[i++] = (id)*keyPtr; + } + + objc_autoreleasePoolPop(pool); + + ret = [OFArray arrayWithObjects: keys count: count]; + } @finally { + OFFreeMemory(keys); + } + + return ret; +} + +- (OFArray *)allObjects +{ + OFArray *ret; + id *objects; + size_t count; + + count = _mapTable.count; + objects = OFAllocMemory(count, sizeof(*objects)); + + @try { + void *pool = objc_autoreleasePoolPush(); + OFMapTableEnumerator *enumerator; + void **objectPtr; + size_t i; + + i = 0; + enumerator = [_mapTable objectEnumerator]; + while ((objectPtr = [enumerator nextObject]) != NULL) { + OFAssert(i < count); + + objects[i++] = (id)*objectPtr; + } + + objc_autoreleasePoolPop(pool); + + ret = [OFArray arrayWithObjects: objects count: count]; + } @finally { + OFFreeMemory(objects); + } + + return ret; +} + +- (OFEnumerator *)keyEnumerator +{ + return [[[OFMapTableEnumeratorWrapper alloc] + initWithEnumerator: [_mapTable keyEnumerator] + object: self] autorelease]; +} + +- (OFEnumerator *)objectEnumerator +{ + return [[[OFMapTableEnumeratorWrapper alloc] + initWithEnumerator: [_mapTable objectEnumerator] + object: self] autorelease]; +} + +- (int)countByEnumeratingWithState: (OFFastEnumerationState *)state + objects: (id *)objects + count: (int)count +{ + return [_mapTable countByEnumeratingWithState: state + objects: objects + count: count]; +} + +#ifdef OF_HAVE_BLOCKS +- (void)enumerateKeysAndObjectsUsingBlock: (OFDictionaryEnumerationBlock)block +{ + @try { + [_mapTable enumerateKeysAndObjectsUsingBlock: + ^ (void *key, void *object, bool *stop) { + block(key, object, stop); + }]; + } @catch (OFEnumerationMutationException *e) { + @throw [OFEnumerationMutationException + exceptionWithObject: self]; + } +} +#endif + +- (unsigned long)hash +{ + return _mapTable.hash; +} +@end ADDED src/OFConcreteMutableArray.h Index: src/OFConcreteMutableArray.h ================================================================== --- src/OFConcreteMutableArray.h +++ src/OFConcreteMutableArray.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFArray.h" + +OF_ASSUME_NONNULL_BEGIN + +@class OFMutableData; + +@interface OFConcreteMutableArray: OFMutableArray +{ + OFMutableData *_array; + unsigned long _mutations; +} +@end + +OF_ASSUME_NONNULL_END ADDED src/OFConcreteMutableArray.m Index: src/OFConcreteMutableArray.m ================================================================== --- src/OFConcreteMutableArray.m +++ src/OFConcreteMutableArray.m @@ -0,0 +1,383 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 + +#import "OFConcreteMutableArray.h" +#import "OFConcreteArray.h" +#import "OFArray+Private.h" +#import "OFData.h" + +#import "OFEnumerationMutationException.h" +#import "OFInvalidArgumentException.h" +#import "OFOutOfRangeException.h" + +@implementation OFConcreteMutableArray ++ (void)initialize +{ + if (self == [OFConcreteMutableArray class]) + [self inheritMethodsFromClass: [OFConcreteArray class]]; +} + +- (instancetype)initWithCapacity: (size_t)capacity +{ + self = [super init]; + + @try { + _array = [[OFMutableData alloc] initWithItemSize: sizeof(id) + capacity: capacity]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)addObject: (id)object +{ + if (object == nil) + @throw [OFInvalidArgumentException exception]; + + [_array addItem: &object]; + [object retain]; + + _mutations++; +} + +- (void)insertObject: (id)object atIndex: (size_t)idx +{ + if (object == nil) + @throw [OFInvalidArgumentException exception]; + + @try { + [_array insertItem: &object atIndex: idx]; + } @catch (OFOutOfRangeException *e) { + @throw [OFOutOfRangeException exception]; + } + [object retain]; + + _mutations++; +} + +- (void)insertObjectsFromArray: (OFArray *)array atIndex: (size_t)idx +{ + id const *objects = array.objects; + size_t count = array.count; + + @try { + [_array insertItems: objects atIndex: idx count: count]; + } @catch (OFOutOfRangeException *e) { + @throw [OFOutOfRangeException exception]; + } + + for (size_t i = 0; i < count; i++) + [objects[i] retain]; + + _mutations++; +} + +- (void)replaceObject: (id)oldObject withObject: (id)newObject +{ + id *objects; + size_t count; + + if (oldObject == nil || newObject == nil) + @throw [OFInvalidArgumentException exception]; + + objects = _array.mutableItems; + count = _array.count; + + for (size_t i = 0; i < count; i++) { + if ([objects[i] isEqual: oldObject]) { + [newObject retain]; + [objects[i] release]; + objects[i] = newObject; + } + } +} + +- (void)replaceObjectAtIndex: (size_t)idx withObject: (id)object +{ + id *objects; + id oldObject; + + if (object == nil) + @throw [OFInvalidArgumentException exception]; + + objects = _array.mutableItems; + + if (idx >= _array.count) + @throw [OFOutOfRangeException exception]; + + oldObject = objects[idx]; + objects[idx] = [object retain]; + [oldObject release]; +} + +- (void)replaceObjectIdenticalTo: (id)oldObject withObject: (id)newObject +{ + id *objects; + size_t count; + + if (oldObject == nil || newObject == nil) + @throw [OFInvalidArgumentException exception]; + + objects = _array.mutableItems; + count = _array.count; + + for (size_t i = 0; i < count; i++) { + if (objects[i] == oldObject) { + [newObject retain]; + [objects[i] release]; + objects[i] = newObject; + + return; + } + } +} + +- (void)removeObject: (id)object +{ + id const *objects; + size_t count; + + if (object == nil) + @throw [OFInvalidArgumentException exception]; + + objects = _array.items; + count = _array.count; + + for (size_t i = 0; i < count; i++) { + if ([objects[i] isEqual: object]) { + id tmp = objects[i]; + + [_array removeItemAtIndex: i]; + _mutations++; + + [tmp release]; + + objects = _array.items; + i--; + count--; + continue; + } + } +} + +- (void)removeObjectIdenticalTo: (id)object +{ + id const *objects; + size_t count; + + if (object == nil) + @throw [OFInvalidArgumentException exception]; + + objects = _array.items; + count = _array.count; + + for (size_t i = 0; i < count; i++) { + if (objects[i] == object) { + [_array removeItemAtIndex: i]; + _mutations++; + + [object release]; + + objects = _array.items; + i--; + count--; + continue; + } + } +} + +- (void)removeObjectAtIndex: (size_t)idx +{ +#ifndef __clang_analyzer__ + id object = [self objectAtIndex: idx]; + [_array removeItemAtIndex: idx]; + [object release]; + + _mutations++; +#endif +} + +- (void)removeAllObjects +{ + id const *objects = _array.items; + size_t count = _array.count; + + for (size_t i = 0; i < count; i++) + [objects[i] release]; + + [_array removeAllItems]; +} + +- (void)removeObjectsInRange: (OFRange)range +{ + id const *objects = _array.items; + size_t count = _array.count; + id *copy; + + if (range.length > SIZE_MAX - range.location || + range.location >= count || range.length > count - range.location) + @throw [OFOutOfRangeException exception]; + + copy = OFAllocMemory(range.length, sizeof(*copy)); + memcpy(copy, objects + range.location, range.length * sizeof(id)); + + @try { + [_array removeItemsInRange: range]; + _mutations++; + + for (size_t i = 0; i < range.length; i++) + [copy[i] release]; + } @finally { + OFFreeMemory(copy); + } +} + +- (void)removeLastObject +{ +#ifndef __clang_analyzer__ + size_t count = _array.count; + id object; + + if (count == 0) + return; + + object = [self objectAtIndex: count - 1]; + [_array removeLastItem]; + [object release]; + + _mutations++; +#endif +} + +- (void)exchangeObjectAtIndex: (size_t)idx1 withObjectAtIndex: (size_t)idx2 +{ + id *objects = _array.mutableItems; + size_t count = _array.count; + id tmp; + + if (idx1 >= count || idx2 >= count) + @throw [OFOutOfRangeException exception]; + + tmp = objects[idx1]; + objects[idx1] = objects[idx2]; + objects[idx2] = tmp; +} + +- (void)reverse +{ + id *objects = _array.mutableItems; + size_t i, j, count = _array.count; + + if (count == 0 || count == 1) + return; + + for (i = 0, j = count - 1; i < j; i++, j--) { + id tmp = objects[i]; + objects[i] = objects[j]; + objects[j] = tmp; + } +} + +- (int)countByEnumeratingWithState: (OFFastEnumerationState *)state + objects: (id *)objects + count: (int)count_ +{ + size_t count = _array.count; + + if (count > INT_MAX) { + /* + * Use the implementation from OFArray (OFMutableArray does not + * have one), which is slower, but can enumerate in chunks, and + * set the mutations pointer. + */ + int ret = [super countByEnumeratingWithState: state + objects: objects + count: count_]; + state->mutationsPtr = &_mutations; + return ret; + } + + if (state->state >= count) + return 0; + + state->state = (unsigned long)count; + state->itemsPtr = (id *)_array.items; + state->mutationsPtr = &_mutations; + + return (int)count; +} + +- (OFEnumerator *)objectEnumerator +{ + return [[[OFArrayEnumerator alloc] + initWithArray: self + mutationsPtr: &_mutations] autorelease]; +} + +#ifdef OF_HAVE_BLOCKS +- (void)enumerateObjectsUsingBlock: (OFArrayEnumerationBlock)block +{ + id const *objects = _array.items; + size_t count = _array.count; + bool stop = false; + unsigned long mutations = _mutations; + + for (size_t i = 0; i < count && !stop; i++) { + if (_mutations != mutations) + @throw [OFEnumerationMutationException + exceptionWithObject: self]; + + block(objects[i], i, &stop); + } +} + +- (void)replaceObjectsUsingBlock: (OFArrayReplaceBlock)block +{ + id *objects = _array.mutableItems; + size_t count = _array.count; + unsigned long mutations = _mutations; + + for (size_t i = 0; i < count; i++) { + id new; + + if (_mutations != mutations) + @throw [OFEnumerationMutationException + exceptionWithObject: self]; + + new = block(objects[i], i); + + if (new == nil) + @throw [OFInvalidArgumentException exception]; + + if (new != objects[i]) { + [objects[i] release]; + objects[i] = [new retain]; + } + } +} +#endif + +- (void)makeImmutable +{ + object_setClass(self, [OFConcreteArray class]); +} +@end ADDED src/OFConcreteMutableData.h Index: src/OFConcreteMutableData.h ================================================================== --- src/OFConcreteMutableData.h +++ src/OFConcreteMutableData.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFMutableData.h" + +OF_ASSUME_NONNULL_BEGIN + +@interface OFConcreteMutableData: OFMutableData +{ + unsigned char *_Nullable _items; + size_t _capacity, _count, _itemSize; + bool _freeWhenDone; +} +@end + +OF_ASSUME_NONNULL_END ADDED src/OFConcreteMutableData.m Index: src/OFConcreteMutableData.m ================================================================== --- src/OFConcreteMutableData.m +++ src/OFConcreteMutableData.m @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 +#include + +#import "OFConcreteMutableData.h" +#import "OFConcreteData.h" + +#import "OFInvalidArgumentException.h" +#import "OFOutOfMemoryException.h" +#import "OFOutOfRangeException.h" + +@implementation OFConcreteMutableData ++ (void)initialize +{ + if (self == [OFConcreteMutableData class]) + [self inheritMethodsFromClass: [OFConcreteData class]]; +} + +- (instancetype)initWithItemSize: (size_t)itemSize capacity: (size_t)capacity +{ + self = [super init]; + + @try { + if (itemSize == 0) + @throw [OFInvalidArgumentException exception]; + + _items = OFAllocMemory(capacity, itemSize); + _itemSize = itemSize; + _capacity = capacity; + _freeWhenDone = true; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithItemsNoCopy: (void *)items + count: (size_t)count + itemSize: (size_t)itemSize + freeWhenDone: (bool)freeWhenDone +{ + self = [self initWithItems: items count: count itemSize: itemSize]; + + if (freeWhenDone) + OFFreeMemory(items); + + return self; +} + +- (void *)mutableItems +{ + return _items; +} + +- (void)addItem: (const void *)item +{ + if (SIZE_MAX - _count < 1) + @throw [OFOutOfRangeException exception]; + + if (_count + 1 > _capacity) { + _items = OFResizeMemory(_items, _count + 1, _itemSize); + _capacity = _count + 1; + } + + memcpy(_items + _count * _itemSize, item, _itemSize); + + _count++; +} + +- (void)addItems: (const void *)items count: (size_t)count +{ + if (count > SIZE_MAX - _count) + @throw [OFOutOfRangeException exception]; + + if (_count + count > _capacity) { + _items = OFResizeMemory(_items, _count + count, _itemSize); + _capacity = _count + count; + } + + memcpy(_items + _count * _itemSize, items, count * _itemSize); + _count += count; +} + +- (void)insertItems: (const void *)items + atIndex: (size_t)idx + count: (size_t)count +{ + if (count > SIZE_MAX - _count || idx > _count) + @throw [OFOutOfRangeException exception]; + + if (_count + count > _capacity) { + _items = OFResizeMemory(_items, _count + count, _itemSize); + _capacity = _count + count; + } + + memmove(_items + (idx + count) * _itemSize, _items + idx * _itemSize, + (_count - idx) * _itemSize); + memcpy(_items + idx * _itemSize, items, count * _itemSize); + + _count += count; +} + +- (void)increaseCountBy: (size_t)count +{ + if (count > SIZE_MAX - _count) + @throw [OFOutOfRangeException exception]; + + if (_count + count > _capacity) { + _items = OFResizeMemory(_items, _count + count, _itemSize); + _capacity = _count + count; + } + + memset(_items + _count * _itemSize, '\0', count * _itemSize); + _count += count; +} + +- (void)removeItemsInRange: (OFRange)range +{ + if (range.length > SIZE_MAX - range.location || + range.location + range.length > _count) + @throw [OFOutOfRangeException exception]; + + memmove(_items + range.location * _itemSize, + _items + (range.location + range.length) * _itemSize, + (_count - range.location - range.length) * _itemSize); + + _count -= range.length; + @try { + _items = OFResizeMemory(_items, _count, _itemSize); + _capacity = _count; + } @catch (OFOutOfMemoryException *e) { + /* We don't really care, as we only made it smaller */ + } +} + +- (void)removeLastItem +{ + if (_count == 0) + return; + + _count--; + @try { + _items = OFResizeMemory(_items, _count, _itemSize); + _capacity = _count; + } @catch (OFOutOfMemoryException *e) { + /* We don't care, as we only made it smaller */ + } +} + +- (void)removeAllItems +{ + OFFreeMemory(_items); + _items = NULL; + _count = 0; + _capacity = 0; +} + +- (void)makeImmutable +{ + if (_capacity != _count) { + @try { + _items = OFResizeMemory(_items, _count, _itemSize); + _capacity = _count; + } @catch (OFOutOfMemoryException *e) { + /* We don't care, as we only made it smaller */ + } + } + + object_setClass(self, [OFConcreteData class]); +} +@end ADDED src/OFConcreteMutableDictionary.h Index: src/OFConcreteMutableDictionary.h ================================================================== --- src/OFConcreteMutableDictionary.h +++ src/OFConcreteMutableDictionary.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFDictionary.h" + +OF_ASSUME_NONNULL_BEGIN + +@class OFMapTable; + +@interface OFConcreteMutableDictionary: OFMutableDictionary +{ + OFMapTable *_mapTable; +} +@end + +OF_ASSUME_NONNULL_END ADDED src/OFConcreteMutableDictionary.m Index: src/OFConcreteMutableDictionary.m ================================================================== --- src/OFConcreteMutableDictionary.m +++ src/OFConcreteMutableDictionary.m @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 + +#import "OFConcreteMutableDictionary.h" +#import "OFConcreteDictionary.h" +#import "OFMapTable.h" + +#import "OFEnumerationMutationException.h" +#import "OFOutOfRangeException.h" + +@implementation OFConcreteMutableDictionary ++ (void)initialize +{ + if (self == [OFConcreteMutableDictionary class]) + [self inheritMethodsFromClass: [OFConcreteDictionary class]]; +} + +- (void)setObject: (id)object forKey: (id)key +{ + [_mapTable setObject: object forKey: key]; +} + +- (void)removeObjectForKey: (id)key +{ + [_mapTable removeObjectForKey: key]; +} + +- (void)removeAllObjects +{ + [_mapTable removeAllObjects]; +} + +#ifdef OF_HAVE_BLOCKS +- (void)replaceObjectsUsingBlock: (OFDictionaryReplaceBlock)block +{ + @try { + [_mapTable replaceObjectsUsingBlock: + ^ void *(void *key, void *object) { + return block(key, object); + }]; + } @catch (OFEnumerationMutationException *e) { + @throw [OFEnumerationMutationException + exceptionWithObject: self]; + } +} +#endif + +- (void)makeImmutable +{ + object_setClass(self, [OFConcreteDictionary class]); +} +@end ADDED src/OFConcreteMutableSet.h Index: src/OFConcreteMutableSet.h ================================================================== --- src/OFConcreteMutableSet.h +++ src/OFConcreteMutableSet.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFMutableSet.h" + +OF_ASSUME_NONNULL_BEGIN + +@class OFMapTable; + +@interface OFConcreteMutableSet: OFMutableSet +{ + OFMapTable *_mapTable; +} +@end + +OF_ASSUME_NONNULL_END ADDED src/OFConcreteMutableSet.m Index: src/OFConcreteMutableSet.m ================================================================== --- src/OFConcreteMutableSet.m +++ src/OFConcreteMutableSet.m @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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" + +#import "OFConcreteMutableSet.h" +#import "OFConcreteSet.h" +#import "OFMapTable.h" + +@implementation OFConcreteMutableSet ++ (void)initialize +{ + if (self == [OFConcreteMutableSet class]) + [self inheritMethodsFromClass: [OFConcreteSet class]]; +} + +- (void)addObject: (id)object +{ + [_mapTable setObject: (void *)1 forKey: object]; +} + +- (void)removeObject: (id)object +{ + [_mapTable removeObjectForKey: object]; +} + +- (void)removeAllObjects +{ + [_mapTable removeAllObjects]; +} + +- (void)makeImmutable +{ + object_setClass(self, [OFConcreteSet class]); +} +@end ADDED src/OFConcreteNumber.h Index: src/OFConcreteNumber.h ================================================================== --- src/OFConcreteNumber.h +++ src/OFConcreteNumber.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFNumber.h" + +OF_ASSUME_NONNULL_BEGIN + +@interface OFConcreteNumber: OFNumber +{ + union { + double float_; + long long signed_; + unsigned long long unsigned_; + } _value; + char _typeEncoding; +} +@end + +OF_ASSUME_NONNULL_END ADDED src/OFConcreteNumber.m Index: src/OFConcreteNumber.m ================================================================== --- src/OFConcreteNumber.m +++ src/OFConcreteNumber.m @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 + +#import "OFConcreteNumber.h" + +#import "OFInvalidFormatException.h" + +static bool +isUnsigned(OFNumber *number) +{ + switch (*number.objCType) { + case 'B': + case 'C': + case 'S': + case 'I': + case 'L': + case 'Q': + return true; + default: + return false; + } +} + +static bool +isSigned(OFNumber *number) +{ + switch (*number.objCType) { + case 'c': + case 's': + case 'i': + case 'l': + case 'q': + return true; + default: + return false; + } +} + +static bool +isFloat(OFNumber *number) +{ + switch (*number.objCType) { + case 'f': + case 'd': + return true; + default: + return false; + } +} + +@implementation OFConcreteNumber +- (instancetype)initWithBytes: (const void *)bytes + objCType: (const char *)objCType +{ +#define CASE(type, method) \ + if (strcmp(objCType, @encode(type)) == 0) { \ + type value; \ + memcpy(&value, bytes, sizeof(type)); \ + return [self method value]; \ + } + + CASE(bool, initWithBool:) + CASE(signed char, initWithChar:) + CASE(short, initWithShort:) + CASE(int, initWithInt:) + CASE(long, initWithLong:) + CASE(long long, initWithLongLong:) + CASE(unsigned char, initWithUnsignedChar:) + CASE(unsigned short, initWithUnsignedShort:) + CASE(unsigned int, initWithUnsignedInt:) + CASE(unsigned long, initWithUnsignedLong:) + CASE(unsigned long long, initWithUnsignedLongLong:) + CASE(float, initWithFloat:) + CASE(double, initWithDouble:) + + [self release]; + @throw [OFInvalidFormatException exception]; +} + +- (instancetype)initWithBool: (bool)value +{ + self = [super initWithBytes: &value objCType: @encode(bool)]; + + _value.unsigned_ = value; + _typeEncoding = *@encode(bool); + + return self; +} + +- (instancetype)initWithChar: (signed char)value +{ + self = [super initWithBytes: &value objCType: @encode(signed char)]; + + _value.signed_ = value; + _typeEncoding = *@encode(signed char); + + return self; +} + +- (instancetype)initWithShort: (short)value +{ + self = [super initWithBytes: &value objCType: @encode(short)]; + + _value.signed_ = value; + _typeEncoding = *@encode(short); + + return self; +} + +- (instancetype)initWithInt: (int)value +{ + self = [super initWithBytes: &value objCType: @encode(int)]; + + _value.signed_ = value; + _typeEncoding = *@encode(int); + + return self; +} + +- (instancetype)initWithLong: (long)value +{ + self = [super initWithBytes: &value objCType: @encode(long)]; + + _value.signed_ = value; + _typeEncoding = *@encode(long); + + return self; +} + +- (instancetype)initWithLongLong: (long long)value +{ + self = [super initWithBytes: &value objCType: @encode(long long)]; + + _value.signed_ = value; + _typeEncoding = *@encode(long long); + + return self; +} + +- (instancetype)initWithUnsignedChar: (unsigned char)value +{ + self = [super initWithBytes: &value objCType: @encode(unsigned char)]; + + _value.unsigned_ = value; + _typeEncoding = *@encode(unsigned long); + + return self; +} + +- (instancetype)initWithUnsignedShort: (unsigned short)value +{ + self = [super initWithBytes: &value objCType: @encode(unsigned short)]; + + _value.unsigned_ = value; + _typeEncoding = *@encode(unsigned short); + + return self; +} + +- (instancetype)initWithUnsignedInt: (unsigned int)value +{ + self = [super initWithBytes: &value objCType: @encode(unsigned int)]; + + _value.unsigned_ = value; + _typeEncoding = *@encode(unsigned int); + + return self; +} + +- (instancetype)initWithUnsignedLong: (unsigned long)value +{ + self = [super initWithBytes: &value objCType: @encode(unsigned long)]; + + _value.unsigned_ = value; + _typeEncoding = *@encode(unsigned long); + + return self; +} + +- (instancetype)initWithUnsignedLongLong: (unsigned long long)value +{ + self = [super initWithBytes: &value + objCType: @encode(unsigned long long)]; + + _value.unsigned_ = value; + _typeEncoding = *@encode(unsigned long long); + + return self; +} + +- (instancetype)initWithFloat: (float)value +{ + self = [super initWithBytes: &value objCType: @encode(float)]; + + _value.float_ = value; + _typeEncoding = *@encode(float); + + return self; +} + +- (instancetype)initWithDouble: (double)value +{ + self = [super initWithBytes: &value objCType: @encode(double)]; + + _value.float_ = value; + _typeEncoding = *@encode(double); + + return self; +} + +- (const char *)objCType +{ + return &_typeEncoding; +} + +- (long long)longLongValue +{ + if (isFloat(self)) + return _value.float_; + else if (isSigned(self)) + return _value.signed_; + else if (isUnsigned(self)) + return _value.unsigned_; + else + @throw [OFInvalidFormatException exception]; +} + +- (unsigned long long)unsignedLongLongValue +{ + if (isFloat(self)) + return _value.float_; + else if (isSigned(self)) + return _value.signed_; + else if (isUnsigned(self)) + return _value.unsigned_; + else + @throw [OFInvalidFormatException exception]; +} + +- (double)doubleValue +{ + if (isFloat(self)) + return _value.float_; + else if (isSigned(self)) + return _value.signed_; + else if (isUnsigned(self)) + return _value.unsigned_; + else + @throw [OFInvalidFormatException exception]; +} +@end ADDED src/OFConcreteSet.h Index: src/OFConcreteSet.h ================================================================== --- src/OFConcreteSet.h +++ src/OFConcreteSet.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFSet.h" + +OF_ASSUME_NONNULL_BEGIN + +@class OFMapTable; + +@interface OFConcreteSet: OFSet +{ + OFMapTable *_mapTable; +} + +- (instancetype)initWithCapacity: (size_t)capacity; +@end + +OF_ASSUME_NONNULL_END ADDED src/OFConcreteSet.m Index: src/OFConcreteSet.m ================================================================== --- src/OFConcreteSet.m +++ src/OFConcreteSet.m @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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" + +#import "OFConcreteSet.h" +#import "OFArray.h" +#import "OFConcreteCountedSet.h" +#import "OFConcreteMutableSet.h" +#import "OFMapTable+Private.h" +#import "OFMapTable.h" +#import "OFString.h" + +#import "OFInvalidArgumentException.h" +#import "OFEnumerationMutationException.h" + +static void * +retain(void *object) +{ + return [(id)object retain]; +} + +static void +release(void *object) +{ + [(id)object release]; +} + +static unsigned long +hash(void *object) +{ + return [(id)object hash]; +} + +static bool +equal(void *object1, void *object2) +{ + return [(id)object1 isEqual: (id)object2]; +} + +static const OFMapTableFunctions keyFunctions = { + .retain = retain, + .release = release, + .hash = hash, + .equal = equal +}; +static const OFMapTableFunctions objectFunctions = { NULL }; + +@implementation OFConcreteSet +- (instancetype)init +{ + return [self initWithCapacity: 0]; +} + +- (instancetype)initWithCapacity: (size_t)capacity +{ + self = [super init]; + + @try { + _mapTable = [[OFMapTable alloc] + initWithKeyFunctions: keyFunctions + objectFunctions: objectFunctions + capacity: capacity]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithSet: (OFSet *)set +{ + size_t count; + + if (set == nil) + return [self init]; + + @try { + count = set.count; + } @catch (id e) { + [self release]; + @throw e; + } + + self = [self initWithCapacity: count]; + + @try { + for (id object in set) + [_mapTable setObject: (void *)1 forKey: object]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithArray: (OFArray *)array +{ + size_t count; + + if (array == nil) + return self; + + @try { + count = array.count; + } @catch (id e) { + [self release]; + @throw e; + } + + self = [self initWithCapacity: count]; + + @try { + for (id object in array) + [_mapTable setObject: (void *)1 forKey: object]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithObjects: (id const *)objects count: (size_t)count +{ + self = [self initWithCapacity: count]; + + @try { + for (size_t i = 0; i < count; i++) + [_mapTable setObject: (void *)1 forKey: objects[i]]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments +{ + self = [super init]; + + @try { + id object; + va_list argumentsCopy; + size_t count; + + va_copy(argumentsCopy, arguments); + + for (count = 1; va_arg(argumentsCopy, id) != nil; count++); + + _mapTable = [[OFMapTable alloc] + initWithKeyFunctions: keyFunctions + objectFunctions: objectFunctions + capacity: count]; + + [_mapTable setObject: (void *)1 forKey: firstObject]; + + while ((object = va_arg(arguments, id)) != nil) + [_mapTable setObject: (void *)1 forKey: object]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [_mapTable release]; + + [super dealloc]; +} + +- (size_t)count +{ + return [_mapTable count]; +} + +- (bool)containsObject: (id)object +{ + if (object == nil) + return false; + + return ([_mapTable objectForKey: object] != nil); +} + +- (bool)isEqual: (id)object +{ + OFConcreteSet *set; + + if (object == self) + return true; + + if (![object isKindOfClass: [OFConcreteSet class]] && + ![object isKindOfClass: [OFConcreteMutableSet class]] && + ![object isKindOfClass: [OFConcreteCountedSet class]]) + return [super isEqual: object]; + + set = object; + + return [set->_mapTable isEqual: _mapTable]; +} + +- (id)anyObject +{ + void *pool = objc_autoreleasePoolPush(); + void **objectPtr; + id object; + + objectPtr = [[_mapTable keyEnumerator] nextObject]; + + if (objectPtr == NULL) { + objc_autoreleasePoolPop(pool); + return nil; + } + + object = [(id)*objectPtr retain]; + + objc_autoreleasePoolPop(pool); + + return [object autorelease]; +} + +- (OFEnumerator *)objectEnumerator +{ + return [[[OFMapTableEnumeratorWrapper alloc] + initWithEnumerator: [_mapTable keyEnumerator] + object: self] autorelease]; +} + +- (int)countByEnumeratingWithState: (OFFastEnumerationState *)state + objects: (id *)objects + count: (int)count +{ + return [_mapTable countByEnumeratingWithState: state + objects: objects + count: count]; +} + +#ifdef OF_HAVE_BLOCKS +- (void)enumerateObjectsUsingBlock: (OFSetEnumerationBlock)block +{ + @try { + [_mapTable enumerateKeysAndObjectsUsingBlock: + ^ (void *key, void *object, bool *stop) { + block(key, stop); + }]; + } @catch (OFEnumerationMutationException *e) { + @throw [OFEnumerationMutationException + exceptionWithObject: self]; + } +} +#endif +@end ADDED src/OFConcreteSubarray.h Index: src/OFConcreteSubarray.h ================================================================== --- src/OFConcreteSubarray.h +++ src/OFConcreteSubarray.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFSubarray.h" + +OF_ASSUME_NONNULL_BEGIN + +@interface OFConcreteSubarray: OFSubarray +@end + +OF_ASSUME_NONNULL_END ADDED src/OFConcreteSubarray.m Index: src/OFConcreteSubarray.m ================================================================== --- src/OFConcreteSubarray.m +++ src/OFConcreteSubarray.m @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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" + +#import "OFConcreteSubarray.h" +#import "OFConcreteArray.h" +#import "OFConcreteMutableArray.h" + +@implementation OFConcreteSubarray +- (const id *)objects +{ + return _array.objects + _range.location; +} + +- (bool)isEqual: (id)object +{ + OFArray *otherArray; + id const *objects, *otherObjects; + + if (object == self) + return true; + + if (![object isKindOfClass: [OFConcreteArray class]] && + ![object isKindOfClass: [OFConcreteMutableArray class]]) + return [super isEqual: object]; + + otherArray = object; + + if (_range.length != otherArray.count) + return false; + + objects = self.objects; + otherObjects = otherArray.objects; + + for (size_t i = 0; i < _range.length; i++) + if (![objects[i] isEqual: otherObjects[i]]) + return false; + + return true; +} + +#ifdef OF_HAVE_BLOCKS +- (void)enumerateObjectsUsingBlock: (OFArrayEnumerationBlock)block +{ + id const *objects = self.objects; + bool stop = false; + + for (size_t i = 0; i < _range.length && !stop; i++) + block(objects[i], i, &stop); +} +#endif +@end ADDED src/OFConcreteValue.h Index: src/OFConcreteValue.h ================================================================== --- src/OFConcreteValue.h +++ src/OFConcreteValue.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFValue.h" + +OF_ASSUME_NONNULL_BEGIN + +@interface OFConcreteValue: OFValue +{ + size_t _size; + void *_bytes; + char *_objCType; +} +@end + +OF_ASSUME_NONNULL_END ADDED src/OFConcreteValue.m Index: src/OFConcreteValue.m ================================================================== --- src/OFConcreteValue.m +++ src/OFConcreteValue.m @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFConcreteValue.h" +#import "OFMethodSignature.h" +#import "OFString.h" + +#import "OFOutOfRangeException.h" + +@implementation OFConcreteValue +- (instancetype)initWithBytes: (const void *)bytes + objCType: (const char *)objCType +{ + self = [super initWithBytes: bytes objCType: objCType]; + + @try { + _size = OFSizeOfTypeEncoding(objCType); + _objCType = OFStrDup(objCType); + _bytes = OFAllocMemory(1, _size); + memcpy(_bytes, bytes, _size); + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + OFFreeMemory(_bytes); + OFFreeMemory(_objCType); + + [super dealloc]; +} + +- (const char *)objCType +{ + return _objCType; +} + +- (void)getValue: (void *)value size: (size_t)size +{ + if (size != _size) + @throw [OFOutOfRangeException exception]; + + memcpy(value, _bytes, _size); +} +@end Index: src/OFCondition.h ================================================================== --- src/OFCondition.h +++ src/OFCondition.h @@ -48,11 +48,11 @@ * * @throw OFWaitForConditionFailedException Waiting for the condition failed */ - (void)wait; -#ifdef OF_AMIGAOS +#if defined(OF_AMIGAOS) || defined(DOXYGEN) /** * @brief Blocks the current thread until another thread calls @ref signal, * @ref broadcast or an Exec Signal is received. * * @note This is only available on AmigaOS! @@ -75,11 +75,11 @@ * @return Whether the condition has been signaled * @throw OFWaitForConditionFailedException Waiting for the condition failed */ - (bool)waitForTimeInterval: (OFTimeInterval)timeInterval; -#ifdef OF_AMIGAOS +#if defined(OF_AMIGAOS) || defined(DOXYGEN) /** * @brief Blocks the current thread until another thread calls @ref signal, * @ref broadcast, the timeout is reached or an Exec Signal is received. * * @note This is only available on AmigaOS! @@ -105,11 +105,11 @@ * @return Whether the condition has been signaled * @throw OFWaitForConditionFailedException Waiting for the condition failed */ - (bool)waitUntilDate: (OFDate *)date; -#ifdef OF_AMIGAOS +#if defined(OF_AMIGAOS) || defined(DOXYGEN) /** * @brief Blocks the current thread until another thread calls @ref signal, * @ref broadcast, the timeout is reached or an Exec Signal is received. * * @note This is only available on AmigaOS! Index: src/OFConstantString.h ================================================================== --- src/OFConstantString.h +++ src/OFConstantString.h @@ -11,14 +11,11 @@ * 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 - -#include "OFString.h" +#import "OFString.h" OF_ASSUME_NONNULL_BEGIN #if !defined(OF_CONSTANT_STRING_M) && \ defined(OF_APPLE_RUNTIME) && !defined(__OBJC2__) @@ -29,11 +26,10 @@ # ifdef __cplusplus } # endif #endif -#ifdef __OBJC__ /** * @class OFConstantString OFConstantString.h ObjFW/OFConstantString.h * * @brief A class for storing constant strings using the `@""` literal. */ @@ -42,10 +38,7 @@ { char *_cString; unsigned int _cStringLength; } @end -#endif OF_ASSUME_NONNULL_END - -#endif Index: src/OFConstantString.m ================================================================== --- src/OFConstantString.m +++ src/OFConstantString.m @@ -50,33 +50,11 @@ + (instancetype)alloc { OF_UNRECOGNIZED_SELECTOR } -- (instancetype)retain -{ - return self; -} - -- (instancetype)autorelease -{ - return self; -} - -- (unsigned int)retainCount -{ - return OFMaxRetainCount; -} - -- (void)release -{ -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} +OF_SINGLETON_METHODS @end @implementation OFConstantString + (void)load { @@ -133,33 +111,11 @@ + (instancetype)alloc { OF_UNRECOGNIZED_SELECTOR } -- (instancetype)retain -{ - return self; -} - -- (instancetype)autorelease -{ - return self; -} - -- (unsigned int)retainCount -{ - return OFMaxRetainCount; -} - -- (void)release -{ -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} +OF_SINGLETON_METHODS /* * In all following methods, the constant string is converted to an * OFConstantUTF8String and the message sent again. */ @@ -547,24 +503,10 @@ { [self finishInitialization]; return [self dataWithEncoding: encoding]; } -#ifdef OF_HAVE_UNICODE_TABLES -- (OFString *)decomposedStringWithCanonicalMapping -{ - [self finishInitialization]; - return self.decomposedStringWithCanonicalMapping; -} - -- (OFString *)decomposedStringWithCompatibilityMapping -{ - [self finishInitialization]; - return self.decomposedStringWithCompatibilityMapping; -} -#endif - #ifdef OF_WINDOWS - (OFString *)stringByExpandingWindowsEnvironmentStrings { [self finishInitialization]; return self.stringByExpandingWindowsEnvironmentStrings; DELETED src/OFCountedMapTableSet.h Index: src/OFCountedMapTableSet.h ================================================================== --- src/OFCountedMapTableSet.h +++ src/OFCountedMapTableSet.h @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFCountedSet.h" - -OF_ASSUME_NONNULL_BEGIN - -@class OFMapTable; - -@interface OFCountedMapTableSet: OFCountedSet -{ - OFMapTable *_mapTable; -} -@end - -OF_ASSUME_NONNULL_END DELETED src/OFCountedMapTableSet.m Index: src/OFCountedMapTableSet.m ================================================================== --- src/OFCountedMapTableSet.m +++ src/OFCountedMapTableSet.m @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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" - -#import "OFCountedMapTableSet.h" -#import "OFArray.h" -#import "OFMapTable.h" -#import "OFMutableMapTableSet.h" -#import "OFString.h" -#import "OFXMLAttribute.h" - -#import "OFInvalidArgumentException.h" -#import "OFInvalidFormatException.h" -#import "OFEnumerationMutationException.h" -#import "OFOutOfRangeException.h" - -@implementation OFCountedMapTableSet -+ (void)initialize -{ - if (self == [OFCountedMapTableSet class]) - [self inheritMethodsFromClass: [OFMutableMapTableSet class]]; -} - -- (instancetype)initWithSet: (OFSet *)set -{ - self = [self init]; - - @try { - void *pool = objc_autoreleasePoolPush(); - - if ([set isKindOfClass: [OFCountedSet class]]) { - OFCountedSet *countedSet = (OFCountedSet *)set; - - for (id object in countedSet) { - size_t count = - [countedSet countForObject: object]; - - for (size_t i = 0; i < count; i++) - [self addObject: object]; - } - } else - for (id object in set) - [self addObject: object]; - - objc_autoreleasePoolPop(pool); - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithArray: (OFArray *)array -{ - self = [self init]; - - @try { - id const *objects = array.objects; - size_t count = array.count; - - for (size_t i = 0; i < count; i++) - [self addObject: objects[i]]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithObjects: (id const *)objects count: (size_t)count -{ - self = [self init]; - - @try { - for (size_t i = 0; i < count; i++) - [self addObject: objects[i]]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments -{ - self = [self init]; - - @try { - id object; - - [self addObject: firstObject]; - - while ((object = va_arg(arguments, id)) != nil) - [self addObject: object]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (size_t)countForObject: (id)object -{ - return (size_t)(uintptr_t)[_mapTable objectForKey: object]; -} - -#ifdef OF_HAVE_BLOCKS -- (void)enumerateObjectsAndCountUsingBlock: (OFCountedSetEnumerationBlock)block -{ - @try { - [_mapTable enumerateKeysAndObjectsUsingBlock: - ^ (void *key, void *object, bool *stop) { - block(key, (size_t)(uintptr_t)object, stop); - }]; - } @catch (OFEnumerationMutationException *e) { - @throw [OFEnumerationMutationException - exceptionWithObject: self]; - } -} -#endif - -- (void)addObject: (id)object -{ - size_t count = (size_t)(uintptr_t)[_mapTable objectForKey: object]; - - if (SIZE_MAX - count < 1 || UINTPTR_MAX - count < 1) - @throw [OFOutOfRangeException exception]; - - [_mapTable setObject: (void *)(uintptr_t)(count + 1) forKey: object]; -} - -- (void)removeObject: (id)object -{ - size_t count = (size_t)(uintptr_t)[_mapTable objectForKey: object]; - - if (count == 0) - return; - - count--; - - if (count > 0) - [_mapTable setObject: (void *)(uintptr_t)count forKey: object]; - else - [_mapTable removeObjectForKey: object]; -} - -- (void)removeAllObjects -{ - [_mapTable removeAllObjects]; -} - -- (void)makeImmutable -{ -} -@end Index: src/OFCountedSet.m ================================================================== --- src/OFCountedSet.m +++ src/OFCountedSet.m @@ -16,87 +16,80 @@ #include "config.h" #include #import "OFCountedSet.h" -#import "OFCountedMapTableSet.h" +#import "OFConcreteCountedSet.h" #import "OFNumber.h" #import "OFString.h" static struct { Class isa; } placeholder; -@interface OFCountedSetPlaceholder: OFCountedSet +@interface OFPlaceholderCountedSet: OFCountedSet @end -@implementation OFCountedSetPlaceholder +@implementation OFPlaceholderCountedSet +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif - (instancetype)init { - return (id)[[OFCountedMapTableSet alloc] init]; + return (id)[[OFConcreteCountedSet alloc] init]; } - (instancetype)initWithSet: (OFSet *)set { - return (id)[[OFCountedMapTableSet alloc] initWithSet: set]; + return (id)[[OFConcreteCountedSet alloc] initWithSet: set]; } - (instancetype)initWithArray: (OFArray *)array { - return (id)[[OFCountedMapTableSet alloc] initWithArray: array]; + return (id)[[OFConcreteCountedSet alloc] initWithArray: array]; } - (instancetype)initWithObjects: (id)firstObject, ... { id ret; va_list arguments; va_start(arguments, firstObject); - ret = [[OFCountedMapTableSet alloc] initWithObject: firstObject + ret = [[OFConcreteCountedSet alloc] initWithObject: firstObject arguments: arguments]; va_end(arguments); return ret; } - (instancetype)initWithObjects: (id const *)objects count: (size_t)count { - return (id)[[OFCountedMapTableSet alloc] initWithObjects: objects + return (id)[[OFConcreteCountedSet alloc] initWithObjects: objects count: count]; } - (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments { - return (id)[[OFCountedMapTableSet alloc] initWithObject: firstObject + return (id)[[OFConcreteCountedSet alloc] initWithObject: firstObject arguments: arguments]; } - -- (instancetype)retain -{ - return self; -} - -- (instancetype)autorelease -{ - return self; -} - -- (void)release -{ -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + +OF_SINGLETON_METHODS @end @implementation OFCountedSet + (void)initialize { if (self == [OFCountedSet class]) - placeholder.isa = [OFCountedSetPlaceholder class]; + object_setClass((id)&placeholder, + [OFPlaceholderCountedSet class]); } + (instancetype)alloc { if (self == [OFCountedSet class]) @@ -103,26 +96,10 @@ return (id)&placeholder; return [super alloc]; } -- (instancetype)init -{ - if ([self isMemberOfClass: [OFCountedSet class]]) { - @try { - [self doesNotRecognizeSelector: _cmd]; - } @catch (id e) { - [self release]; - @throw e; - } - - abort(); - } - - return [super init]; -} - - (size_t)countForObject: (id)object { OF_UNRECOGNIZED_SELECTOR } Index: src/OFDNSResolverSettings.m ================================================================== --- src/OFDNSResolverSettings.m +++ src/OFDNSResolverSettings.m @@ -20,11 +20,14 @@ #import "OFDNSResolverSettings.h" #import "OFArray.h" #import "OFCharacterSet.h" #import "OFDate.h" #import "OFDictionary.h" -#import "OFFile.h" +#ifdef OF_HAVE_FILES +# import "OFFile.h" +# import "OFFileManager.h" +#endif #import "OFLocale.h" #import "OFSocket+Private.h" #import "OFString.h" #ifdef OF_WINDOWS # import "OFWindowsRegistryKey.h" @@ -50,24 +53,24 @@ # define id id_3ds # include <3ds.h> # undef id #endif +#if defined(OF_AMIGAOS_M68K) || defined(OF_AMIGAOS4) +# define Class IntuitionClass +# include +# undef Class +#endif #ifdef OF_MORPHOS # include # include # include #endif #if defined(OF_HAIKU) # define HOSTS_PATH @"/system/settings/network/hosts" # define RESOLV_CONF_PATH @"/system/settings/network/resolv.conf" -#elif defined(OF_AMIGAOS4) -# define HOSTS_PATH @"DEVS:Internet/hosts" -#elif defined(OF_AMIGAOS) -# define HOSTS_PATH @"AmiTCP:db/hosts" -# define RESOLV_CONF_PATH @"AmiTCP:db/resolv.conf" #else # define HOSTS_PATH @"/etc/hosts" # define RESOLV_CONF_PATH @"/etc/resolv.conf" #endif @@ -117,10 +120,21 @@ return [OFString stringWithCString: hostname encoding: [OFLocale encoding]]; } #endif + +#ifdef OF_AMIGAOS_M68K +static bool +assignExists(const char *assign) +{ + struct DosList *list = LockDosList(LDF_ASSIGNS | LDF_READ); + bool found = (FindDosEntry(list, assign, LDF_ASSIGNS) != NULL); + UnLockDosList(LDF_ASSIGNS | LDF_READ); + return found; +} +#endif #ifdef OF_MORPHOS static OFString * arexxCommand(const char *port, const char *command) { @@ -257,10 +271,12 @@ - (void)parseHosts: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFCharacterSet *whitespaceCharacterSet = [OFCharacterSet whitespaceCharacterSet]; + OFCharacterSet *commentCharacters = + [OFCharacterSet characterSetWithCharactersInString: @"#;"]; OFMutableDictionary *staticHosts; OFFile *file; OFString *line; @try { @@ -276,11 +292,11 @@ [file readLineWithEncoding: [OFLocale encoding]]) != nil) { OFArray *components, *hosts; size_t pos; OFString *address; - pos = [line rangeOfString: @"#"].location; + pos = [line indexOfCharacterFromSet: commentCharacters]; if (pos != OFNotFound) line = [line substringToIndex: pos]; components = [line componentsSeparatedByCharactersInSet: whitespaceCharacterSet @@ -314,11 +330,11 @@ _staticHosts = [staticHosts copy]; objc_autoreleasePoolPop(pool); } -# if !defined(OF_WINDOWS) && !defined(OF_AMIGAOS4) +# ifndef OF_WINDOWS - (void)parseResolvConfOption: (OFString *)option { @try { if ([option hasPrefix: @"ndots:"]) { unsigned long long number; @@ -393,11 +409,11 @@ if (components.count < 2) { objc_autoreleasePoolPop(pool2); continue; } - option = components.firstObject; + option = [components.firstObject lowercaseString]; arguments = [components objectsInRange: OFMakeRange(1, components.count - 1)]; if ([option isEqual: @"nameserver"]) { if (arguments.count != 1) { @@ -525,17 +541,26 @@ objc_autoreleasePoolPop(pool); } #endif -#ifdef OF_AMIGAOS4 -- (void)obtainAmigaOS4SystemConfig +#if defined(OF_AMIGAOS_M68K) || defined(OF_AMIGAOS4) +- (bool)obtainRoadshowSystemConfig { - OFMutableArray *nameServers = [OFMutableArray array]; - OFStringEncoding encoding = [OFLocale encoding]; - struct List *nameServerList = ObtainDomainNameServerList(); + OFMutableArray *nameServers; + OFStringEncoding encoding; + struct List *nameServerList; char buffer[MAXHOSTNAMELEN]; + LONG hasDNSAPI; + + if (SocketBaseTags(SBTM_GETREF(SBTC_HAVE_DNS_API), (ULONG)&hasDNSAPI, + TAG_END) != 0 || !hasDNSAPI) + return false; + + nameServers = [OFMutableArray array]; + encoding = [OFLocale encoding]; + nameServerList = ObtainDomainNameServerList(); if (nameServerList == NULL) @throw [OFOutOfMemoryException exception]; @try { @@ -565,10 +590,12 @@ } if (GetDefaultDomainName(buffer, sizeof(buffer))) _localDomain = [[OFString alloc] initWithCString: buffer encoding: encoding]; + + return true; } #endif #ifdef OF_NINTENDO_3DS - (void)obtainNintendo3DSSytemConfig @@ -616,10 +643,13 @@ - (void)reload { #ifdef OF_WINDOWS OFString *path = nil; #endif +#if (defined(OF_AMIGAOS_M68K) || defined(OF_AMIGAOS4)) && defined(OF_HAVE_FILES) + OFFileManager *fileManager = [OFFileManager defaultManager]; +#endif void *pool; /* * TODO: Rather than reparsing every time, check what actually changed * (mtime) and only reset those. @@ -657,13 +687,29 @@ # endif [self obtainWindowsSystemConfig]; #elif defined(OF_MORPHOS) [self obtainMorphOSSystemConfig]; -#elif defined(OF_AMIGAOS4) - [self parseHosts: HOSTS_PATH]; - [self obtainAmigaOS4SystemConfig]; +#elif defined(OF_AMIGAOS_M68K) || defined(OF_AMIGAOS4) +# ifdef OF_HAVE_FILES + if (![self obtainRoadshowSystemConfig]) { + if (assignExists("AmiTCP")) + /* + * FIXME: The installer puts it there, but theoretically + * it could also be in AmiTCP:db/netdb or any of + * the files included there. + */ + [self parseResolvConf: @"AmiTCP:db/netdb-myhost"]; + } + + if ([fileManager fileExistsAtPath: @"DEVS:Internet/hosts"]) + [self parseHosts: @"DEVS:Internet/hosts"]; + else if (assignExists("AmiTCP")) + [self parseHosts: @"AmiTCP:db/hosts"]; +# else + [self obtainRoadshowSystemConfig]; +# endif #elif defined(OF_NINTENDO_3DS) [self obtainNintendo3DSSytemConfig]; #elif defined(OF_HAVE_FILES) [self parseHosts: HOSTS_PATH]; [self parseResolvConf: RESOLV_CONF_PATH]; Index: src/OFData+CryptographicHashing.m ================================================================== --- src/OFData+CryptographicHashing.m +++ src/OFData+CryptographicHashing.m @@ -37,12 +37,12 @@ [class hashWithAllowsSwappableMemory: true]; size_t digestSize = [class digestSize]; const unsigned char *digest; char cString[digestSize * 2]; - [hash updateWithBuffer: self->_items - length: self->_count * self->_itemSize]; + [hash updateWithBuffer: self.items + length: self.count * self.itemSize]; [hash calculate]; digest = hash.digest; for (size_t i = 0; i < digestSize; i++) { uint8_t high, low; Index: src/OFData.h ================================================================== --- src/OFData.h +++ src/OFData.h @@ -38,19 +38,10 @@ * * @brief A class for storing arbitrary data in an array. */ @interface OFData: OFObject -{ - unsigned char *_Nullable _items; - size_t _count, _itemSize; - bool _freeWhenDone; -@private - OFData *_Nullable _parentData; - OF_RESERVE_IVARS(OFData, 4) -} - /** * @brief The size of a single item in the OFData in bytes. */ @property (readonly, nonatomic) size_t itemSize; @@ -90,10 +81,25 @@ /** * @brief A string containing the data in Base64 encoding. */ @property (readonly, nonatomic) OFString *stringByBase64Encoding; +/** + * @brief Creates a new OFData that is empty with an item size of 1. + * + * @return A new autoreleased OFData + */ ++ (instancetype)data; + +/** + * @brief Creates a new OFData that is empty with the specified item size. + * + * @param itemSize The size of a single element in the OFData + * @return A new autoreleased OFData + */ ++ (instancetype)dataWithItemSize: (size_t)itemSize; + /** * @brief Creates a new OFData with the specified `count` items of size 1. * * @param items The items to store in the OFData * @param count The number of items @@ -190,10 +196,27 @@ * @throw OFInvalidFormatException The specified string is not correctly * formatted */ + (instancetype)dataWithBase64EncodedString: (OFString *)string; +/** + * @brief Initializes an already allocated OFData to be empty with an item size + * of 1. + * + * @return An initialized OFData + */ +- (instancetype)init; + +/** + * @brief Initializes an already allocated OFData to be empty with the + * specified item size. + * + * @param itemSize The size of a single element in the OFData + * @return An initialized OFData + */ +- (instancetype)initWithItemSize: (size_t)itemSize; + /** * @brief Initializes an already allocated OFData with the specified `count` * items of size 1. * * @param items The items to store in the OFData Index: src/OFData.m ================================================================== --- src/OFData.m +++ src/OFData.m @@ -19,39 +19,141 @@ #include #include #import "OFData.h" #import "OFBase64.h" +#import "OFConcreteData.h" #import "OFDictionary.h" #ifdef OF_HAVE_FILES # import "OFFile.h" # import "OFFileManager.h" #endif #import "OFIRI.h" #import "OFIRIHandler.h" #import "OFStream.h" #import "OFString.h" +#import "OFSubdata.h" #import "OFSystemInfo.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFNotImplementedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFTruncatedDataException.h" #import "OFUnsupportedProtocolException.h" + +static struct { + Class isa; +} placeholder; + +@interface OFPlaceholderData: OFString +@end /* References for static linking */ void _references_to_categories_of_OFData(void) { _OFData_CryptographicHashing_reference = 1; _OFData_MessagePackParsing_reference = 1; } + +@implementation OFPlaceholderData +- (instancetype)init +{ + return (id)[[OFConcreteData alloc] init]; +} + +- (instancetype)initWithItemSize: (size_t)itemSize +{ + return (id)[[OFConcreteData alloc] initWithItemSize: itemSize]; +} + +- (instancetype)initWithItems: (const void *)items count: (size_t)count +{ + return (id)[[OFConcreteData alloc] initWithItems: items count: count]; +} + +- (instancetype)initWithItems: (const void *)items + count: (size_t)count + itemSize: (size_t)itemSize +{ + return (id)[[OFConcreteData alloc] initWithItems: items + count: count + itemSize: itemSize]; +} + +- (instancetype)initWithItemsNoCopy: (void *)items + count: (size_t)count + freeWhenDone: (bool)freeWhenDone +{ + return (id)[[OFConcreteData alloc] initWithItemsNoCopy: items + count: count + freeWhenDone: freeWhenDone]; +} + +- (instancetype)initWithItemsNoCopy: (void *)items + count: (size_t)count + itemSize: (size_t)itemSize + freeWhenDone: (bool)freeWhenDone +{ + return (id)[[OFConcreteData alloc] initWithItemsNoCopy: items + count: count + itemSize: itemSize + freeWhenDone: freeWhenDone]; +} + +#ifdef OF_HAVE_FILES +- (instancetype)initWithContentsOfFile: (OFString *)path +{ + return (id)[[OFConcreteData alloc] initWithContentsOfFile: path]; +} +#endif + +- (instancetype)initWithContentsOfIRI: (OFIRI *)IRI +{ + return (id)[[OFConcreteData alloc] initWithContentsOfIRI: IRI]; +} + +- (instancetype)initWithStringRepresentation: (OFString *)string +{ + return (id)[[OFConcreteData alloc] + initWithStringRepresentation: string]; +} + +- (instancetype)initWithBase64EncodedString: (OFString *)string +{ + return (id)[[OFConcreteData alloc] initWithBase64EncodedString: string]; +} + +OF_SINGLETON_METHODS +@end @implementation OFData -@synthesize itemSize = _itemSize; ++ (void)initialize +{ + if (self == [OFData class]) + object_setClass((id)&placeholder, [OFPlaceholderData class]); +} + ++ (instancetype)alloc +{ + if (self == [OFData class]) + return (id)&placeholder; + + return [super alloc]; +} + ++ (instancetype)data +{ + return [[[self alloc] init] autorelease]; +} + ++ (instancetype)dataWithItemSize: (size_t)itemSize +{ + return [[[self alloc] initWithItemSize: itemSize] autorelease]; +} + (instancetype)dataWithItems: (const void *)items count: (size_t)count { return [[[self alloc] initWithItems: items count: count] autorelease]; } @@ -105,10 +207,32 @@ + (instancetype)dataWithBase64EncodedString: (OFString *)string { return [[[self alloc] initWithBase64EncodedString: string] autorelease]; } + +- (instancetype)init +{ + if ([self isMemberOfClass: [OFData class]] || + [self isMemberOfClass: [OFMutableData class]]) { + @try { + [self doesNotRecognizeSelector: _cmd]; + } @catch (id e) { + [self release]; + @throw e; + } + + abort(); + } + + return [super init]; +} + +- (instancetype)initWithItemSize: (size_t)itemSize +{ + OF_INVALID_INIT_METHOD +} - (instancetype)initWithItems: (const void *)items count: (size_t)count { return [self initWithItems: items count: count itemSize: 1]; } @@ -115,28 +239,11 @@ - (instancetype)initWithItems: (const void *)items count: (size_t)count itemSize: (size_t)itemSize { - self = [super init]; - - @try { - if (itemSize == 0) - @throw [OFInvalidArgumentException exception]; - - _items = OFAllocMemory(count, itemSize); - _count = count; - _itemSize = itemSize; - _freeWhenDone = true; - - memcpy(_items, items, count * itemSize); - } @catch (id e) { - [self release]; - @throw e; - } - - return self; + OF_INVALID_INIT_METHOD } - (instancetype)initWithItemsNoCopy: (void *)items count: (size_t)count freeWhenDone: (bool)freeWhenDone @@ -150,131 +257,96 @@ - (instancetype)initWithItemsNoCopy: (void *)items count: (size_t)count itemSize: (size_t)itemSize freeWhenDone: (bool)freeWhenDone { - self = [super init]; - - @try { - if (itemSize == 0) - @throw [OFInvalidArgumentException exception]; - - _items = (unsigned char *)items; - _count = count; - _itemSize = itemSize; - _freeWhenDone = freeWhenDone; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; + OF_INVALID_INIT_METHOD } #ifdef OF_HAVE_FILES - (instancetype)initWithContentsOfFile: (OFString *)path { - char *buffer = NULL; - OFStreamOffset fileSize; - - @try { - void *pool = objc_autoreleasePoolPush(); - OFFile *file = [OFFile fileWithPath: path mode: @"r"]; - fileSize = [file seekToOffset: 0 whence: OFSeekEnd]; - - if (fileSize < 0 || (unsigned long long)fileSize > SIZE_MAX) - @throw [OFOutOfRangeException exception]; - - [file seekToOffset: 0 whence: OFSeekSet]; - - buffer = OFAllocMemory((size_t)fileSize, 1); - [file readIntoBuffer: buffer exactLength: (size_t)fileSize]; - - objc_autoreleasePoolPop(pool); - } @catch (id e) { - OFFreeMemory(buffer); - [self release]; - - @throw e; - } - - @try { - self = [self initWithItemsNoCopy: buffer - count: (size_t)fileSize - freeWhenDone: true]; - } @catch (id e) { - OFFreeMemory(buffer); - @throw e; - } + void *pool = objc_autoreleasePoolPush(); + OFIRI *IRI; + + @try { + IRI = [OFIRI fileIRIWithPath: path]; + } @catch (id e) { + [self release]; + @throw e; + } + + self = [self initWithContentsOfIRI: IRI]; + + objc_autoreleasePoolPop(pool); return self; } #endif - (instancetype)initWithContentsOfIRI: (OFIRI *)IRI { - self = [super init]; + char *items = NULL, *buffer = NULL; + size_t count = 0; @try { void *pool = objc_autoreleasePoolPush(); OFStream *stream = [OFIRIHandler openItemAtIRI: IRI mode: @"r"]; size_t pageSize; - unsigned char *buffer; - - _count = 0; - _itemSize = 1; - _freeWhenDone = true; pageSize = [OFSystemInfo pageSize]; buffer = OFAllocMemory(1, pageSize); - @try { - while (!stream.atEndOfStream) { - size_t length = [stream - readIntoBuffer: buffer - length: pageSize]; - - if (SIZE_MAX - _count < length) - @throw [OFOutOfRangeException - exception]; - - _items = OFResizeMemory(_items, - _count + length, 1); - memcpy(_items + _count, buffer, length); - _count += length; - } - } @finally { - OFFreeMemory(buffer); + while (!stream.atEndOfStream) { + size_t length = [stream readIntoBuffer: buffer + length: pageSize]; + + if (SIZE_MAX - count < length) + @throw [OFOutOfRangeException exception]; + + items = OFResizeMemory(items, count + length, 1); + memcpy(items + count, buffer, length); + count += length; } objc_autoreleasePoolPop(pool); } @catch (id e) { + OFFreeMemory(buffer); + OFFreeMemory(items); [self release]; + + @throw e; + } + + @try { + self = [self initWithItemsNoCopy: items + count: count + freeWhenDone: true]; + } @catch (id e) { + OFFreeMemory(items); @throw e; } return self; } - (instancetype)initWithStringRepresentation: (OFString *)string { - self = [super init]; + char *items = NULL; + size_t count = 0; @try { - size_t count = [string - cStringLengthWithEncoding: OFStringEncodingASCII]; const char *cString; + count = [string + cStringLengthWithEncoding: OFStringEncodingASCII]; + if (count % 2 != 0) @throw [OFInvalidFormatException exception]; count /= 2; - - _items = OFAllocMemory(count, 1); - _count = count; - _itemSize = 1; - _freeWhenDone = true; + items = OFAllocMemory(count, 1); cString = [string cStringWithEncoding: OFStringEncodingASCII]; for (size_t i = 0; i < count; i++) { uint8_t c1 = cString[2 * i]; @@ -297,142 +369,180 @@ else if (c2 >= 'A' && c2 <= 'F') byte |= c2 - 'A' + 10; else @throw [OFInvalidFormatException exception]; - _items[i] = byte; + items[i] = byte; } } @catch (id e) { + OFFreeMemory(items); [self release]; + + @throw e; + } + + @try { + self = [self initWithItemsNoCopy: items + count: count + freeWhenDone: true]; + } @catch (id e) { + OFFreeMemory(items); @throw e; } return self; } - (instancetype)initWithBase64EncodedString: (OFString *)string { - bool mutable = [self isKindOfClass: [OFMutableData class]]; - - if (!mutable) { - [self release]; - self = [OFMutableData alloc]; - } - - self = [(OFMutableData *)self initWithCapacity: string.length / 3]; + void *pool = objc_autoreleasePoolPush(); + OFMutableData *data; @try { - if (!OFBase64Decode((OFMutableData *)self, + data = [OFMutableData data]; + + if (!OFBase64Decode(data, [string cStringWithEncoding: OFStringEncodingASCII], [string cStringLengthWithEncoding: OFStringEncodingASCII])) @throw [OFInvalidFormatException exception]; } @catch (id e) { [self release]; @throw e; } - if (!mutable) - [(OFMutableData *)self makeImmutable]; + /* Avoid copying if the class already matches. */ + if (data.class == self.class) { + [self release]; + self = [data retain]; + objc_autoreleasePoolPop(pool); + return self; + } + + /* + * Make it immutable and avoid copying if the class already matches + * after that. + */ + @try { + [data makeImmutable]; + } @catch (id e) { + [self release]; + @throw e; + } + + if (data.class == self.class) { + [self release]; + self = [data retain]; + objc_autoreleasePoolPop(pool); + return self; + } + + self = [self initWithItems: data.items count: data.count]; + + objc_autoreleasePoolPop(pool); return self; } -- (void)dealloc -{ - if (_freeWhenDone) - OFFreeMemory(_items); - - [_parentData release]; - - [super dealloc]; -} - - (size_t)count { - return _count; + OF_UNRECOGNIZED_SELECTOR +} + +- (size_t)itemSize +{ + OF_UNRECOGNIZED_SELECTOR } - (const void *)items { - return _items; + OF_UNRECOGNIZED_SELECTOR } - (const void *)itemAtIndex: (size_t)idx { - if (idx >= _count) + if (idx >= self.count) @throw [OFOutOfRangeException exception]; - return _items + idx * _itemSize; + return (const unsigned char *)self.items + idx * self.itemSize; } - (const void *)firstItem { - if (_items == NULL || _count == 0) + const void *items = self.items; + + if (items == NULL || self.count == 0) return NULL; - return _items; + return items; } - (const void *)lastItem { - if (_items == NULL || _count == 0) + const unsigned char *items = self.items; + size_t count = self.count; + + if (items == NULL || count == 0) return NULL; - return _items + (_count - 1) * _itemSize; + return items + (count - 1) * self.itemSize; } - (id)copy { return [self retain]; } - (id)mutableCopy { - return [[OFMutableData alloc] initWithItems: _items - count: _count - itemSize: _itemSize]; + return [[OFMutableData alloc] initWithItems: self.items + count: self.count + itemSize: self.itemSize]; } - (bool)isEqual: (id)object { + size_t count, itemSize; OFData *data; if (object == self) return true; if (![object isKindOfClass: [OFData class]]) return false; + count = self.count; + itemSize = self.itemSize; data = object; - if (data.count != _count || data.itemSize != _itemSize) + if (data.count != count || data.itemSize != itemSize) return false; - if (memcmp(data.items, _items, _count * _itemSize) != 0) + if (memcmp(data.items, self.items, count * itemSize) != 0) return false; return true; } - (OFComparisonResult)compare: (OFData *)data { int comparison; - size_t count, minCount; + size_t count, dataCount, minCount; if (![data isKindOfClass: [OFData class]]) @throw [OFInvalidArgumentException exception]; - if (data.itemSize != _itemSize) + if (data.itemSize != self.itemSize) @throw [OFInvalidArgumentException exception]; - count = data.count; - minCount = (_count > count ? count : _count); + count = self.count; + dataCount = data.count; + minCount = (count > dataCount ? dataCount : count); - if ((comparison = memcmp(_items, data.items, - minCount * _itemSize)) == 0) { - if (_count > count) + if ((comparison = memcmp(self.items, data.items, + minCount * self.itemSize)) == 0) { + if (count > dataCount) return OFOrderedDescending; - if (_count < count) + if (count < dataCount) return OFOrderedAscending; return OFOrderedSame; } @@ -442,49 +552,52 @@ return OFOrderedAscending; } - (unsigned long)hash { + const unsigned char *items = self.items; + size_t count = self.count, itemSize = self.itemSize; unsigned long hash; OFHashInit(&hash); - for (size_t i = 0; i < _count * _itemSize; i++) - OFHashAddByte(&hash, ((uint8_t *)_items)[i]); + for (size_t i = 0; i < count * itemSize; i++) + OFHashAddByte(&hash, items[i]); OFHashFinalize(&hash); return hash; } - (OFData *)subdataWithRange: (OFRange)range { - OFData *ret; - if (range.length > SIZE_MAX - range.location || - range.location + range.length > _count) + range.location + range.length > self.count) @throw [OFOutOfRangeException exception]; - ret = [OFData dataWithItemsNoCopy: _items + (range.location * _itemSize) - count: range.length - itemSize: _itemSize - freeWhenDone: false]; - ret->_parentData = [(_parentData != nil ? _parentData : self) copy]; + if (![self isKindOfClass: [OFMutableData class]]) + return [[[OFSubdata alloc] initWithData: self + range: range] autorelease]; - return ret; + return [OFData dataWithItems: (const unsigned char *)self.items + + (range.location * self.itemSize) + count: self.count + itemSize: self.itemSize]; } - (OFString *)description { OFMutableString *ret = [OFMutableString stringWithString: @"<"]; + const unsigned char *items = self.items; + size_t count = self.count, itemSize = self.itemSize; - for (size_t i = 0; i < _count; i++) { + for (size_t i = 0; i < count; i++) { if (i > 0) [ret appendString: @" "]; - for (size_t j = 0; j < _itemSize; j++) - [ret appendFormat: @"%02x", _items[i * _itemSize + j]]; + for (size_t j = 0; j < itemSize; j++) + [ret appendFormat: @"%02x", items[i * itemSize + j]]; } [ret appendString: @">"]; [ret makeImmutable]; @@ -492,36 +605,40 @@ } - (OFString *)stringRepresentation { OFMutableString *ret = [OFMutableString string]; + const unsigned char *items = self.items; + size_t count = self.count, itemSize = self.itemSize; - for (size_t i = 0; i < _count; i++) - for (size_t j = 0; j < _itemSize; j++) - [ret appendFormat: @"%02x", _items[i * _itemSize + j]]; + for (size_t i = 0; i < count; i++) + for (size_t j = 0; j < itemSize; j++) + [ret appendFormat: @"%02x", items[i * itemSize + j]]; [ret makeImmutable]; return ret; } - (OFString *)stringByBase64Encoding { - return OFBase64Encode(_items, _count * _itemSize); + return OFBase64Encode(self.items, self.count * self.itemSize); } - (OFRange)rangeOfData: (OFData *)data options: (OFDataSearchOptions)options range: (OFRange)range { + const unsigned char *items = self.items; + size_t count = self.count, itemSize = self.itemSize; const char *search; size_t searchLength; if (range.length > SIZE_MAX - range.location || - range.location + range.length > _count) + range.location + range.length > count) @throw [OFOutOfRangeException exception]; - if (data == nil || data.itemSize != _itemSize) + if (data == nil || data.itemSize != itemSize) @throw [OFInvalidArgumentException exception]; if ((searchLength = data.count) == 0) return OFMakeRange(0, 0); @@ -530,23 +647,23 @@ search = data.items; if (options & OFDataSearchBackwards) { for (size_t i = range.length - searchLength;; i--) { - if (memcmp(_items + i * _itemSize, search, - searchLength * _itemSize) == 0) + if (memcmp(items + i * itemSize, search, + searchLength * itemSize) == 0) return OFMakeRange(i, searchLength); /* No match and we're at the last item */ if (i == 0) break; } } else { for (size_t i = range.location; i <= range.length - searchLength; i++) - if (memcmp(_items + i * _itemSize, search, - searchLength * _itemSize) == 0) + if (memcmp(items + i * itemSize, search, + searchLength * itemSize) == 0) return OFMakeRange(i, searchLength); } return OFMakeRange(OFNotFound, 0); } @@ -554,11 +671,12 @@ #ifdef OF_HAVE_FILES - (void)writeToFile: (OFString *)path { OFFile *file = [[OFFile alloc] initWithPath: path mode: @"w"]; @try { - [file writeBuffer: _items length: _count * _itemSize]; + [file writeBuffer: self.items + length: self.count * self.itemSize]; } @finally { [file release]; } } #endif @@ -573,40 +691,43 @@ } - (OFData *)messagePackRepresentation { OFMutableData *data; + size_t count; - if (_itemSize != 1) + if (self.itemSize != 1) @throw [OFNotImplementedException exceptionWithSelector: _cmd object: self]; - if (_count <= UINT8_MAX) { + count = self.count; + + if (count <= UINT8_MAX) { uint8_t type = 0xC4; - uint8_t tmp = (uint8_t)_count; + uint8_t tmp = (uint8_t)count; - data = [OFMutableData dataWithCapacity: _count + 2]; + data = [OFMutableData dataWithCapacity: count + 2]; [data addItem: &type]; [data addItem: &tmp]; - } else if (_count <= UINT16_MAX) { + } else if (count <= UINT16_MAX) { uint8_t type = 0xC5; - uint16_t tmp = OFToBigEndian16((uint16_t)_count); + uint16_t tmp = OFToBigEndian16((uint16_t)count); - data = [OFMutableData dataWithCapacity: _count + 3]; + data = [OFMutableData dataWithCapacity: count + 3]; [data addItem: &type]; [data addItems: &tmp count: sizeof(tmp)]; - } else if (_count <= UINT32_MAX) { + } else if (count <= UINT32_MAX) { uint8_t type = 0xC6; - uint32_t tmp = OFToBigEndian32((uint32_t)_count); + uint32_t tmp = OFToBigEndian32((uint32_t)count); - data = [OFMutableData dataWithCapacity: _count + 5]; + data = [OFMutableData dataWithCapacity: count + 5]; [data addItem: &type]; [data addItems: &tmp count: sizeof(tmp)]; } else @throw [OFOutOfRangeException exception]; - [data addItems: _items count: _count]; + [data addItems: self.items count: count]; [data makeImmutable]; return data; } @end Index: src/OFDatagramSocket.h ================================================================== --- src/OFDatagramSocket.h +++ src/OFDatagramSocket.h @@ -103,10 +103,14 @@ */ @interface OFDatagramSocket: OFObject { OFSocketHandle _socket; +#ifdef OF_AMIGAOS + LONG _socketID; + int _family; /* unused, reserved for ABI stability */ +#endif bool _canBlock; #ifdef OF_WII bool _canSendToBroadcastAddresses; #endif id _Nullable _delegate; @@ -116,17 +120,19 @@ /** * @brief Whether the socket can block. * * By default, a socket can block. * + * @throw OFGetOptionFailedException The option could not be retrieved * @throw OFSetOptionFailedException The option could not be set */ @property (nonatomic) bool canBlock; /** * @brief Whether the socket can send to broadcast addresses. * + * @throw OFGetOptionFailedException The option could not be retrieved * @throw OFSetOptionFailedException The option could not be set */ @property (nonatomic) bool canSendToBroadcastAddresses; /** @@ -295,10 +301,34 @@ receiver: (const OFSocketAddress *)receiver runLoopMode: (OFRunLoopMode)runLoopMode block: (OFDatagramSocketAsyncSendDataBlock)block; #endif +/** + * @brief Releases the socket from the current thread. + * + * This is necessary on some platforms in order to allow a different thread to + * use the socket, e.g. on AmigaOS, but you should call it on all operating + * systems before using the socket from a different thread. + * + * After calling this method, you must no longer use the socket until + * @ref obtainSocketForCurrentThread has been called. + */ +- (void)releaseSocketFromCurrentThread; + +/** + * @brief Obtains the socket for the current thread. + * + * This is necessary on some platforms in order to allow a different thread to + * use the socket, e.g. on AmigaOS, but you should call it on all operating + * systems before using the socket from a different thread. + * + * You must only call this method after @ref releaseSocketFromCurrentThread has + * been called from a different thread. + */ +- (void)obtainSocketForCurrentThread; + /** * @brief Cancels all pending asynchronous requests on the socket. */ - (void)cancelAsyncRequests; Index: src/OFDatagramSocket.m ================================================================== --- src/OFDatagramSocket.m +++ src/OFDatagramSocket.m @@ -31,18 +31,24 @@ #import "OFRunLoop.h" #import "OFRunLoop+Private.h" #import "OFSocket.h" #import "OFSocket+Private.h" +#import "OFAlreadyOpenException.h" #import "OFGetOptionFailedException.h" #import "OFInitializationFailedException.h" #import "OFNotOpenException.h" +#import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFSetOptionFailedException.h" #import "OFSetOptionFailedException.h" #import "OFWriteFailedException.h" + +#if defined(OF_AMIGAOS) && !defined(UNIQUE_ID) +# define UNIQUE_ID -1 +#endif @implementation OFDatagramSocket @synthesize delegate = _delegate; + (void)initialize @@ -69,10 +75,13 @@ [self doesNotRecognizeSelector: _cmd]; abort(); } _socket = OFInvalidSocketHandle; +#ifdef OF_HAVE_AMIGAOS + _socketID = -1; +#endif _canBlock = true; } @catch (id e) { [self release]; @throw e; } @@ -196,38 +205,43 @@ requestedLength: length errNo: OFSocketErrNo()]; #endif if (sender != NULL) { - switch (((struct sockaddr *)&sender->sockaddr)->sa_family) { - case AF_INET: - sender->family = OFSocketAddressFamilyIPv4; - break; + struct sockaddr *sa = (struct sockaddr *)&sender->sockaddr; + + if (sender->length >= (socklen_t)sizeof(sa->sa_family)) { + switch (sa->sa_family) { + case AF_INET: + sender->family = OFSocketAddressFamilyIPv4; + break; #ifdef OF_HAVE_IPV6 - case AF_INET6: - sender->family = OFSocketAddressFamilyIPv6; - break; + case AF_INET6: + sender->family = OFSocketAddressFamilyIPv6; + break; #endif #ifdef OF_HAVE_UNIX_SOCKETS - case AF_UNIX: - sender->family = OFSocketAddressFamilyUNIX; - break; + case AF_UNIX: + sender->family = OFSocketAddressFamilyUNIX; + break; #endif #ifdef OF_HAVE_IPX - case AF_IPX: - sender->family = OFSocketAddressFamilyIPX; - break; + case AF_IPX: + sender->family = OFSocketAddressFamilyIPX; + break; #endif #ifdef OF_HAVE_APPLETALK - case AF_APPLETALK: - sender->family = OFSocketAddressFamilyAppleTalk; - break; + case AF_APPLETALK: + sender->family = OFSocketAddressFamilyAppleTalk; + break; #endif - default: + default: + sender->family = OFSocketAddressFamilyUnknown; + break; + } + } else sender->family = OFSocketAddressFamilyUnknown; - break; - } } return ret; } @@ -399,10 +413,55 @@ @throw [OFOutOfRangeException exception]; return (int)_socket; #endif } + +- (void)releaseSocketFromCurrentThread +{ +#ifdef OF_AMIGAOS + if (_socket == OFInvalidSocketHandle) + @throw [OFNotOpenException exceptionWithObject: self]; + + if ((_socketID = ReleaseSocket(_socket, UNIQUE_ID)) == -1) { + switch (Errno()) { + case ENOMEM: + @throw [OFOutOfMemoryException + exceptionWithRequestedSize: 0]; + case EBADF: + @throw [OFNotOpenException exceptionWithObject: self]; + default: + OFEnsure(0); + } + } + + _socket = OFInvalidSocketHandle; +#endif +} + +- (void)obtainSocketForCurrentThread +{ +#ifdef OF_AMIGAOS + if (_socket != OFInvalidSocketHandle) + @throw [OFAlreadyOpenException exceptionWithObject: self]; + + if (_socketID == -1) + @throw [OFNotOpenException exceptionWithObject: self]; + + /* + * FIXME: We should store these, but that requires changing all + * subclasses. This only becomes a problem if IPv6 support ever + * gets added. + */ + _socket = ObtainSocket(_socketID, AF_INET, SOCK_DGRAM, 0); + if (_socket == OFInvalidSocketHandle) + @throw [OFInitializationFailedException + exceptionWithClass: self.class]; + + _socketID = -1; +#endif +} - (void)close { if (_socket == OFInvalidSocketHandle) @throw [OFNotOpenException exceptionWithObject: self]; Index: src/OFDate.h ================================================================== --- src/OFDate.h +++ src/OFDate.h @@ -24,19 +24,12 @@ /** * @class OFDate OFDate.h ObjFW/OFDate.h * * @brief A class for storing, accessing and comparing dates. */ -#ifndef OF_DATE_M -OF_SUBCLASSING_RESTRICTED -#endif @interface OFDate: OFObject -{ - OFTimeInterval _seconds; -} - #ifdef OF_HAVE_CLASS_PROPERTIES @property (class, readonly, nonatomic) OFDate *distantFuture; @property (class, readonly, nonatomic) OFDate *distantPast; #endif @@ -280,10 +273,14 @@ /** * @brief Creates a string of the date with the specified format. * * See the man page for `strftime` for information on the format. + * + * @warning The format is currently limited to the following format specifiers: + * %%a, %%b, %%d, %%e, %%H, %%m, %%M, %%S, %%y, %%Y, %%z, %%, %%n and + * %%t. * * @param format The format for the date string * @return A new, autoreleased OFString * @throw OFInvalidFormatException The specified format is invalid */ @@ -291,10 +288,14 @@ /** * @brief Creates a string of the local date with the specified format. * * See the man page for `strftime` for information on the format. + * + * @warning The format is currently limited to the following format specifiers: + * %%a, %%b, %%d, %%e, %%H, %%m, %%M, %%S, %%y, %%Y, %%z, %%, %%n and + * %%t. * * @param format The format for the date string * @return A new, autoreleased OFString * @throw OFInvalidFormatException The specified format is invalid */ Index: src/OFDate.m ================================================================== --- src/OFDate.m +++ src/OFDate.m @@ -22,19 +22,22 @@ #include #include #import "OFDate.h" +#import "OFConcreteDate.h" #import "OFData.h" #import "OFDictionary.h" #import "OFMessagePackExtension.h" #ifdef OF_HAVE_THREADS # import "OFMutex.h" #endif +#import "OFStrFTime.h" #import "OFStrPTime.h" #import "OFString.h" #import "OFSystemInfo.h" +#import "OFTaggedPointerDate.h" #import "OFXMLAttribute.h" #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" @@ -44,51 +47,40 @@ #if defined(OF_AMIGAOS_M68K) || defined(OF_MINT) /* amiga-gcc and freemint-gcc do not have trunc() */ # define trunc(x) ((int64_t)(x)) #endif -@interface OFDate () -+ (instancetype)of_alloc; +@interface OFPlaceholderDate: OFDate @end -@interface OFDateSingleton: OFDate -@end - -@interface OFDatePlaceholder: OFDateSingleton -@end - -#if defined(OF_OBJFW_RUNTIME) && UINTPTR_MAX == UINT64_MAX -@interface OFTaggedPointerDate: OFDateSingleton -@end -#endif +@interface OFConcreteDateSingleton: OFConcreteDate +@end static struct { Class isa; } placeholder; -static OFDateSingleton *zeroDate, *distantFuture, *distantPast; -#if defined(OF_OBJFW_RUNTIME) && UINTPTR_MAX == UINT64_MAX -static int dateTag; -#endif +static OFConcreteDateSingleton *zeroDate, *distantFuture, *distantPast; static void initZeroDate(void) { - zeroDate = [[OFDateSingleton alloc] initWithTimeIntervalSince1970: 0]; + zeroDate = [[OFConcreteDateSingleton alloc] + initWithTimeIntervalSince1970: 0]; } static void initDistantFuture(void) { - distantFuture = [[OFDateSingleton alloc] + distantFuture = [[OFConcreteDateSingleton alloc] initWithTimeIntervalSince1970: 64060588800.0]; } static void initDistantPast(void) { - distantPast = [[OFDateSingleton alloc] + distantPast = [[OFConcreteDateSingleton alloc] initWithTimeIntervalSince1970: -62167219200.0]; } static OFTimeInterval now(void) @@ -257,32 +249,15 @@ seconds += -(double)tz * 60; return seconds; } -@implementation OFDateSingleton -- (instancetype)autorelease -{ - return self; -} - -- (instancetype)retain -{ - return self; -} - -- (void)release -{ -} - -- (unsigned int)retainCount -{ - return OFMaxRetainCount; -} +@implementation OFConcreteDateSingleton +OF_SINGLETON_METHODS @end -@implementation OFDatePlaceholder +@implementation OFPlaceholderDate #ifdef __clang__ /* We intentionally don't call into super, so silence the warning. */ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wunknown-pragmas" # pragma clang diagnostic ignored "-Wobjc-designated-initializers" @@ -303,38 +278,28 @@ value = OFFromBigEndian64(OFDoubleToRawUInt64(OFToBigEndianDouble( seconds))); /* Almost all dates fall into this range. */ if (value & (UINT64_C(4) << 60)) { - id ret = objc_createTaggedPointer(dateTag, - value & ~(UINT64_C(4) << 60)); + id ret = [OFTaggedPointerDate + dateWithUInt64TimeIntervalSince1970: value]; if (ret != nil) return ret; } #endif - return (id)[[OFDate of_alloc] initWithTimeIntervalSince1970: seconds]; + return (id)[[OFConcreteDate alloc] + initWithTimeIntervalSince1970: seconds]; } #ifdef __clang__ # pragma clang diagnostic pop #endif -@end - -#if defined(OF_OBJFW_RUNTIME) && UINTPTR_MAX == UINT64_MAX -@implementation OFTaggedPointerDate -- (OFTimeInterval)timeIntervalSince1970 -{ - uint64_t value = (uint64_t)object_getTaggedPointerValue(self); - - value |= UINT64_C(4) << 60; - - return OFFromBigEndianDouble(OFRawUInt64ToDouble(OFToBigEndian64( - value))); -} -@end -#endif + +OF_SINGLETON_METHODS +@end + @implementation OFDate + (void)initialize { #ifdef OF_WINDOWS @@ -342,11 +307,11 @@ #endif if (self != [OFDate class]) return; - placeholder.isa = [OFDatePlaceholder class]; + object_setClass((id)&placeholder, [OFPlaceholderDate class]); #if (!defined(HAVE_GMTIME_R) || !defined(HAVE_LOCALTIME_R)) && \ defined(OF_HAVE_THREADS) mutex = [[OFMutex alloc] init]; atexit(releaseMutex); @@ -355,19 +320,10 @@ #ifdef OF_WINDOWS if ((module = LoadLibrary("msvcrt.dll")) != NULL) _mktime64FuncPtr = (__time64_t (*)(struct tm *)) GetProcAddress(module, "_mktime64"); #endif - -#if defined(OF_OBJFW_RUNTIME) && UINTPTR_MAX == UINT64_MAX - dateTag = objc_registerTaggedPointerClass([OFTaggedPointerDate class]); -#endif -} - -+ (instancetype)of_alloc -{ - return [super alloc]; } + (instancetype)alloc { if (self == [OFDate class]) @@ -426,15 +382,22 @@ return [self initWithTimeIntervalSince1970: now()]; } - (instancetype)initWithTimeIntervalSince1970: (OFTimeInterval)seconds { - self = [super init]; + if ([self isMemberOfClass: [OFDate class]]) { + @try { + [self doesNotRecognizeSelector: _cmd]; + } @catch (id e) { + [self release]; + @throw e; + } - _seconds = seconds; + abort(); + } - return self; + return [super init]; } - (instancetype)initWithTimeIntervalSinceNow: (OFTimeInterval)seconds { return [self initWithTimeIntervalSince1970: now() + seconds]; @@ -548,11 +511,11 @@ return OFOrderedSame; } - (OFString *)description { - return [self dateStringWithFormat: @"%Y-%m-%dT%H:%M:%SZ"]; + return [self dateStringWithFormat: @"%Y-%m-%dT%H:%M:%S%z"]; } - (OFData *)messagePackRepresentation { void *pool = objc_autoreleasePoolPush(); @@ -694,15 +657,11 @@ OFString *ret; OFTimeInterval timeInterval = self.timeIntervalSince1970; time_t seconds = (time_t)timeInterval; struct tm tm; size_t pageSize; -#ifndef OF_WINDOWS char *buffer; -#else - wchar_t *buffer; -#endif if (seconds != trunc(timeInterval)) @throw [OFOutOfRangeException exception]; #ifdef HAVE_GMTIME_R @@ -728,22 +687,15 @@ #endif pageSize = [OFSystemInfo pageSize]; buffer = OFAllocMemory(1, pageSize); @try { -#ifndef OF_WINDOWS - if (strftime(buffer, pageSize, format.UTF8String, &tm) == 0) + if (OFStrFTime(buffer, pageSize, format.UTF8String, &tm, + 0) == 0) @throw [OFOutOfRangeException exception]; ret = [OFString stringWithUTF8String: buffer]; -#else - if (wcsftime(buffer, pageSize / sizeof(wchar_t), - format.UTF16String, &tm) == 0) - @throw [OFOutOfRangeException exception]; - - ret = [OFString stringWithUTF16String: buffer]; -#endif } @finally { OFFreeMemory(buffer); } return ret; @@ -754,15 +706,11 @@ OFString *ret; OFTimeInterval timeInterval = self.timeIntervalSince1970; time_t seconds = (time_t)timeInterval; struct tm tm; size_t pageSize; -#ifndef OF_WINDOWS char *buffer; -#else - wchar_t *buffer; -#endif if (seconds != trunc(timeInterval)) @throw [OFOutOfRangeException exception]; #ifdef HAVE_LOCALTIME_R @@ -788,22 +736,15 @@ #endif pageSize = [OFSystemInfo pageSize]; buffer = OFAllocMemory(1, pageSize); @try { -#ifndef OF_WINDOWS - if (strftime(buffer, pageSize, format.UTF8String, &tm) == 0) + if (OFStrFTime(buffer, pageSize, format.UTF8String, &tm, + 0) == 0) @throw [OFOutOfRangeException exception]; ret = [OFString stringWithUTF8String: buffer]; -#else - if (wcsftime(buffer, pageSize / sizeof(wchar_t), - format.UTF16String, &tm) == 0) - @throw [OFOutOfRangeException exception]; - - ret = [OFString stringWithUTF16String: buffer]; -#endif } @finally { OFFreeMemory(buffer); } return ret; @@ -831,11 +772,11 @@ return self; } - (OFTimeInterval)timeIntervalSince1970 { - return _seconds; + OF_UNRECOGNIZED_SELECTOR } - (OFTimeInterval)timeIntervalSinceDate: (OFDate *)otherDate { return self.timeIntervalSince1970 - otherDate.timeIntervalSince1970; Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -147,10 +147,17 @@ * @return A new autoreleased OFDictionary */ + (instancetype)dictionaryWithKeysAndObjects: (KeyType)firstKey, ... OF_SENTINEL; +/** + * @brief Initializes an already allocated OFDictionary to be empty. + * + * @return An initialized OFDictionary + */ +- (instancetype)init OF_DESIGNATED_INITIALIZER; + /** * @brief Initializes an already allocated OFDictionary with the specified * OFDictionary. * * @param dictionary An OFDictionary @@ -189,11 +196,11 @@ * @param count The number of objects in the arrays * @return An initialized OFDictionary */ - (instancetype)initWithObjects: (ObjectType const _Nonnull *_Nonnull)objects forKeys: (KeyType const _Nonnull *_Nonnull)keys - count: (size_t)count; + count: (size_t)count OF_DESIGNATED_INITIALIZER; /** * @brief Initializes an already allocated OFDictionary with the specified keys * and objects. * Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -18,13 +18,13 @@ #include #import "OFDictionary.h" #import "OFArray.h" #import "OFCharacterSet.h" +#import "OFConcreteDictionary.h" #import "OFData.h" #import "OFEnumerator.h" -#import "OFMapTableDictionary.h" #import "OFString.h" #import "OFInvalidArgumentException.h" #import "OFOutOfRangeException.h" #import "OFUndefinedKeyException.h" @@ -37,11 +37,11 @@ - (OFString *) of_JSONRepresentationWithOptions: (OFJSONRepresentationOptions)options depth: (size_t)depth; @end -@interface OFDictionaryPlaceholder: OFDictionary +@interface OFPlaceholderDictionary: OFDictionary @end OF_DIRECT_MEMBERS @interface OFDictionaryObjectEnumerator: OFEnumerator { @@ -50,39 +50,45 @@ } - (instancetype)initWithDictionary: (OFDictionary *)dictionary; @end -@implementation OFDictionaryPlaceholder +@implementation OFPlaceholderDictionary +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif - (instancetype)init { - return (id)[[OFMapTableDictionary alloc] init]; + return (id)[[OFConcreteDictionary alloc] init]; } - (instancetype)initWithDictionary: (OFDictionary *)dictionary { - return (id)[[OFMapTableDictionary alloc] + return (id)[[OFConcreteDictionary alloc] initWithDictionary: dictionary]; } - (instancetype)initWithObject: (id)object forKey: (id)key { - return (id)[[OFMapTableDictionary alloc] initWithObject: object + return (id)[[OFConcreteDictionary alloc] initWithObject: object forKey: key]; } - (instancetype)initWithObjects: (OFArray *)objects forKeys: (OFArray *)keys { - return (id)[[OFMapTableDictionary alloc] initWithObjects: objects + return (id)[[OFConcreteDictionary alloc] initWithObjects: objects forKeys: keys]; } - (instancetype)initWithObjects: (id const *)objects forKeys: (id const *)keys count: (size_t)count { - return (id)[[OFMapTableDictionary alloc] initWithObjects: objects + return (id)[[OFConcreteDictionary alloc] initWithObjects: objects forKeys: keys count: count]; } - (instancetype)initWithKeysAndObjects: (id )firstKey, ... @@ -89,49 +95,36 @@ { id ret; va_list arguments; va_start(arguments, firstKey); - ret = [[OFMapTableDictionary alloc] initWithKey: firstKey + ret = [[OFConcreteDictionary alloc] initWithKey: firstKey arguments: arguments]; va_end(arguments); return ret; } - (instancetype)initWithKey: (id )firstKey arguments: (va_list)arguments { - return (id)[[OFMapTableDictionary alloc] initWithKey: firstKey + return (id)[[OFConcreteDictionary alloc] initWithKey: firstKey arguments: arguments]; } - -- (instancetype)retain -{ - return self; -} - -- (instancetype)autorelease -{ - return self; -} - -- (void)release -{ -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + +OF_SINGLETON_METHODS @end @implementation OFDictionary + (void)initialize { if (self == [OFDictionary class]) - placeholder.isa = [OFDictionaryPlaceholder class]; + object_setClass((id)&placeholder, + [OFPlaceholderDictionary class]); } + (instancetype)alloc { if (self == [OFDictionary class]) @@ -185,11 +178,12 @@ return ret; } - (instancetype)init { - if ([self isMemberOfClass: [OFDictionary class]]) { + if ([self isMemberOfClass: [OFDictionary class]] || + [self isMemberOfClass: [OFMutableDictionary class]]) { @try { [self doesNotRecognizeSelector: _cmd]; } @catch (id e) { [self release]; @throw e; @@ -201,23 +195,57 @@ return [super init]; } - (instancetype)initWithDictionary: (OFDictionary *)dictionary { - OF_INVALID_INIT_METHOD + void *pool = objc_autoreleasePoolPush(); + id const *objects, *keys; + size_t count; + + @try { + OFArray *objects_ = [dictionary.objectEnumerator allObjects]; + OFArray *keys_ = [dictionary.keyEnumerator allObjects]; + + count = dictionary.count; + + if (count != keys_.count || count != objects_.count) + @throw [OFInvalidArgumentException exception]; + + objects = objects_.objects; + keys = keys_.objects; + } @catch (id e) { + [self release]; + @throw e; + } + + @try { + self = [self initWithObjects: objects + forKeys: keys + count: count]; + } @finally { + objc_autoreleasePoolPop(pool); + } + + return self; } - (instancetype)initWithObject: (id)object forKey: (id)key { - if (key == nil || object == nil) - @throw [OFInvalidArgumentException exception]; + @try { + if (key == nil || object == nil) + @throw [OFInvalidArgumentException exception]; + } @catch (id e) { + [self release]; + @throw e; + } - return [self initWithKeysAndObjects: key, object, nil]; + return [self initWithObjects: &object forKeys: &key count: 1]; } - (instancetype)initWithObjects: (OFArray *)objects_ forKeys: (OFArray *)keys_ { + void *pool = objc_autoreleasePoolPush(); id const *objects, *keys; size_t count; @try { count = objects_.count; @@ -230,19 +258,32 @@ } @catch (id e) { [self release]; @throw e; } - return [self initWithObjects: objects forKeys: keys count: count]; + self = [self initWithObjects: objects forKeys: keys count: count]; + + objc_autoreleasePoolPop(pool); + + return self; } +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif - (instancetype)initWithObjects: (id const *)objects forKeys: (id const *)keys count: (size_t)count { OF_INVALID_INIT_METHOD } +#ifdef __clang__ +# pragma clang diagnostic pop +#endif - (instancetype)initWithKeysAndObjects: (id)firstKey, ... { id ret; va_list arguments; @@ -254,11 +295,60 @@ return ret; } - (instancetype)initWithKey: (id)firstKey arguments: (va_list)arguments { - OF_INVALID_INIT_METHOD + size_t count = 1; + id *objects = NULL, *keys = NULL; + va_list argumentsCopy; + + if (firstKey == nil) + return [self init]; + + va_copy(argumentsCopy, arguments); + while (va_arg(argumentsCopy, id) != nil) + count++; + + @try { + size_t i = 0; + id key, object; + + if (count % 2 != 0) + @throw [OFInvalidArgumentException exception]; + + count /= 2; + + objects = OFAllocMemory(count, sizeof(id)); + keys = OFAllocMemory(count, sizeof(id)); + + while ((key = va_arg(arguments, id)) != nil && + (object = va_arg(arguments, id)) != nil) { + OFEnsure(i < count); + + objects[i] = object; + keys[i] = key; + + i++; + } + } @catch (id e) { + OFFreeMemory(objects); + OFFreeMemory(keys); + + [self release]; + @throw e; + } + + @try { + self = [self initWithObjects: objects + forKeys: keys + count: count]; + } @finally { + OFFreeMemory(objects); + OFFreeMemory(keys); + } + + return self; } - (id)objectForKey: (id)key { OF_UNRECOGNIZED_SELECTOR @@ -429,10 +519,11 @@ - (int)countByEnumeratingWithState: (OFFastEnumerationState *)state objects: (id *)objects count: (int)count { + static unsigned long dummyMutations; OFEnumerator *enumerator; int i; memcpy(&enumerator, state->extra, sizeof(enumerator)); @@ -440,11 +531,11 @@ enumerator = [self keyEnumerator]; memcpy(state->extra, &enumerator, sizeof(enumerator)); } state->itemsPtr = objects; - state->mutationsPtr = (unsigned long *)self; + state->mutationsPtr = &dummyMutations; for (i = 0; i < count; i++) { id object = [enumerator nextObject]; if (object == nil) Index: src/OFEnumerator.m ================================================================== --- src/OFEnumerator.m +++ src/OFEnumerator.m @@ -59,14 +59,15 @@ - (int)countByEnumeratingWithState: (OFFastEnumerationState *)state objects: (id *)objects count: (int)count { + static unsigned long dummyMutations; int i; state->itemsPtr = objects; - state->mutationsPtr = (unsigned long *)self; + state->mutationsPtr = &dummyMutations; for (i = 0; i < count; i++) { id object = [self nextObject]; if (object == nil) Index: src/OFFileIRIHandler.m ================================================================== --- src/OFFileIRIHandler.m +++ src/OFFileIRIHandler.m @@ -842,17 +842,17 @@ OFTimeInterval modificationTime = modificationDate.timeIntervalSince1970; struct timeval times[2] = { { .tv_sec = (time_t)lastAccessTime, - .tv_usec = - (int)((lastAccessTime - times[0].tv_sec) * 1000000) + .tv_usec = (int)((lastAccessTime - + (time_t)lastAccessTime) * 1000000) }, { .tv_sec = (time_t)modificationTime, - .tv_usec = (int)((modificationTime - times[1].tv_sec) * - 1000000) + .tv_usec = (int)((modificationTime - + (time_t)modificationTime) * 1000000) }, }; if (utimes([path cStringWithEncoding: [OFLocale encoding]], times) != 0) @throw [OFSetItemAttributesFailedException @@ -1023,16 +1023,11 @@ @throw [OFInvalidArgumentException exception]; if (![IRI.scheme isEqual: _scheme]) @throw [OFInvalidArgumentException exception]; - if (statWrapper(IRI.fileSystemRepresentation, &s) != 0) { - objc_autoreleasePoolPop(pool); - return false; - } - - ret = S_ISREG(s.st_mode); + ret = (statWrapper(IRI.fileSystemRepresentation, &s) == 0); objc_autoreleasePoolPop(pool); return ret; } Index: src/OFFileManager.h ================================================================== --- src/OFFileManager.h +++ src/OFFileManager.h @@ -19,23 +19,25 @@ OF_ASSUME_NONNULL_BEGIN /** @file */ #ifdef OF_HAVE_FILES -# if defined(OF_HAVE_CHMOD) && !defined(OF_AMIGAOS) +# if (defined(OF_HAVE_CHMOD) && !defined(OF_AMIGAOS)) || defined(DOXYGEN) # define OF_FILE_MANAGER_SUPPORTS_PERMISSIONS # endif -# if defined(OF_HAVE_CHOWN) && !defined(OF_AMIGAOS) +# if (defined(OF_HAVE_CHOWN) && !defined(OF_AMIGAOS)) || defined(DOXYGEN) # define OF_FILE_MANAGER_SUPPORTS_OWNER # endif -# if (defined(OF_HAVE_LINK) && !defined(OF_AMIGAOS)) || defined(OF_WINDOWS) +# if (defined(OF_HAVE_LINK) && !defined(OF_AMIGAOS)) || defined(OF_WINDOWS) || \ + defined(DOXYGEN) # define OF_FILE_MANAGER_SUPPORTS_LINKS # endif -# if (defined(OF_HAVE_SYMLINK) && !defined(OF_AMIGAOS)) || defined(OF_WINDOWS) +# if (defined(OF_HAVE_SYMLINK) && !defined(OF_AMIGAOS)) || \ + defined(OF_WINDOWS) || defined(DOXYGEN) # define OF_FILE_MANAGER_SUPPORTS_SYMLINKS # endif -# if defined(OF_LINUX) || defined(OF_MACOS) +# if defined(OF_LINUX) || defined(OF_MACOS) || defined(DOXYGEN) # define OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES # endif #endif @class OFArray OF_GENERIC(ObjectType); Index: src/OFFileManager.m ================================================================== --- src/OFFileManager.m +++ src/OFFileManager.m @@ -330,19 +330,22 @@ } #endif - (void)createDirectoryAtIRI: (OFIRI *)IRI { + void *pool = objc_autoreleasePoolPush(); OFIRIHandler *IRIHandler; if (IRI == nil) @throw [OFInvalidArgumentException exception]; if ((IRIHandler = [OFIRIHandler handlerForIRI: IRI]) == nil) @throw [OFUnsupportedProtocolException exceptionWithIRI: IRI]; [IRIHandler createDirectoryAtIRI: IRI]; + + objc_autoreleasePoolPop(pool); } - (void)createDirectoryAtIRI: (OFIRI *)IRI createParents: (bool)createParents { void *pool = objc_autoreleasePoolPush(); @@ -355,10 +358,12 @@ if (IRI == nil) @throw [OFInvalidArgumentException exception]; if (!createParents) { [self createDirectoryAtIRI: IRI]; + + objc_autoreleasePoolPop(pool); return; } /* * Try blindly creating the directory first. @@ -365,15 +370,20 @@ * * The reason for this is that we might be sandboxed, so attempting to * create any of the parent directories will fail, while creating the * directory itself will work. */ - if ([self directoryExistsAtIRI: IRI]) + + if ([self directoryExistsAtIRI: IRI]) { + objc_autoreleasePoolPop(pool); return; + } @try { [self createDirectoryAtIRI: IRI]; + + objc_autoreleasePoolPop(pool); return; } @catch (OFCreateDirectoryFailedException *e) { /* * If we didn't fail because any of the parents is missing, * there is no point in trying to create the parents. @@ -994,28 +1004,11 @@ } #endif @end @implementation OFDefaultFileManager -- (instancetype)autorelease -{ - return self; -} - -- (instancetype)retain -{ - return self; -} - -- (void)release -{ -} - -- (unsigned int)retainCount -{ - return OFMaxRetainCount; -} +OF_SINGLETON_METHODS @end @implementation OFDictionary (FileAttributes) - (unsigned long long)fileSize { Index: src/OFHTTPClient.h ================================================================== --- src/OFHTTPClient.h +++ src/OFHTTPClient.h @@ -35,11 +35,12 @@ * * @brief A delegate for OFHTTPClient. */ @protocol OFHTTPClientDelegate /** - * @brief A callback which is called when an OFHTTPClient performed a request. + * @brief A callback which is called when an @ref OFHTTPClient performed a + * request. * * @param client The OFHTTPClient which performed the request * @param request The request the OFHTTPClient performed * @param response The response to the request performed, or nil on error * @param exception An exception if the request failed, or nil on success @@ -49,11 +50,12 @@ response: (nullable OFHTTPResponse *)response exception: (nullable id)exception; @optional /** - * @brief A callback which is called when an OFHTTPClient creates a TCP socket. + * @brief A callback which is called when an @ref OFHTTPClient creates a TCP + * socket. * * This can be used to tell the socket about a SOCKS5 proxy it should use for * this connection. * * @param client The OFHTTPClient that created a TCP socket @@ -63,11 +65,12 @@ - (void)client: (OFHTTPClient *)client didCreateTCPSocket: (OFTCPSocket *)TCPSocket request: (OFHTTPRequest *)request; /** - * @brief A callback which is called when an OFHTTPClient creates a TLS stream. + * @brief A callback which is called when an @ref OFHTTPClient creates a TLS + * stream. * * This can be used to tell the TLS stream about a client certificate it should * use before performing the TLS handshake. * * @param client The OFHTTPClient that created a TLS stream @@ -77,12 +80,12 @@ - (void)client: (OFHTTPClient *)client didCreateTLSStream: (OFTLSStream *)TLSStream request: (OFHTTPRequest *)request; /** - * @brief A callback which is called when an OFHTTPClient wants to send the - * body for a request. + * @brief A callback which is called when an @ref OFHTTPClient wants to send + * the body for a request. * * @param client The OFHTTPClient that wants to send the body * @param requestBody A stream into which the body of the request should be * written * @param request The request for which the OFHTTPClient wants to send the body @@ -90,11 +93,11 @@ - (void)client: (OFHTTPClient *)client wantsRequestBody: (OFStream *)requestBody request: (OFHTTPRequest *)request; /** - * @brief A callback which is called when an OFHTTPClient received headers. + * @brief A callback which is called when an @ref OFHTTPClient received headers. * * @param client The OFHTTPClient which received the headers * @param headers The headers received * @param statusCode The status code received * @param request The request for which the headers and status code have been @@ -104,12 +107,12 @@ didReceiveHeaders: (OFDictionary OF_GENERIC(OFString *, OFString *) *)headers statusCode: (short)statusCode request: (OFHTTPRequest *)request; /** - * @brief A callback which is called when an OFHTTPClient wants to follow a - * redirect. + * @brief A callback which is called when an @ref OFHTTPClient wants to follow + * a redirect. * * If you want to get the headers and data for each redirect, set the number of * redirects to 0 and perform a new OFHTTPClient for each redirect. However, * this callback will not be called then and you have to look at the status code * to detect a redirect. Index: src/OFHTTPClient.m ================================================================== --- src/OFHTTPClient.m +++ src/OFHTTPClient.m @@ -385,19 +385,11 @@ * 303 means the request should be converted to a GET * request before redirection. This also means stripping * the entity of the request. */ if (_status == 303) { - OFEnumerator *keyEnumerator, *objectEnumerator; - OFString *key, *object; - - keyEnumerator = [headers keyEnumerator]; - objectEnumerator = [headers objectEnumerator]; - while ((key = [keyEnumerator nextObject]) != - nil && - (object = [objectEnumerator nextObject]) != - nil) + for (OFString *key in headers) if ([key hasPrefix: @"Content-"] || [key hasPrefix: @"Transfer-"]) [newHeaders removeObjectForKey: key]; @@ -638,12 +630,10 @@ if (exception != nil) { [self raiseException: exception]; return; } - sock.canBlock = false; - if ([_client->_delegate respondsToSelector: @selector(client:didCreateTCPSocket:request:)]) [_client->_delegate client: _client didCreateTCPSocket: sock request: _request]; Index: src/OFHTTPRequest.h ================================================================== --- src/OFHTTPRequest.h +++ src/OFHTTPRequest.h @@ -51,11 +51,11 @@ /** * @struct OFHTTPRequestProtocolVersion OFHTTPRequest.h ObjFW/OFHTTPRequest.h * * @brief The HTTP version of the HTTP request. */ -typedef struct OF_BOXABLE { +typedef struct OF_BOXABLE OFHTTPRequestProtocolVersion { /** The major of the HTTP version */ unsigned char major; /** The minor of the HTTP version */ unsigned char minor; } OFHTTPRequestProtocolVersion; Index: src/OFHTTPResponse.m ================================================================== --- src/OFHTTPResponse.m +++ src/OFHTTPResponse.m @@ -212,14 +212,16 @@ if ([name isEqual: @"charset"]) charset = value; } - @try { - ret = OFStringEncodingParseName(charset); - } @catch (OFInvalidArgumentException *e) { - ret = OFStringEncodingAutodetect; + ret = OFStringEncodingAutodetect; + if (charset != nil) { + @try { + ret = OFStringEncodingParseName(charset); + } @catch (OFInvalidArgumentException *e) { + } } return ret; } Index: src/OFINICategory.h ================================================================== --- src/OFINICategory.h +++ src/OFINICategory.h @@ -42,97 +42,97 @@ /** * @brief Returns the string for the specified key, or `nil` if it does not * exist. * - * If the specified key is a multi-key (see @ref stringArrayForKey:), the value + * If the specified key is a multi-key (see @ref arrayValueForKey:), the value * of the first key/value pair found is returned. * * @param key The key for which the string should be returned * @return The string for the specified key, or `nil` if it does not exist */ -- (nullable OFString *)stringForKey: (OFString *)key; +- (nullable OFString *)stringValueForKey: (OFString *)key; /** * @brief Returns the string for the specified key or the specified default * value if it does not exist. * - * If the specified key is a multi-key (see @ref stringArrayForKey:), the value + * If the specified key is a multi-key (see @ref arrayValueForKey:), the value * of the first key/value pair found is returned. * * @param key The key for which the string should be returned * @param defaultValue The value to return if the key does not exist * @return The string for the specified key or the specified default value if * it does not exist */ -- (nullable OFString *)stringForKey: (OFString *)key - defaultValue: (nullable OFString *)defaultValue; +- (nullable OFString *)stringValueForKey: (OFString *)key + defaultValue: (nullable OFString *)defaultValue; /** - * @brief Returns the long long for the specified key or the specified default - * value if it does not exist. + * @brief Returns the long long value for the specified key or the specified + * default value if it does not exist. * - * If the specified key is a multi-key (see @ref stringArrayForKey:), the value + * If the specified key is a multi-key (see @ref arrayValueForKey:), the value * of the first key/value pair found is returned. * * @param key The key for which the long long should be returned * @param defaultValue The value to return if the key does not exist * @return The long long for the specified key or the specified default value * if it does not exist * @throw OFInvalidFormatException The specified key is not in the correct * format for a long long */ -- (long long)longLongForKey: (OFString *)key - defaultValue: (long long)defaultValue; +- (long long)longLongValueForKey: (OFString *)key + defaultValue: (long long)defaultValue; /** - * @brief Returns the bool for the specified key or the specified default value - * if it does not exist. + * @brief Returns the bool value for the specified key or the specified default + * value if it does not exist. * - * If the specified key is a multi-key (see @ref stringArrayForKey:), the value + * If the specified key is a multi-key (see @ref arrayValueForKey:), the value * of the first key/value pair found is returned. * * @param key The key for which the bool should be returned * @param defaultValue The value to return if the key does not exist * @return The bool for the specified key or the specified default value if it * does not exist * @throw OFInvalidFormatException The specified key is not in the correct * format for a bool */ -- (bool)boolForKey: (OFString *)key defaultValue: (bool)defaultValue; +- (bool)boolValueForKey: (OFString *)key defaultValue: (bool)defaultValue; /** - * @brief Returns the float for the specified key or the specified default + * @brief Returns the float value for the specified key or the specified default * value if it does not exist. * - * If the specified key is a multi-key (see @ref stringArrayForKey:), the value + * If the specified key is a multi-key (see @ref arrayValueForKey:), the value * of the first key/value pair found is returned. * * @param key The key for which the float should be returned * @param defaultValue The value to return if the key does not exist * @return The float for the specified key or the specified default value if it * does not exist * @throw OFInvalidFormatException The specified key is not in the correct * format for a float */ -- (float)floatForKey: (OFString *)key defaultValue: (float)defaultValue; +- (float)floatValueForKey: (OFString *)key defaultValue: (float)defaultValue; /** - * @brief Returns the double for the specified key or the specified default - * value if it does not exist. + * @brief Returns the double value for the specified key or the specified + * default value if it does not exist. * - * If the specified key is a multi-key (see @ref stringArrayForKey:), the value + * If the specified key is a multi-key (see @ref arrayValueForKey:), the value * of the first key/value pair found is returned. * * @param key The key for which the double should be returned * @param defaultValue The value to return if the key does not exist * @return The double for the specified key or the specified default value if * it does not exist * @throw OFInvalidFormatException The specified key is not in the correct * format for a double */ -- (double)doubleForKey: (OFString *)key defaultValue: (double)defaultValue; +- (double)doubleValueForKey: (OFString *)key defaultValue: (double)defaultValue; /** * @brief Returns an array of strings for the specified multi-key, or an empty * array if the key does not exist. * @@ -141,89 +141,89 @@ * * @param key The multi-key for which the array should be returned * @return The array for the specified key, or an empty array if it does not * exist */ -- (OFArray OF_GENERIC(OFString *) *)stringArrayForKey: (OFString *)key; +- (OFArray OF_GENERIC(OFString *) *)arrayValueForKey: (OFString *)key; /** * @brief Sets the value of the specified key to the specified string. * - * If the specified key is a multi-key (see @ref stringArrayForKey:), the value + * If the specified key is a multi-key (see @ref arrayValueForKey:), the value * of the first key/value pair found is changed. * - * @param string The string to which the key should be set + * @param stringValue The string to which the key should be set * @param key The key for which the new value should be set */ -- (void)setString: (OFString *)string forKey: (OFString *)key; +- (void)setStringValue: (OFString *)stringValue forKey: (OFString *)key; /** * @brief Sets the value of the specified key to the specified long long. * - * If the specified key is a multi-key (see @ref stringArrayForKey:), the value + * If the specified key is a multi-key (see @ref arrayValueForKey:), the value * of the first key/value pair found is changed. * - * @param longLong The long long to which the key should be set + * @param longLongValue The long long to which the key should be set * @param key The key for which the new value should be set */ -- (void)setLongLong: (long long)longLong forKey: (OFString *)key; +- (void)setLongLongValue: (long long)longLongValue forKey: (OFString *)key; /** * @brief Sets the value of the specified key to the specified bool. * - * If the specified key is a multi-key (see @ref stringArrayForKey:), the value + * If the specified key is a multi-key (see @ref arrayValueForKey:), the value * of the first key/value pair found is changed. * - * @param bool_ The bool to which the key should be set + * @param boolValue The bool to which the key should be set * @param key The key for which the new value should be set */ -- (void)setBool: (bool)bool_ forKey: (OFString *)key; +- (void)setBoolValue: (bool)boolValue forKey: (OFString *)key; /** * @brief Sets the value of the specified key to the specified float. * - * If the specified key is a multi-key (see @ref stringArrayForKey:), the value + * If the specified key is a multi-key (see @ref arrayValueForKey:), the value * of the first key/value pair found is changed. * - * @param float_ The float to which the key should be set + * @param floatValue The float to which the key should be set * @param key The key for which the new value should be set */ -- (void)setFloat: (float)float_ forKey: (OFString *)key; +- (void)setFloatValue: (float)floatValue forKey: (OFString *)key; /** * @brief Sets the value of the specified key to the specified double. * - * If the specified key is a multi-key (see @ref stringArrayForKey:), the value + * If the specified key is a multi-key (see @ref arrayValueForKey:), the value * of the first key/value pair found is changed. * - * @param double_ The double to which the key should be set + * @param doubleValue The double to which the key should be set * @param key The key for which the new value should be set */ -- (void)setDouble: (double)double_ forKey: (OFString *)key; +- (void)setDoubleValue: (double)doubleValue forKey: (OFString *)key; /** * @brief Sets the specified multi-key to the specified array of strings. * * It replaces the first occurrence of the multi-key with several key/value * pairs and removes all following occurrences. If the multi-key does not exist * yet, it is appended to the section. * - * See also @ref stringArrayForKey: for more information about multi-keys. + * See also @ref arrayValueForKey: for more information about multi-keys. * - * @param array The array of strings to which the multi-key should be set + * @param arrayValue The array of strings to which the multi-key should be set * @param key The multi-key for which the new values should be set */ -- (void)setStringArray: (OFArray OF_GENERIC(OFString *) *)array - forKey: (OFString *)key; +- (void)setArrayValue: (OFArray OF_GENERIC(OFString *) *)arrayValue + forKey: (OFString *)key; /** * @brief Removes the value for the specified key * - * If the specified key is a multi-key (see @ref stringArrayForKey:), all + * If the specified key is a multi-key (see @ref arrayValueForKey:), all * key/value pairs matching the specified key are removed. * * @param key The key of the value to remove */ - (void)removeValueForKey: (OFString *)key; @end OF_ASSUME_NONNULL_END Index: src/OFINICategory.m ================================================================== --- src/OFINICategory.m +++ src/OFINICategory.m @@ -176,17 +176,17 @@ [_lines addObject: comment]; } } -- (OFString *)stringForKey: (OFString *)key +- (OFString *)stringValueForKey: (OFString *)key { - return [self stringForKey: key defaultValue: nil]; + return [self stringValueForKey: key defaultValue: nil]; } -- (OFString *)stringForKey: (OFString *)key - defaultValue: (OFString *)defaultValue +- (OFString *)stringValueForKey: (OFString *)key + defaultValue: (OFString *)defaultValue { for (id line in _lines) { OFINICategoryPair *pair; if (![line isKindOfClass: [OFINICategoryPair class]]) @@ -199,15 +199,15 @@ } return defaultValue; } -- (long long)longLongForKey: (OFString *)key - defaultValue: (long long)defaultValue +- (long long)longLongValueForKey: (OFString *)key + defaultValue: (long long)defaultValue { void *pool = objc_autoreleasePoolPush(); - OFString *value = [self stringForKey: key defaultValue: nil]; + OFString *value = [self stringValueForKey: key defaultValue: nil]; long long ret; if (value != nil) ret = [value longLongValueWithBase: 0]; else @@ -216,14 +216,14 @@ objc_autoreleasePoolPop(pool); return ret; } -- (bool)boolForKey: (OFString *)key defaultValue: (bool)defaultValue +- (bool)boolValueForKey: (OFString *)key defaultValue: (bool)defaultValue { void *pool = objc_autoreleasePoolPush(); - OFString *value = [self stringForKey: key defaultValue: nil]; + OFString *value = [self stringValueForKey: key defaultValue: nil]; bool ret; if (value != nil) { if ([value isEqual: @"true"]) ret = true; @@ -237,14 +237,14 @@ objc_autoreleasePoolPop(pool); return ret; } -- (float)floatForKey: (OFString *)key defaultValue: (float)defaultValue +- (float)floatValueForKey: (OFString *)key defaultValue: (float)defaultValue { void *pool = objc_autoreleasePoolPush(); - OFString *value = [self stringForKey: key defaultValue: nil]; + OFString *value = [self stringValueForKey: key defaultValue: nil]; float ret; if (value != nil) ret = value.floatValue; else @@ -253,14 +253,14 @@ objc_autoreleasePoolPop(pool); return ret; } -- (double)doubleForKey: (OFString *)key defaultValue: (double)defaultValue +- (double)doubleValueForKey: (OFString *)key defaultValue: (double)defaultValue { void *pool = objc_autoreleasePoolPush(); - OFString *value = [self stringForKey: key defaultValue: nil]; + OFString *value = [self stringValueForKey: key defaultValue: nil]; double ret; if (value != nil) ret = value.doubleValue; else @@ -269,11 +269,11 @@ objc_autoreleasePoolPop(pool); return ret; } -- (OFArray OF_GENERIC(OFString *) *)stringArrayForKey: (OFString *)key +- (OFArray OF_GENERIC(OFString *) *)arrayValueForKey: (OFString *)key { OFMutableArray *ret = [OFMutableArray array]; void *pool = objc_autoreleasePoolPush(); for (id line in _lines) { @@ -293,11 +293,11 @@ [ret makeImmutable]; return ret; } -- (void)setString: (OFString *)string forKey: (OFString *)key +- (void)setStringValue: (OFString *)string forKey: (OFString *)key { void *pool = objc_autoreleasePoolPush(); OFINICategoryPair *pair; for (id line in _lines) { @@ -333,64 +333,65 @@ } objc_autoreleasePoolPop(pool); } -- (void)setLongLong: (long long)longLong forKey: (OFString *)key -{ - void *pool = objc_autoreleasePoolPush(); - - [self setString: [OFString stringWithFormat: @"%lld", longLong] - forKey: key]; - - objc_autoreleasePoolPop(pool); -} - -- (void)setBool: (bool)bool_ forKey: (OFString *)key -{ - [self setString: (bool_ ? @"true" : @"false") forKey: key]; -} - -- (void)setFloat: (float)float_ forKey: (OFString *)key -{ - void *pool = objc_autoreleasePoolPush(); - - [self setString: [OFString stringWithFormat: @"%g", float_] - forKey: key]; - - objc_autoreleasePoolPop(pool); -} - -- (void)setDouble: (double)double_ forKey: (OFString *)key -{ - void *pool = objc_autoreleasePoolPush(); - - [self setString: [OFString stringWithFormat: @"%g", double_] - forKey: key]; - - objc_autoreleasePoolPop(pool); -} - -- (void)setStringArray: (OFArray OF_GENERIC(OFString *) *)array - forKey: (OFString *)key +- (void)setLongLongValue: (long long)longLongValue forKey: (OFString *)key +{ + void *pool = objc_autoreleasePoolPush(); + + [self setStringValue: [OFString stringWithFormat: + @"%lld", longLongValue] + forKey: key]; + + objc_autoreleasePoolPop(pool); +} + +- (void)setBoolValue: (bool)boolValue forKey: (OFString *)key +{ + [self setStringValue: (boolValue ? @"true" : @"false") forKey: key]; +} + +- (void)setFloatValue: (float)floatValue forKey: (OFString *)key +{ + void *pool = objc_autoreleasePoolPush(); + + [self setStringValue: [OFString stringWithFormat: @"%g", floatValue] + forKey: key]; + + objc_autoreleasePoolPop(pool); +} + +- (void)setDoubleValue: (double)doubleValue forKey: (OFString *)key +{ + void *pool = objc_autoreleasePoolPush(); + + [self setStringValue: [OFString stringWithFormat: @"%g", doubleValue] + forKey: key]; + + objc_autoreleasePoolPop(pool); +} + +- (void)setArrayValue: (OFArray OF_GENERIC(OFString *) *)arrayValue + forKey: (OFString *)key { void *pool; OFMutableArray *pairs; id const *lines; size_t count; bool replaced; - if (array.count == 0) { + if (arrayValue.count == 0) { [self removeValueForKey: key]; return; } pool = objc_autoreleasePoolPush(); - pairs = [OFMutableArray arrayWithCapacity: array.count]; + pairs = [OFMutableArray arrayWithCapacity: arrayValue.count]; - for (OFString *string in array) { + for (OFString *string in arrayValue) { OFINICategoryPair *pair; if (![string isKindOfClass: [OFString class]]) @throw [OFInvalidArgumentException exception]; @@ -420,11 +421,11 @@ [_lines insertObjectsFromArray: pairs atIndex: i]; replaced = true; /* Continue after inserted pairs */ - i += array.count - 1; + i += arrayValue.count - 1; } else i--; /* Continue at same position */ lines = _lines.objects; count = _lines.count; Index: src/OFINIFileSettings.m ================================================================== --- src/OFINIFileSettings.m +++ src/OFINIFileSettings.m @@ -74,11 +74,12 @@ { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; [self of_getCategory: &category andKey: &key forPath: path]; - [[_INIFile categoryForName: category] setString: string forKey: key]; + [[_INIFile categoryForName: category] setStringValue: string + forKey: key]; objc_autoreleasePoolPop(pool); } - (void)setLongLong: (long long)longLong forPath: (OFString *)path @@ -85,12 +86,12 @@ { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; [self of_getCategory: &category andKey: &key forPath: path]; - [[_INIFile categoryForName: category] setLongLong: longLong - forKey: key]; + [[_INIFile categoryForName: category] setLongLongValue: longLong + forKey: key]; objc_autoreleasePoolPop(pool); } - (void)setBool: (bool)bool_ forPath: (OFString *)path @@ -97,11 +98,11 @@ { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; [self of_getCategory: &category andKey: &key forPath: path]; - [[_INIFile categoryForName: category] setBool: bool_ forKey: key]; + [[_INIFile categoryForName: category] setBoolValue: bool_ forKey: key]; objc_autoreleasePoolPop(pool); } - (void)setFloat: (float)float_ forPath: (OFString *)path @@ -108,11 +109,12 @@ { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; [self of_getCategory: &category andKey: &key forPath: path]; - [[_INIFile categoryForName: category] setFloat: float_ forKey: key]; + [[_INIFile categoryForName: category] setFloatValue: float_ + forKey: key]; objc_autoreleasePoolPop(pool); } - (void)setDouble: (double)double_ forPath: (OFString *)path @@ -119,11 +121,12 @@ { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; [self of_getCategory: &category andKey: &key forPath: path]; - [[_INIFile categoryForName: category] setDouble: double_ forKey: key]; + [[_INIFile categoryForName: category] setDoubleValue: double_ + forKey: key]; objc_autoreleasePoolPop(pool); } - (void)setStringArray: (OFArray OF_GENERIC(OFString *) *)array @@ -131,12 +134,12 @@ { void *pool = objc_autoreleasePoolPush(); OFString *category, *key; [self of_getCategory: &category andKey: &key forPath: path]; - [[_INIFile categoryForName: category] setStringArray: array - forKey: key]; + [[_INIFile categoryForName: category] setArrayValue: array + forKey: key]; objc_autoreleasePoolPop(pool); } - (OFString *)stringForPath: (OFString *)path @@ -144,12 +147,13 @@ { void *pool = objc_autoreleasePoolPush(); OFString *category, *key, *ret; [self of_getCategory: &category andKey: &key forPath: path]; - ret = [[_INIFile categoryForName: category] stringForKey: key - defaultValue: defaultValue]; + ret = [[_INIFile categoryForName: category] + stringValueForKey: key + defaultValue: defaultValue]; [ret retain]; objc_autoreleasePoolPop(pool); return [ret autorelease]; } @@ -161,12 +165,12 @@ OFString *category, *key; long long ret; [self of_getCategory: &category andKey: &key forPath: path]; ret = [[_INIFile categoryForName: category] - longLongForKey: key - defaultValue: defaultValue]; + longLongValueForKey: key + defaultValue: defaultValue]; objc_autoreleasePoolPop(pool); return ret; } @@ -176,12 +180,13 @@ void *pool = objc_autoreleasePoolPush(); OFString *category, *key; bool ret; [self of_getCategory: &category andKey: &key forPath: path]; - ret = [[_INIFile categoryForName: category] boolForKey: key - defaultValue: defaultValue]; + ret = [[_INIFile categoryForName: category] + boolValueForKey: key + defaultValue: defaultValue]; objc_autoreleasePoolPop(pool); return ret; } @@ -191,12 +196,13 @@ void *pool = objc_autoreleasePoolPush(); OFString *category, *key; float ret; [self of_getCategory: &category andKey: &key forPath: path]; - ret = [[_INIFile categoryForName: category] floatForKey: key - defaultValue: defaultValue]; + ret = [[_INIFile categoryForName: category] + floatValueForKey: key + defaultValue: defaultValue]; objc_autoreleasePoolPop(pool); return ret; } @@ -206,12 +212,13 @@ void *pool = objc_autoreleasePoolPush(); OFString *category, *key; double ret; [self of_getCategory: &category andKey: &key forPath: path]; - ret = [[_INIFile categoryForName: category] doubleForKey: key - defaultValue: defaultValue]; + ret = [[_INIFile categoryForName: category] + doubleValueForKey: key + defaultValue: defaultValue]; objc_autoreleasePoolPop(pool); return ret; } @@ -221,11 +228,11 @@ void *pool = objc_autoreleasePoolPush(); OFString *category, *key; OFArray *ret; [self of_getCategory: &category andKey: &key forPath: path]; - ret = [[_INIFile categoryForName: category] stringArrayForKey: key]; + ret = [[_INIFile categoryForName: category] arrayValueForKey: key]; [ret retain]; objc_autoreleasePoolPop(pool); return [ret autorelease]; } Index: src/OFIRI.m ================================================================== --- src/OFIRI.m +++ src/OFIRI.m @@ -189,28 +189,11 @@ return false; } @implementation OFIRIAllowedCharacterSetBase -- (instancetype)autorelease -{ - return self; -} - -- (instancetype)retain -{ - return self; -} - -- (void)release -{ -} - -- (unsigned int)retainCount -{ - return OFMaxRetainCount; -} +OF_SINGLETON_METHODS @end @implementation OFIRIAllowedCharacterSet - (bool)characterIsMember: (OFUnichar)character { Index: src/OFInflate64Stream.h ================================================================== --- src/OFInflate64Stream.h +++ src/OFInflate64Stream.h @@ -68,10 +68,18 @@ } huffman; } _context; bool _inLastBlock, _atEndOfStream; } +/** + * @brief The underlying stream of the inflate stream. + * + * Setting this can be useful if the the data to be inflated is coming from + * multiple streams, such as split across multiple files. + */ +@property (retain, nonatomic) OFStream *underlyingStream; + /** * @brief Creates a new OFInflate64Stream with the specified underlying stream. * * @param stream The underlying stream to which compressed data is written or * from which compressed data is read Index: src/OFInflateStream.h ================================================================== --- src/OFInflateStream.h +++ src/OFInflateStream.h @@ -68,10 +68,18 @@ } huffman; } _context; bool _inLastBlock, _atEndOfStream; } +/** + * @brief The underlying stream of the inflate stream. + * + * Setting this can be useful if the the data to be inflated is coming from + * multiple streams, such as split across multiple files. + */ +@property (retain, nonatomic) OFStream *underlyingStream; + /** * @brief Creates a new OFInflateStream with the specified underlying stream. * * @param stream The underlying stream to which compressed data is written or * from which compressed data is read Index: src/OFInflateStream.m ================================================================== --- src/OFInflateStream.m +++ src/OFInflateStream.m @@ -98,10 +98,12 @@ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; static OFHuffmanTree fixedLitLenTree, fixedDistTree; @implementation OFInflateStream +@synthesize underlyingStream = _stream; + static OF_INLINE bool tryReadBits(OFInflateStream *stream, uint16_t *bits, uint8_t count) { uint16_t ret = stream->_savedBits; Index: src/OFKernelEventObserver.h ================================================================== --- src/OFKernelEventObserver.h +++ src/OFKernelEventObserver.h @@ -62,11 +62,11 @@ * * @param object The object which did become ready for writing */ - (void)objectIsReadyForWriting: (id)object; -#ifdef OF_AMIGAOS +#if defined(OF_AMIGAOS) || defined(DOXYGEN) /** * @brief This callback is called when an Exec Signal was received. * * @note This is only available on AmigaOS! */ @@ -119,39 +119,39 @@ OFMutableArray OF_GENERIC(id ) *_readObjects; OFMutableArray OF_GENERIC(id ) *_writeObjects; id _Nullable _delegate; -#if defined(OF_AMIGAOS) +# if defined(OF_AMIGAOS) struct Task *_waitingTask; ULONG _cancelSignal; -#elif defined(OF_HAVE_PIPE) +# elif defined(OF_HAVE_PIPE) int _cancelFD[2]; -#else +# else OFSocketHandle _cancelFD[2]; struct sockaddr_in _cancelAddr; -#endif -#ifdef OF_AMIGAOS +# endif +# ifdef OF_AMIGAOS ULONG _execSignalMask; -#endif +# endif OF_RESERVE_IVARS(OFKernelEventObserver, 4) } /** * @brief The delegate for the OFKernelEventObserver. */ @property OF_NULLABLE_PROPERTY (assign, nonatomic) id delegate; -#ifdef OF_AMIGAOS +# if defined(OF_AMIGAOS) || defined(DOXYGEN) /** * @brief A mask of Exec Signals to wait for. * * @note This is only available on AmigaOS! */ @property (nonatomic) ULONG execSignalMask; -#endif +# endif /** * @brief Creates a new OFKernelEventObserver. * * @return A new, autoreleased OFKernelEventObserver Index: src/OFMapTable.h ================================================================== --- src/OFMapTable.h +++ src/OFMapTable.h @@ -72,11 +72,11 @@ @interface OFMapTable: OFObject { OFMapTableFunctions _keyFunctions, _objectFunctions; struct OFMapTableBucket *_Nonnull *_Nullable _buckets; uint32_t _count, _capacity; - unsigned char _rotate; + unsigned char _rotation; unsigned long _mutations; } /** * @brief The key functions used by the map table. Index: src/OFMapTable.m ================================================================== --- src/OFMapTable.m +++ src/OFMapTable.m @@ -155,11 +155,11 @@ _capacity = minCapacity; _buckets = OFAllocZeroedMemory(_capacity, sizeof(*_buckets)); if (OFHashSeed != 0) - _rotate = OFRandom16() & 31; + _rotation = OFRandom16() & 31; } @catch (id e) { [self release]; @throw e; } @@ -185,10 +185,11 @@ static void resizeForCount(OFMapTable *self, uint32_t count) { uint32_t fullness, capacity; struct OFMapTableBucket **buckets; + unsigned char newRotation; if (count > UINT32_MAX / sizeof(*self->_buckets) || count > UINT32_MAX / 8) @throw [OFOutOfRangeException exception]; @@ -211,24 +212,27 @@ if ((capacity < self->_capacity && count > self->_count) || capacity < minCapacity) return; buckets = OFAllocZeroedMemory(capacity, sizeof(*buckets)); + newRotation = (OFHashSeed != 0 ? OFRandom16() & 31 : 0); for (uint32_t i = 0; i < self->_capacity; i++) { if (self->_buckets[i] != NULL && self->_buckets[i] != &deletedBucket) { - uint32_t j, last; + uint32_t rotatedHash, j, last; + rotatedHash = OFRotateLeft(self->_buckets[i]->hash, + newRotation); last = capacity; - for (j = self->_buckets[i]->hash & (capacity - 1); + for (j = rotatedHash & (capacity - 1); j < last && buckets[j] != NULL; j++); /* In case the last bucket is already used */ if (j >= last) { - last = self->_buckets[i]->hash & (capacity - 1); + last = rotatedHash & (capacity - 1); for (j = 0; j < last && buckets[j] != NULL; j++); } @@ -240,25 +244,26 @@ } OFFreeMemory(self->_buckets); self->_buckets = buckets; self->_capacity = capacity; + self->_rotation = newRotation; } static void setObject(OFMapTable *restrict self, void *key, void *object, uint32_t hash) { - uint32_t i, last; + uint32_t rotatedHash, i, last; void *old; if (key == NULL || object == NULL) @throw [OFInvalidArgumentException exception]; - hash = OFRotateLeft(hash, self->_rotate); + rotatedHash = OFRotateLeft(hash, self->_rotation); last = self->_capacity; - for (i = hash & (self->_capacity - 1); + for (i = rotatedHash & (self->_capacity - 1); i < last && self->_buckets[i] != NULL; i++) { if (self->_buckets[i] == &deletedBucket) continue; if (self->_keyFunctions.equal(self->_buckets[i]->key, key)) @@ -265,11 +270,11 @@ break; } /* In case the last bucket is already used */ if (i >= last) { - last = hash & (self->_capacity - 1); + last = rotatedHash & (self->_capacity - 1); for (i = 0; i < last && self->_buckets[i] != NULL; i++) { if (self->_buckets[i] == &deletedBucket) continue; @@ -284,21 +289,23 @@ self->_buckets[i] == &deletedBucket || !self->_keyFunctions.equal(self->_buckets[i]->key, key)) { struct OFMapTableBucket *bucket; resizeForCount(self, self->_count + 1); + /* Resizing can change the rotation */ + rotatedHash = OFRotateLeft(hash, self->_rotation); self->_mutations++; last = self->_capacity; - for (i = hash & (self->_capacity - 1); i < last && + for (i = rotatedHash & (self->_capacity - 1); i < last && self->_buckets[i] != NULL && self->_buckets[i] != &deletedBucket; i++); /* In case the last bucket is already used */ if (i >= last) { - last = hash & (self->_capacity - 1); + last = rotatedHash & (self->_capacity - 1); for (i = 0; i < last && self->_buckets[i] != NULL && self->_buckets[i] != &deletedBucket; i++); } @@ -370,11 +377,11 @@ { unsigned long hash = 0; for (unsigned long i = 0; i < _capacity; i++) { if (_buckets[i] != NULL && _buckets[i] != &deletedBucket) { - hash ^= OFRotateRight(_buckets[i]->hash, _rotate); + hash ^= _buckets[i]->hash; hash ^= _objectFunctions.hash(_buckets[i]->object); } } return hash; @@ -390,12 +397,11 @@ @try { for (uint32_t i = 0; i < _capacity; i++) if (_buckets[i] != NULL && _buckets[i] != &deletedBucket) setObject(copy, _buckets[i]->key, - _buckets[i]->object, - OFRotateRight(_buckets[i]->hash, _rotate)); + _buckets[i]->object, _buckets[i]->hash); } @catch (id e) { [copy release]; @throw e; } @@ -407,19 +413,21 @@ return _count; } - (void *)objectForKey: (void *)key { - uint32_t i, hash, last; + uint32_t i, rotatedHash, last; if (key == NULL) @throw [OFInvalidArgumentException exception]; - hash = OFRotateLeft((uint32_t)_keyFunctions.hash(key), _rotate); + rotatedHash = OFRotateLeft((uint32_t)_keyFunctions.hash(key), + _rotation); last = _capacity; - for (i = hash & (_capacity - 1); i < last && _buckets[i] != NULL; i++) { + for (i = rotatedHash & (_capacity - 1); + i < last && _buckets[i] != NULL; i++) { if (_buckets[i] == &deletedBucket) continue; if (_keyFunctions.equal(_buckets[i]->key, key)) return _buckets[i]->object; @@ -427,11 +435,11 @@ if (i < last) return nil; /* In case the last bucket is already used */ - last = hash & (_capacity - 1); + last = rotatedHash & (_capacity - 1); for (i = 0; i < last && _buckets[i] != NULL; i++) { if (_buckets[i] == &deletedBucket) continue; @@ -447,19 +455,21 @@ setObject(self, key, object, (uint32_t)_keyFunctions.hash(key)); } - (void)removeObjectForKey: (void *)key { - uint32_t i, hash, last; + uint32_t i, rotatedHash, last; if (key == NULL) @throw [OFInvalidArgumentException exception]; - hash = OFRotateLeft((uint32_t)_keyFunctions.hash(key), _rotate); + rotatedHash = OFRotateLeft((uint32_t)_keyFunctions.hash(key), + _rotation); last = _capacity; - for (i = hash & (_capacity - 1); i < last && _buckets[i] != NULL; i++) { + for (i = rotatedHash & (_capacity - 1); + i < last && _buckets[i] != NULL; i++) { if (_buckets[i] == &deletedBucket) continue; if (_keyFunctions.equal(_buckets[i]->key, key)) { _mutations++; @@ -479,11 +489,11 @@ if (i < last) return; /* In case the last bucket is already used */ - last = hash & (_capacity - 1); + last = rotatedHash & (_capacity - 1); for (i = 0; i < last && _buckets[i] != NULL; i++) { if (_buckets[i] == &deletedBucket) continue; @@ -523,15 +533,15 @@ _count = 0; _capacity = minCapacity; _buckets = OFResizeMemory(_buckets, _capacity, sizeof(*_buckets)); /* - * Get a new random value for _rotate, so that it is not less secure + * Get a new random value for _rotation, so that it is not less secure * than creating a new hash map. */ if (OFHashSeed != 0) - _rotate = OFRandom16() & 31; + _rotation = OFRandom16() & 31; } - (bool)containsObject: (void *)object { if (object == NULL || _count == 0) DELETED src/OFMapTableDictionary.h Index: src/OFMapTableDictionary.h ================================================================== --- src/OFMapTableDictionary.h +++ src/OFMapTableDictionary.h @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFDictionary.h" - -OF_ASSUME_NONNULL_BEGIN - -@class OFMapTable; -@class OFMapTableEnumerator; - -@interface OFMapTableDictionary: OFDictionary -{ - OFMapTable *_mapTable; -} - -- (instancetype)initWithCapacity: (size_t)capacity; -@end - -OF_ASSUME_NONNULL_END DELETED src/OFMapTableDictionary.m Index: src/OFMapTableDictionary.m ================================================================== --- src/OFMapTableDictionary.m +++ src/OFMapTableDictionary.m @@ -1,383 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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" - -#import "OFMapTableDictionary.h" -#import "OFArray.h" -#import "OFMapTable+Private.h" -#import "OFMapTable.h" -#import "OFMutableMapTableDictionary.h" -#import "OFString.h" - -#import "OFEnumerationMutationException.h" -#import "OFInvalidArgumentException.h" -#import "OFInvalidFormatException.h" - -static void * -copy(void *object) -{ - return [(id)object copy]; -} - -static void * -retain(void *object) -{ - return [(id)object retain]; -} - -static void -release(void *object) -{ - [(id)object release]; -} - -static unsigned long -hash(void *object) -{ - return [(id)object hash]; -} - -static bool -equal(void *object1, void *object2) -{ - return [(id)object1 isEqual: (id)object2]; -} - -static const OFMapTableFunctions keyFunctions = { - .retain = copy, - .release = release, - .hash = hash, - .equal = equal -}; -static const OFMapTableFunctions objectFunctions = { - .retain = retain, - .release = release, - .hash = hash, - .equal = equal -}; - -@implementation OFMapTableDictionary -- (instancetype)init -{ - return [self initWithCapacity: 0]; -} - -- (instancetype)initWithCapacity: (size_t)capacity -{ - self = [super init]; - - @try { - _mapTable = [[OFMapTable alloc] - initWithKeyFunctions: keyFunctions - objectFunctions: objectFunctions - capacity: capacity]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithDictionary: (OFDictionary *)dictionary -{ - size_t count; - - if (dictionary == nil) - return [self init]; - - if ([dictionary isKindOfClass: [OFMapTableDictionary class]] || - [dictionary isKindOfClass: [OFMutableMapTableDictionary class]]) { - self = [super init]; - - @try { - OFMapTableDictionary *dictionary_ = - (OFMapTableDictionary *)dictionary; - - _mapTable = [dictionary_->_mapTable copy]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; - } - - @try { - count = dictionary.count; - } @catch (id e) { - [self release]; - @throw e; - } - - self = [self initWithCapacity: count]; - - @try { - void *pool = objc_autoreleasePoolPush(); - OFEnumerator *keyEnumerator, *objectEnumerator; - id key, object; - - keyEnumerator = [dictionary keyEnumerator]; - objectEnumerator = [dictionary objectEnumerator]; - while ((key = [keyEnumerator nextObject]) != nil && - (object = [objectEnumerator nextObject]) != nil) - [_mapTable setObject: object forKey: key]; - - objc_autoreleasePoolPop(pool); - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithObject: (id)object forKey: (id)key -{ - self = [self initWithCapacity: 1]; - - @try { - [_mapTable setObject: object forKey: key]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithObjects: (id const *)objects - forKeys: (id const *)keys - count: (size_t)count -{ - self = [self initWithCapacity: count]; - - @try { - size_t i; - - for (i = 0; i < count; i++) - [_mapTable setObject: objects[i] forKey: keys[i]]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithKey: (id)firstKey arguments: (va_list)arguments -{ - self = [super init]; - - @try { - va_list argumentsCopy; - id key, object; - size_t i, count; - - va_copy(argumentsCopy, arguments); - - if (firstKey == nil) - @throw [OFInvalidArgumentException exception]; - - key = firstKey; - - if ((object = va_arg(arguments, id)) == nil) - @throw [OFInvalidArgumentException exception]; - - count = 1; - for (; va_arg(argumentsCopy, id) != nil; count++); - - if (count % 2 != 0) - @throw [OFInvalidArgumentException exception]; - - count /= 2; - - _mapTable = [[OFMapTable alloc] - initWithKeyFunctions: keyFunctions - objectFunctions: objectFunctions - capacity: count]; - - [_mapTable setObject: object forKey: key]; - - for (i = 1; i < count; i++) { - key = va_arg(arguments, id); - object = va_arg(arguments, id); - - if (key == nil || object == nil) - @throw [OFInvalidArgumentException exception]; - - [_mapTable setObject: object forKey: key]; - } - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [_mapTable release]; - - [super dealloc]; -} - -- (id)objectForKey: (id)key -{ - return [_mapTable objectForKey: key]; -} - -- (size_t)count -{ - return _mapTable.count; -} - -- (bool)isEqual: (id)object -{ - OFMapTableDictionary *dictionary; - - if (object == self) - return true; - - if (![object isKindOfClass: [OFMapTableDictionary class]] && - ![object isKindOfClass: [OFMutableMapTableDictionary class]]) - return [super isEqual: object]; - - dictionary = (OFMapTableDictionary *)object; - - return [dictionary->_mapTable isEqual: _mapTable]; -} - -- (bool)containsObject: (id)object -{ - return [_mapTable containsObject: object]; -} - -- (bool)containsObjectIdenticalTo: (id)object -{ - return [_mapTable containsObjectIdenticalTo: object]; -} - -- (OFArray *)allKeys -{ - OFArray *ret; - id *keys; - size_t count; - - count = _mapTable.count; - keys = OFAllocMemory(count, sizeof(*keys)); - - @try { - void *pool = objc_autoreleasePoolPush(); - OFMapTableEnumerator *enumerator; - void **keyPtr; - size_t i; - - i = 0; - enumerator = [_mapTable keyEnumerator]; - while ((keyPtr = [enumerator nextObject]) != NULL) { - OFAssert(i < count); - - keys[i++] = (id)*keyPtr; - } - - objc_autoreleasePoolPop(pool); - - ret = [OFArray arrayWithObjects: keys count: count]; - } @finally { - OFFreeMemory(keys); - } - - return ret; -} - -- (OFArray *)allObjects -{ - OFArray *ret; - id *objects; - size_t count; - - count = _mapTable.count; - objects = OFAllocMemory(count, sizeof(*objects)); - - @try { - void *pool = objc_autoreleasePoolPush(); - OFMapTableEnumerator *enumerator; - void **objectPtr; - size_t i; - - i = 0; - enumerator = [_mapTable objectEnumerator]; - while ((objectPtr = [enumerator nextObject]) != NULL) { - OFAssert(i < count); - - objects[i++] = (id)*objectPtr; - } - - objc_autoreleasePoolPop(pool); - - ret = [OFArray arrayWithObjects: objects count: count]; - } @finally { - OFFreeMemory(objects); - } - - return ret; -} - -- (OFEnumerator *)keyEnumerator -{ - return [[[OFMapTableEnumeratorWrapper alloc] - initWithEnumerator: [_mapTable keyEnumerator] - object: self] autorelease]; -} - -- (OFEnumerator *)objectEnumerator -{ - return [[[OFMapTableEnumeratorWrapper alloc] - initWithEnumerator: [_mapTable objectEnumerator] - object: self] autorelease]; -} - -- (int)countByEnumeratingWithState: (OFFastEnumerationState *)state - objects: (id *)objects - count: (int)count -{ - return [_mapTable countByEnumeratingWithState: state - objects: objects - count: count]; -} - -#ifdef OF_HAVE_BLOCKS -- (void)enumerateKeysAndObjectsUsingBlock: (OFDictionaryEnumerationBlock)block -{ - @try { - [_mapTable enumerateKeysAndObjectsUsingBlock: - ^ (void *key, void *object, bool *stop) { - block(key, object, stop); - }]; - } @catch (OFEnumerationMutationException *e) { - @throw [OFEnumerationMutationException - exceptionWithObject: self]; - } -} -#endif - -- (unsigned long)hash -{ - return _mapTable.hash; -} -@end DELETED src/OFMapTableSet.h Index: src/OFMapTableSet.h ================================================================== --- src/OFMapTableSet.h +++ src/OFMapTableSet.h @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFSet.h" - -OF_ASSUME_NONNULL_BEGIN - -@class OFMapTable; - -@interface OFMapTableSet: OFSet -{ - OFMapTable *_mapTable; -} - -- (instancetype)initWithCapacity: (size_t)capacity; -@end - -OF_ASSUME_NONNULL_END DELETED src/OFMapTableSet.m Index: src/OFMapTableSet.m ================================================================== --- src/OFMapTableSet.m +++ src/OFMapTableSet.m @@ -1,270 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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" - -#import "OFMapTableSet.h" -#import "OFArray.h" -#import "OFCountedMapTableSet.h" -#import "OFMapTable.h" -#import "OFMapTable+Private.h" -#import "OFMutableMapTableSet.h" -#import "OFString.h" - -#import "OFInvalidArgumentException.h" -#import "OFEnumerationMutationException.h" - -static void * -retain(void *object) -{ - return [(id)object retain]; -} - -static void -release(void *object) -{ - [(id)object release]; -} - -static unsigned long -hash(void *object) -{ - return [(id)object hash]; -} - -static bool -equal(void *object1, void *object2) -{ - return [(id)object1 isEqual: (id)object2]; -} - -static const OFMapTableFunctions keyFunctions = { - .retain = retain, - .release = release, - .hash = hash, - .equal = equal -}; -static const OFMapTableFunctions objectFunctions = { NULL }; - -@implementation OFMapTableSet -- (instancetype)init -{ - return [self initWithCapacity: 0]; -} - -- (instancetype)initWithCapacity: (size_t)capacity -{ - self = [super init]; - - @try { - _mapTable = [[OFMapTable alloc] - initWithKeyFunctions: keyFunctions - objectFunctions: objectFunctions - capacity: capacity]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithSet: (OFSet *)set -{ - size_t count; - - if (set == nil) - return [self init]; - - @try { - count = set.count; - } @catch (id e) { - [self release]; - @throw e; - } - - self = [self initWithCapacity: count]; - - @try { - for (id object in set) - [_mapTable setObject: (void *)1 forKey: object]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithArray: (OFArray *)array -{ - size_t count; - - if (array == nil) - return self; - - @try { - count = array.count; - } @catch (id e) { - [self release]; - @throw e; - } - - self = [self initWithCapacity: count]; - - @try { - for (id object in array) - [_mapTable setObject: (void *)1 forKey: object]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithObjects: (id const *)objects count: (size_t)count -{ - self = [self initWithCapacity: count]; - - @try { - for (size_t i = 0; i < count; i++) - [_mapTable setObject: (void *)1 forKey: objects[i]]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments -{ - self = [super init]; - - @try { - id object; - va_list argumentsCopy; - size_t count; - - va_copy(argumentsCopy, arguments); - - for (count = 1; va_arg(argumentsCopy, id) != nil; count++); - - _mapTable = [[OFMapTable alloc] - initWithKeyFunctions: keyFunctions - objectFunctions: objectFunctions - capacity: count]; - - [_mapTable setObject: (void *)1 forKey: firstObject]; - - while ((object = va_arg(arguments, id)) != nil) - [_mapTable setObject: (void *)1 forKey: object]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [_mapTable release]; - - [super dealloc]; -} - -- (size_t)count -{ - return [_mapTable count]; -} - -- (bool)containsObject: (id)object -{ - if (object == nil) - return false; - - return ([_mapTable objectForKey: object] != nil); -} - -- (bool)isEqual: (id)object -{ - OFMapTableSet *set; - - if (object == self) - return true; - - if (![object isKindOfClass: [OFMapTableSet class]] && - ![object isKindOfClass: [OFMutableMapTableSet class]] && - ![object isKindOfClass: [OFCountedMapTableSet class]]) - return [super isEqual: object]; - - set = object; - - return [set->_mapTable isEqual: _mapTable]; -} - -- (id)anyObject -{ - void *pool = objc_autoreleasePoolPush(); - void **objectPtr; - id object; - - objectPtr = [[_mapTable keyEnumerator] nextObject]; - - if (objectPtr == NULL) { - objc_autoreleasePoolPop(pool); - return nil; - } - - object = [(id)*objectPtr retain]; - - objc_autoreleasePoolPop(pool); - - return [object autorelease]; -} - -- (OFEnumerator *)objectEnumerator -{ - return [[[OFMapTableEnumeratorWrapper alloc] - initWithEnumerator: [_mapTable keyEnumerator] - object: self] autorelease]; -} - -- (int)countByEnumeratingWithState: (OFFastEnumerationState *)state - objects: (id *)objects - count: (int)count -{ - return [_mapTable countByEnumeratingWithState: state - objects: objects - count: count]; -} - -#ifdef OF_HAVE_BLOCKS -- (void)enumerateObjectsUsingBlock: (OFSetEnumerationBlock)block -{ - @try { - [_mapTable enumerateKeysAndObjectsUsingBlock: - ^ (void *key, void *object, bool *stop) { - block(key, stop); - }]; - } @catch (OFEnumerationMutationException *e) { - @throw [OFEnumerationMutationException - exceptionWithObject: self]; - } -} -#endif -@end Index: src/OFMatrix4x4.h ================================================================== --- src/OFMatrix4x4.h +++ src/OFMatrix4x4.h @@ -48,17 +48,20 @@ * @param values A 2D array of 4x4 floats in row-major format * @return A new, autoreleased OFMatrix4x4 */ + (instancetype)matrixWithValues: (const float [_Nonnull 4][4])values; +- (instancetype)init OF_UNAVAILABLE; + /** * @brief Initializes an already allocated 4x4 matrix with the specified values. * * @param values A 2D array of 4x4 floats in row-major format * @return An initialized OFMatrix4x4 */ -- (instancetype)initWithValues: (const float [_Nonnull 4][4])values; +- (instancetype)initWithValues: (const float [_Nonnull 4][4])values + OF_DESIGNATED_INITIALIZER; /** * @brief Mulitplies the receiver with the specified matrix on the left side * and the receiver on the right side. * Index: src/OFMatrix4x4.m ================================================================== --- src/OFMatrix4x4.m +++ src/OFMatrix4x4.m @@ -35,10 +35,15 @@ + (instancetype)matrixWithValues: (const float [4][4])values { return [[[self alloc] initWithValues: values] autorelease]; } + +- (instancetype)init +{ + OF_INVALID_INIT_METHOD +} - (instancetype)initWithValues: (const float [4][4])values { self = [super init]; Index: src/OFMethodSignature.h ================================================================== --- src/OFMethodSignature.h +++ src/OFMethodSignature.h @@ -55,19 +55,22 @@ * @return A new, autoreleased OFMethodSignature * @throw OFInvalidFormatException The type encoding is invalid */ + (instancetype)signatureWithObjCTypes: (const char *)types; +- (instancetype)init OF_UNAVAILABLE; + /** * @brief Initializes an already allocated OFMethodSignature with the specified * ObjC types. * * @param types The ObjC types of the method * @return An Initialized OFMethodSignature * @throw OFInvalidFormatException The type encoding is invalid */ -- (instancetype)initWithObjCTypes: (const char *)types; +- (instancetype)initWithObjCTypes: (const char *)types + OF_DESIGNATED_INITIALIZER; /** * @brief Returns the ObjC type for the argument at the specified index. * * @param index The index of the argument for which to return the ObjC type Index: src/OFMethodSignature.m ================================================================== --- src/OFMethodSignature.m +++ src/OFMethodSignature.m @@ -589,10 +589,15 @@ @implementation OFMethodSignature + (instancetype)signatureWithObjCTypes: (const char*)types { return [[[self alloc] initWithObjCTypes: types] autorelease]; } + +- (instancetype)init +{ + OF_INVALID_INIT_METHOD +} - (instancetype)initWithObjCTypes: (const char *)types { self = [super init]; DELETED src/OFMutableAdjacentArray.h Index: src/OFMutableAdjacentArray.h ================================================================== --- src/OFMutableAdjacentArray.h +++ src/OFMutableAdjacentArray.h @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFArray.h" - -OF_ASSUME_NONNULL_BEGIN - -@class OFMutableData; - -@interface OFMutableAdjacentArray: OFMutableArray -{ - OFMutableData *_array; - unsigned long _mutations; -} -@end - -OF_ASSUME_NONNULL_END DELETED src/OFMutableAdjacentArray.m Index: src/OFMutableAdjacentArray.m ================================================================== --- src/OFMutableAdjacentArray.m +++ src/OFMutableAdjacentArray.m @@ -1,383 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 - -#import "OFMutableAdjacentArray.h" -#import "OFAdjacentArray.h" -#import "OFArray+Private.h" -#import "OFData.h" - -#import "OFEnumerationMutationException.h" -#import "OFInvalidArgumentException.h" -#import "OFOutOfRangeException.h" - -@implementation OFMutableAdjacentArray -+ (void)initialize -{ - if (self == [OFMutableAdjacentArray class]) - [self inheritMethodsFromClass: [OFAdjacentArray class]]; -} - -- (instancetype)initWithCapacity: (size_t)capacity -{ - self = [super init]; - - @try { - _array = [[OFMutableData alloc] initWithItemSize: sizeof(id) - capacity: capacity]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)addObject: (id)object -{ - if (object == nil) - @throw [OFInvalidArgumentException exception]; - - [_array addItem: &object]; - [object retain]; - - _mutations++; -} - -- (void)insertObject: (id)object atIndex: (size_t)idx -{ - if (object == nil) - @throw [OFInvalidArgumentException exception]; - - @try { - [_array insertItem: &object atIndex: idx]; - } @catch (OFOutOfRangeException *e) { - @throw [OFOutOfRangeException exception]; - } - [object retain]; - - _mutations++; -} - -- (void)insertObjectsFromArray: (OFArray *)array atIndex: (size_t)idx -{ - id const *objects = array.objects; - size_t count = array.count; - - @try { - [_array insertItems: objects atIndex: idx count: count]; - } @catch (OFOutOfRangeException *e) { - @throw [OFOutOfRangeException exception]; - } - - for (size_t i = 0; i < count; i++) - [objects[i] retain]; - - _mutations++; -} - -- (void)replaceObject: (id)oldObject withObject: (id)newObject -{ - id *objects; - size_t count; - - if (oldObject == nil || newObject == nil) - @throw [OFInvalidArgumentException exception]; - - objects = _array.mutableItems; - count = _array.count; - - for (size_t i = 0; i < count; i++) { - if ([objects[i] isEqual: oldObject]) { - [newObject retain]; - [objects[i] release]; - objects[i] = newObject; - } - } -} - -- (void)replaceObjectAtIndex: (size_t)idx withObject: (id)object -{ - id *objects; - id oldObject; - - if (object == nil) - @throw [OFInvalidArgumentException exception]; - - objects = _array.mutableItems; - - if (idx >= _array.count) - @throw [OFOutOfRangeException exception]; - - oldObject = objects[idx]; - objects[idx] = [object retain]; - [oldObject release]; -} - -- (void)replaceObjectIdenticalTo: (id)oldObject withObject: (id)newObject -{ - id *objects; - size_t count; - - if (oldObject == nil || newObject == nil) - @throw [OFInvalidArgumentException exception]; - - objects = _array.mutableItems; - count = _array.count; - - for (size_t i = 0; i < count; i++) { - if (objects[i] == oldObject) { - [newObject retain]; - [objects[i] release]; - objects[i] = newObject; - - return; - } - } -} - -- (void)removeObject: (id)object -{ - id const *objects; - size_t count; - - if (object == nil) - @throw [OFInvalidArgumentException exception]; - - objects = _array.items; - count = _array.count; - - for (size_t i = 0; i < count; i++) { - if ([objects[i] isEqual: object]) { - id tmp = objects[i]; - - [_array removeItemAtIndex: i]; - _mutations++; - - [tmp release]; - - objects = _array.items; - i--; - count--; - continue; - } - } -} - -- (void)removeObjectIdenticalTo: (id)object -{ - id const *objects; - size_t count; - - if (object == nil) - @throw [OFInvalidArgumentException exception]; - - objects = _array.items; - count = _array.count; - - for (size_t i = 0; i < count; i++) { - if (objects[i] == object) { - [_array removeItemAtIndex: i]; - _mutations++; - - [object release]; - - objects = _array.items; - i--; - count--; - continue; - } - } -} - -- (void)removeObjectAtIndex: (size_t)idx -{ -#ifndef __clang_analyzer__ - id object = [self objectAtIndex: idx]; - [_array removeItemAtIndex: idx]; - [object release]; - - _mutations++; -#endif -} - -- (void)removeAllObjects -{ - id const *objects = _array.items; - size_t count = _array.count; - - for (size_t i = 0; i < count; i++) - [objects[i] release]; - - [_array removeAllItems]; -} - -- (void)removeObjectsInRange: (OFRange)range -{ - id const *objects = _array.items; - size_t count = _array.count; - id *copy; - - if (range.length > SIZE_MAX - range.location || - range.location >= count || range.length > count - range.location) - @throw [OFOutOfRangeException exception]; - - copy = OFAllocMemory(range.length, sizeof(*copy)); - memcpy(copy, objects + range.location, range.length * sizeof(id)); - - @try { - [_array removeItemsInRange: range]; - _mutations++; - - for (size_t i = 0; i < range.length; i++) - [copy[i] release]; - } @finally { - OFFreeMemory(copy); - } -} - -- (void)removeLastObject -{ -#ifndef __clang_analyzer__ - size_t count = _array.count; - id object; - - if (count == 0) - return; - - object = [self objectAtIndex: count - 1]; - [_array removeLastItem]; - [object release]; - - _mutations++; -#endif -} - -- (void)exchangeObjectAtIndex: (size_t)idx1 withObjectAtIndex: (size_t)idx2 -{ - id *objects = _array.mutableItems; - size_t count = _array.count; - id tmp; - - if (idx1 >= count || idx2 >= count) - @throw [OFOutOfRangeException exception]; - - tmp = objects[idx1]; - objects[idx1] = objects[idx2]; - objects[idx2] = tmp; -} - -- (void)reverse -{ - id *objects = _array.mutableItems; - size_t i, j, count = _array.count; - - if (count == 0 || count == 1) - return; - - for (i = 0, j = count - 1; i < j; i++, j--) { - id tmp = objects[i]; - objects[i] = objects[j]; - objects[j] = tmp; - } -} - -- (int)countByEnumeratingWithState: (OFFastEnumerationState *)state - objects: (id *)objects - count: (int)count_ -{ - size_t count = _array.count; - - if (count > INT_MAX) { - /* - * Use the implementation from OFArray (OFMutableArray does not - * have one), which is slower, but can enumerate in chunks, and - * set the mutations pointer. - */ - int ret = [super countByEnumeratingWithState: state - objects: objects - count: count_]; - state->mutationsPtr = &_mutations; - return ret; - } - - if (state->state >= count) - return 0; - - state->state = (unsigned long)count; - state->itemsPtr = (id *)_array.items; - state->mutationsPtr = &_mutations; - - return (int)count; -} - -- (OFEnumerator *)objectEnumerator -{ - return [[[OFArrayEnumerator alloc] - initWithArray: self - mutationsPtr: &_mutations] autorelease]; -} - -#ifdef OF_HAVE_BLOCKS -- (void)enumerateObjectsUsingBlock: (OFArrayEnumerationBlock)block -{ - id const *objects = _array.items; - size_t count = _array.count; - bool stop = false; - unsigned long mutations = _mutations; - - for (size_t i = 0; i < count && !stop; i++) { - if (_mutations != mutations) - @throw [OFEnumerationMutationException - exceptionWithObject: self]; - - block(objects[i], i, &stop); - } -} - -- (void)replaceObjectsUsingBlock: (OFArrayReplaceBlock)block -{ - id *objects = _array.mutableItems; - size_t count = _array.count; - unsigned long mutations = _mutations; - - for (size_t i = 0; i < count; i++) { - id new; - - if (_mutations != mutations) - @throw [OFEnumerationMutationException - exceptionWithObject: self]; - - new = block(objects[i], i); - - if (new == nil) - @throw [OFInvalidArgumentException exception]; - - if (new != objects[i]) { - [objects[i] release]; - objects[i] = [new retain]; - } - } -} -#endif - -- (void)makeImmutable -{ - object_setClass(self, [OFAdjacentArray class]); -} -@end Index: src/OFMutableArray.h ================================================================== --- src/OFMutableArray.h +++ src/OFMutableArray.h @@ -51,18 +51,25 @@ * @param capacity The initial capacity for the OFMutableArray * @return A new autoreleased OFMutableArray */ + (instancetype)arrayWithCapacity: (size_t)capacity; +/** + * @brief Initializes an OFMutableArray with no objects. + * + * @return An initialized OFMutableArray + */ +- (instancetype)init OF_DESIGNATED_INITIALIZER; + /** * @brief Initializes an already allocated OFMutableArray with enough memory to * hold the specified number of objects. * * @param capacity The initial capacity for the OFMutableArray * @return An initialized OFMutableArray */ -- (instancetype)initWithCapacity: (size_t)capacity; +- (instancetype)initWithCapacity: (size_t)capacity OF_DESIGNATED_INITIALIZER; /** * @brief Adds an object to the end of the array. * * @param object An object to add Index: src/OFMutableArray.m ================================================================== --- src/OFMutableArray.m +++ src/OFMutableArray.m @@ -17,21 +17,21 @@ #include #include #import "OFMutableArray.h" -#import "OFMutableAdjacentArray.h" +#import "OFConcreteMutableArray.h" #import "OFEnumerationMutationException.h" #import "OFInvalidArgumentException.h" #import "OFOutOfRangeException.h" static struct { Class isa; } placeholder; -@interface OFMutableArrayPlaceholder: OFMutableArray +@interface OFPlaceholderMutableArray: OFMutableArray @end static void quicksort(OFMutableArray *array, size_t left, size_t right, OFCompareFunction compare, void *context, OFArraySortOptions options) @@ -76,81 +76,74 @@ left = i + 1; } } -@implementation OFMutableArrayPlaceholder +@implementation OFPlaceholderMutableArray +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif - (instancetype)init { - return (id)[[OFMutableAdjacentArray alloc] init]; + return (id)[[OFConcreteMutableArray alloc] init]; } - (instancetype)initWithCapacity: (size_t)capacity { - return (id)[[OFMutableAdjacentArray alloc] initWithCapacity: capacity]; + return (id)[[OFConcreteMutableArray alloc] initWithCapacity: capacity]; } - (instancetype)initWithObject: (id)object { - return (id)[[OFMutableAdjacentArray alloc] initWithObject: object]; + return (id)[[OFConcreteMutableArray alloc] initWithObject: object]; } - (instancetype)initWithObjects: (id)firstObject, ... { id ret; va_list arguments; va_start(arguments, firstObject); - ret = [[OFMutableAdjacentArray alloc] initWithObject: firstObject + ret = [[OFConcreteMutableArray alloc] initWithObject: firstObject arguments: arguments]; va_end(arguments); return ret; } - (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments { - return (id)[[OFMutableAdjacentArray alloc] initWithObject: firstObject + return (id)[[OFConcreteMutableArray alloc] initWithObject: firstObject arguments: arguments]; } - (instancetype)initWithArray: (OFArray *)array { - return (id)[[OFMutableAdjacentArray alloc] initWithArray: array]; + return (id)[[OFConcreteMutableArray alloc] initWithArray: array]; } - (instancetype)initWithObjects: (id const *)objects count: (size_t)count { - return (id)[[OFMutableAdjacentArray alloc] initWithObjects: objects + return (id)[[OFConcreteMutableArray alloc] initWithObjects: objects count: count]; } - -- (instancetype)retain -{ - return self; -} - -- (instancetype)autorelease -{ - return self; -} - -- (void)release -{ -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + +OF_SINGLETON_METHODS @end @implementation OFMutableArray + (void)initialize { if (self == [OFMutableArray class]) - placeholder.isa = [OFMutableArrayPlaceholder class]; + object_setClass((id)&placeholder, + [OFPlaceholderMutableArray class]); } + (instancetype)alloc { if (self == [OFMutableArray class]) @@ -164,27 +157,32 @@ return [[[self alloc] initWithCapacity: capacity] autorelease]; } - (instancetype)init { - if ([self isMemberOfClass: [OFMutableArray class]]) { - @try { - [self doesNotRecognizeSelector: _cmd]; - abort(); - } @catch (id e) { - [self release]; - @throw e; - } - } - return [super init]; } + +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif +- (instancetype)initWithObjects: (id const *)objects + count: (size_t)count +{ + OF_INVALID_INIT_METHOD +} - (instancetype)initWithCapacity: (size_t)capacity { OF_INVALID_INIT_METHOD } +#ifdef __clang__ +# pragma clang diagnostic pop +#endif - (id)copy { return [[OFArray alloc] initWithArray: self]; } Index: src/OFMutableData.h ================================================================== --- src/OFMutableData.h +++ src/OFMutableData.h @@ -15,23 +15,16 @@ #import "OFData.h" OF_ASSUME_NONNULL_BEGIN -@class OFString; - /** * @class OFMutableData OFMutableData.h ObjFW/OFMutableData.h * * @brief A class for storing and manipulating arbitrary data in an array. */ @interface OFMutableData: OFData -{ - size_t _capacity; - OF_RESERVE_IVARS(OFMutableData, 4) -} - /** * @brief All items of the OFMutableData as a C array. * * @warning The pointer is only valid until the OFMutableData is changed! * @@ -51,26 +44,10 @@ * @brief The last item of the OFMutableData or `NULL`. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) void *mutableLastItem OF_RETURNS_INNER_POINTER; -/** - * @brief Creates a new OFMutableData with an item size of 1. - * - * @return A new autoreleased OFMutableData - */ -+ (instancetype)data; - -/** - * @brief Creates a new OFMutableData whose items all have the same specified - * size. - * - * @param itemSize The size of a single element in the OFMutableData - * @return A new autoreleased OFMutableData - */ -+ (instancetype)dataWithItemSize: (size_t)itemSize; - /** * @brief Creates a new OFMutableData with enough memory to hold the specified * number of items which all have an item size of 1. * * @param capacity The initial capacity for the OFMutableData @@ -86,26 +63,10 @@ * @param capacity The initial capacity for the OFMutableData * @return A new autoreleased OFMutableData */ + (instancetype)dataWithItemSize: (size_t)itemSize capacity: (size_t)capacity; -/** - * @brief Initializes an already allocated OFMutableData with an item size of 1. - * - * @return An initialized OFMutableData - */ -- (instancetype)init; - -/** - * @brief Initializes an already allocated OFMutableData whose items all have - * the same size. - * - * @param itemSize The size of a single element in the OFMutableData - * @return An initialized OFMutableData - */ -- (instancetype)initWithItemSize: (size_t)itemSize; - /** * @brief Initializes an already allocated OFMutableData with enough memory to * hold the the specified number of items which all have an item size of * 1. * Index: src/OFMutableData.m ================================================================== --- src/OFMutableData.m +++ src/OFMutableData.m @@ -18,20 +18,121 @@ #include #include #include #import "OFMutableData.h" -#import "OFString.h" +#import "OFConcreteMutableData.h" -#import "OFInvalidArgumentException.h" -#import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" + +static struct { + Class isa; +} placeholder; + +@interface OFPlaceholderMutableData: OFMutableData +@end + +@implementation OFPlaceholderMutableData +- (instancetype)init +{ + return (id)[[OFConcreteMutableData alloc] init]; +} + +- (instancetype)initWithItemSize: (size_t)itemSize +{ + return (id)[[OFConcreteMutableData alloc] initWithItemSize: itemSize]; +} + +- (instancetype)initWithItems: (const void *)items count: (size_t)count +{ + return (id)[[OFConcreteMutableData alloc] initWithItems: items + count: count]; +} + +- (instancetype)initWithItems: (const void *)items + count: (size_t)count + itemSize: (size_t)itemSize +{ + return (id)[[OFConcreteMutableData alloc] initWithItems: items + count: count + itemSize: itemSize]; +} + +- (instancetype)initWithItemsNoCopy: (void *)items + count: (size_t)count + freeWhenDone: (bool)freeWhenDone +{ + return (id)[[OFConcreteMutableData alloc] + initWithItemsNoCopy: items + count: count + freeWhenDone: freeWhenDone]; +} + +- (instancetype)initWithItemsNoCopy: (void *)items + count: (size_t)count + itemSize: (size_t)itemSize + freeWhenDone: (bool)freeWhenDone +{ + return (id)[[OFConcreteMutableData alloc] + initWithItemsNoCopy: items + count: count + itemSize: itemSize + freeWhenDone: freeWhenDone]; +} + +#ifdef OF_HAVE_FILES +- (instancetype)initWithContentsOfFile: (OFString *)path +{ + return (id)[[OFConcreteMutableData alloc] initWithContentsOfFile: path]; +} +#endif + +- (instancetype)initWithContentsOfIRI: (OFIRI *)IRI +{ + return (id)[[OFConcreteMutableData alloc] initWithContentsOfIRI: IRI]; +} + +- (instancetype)initWithStringRepresentation: (OFString *)string +{ + return (id)[[OFConcreteMutableData alloc] + initWithStringRepresentation: string]; +} + +- (instancetype)initWithBase64EncodedString: (OFString *)string +{ + return (id)[[OFConcreteMutableData alloc] + initWithBase64EncodedString: string]; +} + +- (instancetype)initWithCapacity: (size_t)capacity +{ + return (id)[[OFConcreteMutableData alloc] initWithCapacity: capacity]; +} + +- (instancetype)initWithItemSize: (size_t)itemSize capacity: (size_t)capacity +{ + return (id)[[OFConcreteMutableData alloc] initWithItemSize: itemSize + capacity: capacity]; +} + +OF_SINGLETON_METHODS +@end @implementation OFMutableData -+ (instancetype)data ++ (void)initialize +{ + if (self == [OFMutableData class]) + object_setClass((id)&placeholder, + [OFPlaceholderMutableData class]); +} + ++ (instancetype)alloc { - return [[[self alloc] init] autorelease]; + if (self == [OFMutableData class]) + return (id)&placeholder; + + return [super alloc]; } + (instancetype)dataWithItemSize: (size_t)itemSize { return [[[self alloc] initWithItemSize: itemSize] autorelease]; @@ -46,73 +147,23 @@ { return [[[self alloc] initWithItemSize: itemSize capacity: capacity] autorelease]; } -- (instancetype)init -{ - self = [super init]; - - _itemSize = 1; - _freeWhenDone = true; - - return self; -} - - (instancetype)initWithItemSize: (size_t)itemSize { - self = [super init]; - - @try { - if (itemSize == 0) - @throw [OFInvalidArgumentException exception]; - - _itemSize = itemSize; - _freeWhenDone = true; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; + return [self initWithItemSize: 1 capacity: 0]; } - (instancetype)initWithCapacity: (size_t)capacity { - return [self initWithItemSize: 1 - capacity: capacity]; + return [self initWithItemSize: 1 capacity: capacity]; } - (instancetype)initWithItemSize: (size_t)itemSize capacity: (size_t)capacity { - self = [super init]; - - @try { - if (itemSize == 0) - @throw [OFInvalidArgumentException exception]; - - _items = OFAllocMemory(capacity, itemSize); - _itemSize = itemSize; - _capacity = capacity; - _freeWhenDone = true; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (instancetype)initWithItems: (const void *)items - count: (size_t)count - itemSize: (size_t)itemSize -{ - self = [super initWithItems: items count: count itemSize: itemSize]; - - _capacity = _count; - - return self; + OF_INVALID_INIT_METHOD } - (instancetype)initWithItemsNoCopy: (void *)items count: (size_t)count itemSize: (size_t)itemSize @@ -124,188 +175,117 @@ OFFreeMemory(items); return self; } -- (instancetype)initWithStringRepresentation: (OFString *)string -{ - self = [super initWithStringRepresentation: string]; - - _capacity = _count; - - return self; -} - - (void *)mutableItems { - return _items; + OF_UNRECOGNIZED_SELECTOR } - (void *)mutableItemAtIndex: (size_t)idx { - if (idx >= _count) + if (idx >= self.count) @throw [OFOutOfRangeException exception]; - return _items + idx * _itemSize; + return (unsigned char *)self.mutableItems + idx * self.itemSize; } - (void *)mutableFirstItem { - if (_items == NULL || _count == 0) + void *mutableItems = self.mutableItems; + + if (mutableItems == NULL || self.count == 0) return NULL; - return _items; + return mutableItems; } - (void *)mutableLastItem { - if (_items == NULL || _count == 0) + unsigned char *mutableItems = self.mutableItems; + size_t count = self.count; + + if (mutableItems == NULL || count == 0) return NULL; - return _items + (_count - 1) * _itemSize; + return mutableItems + (count - 1) * self.itemSize; } - (OFData *)subdataWithRange: (OFRange)range { + size_t itemSize; + if (range.length > SIZE_MAX - range.location || - range.location + range.length > _count) + range.location + range.length > self.count) @throw [OFOutOfRangeException exception]; - return [OFData dataWithItems: _items + (range.location * _itemSize) + itemSize = self.itemSize; + return [OFData dataWithItems: (unsigned char *)self.mutableItems + + (range.location * itemSize) count: range.length - itemSize: _itemSize]; + itemSize: itemSize]; } - (void)addItem: (const void *)item { - if (SIZE_MAX - _count < 1) - @throw [OFOutOfRangeException exception]; - - if (_count + 1 > _capacity) { - _items = OFResizeMemory(_items, _count + 1, _itemSize); - _capacity = _count + 1; - } - - memcpy(_items + _count * _itemSize, item, _itemSize); - - _count++; + [self insertItems: item atIndex: self.count count: 1]; } - (void)insertItem: (const void *)item atIndex: (size_t)idx { [self insertItems: item atIndex: idx count: 1]; } - (void)addItems: (const void *)items count: (size_t)count { - if (count > SIZE_MAX - _count) - @throw [OFOutOfRangeException exception]; - - if (_count + count > _capacity) { - _items = OFResizeMemory(_items, _count + count, _itemSize); - _capacity = _count + count; - } - - memcpy(_items + _count * _itemSize, items, count * _itemSize); - _count += count; + [self insertItems: items atIndex: self.count count: count]; } - (void)insertItems: (const void *)items atIndex: (size_t)idx count: (size_t)count { - if (count > SIZE_MAX - _count || idx > _count) - @throw [OFOutOfRangeException exception]; - - if (_count + count > _capacity) { - _items = OFResizeMemory(_items, _count + count, _itemSize); - _capacity = _count + count; - } - - memmove(_items + (idx + count) * _itemSize, _items + idx * _itemSize, - (_count - idx) * _itemSize); - memcpy(_items + idx * _itemSize, items, count * _itemSize); - - _count += count; + OF_UNRECOGNIZED_SELECTOR } - (void)increaseCountBy: (size_t)count { - if (count > SIZE_MAX - _count) - @throw [OFOutOfRangeException exception]; - - if (_count + count > _capacity) { - _items = OFResizeMemory(_items, _count + count, _itemSize); - _capacity = _count + count; - } - - memset(_items + _count * _itemSize, '\0', count * _itemSize); - _count += count; + OF_UNRECOGNIZED_SELECTOR } - (void)removeItemAtIndex: (size_t)idx { [self removeItemsInRange: OFMakeRange(idx, 1)]; } - (void)removeItemsInRange: (OFRange)range { - if (range.length > SIZE_MAX - range.location || - range.location + range.length > _count) - @throw [OFOutOfRangeException exception]; - - memmove(_items + range.location * _itemSize, - _items + (range.location + range.length) * _itemSize, - (_count - range.location - range.length) * _itemSize); - - _count -= range.length; - @try { - _items = OFResizeMemory(_items, _count, _itemSize); - _capacity = _count; - } @catch (OFOutOfMemoryException *e) { - /* We don't really care, as we only made it smaller */ - } + OF_UNRECOGNIZED_SELECTOR } - (void)removeLastItem { - if (_count == 0) + size_t count = self.count; + + if (count == 0) return; - _count--; - @try { - _items = OFResizeMemory(_items, _count, _itemSize); - _capacity = _count; - } @catch (OFOutOfMemoryException *e) { - /* We don't care, as we only made it smaller */ - } + [self removeItemsInRange: OFMakeRange(count - 1, 1)]; } - (void)removeAllItems { - OFFreeMemory(_items); - _items = NULL; - _count = 0; - _capacity = 0; + [self removeItemsInRange: OFMakeRange(0, self.count)]; } - (id)copy { - return [[OFData alloc] initWithItems: _items - count: _count - itemSize: _itemSize]; + return [[OFData alloc] initWithItems: self.mutableItems + count: self.count + itemSize: self.itemSize]; } - (void)makeImmutable { - if (_capacity != _count) { - @try { - _items = OFResizeMemory(_items, _count, _itemSize); - _capacity = _count; - } @catch (OFOutOfMemoryException *e) { - /* We don't care, as we only made it smaller */ - } - } - - object_setClass(self, [OFData class]); } @end Index: src/OFMutableDictionary.h ================================================================== --- src/OFMutableDictionary.h +++ src/OFMutableDictionary.h @@ -52,18 +52,25 @@ * @param capacity The initial capacity for the OFMutableDictionary * @return A new autoreleased OFMutableDictionary */ + (instancetype)dictionaryWithCapacity: (size_t)capacity; +/** + * @brief Initializes an already allocated OFMutableDictionary to be empty. + * + * @return An initialized OFMutableDictionary + */ +- (instancetype)init OF_DESIGNATED_INITIALIZER; + /** * @brief Initializes an already allocated OFMutableDictionary with enough * memory to hold the specified number of objects. * * @param capacity The initial capacity for the OFMutableDictionary * @return An initialized OFMutableDictionary */ -- (instancetype)initWithCapacity: (size_t)capacity; +- (instancetype)initWithCapacity: (size_t)capacity OF_DESIGNATED_INITIALIZER; /** * @brief Sets an object for a key. * * A key can be any object that conforms to the OFCopying protocol. Index: src/OFMutableDictionary.m ================================================================== --- src/OFMutableDictionary.m +++ src/OFMutableDictionary.m @@ -15,50 +15,50 @@ #include "config.h" #include -#import "OFMutableMapTableDictionary.h" +#import "OFConcreteMutableDictionary.h" #import "OFArray.h" #import "OFString.h" static struct { Class isa; } placeholder; -@interface OFMutableDictionaryPlaceholder: OFDictionary +@interface OFPlaceholderMutableDictionary: OFDictionary @end -@implementation OFMutableDictionaryPlaceholder +@implementation OFPlaceholderMutableDictionary - (instancetype)init { - return (id)[[OFMutableMapTableDictionary alloc] init]; + return (id)[[OFConcreteMutableDictionary alloc] init]; } - (instancetype)initWithDictionary: (OFDictionary *)dictionary { - return (id)[[OFMutableMapTableDictionary alloc] + return (id)[[OFConcreteMutableDictionary alloc] initWithDictionary: dictionary]; } - (instancetype)initWithObject: (id)object forKey: (id)key { - return (id)[[OFMutableMapTableDictionary alloc] initWithObject: object + return (id)[[OFConcreteMutableDictionary alloc] initWithObject: object forKey: key]; } - (instancetype)initWithObjects: (OFArray *)objects forKeys: (OFArray *)keys { - return (id)[[OFMutableMapTableDictionary alloc] initWithObjects: objects + return (id)[[OFConcreteMutableDictionary alloc] initWithObjects: objects forKeys: keys]; } - (instancetype)initWithObjects: (id const *)objects forKeys: (id const *)keys count: (size_t)count { - return (id)[[OFMutableMapTableDictionary alloc] initWithObjects: objects + return (id)[[OFConcreteMutableDictionary alloc] initWithObjects: objects forKeys: keys count: count]; } - (instancetype)initWithKeysAndObjects: (id)firstKey, ... @@ -65,54 +65,38 @@ { id ret; va_list arguments; va_start(arguments, firstKey); - ret = (id)[[OFMutableMapTableDictionary alloc] initWithKey: firstKey + ret = (id)[[OFConcreteMutableDictionary alloc] initWithKey: firstKey arguments: arguments]; va_end(arguments); return ret; } - (instancetype)initWithKey: (id)firstKey arguments: (va_list)arguments { - return (id)[[OFMutableMapTableDictionary alloc] initWithKey: firstKey + return (id)[[OFConcreteMutableDictionary alloc] initWithKey: firstKey arguments: arguments]; } - (instancetype)initWithCapacity: (size_t)capacity { - return (id)[[OFMutableMapTableDictionary alloc] + return (id)[[OFConcreteMutableDictionary alloc] initWithCapacity: capacity]; } -- (instancetype)retain -{ - return self; -} - -- (instancetype)autorelease -{ - return self; -} - -- (void)release -{ -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} +OF_SINGLETON_METHODS @end @implementation OFMutableDictionary + (void)initialize { if (self == [OFMutableDictionary class]) - placeholder.isa = [OFMutableDictionaryPlaceholder class]; + object_setClass((id)&placeholder, + [OFPlaceholderMutableDictionary class]); } + (instancetype)alloc { if (self == [OFMutableDictionary class]) @@ -126,28 +110,33 @@ return [[[self alloc] initWithCapacity: capacity] autorelease]; } - (instancetype)init { - if ([self isMemberOfClass: [OFMutableDictionary class]]) { - @try { - [self doesNotRecognizeSelector: _cmd]; - } @catch (id e) { - [self release]; - @throw e; - } - - abort(); - } - return [super init]; } + +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif +- (instancetype)initWithObjects: (id const *)objects + forKeys: (id const *)keys + count: (size_t)count +{ + OF_INVALID_INIT_METHOD +} - (instancetype)initWithCapacity: (size_t)capacity { OF_INVALID_INIT_METHOD } +#ifdef __clang__ +# pragma clang diagnostic pop +#endif - (void)setObject: (id)object forKey: (id)key { OF_UNRECOGNIZED_SELECTOR } DELETED src/OFMutableMapTableDictionary.h Index: src/OFMutableMapTableDictionary.h ================================================================== --- src/OFMutableMapTableDictionary.h +++ src/OFMutableMapTableDictionary.h @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFDictionary.h" - -OF_ASSUME_NONNULL_BEGIN - -@class OFMapTable; - -@interface OFMutableMapTableDictionary: OFMutableDictionary -{ - OFMapTable *_mapTable; -} -@end - -OF_ASSUME_NONNULL_END DELETED src/OFMutableMapTableDictionary.m Index: src/OFMutableMapTableDictionary.m ================================================================== --- src/OFMutableMapTableDictionary.m +++ src/OFMutableMapTableDictionary.m @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 - -#import "OFMutableMapTableDictionary.h" -#import "OFMapTable.h" -#import "OFMapTableDictionary.h" - -#import "OFEnumerationMutationException.h" -#import "OFOutOfRangeException.h" - -@implementation OFMutableMapTableDictionary -+ (void)initialize -{ - if (self == [OFMutableMapTableDictionary class]) - [self inheritMethodsFromClass: [OFMapTableDictionary class]]; -} - -- (void)setObject: (id)object forKey: (id)key -{ - [_mapTable setObject: object forKey: key]; -} - -- (void)removeObjectForKey: (id)key -{ - [_mapTable removeObjectForKey: key]; -} - -- (void)removeAllObjects -{ - [_mapTable removeAllObjects]; -} - -#ifdef OF_HAVE_BLOCKS -- (void)replaceObjectsUsingBlock: (OFDictionaryReplaceBlock)block -{ - @try { - [_mapTable replaceObjectsUsingBlock: - ^ void *(void *key, void *object) { - return block(key, object); - }]; - } @catch (OFEnumerationMutationException *e) { - @throw [OFEnumerationMutationException - exceptionWithObject: self]; - } -} -#endif - -- (void)makeImmutable -{ - object_setClass(self, [OFMapTableDictionary class]); -} -@end DELETED src/OFMutableMapTableSet.h Index: src/OFMutableMapTableSet.h ================================================================== --- src/OFMutableMapTableSet.h +++ src/OFMutableMapTableSet.h @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFMutableSet.h" - -OF_ASSUME_NONNULL_BEGIN - -@class OFMapTable; - -@interface OFMutableMapTableSet: OFMutableSet -{ - OFMapTable *_mapTable; -} -@end - -OF_ASSUME_NONNULL_END DELETED src/OFMutableMapTableSet.m Index: src/OFMutableMapTableSet.m ================================================================== --- src/OFMutableMapTableSet.m +++ src/OFMutableMapTableSet.m @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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" - -#import "OFMutableMapTableSet.h" -#import "OFMapTableSet.h" -#import "OFMapTable.h" - -@implementation OFMutableMapTableSet -+ (void)initialize -{ - if (self == [OFMutableMapTableSet class]) - [self inheritMethodsFromClass: [OFMapTableSet class]]; -} - -- (void)addObject: (id)object -{ - [_mapTable setObject: (void *)1 forKey: object]; -} - -- (void)removeObject: (id)object -{ - [_mapTable removeObjectForKey: object]; -} - -- (void)removeAllObjects -{ - [_mapTable removeAllObjects]; -} - -- (void)makeImmutable -{ - object_setClass(self, [OFMapTableSet class]); -} -@end Index: src/OFMutableSet.h ================================================================== --- src/OFMutableSet.h +++ src/OFMutableSet.h @@ -36,18 +36,25 @@ * @param capacity The initial capacity for the OFMutableSet * @return A new autoreleased OFMutableSet */ + (instancetype)setWithCapacity: (size_t)capacity; +/** + * @brief Initializes an already allocated OFMutableSet to be empty. + * + * @return An initialized OFMutableSet + */ +- (instancetype)init OF_DESIGNATED_INITIALIZER; + /** * @brief Initializes an already allocated OFMutableSet with enough memory to * hold the specified number of objects. * * @param capacity The initial capacity for the OFMutableSet * @return An initialized OFMutableSet */ -- (instancetype)initWithCapacity: (size_t)capacity; +- (instancetype)initWithCapacity: (size_t)capacity OF_DESIGNATED_INITIALIZER; /** * @brief Adds the specified object to the set. * * @param object The object to add to the set Index: src/OFMutableSet.m ================================================================== --- src/OFMutableSet.m +++ src/OFMutableSet.m @@ -16,91 +16,84 @@ #include "config.h" #include #import "OFMutableSet.h" -#import "OFMutableMapTableSet.h" +#import "OFConcreteMutableSet.h" #import "OFString.h" static struct { Class isa; } placeholder; -@interface OFMutableSetPlaceholder: OFMutableSet +@interface OFPlaceholderMutableSet: OFMutableSet @end -@implementation OFMutableSetPlaceholder +@implementation OFPlaceholderMutableSet +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif - (instancetype)init { - return (id)[[OFMutableMapTableSet alloc] init]; + return (id)[[OFConcreteMutableSet alloc] init]; } - (instancetype)initWithSet: (OFSet *)set { - return (id)[[OFMutableMapTableSet alloc] initWithSet: set]; + return (id)[[OFConcreteMutableSet alloc] initWithSet: set]; } - (instancetype)initWithArray: (OFArray *)array { - return (id)[[OFMutableMapTableSet alloc] initWithArray: array]; + return (id)[[OFConcreteMutableSet alloc] initWithArray: array]; } - (instancetype)initWithObjects: (id)firstObject, ... { id ret; va_list arguments; va_start(arguments, firstObject); - ret = [[OFMutableMapTableSet alloc] initWithObject: firstObject + ret = [[OFConcreteMutableSet alloc] initWithObject: firstObject arguments: arguments]; va_end(arguments); return ret; } - (instancetype)initWithObjects: (id const *)objects count: (size_t)count { - return (id)[[OFMutableMapTableSet alloc] initWithObjects: objects + return (id)[[OFConcreteMutableSet alloc] initWithObjects: objects count: count]; } - (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments { - return (id)[[OFMutableMapTableSet alloc] initWithObject: firstObject + return (id)[[OFConcreteMutableSet alloc] initWithObject: firstObject arguments: arguments]; } - (instancetype)initWithCapacity: (size_t)capacity { - return (id)[[OFMutableMapTableSet alloc] initWithCapacity: capacity]; -} - -- (instancetype)retain -{ - return self; -} - -- (instancetype)autorelease -{ - return self; -} - -- (void)release -{ -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} + return (id)[[OFConcreteMutableSet alloc] initWithCapacity: capacity]; +} +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + +OF_SINGLETON_METHODS @end @implementation OFMutableSet + (void)initialize { if (self == [OFMutableSet class]) - placeholder.isa = [OFMutableSetPlaceholder class]; + object_setClass((id)&placeholder, + [OFPlaceholderMutableSet class]); } + (instancetype)alloc { if (self == [OFMutableSet class]) @@ -114,27 +107,31 @@ return [[[self alloc] initWithCapacity: capacity] autorelease]; } - (instancetype)init { - if ([self isMemberOfClass: [OFMutableSet class]]) { - @try { - [self doesNotRecognizeSelector: _cmd]; - abort(); - } @catch (id e) { - [self release]; - @throw e; - } - } - return [super init]; } + +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif +- (instancetype)initWithObjects: (id const *)objects count: (size_t)count +{ + OF_INVALID_INIT_METHOD +} - (instancetype)initWithCapacity: (size_t)capacity { OF_INVALID_INIT_METHOD } +#ifdef __clang__ +# pragma clang diagnostic pop +#endif - (id)copy { return [[OFSet alloc] initWithSet: self]; } Index: src/OFMutableString.h ================================================================== --- src/OFMutableString.h +++ src/OFMutableString.h @@ -11,18 +11,14 @@ * 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_MUTABLE_STRING_H -#define OBJFW_OF_MUTABLE_STRING_H - -#include "OFString.h" +#import "OFString.h" OF_ASSUME_NONNULL_BEGIN -#ifdef __OBJC__ /** * @class OFMutableString OFString.h ObjFW/OFString.h * * @brief A class for storing and modifying strings. */ @@ -208,10 +204,7 @@ /** * @brief Converts the mutable string to an immutable string. */ - (void)makeImmutable; @end -#endif OF_ASSUME_NONNULL_END - -#endif Index: src/OFMutableString.m ================================================================== --- src/OFMutableString.m +++ src/OFMutableString.m @@ -31,14 +31,20 @@ static struct { Class isa; } placeholder; -@interface OFMutableStringPlaceholder: OFMutableString +@interface OFPlaceholderMutableString: OFMutableString @end -@implementation OFMutableStringPlaceholder +@implementation OFPlaceholderMutableString +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif - (instancetype)init { return (id)[[OFMutableUTF8String alloc] init]; } @@ -184,36 +190,23 @@ { return (id)[[OFMutableUTF8String alloc] initWithContentsOfIRI: IRI encoding: encoding]; } - -- (instancetype)retain -{ - return self; -} - -- (instancetype)autorelease -{ - return self; -} - -- (void)release -{ -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + +OF_SINGLETON_METHODS @end @implementation OFMutableString + (void)initialize { if (self == [OFMutableString class]) - placeholder.isa = [OFMutableStringPlaceholder class]; + object_setClass((id)&placeholder, + [OFPlaceholderMutableString class]); } + (instancetype)alloc { if (self == [OFMutableString class]) DELETED src/OFNonretainedObjectValue.h Index: src/OFNonretainedObjectValue.h ================================================================== --- src/OFNonretainedObjectValue.h +++ src/OFNonretainedObjectValue.h @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFValue.h" - -OF_ASSUME_NONNULL_BEGIN - -@interface OFNonretainedObjectValue: OFValue -{ - id _object; -} - -- (instancetype)initWithNonretainedObject: (id)object; -@end - -OF_ASSUME_NONNULL_END DELETED src/OFNonretainedObjectValue.m Index: src/OFNonretainedObjectValue.m ================================================================== --- src/OFNonretainedObjectValue.m +++ src/OFNonretainedObjectValue.m @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFNonretainedObjectValue.h" -#import "OFMethodSignature.h" - -#import "OFOutOfRangeException.h" - -@implementation OFNonretainedObjectValue -@synthesize nonretainedObjectValue = _object; - -- (instancetype)initWithNonretainedObject: (id)object -{ - self = [super init]; - - _object = object; - - return self; -} - -- (const char *)objCType -{ - return @encode(id); -} - -- (void)getValue: (void *)value size: (size_t)size -{ - if (size != sizeof(_object)) - @throw [OFOutOfRangeException exception]; - - memcpy(value, &_object, sizeof(_object)); -} - -- (void *)pointerValue -{ - return _object; -} -@end Index: src/OFNotificationCenter.m ================================================================== --- src/OFNotificationCenter.m +++ src/OFNotificationCenter.m @@ -381,24 +381,7 @@ objc_autoreleasePoolPop(pool); } @end @implementation OFDefaultNotificationCenter -- (instancetype)autorelease -{ - return self; -} - -- (instancetype)retain -{ - return self; -} - -- (void)release -{ -} - -- (unsigned int)retainCount -{ - return OFMaxRetainCount; -} +OF_SINGLETON_METHODS @end Index: src/OFNull.m ================================================================== --- src/OFNull.m +++ src/OFNull.m @@ -72,29 +72,7 @@ { uint8_t type = 0xC0; return [OFData dataWithItems: &type count: 1]; } -- (instancetype)autorelease -{ - return self; -} - -- (instancetype)retain -{ - return self; -} - -- (void)release -{ -} - -- (unsigned int)retainCount -{ - return OFMaxRetainCount; -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} +OF_SINGLETON_METHODS @end Index: src/OFNumber.h ================================================================== --- src/OFNumber.h +++ src/OFNumber.h @@ -37,24 +37,12 @@ /** * @class OFNumber OFNumber.h ObjFW/OFNumber.h * * @brief Provides a way to store a number in an object. */ -#ifndef OF_NUMBER_M -OF_SUBCLASSING_RESTRICTED -#endif @interface OFNumber: OFValue -{ - union { - double float_; - long long signed_; - unsigned long long unsigned_; - } _value; - const char *_typeEncoding; -} - /** * @brief The OFNumber as a `bool`. */ @property (readonly, nonatomic) bool boolValue; @@ -121,12 +109,10 @@ /** * @brief The OFNumber as a string. */ @property (readonly, nonatomic) OFString *stringValue; -+ (instancetype)valueWithBytes: (const void *)bytes - objCType: (const char *)objCType OF_UNAVAILABLE; + (instancetype)valueWithPointer: (const void *)pointer OF_UNAVAILABLE; + (instancetype)valueWithNonretainedObject: (id)object OF_UNAVAILABLE; + (instancetype)valueWithRange: (OFRange)range OF_UNAVAILABLE; + (instancetype)valueWithPoint: (OFPoint)point OF_UNAVAILABLE; + (instancetype)valueWithSize: (OFSize)size OF_UNAVAILABLE; @@ -234,14 +220,10 @@ * @param value The `double` value which the OFNumber should contain * @return A new autoreleased OFNumber */ + (instancetype)numberWithDouble: (double)value; -- (instancetype)init OF_UNAVAILABLE; -- (instancetype)initWithBytes: (const void *)bytes - objCType: (const char *)objCType OF_UNAVAILABLE; - /** * @brief Initializes an already allocated OFNumber with the specified `bool`. * * @param value The `bool` value which the OFNumber should contain * @return An initialized OFNumber Index: src/OFNumber.m ================================================================== --- src/OFNumber.m +++ src/OFNumber.m @@ -11,68 +11,47 @@ * 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. */ -#define OF_NUMBER_M - #include "config.h" #include #import "OFNumber.h" +#import "OFConcreteNumber.h" #import "OFData.h" #import "OFString.h" +#import "OFTaggedPointerNumber.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFOutOfRangeException.h" @interface OFNumber () -+ (instancetype)of_alloc; - (OFString *) of_JSONRepresentationWithOptions: (OFJSONRepresentationOptions)options depth: (size_t)depth; @end -@interface OFNumberPlaceholder: OFNumber -@end - -@interface OFNumberSingleton: OFNumber -@end - -#ifdef OF_OBJFW_RUNTIME -enum Tag { - tagChar, - tagShort, - tagInt, - tagLong, - tagLongLong, - tagUnsignedChar, - tagUnsignedShort, - tagUnsignedInt, - tagUnsignedLong, - tagUnsignedLongLong, -}; -static const uint_fast8_t tagBits = 4; -static const uintptr_t tagMask = 0xF; - -@interface OFTaggedPointerNumber: OFNumberSingleton -@end -#endif +@interface OFPlaceholderNumber: OFNumber +@end + +@interface OFConcreteNumberSingleton: OFConcreteNumber +@end static struct { Class isa; } placeholder; -#define SINGLETON(var, sel, val) \ - static OFNumberSingleton *var; \ - \ - static void \ - var##Init(void) \ - { \ - var = [[OFNumberSingleton alloc] sel val]; \ +#define SINGLETON(var, sel, val) \ + static OFConcreteNumberSingleton *var; \ + \ + static void \ + var##Init(void) \ + { \ + var = [[OFConcreteNumberSingleton alloc] sel val]; \ } SINGLETON(falseNumber, initWithBool:, false) SINGLETON(trueNumber, initWithBool:, true) SINGLETON(charZeroNumber, initWithChar:, 0) SINGLETON(shortZeroNumber, initWithShort:, 0) @@ -86,28 +65,19 @@ SINGLETON(unsignedLongLongZeroNumber, initWithUnsignedLongLong:, 0) SINGLETON(floatZeroNumber, initWithFloat:, 0) SINGLETON(doubleZeroNumber, initWithDouble:, 0) #undef SINGLETON -#ifdef OF_OBJFW_RUNTIME -static int numberTag; -#endif - static bool isUnsigned(OFNumber *number) { switch (*number.objCType) { case 'B': - return true; case 'C': - return true; case 'S': - return true; case 'I': - return true; case 'L': - return true; case 'Q': return true; default: return false; } @@ -116,17 +86,13 @@ static bool isSigned(OFNumber *number) { switch (*number.objCType) { case 'c': - return true; case 's': - return true; case 'i': - return true; case 'l': - return true; case 'q': return true; default: return false; } @@ -135,19 +101,18 @@ static bool isFloat(OFNumber *number) { switch (*number.objCType) { case 'f': - return true; case 'd': return true; default: return false; } } -@implementation OFNumberPlaceholder +@implementation OFPlaceholderNumber - (instancetype)initWithBool: (bool)value { if (value) { static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, trueNumberInit); @@ -168,192 +133,187 @@ if (value == 0) { static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, charZeroNumberInit); return (id)charZeroNumber; #ifdef OF_OBJFW_RUNTIME - } else if ((unsigned char)value <= (UINTPTR_MAX >> tagBits)) { - id ret = objc_createTaggedPointer(numberTag, - ((uintptr_t)(unsigned char)value << tagBits) | tagChar); + } else if ((unsigned char)value <= + (UINTPTR_MAX >> OFTaggedPointerNumberTagBits)) { + id ret = [OFTaggedPointerNumber numberWithChar: value]; if (ret != nil) return ret; #endif } - return (id)[[OFNumber of_alloc] initWithChar: value]; + return (id)[[OFConcreteNumber alloc] initWithChar: value]; } - (instancetype)initWithShort: (short)value { if (value == 0) { static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, shortZeroNumberInit); return (id)shortZeroNumber; #ifdef OF_OBJFW_RUNTIME - } else if ((unsigned short)value <= (UINTPTR_MAX >> tagBits)) { - id ret = objc_createTaggedPointer(numberTag, - ((uintptr_t)(unsigned short)value << tagBits) | tagShort); + } else if ((unsigned short)value <= + (UINTPTR_MAX >> OFTaggedPointerNumberTagBits)) { + id ret = [OFTaggedPointerNumber numberWithShort: value]; if (ret != nil) return ret; #endif } - return (id)[[OFNumber of_alloc] initWithShort: value]; + return (id)[[OFConcreteNumber alloc] initWithShort: value]; } - (instancetype)initWithInt: (int)value { if (value == 0) { static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, intZeroNumberInit); return (id)intZeroNumber; #ifdef OF_OBJFW_RUNTIME - } else if ((unsigned int)value <= (UINTPTR_MAX >> tagBits)) { - id ret = objc_createTaggedPointer(numberTag, - ((uintptr_t)(unsigned int)value << tagBits) | tagInt); + } else if ((unsigned int)value <= + (UINTPTR_MAX >> OFTaggedPointerNumberTagBits)) { + id ret = [OFTaggedPointerNumber numberWithInt: value]; if (ret != nil) return ret; #endif } - return (id)[[OFNumber of_alloc] initWithInt: value]; + return (id)[[OFConcreteNumber alloc] initWithInt: value]; } - (instancetype)initWithLong: (long)value { if (value == 0) { static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, longZeroNumberInit); return (id)longZeroNumber; #ifdef OF_OBJFW_RUNTIME - } else if ((unsigned long)value <= (UINTPTR_MAX >> tagBits)) { - id ret = objc_createTaggedPointer(numberTag, - ((uintptr_t)(unsigned long)value << tagBits) | tagLong); + } else if ((unsigned long)value <= + (UINTPTR_MAX >> OFTaggedPointerNumberTagBits)) { + id ret = [OFTaggedPointerNumber numberWithLong: value]; if (ret != nil) return ret; #endif } - return (id)[[OFNumber of_alloc] initWithLong: value]; + return (id)[[OFConcreteNumber alloc] initWithLong: value]; } - (instancetype)initWithLongLong: (long long)value { if (value == 0) { static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, longLongZeroNumberInit); return (id)longLongZeroNumber; #ifdef OF_OBJFW_RUNTIME - } else if ((unsigned long long)value <= (UINTPTR_MAX >> tagBits)) { - id ret = objc_createTaggedPointer(numberTag, - ((uintptr_t)(unsigned long long)value << tagBits) | - tagLongLong); + } else if ((unsigned long long)value <= + (UINTPTR_MAX >> OFTaggedPointerNumberTagBits)) { + id ret = [OFTaggedPointerNumber numberWithLongLong: value]; if (ret != nil) return ret; #endif } - return (id)[[OFNumber of_alloc] initWithLongLong: value]; + return (id)[[OFConcreteNumber alloc] initWithLongLong: value]; } - (instancetype)initWithUnsignedChar: (unsigned char)value { if (value == 0) { static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, unsignedCharZeroNumberInit); return (id)unsignedCharZeroNumber; #ifdef OF_OBJFW_RUNTIME - } else if (value <= (UINTPTR_MAX >> tagBits)) { - id ret = objc_createTaggedPointer(numberTag, - ((uintptr_t)value << tagBits) | tagUnsignedChar); + } else if (value <= (UINTPTR_MAX >> OFTaggedPointerNumberTagBits)) { + id ret = [OFTaggedPointerNumber numberWithUnsignedChar: value]; if (ret != nil) return ret; #endif } - return (id)[[OFNumber of_alloc] initWithUnsignedChar: value]; + return (id)[[OFConcreteNumber alloc] initWithUnsignedChar: value]; } - (instancetype)initWithUnsignedShort: (unsigned short)value { if (value == 0) { static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, unsignedShortZeroNumberInit); return (id)unsignedShortZeroNumber; #ifdef OF_OBJFW_RUNTIME - } else if (value <= (UINTPTR_MAX >> tagBits)) { - id ret = objc_createTaggedPointer(numberTag, - ((uintptr_t)value << tagBits) | tagUnsignedShort); + } else if (value <= (UINTPTR_MAX >> OFTaggedPointerNumberTagBits)) { + id ret = [OFTaggedPointerNumber numberWithUnsignedShort: value]; if (ret != nil) return ret; #endif } - return (id)[[OFNumber of_alloc] initWithUnsignedShort: value]; + return (id)[[OFConcreteNumber alloc] initWithUnsignedShort: value]; } - (instancetype)initWithUnsignedInt: (unsigned int)value { if (value == 0) { static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, unsignedIntZeroNumberInit); return (id)unsignedIntZeroNumber; #ifdef OF_OBJFW_RUNTIME - } else if (value <= (UINTPTR_MAX >> tagBits)) { - id ret = objc_createTaggedPointer(numberTag, - ((uintptr_t)value << tagBits) | tagUnsignedInt); + } else if (value <= (UINTPTR_MAX >> OFTaggedPointerNumberTagBits)) { + id ret = [OFTaggedPointerNumber numberWithUnsignedInt: value]; if (ret != nil) return ret; #endif } - return (id)[[OFNumber of_alloc] initWithUnsignedInt: value]; + return (id)[[OFConcreteNumber alloc] initWithUnsignedInt: value]; } - (instancetype)initWithUnsignedLong: (unsigned long)value { if (value == 0) { static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, unsignedLongZeroNumberInit); return (id)unsignedLongZeroNumber; #ifdef OF_OBJFW_RUNTIME - } else if (value <= (UINTPTR_MAX >> tagBits)) { - id ret = objc_createTaggedPointer(numberTag, - ((uintptr_t)value << tagBits) | tagUnsignedLong); + } else if (value <= (UINTPTR_MAX >> OFTaggedPointerNumberTagBits)) { + id ret = [OFTaggedPointerNumber numberWithUnsignedLong: value]; if (ret != nil) return ret; #endif } - return (id)[[OFNumber of_alloc] initWithUnsignedLong: value]; + return (id)[[OFConcreteNumber alloc] initWithUnsignedLong: value]; } - (instancetype)initWithUnsignedLongLong: (unsigned long long)value { if (value == 0) { static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, unsignedLongLongZeroNumberInit); return (id)unsignedLongLongZeroNumber; #ifdef OF_OBJFW_RUNTIME - } else if (value <= (UINTPTR_MAX >> tagBits)) { - id ret = objc_createTaggedPointer(numberTag, - ((uintptr_t)value << tagBits) | tagUnsignedLongLong); + } else if (value <= (UINTPTR_MAX >> OFTaggedPointerNumberTagBits)) { + id ret = [OFTaggedPointerNumber + numberWithUnsignedLongLong: value]; if (ret != nil) return ret; #endif } - return (id)[[OFNumber of_alloc] initWithUnsignedLongLong: value]; + return (id)[[OFConcreteNumber alloc] initWithUnsignedLongLong: value]; } - (instancetype)initWithFloat: (float)value { if (value == 0) { @@ -360,11 +320,11 @@ static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, floatZeroNumberInit); return (id)floatZeroNumber; } - return (id)[[OFNumber of_alloc] initWithFloat: value]; + return (id)[[OFConcreteNumber alloc] initWithFloat: value]; } - (instancetype)initWithDouble: (double)value { if (value == 0) { @@ -371,132 +331,28 @@ static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, doubleZeroNumberInit); return (id)doubleZeroNumber; } - return (id)[[OFNumber of_alloc] initWithDouble: value]; + return (id)[[OFConcreteNumber alloc] initWithDouble: value]; } #ifdef __clang__ # pragma clang diagnostic pop #endif -@end - -@implementation OFNumberSingleton -- (instancetype)autorelease -{ - return self; -} - -- (instancetype)retain -{ - return self; -} - -- (void)release -{ -} - -- (unsigned int)retainCount -{ - return OFMaxRetainCount; -} -@end - -#ifdef OF_OBJFW_RUNTIME -@implementation OFTaggedPointerNumber -- (const char *)objCType -{ - uintptr_t value = object_getTaggedPointerValue(self); - - switch (value & tagMask) { - case tagChar: - return @encode(signed char); - case tagShort: - return @encode(short); - case tagInt: - return @encode(int); - case tagLong: - return @encode(long); - case tagLongLong: - return @encode(long long); - case tagUnsignedChar: - return @encode(unsigned char); - case tagUnsignedShort: - return @encode(unsigned short); - case tagUnsignedInt: - return @encode(unsigned int); - case tagUnsignedLong: - return @encode(unsigned long); - case tagUnsignedLongLong: - return @encode(unsigned long long); - default: - @throw [OFInvalidArgumentException exception]; - } -} - -# define RETURN_VALUE \ - uintptr_t value = object_getTaggedPointerValue(self); \ - \ - switch (value & tagMask) { \ - case tagChar: \ - return (signed char)(unsigned char)(value >> tagBits); \ - case tagShort: \ - return (short)(unsigned short)(value >> tagBits); \ - case tagInt: \ - return (int)(unsigned int)(value >> tagBits); \ - case tagLong: \ - return (long)(unsigned long)(value >> tagBits); \ - case tagLongLong: \ - return (long long)(unsigned long long)(value >> tagBits); \ - case tagUnsignedChar: \ - return (unsigned char)(value >> tagBits); \ - case tagUnsignedShort: \ - return (unsigned short)(value >> tagBits); \ - case tagUnsignedInt: \ - return (unsigned int)(value >> tagBits); \ - case tagUnsignedLong: \ - return (unsigned long)(value >> tagBits); \ - case tagUnsignedLongLong: \ - return (unsigned long long)(value >> tagBits); \ - default: \ - @throw [OFInvalidArgumentException exception]; \ - } -- (long long)longLongValue -{ - RETURN_VALUE -} - -- (unsigned long long)unsignedLongLongValue -{ - RETURN_VALUE -} - -- (double)doubleValue -{ - RETURN_VALUE -} -@end -# undef RETURN_VALUE -#endif + +OF_SINGLETON_METHODS +@end + +@implementation OFConcreteNumberSingleton +OF_SINGLETON_METHODS +@end @implementation OFNumber + (void)initialize { - if (self != [OFNumber class]) - return; - - placeholder.isa = [OFNumberPlaceholder class]; - -#ifdef OF_OBJFW_RUNTIME - numberTag = - objc_registerTaggedPointerClass([OFTaggedPointerNumber class]); -#endif -} - -+ (instancetype)of_alloc -{ - return [super alloc]; + if (self == [OFNumber class]) + object_setClass((id)&placeholder, [OFPlaceholderNumber class]); } + (instancetype)alloc { if (self == [OFNumber class]) @@ -503,16 +359,10 @@ return (id)&placeholder; return [super alloc]; } -+ (instancetype)valueWithBytes: (const void *)bytes - objCType: (const char *)objCType -{ - OF_UNRECOGNIZED_SELECTOR -} - + (instancetype)valueWithPointer: (const void *)pointer { OF_UNRECOGNIZED_SELECTOR } @@ -604,252 +454,89 @@ + (instancetype)numberWithDouble: (double)value { return [[[self alloc] initWithDouble: value] autorelease]; } -- (instancetype)init -{ - OF_INVALID_INIT_METHOD -} - -- (instancetype)initWithBytes: (const void *)bytes - objCType: (const char *)objCType -{ - OF_INVALID_INIT_METHOD -} - - (instancetype)initWithBool: (bool)value { - self = [super init]; - - _value.unsigned_ = value; - _typeEncoding = @encode(bool); - - return self; + return [self initWithBytes: &value objCType: @encode(bool)]; } - (instancetype)initWithChar: (signed char)value { - self = [super init]; - - _value.signed_ = value; - _typeEncoding = @encode(signed char); - - return self; + return [self initWithBytes: &value objCType: @encode(signed char)]; } - (instancetype)initWithShort: (short)value { - self = [super init]; - - _value.signed_ = value; - _typeEncoding = @encode(short); - - return self; + return [self initWithBytes: &value objCType: @encode(short)]; } - (instancetype)initWithInt: (int)value { - self = [super init]; - - _value.signed_ = value; - _typeEncoding = @encode(int); - - return self; + return [self initWithBytes: &value objCType: @encode(int)]; } - (instancetype)initWithLong: (long)value { - self = [super init]; - - _value.signed_ = value; - _typeEncoding = @encode(long); - - return self; + return [self initWithBytes: &value objCType: @encode(long)]; } - (instancetype)initWithLongLong: (long long)value { - self = [super init]; - - _value.signed_ = value; - _typeEncoding = @encode(long long); - - return self; + return [self initWithBytes: &value objCType: @encode(long long)]; } - (instancetype)initWithUnsignedChar: (unsigned char)value { - self = [super init]; - - _value.unsigned_ = value; - _typeEncoding = @encode(unsigned long); - - return self; + return [self initWithBytes: &value objCType: @encode(unsigned char)]; } - (instancetype)initWithUnsignedShort: (unsigned short)value { - self = [super init]; - - _value.unsigned_ = value; - _typeEncoding = @encode(unsigned short); - - return self; + return [self initWithBytes: &value objCType: @encode(unsigned short)]; } - (instancetype)initWithUnsignedInt: (unsigned int)value { - self = [super init]; - - _value.unsigned_ = value; - _typeEncoding = @encode(unsigned int); - - return self; + return [self initWithBytes: &value objCType: @encode(unsigned int)]; } - (instancetype)initWithUnsignedLong: (unsigned long)value { - self = [super init]; - - _value.unsigned_ = value; - _typeEncoding = @encode(unsigned long); - - return self; + return [self initWithBytes: &value objCType: @encode(unsigned long)]; } - (instancetype)initWithUnsignedLongLong: (unsigned long long)value { - self = [super init]; - - _value.unsigned_ = value; - _typeEncoding = @encode(unsigned long long); - - return self; -} - -- (instancetype)initWithPtrDiff: (ptrdiff_t)value -{ - self = [super init]; - - _value.signed_ = value; - _typeEncoding = @encode(ptrdiff_t); - - return self; -} - -- (instancetype)initWithIntPtr: (intptr_t)value -{ - self = [super init]; - - _value.signed_ = value; - _typeEncoding = @encode(intptr_t); - - return self; -} - -- (instancetype)initWithUIntPtr: (uintptr_t)value -{ - self = [super init]; - - _value.unsigned_ = value; - _typeEncoding = @encode(uintptr_t); - - return self; + return [self initWithBytes: &value + objCType: @encode(unsigned long long)]; } - (instancetype)initWithFloat: (float)value { - self = [super init]; - - _value.float_ = value; - _typeEncoding = @encode(float); - - return self; + return [self initWithBytes: &value objCType: @encode(float)]; } - (instancetype)initWithDouble: (double)value { - self = [super init]; - - _value.float_ = value; - _typeEncoding = @encode(double); - - return self; -} - -- (const char *)objCType -{ - return _typeEncoding; -} - -- (void)getValue: (void *)value size: (size_t)size -{ - switch (*self.objCType) { -#define CASE(enc, type, property) \ - case enc: { \ - type tmp = (type)self.property; \ - \ - if (size != sizeof(type)) \ - @throw [OFOutOfRangeException exception]; \ - \ - memcpy(value, &tmp, size); \ - break; \ - } - CASE('B', bool, unsignedLongLongValue) - CASE('c', signed char, longLongValue) - CASE('s', short, longLongValue) - CASE('i', int, longLongValue) - CASE('l', long, longLongValue) - CASE('q', long long, longLongValue) - CASE('C', unsigned char, unsignedLongLongValue) - CASE('S', unsigned short, unsignedLongLongValue) - CASE('I', unsigned int, unsignedLongLongValue) - CASE('L', unsigned long, unsignedLongLongValue) - CASE('Q', unsigned long long, unsignedLongLongValue) - CASE('f', float, doubleValue) - CASE('d', double, doubleValue) -#undef CASE - default: - @throw [OFInvalidFormatException exception]; - } + return [self initWithBytes: &value objCType: @encode(double)]; } - (long long)longLongValue { - if (isFloat(self)) - return _value.float_; - else if (isSigned(self)) - return _value.signed_; - else if (isUnsigned(self)) - return _value.unsigned_; - else - @throw [OFInvalidFormatException exception]; + OF_UNRECOGNIZED_SELECTOR } - (unsigned long long)unsignedLongLongValue { - if (isFloat(self)) - return _value.float_; - else if (isSigned(self)) - return _value.signed_; - else if (isUnsigned(self)) - return _value.unsigned_; - else - @throw [OFInvalidFormatException exception]; + OF_UNRECOGNIZED_SELECTOR } - (double)doubleValue { - if (isFloat(self)) - return _value.float_; - else if (isSigned(self)) - return _value.signed_; - else if (isUnsigned(self)) - return _value.unsigned_; - else - @throw [OFInvalidFormatException exception]; + OF_UNRECOGNIZED_SELECTOR } - (bool)boolValue { return (bool)self.unsignedLongLongValue; @@ -1009,11 +696,11 @@ return [self stringValue]; } - (OFString *)stringValue { - if (*self.objCType == 'B') + if (self.objCType[0] == 'B' && self.objCType[1] == '\0') return (self.boolValue ? @"true" : @"false"); if (isFloat(self)) return [OFString stringWithFormat: @"%g", self.doubleValue]; if (isSigned(self)) return [OFString stringWithFormat: @"%lld", self.longLongValue]; @@ -1039,11 +726,11 @@ of_JSONRepresentationWithOptions: (OFJSONRepresentationOptions)options depth: (size_t)depth { double doubleValue; - if (*self.objCType == 'B') + if (self.objCType[0] == 'B' && self.objCType[1] == '\0') return (self.boolValue ? @"true" : @"false"); doubleValue = self.doubleValue; if (isinf(doubleValue)) { if (options & OFJSONRepresentationOptionJSON5) { @@ -1060,10 +747,13 @@ - (OFData *)messagePackRepresentation { OFMutableData *data; const char *typeEncoding = self.objCType; + + if (typeEncoding[0] == '\0' || typeEncoding[1] != '\0') + @throw [OFInvalidFormatException exception]; if (*typeEncoding == 'B') { uint8_t type = (self.boolValue ? 0xC3 : 0xC2); data = [OFMutableData dataWithItems: &type count: 1]; } else if (*typeEncoding == 'f') { Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -11,13 +11,10 @@ * 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_OBJECT_H -#define OBJFW_OF_OBJECT_H - #include "objfw-defs.h" #ifndef __STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS #endif @@ -30,11 +27,11 @@ #include #include #include "macros.h" -#include "OFOnce.h" +#import "OFOnce.h" /* * Some versions of MinGW require to be included before * . Do this here to make sure this is always done in the correct * order, even if another header includes just . @@ -104,11 +101,11 @@ /** * @struct OFRange OFObject.h ObjFW/OFObject.h * * @brief A range. */ -typedef struct OF_BOXABLE { +typedef struct OF_BOXABLE OFRange { /** The start of the range */ size_t location; /** The length of the range */ size_t length; } OFRange; @@ -155,11 +152,11 @@ /** * @struct OFPoint OFObject.h ObjFW/OFObject.h * * @brief A point in 2D space. */ -typedef struct OF_BOXABLE { +typedef struct OF_BOXABLE OFPoint { /** The x coordinate of the point */ float x; /** The y coordinate of the point */ float y; } OFPoint; @@ -201,11 +198,11 @@ /** * @struct OFSize OFObject.h ObjFW/OFObject.h * * @brief A size. */ -typedef struct OF_BOXABLE { +typedef struct OF_BOXABLE OFSize { /** The width of the size */ float width; /** The height of the size */ float height; } OFSize; @@ -247,11 +244,11 @@ /** * @struct OFRect OFObject.h ObjFW/OFObject.h * * @brief A rectangle. */ -typedef struct OF_BOXABLE { +typedef struct OF_BOXABLE OFRect { /** The point from where the rectangle originates */ OFPoint origin; /** The size of the rectangle */ OFSize size; } OFRect; @@ -298,11 +295,11 @@ /** * @struct OFVector3D OFObject.h ObjFW/OFObject.h * * @brief A vector in 3D space. */ -typedef struct OF_BOXABLE { +typedef struct OF_BOXABLE OFVector3D { /** The x coordinate of the vector */ float x; /** The y coordinate of the vector */ float y; /** The z coordinate of the vector */ @@ -350,11 +347,11 @@ /** * @struct OFVector4D OFObject.h ObjFW/OFObject.h * * @brief A vector in 4D space. */ -typedef struct OF_BOXABLE { +typedef struct OF_BOXABLE OFVector4D { /** The x coordinate of the vector */ float x; /** The y coordinate of the vector */ float y; /** The z coordinate of the vector */ @@ -455,11 +452,10 @@ *hash = tmp; } static const size_t OFNotFound = SIZE_MAX; -#ifdef __OBJC__ @class OFMethodSignature; @class OFString; @class OFThread; /** @@ -678,43 +674,41 @@ * * @return Whether a weak reference to this object has been retained */ - (bool)retainWeakReference; @end -#endif /** * @class OFObject OFObject.h ObjFW/OFObject.h * * @brief The root class for all other classes inside ObjFW. */ -#ifdef __OBJC__ OF_ROOT_CLASS @interface OFObject { @private -# ifndef __clang_analyzer__ +#ifndef __clang_analyzer__ Class _isa; -# else +#else Class _isa __attribute__((__unused__)); -# endif +#endif } -# ifdef OF_HAVE_CLASS_PROPERTIES -# ifndef __cplusplus +#ifdef OF_HAVE_CLASS_PROPERTIES +# ifndef __cplusplus @property (class, readonly, nonatomic) Class class; -# else +# else @property (class, readonly, nonatomic, getter=class) Class class_; -# endif +# endif @property (class, readonly, nonatomic) OFString *className; @property (class, readonly, nullable, nonatomic) Class superclass; @property (class, readonly, nonatomic) OFString *description; -# endif +#endif -# ifndef __cplusplus +#ifndef __cplusplus @property (readonly, nonatomic) Class class; -# else +#else @property (readonly, nonatomic, getter=class) Class class_; #endif @property OF_NULLABLE_PROPERTY (readonly, nonatomic) Class superclass; @property (readonly, nonatomic) unsigned long hash; @property (readonly, nonatomic) unsigned int retainCount; @@ -1056,11 +1050,11 @@ withObject: (nullable id)object2 withObject: (nullable id)object3 withObject: (nullable id)object4 afterDelay: (OFTimeInterval)delay; -# ifdef OF_HAVE_THREADS +#ifdef OF_HAVE_THREADS /** * @brief Performs the specified selector on the specified thread. * * @param selector The selector to perform * @param thread The thread on which to perform the selector @@ -1314,11 +1308,11 @@ withObject: (nullable id)object1 withObject: (nullable id)object2 withObject: (nullable id)object3 withObject: (nullable id)object4 afterDelay: (OFTimeInterval)delay; -# endif +#endif /** * @brief This method is called when @ref resolveClassMethod: or * @ref resolveInstanceMethod: returned false. It should return a target * to which the message should be forwarded. @@ -1340,15 +1334,11 @@ * @param selector The selector not understood by the receiver * @throw OFNotImplementedException */ - (void)doesNotRecognizeSelector: (SEL)selector OF_NO_RETURN; @end -#else -typedef void OFObject; -#endif -#ifdef __OBJC__ /** * @protocol OFCopying OFObject.h ObjFW/OFObject.h * * @brief A protocol for the creation of copies. */ @@ -1396,11 +1386,10 @@ * @param object An object to compare the object to * @return The result of the comparison */ - (OFComparisonResult)compare: (id )object; @end -#endif #ifdef __cplusplus extern "C" { #endif /** @@ -1510,12 +1499,7 @@ } #endif OF_ASSUME_NONNULL_END -#include "OFBlock.h" - -#ifdef __OBJC__ -# import "OFObject+KeyValueCoding.h" -#endif - -#endif +#import "OFBlock.h" +#import "OFObject+KeyValueCoding.h" Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -349,11 +349,12 @@ instance = calloc(1, PRE_IVARS_ALIGN + instanceSize + extraAlignment + extraSize); if OF_UNLIKELY (instance == nil) { - allocFailedException.isa = [OFAllocFailedException class]; + object_setClass((id)&allocFailedException, + [OFAllocFailedException class]); @throw (id)&allocFailedException; } ((struct PreIvars *)instance)->retainCount = 1; Index: src/OFPlainCondition.h ================================================================== --- src/OFPlainCondition.h +++ src/OFPlainCondition.h @@ -54,15 +54,15 @@ extern int OFPlainConditionBroadcast(OFPlainCondition *condition); extern int OFPlainConditionWait(OFPlainCondition *condition, OFPlainMutex *mutex); extern int OFPlainConditionTimedWait(OFPlainCondition *condition, OFPlainMutex *mutex, OFTimeInterval timeout); -#ifdef OF_AMIGAOS +#if defined(OF_AMIGAOS) || defined(DOXYGEN) extern int OFPlainConditionWaitOrExecSignal(OFPlainCondition *condition, OFPlainMutex *mutex, ULONG *signalMask); extern int OFPlainConditionTimedWaitOrExecSignal(OFPlainCondition *condition, OFPlainMutex *mutex, OFTimeInterval timeout, ULONG *signalMask); #endif extern int OFPlainConditionFree(OFPlainCondition *condition); #ifdef __cplusplus } #endif DELETED src/OFPointValue.h Index: src/OFPointValue.h ================================================================== --- src/OFPointValue.h +++ src/OFPointValue.h @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFValue.h" - -OF_ASSUME_NONNULL_BEGIN - -@interface OFPointValue: OFValue -{ - OFPoint _point; -} - -- (instancetype)initWithPoint: (OFPoint)point; -@end - -OF_ASSUME_NONNULL_END DELETED src/OFPointValue.m Index: src/OFPointValue.m ================================================================== --- src/OFPointValue.m +++ src/OFPointValue.m @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFPointValue.h" -#import "OFMethodSignature.h" -#import "OFString.h" - -#import "OFOutOfRangeException.h" - -@implementation OFPointValue -@synthesize pointValue = _point; - -- (instancetype)initWithPoint: (OFPoint)point -{ - self = [super init]; - - _point = point; - - return self; -} - -- (const char *)objCType -{ - return @encode(OFPoint); -} - -- (void)getValue: (void *)value size: (size_t)size -{ - if (size != sizeof(_point)) - @throw [OFOutOfRangeException exception]; - - memcpy(value, &_point, sizeof(_point)); -} - -- (OFString *)description -{ - return [OFString stringWithFormat: - @"", _point.x, _point.y]; -} -@end DELETED src/OFPointerValue.h Index: src/OFPointerValue.h ================================================================== --- src/OFPointerValue.h +++ src/OFPointerValue.h @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFValue.h" - -OF_ASSUME_NONNULL_BEGIN - -@interface OFPointerValue: OFValue -{ - void *_pointer; -} - -- (instancetype)initWithPointer: (const void *)pointer; -@end - -OF_ASSUME_NONNULL_END DELETED src/OFPointerValue.m Index: src/OFPointerValue.m ================================================================== --- src/OFPointerValue.m +++ src/OFPointerValue.m @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFPointerValue.h" -#import "OFMethodSignature.h" - -#import "OFOutOfRangeException.h" - -@implementation OFPointerValue -@synthesize pointerValue = _pointer; - -- (instancetype)initWithPointer: (const void *)pointer -{ - self = [super init]; - - _pointer = (void *)pointer; - - return self; -} - -- (const char *)objCType -{ - return @encode(void *); -} - -- (void)getValue: (void *)value size: (size_t)size -{ - if (size != sizeof(_pointer)) - @throw [OFOutOfRangeException exception]; - - memcpy(value, &_pointer, sizeof(_pointer)); -} - -- (id)nonretainedObjectValue -{ - return _pointer; -} -@end DELETED src/OFRangeValue.h Index: src/OFRangeValue.h ================================================================== --- src/OFRangeValue.h +++ src/OFRangeValue.h @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFValue.h" - -OF_ASSUME_NONNULL_BEGIN - -@interface OFRangeValue: OFValue -{ - OFRange _range; -} - -- (instancetype)initWithRange: (OFRange)range; -@end - -OF_ASSUME_NONNULL_END DELETED src/OFRangeValue.m Index: src/OFRangeValue.m ================================================================== --- src/OFRangeValue.m +++ src/OFRangeValue.m @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFRangeValue.h" -#import "OFMethodSignature.h" -#import "OFString.h" - -#import "OFOutOfRangeException.h" - -@implementation OFRangeValue -@synthesize rangeValue = _range; - -- (instancetype)initWithRange: (OFRange)range -{ - self = [super init]; - - _range = range; - - return self; -} - -- (const char *)objCType -{ - return @encode(OFRange); -} - -- (void)getValue: (void *)value size: (size_t)size -{ - if (size != sizeof(_range)) - @throw [OFOutOfRangeException exception]; - - memcpy(value, &_range, sizeof(_range)); -} - -- (OFString *)description -{ - return [OFString stringWithFormat: - @"", - _range.location, _range.length]; -} -@end DELETED src/OFRectValue.h Index: src/OFRectValue.h ================================================================== --- src/OFRectValue.h +++ src/OFRectValue.h @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFValue.h" - -OF_ASSUME_NONNULL_BEGIN - -@interface OFRectValue: OFValue -{ - OFRect _rect; -} - -- (instancetype)initWithRect: (OFRect)rect; -@end - -OF_ASSUME_NONNULL_END DELETED src/OFRectValue.m Index: src/OFRectValue.m ================================================================== --- src/OFRectValue.m +++ src/OFRectValue.m @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFRectValue.h" -#import "OFMethodSignature.h" -#import "OFString.h" - -#import "OFOutOfRangeException.h" - -@implementation OFRectValue -@synthesize rectValue = _rect; - -- (instancetype)initWithRect: (OFRect)rect -{ - self = [super init]; - - _rect = rect; - - return self; -} - -- (const char *)objCType -{ - return @encode(OFRect); -} - -- (void)getValue: (void *)value size: (size_t)size -{ - if (size != sizeof(_rect)) - @throw [OFOutOfRangeException exception]; - - memcpy(value, &_rect, sizeof(_rect)); -} - -- (OFString *)description -{ - return [OFString stringWithFormat: - @"", - _rect.origin.x, _rect.origin.y, - _rect.size.width, _rect.size.height]; -} -@end Index: src/OFRunLoop.h ================================================================== --- src/OFRunLoop.h +++ src/OFRunLoop.h @@ -101,11 +101,11 @@ * @param timer The timer to add * @param mode The run loop mode in which to run the timer */ - (void)addTimer: (OFTimer *)timer forMode: (OFRunLoopMode)mode; -#ifdef OF_AMIGAOS +#if defined(OF_AMIGAOS) || defined(DOXYGEN) /** * @brief Adds an Exec Signal to the run loop. * * If a signal is added multiple times, the specified methods will be performed * in the order added. Index: src/OFRunLoop.m ================================================================== --- src/OFRunLoop.m +++ src/OFRunLoop.m @@ -1612,10 +1612,11 @@ [state->_timersQueueMutex unlock]; } #endif if (timer.valid) { + [timer of_reschedule]; [timer fire]; return; } } Index: src/OFSecureData.h ================================================================== --- src/OFSecureData.h +++ src/OFSecureData.h @@ -30,12 +30,14 @@ * memory. */ OF_SUBCLASSING_RESTRICTED @interface OFSecureData: OFData { + unsigned char *_Nullable _items; + size_t _count, _itemSize; + bool _freeWhenDone, _allowsSwappableMemory; void *_page; - bool _allowsSwappableMemory; } /** * @brief Whether the data may be stored in swappable memory. */ @@ -133,10 +135,12 @@ - (instancetype)initWithCount: (size_t)count itemSize: (size_t)itemSize allowsSwappableMemory: (bool)allowsSwappableMemory OF_DESIGNATED_INITIALIZER; +- (instancetype)init OF_UNAVAILABLE; +- (instancetype)initWithItemSize: (size_t)itemSize OF_UNAVAILABLE; - (instancetype)initWithItems: (const void *)items count: (size_t)count OF_UNAVAILABLE; - (instancetype)initWithItems: (const void *)items count: (size_t)count itemSize: (size_t)itemSize OF_UNAVAILABLE; Index: src/OFSecureData.m ================================================================== --- src/OFSecureData.m +++ src/OFSecureData.m @@ -338,12 +338,11 @@ itemSize: itemSize allowsSwappableMemory: allowsSwappableMemory] autorelease]; } -+ (instancetype)dataWithItems: (const void *)items - count: (size_t)count ++ (instancetype)dataWithItems: (const void *)items count: (size_t)count { OF_UNRECOGNIZED_SELECTOR } + (instancetype)dataWithItems: (const void *)items @@ -387,11 +386,10 @@ + (instancetype)dataWithBase64EncodedString: (OFString *)string { OF_UNRECOGNIZED_SELECTOR } - - (instancetype)initWithCount: (size_t)count allowsSwappableMemory: (bool)allowsSwappableMemory { return [self initWithCount: count @@ -462,10 +460,20 @@ @throw e; } return self; } + +- (instancetype)init +{ + OF_INVALID_INIT_METHOD +} + +- (instancetype)initWithItemSize: (size_t)itemSize +{ + OF_INVALID_INIT_METHOD +} - (instancetype)initWithItems: (const void *)items count: (size_t)count { OF_INVALID_INIT_METHOD } @@ -533,12 +541,30 @@ removePageIfEmpty(_page); } } #endif + if (_freeWhenDone) + OFFreeMemory(_items); + [super dealloc]; } + +- (size_t)count +{ + return _count; +} + +- (size_t)itemSize +{ + return _itemSize; +} + +- (const void *)items +{ + return _items; +} - (void *)mutableItems { return _items; } @@ -581,27 +607,29 @@ } - (bool)isEqual: (id)object { OFData *otherData; + const unsigned char *otherDataItems; unsigned char diff; if (object == self) return true; if (![object isKindOfClass: [OFData class]]) return false; otherData = object; + otherDataItems = otherData.items; - if (otherData->_count != _count || otherData->_itemSize != _itemSize) + if (otherData.count != _count || otherData.itemSize != _itemSize) return false; diff = 0; for (size_t i = 0; i < _count * _itemSize; i++) - diff |= otherData->_items[i] ^ _items[i]; + diff |= otherDataItems[i] ^ _items[i]; return (diff == 0); } - (OFString *)description Index: src/OFSeekableStream.h ================================================================== --- src/OFSeekableStream.h +++ src/OFSeekableStream.h @@ -35,11 +35,11 @@ #if defined(OF_WINDOWS) typedef __int64 OFStreamOffset; #elif defined(OF_ANDROID) typedef long long OFStreamOffset; #elif defined(OF_MORPHOS) -typedef signed long long OFStreamOffset; +typedef long long OFStreamOffset; #elif defined(OF_HAVE_OFF64_T) typedef off64_t OFStreamOffset; #else typedef off_t OFStreamOffset; #endif Index: src/OFSequencedPacketSocket.h ================================================================== --- src/OFSequencedPacketSocket.h +++ src/OFSequencedPacketSocket.h @@ -124,10 +124,14 @@ */ @interface OFSequencedPacketSocket: OFObject { OFSocketHandle _socket; +#ifdef OF_AMIGAOS + LONG _socketID; /* unused, reserved for ABI stability */ + int _family; /* unused, reserved for ABI stability */ +#endif bool _canBlock, _listening; OFSocketAddress _remoteAddress; id _Nullable _delegate; OF_RESERVE_IVARS(OFSequencedPacketSocket, 4) } @@ -135,10 +139,11 @@ /** * @brief Whether the socket can block. * * By default, a socket can block. * + * @throw OFGetOptionFailedException The option could not be retrieved * @throw OFSetOptionFailedException The option could not be set */ @property (nonatomic) bool canBlock; /** @@ -365,10 +370,34 @@ /** * @brief Cancels all pending asynchronous requests on the socket. */ - (void)cancelAsyncRequests; +/** + * @brief Releases the socket from the current thread. + * + * This is necessary on some platforms in order to allow a different thread to + * use the socket, e.g. on AmigaOS, but you should call it on all operating + * systems before using the socket from a different thread. + * + * After calling this method, you must no longer use the socket until + * @ref obtainSocketForCurrentThread has been called. + */ +- (void)releaseSocketFromCurrentThread; + +/** + * @brief Obtains the socket for the current thread. + * + * This is necessary on some platforms in order to allow a different thread to + * use the socket, e.g. on AmigaOS, but you should call it on all operating + * systems before using the socket from a different thread. + * + * You must only call this method after @ref releaseSocketFromCurrentThread has + * been called from a different thread. + */ +- (void)obtainSocketForCurrentThread; + /** * @brief Closes the socket so that it can neither receive nor send any more * datagrams. * * @throw OFNotOpenException The socket is not open Index: src/OFSequencedPacketSocket.m ================================================================== --- src/OFSequencedPacketSocket.m +++ src/OFSequencedPacketSocket.m @@ -464,10 +464,26 @@ @throw [OFOutOfRangeException exception]; return (int)_socket; #endif } + +- (void)releaseSocketFromCurrentThread +{ + /* + * Currently a nop, as all supported OSes that have SOCK_SEQPACKET do + * not need anything to move sockets between threads. + */ +} + +- (void)obtainSocketForCurrentThread +{ + /* + * Currently a nop, as all supported OSes that have SOCK_SEQPACKET do + * not need anything to move sockets between threads. + */ +} - (void)close { if (_socket == OFInvalidSocketHandle) @throw [OFNotOpenException exceptionWithObject: self]; Index: src/OFSet.h ================================================================== --- src/OFSet.h +++ src/OFSet.h @@ -115,10 +115,17 @@ * @return A new, autoreleased set with the specified objects */ + (instancetype)setWithObjects: (ObjectType const _Nonnull *_Nonnull)objects count: (size_t)count; +/** + * @brief Initializes an already allocated set to be empty. + * + * @return An initialized set + */ +- (instancetype)init OF_DESIGNATED_INITIALIZER; + /** * @brief Initializes an already allocated set with the specified set. * * @param set The set to initialize the set with * @return An initialized set with the specified set @@ -158,11 +165,11 @@ * @param objects An array of objects for the set * @param count The number of objects in the specified array * @return An initialized set with the specified objects */ - (instancetype)initWithObjects: (ObjectType const _Nonnull *_Nonnull)objects - count: (size_t)count; + count: (size_t)count OF_DESIGNATED_INITIALIZER; /** * @brief Returns an OFEnumerator to enumerate through all objects of the set. * * @return An OFEnumerator to enumerate through all objects of the set Index: src/OFSet.m ================================================================== --- src/OFSet.m +++ src/OFSet.m @@ -17,87 +17,80 @@ #include #import "OFSet.h" #import "OFArray.h" -#import "OFMapTableSet.h" +#import "OFConcreteSet.h" +#import "OFCountedSet.h" #import "OFNull.h" #import "OFString.h" static struct { Class isa; } placeholder; -@interface OFSetPlaceholder: OFSet +@interface OFPlaceholderSet: OFSet @end -@implementation OFSetPlaceholder +@implementation OFPlaceholderSet +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif - (instancetype)init { - return (id)[[OFMapTableSet alloc] init]; + return (id)[[OFConcreteSet alloc] init]; } - (instancetype)initWithSet: (OFSet *)set { - return (id)[[OFMapTableSet alloc] initWithSet: set]; + return (id)[[OFConcreteSet alloc] initWithSet: set]; } - (instancetype)initWithArray: (OFArray *)array { - return (id)[[OFMapTableSet alloc] initWithArray: array]; + return (id)[[OFConcreteSet alloc] initWithArray: array]; } - (instancetype)initWithObjects: (id)firstObject, ... { id ret; va_list arguments; va_start(arguments, firstObject); - ret = [[OFMapTableSet alloc] initWithObject: firstObject + ret = [[OFConcreteSet alloc] initWithObject: firstObject arguments: arguments]; va_end(arguments); return ret; } - (instancetype)initWithObjects: (id const *)objects count: (size_t)count { - return (id)[[OFMapTableSet alloc] initWithObjects: objects + return (id)[[OFConcreteSet alloc] initWithObjects: objects count: count]; } - (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments { - return (id)[[OFMapTableSet alloc] initWithObject: firstObject + return (id)[[OFConcreteSet alloc] initWithObject: firstObject arguments: arguments]; } - -- (instancetype)retain -{ - return self; -} - -- (instancetype)autorelease -{ - return self; -} - -- (void)release -{ -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + +OF_SINGLETON_METHODS @end @implementation OFSet + (void)initialize { if (self == [OFSet class]) - placeholder.isa = [OFSetPlaceholder class]; + object_setClass((id)&placeholder, [OFPlaceholderSet class]); } + (instancetype)alloc { if (self == [OFSet class]) @@ -140,11 +133,13 @@ count: count] autorelease]; } - (instancetype)init { - if ([self isMemberOfClass: [OFSet class]]) { + if ([self isMemberOfClass: [OFSet class]] || + [self isMemberOfClass: [OFMutableSet class]] || + [self isMemberOfClass: [OFCountedSet class]]) { @try { [self doesNotRecognizeSelector: _cmd]; } @catch (id e) { [self release]; @throw e; @@ -156,22 +151,76 @@ return [super init]; } - (instancetype)initWithSet: (OFSet *)set { - OF_INVALID_INIT_METHOD + id *objects = NULL; + size_t count; + + @try { + void *pool = objc_autoreleasePoolPush(); + size_t i = 0; + + count = set.count; + objects = OFAllocMemory(count, sizeof(id)); + + for (id object in set) { + OFEnsure(i < count); + objects[i++] = object; + } + + objc_autoreleasePoolPop(pool); + } @catch (id e) { + OFFreeMemory(objects); + + [self release]; + @throw e; + } + + @try { + self = [self initWithObjects: objects count: count]; + } @finally { + OFFreeMemory(objects); + } + + return self; } - (instancetype)initWithArray: (OFArray *)array { - OF_INVALID_INIT_METHOD + void *pool = objc_autoreleasePoolPush(); + size_t count; + const id *objects; + + @try { + count = array.count; + objects = array.objects; + } @catch (id e) { + [self release]; + @throw e; + } + + self = [self initWithObjects: objects count: count]; + + objc_autoreleasePoolPop(pool); + + return self; } +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif - (instancetype)initWithObjects: (id const *)objects count: (size_t)count { OF_INVALID_INIT_METHOD } +#ifdef __clang__ +# pragma clang diagnostic pop +#endif - (instancetype)initWithObjects: (id)firstObject, ... { id ret; va_list arguments; @@ -183,11 +232,42 @@ return ret; } - (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments { - OF_INVALID_INIT_METHOD + size_t count = 1; + va_list argumentsCopy; + id *objects; + + if (firstObject == nil) + return [self init]; + + va_copy(argumentsCopy, arguments); + while (va_arg(argumentsCopy, id) != nil) + count++; + + @try { + objects = OFAllocMemory(count, sizeof(id)); + } @catch (id e) { + [self release]; + @throw e; + } + + @try { + objects[0] = firstObject; + + for (size_t i = 1; i < count; i++) { + objects[i] = va_arg(arguments, id); + OFEnsure(objects[i] != nil); + } + + self = [self initWithObjects: objects count: count]; + } @finally { + OFFreeMemory(objects); + } + + return self; } - (size_t)count { OF_UNRECOGNIZED_SELECTOR @@ -232,10 +312,11 @@ - (int)countByEnumeratingWithState: (OFFastEnumerationState *)state objects: (id *)objects count: (int)count { + static unsigned long dummyMutations; OFEnumerator *enumerator; int i; memcpy(&enumerator, state->extra, sizeof(enumerator)); @@ -243,11 +324,11 @@ enumerator = [self objectEnumerator]; memcpy(state->extra, &enumerator, sizeof(enumerator)); } state->itemsPtr = objects; - state->mutationsPtr = (unsigned long *)self; + state->mutationsPtr = &dummyMutations; for (i = 0; i < count; i++) { id object = [enumerator nextObject]; if (object == nil) DELETED src/OFSizeValue.h Index: src/OFSizeValue.h ================================================================== --- src/OFSizeValue.h +++ src/OFSizeValue.h @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFValue.h" - -OF_ASSUME_NONNULL_BEGIN - -@interface OFSizeValue: OFValue -{ - OFSize _size; -} - -- (instancetype)initWithSize: (OFSize)size; -@end - -OF_ASSUME_NONNULL_END DELETED src/OFSizeValue.m Index: src/OFSizeValue.m ================================================================== --- src/OFSizeValue.m +++ src/OFSizeValue.m @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * 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 "OFSizeValue.h" -#import "OFMethodSignature.h" -#import "OFString.h" - -#import "OFOutOfRangeException.h" - -@implementation OFSizeValue -@synthesize sizeValue = _size; - -- (instancetype)initWithSize: (OFSize)size -{ - self = [super init]; - - _size = size; - - return self; -} - -- (const char *)objCType -{ - return @encode(OFSize); -} - -- (void)getValue: (void *)value size: (size_t)size -{ - if (size != sizeof(_size)) - @throw [OFOutOfRangeException exception]; - - memcpy(value, &_size, sizeof(_size)); -} - -- (OFString *)description -{ - return [OFString stringWithFormat: - @"", _size.width, _size.height]; -} -@end Index: src/OFSocket+Private.h ================================================================== --- src/OFSocket+Private.h +++ src/OFSocket+Private.h @@ -22,11 +22,11 @@ #endif #ifdef HAVE_NETDB_H # include #endif -#include "OFSocket.h" +#import "OFSocket.h" #ifndef INADDR_NONE # define INADDR_NONE ((in_addr_t)-1) #endif Index: src/OFSocket.h ================================================================== --- src/OFSocket.h +++ src/OFSocket.h @@ -177,11 +177,11 @@ /** * @struct OFSocketAddress OFSocket.h ObjFW/OFSocket.h * * @brief A struct which represents a host / port pair for a socket. */ -typedef struct OF_BOXABLE { +typedef struct OF_BOXABLE OFSocketAddress { OFSocketAddressFamily family; /* * We can't use struct sockaddr as it can contain variable length * arrays. */ @@ -316,11 +316,11 @@ * @brief Gets the UNIX socket path of the specified @ref OFSocketAddress. * * @param address The address on which to get the UNIX socket path * @return The UNIX socket path */ -extern OFString *_Nullable OFSocketAddressUNIXPath( +extern OFString *OFSocketAddressUNIXPath( const OFSocketAddress *_Nonnull address); /** * @brief Sets the IPX network of the specified @ref OFSocketAddress. * Index: src/OFSocket.m ================================================================== --- src/OFSocket.m +++ src/OFSocket.m @@ -956,11 +956,11 @@ ((uint64_t)addrIPX->sipx_node[2] << 24) | ((uint64_t)addrIPX->sipx_node[3] << 16) | ((uint64_t)addrIPX->sipx_node[4] << 8) | (uint64_t)addrIPX->sipx_node[5]; - return [OFString stringWithFormat: @"%X.%X", + return [OFString stringWithFormat: @"%" PRIX32 ".%" PRIX64, OFFromBigEndian32(network), node]; } static OFString * appleTalkString(const OFSocketAddress *address) @@ -977,10 +977,12 @@ switch (address->family) { case OFSocketAddressFamilyIPv4: return IPv4String(address); case OFSocketAddressFamilyIPv6: return IPv6String(address); + case OFSocketAddressFamilyUNIX: + return OFSocketAddressUNIXPath(address); case OFSocketAddressFamilyIPX: return IPXString(address); case OFSocketAddressFamilyAppleTalk: return appleTalkString(address); default: @@ -1028,13 +1030,10 @@ for (socklen_t i = 0; i < length; i++) if (address->sockaddr.un.sun_path[i] == 0) length = i; - if (length <= 0) - return nil; - return [OFString stringWithCString: address->sockaddr.un.sun_path encoding: [OFLocale encoding] length: length]; } Index: src/OFStdIOStream.m ================================================================== --- src/OFStdIOStream.m +++ src/OFStdIOStream.m @@ -30,11 +30,11 @@ #import "OFStdIOStream+Private.h" #import "OFColor.h" #import "OFDate.h" #import "OFApplication.h" #ifdef OF_WINDOWS -# include "OFWin32ConsoleStdIOStream.h" +# import "OFWin32ConsoleStdIOStream.h" #endif #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFNotOpenException.h" ADDED src/OFStrFTime.h Index: src/OFStrFTime.h ================================================================== --- src/OFStrFTime.h +++ src/OFStrFTime.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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. + */ + +#ifndef __STDC_LIMIT_MACROS +# define __STDC_LIMIT_MACROS +#endif +#ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS +#endif + +#include + +#import "macros.h" + +OF_ASSUME_NONNULL_BEGIN + +#ifdef __cplusplus +extern "C" { +#endif +extern size_t OFStrFTime(char *buffer, size_t bufferLen, const char *format, + struct tm *tm, short tz); +#ifdef __cplusplus +} +#endif + +OF_ASSUME_NONNULL_END ADDED src/OFStrFTime.m Index: src/OFStrFTime.m ================================================================== --- src/OFStrFTime.m +++ src/OFStrFTime.m @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 +#include + +#import "OFStrFTime.h" +#import "macros.h" + +static const char weekDays[7][4] = { + "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" +}; +static const char monthNames[12][4] = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", + "Nov", "Dec" +}; + +size_t +OFStrFTime(char *buffer, size_t bufferLen, const char *format, struct tm *tm, + short tz) +{ + enum { + stateSearchConversionSpecifier, + stateInConversionSpecifier + } state = stateSearchConversionSpecifier; + size_t j, formatLen; + + if (bufferLen == 0) + return 0; + + formatLen = strlen(format); + + j = 0; + for (size_t i = 0; i < formatLen; i++) { + switch (state) { + case stateSearchConversionSpecifier: + if (format[i] == '%') + state = stateInConversionSpecifier; + else { + if (j >= bufferLen) + return 0; + + buffer[j++] = format[i]; + } + + break; + case stateInConversionSpecifier:; + const char *appendFormat; + unsigned int value = 0; + char append[5]; + int appendLen; + + switch (format[i]) { + case '%': + appendFormat = "%%"; + break; + case 'a': + if (tm->tm_wday > 6) + return 0; + + appendFormat = weekDays[tm->tm_wday]; + break; + case 'b': + if (tm->tm_mon > 11) + return 0; + + appendFormat = monthNames[tm->tm_mon]; + break; + case 'd': + appendFormat = "%02u"; + value = tm->tm_mday; + break; + case 'e': + appendFormat = "%2u"; + value = tm->tm_mday; + break; + case 'H': + appendFormat = "%02u"; + value = tm->tm_hour; + break; + case 'M': + appendFormat = "%02u"; + value = tm->tm_min; + break; + case 'm': + appendFormat = "%02u"; + value = tm->tm_mon + 1; + break; + case 'n': + appendFormat = "\n"; + break; + case 'S': + appendFormat = "%02u"; + value = tm->tm_sec; + break; + case 't': + appendFormat = "\t"; + break; + case 'Y': + appendFormat = "%4u"; + value = tm->tm_year + 1900; + break; + case 'y': + appendFormat = "%02u"; + value = tm->tm_year; + + while (value > 100) + value -= 100; + + break; + case 'z': + if (tz == 0) + appendFormat = "Z"; + else if (tz >= 0) { + appendFormat = "+%04u"; + value = tz; + } else { + appendFormat = "-%04u"; + value = -tz; + } + + value = (value / 60) * 100 + (value % 60); + break; + default: + return 0; + } + + appendLen = snprintf(append, sizeof(append), + appendFormat, value); + if (appendLen < 0 || + (size_t)appendLen >= sizeof(append)) + return 0; + + if (bufferLen - j < (size_t)appendLen) + return 0; + + memcpy(buffer + j, append, appendLen); + j += appendLen; + + state = stateSearchConversionSpecifier; + } + } + + if (j >= bufferLen) + return 0; + + buffer[j] = 0; + + return j; +} Index: src/OFStrPTime.m ================================================================== --- src/OFStrPTime.m +++ src/OFStrPTime.m @@ -15,12 +15,11 @@ #include "config.h" #include -#include - +#import "OFStrPTime.h" #import "macros.h" const char * OFStrPTime(const char *buffer, const char *format, struct tm *tm, short *tz) { Index: src/OFStream.h ================================================================== --- src/OFStream.h +++ src/OFStream.h @@ -216,10 +216,11 @@ * @brief Whether the stream can block. * * By default, a stream can block. * On Win32, setting this currently only works for sockets! * + * @throw OFGetOptionFailedException The option could not be retrieved * @throw OFSetOptionFailedException The option could not be set */ @property (nonatomic) bool canBlock; /** Index: src/OFStreamSocket.h ================================================================== --- src/OFStreamSocket.h +++ src/OFStreamSocket.h @@ -64,10 +64,14 @@ */ @interface OFStreamSocket: OFStream { OFSocketHandle _socket; +#ifdef OF_AMIGAOS + LONG _socketID; + int _family; /* unused, reserved for ABI stability */ +#endif bool _atEndOfStream, _listening; OFSocketAddress _remoteAddress; OF_RESERVE_IVARS(OFStreamSocket, 4) } @@ -159,8 +163,32 @@ * by the specified block as well. */ - (void)asyncAcceptWithRunLoopMode: (OFRunLoopMode)runLoopMode block: (OFStreamSocketAsyncAcceptBlock)block; #endif + +/** + * @brief Releases the socket from the current thread. + * + * This is necessary on some platforms in order to allow a different thread to + * use the socket, e.g. on AmigaOS, but you should call it on all operating + * systems before using the socket from a different thread. + * + * After calling this method, you must no longer use the socket until + * @ref obtainSocketForCurrentThread has been called. + */ +- (void)releaseSocketFromCurrentThread; + +/** + * @brief Obtains the socket for the current thread. + * + * This is necessary on some platforms in order to allow a different thread to + * use the socket, e.g. on AmigaOS, but you should call it on all operating + * systems before using the socket from a different thread. + * + * You must only call this method after @ref releaseSocketFromCurrentThread has + * been called from a different thread. + */ +- (void)obtainSocketForCurrentThread; @end OF_ASSUME_NONNULL_END Index: src/OFStreamSocket.m ================================================================== --- src/OFStreamSocket.m +++ src/OFStreamSocket.m @@ -29,19 +29,25 @@ #import "OFRunLoop.h" #import "OFRunLoop+Private.h" #import "OFSocket+Private.h" #import "OFAcceptSocketFailedException.h" +#import "OFAlreadyOpenException.h" #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFListenOnSocketFailedException.h" #import "OFNotImplementedException.h" #import "OFNotOpenException.h" +#import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFSetOptionFailedException.h" #import "OFWriteFailedException.h" + +#if defined(OF_AMIGAOS) && !defined(UNIQUE_ID) +# define UNIQUE_ID -1 +#endif @implementation OFStreamSocket @dynamic delegate; @synthesize listening = _listening; @@ -69,10 +75,13 @@ [self doesNotRecognizeSelector: _cmd]; abort(); } _socket = OFInvalidSocketHandle; +#ifdef OF_AMIGAOS + _socketID = -1; +#endif } @catch (id e) { [self release]; @throw e; } @@ -357,10 +366,55 @@ if (_remoteAddress.length > (socklen_t)sizeof(_remoteAddress.sockaddr)) @throw [OFOutOfRangeException exception]; return &_remoteAddress; } + +- (void)releaseSocketFromCurrentThread +{ +#ifdef OF_AMIGAOS + if (_socket == OFInvalidSocketHandle) + @throw [OFNotOpenException exceptionWithObject: self]; + + if ((_socketID = ReleaseSocket(_socket, UNIQUE_ID)) == -1) { + switch (Errno()) { + case ENOMEM: + @throw [OFOutOfMemoryException + exceptionWithRequestedSize: 0]; + case EBADF: + @throw [OFNotOpenException exceptionWithObject: self]; + default: + OFEnsure(0); + } + } + + _socket = OFInvalidSocketHandle; +#endif +} + +- (void)obtainSocketForCurrentThread +{ +#ifdef OF_AMIGAOS + if (_socket != OFInvalidSocketHandle) + @throw [OFAlreadyOpenException exceptionWithObject: self]; + + if (_socketID == -1) + @throw [OFNotOpenException exceptionWithObject: self]; + + /* + * FIXME: We should store these, but that requires changing all + * subclasses. This only becomes a problem if IPv6 support ever + * gets added. + */ + _socket = ObtainSocket(_socketID, AF_INET, SOCK_STREAM, 0); + if (_socket == OFInvalidSocketHandle) + @throw [OFInitializationFailedException + exceptionWithClass: self.class]; + + _socketID = -1; +#endif +} - (void)close { if (_socket == OFInvalidSocketHandle) @throw [OFNotOpenException exceptionWithObject: self]; Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -11,13 +11,10 @@ * 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_STRING_H -#define OBJFW_OF_STRING_H - #ifndef __STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS #endif #ifndef __STDC_CONSTANT_MACROS # define __STDC_CONSTANT_MACROS @@ -33,26 +30,23 @@ #include #ifdef OF_HAVE_INTTYPES_H # include #endif -#include "OFObject.h" -#ifdef __OBJC__ -# import "OFJSONRepresentation.h" -# import "OFMessagePackRepresentation.h" -#endif +#import "OFObject.h" +#import "OFJSONRepresentation.h" +#import "OFMessagePackRepresentation.h" OF_ASSUME_NONNULL_BEGIN /** @file */ -#ifdef __OBJC__ +@class OFArray OF_GENERIC(ObjectType); +@class OFCharacterSet; @class OFConstantString; +@class OFIRI; @class OFString; -#else -typedef void OFString; -#endif #if defined(__cplusplus) && __cplusplus >= 201103L typedef char16_t OFChar16; typedef char32_t OFChar32; #else @@ -130,15 +124,10 @@ * enumeration */ typedef void (^OFStringLineEnumerationBlock)(OFString *line, bool *stop); #endif -#ifdef __OBJC__ -@class OFArray OF_GENERIC(ObjectType); -@class OFCharacterSet; -@class OFIRI; - /** * @class OFString OFString.h ObjFW/OFString.h * * @brief A class for handling strings. */ @@ -275,30 +264,17 @@ /** * @brief The string with leading and trailing whitespaces deleted. */ @property (readonly, nonatomic) OFString *stringByDeletingEnclosingWhitespaces; -# ifdef OF_HAVE_UNICODE_TABLES -/** - * @brief The string in Unicode Normalization Form D (NFD). - */ -@property (readonly, nonatomic) OFString *decomposedStringWithCanonicalMapping; - -/** - * @brief The string in Unicode Normalization Form KD (NFKD). - */ -@property (readonly, nonatomic) - OFString *decomposedStringWithCompatibilityMapping; -# endif - -# ifdef OF_WINDOWS +#if defined(OF_WINDOWS) || defined(DOXYGEN) /** * @brief The string with the Windows Environment Strings expanded. */ @property (readonly, nonatomic) OFString *stringByExpandingWindowsEnvironmentStrings; -# endif +#endif /** * @brief Creates a new OFString. * * @return A new, autoreleased OFString @@ -524,11 +500,11 @@ * @throw OFInvalidEncodingException The resulting string is not in not in UTF-8 * encoding */ + (instancetype)stringWithFormat: (OFConstantString *)format, ...; -# ifdef OF_HAVE_FILES +#ifdef OF_HAVE_FILES /** * @brief Creates a new OFString with the contents of the specified UTF-8 * encoded file. * * @param path The path to the file @@ -546,11 +522,11 @@ * @return A new autoreleased OFString * @throw OFInvalidEncodingException The string is not in the specified encoding */ + (instancetype)stringWithContentsOfFile: (OFString *)path encoding: (OFStringEncoding)encoding; -# endif +#endif /** * @brief Creates a new OFString with the contents of the specified IRI. * * If the IRI's scheme is file, it tries UTF-8 encoding. @@ -575,10 +551,17 @@ * @throw OFInvalidEncodingException The string is not in the specified encoding */ + (instancetype)stringWithContentsOfIRI: (OFIRI *)IRI encoding: (OFStringEncoding)encoding; +/** + * @brief Initializes an already allocated OFString to be empty. + * + * @return An initialized OFString + */ +- (instancetype)init OF_DESIGNATED_INITIALIZER; + /** * @brief Initializes an already allocated OFString from a UTF-8 encoded C * string. * * @param UTF8String A UTF-8 encoded C string to initialize the OFString with @@ -817,11 +800,11 @@ * encoding */ - (instancetype)initWithFormat: (OFConstantString *)format arguments: (va_list)arguments; -# ifdef OF_HAVE_FILES +#ifdef OF_HAVE_FILES /** * @brief Initializes an already allocated OFString with the contents of the * specified file in the specified encoding. * * @param path The path to the file @@ -839,11 +822,11 @@ * @return An initialized OFString * @throw OFInvalidEncodingException The string is not in the specified encoding */ - (instancetype)initWithContentsOfFile: (OFString *)path encoding: (OFStringEncoding)encoding; -# endif +#endif /** * @brief Initializes an already allocated OFString with the contents of the * specified IRI. * @@ -1276,11 +1259,11 @@ * @throw OFInvalidEncodingException The string cannot be represented in the * specified encoding */ - (OFData *)dataWithEncoding: (OFStringEncoding)encoding; -# ifdef OF_HAVE_FILES +#ifdef OF_HAVE_FILES /** * @brief Writes the string into the specified file using UTF-8 encoding. * * @param path The path of the file to write to */ @@ -1294,11 +1277,11 @@ * @param encoding The encoding to use to write the string into the file * @throw OFInvalidEncodingException The string cannot be represented in the * specified encoding */ - (void)writeToFile: (OFString *)path encoding: (OFStringEncoding)encoding; -# endif +#endif /** * @brief Writes the string to the specified IRI using UTF-8 encoding. * * @param IRI The IRI to write to @@ -1313,20 +1296,19 @@ * @throw OFInvalidEncodingException The string cannot be represented in the * specified encoding */ - (void)writeToIRI: (OFIRI *)IRI encoding: (OFStringEncoding)encoding; -# ifdef OF_HAVE_BLOCKS +#ifdef OF_HAVE_BLOCKS /** * Enumerates all lines in the receiver using the specified block. * * @brief block The block to call for each line */ - (void)enumerateLinesUsingBlock: (OFStringLineEnumerationBlock)block; -# endif -@end #endif +@end #ifdef __cplusplus extern "C" { #endif /** @@ -1358,25 +1340,23 @@ } #endif OF_ASSUME_NONNULL_END -#include "OFConstantString.h" -#include "OFMutableString.h" -#ifdef __OBJC__ -# import "OFString+CryptographicHashing.h" -# import "OFString+JSONParsing.h" -# ifdef OF_HAVE_FILES -# import "OFString+PathAdditions.h" -# endif -# import "OFString+PercentEncoding.h" -# import "OFString+PropertyListParsing.h" -# import "OFString+XMLEscaping.h" -# import "OFString+XMLUnescaping.h" -#endif - -#if defined(__OBJC__) && !defined(NSINTEGER_DEFINED) && !__has_feature(modules) +#import "OFConstantString.h" +#import "OFMutableString.h" +#import "OFString+CryptographicHashing.h" +#import "OFString+JSONParsing.h" +#ifdef OF_HAVE_FILES +# import "OFString+PathAdditions.h" +#endif +#import "OFString+PercentEncoding.h" +#import "OFString+PropertyListParsing.h" +#import "OFString+XMLEscaping.h" +#import "OFString+XMLUnescaping.h" + +#if !defined(NSINTEGER_DEFINED) && !__has_feature(modules) /* * Very *ugly* hack required for string boxing literals to work. * * This hack is needed in order to work with `@class NSString` from Apple's * objc/NSString.h - which is included when using modules - as @@ -1387,8 +1367,6 @@ * * TODO: Submit a patch for Clang that makes the boxing classes configurable! */ @interface NSString: OFString @end -#endif - #endif Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -95,11 +95,11 @@ - (OFString *) of_JSONRepresentationWithOptions: (OFJSONRepresentationOptions)options depth: (size_t)depth; @end -@interface OFStringPlaceholder: OFString +@interface OFPlaceholderString: OFString @end extern bool OFUnicodeToISO8859_2(const OFUnichar *, unsigned char *, size_t, bool); extern bool OFUnicodeToISO8859_3(const OFUnichar *, unsigned char *, @@ -344,42 +344,17 @@ memcpy(copy, string, length + 1); return copy; } -#ifdef OF_HAVE_UNICODE_TABLES -static OFString * -decomposedString(OFString *self, const char *const *const *table, size_t size) -{ - OFMutableString *ret = [OFMutableString string]; - void *pool = objc_autoreleasePoolPush(); - const OFUnichar *characters = self.characters; - size_t length = self.length; - - for (size_t i = 0; i < length; i++) { - OFUnichar c = characters[i]; - const char *const *page; - - if (c >= size) { - [ret appendCharacters: &c length: 1]; - continue; - } - - page = table[c >> 8]; - if (page != NULL && page[c & 0xFF] != NULL) - [ret appendUTF8String: page[c & 0xFF]]; - else - [ret appendCharacters: &c length: 1]; - } - - objc_autoreleasePoolPop(pool); - - return ret; -} +@implementation OFPlaceholderString +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" #endif - -@implementation OFStringPlaceholder - (instancetype)init { return (id)[[OFUTF8String alloc] init]; } @@ -589,38 +564,24 @@ encoding: (OFStringEncoding)encoding { return (id)[[OFUTF8String alloc] initWithContentsOfIRI: IRI encoding: encoding]; } - -- (instancetype)retain -{ - return self; -} - -- (instancetype)autorelease -{ - return self; -} - -- (void)release -{ -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + +OF_SINGLETON_METHODS @end @implementation OFString + (void)initialize { if (self != [OFString class]) return; - placeholder.isa = [OFStringPlaceholder class]; + object_setClass((id)&placeholder, [OFPlaceholderString class]); #if defined(HAVE_STRTOF_L) || defined(HAVE_STRTOD_L) || defined(HAVE_USELOCALE) if ((cLocale = newlocale(LC_ALL_MASK, "C", NULL)) == NULL) @throw [OFInitializationFailedException exceptionWithClass: self]; @@ -801,11 +762,12 @@ encoding: encoding] autorelease]; } - (instancetype)init { - if ([self isMemberOfClass: [OFString class]]) { + if ([self isMemberOfClass: [OFString class]] || + [self isMemberOfClass: [OFMutableString class]]) { @try { [self doesNotRecognizeSelector: _cmd]; } @catch (id e) { [self release]; @throw e; @@ -861,16 +823,25 @@ return [self initWithCString: cString encoding: encoding length: strlen(cString)]; } +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif - (instancetype)initWithCString: (const char *)cString encoding: (OFStringEncoding)encoding length: (size_t)cStringLength { OF_INVALID_INIT_METHOD } +#ifdef __clang__ +# pragma clang diagnostic pop +#endif - (instancetype)initWithData: (OFData *)data encoding: (OFStringEncoding)encoding { @try { @@ -886,10 +857,16 @@ length: data.count]; return self; } +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif - (instancetype)initWithString: (OFString *)string { OF_INVALID_INIT_METHOD } @@ -896,10 +873,13 @@ - (instancetype)initWithCharacters: (const OFUnichar *)string length: (size_t)length { OF_INVALID_INIT_METHOD } +#ifdef __clang__ +# pragma clang diagnostic pop +#endif - (instancetype)initWithUTF16String: (const OFChar16 *)string { return [self initWithUTF16String: string length: OFUTF16StringLength(string) @@ -920,16 +900,25 @@ return [self initWithUTF16String: string length: OFUTF16StringLength(string) byteOrder: byteOrder]; } +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif - (instancetype)initWithUTF16String: (const OFChar16 *)string length: (size_t)length byteOrder: (OFByteOrder)byteOrder { OF_INVALID_INIT_METHOD } +#ifdef __clang__ +# pragma clang diagnostic pop +#endif - (instancetype)initWithUTF32String: (const OFChar32 *)string { return [self initWithUTF32String: string length: OFUTF32StringLength(string) @@ -950,16 +939,25 @@ return [self initWithUTF32String: string length: OFUTF32StringLength(string) byteOrder: byteOrder]; } +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif - (instancetype)initWithUTF32String: (const OFChar32 *)string length: (size_t)length byteOrder: (OFByteOrder)byteOrder { OF_INVALID_INIT_METHOD } +#ifdef __clang__ +# pragma clang diagnostic pop +#endif - (instancetype)initWithFormat: (OFConstantString *)format, ... { id ret; va_list arguments; @@ -969,15 +967,24 @@ va_end(arguments); return ret; } +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif - (instancetype)initWithFormat: (OFConstantString *)format arguments: (va_list)arguments { OF_INVALID_INIT_METHOD } +#ifdef __clang__ +# pragma clang diagnostic pop +#endif #ifdef OF_HAVE_FILES - (instancetype)initWithContentsOfFile: (OFString *)path { return [self initWithContentsOfFile: path @@ -985,60 +992,23 @@ } - (instancetype)initWithContentsOfFile: (OFString *)path encoding: (OFStringEncoding)encoding { - char *buffer = NULL; - OFStreamOffset fileSize; - - @try { - void *pool = objc_autoreleasePoolPush(); - OFFile *file = [OFFile fileWithPath: path mode: @"r"]; - fileSize = [file seekToOffset: 0 whence: OFSeekEnd]; - - if (fileSize < 0 || (unsigned long long)fileSize > SIZE_MAX) - @throw [OFOutOfRangeException exception]; - - /* - * We need one extra byte for the terminating zero if we want - * to use -[initWithUTF8StringNoCopy:length:freeWhenDone:]. - */ - if (SIZE_MAX - (size_t)fileSize < 1) - @throw [OFOutOfRangeException exception]; - - [file seekToOffset: 0 whence: OFSeekSet]; - - buffer = OFAllocMemory((size_t)fileSize + 1, 1); - [file readIntoBuffer: buffer exactLength: (size_t)fileSize]; - buffer[(size_t)fileSize] = '\0'; - - objc_autoreleasePoolPop(pool); - } @catch (id e) { - OFFreeMemory(buffer); - [self release]; - - @throw e; - } - - if (encoding == OFStringEncodingUTF8) { - @try { - self = [self initWithUTF8StringNoCopy: buffer - length: (size_t)fileSize - freeWhenDone: true]; - } @catch (id e) { - OFFreeMemory(buffer); - @throw e; - } - } else { - @try { - self = [self initWithCString: buffer - encoding: encoding - length: (size_t)fileSize]; - } @finally { - OFFreeMemory(buffer); - } - } + void *pool = objc_autoreleasePoolPush(); + OFIRI *IRI; + + @try { + IRI = [OFIRI fileIRIWithPath: path]; + } @catch (id e) { + [self release]; + @throw e; + } + + self = [self initWithContentsOfIRI: IRI encoding: encoding]; + + objc_autoreleasePoolPop(pool); return self; } #endif @@ -2612,24 +2582,10 @@ objc_autoreleasePoolPop(pool); return [data autorelease]; } -#ifdef OF_HAVE_UNICODE_TABLES -- (OFString *)decomposedStringWithCanonicalMapping -{ - return decomposedString(self, OFUnicodeDecompositionTable, - OFUnicodeDecompositionTableSize); -} - -- (OFString *)decomposedStringWithCompatibilityMapping -{ - return decomposedString(self, OFUnicodeDecompositionCompatTable, - OFUnicodeDecompositionCompatTableSize); -} -#endif - #ifdef OF_WINDOWS - (OFString *)stringByExpandingWindowsEnvironmentStrings { if ([OFSystemInfo isWindowsNT]) { wchar_t buffer[512]; Index: src/OFSubarray.h ================================================================== --- src/OFSubarray.h +++ src/OFSubarray.h @@ -21,10 +21,9 @@ { OFArray *_array; OFRange _range; } -+ (instancetype)arrayWithArray: (OFArray *)array range: (OFRange)range; - (instancetype)initWithArray: (OFArray *)array range: (OFRange)range; @end OF_ASSUME_NONNULL_END ADDED src/OFSubdata.h Index: src/OFSubdata.h ================================================================== --- src/OFSubdata.h +++ src/OFSubdata.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFData.h" + +OF_ASSUME_NONNULL_BEGIN + +@interface OFSubdata: OFData +{ + OFData *_data; + OFRange _range; +} + +- (instancetype)initWithData: (OFData *)data range: (OFRange)range; +@end + +OF_ASSUME_NONNULL_END ADDED src/OFSubdata.m Index: src/OFSubdata.m ================================================================== --- src/OFSubdata.m +++ src/OFSubdata.m @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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" + +#import "OFSubdata.h" + +@implementation OFSubdata +- (instancetype)initWithData: (OFData *)data range: (OFRange)range +{ + self = [super init]; + + @try { + /* Should usually be retain, as it's useless with a copy */ + _data = [data copy]; + _range = range; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [_data release]; + + [super dealloc]; +} + +- (size_t)count +{ + return _range.length; +} + +- (size_t)itemSize +{ + return _data.itemSize; +} + +- (const void *)items +{ + return (const unsigned char *)_data.items + + (_range.location * _data.itemSize); +} +@end Index: src/OFSystemInfo.h ================================================================== --- src/OFSystemInfo.h +++ src/OFSystemInfo.h @@ -58,11 +58,11 @@ @property (class, readonly, nonatomic) bool supportsSHAExtensions; # endif # if defined(OF_POWERPC) || defined(OF_POWERPC64) || defined(DOXYGEN) @property (class, readonly, nonatomic) bool supportsAltiVec; # endif -# ifdef OF_WINDOWS +# if defined(OF_WINDOWS) || defined(DOXYGEN) @property (class, readonly, nonatomic, getter=isWindowsNT) bool windowsNT; # endif #endif /** @@ -315,11 +315,11 @@ * @return Whether the CPU supports Intel SHA Extensions */ + (bool)supportsSHAExtensions; #endif -#if defined(OF_POWERPC) || defined(OF_POWERPC64) +#if defined(OF_POWERPC) || defined(OF_POWERPC64) || defined(DOXYGEN) /** * @brief Returns whether the CPU and OS support AltiVec. * * @note This method is only available on PowerPC and PowerPC 64. * @@ -326,11 +326,11 @@ * @return Whether the CPU and OS support AltiVec */ + (bool)supportsAltiVec; #endif -#ifdef OF_WINDOWS +#if defined(OF_WINDOWS) || defined(DOXYGEN) /** * @brief Returns whether the application is running on Windows NT. * * @note This method is only available on Windows. * Index: src/OFSystemInfo.m ================================================================== --- src/OFSystemInfo.m +++ src/OFSystemInfo.m @@ -57,11 +57,12 @@ #import "OFApplication.h" #import "OFArray.h" #import "OFData.h" #import "OFDictionary.h" #ifdef OF_HAVE_FILES - #import "OFFile.h" +# import "OFFile.h" +# import "OFFileManager.h" #endif #import "OFIRI.h" #import "OFLocale.h" #import "OFNumber.h" #import "OFOnce.h" @@ -448,10 +449,12 @@ return [OFIRI fileIRIWithPath: [OFString stringWithUTF8String: pathC] isDirectory: true]; # elif defined(OF_AMIGAOS) return [OFIRI fileIRIWithPath: @"PROGDIR:" isDirectory: true]; +# elif defined(OF_WII) || defined(OF_NINTENDO_3DS) + return [[OFFileManager defaultManager] currentDirectoryIRI]; # else OFDictionary *env = [OFApplication environment]; OFString *var; OFIRI *IRI; void *pool; @@ -538,10 +541,12 @@ return [OFIRI fileIRIWithPath: [OFString stringWithUTF8String: pathC] isDirectory: true]; # elif defined(OF_AMIGAOS) return [OFIRI fileIRIWithPath: @"PROGDIR:" isDirectory: true]; +# elif defined(OF_WII) || defined(OF_NINTENDO_3DS) + return [[OFFileManager defaultManager] currentDirectoryIRI]; # else OFDictionary *env = [OFApplication environment]; OFString *var; if ((var = [env objectForKey: @"XDG_CONFIG_HOME"]) != nil && @@ -615,10 +620,12 @@ return nil; return [OFIRI fileIRIWithPath: path isDirectory: true]; # elif defined(OF_MINT) return [OFIRI fileIRIWithPath: @"u:\\tmp" isDirectory: true]; +# elif defined(OF_WII) || defined(OF_NINTENDO_3DS) + return [[OFFileManager defaultManager] currentDirectoryIRI]; # elif defined(OF_NINTENDO_SWITCH) static OFOnceControl onceControl = OFOnceControlInitValue; OFOnce(&onceControl, mountTmpFS); return tmpFSIRI; Index: src/OFTCPSocket.h ================================================================== --- src/OFTCPSocket.h +++ src/OFTCPSocket.h @@ -82,12 +82,12 @@ /** * @brief Whether the socket sends keep alives for the connection. * * @warning This is not available on the Wii or Nintendo 3DS! * + * @throw OFGetOptionFailedException The option could not be retrieved * @throw OFSetOptionFailedException The option could not be set - * @throw OFGetOptionFailedException The option could not be gotten */ @property (nonatomic) bool sendsKeepAlives; #endif #ifndef OF_WII @@ -95,12 +95,12 @@ * @brief Whether sending segments can be delayed. Setting this to `false` sets * TCP_NODELAY on the socket. * * @warning This is not available on the Wii! * + * @throw OFGetOptionFailedException The option could not be retrieved * @throw OFSetOptionFailedException The option could not be set - * @throw OFGetOptionFailedException The option could not be gotten */ @property (nonatomic) bool canDelaySendingSegments; #endif /** ADDED src/OFTaggedPointerColor.h Index: src/OFTaggedPointerColor.h ================================================================== --- src/OFTaggedPointerColor.h +++ src/OFTaggedPointerColor.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFColor.h" + +OF_ASSUME_NONNULL_BEGIN + +#ifdef OF_OBJFW_RUNTIME +@interface OFTaggedPointerColor: OFColor ++ (OFTaggedPointerColor *)colorWithRed: (uint8_t)red + green: (uint8_t)green + blue: (uint8_t)blue; +@end +#endif + +OF_ASSUME_NONNULL_END ADDED src/OFTaggedPointerColor.m Index: src/OFTaggedPointerColor.m ================================================================== --- src/OFTaggedPointerColor.m +++ src/OFTaggedPointerColor.m @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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" + +#import "OFTaggedPointerColor.h" + +#ifdef OF_OBJFW_RUNTIME +static int colorTag; + +@implementation OFTaggedPointerColor ++ (void)initialize +{ + if (self == [OFTaggedPointerColor class]) + colorTag = objc_registerTaggedPointerClass(self); +} + ++ (OFTaggedPointerColor *)colorWithRed: (uint8_t)red + green: (uint8_t)green + blue: (uint8_t)blue +{ + return objc_createTaggedPointer(colorTag, + (uintptr_t)red << 16 | (uintptr_t)green << 8 | (uintptr_t)blue); +} + +- (void)getRed: (float *)red + green: (float *)green + blue: (float *)blue + alpha: (float *)alpha +{ + uintptr_t value = object_getTaggedPointerValue(self); + + *red = (float)(value >> 16) / 255; + *green = (float)((value >> 8) & 0xFF) / 255; + *blue = (float)(value & 0xFF) / 255; + + if (alpha != NULL) + *alpha = 1; +} + +OF_SINGLETON_METHODS +@end +#endif ADDED src/OFTaggedPointerDate.h Index: src/OFTaggedPointerDate.h ================================================================== --- src/OFTaggedPointerDate.h +++ src/OFTaggedPointerDate.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFDate.h" + +OF_ASSUME_NONNULL_BEGIN + +#if defined(OF_OBJFW_RUNTIME) && UINTPTR_MAX == UINT64_MAX +@interface OFTaggedPointerDate: OFDate ++ (OFTaggedPointerDate *)dateWithUInt64TimeIntervalSince1970: (uint64_t)value; +@end +#endif + +OF_ASSUME_NONNULL_END ADDED src/OFTaggedPointerDate.m Index: src/OFTaggedPointerDate.m ================================================================== --- src/OFTaggedPointerDate.m +++ src/OFTaggedPointerDate.m @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFTaggedPointerDate.h" + +#if defined(OF_OBJFW_RUNTIME) && UINTPTR_MAX == UINT64_MAX +static int dateTag; + +@implementation OFTaggedPointerDate ++ (void)initialize +{ + if (self == [OFTaggedPointerDate class]) + dateTag = objc_registerTaggedPointerClass(self); +} + ++ (OFTaggedPointerDate *)dateWithUInt64TimeIntervalSince1970: (uint64_t)value +{ + return objc_createTaggedPointer(dateTag, value & ~(UINT64_C(4) << 60)); +} + +- (OFTimeInterval)timeIntervalSince1970 +{ + uint64_t value = (uint64_t)object_getTaggedPointerValue(self); + + value |= UINT64_C(4) << 60; + + return OFFromBigEndianDouble(OFRawUInt64ToDouble(OFToBigEndian64( + value))); +} + +OF_SINGLETON_METHODS +@end +#endif ADDED src/OFTaggedPointerNumber.h Index: src/OFTaggedPointerNumber.h ================================================================== --- src/OFTaggedPointerNumber.h +++ src/OFTaggedPointerNumber.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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 "OFNumber.h" + +OF_ASSUME_NONNULL_BEGIN + +#ifdef OF_OBJFW_RUNTIME +# define OFTaggedPointerNumberTagBits 4 + +@interface OFTaggedPointerNumber: OFNumber +@end +#endif + +OF_ASSUME_NONNULL_END ADDED src/OFTaggedPointerNumber.m Index: src/OFTaggedPointerNumber.m ================================================================== --- src/OFTaggedPointerNumber.m +++ src/OFTaggedPointerNumber.m @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2008-2023 Jonathan Schleifer + * + * 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" + +#import "OFTaggedPointerNumber.h" + +#import "OFInvalidFormatException.h" + +#ifdef OF_OBJFW_RUNTIME +enum Tag { + tagChar, + tagShort, + tagInt, + tagLong, + tagLongLong, + tagUnsignedChar, + tagUnsignedShort, + tagUnsignedInt, + tagUnsignedLong, + tagUnsignedLongLong, +}; +static const uintptr_t tagMask = (1 << OFTaggedPointerNumberTagBits) - 1; +static int numberTag; + +@implementation OFTaggedPointerNumber ++ (void)initialize +{ + if (self == [OFTaggedPointerNumber class]) + numberTag = objc_registerTaggedPointerClass(self); +} + ++ (OFTaggedPointerNumber *)numberWithChar: (signed char)value +{ + return objc_createTaggedPointer(numberTag, + ((uintptr_t)(unsigned char)value << OFTaggedPointerNumberTagBits) | + tagChar); +} + ++ (OFTaggedPointerNumber *)numberWithShort: (short)value +{ + return objc_createTaggedPointer(numberTag, + ((uintptr_t)(unsigned short)value << OFTaggedPointerNumberTagBits) | + tagShort); +} + ++ (OFTaggedPointerNumber *)numberWithInt: (int)value +{ + return objc_createTaggedPointer(numberTag, + ((uintptr_t)(unsigned int)value << OFTaggedPointerNumberTagBits) | + tagInt); +} + ++ (OFTaggedPointerNumber *)numberWithLong: (long)value +{ + return objc_createTaggedPointer(numberTag, + ((uintptr_t)(unsigned long)value << OFTaggedPointerNumberTagBits) | + tagLong); +} + ++ (OFTaggedPointerNumber *)numberWithLongLong: (long long)value +{ + return objc_createTaggedPointer(numberTag, + ((uintptr_t)(unsigned long long)value << + OFTaggedPointerNumberTagBits) | tagLongLong); +} + ++ (OFTaggedPointerNumber *)numberWithUnsignedChar: (unsigned char)value +{ + return objc_createTaggedPointer(numberTag, + ((uintptr_t)value << OFTaggedPointerNumberTagBits) | + tagUnsignedChar); +} + ++ (OFTaggedPointerNumber *)numberWithUnsignedShort: (unsigned short)value +{ + return objc_createTaggedPointer(numberTag, + ((uintptr_t)value << OFTaggedPointerNumberTagBits) | + tagUnsignedShort); +} + ++ (OFTaggedPointerNumber *)numberWithUnsignedInt: (unsigned int)value +{ + return objc_createTaggedPointer(numberTag, + ((uintptr_t)value << OFTaggedPointerNumberTagBits) | + tagUnsignedInt); +} + ++ (OFTaggedPointerNumber *)numberWithUnsignedLong: (unsigned long)value +{ + return objc_createTaggedPointer(numberTag, + ((uintptr_t)value << OFTaggedPointerNumberTagBits) | + tagUnsignedLong); +} + ++ (OFTaggedPointerNumber *)numberWithUnsignedLongLong: (unsigned long long)value +{ + return objc_createTaggedPointer(numberTag, + ((uintptr_t)value << OFTaggedPointerNumberTagBits) | + tagUnsignedLongLong); +} + +- (const char *)objCType +{ + uintptr_t value = object_getTaggedPointerValue(self); + + switch (value & tagMask) { + case tagChar: + return @encode(signed char); + case tagShort: + return @encode(short); + case tagInt: + return @encode(int); + case tagLong: + return @encode(long); + case tagLongLong: + return @encode(long long); + case tagUnsignedChar: + return @encode(unsigned char); + case tagUnsignedShort: + return @encode(unsigned short); + case tagUnsignedInt: + return @encode(unsigned int); + case tagUnsignedLong: + return @encode(unsigned long); + case tagUnsignedLongLong: + return @encode(unsigned long long); + default: + @throw [OFInvalidFormatException exception]; + } +} + +# define RETURN_VALUE \ + uintptr_t value = object_getTaggedPointerValue(self); \ + \ + switch (value & tagMask) { \ + case tagChar: \ + return (signed char)(unsigned char) \ + (value >> OFTaggedPointerNumberTagBits); \ + case tagShort: \ + return (short)(unsigned short) \ + (value >> OFTaggedPointerNumberTagBits); \ + case tagInt: \ + return (int)(unsigned int) \ + (value >> OFTaggedPointerNumberTagBits); \ + case tagLong: \ + return (long)(unsigned long) \ + (value >> OFTaggedPointerNumberTagBits); \ + case tagLongLong: \ + return (long long)(unsigned long long) \ + (value >> OFTaggedPointerNumberTagBits); \ + case tagUnsignedChar: \ + return (unsigned char) \ + (value >> OFTaggedPointerNumberTagBits); \ + case tagUnsignedShort: \ + return (unsigned short) \ + (value >> OFTaggedPointerNumberTagBits); \ + case tagUnsignedInt: \ + return (unsigned int) \ + (value >> OFTaggedPointerNumberTagBits); \ + case tagUnsignedLong: \ + return (unsigned long) \ + (value >> OFTaggedPointerNumberTagBits); \ + case tagUnsignedLongLong: \ + return (unsigned long long) \ + (value >> OFTaggedPointerNumberTagBits); \ + default: \ + @throw [OFInvalidFormatException exception]; \ + } +- (long long)longLongValue +{ + RETURN_VALUE +} + +- (unsigned long long)unsignedLongLongValue +{ + RETURN_VALUE +} + +- (double)doubleValue +{ + RETURN_VALUE +} +# undef RETURN_VALUE + +OF_SINGLETON_METHODS +@end +#endif Index: src/OFTimer+Private.h ================================================================== --- src/OFTimer+Private.h +++ src/OFTimer+Private.h @@ -19,8 +19,9 @@ OF_DIRECT_MEMBERS @interface OFTimer () - (void)of_setInRunLoop: (nullable OFRunLoop *)runLoop mode: (nullable OFRunLoopMode)mode; +- (void)of_reschedule; @end OF_ASSUME_NONNULL_END Index: src/OFTimer.h ================================================================== --- src/OFTimer.h +++ src/OFTimer.h @@ -460,12 +460,13 @@ * @return The result of the comparison */ - (OFComparisonResult)compare: (OFTimer *)timer; /** - * @brief Fires the timer, meaning it will execute the specified selector on the - * target. + * @brief Fires the timer without changing its regular schedule. + * + * A non-repeating timer will be invalidated after firing. */ - (void)fire; /** * @brief Invalidates the timer, preventing it from firing. Index: src/OFTimer.m ================================================================== --- src/OFTimer.m +++ src/OFTimer.m @@ -521,90 +521,93 @@ [oldInRunLoop release]; _inRunLoopMode = [mode copy]; [oldInRunLoopMode release]; } + +- (void)of_reschedule +{ + long long missedIntervals; + OFTimeInterval newFireDate; + OFRunLoop *runLoop; + + if (!_repeats || !_valid) + return; + + missedIntervals = -_fireDate.timeIntervalSinceNow / _interval; + + /* In case the clock was changed backwards */ + if (missedIntervals < 0) + missedIntervals = 0; + + newFireDate = _fireDate.timeIntervalSince1970 + + (missedIntervals + 1) * _interval; + + [_fireDate release]; + _fireDate = nil; + _fireDate = [[OFDate alloc] + initWithTimeIntervalSince1970: newFireDate]; + + runLoop = [OFRunLoop currentRunLoop]; + [runLoop addTimer: self forMode: runLoop.currentMode]; +} - (void)fire { - void *pool = objc_autoreleasePoolPush(); - id target = [[_target retain] autorelease]; - id object1 = [[_object1 retain] autorelease]; - id object2 = [[_object2 retain] autorelease]; - id object3 = [[_object3 retain] autorelease]; - id object4 = [[_object4 retain] autorelease]; - OFEnsure(_arguments <= 4); - if (_repeats && _valid) { - int64_t missedIntervals = - -_fireDate.timeIntervalSinceNow / _interval; - OFTimeInterval newFireDate; - OFRunLoop *runLoop; - - /* In case the clock was changed backwards */ - if (missedIntervals < 0) - missedIntervals = 0; - - newFireDate = _fireDate.timeIntervalSince1970 + - (missedIntervals + 1) * _interval; - - [_fireDate release]; - _fireDate = [[OFDate alloc] - initWithTimeIntervalSince1970: newFireDate]; - - runLoop = [OFRunLoop currentRunLoop]; - [runLoop addTimer: self forMode: runLoop.currentMode]; - } else - [self invalidate]; + if (!_valid) + return; #ifdef OF_HAVE_BLOCKS if (_block != NULL) _block(self); else { #endif switch (_arguments) { case 0: - [target performSelector: _selector]; + [_target performSelector: _selector]; break; case 1: - [target performSelector: _selector withObject: object1]; + [_target performSelector: _selector + withObject: _object1]; break; case 2: - [target performSelector: _selector - withObject: object1 - withObject: object2]; + [_target performSelector: _selector + withObject: _object1 + withObject: _object2]; break; case 3: - [target performSelector: _selector - withObject: object1 - withObject: object2 - withObject: object3]; + [_target performSelector: _selector + withObject: _object1 + withObject: _object2 + withObject: _object3]; break; case 4: - [target performSelector: _selector - withObject: object1 - withObject: object2 - withObject: object3 - withObject: object4]; + [_target performSelector: _selector + withObject: _object1 + withObject: _object2 + withObject: _object3 + withObject: _object4]; break; } #ifdef OF_HAVE_BLOCKS } #endif + if (!_repeats) + [self invalidate]; + #ifdef OF_HAVE_THREADS [_condition lock]; @try { _done = true; [_condition signal]; } @finally { [_condition unlock]; } #endif - - objc_autoreleasePoolPop(pool); } - (OFDate *)fireDate { return _fireDate; @@ -633,10 +636,13 @@ - (void)invalidate { _valid = false; +#ifdef OF_HAVE_BLOCKS + [_block release]; +#endif [_target release]; [_object1 release]; [_object2 release]; [_object3 release]; [_object4 release]; Index: src/OFUNIXDatagramSocket.h ================================================================== --- src/OFUNIXDatagramSocket.h +++ src/OFUNIXDatagramSocket.h @@ -61,14 +61,15 @@ id delegate; /** * @brief Bind the socket to the specified path. * - * @param path The path to bind to - * @return The address on which this socket can be reached + * @param path The path to bind to or `nil` for an anonymous socket + * @return The address on which this socket can be reached, if a path was + * specified * @throw OFBindUNIXSocketFailedException Binding failed * @throw OFAlreadyOpenException The socket is already bound */ -- (OFSocketAddress)bindToPath: (OFString *)path; +- (OFSocketAddress)bindToPath: (nullable OFString *)path; @end OF_ASSUME_NONNULL_END Index: src/OFUNIXDatagramSocket.m ================================================================== --- src/OFUNIXDatagramSocket.m +++ src/OFUNIXDatagramSocket.m @@ -38,14 +38,19 @@ #endif if (_socket != OFInvalidSocketHandle) @throw [OFAlreadyOpenException exceptionWithObject: self]; - address = OFSocketAddressMakeUNIX(path); + if (path != nil) + address = OFSocketAddressMakeUNIX(path); + else { + address.family = OFSocketAddressFamilyUnknown; + address.length = 0; + } - if ((_socket = socket(address.sockaddr.un.sun_family, - SOCK_DGRAM | SOCK_CLOEXEC, 0)) == OFInvalidSocketHandle) + if ((_socket = socket(AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC, 0)) == + OFInvalidSocketHandle) @throw [OFBindUNIXSocketFailedException exceptionWithPath: path socket: self errNo: OFSocketErrNo()]; @@ -54,21 +59,23 @@ #if SOCK_CLOEXEC == 0 && defined(HAVE_FCNTL_H) && defined(FD_CLOEXEC) if ((flags = fcntl(_socket, F_GETFD, 0)) != -1) fcntl(_socket, F_SETFD, flags | FD_CLOEXEC); #endif - if (bind(_socket, (struct sockaddr *)&address.sockaddr, - address.length) != 0) { - int errNo = OFSocketErrNo(); - - closesocket(_socket); - _socket = OFInvalidSocketHandle; - - @throw [OFBindUNIXSocketFailedException - exceptionWithPath: path - socket: self - errNo: errNo]; + if (path != nil) { + if (bind(_socket, (struct sockaddr *)&address.sockaddr, + address.length) != 0) { + int errNo = OFSocketErrNo(); + + closesocket(_socket); + _socket = OFInvalidSocketHandle; + + @throw [OFBindUNIXSocketFailedException + exceptionWithPath: path + socket: self + errNo: errNo]; + } } return address; } @end Index: src/OFValue.h ================================================================== --- src/OFValue.h +++ src/OFValue.h @@ -21,14 +21,10 @@ * @class OFValue OFValue.h ObjFW/OFValue.h * * @brief A class for storing arbitrary values in an object. */ @interface OFValue: OFObject -{ - OF_RESERVE_IVARS(OFValue, 4) -} - /** * @brief The ObjC type encoding of the value. */ @property (readonly, nonatomic) const char *objCType; @@ -66,16 +62,30 @@ * @throw OFOutOfRangeException The value is not OFSize-sized */ @property (readonly, nonatomic) OFSize sizeValue; /** - * @brief The value as a OFRect. + * @brief The value as an OFRect. * * @throw OFOutOfRangeException The value is not OFRect-sized */ @property (readonly, nonatomic) OFRect rectValue; +/** + * @brief The value as an OFVector3D. + * + * @throw OFOutOfRangeException The value is not OFVector3D-sized + */ +@property (readonly, nonatomic) OFVector3D vector3DValue; + +/** + * @brief The value as an OFVector4D. + * + * @throw OFOutOfRangeException The value is not OFVector4D-sized + */ +@property (readonly, nonatomic) OFVector4D vector4DValue; + /** * @brief Creates a new, autorelease OFValue with the specified bytes of the * specified type. * * @param bytes The bytes containing the value @@ -138,20 +148,40 @@ * @param rect The rectangle the OFValue should contain * @return A new, autoreleased OFValue */ + (instancetype)valueWithRect: (OFRect)rect; +/** + * @brief Creates a new, autoreleased OFValue containing the specified + * 3D vector. + * + * @param vector3D The 3D vector the OFValue should contain + * @return A new, autoreleased OFValue + */ ++ (instancetype)valueWithVector3D: (OFVector3D)vector3D; + +/** + * @brief Creates a new, autoreleased OFValue containing the specified + * 4D vector. + * + * @param vector4D The 4D vector the OFValue should contain + * @return A new, autoreleased OFValue + */ ++ (instancetype)valueWithVector4D: (OFVector4D)vector4D; + /** * @brief Initializes an already allocated OFValue with the specified bytes of * the specified type. * * @param bytes The bytes containing the value * @param objCType The ObjC type encoding for the value * @return An initialized OFValue */ - (instancetype)initWithBytes: (const void *)bytes - objCType: (const char *)objCType; + objCType: (const char *)objCType OF_DESIGNATED_INITIALIZER; + +- (instancetype)init OF_UNAVAILABLE; /** * @brief Gets the value. * * @param value The buffer to copy the value into Index: src/OFValue.m ================================================================== --- src/OFValue.m +++ src/OFValue.m @@ -14,71 +14,134 @@ */ #include "config.h" #import "OFValue.h" -#import "OFBytesValue.h" +#import "OFConcreteValue.h" #import "OFMethodSignature.h" -#import "OFNonretainedObjectValue.h" -#import "OFPointValue.h" -#import "OFPointerValue.h" -#import "OFRangeValue.h" -#import "OFRectValue.h" -#import "OFSizeValue.h" #import "OFString.h" #import "OFOutOfMemoryException.h" + +static struct { + Class isa; +} placeholder; + +@interface OFPlaceholderValue: OFValue +@end + +@implementation OFPlaceholderValue +#ifdef __clang__ +/* We intentionally don't call into super, so silence the warning. */ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunknown-pragmas" +# pragma clang diagnostic ignored "-Wobjc-designated-initializers" +#endif +- (instancetype)initWithBytes: (const void *)bytes + objCType: (const char *)objCType +{ + return (id)[[OFConcreteValue alloc] initWithBytes: bytes + objCType: objCType]; +} +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + +OF_SINGLETON_METHODS +@end @implementation OFValue ++ (void)initialize +{ + if (self == [OFValue class]) + object_setClass((id)&placeholder, [OFPlaceholderValue class]); +} + + (instancetype)alloc { if (self == [OFValue class]) - return [OFBytesValue alloc]; + return (id)&placeholder; return [super alloc]; } + (instancetype)valueWithBytes: (const void *)bytes objCType: (const char *)objCType { - return [[[OFBytesValue alloc] initWithBytes: bytes - objCType: objCType] autorelease]; + return [[[OFValue alloc] initWithBytes: bytes + objCType: objCType] autorelease]; } + (instancetype)valueWithPointer: (const void *)pointer { - return [[[OFPointerValue alloc] initWithPointer: pointer] autorelease]; + return [[[OFValue alloc] + initWithBytes: &pointer + objCType: @encode(const void *)] autorelease]; } + (instancetype)valueWithNonretainedObject: (id)object { - return [[[OFNonretainedObjectValue alloc] - initWithNonretainedObject: object] autorelease]; + return [[[OFValue alloc] initWithBytes: &object + objCType: @encode(id)] autorelease]; } + (instancetype)valueWithRange: (OFRange)range { - return [[[OFRangeValue alloc] initWithRange: range] autorelease]; + return [[[OFValue alloc] initWithBytes: &range + objCType: @encode(OFRange)] autorelease]; } + (instancetype)valueWithPoint: (OFPoint)point { - return [[[OFPointValue alloc] initWithPoint: point] autorelease]; + return [[[OFValue alloc] initWithBytes: &point + objCType: @encode(OFPoint)] autorelease]; } + (instancetype)valueWithSize: (OFSize)size { - return [[[OFSizeValue alloc] initWithSize: size] autorelease]; + return [[[OFValue alloc] initWithBytes: &size + objCType: @encode(OFSize)] autorelease]; } + (instancetype)valueWithRect: (OFRect)rect { - return [[[OFRectValue alloc] initWithRect: rect] autorelease]; + return [[[OFValue alloc] initWithBytes: &rect + objCType: @encode(OFRect)] autorelease]; +} + ++ (instancetype)valueWithVector3D: (OFVector3D)vector3D +{ + return [[[OFValue alloc] + initWithBytes: &vector3D + objCType: @encode(OFVector3D)] autorelease]; +} + ++ (instancetype)valueWithVector4D: (OFVector4D)vector4D +{ + return [[[OFValue alloc] + initWithBytes: &vector4D + objCType: @encode(OFVector4D)] autorelease]; } - (instancetype)initWithBytes: (const void *)bytes objCType: (const char *)objCType +{ + if ([self isMemberOfClass: [OFValue class]]) { + @try { + [self doesNotRecognizeSelector: _cmd]; + } @catch (id e) { + [self release]; + @throw e; + } + + abort(); + } + + return [super init]; +} + +- (instancetype)init { OF_INVALID_INIT_METHOD } - (bool)isEqual: (id)object @@ -198,18 +261,80 @@ { OFRect ret; [self getValue: &ret size: sizeof(ret)]; return ret; } + +- (OFVector3D)vector3DValue +{ + OFVector3D ret; + [self getValue: &ret size: sizeof(ret)]; + return ret; +} + +- (OFVector4D)vector4DValue +{ + OFVector4D ret; + [self getValue: &ret size: sizeof(ret)]; + return ret; +} - (OFString *)description { - OFMutableString *ret = - [OFMutableString stringWithString: @"", + rangeValue.location, rangeValue.length]; + } else if (strcmp(objCType, @encode(OFPoint)) == 0 || + strcmp(objCType, @encode(const OFPoint)) == 0) { + OFPoint pointValue; + [self getValue: &pointValue size: sizeof(pointValue)]; + return [OFString stringWithFormat: + @"", + pointValue.x, pointValue.y]; + } else if (strcmp(objCType, @encode(OFSize)) == 0 || + strcmp(objCType, @encode(const OFSize)) == 0) { + OFSize sizeValue; + [self getValue: &sizeValue size: sizeof(sizeValue)]; + return [OFString stringWithFormat: + @"", + sizeValue.width, sizeValue.height]; + } else if (strcmp(objCType, @encode(OFRect)) == 0 || + strcmp(objCType, @encode(const OFRect)) == 0) { + OFRect rectValue; + [self getValue: &rectValue size: sizeof(rectValue)]; + return [OFString stringWithFormat: + @"", + rectValue.origin.x, rectValue.origin.y, + rectValue.size.width, rectValue.size.height]; + } else if (strcmp(objCType, @encode(OFVector3D)) == 0 || + strcmp(objCType, @encode(const OFVector3D)) == 0) { + OFVector3D vector3DValue; + [self getValue: &vector3DValue size: sizeof(vector3DValue)]; + return [OFString stringWithFormat: + @"", + vector3DValue.x, vector3DValue.y, vector3DValue.z]; + } else if (strcmp(objCType, @encode(OFVector4D)) == 0 || + strcmp(objCType, @encode(const OFVector4D)) == 0) { + OFVector4D vector4DValue; + [self getValue: &vector4DValue size: sizeof(vector4DValue)]; + return [OFString stringWithFormat: + @"", + vector4DValue.x, vector4DValue.y, vector4DValue.z, + vector4DValue.w]; + } + + ret = [OFMutableString stringWithString: @" +@optional +/** + * @brief A callback that is called when an @ref OFZIPArchive wants to read a + * different archive part. + * + * @param archive The archive that wants to read another part + * @param partNumber The number of the part the archive wants to read + * @param lastPartNumber The number of the last archive part + * @return The stream to read the needed part, or `nil` if no such part exists + */ +- (nullable OFSeekableStream *)archive: (OFZIPArchive *)archive + wantsPartNumbered: (unsigned int)partNumber + lastPartNumber: (unsigned int)lastPartNumber; +@end /** * @class OFZIPArchive OFZIPArchive.h ObjFW/OFZIPArchive.h * * @brief A class for accessing and manipulating ZIP files. */ OF_SUBCLASSING_RESTRICTED @interface OFZIPArchive: OFObject { - OF_KINDOF(OFStream *) _stream; #ifdef OF_ZIP_ARCHIVE_M @public #endif + OFObject *_Nullable _delegate; + OF_KINDOF(OFStream *) _stream; int64_t _offset; -@protected uint_least8_t _mode; - uint32_t _diskNumber, _centralDirectoryDisk; + uint32_t _diskNumber, _lastDiskNumber; +@protected + uint32_t _centralDirectoryDisk; uint64_t _centralDirectoryEntriesInDisk, _centralDirectoryEntries; uint64_t _centralDirectorySize; int64_t _centralDirectoryOffset; OFString *_Nullable _archiveComment; #ifdef OF_ZIP_ARCHIVE_M @@ -51,10 +76,16 @@ OFMutableDictionary OF_GENERIC(OFString *, OFZIPArchiveEntry *) *_pathToEntryMap; OFStream *_Nullable _lastReturnedStream; } +/** + * @brief The delegate of the ZIP archive. + */ +@property OF_NULLABLE_PROPERTY (assign, nonatomic) + OFObject *delegate; + /** * @brief The archive comment. */ @property OF_NULLABLE_PROPERTY (copy, nonatomic) OFString *archiveComment; Index: src/OFZIPArchive.m ================================================================== --- src/OFZIPArchive.m +++ src/OFZIPArchive.m @@ -45,12 +45,11 @@ #import "OFTruncatedDataException.h" #import "OFUnsupportedVersionException.h" #import "OFWriteFailedException.h" /* - * FIXME: Current limitations: - * - Split archives are not supported. + * TODO: Current limitations: * - Encrypted files cannot be read. */ enum { modeRead, @@ -83,11 +82,12 @@ OF_DIRECT_MEMBERS @interface OFZIPArchiveFileReadStream: OFStream { OFZIPArchive *_archive; - OFStream *_stream, *_decompressedStream; + OFZIPArchiveEntryCompressionMethod _compressionMethod; + OF_KINDOF(OFStream *) _decompressedStream; OFZIPArchiveEntry *_entry; unsigned long long _toRead; uint32_t _CRC32; bool _atEndOfStream; } @@ -148,27 +148,47 @@ *size -= 8; return field; } +@implementation OFZIPArchive +@synthesize delegate = _delegate, archiveComment = _archiveComment; + static void -seekOrThrowInvalidFormat(OFSeekableStream *stream, +seekOrThrowInvalidFormat(OFZIPArchive *archive, const uint32_t *diskNumber, OFStreamOffset offset, OFSeekWhence whence) { + if (diskNumber != NULL && *diskNumber != archive->_diskNumber) { + OFStream *oldStream = archive->_stream; + OFSeekableStream *stream; + + if (archive->_mode != modeRead || + *diskNumber > archive->_lastDiskNumber) + @throw [OFInvalidFormatException exception]; + + stream = [archive->_delegate archive: archive + wantsPartNumbered: *diskNumber + lastPartNumber: archive->_lastDiskNumber]; + + if (stream == nil) + @throw [OFInvalidFormatException exception]; + + archive->_diskNumber = *diskNumber; + archive->_stream = [stream retain]; + [oldStream release]; + } + @try { - [stream seekToOffset: offset whence: whence]; + [archive->_stream seekToOffset: offset whence: whence]; } @catch (OFSeekFailedException *e) { if (e.errNo == EINVAL) @throw [OFInvalidFormatException exception]; @throw e; } } -@implementation OFZIPArchive -@synthesize archiveComment = _archiveComment; - + (instancetype)archiveWithStream: (OFStream *)stream mode: (OFString *)mode { return [[[self alloc] initWithStream: stream mode: mode] autorelease]; } @@ -213,11 +233,11 @@ [self of_readEntries]; } if (_mode == modeAppend) { _offset = _centralDirectoryOffset; - seekOrThrowInvalidFormat(_stream, + seekOrThrowInvalidFormat(self, NULL, (OFStreamOffset)_offset, OFSeekSet); } } @catch (id e) { /* * If we are in write or append mode, we do not want -[close] @@ -275,11 +295,11 @@ uint16_t commentLength; OFStreamOffset offset = -22; bool valid = false; do { - seekOrThrowInvalidFormat(_stream, offset, OFSeekEnd); + seekOrThrowInvalidFormat(self, NULL, offset, OFSeekEnd); if ([_stream readLittleEndianInt32] == 0x06054B50) { valid = true; break; } @@ -286,11 +306,11 @@ } while (--offset >= -65557); if (!valid) @throw [OFInvalidFormatException exception]; - _diskNumber = [_stream readLittleEndianInt16]; + _diskNumber = _lastDiskNumber = [_stream readLittleEndianInt16]; _centralDirectoryDisk = [_stream readLittleEndianInt16]; _centralDirectoryEntriesInDisk = [_stream readLittleEndianInt16]; _centralDirectoryEntries = [_stream readLittleEndianInt16]; _centralDirectorySize = [_stream readLittleEndianInt32]; _centralDirectoryOffset = [_stream readLittleEndianInt32]; @@ -298,20 +318,21 @@ commentLength = [_stream readLittleEndianInt16]; _archiveComment = [[_stream readStringWithLength: commentLength encoding: OFStringEncodingCodepage437] copy]; - if (_diskNumber == 0xFFFF || + if (_lastDiskNumber == 0xFFFF || _centralDirectoryDisk == 0xFFFF || _centralDirectoryEntriesInDisk == 0xFFFF || _centralDirectoryEntries == 0xFFFF || _centralDirectorySize == 0xFFFFFFFF || _centralDirectoryOffset == 0xFFFFFFFF) { + uint32_t diskNumber; int64_t offset64; uint64_t size; - seekOrThrowInvalidFormat(_stream, offset - 20, OFSeekEnd); + seekOrThrowInvalidFormat(self, NULL, offset - 20, OFSeekEnd); if ([_stream readLittleEndianInt32] != 0x07064B50) { objc_autoreleasePoolPop(pool); return; } @@ -318,17 +339,21 @@ /* * FIXME: Handle number of the disk containing ZIP64 end of * central directory record. */ - [_stream readLittleEndianInt32]; + diskNumber = [_stream readLittleEndianInt32]; offset64 = [_stream readLittleEndianInt64]; + _lastDiskNumber = [_stream readLittleEndianInt32]; + if (_lastDiskNumber == 0) + @throw [OFInvalidFormatException exception]; + _lastDiskNumber--; if (offset64 < 0 || (OFStreamOffset)offset64 != offset64) @throw [OFOutOfRangeException exception]; - seekOrThrowInvalidFormat(_stream, + seekOrThrowInvalidFormat(self, &diskNumber, (OFStreamOffset)offset64, OFSeekSet); if ([_stream readLittleEndianInt32] != 0x06064B50) @throw [OFInvalidFormatException exception]; @@ -339,11 +364,13 @@ /* version made by */ [_stream readLittleEndianInt16]; /* version needed to extract */ [_stream readLittleEndianInt16]; - _diskNumber = [_stream readLittleEndianInt32]; + if ([_stream readLittleEndianInt32] != _diskNumber) + @throw [OFInvalidFormatException exception]; + _centralDirectoryDisk = [_stream readLittleEndianInt32]; _centralDirectoryEntriesInDisk = [_stream readLittleEndianInt64]; _centralDirectoryEntries = [_stream readLittleEndianInt64]; _centralDirectorySize = [_stream readLittleEndianInt64]; @@ -364,15 +391,48 @@ if (_centralDirectoryOffset < 0 || (OFStreamOffset)_centralDirectoryOffset != _centralDirectoryOffset) @throw [OFOutOfRangeException exception]; - seekOrThrowInvalidFormat(_stream, + seekOrThrowInvalidFormat(self, &_centralDirectoryDisk, (OFStreamOffset)_centralDirectoryOffset, OFSeekSet); for (size_t i = 0; i < _centralDirectoryEntries; i++) { - OFZIPArchiveEntry *entry = [[[OFZIPArchiveEntry alloc] + OFZIPArchiveEntry *entry; + char buffer; + + /* + * The stream might have 0 bytes left to read, but might not + * realize that before a read is attempted, where it will then + * return a length of 0. But OFZIPArchiveEntry expects to be + * able to read the entire entry and will then throw an + * OFTruncatedDataException. Therefore, try to peek one byte to + * make sure the stream realizes that it's at the end. + */ + if ([_stream readIntoBuffer: &buffer length: 1] == 1) + [_stream unreadFromBuffer: &buffer length: 1]; + + if ([_stream isAtEndOfStream]) { + OFStream *oldStream = _stream; + OFSeekableStream *stream; + + if (_diskNumber >= _lastDiskNumber) + @throw [OFTruncatedDataException exception]; + + stream = [_delegate archive: self + wantsPartNumbered: _diskNumber + 1 + lastPartNumber: _lastDiskNumber]; + + if (stream == nil) + @throw [OFInvalidFormatException exception]; + + _diskNumber++; + _stream = [stream retain]; + [oldStream release]; + } + + entry = [[[OFZIPArchiveEntry alloc] of_initWithStream: _stream] autorelease]; if ([_pathToEntryMap objectForKey: entry.fileName] != nil) @throw [OFInvalidFormatException exception]; @@ -411,10 +471,11 @@ - (OFStream *)streamForReadingFile: (OFString *)path { void *pool = objc_autoreleasePoolPush(); OFZIPArchiveEntry *entry; OFZIPArchiveLocalFileHeader *localFileHeader; + uint32_t startDiskNumber; int64_t offset64; if (_stream == nil) @throw [OFNotOpenException exceptionWithObject: self]; @@ -431,15 +492,17 @@ } @catch (OFNotOpenException *e) { /* Might have already been closed by the user - that's fine. */ } _lastReturnedStream = nil; + startDiskNumber = entry.of_startDiskNumber; offset64 = entry.of_localFileHeaderOffset; if (offset64 < 0 || (OFStreamOffset)offset64 != offset64) @throw [OFOutOfRangeException exception]; - seekOrThrowInvalidFormat(_stream, (OFStreamOffset)offset64, OFSeekSet); + seekOrThrowInvalidFormat(self, &startDiskNumber, + (OFStreamOffset)offset64, OFSeekSet); localFileHeader = [[[OFZIPArchiveLocalFileHeader alloc] initWithStream: _stream] autorelease]; if (![localFileHeader matchesEntry: entry]) @throw [OFInvalidFormatException exception]; @@ -743,23 +806,23 @@ { self = [super init]; @try { _archive = [archive retain]; - _stream = [stream retain]; + _compressionMethod = entry.compressionMethod; - switch (entry.compressionMethod) { + switch (_compressionMethod) { case OFZIPArchiveEntryCompressionMethodNone: - _decompressedStream = [stream retain]; + _decompressedStream = [_archive->_stream retain]; break; case OFZIPArchiveEntryCompressionMethodDeflate: _decompressedStream = [[OFInflateStream alloc] - initWithStream: stream]; + initWithStream: _archive->_stream]; break; case OFZIPArchiveEntryCompressionMethodDeflate64: _decompressedStream = [[OFInflate64Stream alloc] - initWithStream: stream]; + initWithStream: _archive->_stream]; break; default: @throw [OFNotImplementedException exceptionWithSelector: _cmd object: nil]; @@ -776,11 +839,11 @@ return self; } - (void)dealloc { - if (_stream != nil || _decompressedStream != nil) + if (_decompressedStream != nil) [self close]; [_entry release]; if (_archive->_lastReturnedStream == self) @@ -791,28 +854,63 @@ [super dealloc]; } - (bool)lowlevelIsAtEndOfStream { - if (_stream == nil) + if (_decompressedStream == nil) @throw [OFNotOpenException exceptionWithObject: self]; return _atEndOfStream; } - (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { size_t ret; - if (_stream == nil) + if (_decompressedStream == nil) @throw [OFNotOpenException exceptionWithObject: self]; if (_atEndOfStream) return 0; - if (_stream.atEndOfStream && !_decompressedStream.hasDataInReadBuffer) - @throw [OFTruncatedDataException exception]; + if ([_archive->_stream isAtEndOfStream] && + ![_decompressedStream hasDataInReadBuffer]) { + OFStream *oldStream = _archive->_stream, *oldDecompressedStream; + OFSeekableStream *stream; + + if (_archive->_diskNumber >= _archive->_lastDiskNumber) + @throw [OFTruncatedDataException exception]; + + stream = [_archive->_delegate + archive: _archive + wantsPartNumbered: _archive->_diskNumber + 1 + lastPartNumber: _archive->_lastDiskNumber]; + + if (stream == nil) + @throw [OFInvalidFormatException exception]; + + _archive->_diskNumber++; + _archive->_stream = [stream retain]; + [oldStream release]; + + switch (_compressionMethod) { + case OFZIPArchiveEntryCompressionMethodNone: + oldDecompressedStream = _decompressedStream; + _decompressedStream = [_archive->_stream retain]; + [oldDecompressedStream release]; + break; + case OFZIPArchiveEntryCompressionMethodDeflate: + case OFZIPArchiveEntryCompressionMethodDeflate64: + [_decompressedStream + setUnderlyingStream: _archive->_stream]; + break; + default: + @throw [OFNotImplementedException + exceptionWithSelector: _cmd + object: nil]; + } + } #if SIZE_MAX >= UINT64_MAX if (length > UINT64_MAX) @throw [OFOutOfRangeException exception]; #endif @@ -844,11 +942,11 @@ } - (bool)hasDataInReadBuffer { return (super.hasDataInReadBuffer || - _decompressedStream.hasDataInReadBuffer); + [_decompressedStream hasDataInReadBuffer]); } - (int)fileDescriptorForReading { return ((id )_decompressedStream) @@ -855,16 +953,13 @@ .fileDescriptorForReading; } - (void)close { - if (_stream == nil || _decompressedStream == nil) + if (_decompressedStream == nil) @throw [OFNotOpenException exceptionWithObject: self]; - [_stream release]; - _stream = nil; - [_decompressedStream release]; _decompressedStream = nil; [super close]; } Index: src/OFZIPArchiveEntry+Private.h ================================================================== --- src/OFZIPArchiveEntry+Private.h +++ src/OFZIPArchiveEntry+Private.h @@ -18,10 +18,11 @@ OF_ASSUME_NONNULL_BEGIN @interface OFZIPArchiveEntry () @property (readonly, nonatomic) uint16_t of_lastModifiedFileTime, of_lastModifiedFileDate; +@property (readonly, nonatomic) uint32_t of_startDiskNumber; @property (readonly, nonatomic) int64_t of_localFileHeaderOffset; - (instancetype)of_init OF_METHOD_FAMILY(init); - (instancetype)of_initWithStream: (OFStream *)stream OF_METHOD_FAMILY(init) OF_DIRECT; Index: src/OFZIPArchiveEntry.m ================================================================== --- src/OFZIPArchiveEntry.m +++ src/OFZIPArchiveEntry.m @@ -405,10 +405,15 @@ - (uint16_t)of_lastModifiedFileDate { return _lastModifiedFileDate; } + +- (uint32_t)of_startDiskNumber +{ + return _startDiskNumber; +} - (int64_t)of_localFileHeaderOffset { return _localFileHeaderOffset; } Index: src/exceptions/OFAllocFailedException.m ================================================================== --- src/exceptions/OFAllocFailedException.m +++ src/exceptions/OFAllocFailedException.m @@ -32,34 +32,12 @@ - (instancetype)init { OF_INVALID_INIT_METHOD } -- (instancetype)retain -{ - return self; -} - -- (instancetype)autorelease -{ - return self; -} - -- (unsigned int)retainCount -{ - return OFMaxRetainCount; -} - -- (void)release -{ -} - -- (void)dealloc -{ - OF_DEALLOC_UNSUPPORTED -} +OF_SINGLETON_METHODS - (OFString *)description { return @"Allocating an object failed!"; } @end Index: src/exceptions/OFBindUNIXSocketFailedException.h ================================================================== --- src/exceptions/OFBindUNIXSocketFailedException.h +++ src/exceptions/OFBindUNIXSocketFailedException.h @@ -41,11 +41,11 @@ * @param path The path on which binding failed * @param socket The socket which could not be bound * @param errNo The errno of the error that occurred * @return A new, autoreleased bind UNIX socket failed exception */ -+ (instancetype)exceptionWithPath: (OFString *)path ++ (instancetype)exceptionWithPath: (nullable OFString *)path socket: (id)socket errNo: (int)errNo; + (instancetype)exceptionWithSocket: (id)socket errNo: (int)errNo OF_UNAVAILABLE; @@ -56,13 +56,13 @@ * @param path The path on which binding failed * @param socket The socket which could not be bound * @param errNo The errno of the error that occurred * @return An initialized bind UNIX socket failed exception */ -- (instancetype)initWithPath: (OFString *)path +- (instancetype)initWithPath: (nullable OFString *)path socket: (id)socket errNo: (int)errNo OF_DESIGNATED_INITIALIZER; - (instancetype)initWithSocket: (id)socket errNo: (int)errNo OF_UNAVAILABLE; @end OF_ASSUME_NONNULL_END Index: src/forwarding/forwarding-amd64-elf.S ================================================================== --- src/forwarding/forwarding-amd64-elf.S +++ src/forwarding/forwarding-amd64-elf.S @@ -218,8 +218,8 @@ .long 0 .quad 0 module: .quad 8, 32, 0, symtab -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/forwarding/forwarding-arm-elf.S ================================================================== --- src/forwarding/forwarding-arm-elf.S +++ src/forwarding/forwarding-arm-elf.S @@ -166,8 +166,8 @@ .long 0 .long 0 module: .long 8, 16, 0, symtab -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/forwarding/forwarding-arm64-elf.S ================================================================== --- src/forwarding/forwarding-arm64-elf.S +++ src/forwarding/forwarding-arm64-elf.S @@ -124,8 +124,8 @@ .long 4 .xword 0 module: .xword 8, 32, 0, symtab -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/forwarding/forwarding-mips-elf.S ================================================================== --- src/forwarding/forwarding-mips-elf.S +++ src/forwarding/forwarding-mips-elf.S @@ -322,8 +322,8 @@ .long 0 .long 0 module: .long 8, 16, 0, symtab -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/forwarding/forwarding-powerpc-elf.S ================================================================== --- src/forwarding/forwarding-powerpc-elf.S +++ src/forwarding/forwarding-powerpc-elf.S @@ -355,8 +355,8 @@ .long OFMethodNotFound .Lgot_OFMethodNotFound_stret: .long OFMethodNotFound_stret #endif -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", @progbits #endif Index: src/forwarding/forwarding-sparc-elf.S ================================================================== --- src/forwarding/forwarding-sparc-elf.S +++ src/forwarding/forwarding-sparc-elf.S @@ -188,8 +188,8 @@ .word 0 .word 0 module: .word 8, 16, 0, symtab -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/forwarding/forwarding-sparc64-elf.S ================================================================== --- src/forwarding/forwarding-sparc64-elf.S +++ src/forwarding/forwarding-sparc64-elf.S @@ -248,8 +248,8 @@ .word 0 .xword 0 module: .xword 8, 32, 0, symtab -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/forwarding/forwarding-x86-elf.S ================================================================== --- src/forwarding/forwarding-x86-elf.S +++ src/forwarding/forwarding-x86-elf.S @@ -193,8 +193,8 @@ .long 0 .long 0 module: .long 8, 16, 0, symtab -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -413,10 +413,34 @@ \ abort(); \ \ [super dealloc]; /* Get rid of a stupid warning */ #endif +#define OF_SINGLETON_METHODS \ + - (instancetype)autorelease \ + { \ + return self; \ + } \ + \ + - (instancetype)retain \ + { \ + return self; \ + } \ + \ + - (void)release \ + { \ + } \ + \ + - (unsigned int)retainCount \ + { \ + return OFMaxRetainCount; \ + } \ + \ + - (void)dealloc \ + { \ + OF_DEALLOC_UNSUPPORTED \ + } #define OF_CONSTRUCTOR(prio) \ static void __attribute__((__constructor__(prio))) \ OF_PREPROCESSOR_CONCAT(constructor, __LINE__)(void) #define OF_DESTRUCTOR(prio) \ Index: src/platform/POSIX/OFSystemInfo+NetworkInterfaces.m ================================================================== --- src/platform/POSIX/OFSystemInfo+NetworkInterfaces.m +++ src/platform/POSIX/OFSystemInfo+NetworkInterfaces.m @@ -19,10 +19,13 @@ # include #endif #ifdef OF_HAVE_SYS_SOCKET_H # include #endif +#ifdef HAVE_SYS_SOCKIO_H +# include +#endif #ifdef HAVE_NET_IF_H # include #endif #ifdef HAVE_NET_IF_ARP_H # include @@ -65,21 +68,21 @@ @try { for (size_t i = 0; nameindex[i].if_index != 0; i++) { OFString *name = [OFString stringWithCString: nameindex[i].if_name encoding: encoding]; - OFNumber *index = [OFNumber + OFNumber *idx = [OFNumber numberWithUnsignedInt: nameindex[i].if_index]; OFMutableDictionary *interface = [ret objectForKey: name]; if (interface == nil) { interface = [OFMutableDictionary dictionary]; [ret setObject: interface forKey: name]; } - [interface setObject: index + [interface setObject: idx forKey: OFNetworkInterfaceIndex]; } } @finally { if_freenameindex(nameindex); } @@ -96,20 +99,89 @@ OFNetworkInterfaceKey key, OFSocketAddressFamily addressFamily, int family, size_t sockaddrSize) { OFStringEncoding encoding = [OFLocale encoding]; int sock = socket(family, SOCK_DGRAM, 0); - struct ifconf ifc; - struct ifreq *ifrs; OFMutableDictionary *interface; OFEnumerator *enumerator; if (sock < 0) return false; - ifrs = malloc(128 * sizeof(struct ifreq)); - if (ifrs == NULL) { +# if defined(HAVE_STRUCT_LIFCONF) && defined(SIOCGLIFCONF) + struct lifconf lifc; + struct lifreq *lifrs; + + if ((lifrs = malloc(128 * sizeof(struct lifreq))) == NULL) { + closesocket(sock); + return false; + } + + @try { + char *buffer; + + memset(&lifc, 0, sizeof(lifc)); + lifc.lifc_buf = (void *)lifrs; + lifc.lifc_len = 128 * sizeof(struct lifreq); + if (ioctl(sock, SIOCGLIFCONF, &lifc) < 0) + return false; + + for (buffer = lifc.lifc_buf; + buffer < (char *)lifc.lifc_buf + lifc.lifc_len; + buffer += sizeof(struct lifreq)) { + struct lifreq *current = + (struct lifreq *)(void *)buffer; + OFString *name; + OFMutableData *addresses; + OFSocketAddress address; + + if (current->lifr_addr.ss_family != family) + continue; + + name = [OFString stringWithCString: current->lifr_name + encoding: encoding]; + if ((interface = [ret objectForKey: name]) == nil) { + interface = [OFMutableDictionary dictionary]; + [ret setObject: interface forKey: name]; + } + + addresses = [interface objectForKey: key]; + if (addresses == nil) { + addresses = [OFMutableData + dataWithItemSize: sizeof(OFSocketAddress)]; + [interface setObject: addresses forKey: key]; + } + + memset(&address, 0, sizeof(address)); + address.family = addressFamily; + memcpy(&address.sockaddr.in, ¤t->lifr_addr, + sockaddrSize); + +# if defined(OF_HAVE_IPV6) && defined(HAVE_IF_NAMETOINDEX) + if (address.sockaddr.in6.sin6_family == AF_INET6 && + address.sockaddr.in6.sin6_addr.s6_addr[0] == 0xFE && + (address.sockaddr.in6.sin6_addr.s6_addr[1] & 0xC0) + == 0x80) + address.sockaddr.in6.sin6_scope_id = + if_nametoindex( + [name cStringWithEncoding: encoding]); +# endif + + [addresses addItem: &address]; + } + } @finally { + free(lifrs); + closesocket(sock); + } +# else + struct ifconf ifc; + struct ifreq *ifrs; + + if (sock < 0) + return false; + + if ((ifrs = malloc(128 * sizeof(struct ifreq))) == NULL) { closesocket(sock); return false; } @try { @@ -147,10 +219,26 @@ memset(&address, 0, sizeof(address)); address.family = addressFamily; memcpy(&address.sockaddr.in, ¤t->ifr_addr, sockaddrSize); + +# if defined(OF_HAVE_IPV6) && defined(HAVE_IF_NAMETOINDEX) + if (address.sockaddr.in6.sin6_family == AF_INET6 && + address.sockaddr.in6.sin6_addr.s6_addr[0] == 0xFE && + (address.sockaddr.in6.sin6_addr.s6_addr[1] & 0xC0) + == 0x80) { +# if defined(HAVE_INET6_GETSCOPEID) + inet6_getscopeid(&address.sockaddr.in6, + INET6_IS_ADDR_LINKLOCAL); +# elif defined(HAVE_IF_NAMETOINDEX) + address.sockaddr.in6.sin6_scope_id = + if_nametoindex( + [name cStringWithEncoding: encoding]); +# endif + } +# endif [addresses addItem: &address]; next: # ifdef _SIZEOF_ADDR_IFREQ @@ -161,10 +249,11 @@ } } @finally { free(ifrs); closesocket(sock); } +# endif enumerator = [ret objectEnumerator]; while ((interface = [enumerator nextObject]) != nil) [[interface objectForKey: key] makeImmutable]; @@ -187,10 +276,13 @@ #ifdef OF_HAVE_IPV6 static bool queryNetworkInterfaceIPv6Addresses(OFMutableDictionary *ret) { # if defined(OF_LINUX) && defined(OF_HAVE_FILES) +# ifdef HAVE_IF_NAMETOINDEX + OFStringEncoding encoding = [OFLocale encoding]; +# endif OFFile *file; OFString *line; OFMutableDictionary *interface; OFEnumerator *enumerator; @@ -222,10 +314,11 @@ [ret setObject: interface forKey: name]; } memset(&address, 0, sizeof(address)); address.family = OFSocketAddressFamilyIPv6; + address.sockaddr.in6.sin6_family = AF_INET6; for (size_t i = 0; i < 32; i += 2) { unsigned long long byte; @try { @@ -240,10 +333,17 @@ goto next_line; address.sockaddr.in6.sin6_addr.s6_addr[i / 2] = (unsigned char)byte; } + +# ifdef HAVE_IF_NAMETOINDEX + if (address.sockaddr.in6.sin6_addr.s6_addr[0] == 0xFE && + (address.sockaddr.in6.sin6_addr.s6_addr[1] & 0xC0) == 0x80) + address.sockaddr.in6.sin6_scope_id = if_nametoindex( + [name cStringWithEncoding: encoding]); +# endif if ((addresses = [interface objectForKey: OFNetworkInterfaceIPv6Addresses]) == nil) { addresses = [OFMutableData dataWithItemSize: sizeof(OFSocketAddress)]; @@ -275,11 +375,86 @@ #ifdef OF_HAVE_IPX static bool queryNetworkInterfaceIPXAddresses(OFMutableDictionary *ret) { -# if defined(HAVE_IOCTL) && defined(HAVE_NET_IF_H) +# if defined(OF_LINUX) && defined(OF_HAVE_FILES) + OFFile *file; + OFString *line; + OFMutableDictionary *interface; + OFEnumerator *enumerator; + + @try { + file = [OFFile fileWithPath: @"/proc/net/ipx/interface" + mode: @"r"]; + } @catch (OFOpenItemFailedException *e) { + return false; + } + + /* First line is "Network Node_Address Primary Device Frame_Type" */ + if (![[file readLine] hasPrefix: @"Network "]) + return false; + + while ((line = [file readLine]) != nil) { + OFArray *components = [line + componentsSeparatedByString: @" " + options: OFStringSkipEmptyComponents]; + OFString *name; + unsigned long long network, nodeLong; + unsigned char node[IPX_NODE_LEN]; + OFSocketAddress address; + OFMutableData *addresses; + + if (components.count < 5) + continue; + + name = [components objectAtIndex: 3]; + + if ((interface = [ret objectForKey: name]) == nil) { + interface = [OFMutableDictionary dictionary]; + [ret setObject: interface forKey: name]; + } + + @try { + network = [[components objectAtIndex: 0] + unsignedLongLongValueWithBase: 16]; + nodeLong = [[components objectAtIndex: 1] + unsignedLongLongValueWithBase: 16]; + } @catch (OFInvalidFormatException *e) { + continue; + } + + if (network > 0xFFFFFFFF || nodeLong > 0xFFFFFFFFFFFF) + continue; + + node[0] = (nodeLong >> 40) & 0xFF; + node[1] = (nodeLong >> 32) & 0xFF; + node[2] = (nodeLong >> 24) & 0xFF; + node[3] = (nodeLong >> 16) & 0xFF; + node[4] = (nodeLong >> 8) & 0xFF; + node[5] = nodeLong & 0xFF; + + address = OFSocketAddressMakeIPX((uint32_t)network, node, 0); + + if ((addresses = [interface objectForKey: + OFNetworkInterfaceIPXAddresses]) == nil) { + addresses = [OFMutableData + dataWithItemSize: sizeof(OFSocketAddress)]; + [interface setObject: addresses + forKey: OFNetworkInterfaceIPXAddresses]; + } + + [addresses addItem: &address]; + } + + enumerator = [ret objectEnumerator]; + while ((interface = [enumerator nextObject]) != nil) + [[interface objectForKey: OFNetworkInterfaceIPXAddresses] + makeImmutable]; + + return false; +# elif defined(HAVE_IOCTL) && defined(HAVE_NET_IF_H) return queryNetworkInterfaceAddresses(ret, OFNetworkInterfaceIPXAddresses, OFSocketAddressFamilyIPX, AF_IPX, sizeof(struct sockaddr_ipx)); # else return false; @@ -289,11 +464,87 @@ #ifdef OF_HAVE_APPLETALK static bool queryNetworkInterfaceAppleTalkAddresses(OFMutableDictionary *ret) { -# if defined(HAVE_IOCTL) && defined(HAVE_NET_IF_H) +# if defined(OF_LINUX) && defined(OF_HAVE_FILES) + OFFile *file; + OFString *line; + OFMutableDictionary *interface; + OFEnumerator *enumerator; + + @try { + file = [OFFile fileWithPath: @"/proc/net/atalk/interface" + mode: @"r"]; + } @catch (OFOpenItemFailedException *e) { + return false; + } + + /* First line is "Interface Address Networks Status" */ + if (![[file readLine] hasPrefix: @"Interface "]) + return false; + + while ((line = [file readLine]) != nil) { + OFArray *components = [line + componentsSeparatedByString: @" " + options: OFStringSkipEmptyComponents]; + OFString *addressString, *name; + unsigned long long network, node; + OFSocketAddress address; + OFMutableData *addresses; + + if (components.count < 4) + continue; + + name = [components objectAtIndex: 0]; + addressString = [components objectAtIndex: 1]; + + if (addressString.length != 7 || + [addressString characterAtIndex: 4] != ':') + continue; + + if ((interface = [ret objectForKey: name]) == nil) { + interface = [OFMutableDictionary dictionary]; + [ret setObject: interface forKey: name]; + } + + @try { + network = [[addressString + substringWithRange: OFMakeRange(0, 4)] + unsignedLongLongValueWithBase: 16]; + node = [[addressString + substringWithRange: OFMakeRange(5, 2)] + unsignedLongLongValueWithBase: 16]; + } @catch (OFInvalidFormatException *e) { + continue; + } + + if (network > 0xFFFF || node > 0xFF) + continue; + + address = OFSocketAddressMakeAppleTalk( + (uint16_t)network, (uint8_t)node, 0); + + if ((addresses = [interface objectForKey: + OFNetworkInterfaceAppleTalkAddresses]) == nil) { + addresses = [OFMutableData + dataWithItemSize: sizeof(OFSocketAddress)]; + [interface + setObject: addresses + forKey: OFNetworkInterfaceAppleTalkAddresses]; + } + + [addresses addItem: &address]; + } + + enumerator = [ret objectEnumerator]; + while ((interface = [enumerator nextObject]) != nil) + [[interface objectForKey: OFNetworkInterfaceAppleTalkAddresses] + makeImmutable]; + + return false; +# elif defined(HAVE_IOCTL) && defined(HAVE_NET_IF_H) return queryNetworkInterfaceAddresses(ret, OFNetworkInterfaceAppleTalkAddresses, OFSocketAddressFamilyAppleTalk, AF_APPLETALK, sizeof(struct sockaddr_at)); # else @@ -303,11 +554,47 @@ #endif static bool queryNetworkInterfaceHardwareAddress(OFMutableDictionary *ret) { -#if defined(HAVE_IOCTL) && defined(HAVE_NET_IF_H) && defined(SIOCGIFHWADDR) +#if defined(HAVE_IOCTL) && defined(HAVE_NET_IF_H) && defined(SIOCGLIFHWADDR) + OFStringEncoding encoding = [OFLocale encoding]; + int sock = socket(AF_INET, SOCK_DGRAM, 0); + + if (sock < 0) + return false; + + for (OFString *name in ret) { + size_t nameLength = [name cStringLengthWithEncoding: encoding]; + struct lifreq lifr; + struct sockaddr_dl *sdl; + OFData *hardwareAddress; + + if (nameLength > IFNAMSIZ) + continue; + + memset(&lifr, 0, sizeof(lifr)); + memcpy(&lifr.lifr_name, [name cStringWithEncoding: encoding], + nameLength); + + if (ioctl(sock, SIOCGLIFHWADDR, &lifr) < 0) + continue; + + if (lifr.lifr_addr.ss_family != AF_LINK) + continue; + + sdl = (struct sockaddr_dl *)(void *)&lifr.lifr_addr; + hardwareAddress = [OFData dataWithItems: LLADDR(sdl) + count: sdl->sdl_alen]; + [[ret objectForKey: name] + setObject: hardwareAddress + forKey: OFNetworkInterfaceHardwareAddress]; + } + + return true; +#elif defined(HAVE_IOCTL) && defined(HAVE_NET_IF_H) && \ + defined(SIOCGIFHWADDR) && defined(HAVE_STRUCT_IFREQ_IFR_HWADDR) OFStringEncoding encoding = [OFLocale encoding]; int sock = socket(AF_INET, SOCK_DGRAM, 0); if (sock < 0) return false; Index: src/runtime/arc.m ================================================================== --- src/runtime/arc.m +++ src/runtime/arc.m @@ -186,19 +186,17 @@ id objc_loadWeakRetained(id *object) { id value = nil; - struct WeakRef *ref; #ifdef OF_HAVE_THREADS if (OFSpinlockLock(&spinlock) != 0) OBJC_ERROR("Failed to lock spinlock!"); #endif - if (*object != nil && - (ref = objc_hashtable_get(hashtable, *object)) != NULL) + if (*object != nil && objc_hashtable_get(hashtable, *object) != NULL) value = *object; #ifdef OF_HAVE_THREADS if (OFSpinlockUnlock(&spinlock) != 0) OBJC_ERROR("Failed to unlock spinlock!"); Index: src/runtime/exception.m ================================================================== --- src/runtime/exception.m +++ src/runtime/exception.m @@ -24,11 +24,11 @@ #import "ObjFWRT.h" #import "private.h" #import "macros.h" #ifdef OF_HAVE_THREADS -# include "OFPlainMutex.h" +# import "OFPlainMutex.h" #endif #ifdef HAVE_SEH_EXCEPTIONS # include #endif Index: src/runtime/lookup-asm/lookup-asm-amd64-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-amd64-elf.S +++ src/runtime/lookup-asm/lookup-asm-amd64-elf.S @@ -91,8 +91,8 @@ nilMethod: xorq %rax, %rax ret -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-arm-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-arm-elf.S +++ src/runtime/lookup-asm/lookup-asm-arm-elf.S @@ -113,8 +113,8 @@ nilMethod: mov r0, #0 bx lr -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-arm64-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-arm64-elf.S +++ src/runtime/lookup-asm/lookup-asm-arm64-elf.S @@ -91,8 +91,8 @@ nilMethod: mov x0, #0 ret -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-mips-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-mips-elf.S +++ src/runtime/lookup-asm/lookup-asm-mips-elf.S @@ -152,8 +152,8 @@ nilMethod: move $v0, $zero jr $ra -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-mips64-n64-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-mips64-n64-elf.S +++ src/runtime/lookup-asm/lookup-asm-mips64-n64-elf.S @@ -132,8 +132,8 @@ nilMethod: move $v0, $zero jr $ra -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-powerpc-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-powerpc-elf.S +++ src/runtime/lookup-asm/lookup-asm-powerpc-elf.S @@ -166,8 +166,8 @@ .long objc_taggedPointerSecret .Lgot_objc_taggedPointerClasses: .long objc_taggedPointerClasses #endif -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", @progbits #endif Index: src/runtime/lookup-asm/lookup-asm-powerpc64-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-powerpc64-elf.S +++ src/runtime/lookup-asm/lookup-asm-powerpc64-elf.S @@ -156,8 +156,8 @@ li %r3, 0 blr .type nilMethod, @function .size nilMethod, .-.Lbegin_nilMethod -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", @progbits #endif Index: src/runtime/lookup-asm/lookup-asm-sparc-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-sparc-elf.S +++ src/runtime/lookup-asm/lookup-asm-sparc-elf.S @@ -142,8 +142,8 @@ nilMethod: retl clr %o0 -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-sparc64-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-sparc64-elf.S +++ src/runtime/lookup-asm/lookup-asm-sparc64-elf.S @@ -139,8 +139,8 @@ nilMethod: retl clr %o0 -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/lookup-asm/lookup-asm-x86-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-x86-elf.S +++ src/runtime/lookup-asm/lookup-asm-x86-elf.S @@ -108,8 +108,8 @@ getEIP: movl (%esp), %eax ret -#if defined(OF_LINUX) || defined(OF_HURD) +#if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif Index: src/runtime/private.h ================================================================== --- src/runtime/private.h +++ src/runtime/private.h @@ -37,11 +37,11 @@ unsigned long version; unsigned long info; long instanceSize; struct objc_ivar_list *_Nullable ivars; struct objc_method_list *_Nullable methodList; - struct objc_dtable *_Nonnull dTable; + struct objc_dtable *_Nullable dTable; Class _Nullable *_Nullable subclassList; void *_Nullable siblingClass; struct objc_protocol_list *_Nullable protocols; void *_Nullable GCObjectType; unsigned long ABIVersion; Index: src/tls/OFOpenSSLTLSStream.m ================================================================== --- src/tls/OFOpenSSLTLSStream.m +++ src/tls/OFOpenSSLTLSStream.m @@ -106,26 +106,10 @@ size_t bytesRead; if (!_handshakeDone) @throw [OFNotOpenException exceptionWithObject: self]; - if (BIO_ctrl_pending(_readBIO) < 1) { - @try { - size_t tmp = [_underlyingStream - readIntoBuffer: _buffer - length: bufferSize]; - - OFEnsure(tmp <= INT_MAX); - /* Writing to a memory BIO must never fail. */ - OFEnsure(BIO_write(_readBIO, _buffer, (int)tmp) == - (int)tmp); - } @catch (OFReadFailedException *e) { - if (e.errNo != EWOULDBLOCK && e.errNo != EAGAIN) - @throw e; - } - } - ret = SSL_read_ex(_SSL, buffer, length, &bytesRead); while (BIO_ctrl_pending(_writeBIO) > 0) { int tmp = BIO_read(_writeBIO, _buffer, bufferSize); @@ -133,30 +117,52 @@ [_underlyingStream writeBuffer: _buffer length: tmp]; [_underlyingStream flushWriteBuffer]; } - if (ret != 1) { - /* - * The underlying stream might have had data ready, but not - * enough for OpenSSL to return decrypted data. This means the - * caller might have observed the TLS stream for reading, got a - * ready signal and read - and expects the read to succeed, not - * to fail with EWOULDBLOCK, as it was signaled ready. - * Therefore, return 0, as we could read 0 decrypted bytes, but - * cleared the ready signal of the underlying stream. - */ + if (ret == 1) + return bytesRead; + + if (SSL_get_error(_SSL, ret) == SSL_ERROR_WANT_READ) { + if (BIO_ctrl_pending(_readBIO) < 1) { + @try { + size_t tmp = [_underlyingStream + readIntoBuffer: _buffer + length: bufferSize]; + + OFEnsure(tmp <= INT_MAX); + /* Writing to a memory BIO must never fail. */ + OFEnsure(BIO_write(_readBIO, _buffer, + (int)tmp) == (int)tmp); + } @catch (OFReadFailedException *e) { + if (e.errNo == EWOULDBLOCK || e.errNo != EAGAIN) + return 0; + } + } + + ret = SSL_read_ex(_SSL, buffer, length, &bytesRead); + + while (BIO_ctrl_pending(_writeBIO) > 0) { + int tmp = BIO_read(_writeBIO, _buffer, bufferSize); + + OFEnsure(tmp >= 0); + + [_underlyingStream writeBuffer: _buffer length: tmp]; + [_underlyingStream flushWriteBuffer]; + } + + if (ret == 1) + return bytesRead; + if (SSL_get_error(_SSL, ret) == SSL_ERROR_WANT_READ) return 0; - - /* FIXME: Translate error to errNo */ - @throw [OFReadFailedException exceptionWithObject: self - requestedLength: length - errNo: 0]; } - return bytesRead; + /* FIXME: Translate error to errNo */ + @throw [OFReadFailedException exceptionWithObject: self + requestedLength: length + errNo: 0]; } - (size_t)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { int ret; Index: src/unicode.h ================================================================== --- src/unicode.h +++ src/unicode.h @@ -17,12 +17,10 @@ #define OFUnicodeUppercaseTableSize 0x1EA #define OFUnicodeLowercaseTableSize 0x1EA #define OFUnicodeTitlecaseTableSize 0x1EA #define OFUnicodeCaseFoldingTableSize 0x1EA -#define OFUnicodeDecompositionTableSize 0x2FB -#define OFUnicodeDecompositionCompatTableSize 0x2FB #ifdef __cplusplus extern "C" { #endif extern const OFUnichar *const _Nonnull @@ -31,12 +29,8 @@ OFUnicodeLowercaseTable[OFUnicodeLowercaseTableSize]; extern const OFUnichar *const _Nonnull OFUnicodeTitlecaseTable[OFUnicodeTitlecaseTableSize]; extern const OFUnichar *const _Nonnull OFUnicodeCaseFoldingTable[OFUnicodeCaseFoldingTableSize]; -extern const char *const _Nullable *const _Nonnull - OFUnicodeDecompositionTable[OFUnicodeDecompositionTableSize]; -extern const char *const _Nullable *const _Nonnull - OFUnicodeDecompositionCompatTable[OFUnicodeDecompositionCompatTableSize]; #ifdef __cplusplus } #endif Index: src/unicode.m ================================================================== --- src/unicode.m +++ src/unicode.m @@ -16,11 +16,10 @@ #include "config.h" #import "OFString.h" static const OFUnichar emptyPage[0x100] = { 0 }; -static const char *emptyDecompositionPage[0x100] = { NULL }; static const OFUnichar uppercasePage0[0x100] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -520,11 +519,11 @@ 11264, 11265, 11266, 11267, 11268, 11269, 11270, 11271, 11272, 11273, 11274, 11275, 11276, 11277, 11278, 11279, 11280, 11281, 11282, 11283, 11284, 11285, 11286, 11287, 11288, 11289, 11290, 11291, 11292, 11293, 11294, 11295, 11296, 11297, 11298, 11299, 11300, 11301, 11302, 11303, - 11304, 11305, 11306, 11307, 11308, 11309, 11310, 0, + 11304, 11305, 11306, 11307, 11308, 11309, 11310, 11311, 0, 11360, 0, 0, 0, 570, 574, 0, 11367, 0, 11369, 0, 11371, 0, 0, 0, 0, 0, 0, 11378, 0, 0, 11381, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11392, 0, 11394, 0, 11396, 0, 11398, @@ -638,14 +637,14 @@ 0, 42904, 0, 42906, 0, 42908, 0, 42910, 0, 42912, 0, 42914, 0, 42916, 0, 42918, 0, 42920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42932, 0, 42934, 0, 42936, 0, 42938, 0, 42940, 0, 42942, - 0, 0, 0, 42946, 0, 0, 0, 0, + 0, 42944, 0, 42946, 0, 0, 0, 0, 42951, 0, 42953, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 42960, 0, 0, 0, 0, 0, 42966, + 0, 42968, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42997, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; @@ -752,10 +751,45 @@ 66744, 66745, 66746, 66747, 66748, 66749, 66750, 66751, 66752, 66753, 66754, 66755, 66756, 66757, 66758, 66759, 66760, 66761, 66762, 66763, 66764, 66765, 66766, 66767, 66768, 66769, 66770, 66771, 0, 0, 0, 0, }; + +static const OFUnichar uppercasePage261[0x100] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 66928, + 66929, 66930, 66931, 66932, 66933, 66934, 66935, 66936, + 66937, 66938, 0, 66940, 66941, 66942, 66943, 66944, + 66945, 66946, 66947, 66948, 66949, 66950, 66951, 66952, + 66953, 66954, 0, 66956, 66957, 66958, 66959, 66960, + 66961, 66962, 0, 66964, 66965, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +}; static const OFUnichar uppercasePage268[0x100] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1354,11 +1388,11 @@ 11312, 11313, 11314, 11315, 11316, 11317, 11318, 11319, 11320, 11321, 11322, 11323, 11324, 11325, 11326, 11327, 11328, 11329, 11330, 11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, 11339, 11340, 11341, 11342, 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350, 11351, - 11352, 11353, 11354, 11355, 11356, 11357, 11358, 0, + 11352, 11353, 11354, 11355, 11356, 11357, 11358, 11359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1443,14 +1477,14 @@ 42905, 0, 42907, 0, 42909, 0, 42911, 0, 42913, 0, 42915, 0, 42917, 0, 42919, 0, 42921, 0, 614, 604, 609, 620, 618, 0, 670, 647, 669, 43859, 42933, 0, 42935, 0, 42937, 0, 42939, 0, 42941, 0, 42943, 0, - 0, 0, 42947, 0, 42900, 642, 7566, 42952, + 42945, 0, 42947, 0, 42900, 642, 7566, 42952, 0, 42954, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + 42961, 0, 0, 0, 0, 0, 42967, 0, + 42969, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42998, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; @@ -1516,10 +1550,45 @@ 66776, 66777, 66778, 66779, 66780, 66781, 66782, 66783, 66784, 66785, 66786, 66787, 66788, 66789, 66790, 66791, 66792, 66793, 66794, 66795, 66796, 66797, 66798, 66799, 66800, 66801, 66802, 66803, 66804, 66805, 66806, 66807, 66808, 66809, 66810, 66811, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const OFUnichar lowercasePage261[0x100] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 66967, 66968, 66969, 66970, 66971, 66972, 66973, 66974, + 66975, 66976, 66977, 0, 66979, 66980, 66981, 66982, + 66983, 66984, 66985, 66986, 66987, 66988, 66989, 66990, + 66991, 66992, 66993, 0, 66995, 66996, 66997, 66998, + 66999, 67000, 67001, 0, 67003, 67004, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2013,10359 +2082,10 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -static const char *const decompositionPage0[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x41\xCC\x80", "\x41\xCC\x81", - "\x41\xCC\x82", "\x41\xCC\x83", - "\x41\xCC\x88", "\x41\xCC\x8A", - NULL, "\x43\xCC\xA7", - "\x45\xCC\x80", "\x45\xCC\x81", - "\x45\xCC\x82", "\x45\xCC\x88", - "\x49\xCC\x80", "\x49\xCC\x81", - "\x49\xCC\x82", "\x49\xCC\x88", - NULL, "\x4E\xCC\x83", - "\x4F\xCC\x80", "\x4F\xCC\x81", - "\x4F\xCC\x82", "\x4F\xCC\x83", - "\x4F\xCC\x88", NULL, - NULL, "\x55\xCC\x80", - "\x55\xCC\x81", "\x55\xCC\x82", - "\x55\xCC\x88", "\x59\xCC\x81", - NULL, NULL, - "\x61\xCC\x80", "\x61\xCC\x81", - "\x61\xCC\x82", "\x61\xCC\x83", - "\x61\xCC\x88", "\x61\xCC\x8A", - NULL, "\x63\xCC\xA7", - "\x65\xCC\x80", "\x65\xCC\x81", - "\x65\xCC\x82", "\x65\xCC\x88", - "\x69\xCC\x80", "\x69\xCC\x81", - "\x69\xCC\x82", "\x69\xCC\x88", - NULL, "\x6E\xCC\x83", - "\x6F\xCC\x80", "\x6F\xCC\x81", - "\x6F\xCC\x82", "\x6F\xCC\x83", - "\x6F\xCC\x88", NULL, - NULL, "\x75\xCC\x80", - "\x75\xCC\x81", "\x75\xCC\x82", - "\x75\xCC\x88", "\x79\xCC\x81", - NULL, "\x79\xCC\x88", -}; - -static const char *const decompositionPage1[0x100] = { - "\x41\xCC\x84", "\x61\xCC\x84", - "\x41\xCC\x86", "\x61\xCC\x86", - "\x41\xCC\xA8", "\x61\xCC\xA8", - "\x43\xCC\x81", "\x63\xCC\x81", - "\x43\xCC\x82", "\x63\xCC\x82", - "\x43\xCC\x87", "\x63\xCC\x87", - "\x43\xCC\x8C", "\x63\xCC\x8C", - "\x44\xCC\x8C", "\x64\xCC\x8C", - NULL, NULL, - "\x45\xCC\x84", "\x65\xCC\x84", - "\x45\xCC\x86", "\x65\xCC\x86", - "\x45\xCC\x87", "\x65\xCC\x87", - "\x45\xCC\xA8", "\x65\xCC\xA8", - "\x45\xCC\x8C", "\x65\xCC\x8C", - "\x47\xCC\x82", "\x67\xCC\x82", - "\x47\xCC\x86", "\x67\xCC\x86", - "\x47\xCC\x87", "\x67\xCC\x87", - "\x47\xCC\xA7", "\x67\xCC\xA7", - "\x48\xCC\x82", "\x68\xCC\x82", - NULL, NULL, - "\x49\xCC\x83", "\x69\xCC\x83", - "\x49\xCC\x84", "\x69\xCC\x84", - "\x49\xCC\x86", "\x69\xCC\x86", - "\x49\xCC\xA8", "\x69\xCC\xA8", - "\x49\xCC\x87", NULL, - NULL, NULL, - "\x4A\xCC\x82", "\x6A\xCC\x82", - "\x4B\xCC\xA7", "\x6B\xCC\xA7", - NULL, "\x4C\xCC\x81", - "\x6C\xCC\x81", "\x4C\xCC\xA7", - "\x6C\xCC\xA7", "\x4C\xCC\x8C", - "\x6C\xCC\x8C", NULL, - NULL, NULL, - NULL, "\x4E\xCC\x81", - "\x6E\xCC\x81", "\x4E\xCC\xA7", - "\x6E\xCC\xA7", "\x4E\xCC\x8C", - "\x6E\xCC\x8C", NULL, - NULL, NULL, - "\x4F\xCC\x84", "\x6F\xCC\x84", - "\x4F\xCC\x86", "\x6F\xCC\x86", - "\x4F\xCC\x8B", "\x6F\xCC\x8B", - NULL, NULL, - "\x52\xCC\x81", "\x72\xCC\x81", - "\x52\xCC\xA7", "\x72\xCC\xA7", - "\x52\xCC\x8C", "\x72\xCC\x8C", - "\x53\xCC\x81", "\x73\xCC\x81", - "\x53\xCC\x82", "\x73\xCC\x82", - "\x53\xCC\xA7", "\x73\xCC\xA7", - "\x53\xCC\x8C", "\x73\xCC\x8C", - "\x54\xCC\xA7", "\x74\xCC\xA7", - "\x54\xCC\x8C", "\x74\xCC\x8C", - NULL, NULL, - "\x55\xCC\x83", "\x75\xCC\x83", - "\x55\xCC\x84", "\x75\xCC\x84", - "\x55\xCC\x86", "\x75\xCC\x86", - "\x55\xCC\x8A", "\x75\xCC\x8A", - "\x55\xCC\x8B", "\x75\xCC\x8B", - "\x55\xCC\xA8", "\x75\xCC\xA8", - "\x57\xCC\x82", "\x77\xCC\x82", - "\x59\xCC\x82", "\x79\xCC\x82", - "\x59\xCC\x88", "\x5A\xCC\x81", - "\x7A\xCC\x81", "\x5A\xCC\x87", - "\x7A\xCC\x87", "\x5A\xCC\x8C", - "\x7A\xCC\x8C", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x4F\xCC\x9B", "\x6F\xCC\x9B", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\x55\xCC\x9B", - "\x75\xCC\x9B", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\x41\xCC\x8C", - "\x61\xCC\x8C", "\x49\xCC\x8C", - "\x69\xCC\x8C", "\x4F\xCC\x8C", - "\x6F\xCC\x8C", "\x55\xCC\x8C", - "\x75\xCC\x8C", "\x55\xCC\x88\xCC\x84", - "\x75\xCC\x88\xCC\x84", "\x55\xCC\x88\xCC\x81", - "\x75\xCC\x88\xCC\x81", "\x55\xCC\x88\xCC\x8C", - "\x75\xCC\x88\xCC\x8C", "\x55\xCC\x88\xCC\x80", - "\x75\xCC\x88\xCC\x80", NULL, - "\x41\xCC\x88\xCC\x84", "\x61\xCC\x88\xCC\x84", - "\x41\xCC\x87\xCC\x84", "\x61\xCC\x87\xCC\x84", - "\xC3\x86\xCC\x84", "\xC3\xA6\xCC\x84", - NULL, NULL, - "\x47\xCC\x8C", "\x67\xCC\x8C", - "\x4B\xCC\x8C", "\x6B\xCC\x8C", - "\x4F\xCC\xA8", "\x6F\xCC\xA8", - "\x4F\xCC\xA8\xCC\x84", "\x6F\xCC\xA8\xCC\x84", - "\xC6\xB7\xCC\x8C", "\xCA\x92\xCC\x8C", - "\x6A\xCC\x8C", NULL, - NULL, NULL, - "\x47\xCC\x81", "\x67\xCC\x81", - NULL, NULL, - "\x4E\xCC\x80", "\x6E\xCC\x80", - "\x41\xCC\x8A\xCC\x81", "\x61\xCC\x8A\xCC\x81", - "\xC3\x86\xCC\x81", "\xC3\xA6\xCC\x81", - "\xC3\x98\xCC\x81", "\xC3\xB8\xCC\x81", -}; - -static const char *const decompositionPage2[0x100] = { - "\x41\xCC\x8F", "\x61\xCC\x8F", - "\x41\xCC\x91", "\x61\xCC\x91", - "\x45\xCC\x8F", "\x65\xCC\x8F", - "\x45\xCC\x91", "\x65\xCC\x91", - "\x49\xCC\x8F", "\x69\xCC\x8F", - "\x49\xCC\x91", "\x69\xCC\x91", - "\x4F\xCC\x8F", "\x6F\xCC\x8F", - "\x4F\xCC\x91", "\x6F\xCC\x91", - "\x52\xCC\x8F", "\x72\xCC\x8F", - "\x52\xCC\x91", "\x72\xCC\x91", - "\x55\xCC\x8F", "\x75\xCC\x8F", - "\x55\xCC\x91", "\x75\xCC\x91", - "\x53\xCC\xA6", "\x73\xCC\xA6", - "\x54\xCC\xA6", "\x74\xCC\xA6", - NULL, NULL, - "\x48\xCC\x8C", "\x68\xCC\x8C", - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x41\xCC\x87", "\x61\xCC\x87", - "\x45\xCC\xA7", "\x65\xCC\xA7", - "\x4F\xCC\x88\xCC\x84", "\x6F\xCC\x88\xCC\x84", - "\x4F\xCC\x83\xCC\x84", "\x6F\xCC\x83\xCC\x84", - "\x4F\xCC\x87", "\x6F\xCC\x87", - "\x4F\xCC\x87\xCC\x84", "\x6F\xCC\x87\xCC\x84", - "\x59\xCC\x84", "\x79\xCC\x84", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage3[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xCC\x80", "\xCC\x81", - NULL, "\xCC\x93", - "\xCC\x88\xCC\x81", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xCA\xB9", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x3B", NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xC2\xA8\xCC\x81", - "\xCE\x91\xCC\x81", "\xC2\xB7", - "\xCE\x95\xCC\x81", "\xCE\x97\xCC\x81", - "\xCE\x99\xCC\x81", NULL, - "\xCE\x9F\xCC\x81", NULL, - "\xCE\xA5\xCC\x81", "\xCE\xA9\xCC\x81", - "\xCE\xB9\xCC\x88\xCC\x81", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xCE\x99\xCC\x88", "\xCE\xA5\xCC\x88", - "\xCE\xB1\xCC\x81", "\xCE\xB5\xCC\x81", - "\xCE\xB7\xCC\x81", "\xCE\xB9\xCC\x81", - "\xCF\x85\xCC\x88\xCC\x81", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xCE\xB9\xCC\x88", "\xCF\x85\xCC\x88", - "\xCE\xBF\xCC\x81", "\xCF\x85\xCC\x81", - "\xCF\x89\xCC\x81", NULL, - NULL, NULL, - NULL, "\xCF\x92\xCC\x81", - "\xCF\x92\xCC\x88", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage4[0x100] = { - "\xD0\x95\xCC\x80", "\xD0\x95\xCC\x88", - NULL, "\xD0\x93\xCC\x81", - NULL, NULL, - NULL, "\xD0\x86\xCC\x88", - NULL, NULL, - NULL, NULL, - "\xD0\x9A\xCC\x81", "\xD0\x98\xCC\x80", - "\xD0\xA3\xCC\x86", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xD0\x98\xCC\x86", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xD0\xB8\xCC\x86", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xD0\xB5\xCC\x80", "\xD0\xB5\xCC\x88", - NULL, "\xD0\xB3\xCC\x81", - NULL, NULL, - NULL, "\xD1\x96\xCC\x88", - NULL, NULL, - NULL, NULL, - "\xD0\xBA\xCC\x81", "\xD0\xB8\xCC\x80", - "\xD1\x83\xCC\x86", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xD1\xB4\xCC\x8F", "\xD1\xB5\xCC\x8F", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xD0\x96\xCC\x86", - "\xD0\xB6\xCC\x86", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xD0\x90\xCC\x86", "\xD0\xB0\xCC\x86", - "\xD0\x90\xCC\x88", "\xD0\xB0\xCC\x88", - NULL, NULL, - "\xD0\x95\xCC\x86", "\xD0\xB5\xCC\x86", - NULL, NULL, - "\xD3\x98\xCC\x88", "\xD3\x99\xCC\x88", - "\xD0\x96\xCC\x88", "\xD0\xB6\xCC\x88", - "\xD0\x97\xCC\x88", "\xD0\xB7\xCC\x88", - NULL, NULL, - "\xD0\x98\xCC\x84", "\xD0\xB8\xCC\x84", - "\xD0\x98\xCC\x88", "\xD0\xB8\xCC\x88", - "\xD0\x9E\xCC\x88", "\xD0\xBE\xCC\x88", - NULL, NULL, - "\xD3\xA8\xCC\x88", "\xD3\xA9\xCC\x88", - "\xD0\xAD\xCC\x88", "\xD1\x8D\xCC\x88", - "\xD0\xA3\xCC\x84", "\xD1\x83\xCC\x84", - "\xD0\xA3\xCC\x88", "\xD1\x83\xCC\x88", - "\xD0\xA3\xCC\x8B", "\xD1\x83\xCC\x8B", - "\xD0\xA7\xCC\x88", "\xD1\x87\xCC\x88", - NULL, NULL, - "\xD0\xAB\xCC\x88", "\xD1\x8B\xCC\x88", - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage6[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xD8\xA7\xD9\x93", "\xD8\xA7\xD9\x94", - "\xD9\x88\xD9\x94", "\xD8\xA7\xD9\x95", - "\xD9\x8A\xD9\x94", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xDB\x95\xD9\x94", NULL, - "\xDB\x81\xD9\x94", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xDB\x92\xD9\x94", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage9[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xA4\xA8\xE0\xA4\xBC", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xA4\xB0\xE0\xA4\xBC", - NULL, NULL, - "\xE0\xA4\xB3\xE0\xA4\xBC", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xA4\x95\xE0\xA4\xBC", "\xE0\xA4\x96\xE0\xA4\xBC", - "\xE0\xA4\x97\xE0\xA4\xBC", "\xE0\xA4\x9C\xE0\xA4\xBC", - "\xE0\xA4\xA1\xE0\xA4\xBC", "\xE0\xA4\xA2\xE0\xA4\xBC", - "\xE0\xA4\xAB\xE0\xA4\xBC", "\xE0\xA4\xAF\xE0\xA4\xBC", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xA7\x87\xE0\xA6\xBE", - "\xE0\xA7\x87\xE0\xA7\x97", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xA6\xA1\xE0\xA6\xBC", "\xE0\xA6\xA2\xE0\xA6\xBC", - NULL, "\xE0\xA6\xAF\xE0\xA6\xBC", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage10[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xA8\xB2\xE0\xA8\xBC", - NULL, NULL, - "\xE0\xA8\xB8\xE0\xA8\xBC", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xA8\x96\xE0\xA8\xBC", - "\xE0\xA8\x97\xE0\xA8\xBC", "\xE0\xA8\x9C\xE0\xA8\xBC", - NULL, NULL, - "\xE0\xA8\xAB\xE0\xA8\xBC", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage11[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xAD\x87\xE0\xAD\x96", NULL, - NULL, "\xE0\xAD\x87\xE0\xAC\xBE", - "\xE0\xAD\x87\xE0\xAD\x97", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xAC\xA1\xE0\xAC\xBC", "\xE0\xAC\xA2\xE0\xAC\xBC", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xAE\x92\xE0\xAF\x97", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xAF\x86\xE0\xAE\xBE", "\xE0\xAF\x87\xE0\xAE\xBE", - "\xE0\xAF\x86\xE0\xAF\x97", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage12[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xB1\x86\xE0\xB1\x96", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xB2\xBF\xE0\xB3\x95", NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xB3\x86\xE0\xB3\x95", - "\xE0\xB3\x86\xE0\xB3\x96", NULL, - "\xE0\xB3\x86\xE0\xB3\x82", "\xE0\xB3\x86\xE0\xB3\x82\xE0\xB3\x95", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage13[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xB5\x86\xE0\xB4\xBE", "\xE0\xB5\x87\xE0\xB4\xBE", - "\xE0\xB5\x86\xE0\xB5\x97", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xB7\x99\xE0\xB7\x8A", NULL, - "\xE0\xB7\x99\xE0\xB7\x8F", "\xE0\xB7\x99\xE0\xB7\x8F\xE0\xB7\x8A", - "\xE0\xB7\x99\xE0\xB7\x9F", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage15[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBD\x82\xE0\xBE\xB7", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBD\x8C\xE0\xBE\xB7", - NULL, NULL, - NULL, NULL, - "\xE0\xBD\x91\xE0\xBE\xB7", NULL, - NULL, NULL, - NULL, "\xE0\xBD\x96\xE0\xBE\xB7", - NULL, NULL, - NULL, NULL, - "\xE0\xBD\x9B\xE0\xBE\xB7", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBD\x80\xE0\xBE\xB5", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBD\xB1\xE0\xBD\xB2", - NULL, "\xE0\xBD\xB1\xE0\xBD\xB4", - "\xE0\xBE\xB2\xE0\xBE\x80", NULL, - "\xE0\xBE\xB3\xE0\xBE\x80", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBD\xB1\xE0\xBE\x80", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBE\x92\xE0\xBE\xB7", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBE\x9C\xE0\xBE\xB7", - NULL, NULL, - NULL, NULL, - "\xE0\xBE\xA1\xE0\xBE\xB7", NULL, - NULL, NULL, - NULL, "\xE0\xBE\xA6\xE0\xBE\xB7", - NULL, NULL, - NULL, NULL, - "\xE0\xBE\xAB\xE0\xBE\xB7", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBE\x90\xE0\xBE\xB5", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage16[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE1\x80\xA5\xE1\x80\xAE", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage27[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE1\xAC\x85\xE1\xAC\xB5", NULL, - "\xE1\xAC\x87\xE1\xAC\xB5", NULL, - "\xE1\xAC\x89\xE1\xAC\xB5", NULL, - "\xE1\xAC\x8B\xE1\xAC\xB5", NULL, - "\xE1\xAC\x8D\xE1\xAC\xB5", NULL, - NULL, NULL, - "\xE1\xAC\x91\xE1\xAC\xB5", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE1\xAC\xBA\xE1\xAC\xB5", - NULL, "\xE1\xAC\xBC\xE1\xAC\xB5", - NULL, NULL, - "\xE1\xAC\xBE\xE1\xAC\xB5", "\xE1\xAC\xBF\xE1\xAC\xB5", - NULL, "\xE1\xAD\x82\xE1\xAC\xB5", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage30[0x100] = { - "\x41\xCC\xA5", "\x61\xCC\xA5", - "\x42\xCC\x87", "\x62\xCC\x87", - "\x42\xCC\xA3", "\x62\xCC\xA3", - "\x42\xCC\xB1", "\x62\xCC\xB1", - "\x43\xCC\xA7\xCC\x81", "\x63\xCC\xA7\xCC\x81", - "\x44\xCC\x87", "\x64\xCC\x87", - "\x44\xCC\xA3", "\x64\xCC\xA3", - "\x44\xCC\xB1", "\x64\xCC\xB1", - "\x44\xCC\xA7", "\x64\xCC\xA7", - "\x44\xCC\xAD", "\x64\xCC\xAD", - "\x45\xCC\x84\xCC\x80", "\x65\xCC\x84\xCC\x80", - "\x45\xCC\x84\xCC\x81", "\x65\xCC\x84\xCC\x81", - "\x45\xCC\xAD", "\x65\xCC\xAD", - "\x45\xCC\xB0", "\x65\xCC\xB0", - "\x45\xCC\xA7\xCC\x86", "\x65\xCC\xA7\xCC\x86", - "\x46\xCC\x87", "\x66\xCC\x87", - "\x47\xCC\x84", "\x67\xCC\x84", - "\x48\xCC\x87", "\x68\xCC\x87", - "\x48\xCC\xA3", "\x68\xCC\xA3", - "\x48\xCC\x88", "\x68\xCC\x88", - "\x48\xCC\xA7", "\x68\xCC\xA7", - "\x48\xCC\xAE", "\x68\xCC\xAE", - "\x49\xCC\xB0", "\x69\xCC\xB0", - "\x49\xCC\x88\xCC\x81", "\x69\xCC\x88\xCC\x81", - "\x4B\xCC\x81", "\x6B\xCC\x81", - "\x4B\xCC\xA3", "\x6B\xCC\xA3", - "\x4B\xCC\xB1", "\x6B\xCC\xB1", - "\x4C\xCC\xA3", "\x6C\xCC\xA3", - "\x4C\xCC\xA3\xCC\x84", "\x6C\xCC\xA3\xCC\x84", - "\x4C\xCC\xB1", "\x6C\xCC\xB1", - "\x4C\xCC\xAD", "\x6C\xCC\xAD", - "\x4D\xCC\x81", "\x6D\xCC\x81", - "\x4D\xCC\x87", "\x6D\xCC\x87", - "\x4D\xCC\xA3", "\x6D\xCC\xA3", - "\x4E\xCC\x87", "\x6E\xCC\x87", - "\x4E\xCC\xA3", "\x6E\xCC\xA3", - "\x4E\xCC\xB1", "\x6E\xCC\xB1", - "\x4E\xCC\xAD", "\x6E\xCC\xAD", - "\x4F\xCC\x83\xCC\x81", "\x6F\xCC\x83\xCC\x81", - "\x4F\xCC\x83\xCC\x88", "\x6F\xCC\x83\xCC\x88", - "\x4F\xCC\x84\xCC\x80", "\x6F\xCC\x84\xCC\x80", - "\x4F\xCC\x84\xCC\x81", "\x6F\xCC\x84\xCC\x81", - "\x50\xCC\x81", "\x70\xCC\x81", - "\x50\xCC\x87", "\x70\xCC\x87", - "\x52\xCC\x87", "\x72\xCC\x87", - "\x52\xCC\xA3", "\x72\xCC\xA3", - "\x52\xCC\xA3\xCC\x84", "\x72\xCC\xA3\xCC\x84", - "\x52\xCC\xB1", "\x72\xCC\xB1", - "\x53\xCC\x87", "\x73\xCC\x87", - "\x53\xCC\xA3", "\x73\xCC\xA3", - "\x53\xCC\x81\xCC\x87", "\x73\xCC\x81\xCC\x87", - "\x53\xCC\x8C\xCC\x87", "\x73\xCC\x8C\xCC\x87", - "\x53\xCC\xA3\xCC\x87", "\x73\xCC\xA3\xCC\x87", - "\x54\xCC\x87", "\x74\xCC\x87", - "\x54\xCC\xA3", "\x74\xCC\xA3", - "\x54\xCC\xB1", "\x74\xCC\xB1", - "\x54\xCC\xAD", "\x74\xCC\xAD", - "\x55\xCC\xA4", "\x75\xCC\xA4", - "\x55\xCC\xB0", "\x75\xCC\xB0", - "\x55\xCC\xAD", "\x75\xCC\xAD", - "\x55\xCC\x83\xCC\x81", "\x75\xCC\x83\xCC\x81", - "\x55\xCC\x84\xCC\x88", "\x75\xCC\x84\xCC\x88", - "\x56\xCC\x83", "\x76\xCC\x83", - "\x56\xCC\xA3", "\x76\xCC\xA3", - "\x57\xCC\x80", "\x77\xCC\x80", - "\x57\xCC\x81", "\x77\xCC\x81", - "\x57\xCC\x88", "\x77\xCC\x88", - "\x57\xCC\x87", "\x77\xCC\x87", - "\x57\xCC\xA3", "\x77\xCC\xA3", - "\x58\xCC\x87", "\x78\xCC\x87", - "\x58\xCC\x88", "\x78\xCC\x88", - "\x59\xCC\x87", "\x79\xCC\x87", - "\x5A\xCC\x82", "\x7A\xCC\x82", - "\x5A\xCC\xA3", "\x7A\xCC\xA3", - "\x5A\xCC\xB1", "\x7A\xCC\xB1", - "\x68\xCC\xB1", "\x74\xCC\x88", - "\x77\xCC\x8A", "\x79\xCC\x8A", - NULL, "\xC5\xBF\xCC\x87", - NULL, NULL, - NULL, NULL, - "\x41\xCC\xA3", "\x61\xCC\xA3", - "\x41\xCC\x89", "\x61\xCC\x89", - "\x41\xCC\x82\xCC\x81", "\x61\xCC\x82\xCC\x81", - "\x41\xCC\x82\xCC\x80", "\x61\xCC\x82\xCC\x80", - "\x41\xCC\x82\xCC\x89", "\x61\xCC\x82\xCC\x89", - "\x41\xCC\x82\xCC\x83", "\x61\xCC\x82\xCC\x83", - "\x41\xCC\xA3\xCC\x82", "\x61\xCC\xA3\xCC\x82", - "\x41\xCC\x86\xCC\x81", "\x61\xCC\x86\xCC\x81", - "\x41\xCC\x86\xCC\x80", "\x61\xCC\x86\xCC\x80", - "\x41\xCC\x86\xCC\x89", "\x61\xCC\x86\xCC\x89", - "\x41\xCC\x86\xCC\x83", "\x61\xCC\x86\xCC\x83", - "\x41\xCC\xA3\xCC\x86", "\x61\xCC\xA3\xCC\x86", - "\x45\xCC\xA3", "\x65\xCC\xA3", - "\x45\xCC\x89", "\x65\xCC\x89", - "\x45\xCC\x83", "\x65\xCC\x83", - "\x45\xCC\x82\xCC\x81", "\x65\xCC\x82\xCC\x81", - "\x45\xCC\x82\xCC\x80", "\x65\xCC\x82\xCC\x80", - "\x45\xCC\x82\xCC\x89", "\x65\xCC\x82\xCC\x89", - "\x45\xCC\x82\xCC\x83", "\x65\xCC\x82\xCC\x83", - "\x45\xCC\xA3\xCC\x82", "\x65\xCC\xA3\xCC\x82", - "\x49\xCC\x89", "\x69\xCC\x89", - "\x49\xCC\xA3", "\x69\xCC\xA3", - "\x4F\xCC\xA3", "\x6F\xCC\xA3", - "\x4F\xCC\x89", "\x6F\xCC\x89", - "\x4F\xCC\x82\xCC\x81", "\x6F\xCC\x82\xCC\x81", - "\x4F\xCC\x82\xCC\x80", "\x6F\xCC\x82\xCC\x80", - "\x4F\xCC\x82\xCC\x89", "\x6F\xCC\x82\xCC\x89", - "\x4F\xCC\x82\xCC\x83", "\x6F\xCC\x82\xCC\x83", - "\x4F\xCC\xA3\xCC\x82", "\x6F\xCC\xA3\xCC\x82", - "\x4F\xCC\x9B\xCC\x81", "\x6F\xCC\x9B\xCC\x81", - "\x4F\xCC\x9B\xCC\x80", "\x6F\xCC\x9B\xCC\x80", - "\x4F\xCC\x9B\xCC\x89", "\x6F\xCC\x9B\xCC\x89", - "\x4F\xCC\x9B\xCC\x83", "\x6F\xCC\x9B\xCC\x83", - "\x4F\xCC\x9B\xCC\xA3", "\x6F\xCC\x9B\xCC\xA3", - "\x55\xCC\xA3", "\x75\xCC\xA3", - "\x55\xCC\x89", "\x75\xCC\x89", - "\x55\xCC\x9B\xCC\x81", "\x75\xCC\x9B\xCC\x81", - "\x55\xCC\x9B\xCC\x80", "\x75\xCC\x9B\xCC\x80", - "\x55\xCC\x9B\xCC\x89", "\x75\xCC\x9B\xCC\x89", - "\x55\xCC\x9B\xCC\x83", "\x75\xCC\x9B\xCC\x83", - "\x55\xCC\x9B\xCC\xA3", "\x75\xCC\x9B\xCC\xA3", - "\x59\xCC\x80", "\x79\xCC\x80", - "\x59\xCC\xA3", "\x79\xCC\xA3", - "\x59\xCC\x89", "\x79\xCC\x89", - "\x59\xCC\x83", "\x79\xCC\x83", - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage31[0x100] = { - "\xCE\xB1\xCC\x93", "\xCE\xB1\xCC\x94", - "\xCE\xB1\xCC\x93\xCC\x80", "\xCE\xB1\xCC\x94\xCC\x80", - "\xCE\xB1\xCC\x93\xCC\x81", "\xCE\xB1\xCC\x94\xCC\x81", - "\xCE\xB1\xCC\x93\xCD\x82", "\xCE\xB1\xCC\x94\xCD\x82", - "\xCE\x91\xCC\x93", "\xCE\x91\xCC\x94", - "\xCE\x91\xCC\x93\xCC\x80", "\xCE\x91\xCC\x94\xCC\x80", - "\xCE\x91\xCC\x93\xCC\x81", "\xCE\x91\xCC\x94\xCC\x81", - "\xCE\x91\xCC\x93\xCD\x82", "\xCE\x91\xCC\x94\xCD\x82", - "\xCE\xB5\xCC\x93", "\xCE\xB5\xCC\x94", - "\xCE\xB5\xCC\x93\xCC\x80", "\xCE\xB5\xCC\x94\xCC\x80", - "\xCE\xB5\xCC\x93\xCC\x81", "\xCE\xB5\xCC\x94\xCC\x81", - NULL, NULL, - "\xCE\x95\xCC\x93", "\xCE\x95\xCC\x94", - "\xCE\x95\xCC\x93\xCC\x80", "\xCE\x95\xCC\x94\xCC\x80", - "\xCE\x95\xCC\x93\xCC\x81", "\xCE\x95\xCC\x94\xCC\x81", - NULL, NULL, - "\xCE\xB7\xCC\x93", "\xCE\xB7\xCC\x94", - "\xCE\xB7\xCC\x93\xCC\x80", "\xCE\xB7\xCC\x94\xCC\x80", - "\xCE\xB7\xCC\x93\xCC\x81", "\xCE\xB7\xCC\x94\xCC\x81", - "\xCE\xB7\xCC\x93\xCD\x82", "\xCE\xB7\xCC\x94\xCD\x82", - "\xCE\x97\xCC\x93", "\xCE\x97\xCC\x94", - "\xCE\x97\xCC\x93\xCC\x80", "\xCE\x97\xCC\x94\xCC\x80", - "\xCE\x97\xCC\x93\xCC\x81", "\xCE\x97\xCC\x94\xCC\x81", - "\xCE\x97\xCC\x93\xCD\x82", "\xCE\x97\xCC\x94\xCD\x82", - "\xCE\xB9\xCC\x93", "\xCE\xB9\xCC\x94", - "\xCE\xB9\xCC\x93\xCC\x80", "\xCE\xB9\xCC\x94\xCC\x80", - "\xCE\xB9\xCC\x93\xCC\x81", "\xCE\xB9\xCC\x94\xCC\x81", - "\xCE\xB9\xCC\x93\xCD\x82", "\xCE\xB9\xCC\x94\xCD\x82", - "\xCE\x99\xCC\x93", "\xCE\x99\xCC\x94", - "\xCE\x99\xCC\x93\xCC\x80", "\xCE\x99\xCC\x94\xCC\x80", - "\xCE\x99\xCC\x93\xCC\x81", "\xCE\x99\xCC\x94\xCC\x81", - "\xCE\x99\xCC\x93\xCD\x82", "\xCE\x99\xCC\x94\xCD\x82", - "\xCE\xBF\xCC\x93", "\xCE\xBF\xCC\x94", - "\xCE\xBF\xCC\x93\xCC\x80", "\xCE\xBF\xCC\x94\xCC\x80", - "\xCE\xBF\xCC\x93\xCC\x81", "\xCE\xBF\xCC\x94\xCC\x81", - NULL, NULL, - "\xCE\x9F\xCC\x93", "\xCE\x9F\xCC\x94", - "\xCE\x9F\xCC\x93\xCC\x80", "\xCE\x9F\xCC\x94\xCC\x80", - "\xCE\x9F\xCC\x93\xCC\x81", "\xCE\x9F\xCC\x94\xCC\x81", - NULL, NULL, - "\xCF\x85\xCC\x93", "\xCF\x85\xCC\x94", - "\xCF\x85\xCC\x93\xCC\x80", "\xCF\x85\xCC\x94\xCC\x80", - "\xCF\x85\xCC\x93\xCC\x81", "\xCF\x85\xCC\x94\xCC\x81", - "\xCF\x85\xCC\x93\xCD\x82", "\xCF\x85\xCC\x94\xCD\x82", - NULL, "\xCE\xA5\xCC\x94", - NULL, "\xCE\xA5\xCC\x94\xCC\x80", - NULL, "\xCE\xA5\xCC\x94\xCC\x81", - NULL, "\xCE\xA5\xCC\x94\xCD\x82", - "\xCF\x89\xCC\x93", "\xCF\x89\xCC\x94", - "\xCF\x89\xCC\x93\xCC\x80", "\xCF\x89\xCC\x94\xCC\x80", - "\xCF\x89\xCC\x93\xCC\x81", "\xCF\x89\xCC\x94\xCC\x81", - "\xCF\x89\xCC\x93\xCD\x82", "\xCF\x89\xCC\x94\xCD\x82", - "\xCE\xA9\xCC\x93", "\xCE\xA9\xCC\x94", - "\xCE\xA9\xCC\x93\xCC\x80", "\xCE\xA9\xCC\x94\xCC\x80", - "\xCE\xA9\xCC\x93\xCC\x81", "\xCE\xA9\xCC\x94\xCC\x81", - "\xCE\xA9\xCC\x93\xCD\x82", "\xCE\xA9\xCC\x94\xCD\x82", - "\xCE\xB1\xCC\x80", "\xCE\xB1\xCC\x81", - "\xCE\xB5\xCC\x80", "\xCE\xB5\xCC\x81", - "\xCE\xB7\xCC\x80", "\xCE\xB7\xCC\x81", - "\xCE\xB9\xCC\x80", "\xCE\xB9\xCC\x81", - "\xCE\xBF\xCC\x80", "\xCE\xBF\xCC\x81", - "\xCF\x85\xCC\x80", "\xCF\x85\xCC\x81", - "\xCF\x89\xCC\x80", "\xCF\x89\xCC\x81", - NULL, NULL, - "\xCE\xB1\xCC\x93\xCD\x85", "\xCE\xB1\xCC\x94\xCD\x85", - "\xCE\xB1\xCC\x93\xCC\x80\xCD\x85", "\xCE\xB1\xCC\x94\xCC\x80\xCD\x85", - "\xCE\xB1\xCC\x93\xCC\x81\xCD\x85", "\xCE\xB1\xCC\x94\xCC\x81\xCD\x85", - "\xCE\xB1\xCC\x93\xCD\x82\xCD\x85", "\xCE\xB1\xCC\x94\xCD\x82\xCD\x85", - "\xCE\x91\xCC\x93\xCD\x85", "\xCE\x91\xCC\x94\xCD\x85", - "\xCE\x91\xCC\x93\xCC\x80\xCD\x85", "\xCE\x91\xCC\x94\xCC\x80\xCD\x85", - "\xCE\x91\xCC\x93\xCC\x81\xCD\x85", "\xCE\x91\xCC\x94\xCC\x81\xCD\x85", - "\xCE\x91\xCC\x93\xCD\x82\xCD\x85", "\xCE\x91\xCC\x94\xCD\x82\xCD\x85", - "\xCE\xB7\xCC\x93\xCD\x85", "\xCE\xB7\xCC\x94\xCD\x85", - "\xCE\xB7\xCC\x93\xCC\x80\xCD\x85", "\xCE\xB7\xCC\x94\xCC\x80\xCD\x85", - "\xCE\xB7\xCC\x93\xCC\x81\xCD\x85", "\xCE\xB7\xCC\x94\xCC\x81\xCD\x85", - "\xCE\xB7\xCC\x93\xCD\x82\xCD\x85", "\xCE\xB7\xCC\x94\xCD\x82\xCD\x85", - "\xCE\x97\xCC\x93\xCD\x85", "\xCE\x97\xCC\x94\xCD\x85", - "\xCE\x97\xCC\x93\xCC\x80\xCD\x85", "\xCE\x97\xCC\x94\xCC\x80\xCD\x85", - "\xCE\x97\xCC\x93\xCC\x81\xCD\x85", "\xCE\x97\xCC\x94\xCC\x81\xCD\x85", - "\xCE\x97\xCC\x93\xCD\x82\xCD\x85", "\xCE\x97\xCC\x94\xCD\x82\xCD\x85", - "\xCF\x89\xCC\x93\xCD\x85", "\xCF\x89\xCC\x94\xCD\x85", - "\xCF\x89\xCC\x93\xCC\x80\xCD\x85", "\xCF\x89\xCC\x94\xCC\x80\xCD\x85", - "\xCF\x89\xCC\x93\xCC\x81\xCD\x85", "\xCF\x89\xCC\x94\xCC\x81\xCD\x85", - "\xCF\x89\xCC\x93\xCD\x82\xCD\x85", "\xCF\x89\xCC\x94\xCD\x82\xCD\x85", - "\xCE\xA9\xCC\x93\xCD\x85", "\xCE\xA9\xCC\x94\xCD\x85", - "\xCE\xA9\xCC\x93\xCC\x80\xCD\x85", "\xCE\xA9\xCC\x94\xCC\x80\xCD\x85", - "\xCE\xA9\xCC\x93\xCC\x81\xCD\x85", "\xCE\xA9\xCC\x94\xCC\x81\xCD\x85", - "\xCE\xA9\xCC\x93\xCD\x82\xCD\x85", "\xCE\xA9\xCC\x94\xCD\x82\xCD\x85", - "\xCE\xB1\xCC\x86", "\xCE\xB1\xCC\x84", - "\xCE\xB1\xCC\x80\xCD\x85", "\xCE\xB1\xCD\x85", - "\xCE\xB1\xCC\x81\xCD\x85", NULL, - "\xCE\xB1\xCD\x82", "\xCE\xB1\xCD\x82\xCD\x85", - "\xCE\x91\xCC\x86", "\xCE\x91\xCC\x84", - "\xCE\x91\xCC\x80", "\xCE\x91\xCC\x81", - "\xCE\x91\xCD\x85", NULL, - "\xCE\xB9", NULL, - NULL, "\xC2\xA8\xCD\x82", - "\xCE\xB7\xCC\x80\xCD\x85", "\xCE\xB7\xCD\x85", - "\xCE\xB7\xCC\x81\xCD\x85", NULL, - "\xCE\xB7\xCD\x82", "\xCE\xB7\xCD\x82\xCD\x85", - "\xCE\x95\xCC\x80", "\xCE\x95\xCC\x81", - "\xCE\x97\xCC\x80", "\xCE\x97\xCC\x81", - "\xCE\x97\xCD\x85", "\xE1\xBE\xBF\xCC\x80", - "\xE1\xBE\xBF\xCC\x81", "\xE1\xBE\xBF\xCD\x82", - "\xCE\xB9\xCC\x86", "\xCE\xB9\xCC\x84", - "\xCE\xB9\xCC\x88\xCC\x80", "\xCE\xB9\xCC\x88\xCC\x81", - NULL, NULL, - "\xCE\xB9\xCD\x82", "\xCE\xB9\xCC\x88\xCD\x82", - "\xCE\x99\xCC\x86", "\xCE\x99\xCC\x84", - "\xCE\x99\xCC\x80", "\xCE\x99\xCC\x81", - NULL, "\xE1\xBF\xBE\xCC\x80", - "\xE1\xBF\xBE\xCC\x81", "\xE1\xBF\xBE\xCD\x82", - "\xCF\x85\xCC\x86", "\xCF\x85\xCC\x84", - "\xCF\x85\xCC\x88\xCC\x80", "\xCF\x85\xCC\x88\xCC\x81", - "\xCF\x81\xCC\x93", "\xCF\x81\xCC\x94", - "\xCF\x85\xCD\x82", "\xCF\x85\xCC\x88\xCD\x82", - "\xCE\xA5\xCC\x86", "\xCE\xA5\xCC\x84", - "\xCE\xA5\xCC\x80", "\xCE\xA5\xCC\x81", - "\xCE\xA1\xCC\x94", "\xC2\xA8\xCC\x80", - "\xC2\xA8\xCC\x81", "\x60", - NULL, NULL, - "\xCF\x89\xCC\x80\xCD\x85", "\xCF\x89\xCD\x85", - "\xCF\x89\xCC\x81\xCD\x85", NULL, - "\xCF\x89\xCD\x82", "\xCF\x89\xCD\x82\xCD\x85", - "\xCE\x9F\xCC\x80", "\xCE\x9F\xCC\x81", - "\xCE\xA9\xCC\x80", "\xCE\xA9\xCC\x81", - "\xCE\xA9\xCD\x85", "\xC2\xB4", - NULL, NULL, -}; - -static const char *const decompositionPage32[0x100] = { - "\xE2\x80\x82", "\xE2\x80\x83", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage33[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xCE\xA9", NULL, - NULL, NULL, - "\x4B", "\x41\xCC\x8A", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x86\x90\xCC\xB8", "\xE2\x86\x92\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x86\x94\xCC\xB8", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE2\x87\x90\xCC\xB8", - "\xE2\x87\x94\xCC\xB8", "\xE2\x87\x92\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage34[0x100] = { - NULL, NULL, - NULL, NULL, - "\xE2\x88\x83\xCC\xB8", NULL, - NULL, NULL, - NULL, "\xE2\x88\x88\xCC\xB8", - NULL, NULL, - "\xE2\x88\x8B\xCC\xB8", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x88\xA3\xCC\xB8", NULL, - "\xE2\x88\xA5\xCC\xB8", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE2\x88\xBC\xCC\xB8", - NULL, NULL, - "\xE2\x89\x83\xCC\xB8", NULL, - NULL, "\xE2\x89\x85\xCC\xB8", - NULL, "\xE2\x89\x88\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x3D\xCC\xB8", NULL, - "\xE2\x89\xA1\xCC\xB8", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE2\x89\x8D\xCC\xB8", - "\x3C\xCC\xB8", "\x3E\xCC\xB8", - "\xE2\x89\xA4\xCC\xB8", "\xE2\x89\xA5\xCC\xB8", - NULL, NULL, - "\xE2\x89\xB2\xCC\xB8", "\xE2\x89\xB3\xCC\xB8", - NULL, NULL, - "\xE2\x89\xB6\xCC\xB8", "\xE2\x89\xB7\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x89\xBA\xCC\xB8", "\xE2\x89\xBB\xCC\xB8", - NULL, NULL, - "\xE2\x8A\x82\xCC\xB8", "\xE2\x8A\x83\xCC\xB8", - NULL, NULL, - "\xE2\x8A\x86\xCC\xB8", "\xE2\x8A\x87\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x8A\xA2\xCC\xB8", "\xE2\x8A\xA8\xCC\xB8", - "\xE2\x8A\xA9\xCC\xB8", "\xE2\x8A\xAB\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x89\xBC\xCC\xB8", "\xE2\x89\xBD\xCC\xB8", - "\xE2\x8A\x91\xCC\xB8", "\xE2\x8A\x92\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x8A\xB2\xCC\xB8", "\xE2\x8A\xB3\xCC\xB8", - "\xE2\x8A\xB4\xCC\xB8", "\xE2\x8A\xB5\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage35[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE3\x80\x88", - "\xE3\x80\x89", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage42[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\xAB\x9D\xCC\xB8", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage48[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE3\x81\x8B\xE3\x82\x99", NULL, - "\xE3\x81\x8D\xE3\x82\x99", NULL, - "\xE3\x81\x8F\xE3\x82\x99", NULL, - "\xE3\x81\x91\xE3\x82\x99", NULL, - "\xE3\x81\x93\xE3\x82\x99", NULL, - "\xE3\x81\x95\xE3\x82\x99", NULL, - "\xE3\x81\x97\xE3\x82\x99", NULL, - "\xE3\x81\x99\xE3\x82\x99", NULL, - "\xE3\x81\x9B\xE3\x82\x99", NULL, - "\xE3\x81\x9D\xE3\x82\x99", NULL, - "\xE3\x81\x9F\xE3\x82\x99", NULL, - "\xE3\x81\xA1\xE3\x82\x99", NULL, - NULL, "\xE3\x81\xA4\xE3\x82\x99", - NULL, "\xE3\x81\xA6\xE3\x82\x99", - NULL, "\xE3\x81\xA8\xE3\x82\x99", - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE3\x81\xAF\xE3\x82\x99", "\xE3\x81\xAF\xE3\x82\x9A", - NULL, "\xE3\x81\xB2\xE3\x82\x99", - "\xE3\x81\xB2\xE3\x82\x9A", NULL, - "\xE3\x81\xB5\xE3\x82\x99", "\xE3\x81\xB5\xE3\x82\x9A", - NULL, "\xE3\x81\xB8\xE3\x82\x99", - "\xE3\x81\xB8\xE3\x82\x9A", NULL, - "\xE3\x81\xBB\xE3\x82\x99", "\xE3\x81\xBB\xE3\x82\x9A", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE3\x81\x86\xE3\x82\x99", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE3\x82\x9D\xE3\x82\x99", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE3\x82\xAB\xE3\x82\x99", NULL, - "\xE3\x82\xAD\xE3\x82\x99", NULL, - "\xE3\x82\xAF\xE3\x82\x99", NULL, - "\xE3\x82\xB1\xE3\x82\x99", NULL, - "\xE3\x82\xB3\xE3\x82\x99", NULL, - "\xE3\x82\xB5\xE3\x82\x99", NULL, - "\xE3\x82\xB7\xE3\x82\x99", NULL, - "\xE3\x82\xB9\xE3\x82\x99", NULL, - "\xE3\x82\xBB\xE3\x82\x99", NULL, - "\xE3\x82\xBD\xE3\x82\x99", NULL, - "\xE3\x82\xBF\xE3\x82\x99", NULL, - "\xE3\x83\x81\xE3\x82\x99", NULL, - NULL, "\xE3\x83\x84\xE3\x82\x99", - NULL, "\xE3\x83\x86\xE3\x82\x99", - NULL, "\xE3\x83\x88\xE3\x82\x99", - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE3\x83\x8F\xE3\x82\x99", "\xE3\x83\x8F\xE3\x82\x9A", - NULL, "\xE3\x83\x92\xE3\x82\x99", - "\xE3\x83\x92\xE3\x82\x9A", NULL, - "\xE3\x83\x95\xE3\x82\x99", "\xE3\x83\x95\xE3\x82\x9A", - NULL, "\xE3\x83\x98\xE3\x82\x99", - "\xE3\x83\x98\xE3\x82\x9A", NULL, - "\xE3\x83\x9B\xE3\x82\x99", "\xE3\x83\x9B\xE3\x82\x9A", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE3\x82\xA6\xE3\x82\x99", NULL, - NULL, "\xE3\x83\xAF\xE3\x82\x99", - "\xE3\x83\xB0\xE3\x82\x99", "\xE3\x83\xB1\xE3\x82\x99", - "\xE3\x83\xB2\xE3\x82\x99", NULL, - NULL, NULL, - "\xE3\x83\xBD\xE3\x82\x99", NULL, -}; - -static const char *const decompositionPage249[0x100] = { - "\xE8\xB1\x88", "\xE6\x9B\xB4", - "\xE8\xBB\x8A", "\xE8\xB3\x88", - "\xE6\xBB\x91", "\xE4\xB8\xB2", - "\xE5\x8F\xA5", "\xE9\xBE\x9C", - "\xE9\xBE\x9C", "\xE5\xA5\x91", - "\xE9\x87\x91", "\xE5\x96\x87", - "\xE5\xA5\x88", "\xE6\x87\xB6", - "\xE7\x99\xA9", "\xE7\xBE\x85", - "\xE8\x98\xBF", "\xE8\x9E\xBA", - "\xE8\xA3\xB8", "\xE9\x82\x8F", - "\xE6\xA8\x82", "\xE6\xB4\x9B", - "\xE7\x83\x99", "\xE7\x8F\x9E", - "\xE8\x90\xBD", "\xE9\x85\xAA", - "\xE9\xA7\xB1", "\xE4\xBA\x82", - "\xE5\x8D\xB5", "\xE6\xAC\x84", - "\xE7\x88\x9B", "\xE8\x98\xAD", - "\xE9\xB8\x9E", "\xE5\xB5\x90", - "\xE6\xBF\xAB", "\xE8\x97\x8D", - "\xE8\xA5\xA4", "\xE6\x8B\x89", - "\xE8\x87\x98", "\xE8\xA0\x9F", - "\xE5\xBB\x8A", "\xE6\x9C\x97", - "\xE6\xB5\xAA", "\xE7\x8B\xBC", - "\xE9\x83\x8E", "\xE4\xBE\x86", - "\xE5\x86\xB7", "\xE5\x8B\x9E", - "\xE6\x93\x84", "\xE6\xAB\x93", - "\xE7\x88\x90", "\xE7\x9B\xA7", - "\xE8\x80\x81", "\xE8\x98\x86", - "\xE8\x99\x9C", "\xE8\xB7\xAF", - "\xE9\x9C\xB2", "\xE9\xAD\xAF", - "\xE9\xB7\xBA", "\xE7\xA2\x8C", - "\xE7\xA5\xBF", "\xE7\xB6\xA0", - "\xE8\x8F\x89", "\xE9\x8C\x84", - "\xE9\xB9\xBF", "\xE8\xAB\x96", - "\xE5\xA3\x9F", "\xE5\xBC\x84", - "\xE7\xB1\xA0", "\xE8\x81\xBE", - "\xE7\x89\xA2", "\xE7\xA3\x8A", - "\xE8\xB3\x82", "\xE9\x9B\xB7", - "\xE5\xA3\x98", "\xE5\xB1\xA2", - "\xE6\xA8\x93", "\xE6\xB7\x9A", - "\xE6\xBC\x8F", "\xE7\xB4\xAF", - "\xE7\xB8\xB7", "\xE9\x99\x8B", - "\xE5\x8B\x92", "\xE8\x82\x8B", - "\xE5\x87\x9C", "\xE5\x87\x8C", - "\xE7\xA8\x9C", "\xE7\xB6\xBE", - "\xE8\x8F\xB1", "\xE9\x99\xB5", - "\xE8\xAE\x80", "\xE6\x8B\x8F", - "\xE6\xA8\x82", "\xE8\xAB\xBE", - "\xE4\xB8\xB9", "\xE5\xAF\xA7", - "\xE6\x80\x92", "\xE7\x8E\x87", - "\xE7\x95\xB0", "\xE5\x8C\x97", - "\xE7\xA3\xBB", "\xE4\xBE\xBF", - "\xE5\xBE\xA9", "\xE4\xB8\x8D", - "\xE6\xB3\x8C", "\xE6\x95\xB8", - "\xE7\xB4\xA2", "\xE5\x8F\x83", - "\xE5\xA1\x9E", "\xE7\x9C\x81", - "\xE8\x91\x89", "\xE8\xAA\xAA", - "\xE6\xAE\xBA", "\xE8\xBE\xB0", - "\xE6\xB2\x88", "\xE6\x8B\xBE", - "\xE8\x8B\xA5", "\xE6\x8E\xA0", - "\xE7\x95\xA5", "\xE4\xBA\xAE", - "\xE5\x85\xA9", "\xE5\x87\x89", - "\xE6\xA2\x81", "\xE7\xB3\xA7", - "\xE8\x89\xAF", "\xE8\xAB\x92", - "\xE9\x87\x8F", "\xE5\x8B\xB5", - "\xE5\x91\x82", "\xE5\xA5\xB3", - "\xE5\xBB\xAC", "\xE6\x97\x85", - "\xE6\xBF\xBE", "\xE7\xA4\xAA", - "\xE9\x96\xAD", "\xE9\xA9\xAA", - "\xE9\xBA\x97", "\xE9\xBB\x8E", - "\xE5\x8A\x9B", "\xE6\x9B\x86", - "\xE6\xAD\xB7", "\xE8\xBD\xA2", - "\xE5\xB9\xB4", "\xE6\x86\x90", - "\xE6\x88\x80", "\xE6\x92\x9A", - "\xE6\xBC\xA3", "\xE7\x85\x89", - "\xE7\x92\x89", "\xE7\xA7\x8A", - "\xE7\xB7\xB4", "\xE8\x81\xAF", - "\xE8\xBC\xA6", "\xE8\x93\xAE", - "\xE9\x80\xA3", "\xE9\x8D\x8A", - "\xE5\x88\x97", "\xE5\x8A\xA3", - "\xE5\x92\xBD", "\xE7\x83\x88", - "\xE8\xA3\x82", "\xE8\xAA\xAA", - "\xE5\xBB\x89", "\xE5\xBF\xB5", - "\xE6\x8D\xBB", "\xE6\xAE\xAE", - "\xE7\xB0\xBE", "\xE7\x8D\xB5", - "\xE4\xBB\xA4", "\xE5\x9B\xB9", - "\xE5\xAF\xA7", "\xE5\xB6\xBA", - "\xE6\x80\x9C", "\xE7\x8E\xB2", - "\xE7\x91\xA9", "\xE7\xBE\x9A", - "\xE8\x81\x86", "\xE9\x88\xB4", - "\xE9\x9B\xB6", "\xE9\x9D\x88", - "\xE9\xA0\x98", "\xE4\xBE\x8B", - "\xE7\xA6\xAE", "\xE9\x86\xB4", - "\xE9\x9A\xB8", "\xE6\x83\xA1", - "\xE4\xBA\x86", "\xE5\x83\x9A", - "\xE5\xAF\xAE", "\xE5\xB0\xBF", - "\xE6\x96\x99", "\xE6\xA8\x82", - "\xE7\x87\x8E", "\xE7\x99\x82", - "\xE8\x93\xBC", "\xE9\x81\xBC", - "\xE9\xBE\x8D", "\xE6\x9A\x88", - "\xE9\x98\xAE", "\xE5\x8A\x89", - "\xE6\x9D\xBB", "\xE6\x9F\xB3", - "\xE6\xB5\x81", "\xE6\xBA\x9C", - "\xE7\x90\x89", "\xE7\x95\x99", - "\xE7\xA1\xAB", "\xE7\xB4\x90", - "\xE9\xA1\x9E", "\xE5\x85\xAD", - "\xE6\x88\xAE", "\xE9\x99\xB8", - "\xE5\x80\xAB", "\xE5\xB4\x99", - "\xE6\xB7\xAA", "\xE8\xBC\xAA", - "\xE5\xBE\x8B", "\xE6\x85\x84", - "\xE6\xA0\x97", "\xE7\x8E\x87", - "\xE9\x9A\x86", "\xE5\x88\xA9", - "\xE5\x90\x8F", "\xE5\xB1\xA5", - "\xE6\x98\x93", "\xE6\x9D\x8E", - "\xE6\xA2\xA8", "\xE6\xB3\xA5", - "\xE7\x90\x86", "\xE7\x97\xA2", - "\xE7\xBD\xB9", "\xE8\xA3\x8F", - "\xE8\xA3\xA1", "\xE9\x87\x8C", - "\xE9\x9B\xA2", "\xE5\x8C\xBF", - "\xE6\xBA\xBA", "\xE5\x90\x9D", - "\xE7\x87\x90", "\xE7\x92\x98", - "\xE8\x97\xBA", "\xE9\x9A\xA3", - "\xE9\xB1\x97", "\xE9\xBA\x9F", - "\xE6\x9E\x97", "\xE6\xB7\x8B", - "\xE8\x87\xA8", "\xE7\xAB\x8B", - "\xE7\xAC\xA0", "\xE7\xB2\x92", - "\xE7\x8B\x80", "\xE7\x82\x99", - "\xE8\xAD\x98", "\xE4\xBB\x80", - "\xE8\x8C\xB6", "\xE5\x88\xBA", -}; - -static const char *const decompositionPage250[0x100] = { - "\xE5\x88\x87", "\xE5\xBA\xA6", - "\xE6\x8B\x93", "\xE7\xB3\x96", - "\xE5\xAE\x85", "\xE6\xB4\x9E", - "\xE6\x9A\xB4", "\xE8\xBC\xBB", - "\xE8\xA1\x8C", "\xE9\x99\x8D", - "\xE8\xA6\x8B", "\xE5\xBB\x93", - "\xE5\x85\x80", "\xE5\x97\x80", - NULL, NULL, - "\xE5\xA1\x9A", NULL, - "\xE6\x99\xB4", NULL, - NULL, "\xE5\x87\x9E", - "\xE7\x8C\xAA", "\xE7\x9B\x8A", - "\xE7\xA4\xBC", "\xE7\xA5\x9E", - "\xE7\xA5\xA5", "\xE7\xA6\x8F", - "\xE9\x9D\x96", "\xE7\xB2\xBE", - "\xE7\xBE\xBD", NULL, - "\xE8\x98\x92", NULL, - "\xE8\xAB\xB8", NULL, - NULL, "\xE9\x80\xB8", - "\xE9\x83\xBD", NULL, - NULL, NULL, - "\xE9\xA3\xAF", "\xE9\xA3\xBC", - "\xE9\xA4\xA8", "\xE9\xB6\xB4", - "\xE9\x83\x9E", "\xE9\x9A\xB7", - "\xE4\xBE\xAE", "\xE5\x83\xA7", - "\xE5\x85\x8D", "\xE5\x8B\x89", - "\xE5\x8B\xA4", "\xE5\x8D\x91", - "\xE5\x96\x9D", "\xE5\x98\x86", - "\xE5\x99\xA8", "\xE5\xA1\x80", - "\xE5\xA2\xA8", "\xE5\xB1\xA4", - "\xE5\xB1\xAE", "\xE6\x82\x94", - "\xE6\x85\xA8", "\xE6\x86\x8E", - "\xE6\x87\xB2", "\xE6\x95\x8F", - "\xE6\x97\xA2", "\xE6\x9A\x91", - "\xE6\xA2\x85", "\xE6\xB5\xB7", - "\xE6\xB8\x9A", "\xE6\xBC\xA2", - "\xE7\x85\xAE", "\xE7\x88\xAB", - "\xE7\x90\xA2", "\xE7\xA2\x91", - "\xE7\xA4\xBE", "\xE7\xA5\x89", - "\xE7\xA5\x88", "\xE7\xA5\x90", - "\xE7\xA5\x96", "\xE7\xA5\x9D", - "\xE7\xA6\x8D", "\xE7\xA6\x8E", - "\xE7\xA9\x80", "\xE7\xAA\x81", - "\xE7\xAF\x80", "\xE7\xB7\xB4", - "\xE7\xB8\x89", "\xE7\xB9\x81", - "\xE7\xBD\xB2", "\xE8\x80\x85", - "\xE8\x87\xAD", "\xE8\x89\xB9", - "\xE8\x89\xB9", "\xE8\x91\x97", - "\xE8\xA4\x90", "\xE8\xA6\x96", - "\xE8\xAC\x81", "\xE8\xAC\xB9", - "\xE8\xB3\x93", "\xE8\xB4\x88", - "\xE8\xBE\xB6", "\xE9\x80\xB8", - "\xE9\x9B\xA3", "\xE9\x9F\xBF", - "\xE9\xA0\xBB", "\xE6\x81\xB5", - "\xF0\xA4\x8B\xAE", "\xE8\x88\x98", - NULL, NULL, - "\xE4\xB8\xA6", "\xE5\x86\xB5", - "\xE5\x85\xA8", "\xE4\xBE\x80", - "\xE5\x85\x85", "\xE5\x86\x80", - "\xE5\x8B\x87", "\xE5\x8B\xBA", - "\xE5\x96\x9D", "\xE5\x95\x95", - "\xE5\x96\x99", "\xE5\x97\xA2", - "\xE5\xA1\x9A", "\xE5\xA2\xB3", - "\xE5\xA5\x84", "\xE5\xA5\x94", - "\xE5\xA9\xA2", "\xE5\xAC\xA8", - "\xE5\xBB\x92", "\xE5\xBB\x99", - "\xE5\xBD\xA9", "\xE5\xBE\xAD", - "\xE6\x83\x98", "\xE6\x85\x8E", - "\xE6\x84\x88", "\xE6\x86\x8E", - "\xE6\x85\xA0", "\xE6\x87\xB2", - "\xE6\x88\xB4", "\xE6\x8F\x84", - "\xE6\x90\x9C", "\xE6\x91\x92", - "\xE6\x95\x96", "\xE6\x99\xB4", - "\xE6\x9C\x97", "\xE6\x9C\x9B", - "\xE6\x9D\x96", "\xE6\xAD\xB9", - "\xE6\xAE\xBA", "\xE6\xB5\x81", - "\xE6\xBB\x9B", "\xE6\xBB\x8B", - "\xE6\xBC\xA2", "\xE7\x80\x9E", - "\xE7\x85\xAE", "\xE7\x9E\xA7", - "\xE7\x88\xB5", "\xE7\x8A\xAF", - "\xE7\x8C\xAA", "\xE7\x91\xB1", - "\xE7\x94\x86", "\xE7\x94\xBB", - "\xE7\x98\x9D", "\xE7\x98\x9F", - "\xE7\x9B\x8A", "\xE7\x9B\x9B", - "\xE7\x9B\xB4", "\xE7\x9D\x8A", - "\xE7\x9D\x80", "\xE7\xA3\x8C", - "\xE7\xAA\xB1", "\xE7\xAF\x80", - "\xE7\xB1\xBB", "\xE7\xB5\x9B", - "\xE7\xB7\xB4", "\xE7\xBC\xBE", - "\xE8\x80\x85", "\xE8\x8D\x92", - "\xE8\x8F\xAF", "\xE8\x9D\xB9", - "\xE8\xA5\x81", "\xE8\xA6\x86", - "\xE8\xA6\x96", "\xE8\xAA\xBF", - "\xE8\xAB\xB8", "\xE8\xAB\x8B", - "\xE8\xAC\x81", "\xE8\xAB\xBE", - "\xE8\xAB\xAD", "\xE8\xAC\xB9", - "\xE8\xAE\x8A", "\xE8\xB4\x88", - "\xE8\xBC\xB8", "\xE9\x81\xB2", - "\xE9\x86\x99", "\xE9\x89\xB6", - "\xE9\x99\xBC", "\xE9\x9B\xA3", - "\xE9\x9D\x96", "\xE9\x9F\x9B", - "\xE9\x9F\xBF", "\xE9\xA0\x8B", - "\xE9\xA0\xBB", "\xE9\xAC\x92", - "\xE9\xBE\x9C", "\xF0\xA2\xA1\x8A", - "\xF0\xA2\xA1\x84", "\xF0\xA3\x8F\x95", - "\xE3\xAE\x9D", "\xE4\x80\x98", - "\xE4\x80\xB9", "\xF0\xA5\x89\x89", - "\xF0\xA5\xB3\x90", "\xF0\xA7\xBB\x93", - "\xE9\xBD\x83", "\xE9\xBE\x8E", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage251[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xD7\x99\xD6\xB4", - NULL, "\xD7\xB2\xD6\xB7", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xD7\xA9\xD7\x81", "\xD7\xA9\xD7\x82", - "\xD7\xA9\xD6\xBC\xD7\x81", "\xD7\xA9\xD6\xBC\xD7\x82", - "\xD7\x90\xD6\xB7", "\xD7\x90\xD6\xB8", - "\xD7\x90\xD6\xBC", "\xD7\x91\xD6\xBC", - "\xD7\x92\xD6\xBC", "\xD7\x93\xD6\xBC", - "\xD7\x94\xD6\xBC", "\xD7\x95\xD6\xBC", - "\xD7\x96\xD6\xBC", NULL, - "\xD7\x98\xD6\xBC", "\xD7\x99\xD6\xBC", - "\xD7\x9A\xD6\xBC", "\xD7\x9B\xD6\xBC", - "\xD7\x9C\xD6\xBC", NULL, - "\xD7\x9E\xD6\xBC", NULL, - "\xD7\xA0\xD6\xBC", "\xD7\xA1\xD6\xBC", - NULL, "\xD7\xA3\xD6\xBC", - "\xD7\xA4\xD6\xBC", NULL, - "\xD7\xA6\xD6\xBC", "\xD7\xA7\xD6\xBC", - "\xD7\xA8\xD6\xBC", "\xD7\xA9\xD6\xBC", - "\xD7\xAA\xD6\xBC", "\xD7\x95\xD6\xB9", - "\xD7\x91\xD6\xBF", "\xD7\x9B\xD6\xBF", - "\xD7\xA4\xD6\xBF", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage272[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xF0\x91\x82\x99\xF0\x91\x82\xBA", NULL, - "\xF0\x91\x82\x9B\xF0\x91\x82\xBA", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xF0\x91\x82\xA5\xF0\x91\x82\xBA", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage273[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xF0\x91\x84\xB1\xF0\x91\x84\xA7", "\xF0\x91\x84\xB2\xF0\x91\x84\xA7", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage275[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xF0\x91\x8D\x87\xF0\x91\x8C\xBE", - "\xF0\x91\x8D\x87\xF0\x91\x8D\x97", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage276[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xF0\x91\x92\xB9\xF0\x91\x92\xBA", - "\xF0\x91\x92\xB9\xF0\x91\x92\xB0", NULL, - "\xF0\x91\x92\xB9\xF0\x91\x92\xBD", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage277[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xF0\x91\x96\xB8\xF0\x91\x96\xAF", "\xF0\x91\x96\xB9\xF0\x91\x96\xAF", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage281[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xF0\x91\xA4\xB5\xF0\x91\xA4\xB0", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage465[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xF0\x9D\x85\x97\xF0\x9D\x85\xA5", "\xF0\x9D\x85\x98\xF0\x9D\x85\xA5", - "\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\xF0\x9D\x85\xAE", "\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\xF0\x9D\x85\xAF", - "\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\xF0\x9D\x85\xB0", "\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\xF0\x9D\x85\xB1", - "\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\xF0\x9D\x85\xB2", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xF0\x9D\x86\xB9\xF0\x9D\x85\xA5", - "\xF0\x9D\x86\xBA\xF0\x9D\x85\xA5", "\xF0\x9D\x86\xB9\xF0\x9D\x85\xA5\xF0\x9D\x85\xAE", - "\xF0\x9D\x86\xBA\xF0\x9D\x85\xA5\xF0\x9D\x85\xAE", "\xF0\x9D\x86\xB9\xF0\x9D\x85\xA5\xF0\x9D\x85\xAF", - "\xF0\x9D\x86\xBA\xF0\x9D\x85\xA5\xF0\x9D\x85\xAF", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompositionPage760[0x100] = { - "\xE4\xB8\xBD", "\xE4\xB8\xB8", - "\xE4\xB9\x81", "\xF0\xA0\x84\xA2", - "\xE4\xBD\xA0", "\xE4\xBE\xAE", - "\xE4\xBE\xBB", "\xE5\x80\x82", - "\xE5\x81\xBA", "\xE5\x82\x99", - "\xE5\x83\xA7", "\xE5\x83\x8F", - "\xE3\x92\x9E", "\xF0\xA0\x98\xBA", - "\xE5\x85\x8D", "\xE5\x85\x94", - "\xE5\x85\xA4", "\xE5\x85\xB7", - "\xF0\xA0\x94\x9C", "\xE3\x92\xB9", - "\xE5\x85\xA7", "\xE5\x86\x8D", - "\xF0\xA0\x95\x8B", "\xE5\x86\x97", - "\xE5\x86\xA4", "\xE4\xBB\x8C", - "\xE5\x86\xAC", "\xE5\x86\xB5", - "\xF0\xA9\x87\x9F", "\xE5\x87\xB5", - "\xE5\x88\x83", "\xE3\x93\x9F", - "\xE5\x88\xBB", "\xE5\x89\x86", - "\xE5\x89\xB2", "\xE5\x89\xB7", - "\xE3\x94\x95", "\xE5\x8B\x87", - "\xE5\x8B\x89", "\xE5\x8B\xA4", - "\xE5\x8B\xBA", "\xE5\x8C\x85", - "\xE5\x8C\x86", "\xE5\x8C\x97", - "\xE5\x8D\x89", "\xE5\x8D\x91", - "\xE5\x8D\x9A", "\xE5\x8D\xB3", - "\xE5\x8D\xBD", "\xE5\x8D\xBF", - "\xE5\x8D\xBF", "\xE5\x8D\xBF", - "\xF0\xA0\xA8\xAC", "\xE7\x81\xB0", - "\xE5\x8F\x8A", "\xE5\x8F\x9F", - "\xF0\xA0\xAD\xA3", "\xE5\x8F\xAB", - "\xE5\x8F\xB1", "\xE5\x90\x86", - "\xE5\x92\x9E", "\xE5\x90\xB8", - "\xE5\x91\x88", "\xE5\x91\xA8", - "\xE5\x92\xA2", "\xE5\x93\xB6", - "\xE5\x94\x90", "\xE5\x95\x93", - "\xE5\x95\xA3", "\xE5\x96\x84", - "\xE5\x96\x84", "\xE5\x96\x99", - "\xE5\x96\xAB", "\xE5\x96\xB3", - "\xE5\x97\x82", "\xE5\x9C\x96", - "\xE5\x98\x86", "\xE5\x9C\x97", - "\xE5\x99\x91", "\xE5\x99\xB4", - "\xE5\x88\x87", "\xE5\xA3\xAE", - "\xE5\x9F\x8E", "\xE5\x9F\xB4", - "\xE5\xA0\x8D", "\xE5\x9E\x8B", - "\xE5\xA0\xB2", "\xE5\xA0\xB1", - "\xE5\xA2\xAC", "\xF0\xA1\x93\xA4", - "\xE5\xA3\xB2", "\xE5\xA3\xB7", - "\xE5\xA4\x86", "\xE5\xA4\x9A", - "\xE5\xA4\xA2", "\xE5\xA5\xA2", - "\xF0\xA1\x9A\xA8", "\xF0\xA1\x9B\xAA", - "\xE5\xA7\xAC", "\xE5\xA8\x9B", - "\xE5\xA8\xA7", "\xE5\xA7\x98", - "\xE5\xA9\xA6", "\xE3\x9B\xAE", - "\xE3\x9B\xBC", "\xE5\xAC\x88", - "\xE5\xAC\xBE", "\xE5\xAC\xBE", - "\xF0\xA1\xA7\x88", "\xE5\xAF\x83", - "\xE5\xAF\x98", "\xE5\xAF\xA7", - "\xE5\xAF\xB3", "\xF0\xA1\xAC\x98", - "\xE5\xAF\xBF", "\xE5\xB0\x86", - "\xE5\xBD\x93", "\xE5\xB0\xA2", - "\xE3\x9E\x81", "\xE5\xB1\xA0", - "\xE5\xB1\xAE", "\xE5\xB3\x80", - "\xE5\xB2\x8D", "\xF0\xA1\xB7\xA4", - "\xE5\xB5\x83", "\xF0\xA1\xB7\xA6", - "\xE5\xB5\xAE", "\xE5\xB5\xAB", - "\xE5\xB5\xBC", "\xE5\xB7\xA1", - "\xE5\xB7\xA2", "\xE3\xA0\xAF", - "\xE5\xB7\xBD", "\xE5\xB8\xA8", - "\xE5\xB8\xBD", "\xE5\xB9\xA9", - "\xE3\xA1\xA2", "\xF0\xA2\x86\x83", - "\xE3\xA1\xBC", "\xE5\xBA\xB0", - "\xE5\xBA\xB3", "\xE5\xBA\xB6", - "\xE5\xBB\x8A", "\xF0\xAA\x8E\x92", - "\xE5\xBB\xBE", "\xF0\xA2\x8C\xB1", - "\xF0\xA2\x8C\xB1", "\xE8\x88\x81", - "\xE5\xBC\xA2", "\xE5\xBC\xA2", - "\xE3\xA3\x87", "\xF0\xA3\x8A\xB8", - "\xF0\xA6\x87\x9A", "\xE5\xBD\xA2", - "\xE5\xBD\xAB", "\xE3\xA3\xA3", - "\xE5\xBE\x9A", "\xE5\xBF\x8D", - "\xE5\xBF\x97", "\xE5\xBF\xB9", - "\xE6\x82\x81", "\xE3\xA4\xBA", - "\xE3\xA4\x9C", "\xE6\x82\x94", - "\xF0\xA2\x9B\x94", "\xE6\x83\x87", - "\xE6\x85\x88", "\xE6\x85\x8C", - "\xE6\x85\x8E", "\xE6\x85\x8C", - "\xE6\x85\xBA", "\xE6\x86\x8E", - "\xE6\x86\xB2", "\xE6\x86\xA4", - "\xE6\x86\xAF", "\xE6\x87\x9E", - "\xE6\x87\xB2", "\xE6\x87\xB6", - "\xE6\x88\x90", "\xE6\x88\x9B", - "\xE6\x89\x9D", "\xE6\x8A\xB1", - "\xE6\x8B\x94", "\xE6\x8D\x90", - "\xF0\xA2\xAC\x8C", "\xE6\x8C\xBD", - "\xE6\x8B\xBC", "\xE6\x8D\xA8", - "\xE6\x8E\x83", "\xE6\x8F\xA4", - "\xF0\xA2\xAF\xB1", "\xE6\x90\xA2", - "\xE6\x8F\x85", "\xE6\x8E\xA9", - "\xE3\xA8\xAE", "\xE6\x91\xA9", - "\xE6\x91\xBE", "\xE6\x92\x9D", - "\xE6\x91\xB7", "\xE3\xA9\xAC", - "\xE6\x95\x8F", "\xE6\x95\xAC", - "\xF0\xA3\x80\x8A", "\xE6\x97\xA3", - "\xE6\x9B\xB8", "\xE6\x99\x89", - "\xE3\xAC\x99", "\xE6\x9A\x91", - "\xE3\xAC\x88", "\xE3\xAB\xA4", - "\xE5\x86\x92", "\xE5\x86\x95", - "\xE6\x9C\x80", "\xE6\x9A\x9C", - "\xE8\x82\xAD", "\xE4\x8F\x99", - "\xE6\x9C\x97", "\xE6\x9C\x9B", - "\xE6\x9C\xA1", "\xE6\x9D\x9E", - "\xE6\x9D\x93", "\xF0\xA3\x8F\x83", - "\xE3\xAD\x89", "\xE6\x9F\xBA", - "\xE6\x9E\x85", "\xE6\xA1\x92", - "\xE6\xA2\x85", "\xF0\xA3\x91\xAD", - "\xE6\xA2\x8E", "\xE6\xA0\x9F", - "\xE6\xA4\x94", "\xE3\xAE\x9D", - "\xE6\xA5\x82", "\xE6\xA6\xA3", - "\xE6\xA7\xAA", "\xE6\xAA\xA8", - "\xF0\xA3\x9A\xA3", "\xE6\xAB\x9B", - "\xE3\xB0\x98", "\xE6\xAC\xA1", - "\xF0\xA3\xA2\xA7", "\xE6\xAD\x94", - "\xE3\xB1\x8E", "\xE6\xAD\xB2", - "\xE6\xAE\x9F", "\xE6\xAE\xBA", - "\xE6\xAE\xBB", "\xF0\xA3\xAA\x8D", - "\xF0\xA1\xB4\x8B", "\xF0\xA3\xAB\xBA", - "\xE6\xB1\x8E", "\xF0\xA3\xB2\xBC", - "\xE6\xB2\xBF", "\xE6\xB3\x8D", - "\xE6\xB1\xA7", "\xE6\xB4\x96", -}; - -static const char *const decompositionPage761[0x100] = { - "\xE6\xB4\xBE", "\xE6\xB5\xB7", - "\xE6\xB5\x81", "\xE6\xB5\xA9", - "\xE6\xB5\xB8", "\xE6\xB6\x85", - "\xF0\xA3\xB4\x9E", "\xE6\xB4\xB4", - "\xE6\xB8\xAF", "\xE6\xB9\xAE", - "\xE3\xB4\xB3", "\xE6\xBB\x8B", - "\xE6\xBB\x87", "\xF0\xA3\xBB\x91", - "\xE6\xB7\xB9", "\xE6\xBD\xAE", - "\xF0\xA3\xBD\x9E", "\xF0\xA3\xBE\x8E", - "\xE6\xBF\x86", "\xE7\x80\xB9", - "\xE7\x80\x9E", "\xE7\x80\x9B", - "\xE3\xB6\x96", "\xE7\x81\x8A", - "\xE7\x81\xBD", "\xE7\x81\xB7", - "\xE7\x82\xAD", "\xF0\xA0\x94\xA5", - "\xE7\x85\x85", "\xF0\xA4\x89\xA3", - "\xE7\x86\x9C", "\xF0\xA4\x8E\xAB", - "\xE7\x88\xA8", "\xE7\x88\xB5", - "\xE7\x89\x90", "\xF0\xA4\x98\x88", - "\xE7\x8A\x80", "\xE7\x8A\x95", - "\xF0\xA4\x9C\xB5", "\xF0\xA4\xA0\x94", - "\xE7\x8D\xBA", "\xE7\x8E\x8B", - "\xE3\xBA\xAC", "\xE7\x8E\xA5", - "\xE3\xBA\xB8", "\xE3\xBA\xB8", - "\xE7\x91\x87", "\xE7\x91\x9C", - "\xE7\x91\xB1", "\xE7\x92\x85", - "\xE7\x93\x8A", "\xE3\xBC\x9B", - "\xE7\x94\xA4", "\xF0\xA4\xB0\xB6", - "\xE7\x94\xBE", "\xF0\xA4\xB2\x92", - "\xE7\x95\xB0", "\xF0\xA2\x86\x9F", - "\xE7\x98\x90", "\xF0\xA4\xBE\xA1", - "\xF0\xA4\xBE\xB8", "\xF0\xA5\x81\x84", - "\xE3\xBF\xBC", "\xE4\x80\x88", - "\xE7\x9B\xB4", "\xF0\xA5\x83\xB3", - "\xF0\xA5\x83\xB2", "\xF0\xA5\x84\x99", - "\xF0\xA5\x84\xB3", "\xE7\x9C\x9E", - "\xE7\x9C\x9F", "\xE7\x9C\x9F", - "\xE7\x9D\x8A", "\xE4\x80\xB9", - "\xE7\x9E\x8B", "\xE4\x81\x86", - "\xE4\x82\x96", "\xF0\xA5\x90\x9D", - "\xE7\xA1\x8E", "\xE7\xA2\x8C", - "\xE7\xA3\x8C", "\xE4\x83\xA3", - "\xF0\xA5\x98\xA6", "\xE7\xA5\x96", - "\xF0\xA5\x9A\x9A", "\xF0\xA5\x9B\x85", - "\xE7\xA6\x8F", "\xE7\xA7\xAB", - "\xE4\x84\xAF", "\xE7\xA9\x80", - "\xE7\xA9\x8A", "\xE7\xA9\x8F", - "\xF0\xA5\xA5\xBC", "\xF0\xA5\xAA\xA7", - "\xF0\xA5\xAA\xA7", "\xE7\xAB\xAE", - "\xE4\x88\x82", "\xF0\xA5\xAE\xAB", - "\xE7\xAF\x86", "\xE7\xAF\x89", - "\xE4\x88\xA7", "\xF0\xA5\xB2\x80", - "\xE7\xB3\x92", "\xE4\x8A\xA0", - "\xE7\xB3\xA8", "\xE7\xB3\xA3", - "\xE7\xB4\x80", "\xF0\xA5\xBE\x86", - "\xE7\xB5\xA3", "\xE4\x8C\x81", - "\xE7\xB7\x87", "\xE7\xB8\x82", - "\xE7\xB9\x85", "\xE4\x8C\xB4", - "\xF0\xA6\x88\xA8", "\xF0\xA6\x89\x87", - "\xE4\x8D\x99", "\xF0\xA6\x8B\x99", - "\xE7\xBD\xBA", "\xF0\xA6\x8C\xBE", - "\xE7\xBE\x95", "\xE7\xBF\xBA", - "\xE8\x80\x85", "\xF0\xA6\x93\x9A", - "\xF0\xA6\x94\xA3", "\xE8\x81\xA0", - "\xF0\xA6\x96\xA8", "\xE8\x81\xB0", - "\xF0\xA3\x8D\x9F", "\xE4\x8F\x95", - "\xE8\x82\xB2", "\xE8\x84\x83", - "\xE4\x90\x8B", "\xE8\x84\xBE", - "\xE5\xAA\xB5", "\xF0\xA6\x9E\xA7", - "\xF0\xA6\x9E\xB5", "\xF0\xA3\x8E\x93", - "\xF0\xA3\x8E\x9C", "\xE8\x88\x81", - "\xE8\x88\x84", "\xE8\xBE\x9E", - "\xE4\x91\xAB", "\xE8\x8A\x91", - "\xE8\x8A\x8B", "\xE8\x8A\x9D", - "\xE5\x8A\xB3", "\xE8\x8A\xB1", - "\xE8\x8A\xB3", "\xE8\x8A\xBD", - "\xE8\x8B\xA6", "\xF0\xA6\xAC\xBC", - "\xE8\x8B\xA5", "\xE8\x8C\x9D", - "\xE8\x8D\xA3", "\xE8\x8E\xAD", - "\xE8\x8C\xA3", "\xE8\x8E\xBD", - "\xE8\x8F\xA7", "\xE8\x91\x97", - "\xE8\x8D\x93", "\xE8\x8F\x8A", - "\xE8\x8F\x8C", "\xE8\x8F\x9C", - "\xF0\xA6\xB0\xB6", "\xF0\xA6\xB5\xAB", - "\xF0\xA6\xB3\x95", "\xE4\x94\xAB", - "\xE8\x93\xB1", "\xE8\x93\xB3", - "\xE8\x94\x96", "\xF0\xA7\x8F\x8A", - "\xE8\x95\xA4", "\xF0\xA6\xBC\xAC", - "\xE4\x95\x9D", "\xE4\x95\xA1", - "\xF0\xA6\xBE\xB1", "\xF0\xA7\x83\x92", - "\xE4\x95\xAB", "\xE8\x99\x90", - "\xE8\x99\x9C", "\xE8\x99\xA7", - "\xE8\x99\xA9", "\xE8\x9A\xA9", - "\xE8\x9A\x88", "\xE8\x9C\x8E", - "\xE8\x9B\xA2", "\xE8\x9D\xB9", - "\xE8\x9C\xA8", "\xE8\x9D\xAB", - "\xE8\x9E\x86", "\xE4\x97\x97", - "\xE8\x9F\xA1", "\xE8\xA0\x81", - "\xE4\x97\xB9", "\xE8\xA1\xA0", - "\xE8\xA1\xA3", "\xF0\xA7\x99\xA7", - "\xE8\xA3\x97", "\xE8\xA3\x9E", - "\xE4\x98\xB5", "\xE8\xA3\xBA", - "\xE3\x92\xBB", "\xF0\xA7\xA2\xAE", - "\xF0\xA7\xA5\xA6", "\xE4\x9A\xBE", - "\xE4\x9B\x87", "\xE8\xAA\xA0", - "\xE8\xAB\xAD", "\xE8\xAE\x8A", - "\xE8\xB1\x95", "\xF0\xA7\xB2\xA8", - "\xE8\xB2\xAB", "\xE8\xB3\x81", - "\xE8\xB4\x9B", "\xE8\xB5\xB7", - "\xF0\xA7\xBC\xAF", "\xF0\xA0\xA0\x84", - "\xE8\xB7\x8B", "\xE8\xB6\xBC", - "\xE8\xB7\xB0", "\xF0\xA0\xA3\x9E", - "\xE8\xBB\x94", "\xE8\xBC\xB8", - "\xF0\xA8\x97\x92", "\xF0\xA8\x97\xAD", - "\xE9\x82\x94", "\xE9\x83\xB1", - "\xE9\x84\x91", "\xF0\xA8\x9C\xAE", - "\xE9\x84\x9B", "\xE9\x88\xB8", - "\xE9\x8B\x97", "\xE9\x8B\x98", - "\xE9\x89\xBC", "\xE9\x8F\xB9", - "\xE9\x90\x95", "\xF0\xA8\xAF\xBA", - "\xE9\x96\x8B", "\xE4\xA6\x95", - "\xE9\x96\xB7", "\xF0\xA8\xB5\xB7", - "\xE4\xA7\xA6", "\xE9\x9B\x83", - "\xE5\xB6\xB2", "\xE9\x9C\xA3", - "\xF0\xA9\x85\x85", "\xF0\xA9\x88\x9A", - "\xE4\xA9\xAE", "\xE4\xA9\xB6", - "\xE9\x9F\xA0", "\xF0\xA9\x90\x8A", - "\xE4\xAA\xB2", "\xF0\xA9\x92\x96", - "\xE9\xA0\x8B", "\xE9\xA0\x8B", -}; - -static const char *const decompositionPage762[0x100] = { - "\xE9\xA0\xA9", "\xF0\xA9\x96\xB6", - "\xE9\xA3\xA2", "\xE4\xAC\xB3", - "\xE9\xA4\xA9", "\xE9\xA6\xA7", - "\xE9\xA7\x82", "\xE9\xA7\xBE", - "\xE4\xAF\x8E", "\xF0\xA9\xAC\xB0", - "\xE9\xAC\x92", "\xE9\xB1\x80", - "\xE9\xB3\xBD", "\xE4\xB3\x8E", - "\xE4\xB3\xAD", "\xE9\xB5\xA7", - "\xF0\xAA\x83\x8E", "\xE4\xB3\xB8", - "\xF0\xAA\x84\x85", "\xF0\xAA\x88\x8E", - "\xF0\xAA\x8A\x91", "\xE9\xBA\xBB", - "\xE4\xB5\x96", "\xE9\xBB\xB9", - "\xE9\xBB\xBE", "\xE9\xBC\x85", - "\xE9\xBC\x8F", "\xE9\xBC\x96", - "\xE9\xBC\xBB", "\xF0\xAA\x98\x80", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage0[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x20", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x20\xCC\x88", NULL, - "\x61", NULL, - NULL, NULL, - NULL, "\x20\xCC\x84", - NULL, NULL, - "\x32", "\x33", - "\x20\xCC\x81", "\xCE\xBC", - NULL, NULL, - "\x20\xCC\xA7", "\x31", - "\x6F", NULL, - "\x31\xE2\x81\x84\x34", "\x31\xE2\x81\x84\x32", - "\x33\xE2\x81\x84\x34", NULL, - "\x41\xCC\x80", "\x41\xCC\x81", - "\x41\xCC\x82", "\x41\xCC\x83", - "\x41\xCC\x88", "\x41\xCC\x8A", - NULL, "\x43\xCC\xA7", - "\x45\xCC\x80", "\x45\xCC\x81", - "\x45\xCC\x82", "\x45\xCC\x88", - "\x49\xCC\x80", "\x49\xCC\x81", - "\x49\xCC\x82", "\x49\xCC\x88", - NULL, "\x4E\xCC\x83", - "\x4F\xCC\x80", "\x4F\xCC\x81", - "\x4F\xCC\x82", "\x4F\xCC\x83", - "\x4F\xCC\x88", NULL, - NULL, "\x55\xCC\x80", - "\x55\xCC\x81", "\x55\xCC\x82", - "\x55\xCC\x88", "\x59\xCC\x81", - NULL, NULL, - "\x61\xCC\x80", "\x61\xCC\x81", - "\x61\xCC\x82", "\x61\xCC\x83", - "\x61\xCC\x88", "\x61\xCC\x8A", - NULL, "\x63\xCC\xA7", - "\x65\xCC\x80", "\x65\xCC\x81", - "\x65\xCC\x82", "\x65\xCC\x88", - "\x69\xCC\x80", "\x69\xCC\x81", - "\x69\xCC\x82", "\x69\xCC\x88", - NULL, "\x6E\xCC\x83", - "\x6F\xCC\x80", "\x6F\xCC\x81", - "\x6F\xCC\x82", "\x6F\xCC\x83", - "\x6F\xCC\x88", NULL, - NULL, "\x75\xCC\x80", - "\x75\xCC\x81", "\x75\xCC\x82", - "\x75\xCC\x88", "\x79\xCC\x81", - NULL, "\x79\xCC\x88", -}; - -static const char *const decompCompatPage1[0x100] = { - "\x41\xCC\x84", "\x61\xCC\x84", - "\x41\xCC\x86", "\x61\xCC\x86", - "\x41\xCC\xA8", "\x61\xCC\xA8", - "\x43\xCC\x81", "\x63\xCC\x81", - "\x43\xCC\x82", "\x63\xCC\x82", - "\x43\xCC\x87", "\x63\xCC\x87", - "\x43\xCC\x8C", "\x63\xCC\x8C", - "\x44\xCC\x8C", "\x64\xCC\x8C", - NULL, NULL, - "\x45\xCC\x84", "\x65\xCC\x84", - "\x45\xCC\x86", "\x65\xCC\x86", - "\x45\xCC\x87", "\x65\xCC\x87", - "\x45\xCC\xA8", "\x65\xCC\xA8", - "\x45\xCC\x8C", "\x65\xCC\x8C", - "\x47\xCC\x82", "\x67\xCC\x82", - "\x47\xCC\x86", "\x67\xCC\x86", - "\x47\xCC\x87", "\x67\xCC\x87", - "\x47\xCC\xA7", "\x67\xCC\xA7", - "\x48\xCC\x82", "\x68\xCC\x82", - NULL, NULL, - "\x49\xCC\x83", "\x69\xCC\x83", - "\x49\xCC\x84", "\x69\xCC\x84", - "\x49\xCC\x86", "\x69\xCC\x86", - "\x49\xCC\xA8", "\x69\xCC\xA8", - "\x49\xCC\x87", NULL, - "\x49\x4A", "\x69\x6A", - "\x4A\xCC\x82", "\x6A\xCC\x82", - "\x4B\xCC\xA7", "\x6B\xCC\xA7", - NULL, "\x4C\xCC\x81", - "\x6C\xCC\x81", "\x4C\xCC\xA7", - "\x6C\xCC\xA7", "\x4C\xCC\x8C", - "\x6C\xCC\x8C", "\x4C\xC2\xB7", - "\x6C\xC2\xB7", NULL, - NULL, "\x4E\xCC\x81", - "\x6E\xCC\x81", "\x4E\xCC\xA7", - "\x6E\xCC\xA7", "\x4E\xCC\x8C", - "\x6E\xCC\x8C", "\xCA\xBC\x6E", - NULL, NULL, - "\x4F\xCC\x84", "\x6F\xCC\x84", - "\x4F\xCC\x86", "\x6F\xCC\x86", - "\x4F\xCC\x8B", "\x6F\xCC\x8B", - NULL, NULL, - "\x52\xCC\x81", "\x72\xCC\x81", - "\x52\xCC\xA7", "\x72\xCC\xA7", - "\x52\xCC\x8C", "\x72\xCC\x8C", - "\x53\xCC\x81", "\x73\xCC\x81", - "\x53\xCC\x82", "\x73\xCC\x82", - "\x53\xCC\xA7", "\x73\xCC\xA7", - "\x53\xCC\x8C", "\x73\xCC\x8C", - "\x54\xCC\xA7", "\x74\xCC\xA7", - "\x54\xCC\x8C", "\x74\xCC\x8C", - NULL, NULL, - "\x55\xCC\x83", "\x75\xCC\x83", - "\x55\xCC\x84", "\x75\xCC\x84", - "\x55\xCC\x86", "\x75\xCC\x86", - "\x55\xCC\x8A", "\x75\xCC\x8A", - "\x55\xCC\x8B", "\x75\xCC\x8B", - "\x55\xCC\xA8", "\x75\xCC\xA8", - "\x57\xCC\x82", "\x77\xCC\x82", - "\x59\xCC\x82", "\x79\xCC\x82", - "\x59\xCC\x88", "\x5A\xCC\x81", - "\x7A\xCC\x81", "\x5A\xCC\x87", - "\x7A\xCC\x87", "\x5A\xCC\x8C", - "\x7A\xCC\x8C", "\x73", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x4F\xCC\x9B", "\x6F\xCC\x9B", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\x55\xCC\x9B", - "\x75\xCC\x9B", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x44\x5A\xCC\x8C", "\x44\x7A\xCC\x8C", - "\x64\x7A\xCC\x8C", "\x4C\x4A", - "\x4C\x6A", "\x6C\x6A", - "\x4E\x4A", "\x4E\x6A", - "\x6E\x6A", "\x41\xCC\x8C", - "\x61\xCC\x8C", "\x49\xCC\x8C", - "\x69\xCC\x8C", "\x4F\xCC\x8C", - "\x6F\xCC\x8C", "\x55\xCC\x8C", - "\x75\xCC\x8C", "\x55\xCC\x88\xCC\x84", - "\x75\xCC\x88\xCC\x84", "\x55\xCC\x88\xCC\x81", - "\x75\xCC\x88\xCC\x81", "\x55\xCC\x88\xCC\x8C", - "\x75\xCC\x88\xCC\x8C", "\x55\xCC\x88\xCC\x80", - "\x75\xCC\x88\xCC\x80", NULL, - "\x41\xCC\x88\xCC\x84", "\x61\xCC\x88\xCC\x84", - "\x41\xCC\x87\xCC\x84", "\x61\xCC\x87\xCC\x84", - "\xC3\x86\xCC\x84", "\xC3\xA6\xCC\x84", - NULL, NULL, - "\x47\xCC\x8C", "\x67\xCC\x8C", - "\x4B\xCC\x8C", "\x6B\xCC\x8C", - "\x4F\xCC\xA8", "\x6F\xCC\xA8", - "\x4F\xCC\xA8\xCC\x84", "\x6F\xCC\xA8\xCC\x84", - "\xC6\xB7\xCC\x8C", "\xCA\x92\xCC\x8C", - "\x6A\xCC\x8C", "\x44\x5A", - "\x44\x7A", "\x64\x7A", - "\x47\xCC\x81", "\x67\xCC\x81", - NULL, NULL, - "\x4E\xCC\x80", "\x6E\xCC\x80", - "\x41\xCC\x8A\xCC\x81", "\x61\xCC\x8A\xCC\x81", - "\xC3\x86\xCC\x81", "\xC3\xA6\xCC\x81", - "\xC3\x98\xCC\x81", "\xC3\xB8\xCC\x81", -}; - -static const char *const decompCompatPage2[0x100] = { - "\x41\xCC\x8F", "\x61\xCC\x8F", - "\x41\xCC\x91", "\x61\xCC\x91", - "\x45\xCC\x8F", "\x65\xCC\x8F", - "\x45\xCC\x91", "\x65\xCC\x91", - "\x49\xCC\x8F", "\x69\xCC\x8F", - "\x49\xCC\x91", "\x69\xCC\x91", - "\x4F\xCC\x8F", "\x6F\xCC\x8F", - "\x4F\xCC\x91", "\x6F\xCC\x91", - "\x52\xCC\x8F", "\x72\xCC\x8F", - "\x52\xCC\x91", "\x72\xCC\x91", - "\x55\xCC\x8F", "\x75\xCC\x8F", - "\x55\xCC\x91", "\x75\xCC\x91", - "\x53\xCC\xA6", "\x73\xCC\xA6", - "\x54\xCC\xA6", "\x74\xCC\xA6", - NULL, NULL, - "\x48\xCC\x8C", "\x68\xCC\x8C", - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x41\xCC\x87", "\x61\xCC\x87", - "\x45\xCC\xA7", "\x65\xCC\xA7", - "\x4F\xCC\x88\xCC\x84", "\x6F\xCC\x88\xCC\x84", - "\x4F\xCC\x83\xCC\x84", "\x6F\xCC\x83\xCC\x84", - "\x4F\xCC\x87", "\x6F\xCC\x87", - "\x4F\xCC\x87\xCC\x84", "\x6F\xCC\x87\xCC\x84", - "\x59\xCC\x84", "\x79\xCC\x84", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x68", "\xC9\xA6", - "\x6A", "\x72", - "\xC9\xB9", "\xC9\xBB", - "\xCA\x81", "\x77", - "\x79", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x20\xCC\x86", "\x20\xCC\x87", - "\x20\xCC\x8A", "\x20\xCC\xA8", - "\x20\xCC\x83", "\x20\xCC\x8B", - NULL, NULL, - "\xC9\xA3", "\x6C", - "\x73", "\x78", - "\xCA\x95", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage3[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xCC\x80", "\xCC\x81", - NULL, "\xCC\x93", - "\xCC\x88\xCC\x81", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xCA\xB9", NULL, - NULL, NULL, - NULL, NULL, - "\x20\xCD\x85", NULL, - NULL, NULL, - "\x3B", NULL, - NULL, NULL, - NULL, NULL, - "\x20\xCC\x81", "\x20\xCC\x88\xCC\x81", - "\xCE\x91\xCC\x81", "\xC2\xB7", - "\xCE\x95\xCC\x81", "\xCE\x97\xCC\x81", - "\xCE\x99\xCC\x81", NULL, - "\xCE\x9F\xCC\x81", NULL, - "\xCE\xA5\xCC\x81", "\xCE\xA9\xCC\x81", - "\xCE\xB9\xCC\x88\xCC\x81", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xCE\x99\xCC\x88", "\xCE\xA5\xCC\x88", - "\xCE\xB1\xCC\x81", "\xCE\xB5\xCC\x81", - "\xCE\xB7\xCC\x81", "\xCE\xB9\xCC\x81", - "\xCF\x85\xCC\x88\xCC\x81", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xCE\xB9\xCC\x88", "\xCF\x85\xCC\x88", - "\xCE\xBF\xCC\x81", "\xCF\x85\xCC\x81", - "\xCF\x89\xCC\x81", NULL, - "\xCE\xB2", "\xCE\xB8", - "\xCE\xA5", "\xCE\xA5\xCC\x81", - "\xCE\xA5\xCC\x88", "\xCF\x86", - "\xCF\x80", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xCE\xBA", "\xCF\x81", - "\xCF\x82", NULL, - "\xCE\x98", "\xCE\xB5", - NULL, NULL, - NULL, "\xCE\xA3", - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage5[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xD5\xA5\xD6\x82", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage6[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xD8\xA7\xD9\x93", "\xD8\xA7\xD9\x94", - "\xD9\x88\xD9\x94", "\xD8\xA7\xD9\x95", - "\xD9\x8A\xD9\x94", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xD8\xA7\xD9\xB4", - "\xD9\x88\xD9\xB4", "\xDB\x87\xD9\xB4", - "\xD9\x8A\xD9\xB4", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xDB\x95\xD9\x94", NULL, - "\xDB\x81\xD9\x94", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xDB\x92\xD9\x94", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage12[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xB1\x86\xE0\xB1\x96", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xB2\xBF\xE0\xB3\x95", NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xB3\x86\xE0\xB3\x95", - "\xE0\xB3\x86\xE0\xB3\x96", NULL, - "\xE0\xB3\x86\xE0\xB3\x82", "\xE0\xB3\x86\xE0\xB3\x82\xE0\xB3\x95", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage13[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xB5\x86\xE0\xB4\xBE", "\xE0\xB5\x87\xE0\xB4\xBE", - "\xE0\xB5\x86\xE0\xB5\x97", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xB7\x99\xE0\xB7\x8A", NULL, - "\xE0\xB7\x99\xE0\xB7\x8F", "\xE0\xB7\x99\xE0\xB7\x8F\xE0\xB7\x8A", - "\xE0\xB7\x99\xE0\xB7\x9F", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage14[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xB9\x8D\xE0\xB8\xB2", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBB\x8D\xE0\xBA\xB2", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xBA\xAB\xE0\xBA\x99", "\xE0\xBA\xAB\xE0\xBA\xA1", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage15[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE0\xBC\x8B", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBD\x82\xE0\xBE\xB7", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBD\x8C\xE0\xBE\xB7", - NULL, NULL, - NULL, NULL, - "\xE0\xBD\x91\xE0\xBE\xB7", NULL, - NULL, NULL, - NULL, "\xE0\xBD\x96\xE0\xBE\xB7", - NULL, NULL, - NULL, NULL, - "\xE0\xBD\x9B\xE0\xBE\xB7", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBD\x80\xE0\xBE\xB5", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBD\xB1\xE0\xBD\xB2", - NULL, "\xE0\xBD\xB1\xE0\xBD\xB4", - "\xE0\xBE\xB2\xE0\xBE\x80", "\xE0\xBE\xB2\xE0\xBD\xB1\xE0\xBE\x80", - "\xE0\xBE\xB3\xE0\xBE\x80", "\xE0\xBE\xB3\xE0\xBD\xB1\xE0\xBE\x80", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBD\xB1\xE0\xBE\x80", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBE\x92\xE0\xBE\xB7", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBE\x9C\xE0\xBE\xB7", - NULL, NULL, - NULL, NULL, - "\xE0\xBE\xA1\xE0\xBE\xB7", NULL, - NULL, NULL, - NULL, "\xE0\xBE\xA6\xE0\xBE\xB7", - NULL, NULL, - NULL, NULL, - "\xE0\xBE\xAB\xE0\xBE\xB7", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE0\xBE\x90\xE0\xBE\xB5", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage16[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE1\x80\xA5\xE1\x80\xAE", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE1\x83\x9C", NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage29[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x41", "\xC3\x86", - "\x42", NULL, - "\x44", "\x45", - "\xC6\x8E", "\x47", - "\x48", "\x49", - "\x4A", "\x4B", - "\x4C", "\x4D", - "\x4E", NULL, - "\x4F", "\xC8\xA2", - "\x50", "\x52", - "\x54", "\x55", - "\x57", "\x61", - "\xC9\x90", "\xC9\x91", - "\xE1\xB4\x82", "\x62", - "\x64", "\x65", - "\xC9\x99", "\xC9\x9B", - "\xC9\x9C", "\x67", - NULL, "\x6B", - "\x6D", "\xC5\x8B", - "\x6F", "\xC9\x94", - "\xE1\xB4\x96", "\xE1\xB4\x97", - "\x70", "\x74", - "\x75", "\xE1\xB4\x9D", - "\xC9\xAF", "\x76", - "\xE1\xB4\xA5", "\xCE\xB2", - "\xCE\xB3", "\xCE\xB4", - "\xCF\x86", "\xCF\x87", - "\x69", "\x72", - "\x75", "\x76", - "\xCE\xB2", "\xCE\xB3", - "\xCF\x81", "\xCF\x86", - "\xCF\x87", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xD0\xBD", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xC9\x92", - "\x63", "\xC9\x95", - "\xC3\xB0", "\xC9\x9C", - "\x66", "\xC9\x9F", - "\xC9\xA1", "\xC9\xA5", - "\xC9\xA8", "\xC9\xA9", - "\xC9\xAA", "\xE1\xB5\xBB", - "\xCA\x9D", "\xC9\xAD", - "\xE1\xB6\x85", "\xCA\x9F", - "\xC9\xB1", "\xC9\xB0", - "\xC9\xB2", "\xC9\xB3", - "\xC9\xB4", "\xC9\xB5", - "\xC9\xB8", "\xCA\x82", - "\xCA\x83", "\xC6\xAB", - "\xCA\x89", "\xCA\x8A", - "\xE1\xB4\x9C", "\xCA\x8B", - "\xCA\x8C", "\x7A", - "\xCA\x90", "\xCA\x91", - "\xCA\x92", "\xCE\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage30[0x100] = { - "\x41\xCC\xA5", "\x61\xCC\xA5", - "\x42\xCC\x87", "\x62\xCC\x87", - "\x42\xCC\xA3", "\x62\xCC\xA3", - "\x42\xCC\xB1", "\x62\xCC\xB1", - "\x43\xCC\xA7\xCC\x81", "\x63\xCC\xA7\xCC\x81", - "\x44\xCC\x87", "\x64\xCC\x87", - "\x44\xCC\xA3", "\x64\xCC\xA3", - "\x44\xCC\xB1", "\x64\xCC\xB1", - "\x44\xCC\xA7", "\x64\xCC\xA7", - "\x44\xCC\xAD", "\x64\xCC\xAD", - "\x45\xCC\x84\xCC\x80", "\x65\xCC\x84\xCC\x80", - "\x45\xCC\x84\xCC\x81", "\x65\xCC\x84\xCC\x81", - "\x45\xCC\xAD", "\x65\xCC\xAD", - "\x45\xCC\xB0", "\x65\xCC\xB0", - "\x45\xCC\xA7\xCC\x86", "\x65\xCC\xA7\xCC\x86", - "\x46\xCC\x87", "\x66\xCC\x87", - "\x47\xCC\x84", "\x67\xCC\x84", - "\x48\xCC\x87", "\x68\xCC\x87", - "\x48\xCC\xA3", "\x68\xCC\xA3", - "\x48\xCC\x88", "\x68\xCC\x88", - "\x48\xCC\xA7", "\x68\xCC\xA7", - "\x48\xCC\xAE", "\x68\xCC\xAE", - "\x49\xCC\xB0", "\x69\xCC\xB0", - "\x49\xCC\x88\xCC\x81", "\x69\xCC\x88\xCC\x81", - "\x4B\xCC\x81", "\x6B\xCC\x81", - "\x4B\xCC\xA3", "\x6B\xCC\xA3", - "\x4B\xCC\xB1", "\x6B\xCC\xB1", - "\x4C\xCC\xA3", "\x6C\xCC\xA3", - "\x4C\xCC\xA3\xCC\x84", "\x6C\xCC\xA3\xCC\x84", - "\x4C\xCC\xB1", "\x6C\xCC\xB1", - "\x4C\xCC\xAD", "\x6C\xCC\xAD", - "\x4D\xCC\x81", "\x6D\xCC\x81", - "\x4D\xCC\x87", "\x6D\xCC\x87", - "\x4D\xCC\xA3", "\x6D\xCC\xA3", - "\x4E\xCC\x87", "\x6E\xCC\x87", - "\x4E\xCC\xA3", "\x6E\xCC\xA3", - "\x4E\xCC\xB1", "\x6E\xCC\xB1", - "\x4E\xCC\xAD", "\x6E\xCC\xAD", - "\x4F\xCC\x83\xCC\x81", "\x6F\xCC\x83\xCC\x81", - "\x4F\xCC\x83\xCC\x88", "\x6F\xCC\x83\xCC\x88", - "\x4F\xCC\x84\xCC\x80", "\x6F\xCC\x84\xCC\x80", - "\x4F\xCC\x84\xCC\x81", "\x6F\xCC\x84\xCC\x81", - "\x50\xCC\x81", "\x70\xCC\x81", - "\x50\xCC\x87", "\x70\xCC\x87", - "\x52\xCC\x87", "\x72\xCC\x87", - "\x52\xCC\xA3", "\x72\xCC\xA3", - "\x52\xCC\xA3\xCC\x84", "\x72\xCC\xA3\xCC\x84", - "\x52\xCC\xB1", "\x72\xCC\xB1", - "\x53\xCC\x87", "\x73\xCC\x87", - "\x53\xCC\xA3", "\x73\xCC\xA3", - "\x53\xCC\x81\xCC\x87", "\x73\xCC\x81\xCC\x87", - "\x53\xCC\x8C\xCC\x87", "\x73\xCC\x8C\xCC\x87", - "\x53\xCC\xA3\xCC\x87", "\x73\xCC\xA3\xCC\x87", - "\x54\xCC\x87", "\x74\xCC\x87", - "\x54\xCC\xA3", "\x74\xCC\xA3", - "\x54\xCC\xB1", "\x74\xCC\xB1", - "\x54\xCC\xAD", "\x74\xCC\xAD", - "\x55\xCC\xA4", "\x75\xCC\xA4", - "\x55\xCC\xB0", "\x75\xCC\xB0", - "\x55\xCC\xAD", "\x75\xCC\xAD", - "\x55\xCC\x83\xCC\x81", "\x75\xCC\x83\xCC\x81", - "\x55\xCC\x84\xCC\x88", "\x75\xCC\x84\xCC\x88", - "\x56\xCC\x83", "\x76\xCC\x83", - "\x56\xCC\xA3", "\x76\xCC\xA3", - "\x57\xCC\x80", "\x77\xCC\x80", - "\x57\xCC\x81", "\x77\xCC\x81", - "\x57\xCC\x88", "\x77\xCC\x88", - "\x57\xCC\x87", "\x77\xCC\x87", - "\x57\xCC\xA3", "\x77\xCC\xA3", - "\x58\xCC\x87", "\x78\xCC\x87", - "\x58\xCC\x88", "\x78\xCC\x88", - "\x59\xCC\x87", "\x79\xCC\x87", - "\x5A\xCC\x82", "\x7A\xCC\x82", - "\x5A\xCC\xA3", "\x7A\xCC\xA3", - "\x5A\xCC\xB1", "\x7A\xCC\xB1", - "\x68\xCC\xB1", "\x74\xCC\x88", - "\x77\xCC\x8A", "\x79\xCC\x8A", - "\x61\xCA\xBE", "\x73\xCC\x87", - NULL, NULL, - NULL, NULL, - "\x41\xCC\xA3", "\x61\xCC\xA3", - "\x41\xCC\x89", "\x61\xCC\x89", - "\x41\xCC\x82\xCC\x81", "\x61\xCC\x82\xCC\x81", - "\x41\xCC\x82\xCC\x80", "\x61\xCC\x82\xCC\x80", - "\x41\xCC\x82\xCC\x89", "\x61\xCC\x82\xCC\x89", - "\x41\xCC\x82\xCC\x83", "\x61\xCC\x82\xCC\x83", - "\x41\xCC\xA3\xCC\x82", "\x61\xCC\xA3\xCC\x82", - "\x41\xCC\x86\xCC\x81", "\x61\xCC\x86\xCC\x81", - "\x41\xCC\x86\xCC\x80", "\x61\xCC\x86\xCC\x80", - "\x41\xCC\x86\xCC\x89", "\x61\xCC\x86\xCC\x89", - "\x41\xCC\x86\xCC\x83", "\x61\xCC\x86\xCC\x83", - "\x41\xCC\xA3\xCC\x86", "\x61\xCC\xA3\xCC\x86", - "\x45\xCC\xA3", "\x65\xCC\xA3", - "\x45\xCC\x89", "\x65\xCC\x89", - "\x45\xCC\x83", "\x65\xCC\x83", - "\x45\xCC\x82\xCC\x81", "\x65\xCC\x82\xCC\x81", - "\x45\xCC\x82\xCC\x80", "\x65\xCC\x82\xCC\x80", - "\x45\xCC\x82\xCC\x89", "\x65\xCC\x82\xCC\x89", - "\x45\xCC\x82\xCC\x83", "\x65\xCC\x82\xCC\x83", - "\x45\xCC\xA3\xCC\x82", "\x65\xCC\xA3\xCC\x82", - "\x49\xCC\x89", "\x69\xCC\x89", - "\x49\xCC\xA3", "\x69\xCC\xA3", - "\x4F\xCC\xA3", "\x6F\xCC\xA3", - "\x4F\xCC\x89", "\x6F\xCC\x89", - "\x4F\xCC\x82\xCC\x81", "\x6F\xCC\x82\xCC\x81", - "\x4F\xCC\x82\xCC\x80", "\x6F\xCC\x82\xCC\x80", - "\x4F\xCC\x82\xCC\x89", "\x6F\xCC\x82\xCC\x89", - "\x4F\xCC\x82\xCC\x83", "\x6F\xCC\x82\xCC\x83", - "\x4F\xCC\xA3\xCC\x82", "\x6F\xCC\xA3\xCC\x82", - "\x4F\xCC\x9B\xCC\x81", "\x6F\xCC\x9B\xCC\x81", - "\x4F\xCC\x9B\xCC\x80", "\x6F\xCC\x9B\xCC\x80", - "\x4F\xCC\x9B\xCC\x89", "\x6F\xCC\x9B\xCC\x89", - "\x4F\xCC\x9B\xCC\x83", "\x6F\xCC\x9B\xCC\x83", - "\x4F\xCC\x9B\xCC\xA3", "\x6F\xCC\x9B\xCC\xA3", - "\x55\xCC\xA3", "\x75\xCC\xA3", - "\x55\xCC\x89", "\x75\xCC\x89", - "\x55\xCC\x9B\xCC\x81", "\x75\xCC\x9B\xCC\x81", - "\x55\xCC\x9B\xCC\x80", "\x75\xCC\x9B\xCC\x80", - "\x55\xCC\x9B\xCC\x89", "\x75\xCC\x9B\xCC\x89", - "\x55\xCC\x9B\xCC\x83", "\x75\xCC\x9B\xCC\x83", - "\x55\xCC\x9B\xCC\xA3", "\x75\xCC\x9B\xCC\xA3", - "\x59\xCC\x80", "\x79\xCC\x80", - "\x59\xCC\xA3", "\x79\xCC\xA3", - "\x59\xCC\x89", "\x79\xCC\x89", - "\x59\xCC\x83", "\x79\xCC\x83", - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage31[0x100] = { - "\xCE\xB1\xCC\x93", "\xCE\xB1\xCC\x94", - "\xCE\xB1\xCC\x93\xCC\x80", "\xCE\xB1\xCC\x94\xCC\x80", - "\xCE\xB1\xCC\x93\xCC\x81", "\xCE\xB1\xCC\x94\xCC\x81", - "\xCE\xB1\xCC\x93\xCD\x82", "\xCE\xB1\xCC\x94\xCD\x82", - "\xCE\x91\xCC\x93", "\xCE\x91\xCC\x94", - "\xCE\x91\xCC\x93\xCC\x80", "\xCE\x91\xCC\x94\xCC\x80", - "\xCE\x91\xCC\x93\xCC\x81", "\xCE\x91\xCC\x94\xCC\x81", - "\xCE\x91\xCC\x93\xCD\x82", "\xCE\x91\xCC\x94\xCD\x82", - "\xCE\xB5\xCC\x93", "\xCE\xB5\xCC\x94", - "\xCE\xB5\xCC\x93\xCC\x80", "\xCE\xB5\xCC\x94\xCC\x80", - "\xCE\xB5\xCC\x93\xCC\x81", "\xCE\xB5\xCC\x94\xCC\x81", - NULL, NULL, - "\xCE\x95\xCC\x93", "\xCE\x95\xCC\x94", - "\xCE\x95\xCC\x93\xCC\x80", "\xCE\x95\xCC\x94\xCC\x80", - "\xCE\x95\xCC\x93\xCC\x81", "\xCE\x95\xCC\x94\xCC\x81", - NULL, NULL, - "\xCE\xB7\xCC\x93", "\xCE\xB7\xCC\x94", - "\xCE\xB7\xCC\x93\xCC\x80", "\xCE\xB7\xCC\x94\xCC\x80", - "\xCE\xB7\xCC\x93\xCC\x81", "\xCE\xB7\xCC\x94\xCC\x81", - "\xCE\xB7\xCC\x93\xCD\x82", "\xCE\xB7\xCC\x94\xCD\x82", - "\xCE\x97\xCC\x93", "\xCE\x97\xCC\x94", - "\xCE\x97\xCC\x93\xCC\x80", "\xCE\x97\xCC\x94\xCC\x80", - "\xCE\x97\xCC\x93\xCC\x81", "\xCE\x97\xCC\x94\xCC\x81", - "\xCE\x97\xCC\x93\xCD\x82", "\xCE\x97\xCC\x94\xCD\x82", - "\xCE\xB9\xCC\x93", "\xCE\xB9\xCC\x94", - "\xCE\xB9\xCC\x93\xCC\x80", "\xCE\xB9\xCC\x94\xCC\x80", - "\xCE\xB9\xCC\x93\xCC\x81", "\xCE\xB9\xCC\x94\xCC\x81", - "\xCE\xB9\xCC\x93\xCD\x82", "\xCE\xB9\xCC\x94\xCD\x82", - "\xCE\x99\xCC\x93", "\xCE\x99\xCC\x94", - "\xCE\x99\xCC\x93\xCC\x80", "\xCE\x99\xCC\x94\xCC\x80", - "\xCE\x99\xCC\x93\xCC\x81", "\xCE\x99\xCC\x94\xCC\x81", - "\xCE\x99\xCC\x93\xCD\x82", "\xCE\x99\xCC\x94\xCD\x82", - "\xCE\xBF\xCC\x93", "\xCE\xBF\xCC\x94", - "\xCE\xBF\xCC\x93\xCC\x80", "\xCE\xBF\xCC\x94\xCC\x80", - "\xCE\xBF\xCC\x93\xCC\x81", "\xCE\xBF\xCC\x94\xCC\x81", - NULL, NULL, - "\xCE\x9F\xCC\x93", "\xCE\x9F\xCC\x94", - "\xCE\x9F\xCC\x93\xCC\x80", "\xCE\x9F\xCC\x94\xCC\x80", - "\xCE\x9F\xCC\x93\xCC\x81", "\xCE\x9F\xCC\x94\xCC\x81", - NULL, NULL, - "\xCF\x85\xCC\x93", "\xCF\x85\xCC\x94", - "\xCF\x85\xCC\x93\xCC\x80", "\xCF\x85\xCC\x94\xCC\x80", - "\xCF\x85\xCC\x93\xCC\x81", "\xCF\x85\xCC\x94\xCC\x81", - "\xCF\x85\xCC\x93\xCD\x82", "\xCF\x85\xCC\x94\xCD\x82", - NULL, "\xCE\xA5\xCC\x94", - NULL, "\xCE\xA5\xCC\x94\xCC\x80", - NULL, "\xCE\xA5\xCC\x94\xCC\x81", - NULL, "\xCE\xA5\xCC\x94\xCD\x82", - "\xCF\x89\xCC\x93", "\xCF\x89\xCC\x94", - "\xCF\x89\xCC\x93\xCC\x80", "\xCF\x89\xCC\x94\xCC\x80", - "\xCF\x89\xCC\x93\xCC\x81", "\xCF\x89\xCC\x94\xCC\x81", - "\xCF\x89\xCC\x93\xCD\x82", "\xCF\x89\xCC\x94\xCD\x82", - "\xCE\xA9\xCC\x93", "\xCE\xA9\xCC\x94", - "\xCE\xA9\xCC\x93\xCC\x80", "\xCE\xA9\xCC\x94\xCC\x80", - "\xCE\xA9\xCC\x93\xCC\x81", "\xCE\xA9\xCC\x94\xCC\x81", - "\xCE\xA9\xCC\x93\xCD\x82", "\xCE\xA9\xCC\x94\xCD\x82", - "\xCE\xB1\xCC\x80", "\xCE\xB1\xCC\x81", - "\xCE\xB5\xCC\x80", "\xCE\xB5\xCC\x81", - "\xCE\xB7\xCC\x80", "\xCE\xB7\xCC\x81", - "\xCE\xB9\xCC\x80", "\xCE\xB9\xCC\x81", - "\xCE\xBF\xCC\x80", "\xCE\xBF\xCC\x81", - "\xCF\x85\xCC\x80", "\xCF\x85\xCC\x81", - "\xCF\x89\xCC\x80", "\xCF\x89\xCC\x81", - NULL, NULL, - "\xCE\xB1\xCC\x93\xCD\x85", "\xCE\xB1\xCC\x94\xCD\x85", - "\xCE\xB1\xCC\x93\xCC\x80\xCD\x85", "\xCE\xB1\xCC\x94\xCC\x80\xCD\x85", - "\xCE\xB1\xCC\x93\xCC\x81\xCD\x85", "\xCE\xB1\xCC\x94\xCC\x81\xCD\x85", - "\xCE\xB1\xCC\x93\xCD\x82\xCD\x85", "\xCE\xB1\xCC\x94\xCD\x82\xCD\x85", - "\xCE\x91\xCC\x93\xCD\x85", "\xCE\x91\xCC\x94\xCD\x85", - "\xCE\x91\xCC\x93\xCC\x80\xCD\x85", "\xCE\x91\xCC\x94\xCC\x80\xCD\x85", - "\xCE\x91\xCC\x93\xCC\x81\xCD\x85", "\xCE\x91\xCC\x94\xCC\x81\xCD\x85", - "\xCE\x91\xCC\x93\xCD\x82\xCD\x85", "\xCE\x91\xCC\x94\xCD\x82\xCD\x85", - "\xCE\xB7\xCC\x93\xCD\x85", "\xCE\xB7\xCC\x94\xCD\x85", - "\xCE\xB7\xCC\x93\xCC\x80\xCD\x85", "\xCE\xB7\xCC\x94\xCC\x80\xCD\x85", - "\xCE\xB7\xCC\x93\xCC\x81\xCD\x85", "\xCE\xB7\xCC\x94\xCC\x81\xCD\x85", - "\xCE\xB7\xCC\x93\xCD\x82\xCD\x85", "\xCE\xB7\xCC\x94\xCD\x82\xCD\x85", - "\xCE\x97\xCC\x93\xCD\x85", "\xCE\x97\xCC\x94\xCD\x85", - "\xCE\x97\xCC\x93\xCC\x80\xCD\x85", "\xCE\x97\xCC\x94\xCC\x80\xCD\x85", - "\xCE\x97\xCC\x93\xCC\x81\xCD\x85", "\xCE\x97\xCC\x94\xCC\x81\xCD\x85", - "\xCE\x97\xCC\x93\xCD\x82\xCD\x85", "\xCE\x97\xCC\x94\xCD\x82\xCD\x85", - "\xCF\x89\xCC\x93\xCD\x85", "\xCF\x89\xCC\x94\xCD\x85", - "\xCF\x89\xCC\x93\xCC\x80\xCD\x85", "\xCF\x89\xCC\x94\xCC\x80\xCD\x85", - "\xCF\x89\xCC\x93\xCC\x81\xCD\x85", "\xCF\x89\xCC\x94\xCC\x81\xCD\x85", - "\xCF\x89\xCC\x93\xCD\x82\xCD\x85", "\xCF\x89\xCC\x94\xCD\x82\xCD\x85", - "\xCE\xA9\xCC\x93\xCD\x85", "\xCE\xA9\xCC\x94\xCD\x85", - "\xCE\xA9\xCC\x93\xCC\x80\xCD\x85", "\xCE\xA9\xCC\x94\xCC\x80\xCD\x85", - "\xCE\xA9\xCC\x93\xCC\x81\xCD\x85", "\xCE\xA9\xCC\x94\xCC\x81\xCD\x85", - "\xCE\xA9\xCC\x93\xCD\x82\xCD\x85", "\xCE\xA9\xCC\x94\xCD\x82\xCD\x85", - "\xCE\xB1\xCC\x86", "\xCE\xB1\xCC\x84", - "\xCE\xB1\xCC\x80\xCD\x85", "\xCE\xB1\xCD\x85", - "\xCE\xB1\xCC\x81\xCD\x85", NULL, - "\xCE\xB1\xCD\x82", "\xCE\xB1\xCD\x82\xCD\x85", - "\xCE\x91\xCC\x86", "\xCE\x91\xCC\x84", - "\xCE\x91\xCC\x80", "\xCE\x91\xCC\x81", - "\xCE\x91\xCD\x85", "\x20\xCC\x93", - "\xCE\xB9", "\x20\xCC\x93", - "\x20\xCD\x82", "\x20\xCC\x88\xCD\x82", - "\xCE\xB7\xCC\x80\xCD\x85", "\xCE\xB7\xCD\x85", - "\xCE\xB7\xCC\x81\xCD\x85", NULL, - "\xCE\xB7\xCD\x82", "\xCE\xB7\xCD\x82\xCD\x85", - "\xCE\x95\xCC\x80", "\xCE\x95\xCC\x81", - "\xCE\x97\xCC\x80", "\xCE\x97\xCC\x81", - "\xCE\x97\xCD\x85", "\x20\xCC\x93\xCC\x80", - "\x20\xCC\x93\xCC\x81", "\x20\xCC\x93\xCD\x82", - "\xCE\xB9\xCC\x86", "\xCE\xB9\xCC\x84", - "\xCE\xB9\xCC\x88\xCC\x80", "\xCE\xB9\xCC\x88\xCC\x81", - NULL, NULL, - "\xCE\xB9\xCD\x82", "\xCE\xB9\xCC\x88\xCD\x82", - "\xCE\x99\xCC\x86", "\xCE\x99\xCC\x84", - "\xCE\x99\xCC\x80", "\xCE\x99\xCC\x81", - NULL, "\x20\xCC\x94\xCC\x80", - "\x20\xCC\x94\xCC\x81", "\x20\xCC\x94\xCD\x82", - "\xCF\x85\xCC\x86", "\xCF\x85\xCC\x84", - "\xCF\x85\xCC\x88\xCC\x80", "\xCF\x85\xCC\x88\xCC\x81", - "\xCF\x81\xCC\x93", "\xCF\x81\xCC\x94", - "\xCF\x85\xCD\x82", "\xCF\x85\xCC\x88\xCD\x82", - "\xCE\xA5\xCC\x86", "\xCE\xA5\xCC\x84", - "\xCE\xA5\xCC\x80", "\xCE\xA5\xCC\x81", - "\xCE\xA1\xCC\x94", "\x20\xCC\x88\xCC\x80", - "\x20\xCC\x88\xCC\x81", "\x60", - NULL, NULL, - "\xCF\x89\xCC\x80\xCD\x85", "\xCF\x89\xCD\x85", - "\xCF\x89\xCC\x81\xCD\x85", NULL, - "\xCF\x89\xCD\x82", "\xCF\x89\xCD\x82\xCD\x85", - "\xCE\x9F\xCC\x80", "\xCE\x9F\xCC\x81", - "\xCE\xA9\xCC\x80", "\xCE\xA9\xCC\x81", - "\xCE\xA9\xCD\x85", "\x20\xCC\x81", - "\x20\xCC\x94", NULL, -}; - -static const char *const decompCompatPage32[0x100] = { - "\x20", "\x20", - "\x20", "\x20", - "\x20", "\x20", - "\x20", "\x20", - "\x20", "\x20", - "\x20", NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE2\x80\x90", - NULL, NULL, - NULL, NULL, - NULL, "\x20\xCC\xB3", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x2E", "\x2E\x2E", - "\x2E\x2E\x2E", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\x20", - NULL, NULL, - NULL, "\xE2\x80\xB2\xE2\x80\xB2", - "\xE2\x80\xB2\xE2\x80\xB2\xE2\x80\xB2", NULL, - "\xE2\x80\xB5\xE2\x80\xB5", "\xE2\x80\xB5\xE2\x80\xB5\xE2\x80\xB5", - NULL, NULL, - NULL, NULL, - "\x21\x21", NULL, - "\x20\xCC\x85", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\x3F\x3F", - "\x3F\x21", "\x21\x3F", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE2\x80\xB2\xE2\x80\xB2\xE2\x80\xB2\xE2\x80\xB2", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\x20", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x30", "\x69", - NULL, NULL, - "\x34", "\x35", - "\x36", "\x37", - "\x38", "\x39", - "\x2B", "\xE2\x88\x92", - "\x3D", "\x28", - "\x29", "\x6E", - "\x30", "\x31", - "\x32", "\x33", - "\x34", "\x35", - "\x36", "\x37", - "\x38", "\x39", - "\x2B", "\xE2\x88\x92", - "\x3D", "\x28", - "\x29", NULL, - "\x61", "\x65", - "\x6F", "\x78", - "\xC9\x99", "\x68", - "\x6B", "\x6C", - "\x6D", "\x6E", - "\x70", "\x73", - "\x74", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x52\x73", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage33[0x100] = { - "\x61\x2F\x63", "\x61\x2F\x73", - "\x43", "\xC2\xB0\x43", - NULL, "\x63\x2F\x6F", - "\x63\x2F\x75", "\xC6\x90", - NULL, "\xC2\xB0\x46", - "\x67", "\x48", - "\x48", "\x48", - "\x68", "\xC4\xA7", - "\x49", "\x49", - "\x4C", "\x6C", - NULL, "\x4E", - "\x4E\x6F", NULL, - NULL, "\x50", - "\x51", "\x52", - "\x52", "\x52", - NULL, NULL, - "\x53\x4D", "\x54\x45\x4C", - "\x54\x4D", NULL, - "\x5A", NULL, - "\xCE\xA9", NULL, - "\x5A", NULL, - "\x4B", "\x41\xCC\x8A", - "\x42", "\x43", - NULL, "\x65", - "\x45", "\x46", - NULL, "\x4D", - "\x6F", "\xD7\x90", - "\xD7\x91", "\xD7\x92", - "\xD7\x93", "\x69", - NULL, "\x46\x41\x58", - "\xCF\x80", "\xCE\xB3", - "\xCE\x93", "\xCE\xA0", - "\xE2\x88\x91", NULL, - NULL, NULL, - NULL, "\x44", - "\x64", "\x65", - "\x69", "\x6A", - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x31\xE2\x81\x84\x37", "\x31\xE2\x81\x84\x39", - "\x31\xE2\x81\x84\x31\x30", "\x31\xE2\x81\x84\x33", - "\x32\xE2\x81\x84\x33", "\x31\xE2\x81\x84\x35", - "\x32\xE2\x81\x84\x35", "\x33\xE2\x81\x84\x35", - "\x34\xE2\x81\x84\x35", "\x31\xE2\x81\x84\x36", - "\x35\xE2\x81\x84\x36", "\x31\xE2\x81\x84\x38", - "\x33\xE2\x81\x84\x38", "\x35\xE2\x81\x84\x38", - "\x37\xE2\x81\x84\x38", "\x31\xE2\x81\x84", - "\x49", "\x49\x49", - "\x49\x49\x49", "\x49\x56", - "\x56", "\x56\x49", - "\x56\x49\x49", "\x56\x49\x49\x49", - "\x49\x58", "\x58", - "\x58\x49", "\x58\x49\x49", - "\x4C", "\x43", - "\x44", "\x4D", - "\x69", "\x69\x69", - "\x69\x69\x69", "\x69\x76", - "\x76", "\x76\x69", - "\x76\x69\x69", "\x76\x69\x69\x69", - "\x69\x78", "\x78", - "\x78\x69", "\x78\x69\x69", - "\x6C", "\x63", - "\x64", "\x6D", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\x30\xE2\x81\x84\x33", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x86\x90\xCC\xB8", "\xE2\x86\x92\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x86\x94\xCC\xB8", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE2\x87\x90\xCC\xB8", - "\xE2\x87\x94\xCC\xB8", "\xE2\x87\x92\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage34[0x100] = { - NULL, NULL, - NULL, NULL, - "\xE2\x88\x83\xCC\xB8", NULL, - NULL, NULL, - NULL, "\xE2\x88\x88\xCC\xB8", - NULL, NULL, - "\xE2\x88\x8B\xCC\xB8", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x88\xA3\xCC\xB8", NULL, - "\xE2\x88\xA5\xCC\xB8", NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x88\xAB\xE2\x88\xAB", "\xE2\x88\xAB\xE2\x88\xAB\xE2\x88\xAB", - NULL, "\xE2\x88\xAE\xE2\x88\xAE", - "\xE2\x88\xAE\xE2\x88\xAE\xE2\x88\xAE", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE2\x88\xBC\xCC\xB8", - NULL, NULL, - "\xE2\x89\x83\xCC\xB8", NULL, - NULL, "\xE2\x89\x85\xCC\xB8", - NULL, "\xE2\x89\x88\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x3D\xCC\xB8", NULL, - "\xE2\x89\xA1\xCC\xB8", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE2\x89\x8D\xCC\xB8", - "\x3C\xCC\xB8", "\x3E\xCC\xB8", - "\xE2\x89\xA4\xCC\xB8", "\xE2\x89\xA5\xCC\xB8", - NULL, NULL, - "\xE2\x89\xB2\xCC\xB8", "\xE2\x89\xB3\xCC\xB8", - NULL, NULL, - "\xE2\x89\xB6\xCC\xB8", "\xE2\x89\xB7\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x89\xBA\xCC\xB8", "\xE2\x89\xBB\xCC\xB8", - NULL, NULL, - "\xE2\x8A\x82\xCC\xB8", "\xE2\x8A\x83\xCC\xB8", - NULL, NULL, - "\xE2\x8A\x86\xCC\xB8", "\xE2\x8A\x87\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x8A\xA2\xCC\xB8", "\xE2\x8A\xA8\xCC\xB8", - "\xE2\x8A\xA9\xCC\xB8", "\xE2\x8A\xAB\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x89\xBC\xCC\xB8", "\xE2\x89\xBD\xCC\xB8", - "\xE2\x8A\x91\xCC\xB8", "\xE2\x8A\x92\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x8A\xB2\xCC\xB8", "\xE2\x8A\xB3\xCC\xB8", - "\xE2\x8A\xB4\xCC\xB8", "\xE2\x8A\xB5\xCC\xB8", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage36[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x31", "\x32", - "\x33", "\x34", - "\x35", "\x36", - "\x37", "\x38", - "\x39", "\x31\x30", - "\x31\x31", "\x31\x32", - "\x31\x33", "\x31\x34", - "\x31\x35", "\x31\x36", - "\x31\x37", "\x31\x38", - "\x31\x39", "\x32\x30", - "\x28\x31\x29", "\x28\x32\x29", - "\x28\x33\x29", "\x28\x34\x29", - "\x28\x35\x29", "\x28\x36\x29", - "\x28\x37\x29", "\x28\x38\x29", - "\x28\x39\x29", "\x28\x31\x30\x29", - "\x28\x31\x31\x29", "\x28\x31\x32\x29", - "\x28\x31\x33\x29", "\x28\x31\x34\x29", - "\x28\x31\x35\x29", "\x28\x31\x36\x29", - "\x28\x31\x37\x29", "\x28\x31\x38\x29", - "\x28\x31\x39\x29", "\x28\x32\x30\x29", - "\x31\x2E", "\x32\x2E", - "\x33\x2E", "\x34\x2E", - "\x35\x2E", "\x36\x2E", - "\x37\x2E", "\x38\x2E", - "\x39\x2E", "\x31\x30\x2E", - "\x31\x31\x2E", "\x31\x32\x2E", - "\x31\x33\x2E", "\x31\x34\x2E", - "\x31\x35\x2E", "\x31\x36\x2E", - "\x31\x37\x2E", "\x31\x38\x2E", - "\x31\x39\x2E", "\x32\x30\x2E", - "\x28\x61\x29", "\x28\x62\x29", - "\x28\x63\x29", "\x28\x64\x29", - "\x28\x65\x29", "\x28\x66\x29", - "\x28\x67\x29", "\x28\x68\x29", - "\x28\x69\x29", "\x28\x6A\x29", - "\x28\x6B\x29", "\x28\x6C\x29", - "\x28\x6D\x29", "\x28\x6E\x29", - "\x28\x6F\x29", "\x28\x70\x29", - "\x28\x71\x29", "\x28\x72\x29", - "\x28\x73\x29", "\x28\x74\x29", - "\x28\x75\x29", "\x28\x76\x29", - "\x28\x77\x29", "\x28\x78\x29", - "\x28\x79\x29", "\x28\x7A\x29", - "\x41", "\x42", - "\x43", "\x44", - "\x45", "\x46", - "\x47", "\x48", - "\x49", "\x4A", - "\x4B", "\x4C", - "\x4D", "\x4E", - "\x4F", "\x50", - "\x51", "\x52", - "\x53", "\x54", - "\x55", "\x56", - "\x57", "\x58", - "\x59", "\x5A", - "\x61", "\x62", - "\x63", "\x64", - "\x65", "\x66", - "\x67", "\x68", - "\x69", "\x6A", - "\x6B", "\x6C", - "\x6D", "\x6E", - "\x6F", "\x70", - "\x71", "\x72", - "\x73", "\x74", - "\x75", "\x76", - "\x77", "\x78", - "\x79", "\x7A", - "\x30", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage42[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\x88\xAB\xE2\x88\xAB\xE2\x88\xAB\xE2\x88\xAB", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x3A\x3A\x3D", "\x3D\x3D", - "\x3D\x3D\x3D", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE2\xAB\x9D\xCC\xB8", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage44[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x6A", "\x56", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage45[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE2\xB5\xA1", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage46[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE6\xAF\x8D", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE9\xBE\x9F", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage47[0x100] = { - "\xE4\xB8\x80", "\xE4\xB8\xA8", - "\xE4\xB8\xB6", "\xE4\xB8\xBF", - "\xE4\xB9\x99", "\xE4\xBA\x85", - "\xE4\xBA\x8C", "\xE4\xBA\xA0", - "\xE4\xBA\xBA", "\xE5\x84\xBF", - "\xE5\x85\xA5", "\xE5\x85\xAB", - "\xE5\x86\x82", "\xE5\x86\x96", - "\xE5\x86\xAB", "\xE5\x87\xA0", - "\xE5\x87\xB5", "\xE5\x88\x80", - "\xE5\x8A\x9B", "\xE5\x8B\xB9", - "\xE5\x8C\x95", "\xE5\x8C\x9A", - "\xE5\x8C\xB8", "\xE5\x8D\x81", - "\xE5\x8D\x9C", "\xE5\x8D\xA9", - "\xE5\x8E\x82", "\xE5\x8E\xB6", - "\xE5\x8F\x88", "\xE5\x8F\xA3", - "\xE5\x9B\x97", "\xE5\x9C\x9F", - "\xE5\xA3\xAB", "\xE5\xA4\x82", - "\xE5\xA4\x8A", "\xE5\xA4\x95", - "\xE5\xA4\xA7", "\xE5\xA5\xB3", - "\xE5\xAD\x90", "\xE5\xAE\x80", - "\xE5\xAF\xB8", "\xE5\xB0\x8F", - "\xE5\xB0\xA2", "\xE5\xB0\xB8", - "\xE5\xB1\xAE", "\xE5\xB1\xB1", - "\xE5\xB7\x9B", "\xE5\xB7\xA5", - "\xE5\xB7\xB1", "\xE5\xB7\xBE", - "\xE5\xB9\xB2", "\xE5\xB9\xBA", - "\xE5\xB9\xBF", "\xE5\xBB\xB4", - "\xE5\xBB\xBE", "\xE5\xBC\x8B", - "\xE5\xBC\x93", "\xE5\xBD\x90", - "\xE5\xBD\xA1", "\xE5\xBD\xB3", - "\xE5\xBF\x83", "\xE6\x88\x88", - "\xE6\x88\xB6", "\xE6\x89\x8B", - "\xE6\x94\xAF", "\xE6\x94\xB4", - "\xE6\x96\x87", "\xE6\x96\x97", - "\xE6\x96\xA4", "\xE6\x96\xB9", - "\xE6\x97\xA0", "\xE6\x97\xA5", - "\xE6\x9B\xB0", "\xE6\x9C\x88", - "\xE6\x9C\xA8", "\xE6\xAC\xA0", - "\xE6\xAD\xA2", "\xE6\xAD\xB9", - "\xE6\xAE\xB3", "\xE6\xAF\x8B", - "\xE6\xAF\x94", "\xE6\xAF\x9B", - "\xE6\xB0\x8F", "\xE6\xB0\x94", - "\xE6\xB0\xB4", "\xE7\x81\xAB", - "\xE7\x88\xAA", "\xE7\x88\xB6", - "\xE7\x88\xBB", "\xE7\x88\xBF", - "\xE7\x89\x87", "\xE7\x89\x99", - "\xE7\x89\x9B", "\xE7\x8A\xAC", - "\xE7\x8E\x84", "\xE7\x8E\x89", - "\xE7\x93\x9C", "\xE7\x93\xA6", - "\xE7\x94\x98", "\xE7\x94\x9F", - "\xE7\x94\xA8", "\xE7\x94\xB0", - "\xE7\x96\x8B", "\xE7\x96\x92", - "\xE7\x99\xB6", "\xE7\x99\xBD", - "\xE7\x9A\xAE", "\xE7\x9A\xBF", - "\xE7\x9B\xAE", "\xE7\x9F\x9B", - "\xE7\x9F\xA2", "\xE7\x9F\xB3", - "\xE7\xA4\xBA", "\xE7\xA6\xB8", - "\xE7\xA6\xBE", "\xE7\xA9\xB4", - "\xE7\xAB\x8B", "\xE7\xAB\xB9", - "\xE7\xB1\xB3", "\xE7\xB3\xB8", - "\xE7\xBC\xB6", "\xE7\xBD\x91", - "\xE7\xBE\x8A", "\xE7\xBE\xBD", - "\xE8\x80\x81", "\xE8\x80\x8C", - "\xE8\x80\x92", "\xE8\x80\xB3", - "\xE8\x81\xBF", "\xE8\x82\x89", - "\xE8\x87\xA3", "\xE8\x87\xAA", - "\xE8\x87\xB3", "\xE8\x87\xBC", - "\xE8\x88\x8C", "\xE8\x88\x9B", - "\xE8\x88\x9F", "\xE8\x89\xAE", - "\xE8\x89\xB2", "\xE8\x89\xB8", - "\xE8\x99\x8D", "\xE8\x99\xAB", - "\xE8\xA1\x80", "\xE8\xA1\x8C", - "\xE8\xA1\xA3", "\xE8\xA5\xBE", - "\xE8\xA6\x8B", "\xE8\xA7\x92", - "\xE8\xA8\x80", "\xE8\xB0\xB7", - "\xE8\xB1\x86", "\xE8\xB1\x95", - "\xE8\xB1\xB8", "\xE8\xB2\x9D", - "\xE8\xB5\xA4", "\xE8\xB5\xB0", - "\xE8\xB6\xB3", "\xE8\xBA\xAB", - "\xE8\xBB\x8A", "\xE8\xBE\x9B", - "\xE8\xBE\xB0", "\xE8\xBE\xB5", - "\xE9\x82\x91", "\xE9\x85\x89", - "\xE9\x87\x86", "\xE9\x87\x8C", - "\xE9\x87\x91", "\xE9\x95\xB7", - "\xE9\x96\x80", "\xE9\x98\x9C", - "\xE9\x9A\xB6", "\xE9\x9A\xB9", - "\xE9\x9B\xA8", "\xE9\x9D\x91", - "\xE9\x9D\x9E", "\xE9\x9D\xA2", - "\xE9\x9D\xA9", "\xE9\x9F\x8B", - "\xE9\x9F\xAD", "\xE9\x9F\xB3", - "\xE9\xA0\x81", "\xE9\xA2\xA8", - "\xE9\xA3\x9B", "\xE9\xA3\x9F", - "\xE9\xA6\x96", "\xE9\xA6\x99", - "\xE9\xA6\xAC", "\xE9\xAA\xA8", - "\xE9\xAB\x98", "\xE9\xAB\x9F", - "\xE9\xAC\xA5", "\xE9\xAC\xAF", - "\xE9\xAC\xB2", "\xE9\xAC\xBC", - "\xE9\xAD\x9A", "\xE9\xB3\xA5", - "\xE9\xB9\xB5", "\xE9\xB9\xBF", - "\xE9\xBA\xA5", "\xE9\xBA\xBB", - "\xE9\xBB\x83", "\xE9\xBB\x8D", - "\xE9\xBB\x91", "\xE9\xBB\xB9", - "\xE9\xBB\xBD", "\xE9\xBC\x8E", - "\xE9\xBC\x93", "\xE9\xBC\xA0", - "\xE9\xBC\xBB", "\xE9\xBD\x8A", - "\xE9\xBD\x92", "\xE9\xBE\x8D", - "\xE9\xBE\x9C", "\xE9\xBE\xA0", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage48[0x100] = { - "\x20", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE3\x80\x92", NULL, - "\xE5\x8D\x81", "\xE5\x8D\x84", - "\xE5\x8D\x85", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE3\x81\x8B\xE3\x82\x99", NULL, - "\xE3\x81\x8D\xE3\x82\x99", NULL, - "\xE3\x81\x8F\xE3\x82\x99", NULL, - "\xE3\x81\x91\xE3\x82\x99", NULL, - "\xE3\x81\x93\xE3\x82\x99", NULL, - "\xE3\x81\x95\xE3\x82\x99", NULL, - "\xE3\x81\x97\xE3\x82\x99", NULL, - "\xE3\x81\x99\xE3\x82\x99", NULL, - "\xE3\x81\x9B\xE3\x82\x99", NULL, - "\xE3\x81\x9D\xE3\x82\x99", NULL, - "\xE3\x81\x9F\xE3\x82\x99", NULL, - "\xE3\x81\xA1\xE3\x82\x99", NULL, - NULL, "\xE3\x81\xA4\xE3\x82\x99", - NULL, "\xE3\x81\xA6\xE3\x82\x99", - NULL, "\xE3\x81\xA8\xE3\x82\x99", - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE3\x81\xAF\xE3\x82\x99", "\xE3\x81\xAF\xE3\x82\x9A", - NULL, "\xE3\x81\xB2\xE3\x82\x99", - "\xE3\x81\xB2\xE3\x82\x9A", NULL, - "\xE3\x81\xB5\xE3\x82\x99", "\xE3\x81\xB5\xE3\x82\x9A", - NULL, "\xE3\x81\xB8\xE3\x82\x99", - "\xE3\x81\xB8\xE3\x82\x9A", NULL, - "\xE3\x81\xBB\xE3\x82\x99", "\xE3\x81\xBB\xE3\x82\x9A", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE3\x81\x86\xE3\x82\x99", NULL, - NULL, NULL, - NULL, NULL, - NULL, "\x20\xE3\x82\x99", - "\x20\xE3\x82\x9A", NULL, - "\xE3\x82\x9D\xE3\x82\x99", "\xE3\x82\x88\xE3\x82\x8A", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE3\x82\xAB\xE3\x82\x99", NULL, - "\xE3\x82\xAD\xE3\x82\x99", NULL, - "\xE3\x82\xAF\xE3\x82\x99", NULL, - "\xE3\x82\xB1\xE3\x82\x99", NULL, - "\xE3\x82\xB3\xE3\x82\x99", NULL, - "\xE3\x82\xB5\xE3\x82\x99", NULL, - "\xE3\x82\xB7\xE3\x82\x99", NULL, - "\xE3\x82\xB9\xE3\x82\x99", NULL, - "\xE3\x82\xBB\xE3\x82\x99", NULL, - "\xE3\x82\xBD\xE3\x82\x99", NULL, - "\xE3\x82\xBF\xE3\x82\x99", NULL, - "\xE3\x83\x81\xE3\x82\x99", NULL, - NULL, "\xE3\x83\x84\xE3\x82\x99", - NULL, "\xE3\x83\x86\xE3\x82\x99", - NULL, "\xE3\x83\x88\xE3\x82\x99", - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE3\x83\x8F\xE3\x82\x99", "\xE3\x83\x8F\xE3\x82\x9A", - NULL, "\xE3\x83\x92\xE3\x82\x99", - "\xE3\x83\x92\xE3\x82\x9A", NULL, - "\xE3\x83\x95\xE3\x82\x99", "\xE3\x83\x95\xE3\x82\x9A", - NULL, "\xE3\x83\x98\xE3\x82\x99", - "\xE3\x83\x98\xE3\x82\x9A", NULL, - "\xE3\x83\x9B\xE3\x82\x99", "\xE3\x83\x9B\xE3\x82\x9A", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE3\x82\xA6\xE3\x82\x99", NULL, - NULL, "\xE3\x83\xAF\xE3\x82\x99", - "\xE3\x83\xB0\xE3\x82\x99", "\xE3\x83\xB1\xE3\x82\x99", - "\xE3\x83\xB2\xE3\x82\x99", NULL, - NULL, NULL, - "\xE3\x83\xBD\xE3\x82\x99", "\xE3\x82\xB3\xE3\x83\x88", -}; - -static const char *const decompCompatPage49[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xE1\x84\x80", - "\xE1\x84\x81", "\xE1\x86\xAA", - "\xE1\x84\x82", "\xE1\x86\xAC", - "\xE1\x86\xAD", "\xE1\x84\x83", - "\xE1\x84\x84", "\xE1\x84\x85", - "\xE1\x86\xB0", "\xE1\x86\xB1", - "\xE1\x86\xB2", "\xE1\x86\xB3", - "\xE1\x86\xB4", "\xE1\x86\xB5", - "\xE1\x84\x9A", "\xE1\x84\x86", - "\xE1\x84\x87", "\xE1\x84\x88", - "\xE1\x84\xA1", "\xE1\x84\x89", - "\xE1\x84\x8A", "\xE1\x84\x8B", - "\xE1\x84\x8C", "\xE1\x84\x8D", - "\xE1\x84\x8E", "\xE1\x84\x8F", - "\xE1\x84\x90", "\xE1\x84\x91", - "\xE1\x84\x92", "\xE1\x85\xA1", - "\xE1\x85\xA2", "\xE1\x85\xA3", - "\xE1\x85\xA4", "\xE1\x85\xA5", - "\xE1\x85\xA6", "\xE1\x85\xA7", - "\xE1\x85\xA8", "\xE1\x85\xA9", - "\xE1\x85\xAA", "\xE1\x85\xAB", - "\xE1\x85\xAC", "\xE1\x85\xAD", - "\xE1\x85\xAE", "\xE1\x85\xAF", - "\xE1\x85\xB0", "\xE1\x85\xB1", - "\xE1\x85\xB2", "\xE1\x85\xB3", - "\xE1\x85\xB4", "\xE1\x85\xB5", - "\xE1\x85\xA0", "\xE1\x84\x94", - "\xE1\x84\x95", "\xE1\x87\x87", - "\xE1\x87\x88", "\xE1\x87\x8C", - "\xE1\x87\x8E", "\xE1\x87\x93", - "\xE1\x87\x97", "\xE1\x87\x99", - "\xE1\x84\x9C", "\xE1\x87\x9D", - "\xE1\x87\x9F", "\xE1\x84\x9D", - "\xE1\x84\x9E", "\xE1\x84\xA0", - "\xE1\x84\xA2", "\xE1\x84\xA3", - "\xE1\x84\xA7", "\xE1\x84\xA9", - "\xE1\x84\xAB", "\xE1\x84\xAC", - "\xE1\x84\xAD", "\xE1\x84\xAE", - "\xE1\x84\xAF", "\xE1\x84\xB2", - "\xE1\x84\xB6", "\xE1\x85\x80", - "\xE1\x85\x87", "\xE1\x85\x8C", - "\xE1\x87\xB1", "\xE1\x87\xB2", - "\xE1\x85\x97", "\xE1\x85\x98", - "\xE1\x85\x99", "\xE1\x86\x84", - "\xE1\x86\x85", "\xE1\x86\x88", - "\xE1\x86\x91", "\xE1\x86\x92", - "\xE1\x86\x94", "\xE1\x86\x9E", - "\xE1\x86\xA1", NULL, - NULL, NULL, - "\xE4\xB8\x80", "\xE4\xBA\x8C", - "\xE4\xB8\x89", "\xE5\x9B\x9B", - "\xE4\xB8\x8A", "\xE4\xB8\xAD", - "\xE4\xB8\x8B", "\xE7\x94\xB2", - "\xE4\xB9\x99", "\xE4\xB8\x99", - "\xE4\xB8\x81", "\xE5\xA4\xA9", - "\xE5\x9C\xB0", "\xE4\xBA\xBA", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage50[0x100] = { - "\x28\xE1\x84\x80\x29", "\x28\xE1\x84\x82\x29", - "\x28\xE1\x84\x83\x29", "\x28\xE1\x84\x85\x29", - "\x28\xE1\x84\x86\x29", "\x28\xE1\x84\x87\x29", - "\x28\xE1\x84\x89\x29", "\x28\xE1\x84\x8B\x29", - "\x28\xE1\x84\x8C\x29", "\x28\xE1\x84\x8E\x29", - "\x28\xE1\x84\x8F\x29", "\x28\xE1\x84\x90\x29", - "\x28\xE1\x84\x91\x29", "\x28\xE1\x84\x92\x29", - "\x28\xE1\x84\x80\xE1\x85\xA1\x29", "\x28\xE1\x84\x82\xE1\x85\xA1\x29", - "\x28\xE1\x84\x83\xE1\x85\xA1\x29", "\x28\xE1\x84\x85\xE1\x85\xA1\x29", - "\x28\xE1\x84\x86\xE1\x85\xA1\x29", "\x28\xE1\x84\x87\xE1\x85\xA1\x29", - "\x28\xE1\x84\x89\xE1\x85\xA1\x29", "\x28\xE1\x84\x8B\xE1\x85\xA1\x29", - "\x28\xE1\x84\x8C\xE1\x85\xA1\x29", "\x28\xE1\x84\x8E\xE1\x85\xA1\x29", - "\x28\xE1\x84\x8F\xE1\x85\xA1\x29", "\x28\xE1\x84\x90\xE1\x85\xA1\x29", - "\x28\xE1\x84\x91\xE1\x85\xA1\x29", "\x28\xE1\x84\x92\xE1\x85\xA1\x29", - "\x28\xE1\x84\x8C\xE1\x85\xAE\x29", "\x28\xE1\x84\x8B\xE1\x85\xA9\xE1\x84\x8C\xE1\x85\xA5\xE1\x86\xAB\x29", - "\x28\xE1\x84\x8B\xE1\x85\xA9\xE1\x84\x92\xE1\x85\xAE\x29", NULL, - "\x28\xE4\xB8\x80\x29", "\x28\xE4\xBA\x8C\x29", - "\x28\xE4\xB8\x89\x29", "\x28\xE5\x9B\x9B\x29", - "\x28\xE4\xBA\x94\x29", "\x28\xE5\x85\xAD\x29", - "\x28\xE4\xB8\x83\x29", "\x28\xE5\x85\xAB\x29", - "\x28\xE4\xB9\x9D\x29", "\x28\xE5\x8D\x81\x29", - "\x28\xE6\x9C\x88\x29", "\x28\xE7\x81\xAB\x29", - "\x28\xE6\xB0\xB4\x29", "\x28\xE6\x9C\xA8\x29", - "\x28\xE9\x87\x91\x29", "\x28\xE5\x9C\x9F\x29", - "\x28\xE6\x97\xA5\x29", "\x28\xE6\xA0\xAA\x29", - "\x28\xE6\x9C\x89\x29", "\x28\xE7\xA4\xBE\x29", - "\x28\xE5\x90\x8D\x29", "\x28\xE7\x89\xB9\x29", - "\x28\xE8\xB2\xA1\x29", "\x28\xE7\xA5\x9D\x29", - "\x28\xE5\x8A\xB4\x29", "\x28\xE4\xBB\xA3\x29", - "\x28\xE5\x91\xBC\x29", "\x28\xE5\xAD\xA6\x29", - "\x28\xE7\x9B\xA3\x29", "\x28\xE4\xBC\x81\x29", - "\x28\xE8\xB3\x87\x29", "\x28\xE5\x8D\x94\x29", - "\x28\xE7\xA5\xAD\x29", "\x28\xE4\xBC\x91\x29", - "\x28\xE8\x87\xAA\x29", "\x28\xE8\x87\xB3\x29", - "\xE5\x95\x8F", "\xE5\xB9\xBC", - "\xE6\x96\x87", "\xE7\xAE\x8F", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x50\x54\x45", "\x32\x31", - "\x32\x32", "\x32\x33", - "\x32\x34", "\x32\x35", - "\x32\x36", "\x32\x37", - "\x32\x38", "\x32\x39", - "\x33\x30", "\x33\x31", - "\x33\x32", "\x33\x33", - "\x33\x34", "\x33\x35", - "\xE1\x84\x80", "\xE1\x84\x82", - "\xE1\x84\x83", "\xE1\x84\x85", - "\xE1\x84\x86", "\xE1\x84\x87", - "\xE1\x84\x89", "\xE1\x84\x8B", - "\xE1\x84\x8C", "\xE1\x84\x8E", - "\xE1\x84\x8F", "\xE1\x84\x90", - "\xE1\x84\x91", "\xE1\x84\x92", - "\xE1\x84\x80\xE1\x85\xA1", "\xE1\x84\x82\xE1\x85\xA1", - "\xE1\x84\x83\xE1\x85\xA1", "\xE1\x84\x85\xE1\x85\xA1", - "\xE1\x84\x86\xE1\x85\xA1", "\xE1\x84\x87\xE1\x85\xA1", - "\xE1\x84\x89\xE1\x85\xA1", "\xE1\x84\x8B\xE1\x85\xA1", - "\xE1\x84\x8C\xE1\x85\xA1", "\xE1\x84\x8E\xE1\x85\xA1", - "\xE1\x84\x8F\xE1\x85\xA1", "\xE1\x84\x90\xE1\x85\xA1", - "\xE1\x84\x91\xE1\x85\xA1", "\xE1\x84\x92\xE1\x85\xA1", - "\xE1\x84\x8E\xE1\x85\xA1\xE1\x86\xB7\xE1\x84\x80\xE1\x85\xA9", "\xE1\x84\x8C\xE1\x85\xAE\xE1\x84\x8B\xE1\x85\xB4", - "\xE1\x84\x8B\xE1\x85\xAE", NULL, - "\xE4\xB8\x80", "\xE4\xBA\x8C", - "\xE4\xB8\x89", "\xE5\x9B\x9B", - "\xE4\xBA\x94", "\xE5\x85\xAD", - "\xE4\xB8\x83", "\xE5\x85\xAB", - "\xE4\xB9\x9D", "\xE5\x8D\x81", - "\xE6\x9C\x88", "\xE7\x81\xAB", - "\xE6\xB0\xB4", "\xE6\x9C\xA8", - "\xE9\x87\x91", "\xE5\x9C\x9F", - "\xE6\x97\xA5", "\xE6\xA0\xAA", - "\xE6\x9C\x89", "\xE7\xA4\xBE", - "\xE5\x90\x8D", "\xE7\x89\xB9", - "\xE8\xB2\xA1", "\xE7\xA5\x9D", - "\xE5\x8A\xB4", "\xE7\xA7\x98", - "\xE7\x94\xB7", "\xE5\xA5\xB3", - "\xE9\x81\xA9", "\xE5\x84\xAA", - "\xE5\x8D\xB0", "\xE6\xB3\xA8", - "\xE9\xA0\x85", "\xE4\xBC\x91", - "\xE5\x86\x99", "\xE6\xAD\xA3", - "\xE4\xB8\x8A", "\xE4\xB8\xAD", - "\xE4\xB8\x8B", "\xE5\xB7\xA6", - "\xE5\x8F\xB3", "\xE5\x8C\xBB", - "\xE5\xAE\x97", "\xE5\xAD\xA6", - "\xE7\x9B\xA3", "\xE4\xBC\x81", - "\xE8\xB3\x87", "\xE5\x8D\x94", - "\xE5\xA4\x9C", "\x33\x36", - "\x33\x37", "\x33\x38", - "\x33\x39", "\x34\x30", - "\x34\x31", "\x34\x32", - "\x34\x33", "\x34\x34", - "\x34\x35", "\x34\x36", - "\x34\x37", "\x34\x38", - "\x34\x39", "\x35\x30", - "\x31\xE6\x9C\x88", "\x32\xE6\x9C\x88", - "\x33\xE6\x9C\x88", "\x34\xE6\x9C\x88", - "\x35\xE6\x9C\x88", "\x36\xE6\x9C\x88", - "\x37\xE6\x9C\x88", "\x38\xE6\x9C\x88", - "\x39\xE6\x9C\x88", "\x31\x30\xE6\x9C\x88", - "\x31\x31\xE6\x9C\x88", "\x31\x32\xE6\x9C\x88", - "\x48\x67", "\x65\x72\x67", - "\x65\x56", "\x4C\x54\x44", - "\xE3\x82\xA2", "\xE3\x82\xA4", - "\xE3\x82\xA6", "\xE3\x82\xA8", - "\xE3\x82\xAA", "\xE3\x82\xAB", - "\xE3\x82\xAD", "\xE3\x82\xAF", - "\xE3\x82\xB1", "\xE3\x82\xB3", - "\xE3\x82\xB5", "\xE3\x82\xB7", - "\xE3\x82\xB9", "\xE3\x82\xBB", - "\xE3\x82\xBD", "\xE3\x82\xBF", - "\xE3\x83\x81", "\xE3\x83\x84", - "\xE3\x83\x86", "\xE3\x83\x88", - "\xE3\x83\x8A", "\xE3\x83\x8B", - "\xE3\x83\x8C", "\xE3\x83\x8D", - "\xE3\x83\x8E", "\xE3\x83\x8F", - "\xE3\x83\x92", "\xE3\x83\x95", - "\xE3\x83\x98", "\xE3\x83\x9B", - "\xE3\x83\x9E", "\xE3\x83\x9F", - "\xE3\x83\xA0", "\xE3\x83\xA1", - "\xE3\x83\xA2", "\xE3\x83\xA4", - "\xE3\x83\xA6", "\xE3\x83\xA8", - "\xE3\x83\xA9", "\xE3\x83\xAA", - "\xE3\x83\xAB", "\xE3\x83\xAC", - "\xE3\x83\xAD", "\xE3\x83\xAF", - "\xE3\x83\xB0", "\xE3\x83\xB1", - "\xE3\x83\xB2", "\xE4\xBB\xA4\xE5\x92\x8C", -}; - -static const char *const decompCompatPage51[0x100] = { - "\xE3\x82\xA2\xE3\x83\x8F\xE3\x82\x9A\xE3\x83\xBC\xE3\x83\x88", "\xE3\x82\xA2\xE3\x83\xAB\xE3\x83\x95\xE3\x82\xA1", - "\xE3\x82\xA2\xE3\x83\xB3\xE3\x83\x98\xE3\x82\x9A\xE3\x82\xA2", "\xE3\x82\xA2\xE3\x83\xBC\xE3\x83\xAB", - "\xE3\x82\xA4\xE3\x83\x8B\xE3\x83\xB3\xE3\x82\xAF\xE3\x82\x99", "\xE3\x82\xA4\xE3\x83\xB3\xE3\x83\x81", - "\xE3\x82\xA6\xE3\x82\xA9\xE3\x83\xB3", "\xE3\x82\xA8\xE3\x82\xB9\xE3\x82\xAF\xE3\x83\xBC\xE3\x83\x88\xE3\x82\x99", - "\xE3\x82\xA8\xE3\x83\xBC\xE3\x82\xAB\xE3\x83\xBC", "\xE3\x82\xAA\xE3\x83\xB3\xE3\x82\xB9", - "\xE3\x82\xAA\xE3\x83\xBC\xE3\x83\xA0", "\xE3\x82\xAB\xE3\x82\xA4\xE3\x83\xAA", - "\xE3\x82\xAB\xE3\x83\xA9\xE3\x83\x83\xE3\x83\x88", "\xE3\x82\xAB\xE3\x83\xAD\xE3\x83\xAA\xE3\x83\xBC", - "\xE3\x82\xAB\xE3\x82\x99\xE3\x83\xAD\xE3\x83\xB3", "\xE3\x82\xAB\xE3\x82\x99\xE3\x83\xB3\xE3\x83\x9E", - "\xE3\x82\xAD\xE3\x82\x99\xE3\x82\xAB\xE3\x82\x99", "\xE3\x82\xAD\xE3\x82\x99\xE3\x83\x8B\xE3\x83\xBC", - "\xE3\x82\xAD\xE3\x83\xA5\xE3\x83\xAA\xE3\x83\xBC", "\xE3\x82\xAD\xE3\x82\x99\xE3\x83\xAB\xE3\x82\xBF\xE3\x82\x99\xE3\x83\xBC", - "\xE3\x82\xAD\xE3\x83\xAD", "\xE3\x82\xAD\xE3\x83\xAD\xE3\x82\xAF\xE3\x82\x99\xE3\x83\xA9\xE3\x83\xA0", - "\xE3\x82\xAD\xE3\x83\xAD\xE3\x83\xA1\xE3\x83\xBC\xE3\x83\x88\xE3\x83\xAB", "\xE3\x82\xAD\xE3\x83\xAD\xE3\x83\xAF\xE3\x83\x83\xE3\x83\x88", - "\xE3\x82\xAF\xE3\x82\x99\xE3\x83\xA9\xE3\x83\xA0", "\xE3\x82\xAF\xE3\x82\x99\xE3\x83\xA9\xE3\x83\xA0\xE3\x83\x88\xE3\x83\xB3", - "\xE3\x82\xAF\xE3\x83\xAB\xE3\x82\xBB\xE3\x82\x99\xE3\x82\xA4\xE3\x83\xAD", "\xE3\x82\xAF\xE3\x83\xAD\xE3\x83\xBC\xE3\x83\x8D", - "\xE3\x82\xB1\xE3\x83\xBC\xE3\x82\xB9", "\xE3\x82\xB3\xE3\x83\xAB\xE3\x83\x8A", - "\xE3\x82\xB3\xE3\x83\xBC\xE3\x83\x9B\xE3\x82\x9A", "\xE3\x82\xB5\xE3\x82\xA4\xE3\x82\xAF\xE3\x83\xAB", - "\xE3\x82\xB5\xE3\x83\xB3\xE3\x83\x81\xE3\x83\xBC\xE3\x83\xA0", "\xE3\x82\xB7\xE3\x83\xAA\xE3\x83\xB3\xE3\x82\xAF\xE3\x82\x99", - "\xE3\x82\xBB\xE3\x83\xB3\xE3\x83\x81", "\xE3\x82\xBB\xE3\x83\xB3\xE3\x83\x88", - "\xE3\x82\xBF\xE3\x82\x99\xE3\x83\xBC\xE3\x82\xB9", "\xE3\x83\x86\xE3\x82\x99\xE3\x82\xB7", - "\xE3\x83\x88\xE3\x82\x99\xE3\x83\xAB", "\xE3\x83\x88\xE3\x83\xB3", - "\xE3\x83\x8A\xE3\x83\x8E", "\xE3\x83\x8E\xE3\x83\x83\xE3\x83\x88", - "\xE3\x83\x8F\xE3\x82\xA4\xE3\x83\x84", "\xE3\x83\x8F\xE3\x82\x9A\xE3\x83\xBC\xE3\x82\xBB\xE3\x83\xB3\xE3\x83\x88", - "\xE3\x83\x8F\xE3\x82\x9A\xE3\x83\xBC\xE3\x83\x84", "\xE3\x83\x8F\xE3\x82\x99\xE3\x83\xBC\xE3\x83\xAC\xE3\x83\xAB", - "\xE3\x83\x92\xE3\x82\x9A\xE3\x82\xA2\xE3\x82\xB9\xE3\x83\x88\xE3\x83\xAB", "\xE3\x83\x92\xE3\x82\x9A\xE3\x82\xAF\xE3\x83\xAB", - "\xE3\x83\x92\xE3\x82\x9A\xE3\x82\xB3", "\xE3\x83\x92\xE3\x82\x99\xE3\x83\xAB", - "\xE3\x83\x95\xE3\x82\xA1\xE3\x83\xA9\xE3\x83\x83\xE3\x83\x88\xE3\x82\x99", "\xE3\x83\x95\xE3\x82\xA3\xE3\x83\xBC\xE3\x83\x88", - "\xE3\x83\x95\xE3\x82\x99\xE3\x83\x83\xE3\x82\xB7\xE3\x82\xA7\xE3\x83\xAB", "\xE3\x83\x95\xE3\x83\xA9\xE3\x83\xB3", - "\xE3\x83\x98\xE3\x82\xAF\xE3\x82\xBF\xE3\x83\xBC\xE3\x83\xAB", "\xE3\x83\x98\xE3\x82\x9A\xE3\x82\xBD", - "\xE3\x83\x98\xE3\x82\x9A\xE3\x83\x8B\xE3\x83\x92", "\xE3\x83\x98\xE3\x83\xAB\xE3\x83\x84", - "\xE3\x83\x98\xE3\x82\x9A\xE3\x83\xB3\xE3\x82\xB9", "\xE3\x83\x98\xE3\x82\x9A\xE3\x83\xBC\xE3\x82\xB7\xE3\x82\x99", - "\xE3\x83\x98\xE3\x82\x99\xE3\x83\xBC\xE3\x82\xBF", "\xE3\x83\x9B\xE3\x82\x9A\xE3\x82\xA4\xE3\x83\xB3\xE3\x83\x88", - "\xE3\x83\x9B\xE3\x82\x99\xE3\x83\xAB\xE3\x83\x88", "\xE3\x83\x9B\xE3\x83\xB3", - "\xE3\x83\x9B\xE3\x82\x9A\xE3\x83\xB3\xE3\x83\x88\xE3\x82\x99", "\xE3\x83\x9B\xE3\x83\xBC\xE3\x83\xAB", - "\xE3\x83\x9B\xE3\x83\xBC\xE3\x83\xB3", "\xE3\x83\x9E\xE3\x82\xA4\xE3\x82\xAF\xE3\x83\xAD", - "\xE3\x83\x9E\xE3\x82\xA4\xE3\x83\xAB", "\xE3\x83\x9E\xE3\x83\x83\xE3\x83\x8F", - "\xE3\x83\x9E\xE3\x83\xAB\xE3\x82\xAF", "\xE3\x83\x9E\xE3\x83\xB3\xE3\x82\xB7\xE3\x83\xA7\xE3\x83\xB3", - "\xE3\x83\x9F\xE3\x82\xAF\xE3\x83\xAD\xE3\x83\xB3", "\xE3\x83\x9F\xE3\x83\xAA", - "\xE3\x83\x9F\xE3\x83\xAA\xE3\x83\x8F\xE3\x82\x99\xE3\x83\xBC\xE3\x83\xAB", "\xE3\x83\xA1\xE3\x82\xAB\xE3\x82\x99", - "\xE3\x83\xA1\xE3\x82\xAB\xE3\x82\x99\xE3\x83\x88\xE3\x83\xB3", "\xE3\x83\xA1\xE3\x83\xBC\xE3\x83\x88\xE3\x83\xAB", - "\xE3\x83\xA4\xE3\x83\xBC\xE3\x83\x88\xE3\x82\x99", "\xE3\x83\xA4\xE3\x83\xBC\xE3\x83\xAB", - "\xE3\x83\xA6\xE3\x82\xA2\xE3\x83\xB3", "\xE3\x83\xAA\xE3\x83\x83\xE3\x83\x88\xE3\x83\xAB", - "\xE3\x83\xAA\xE3\x83\xA9", "\xE3\x83\xAB\xE3\x83\x92\xE3\x82\x9A\xE3\x83\xBC", - "\xE3\x83\xAB\xE3\x83\xBC\xE3\x83\x95\xE3\x82\x99\xE3\x83\xAB", "\xE3\x83\xAC\xE3\x83\xA0", - "\xE3\x83\xAC\xE3\x83\xB3\xE3\x83\x88\xE3\x82\xB1\xE3\x82\x99\xE3\x83\xB3", "\xE3\x83\xAF\xE3\x83\x83\xE3\x83\x88", - "\x30\xE7\x82\xB9", "\x31\xE7\x82\xB9", - "\x32\xE7\x82\xB9", "\x33\xE7\x82\xB9", - "\x34\xE7\x82\xB9", "\x35\xE7\x82\xB9", - "\x36\xE7\x82\xB9", "\x37\xE7\x82\xB9", - "\x38\xE7\x82\xB9", "\x39\xE7\x82\xB9", - "\x31\x30\xE7\x82\xB9", "\x31\x31\xE7\x82\xB9", - "\x31\x32\xE7\x82\xB9", "\x31\x33\xE7\x82\xB9", - "\x31\x34\xE7\x82\xB9", "\x31\x35\xE7\x82\xB9", - "\x31\x36\xE7\x82\xB9", "\x31\x37\xE7\x82\xB9", - "\x31\x38\xE7\x82\xB9", "\x31\x39\xE7\x82\xB9", - "\x32\x30\xE7\x82\xB9", "\x32\x31\xE7\x82\xB9", - "\x32\x32\xE7\x82\xB9", "\x32\x33\xE7\x82\xB9", - "\x32\x34\xE7\x82\xB9", "\x68\x50\x61", - "\x64\x61", "\x41\x55", - "\x62\x61\x72", "\x6F\x56", - "\x70\x63", "\x64\x6D", - "\x64\x6D\x32", "\x64\x6D\x33", - "\x49\x55", "\xE5\xB9\xB3\xE6\x88\x90", - "\xE6\x98\xAD\xE5\x92\x8C", "\xE5\xA4\xA7\xE6\xAD\xA3", - "\xE6\x98\x8E\xE6\xB2\xBB", "\xE6\xA0\xAA\xE5\xBC\x8F\xE4\xBC\x9A\xE7\xA4\xBE", - "\x70\x41", "\x6E\x41", - "\xCE\xBC\x41", "\x6D\x41", - "\x6B\x41", "\x4B\x42", - "\x4D\x42", "\x47\x42", - "\x63\x61\x6C", "\x6B\x63\x61\x6C", - "\x70\x46", "\x6E\x46", - "\xCE\xBC\x46", "\xCE\xBC\x67", - "\x6D\x67", "\x6B\x67", - "\x48\x7A", "\x6B\x48\x7A", - "\x4D\x48\x7A", "\x47\x48\x7A", - "\x54\x48\x7A", "\xCE\xBC\x6C", - "\x6D\x6C", "\x64\x6C", - "\x6B\x6C", "\x66\x6D", - "\x6E\x6D", "\xCE\xBC\x6D", - "\x6D\x6D", "\x63\x6D", - "\x6B\x6D", "\x6D\x6D\x32", - "\x63\x6D\x32", "\x6D\x32", - "\x6B\x6D\x32", "\x6D\x6D\x33", - "\x63\x6D\x33", "\x6D\x33", - "\x6B\x6D\x33", "\x6D\xE2\x88\x95\x73", - "\x6D\xE2\x88\x95\x73\x32", "\x50\x61", - "\x6B\x50\x61", "\x4D\x50\x61", - "\x47\x50\x61", "\x72\x61\x64", - "\x72\x61\x64\xE2\x88\x95\x73", "\x72\x61\x64\xE2\x88\x95\x73\x32", - "\x70\x73", "\x6E\x73", - "\xCE\xBC\x73", "\x6D\x73", - "\x70\x56", "\x6E\x56", - "\xCE\xBC\x56", "\x6D\x56", - "\x6B\x56", "\x4D\x56", - "\x70\x57", "\x6E\x57", - "\xCE\xBC\x57", "\x6D\x57", - "\x6B\x57", "\x4D\x57", - "\x6B\xCE\xA9", "\x4D\xCE\xA9", - "\x61\x2E\x6D\x2E", "\x42\x71", - "\x63\x63", "\x63\x64", - "\x43\xE2\x88\x95\x6B\x67", "\x43\x6F\x2E", - "\x64\x42", "\x47\x79", - "\x68\x61", "\x48\x50", - "\x69\x6E", "\x4B\x4B", - "\x4B\x4D", "\x6B\x74", - "\x6C\x6D", "\x6C\x6E", - "\x6C\x6F\x67", "\x6C\x78", - "\x6D\x62", "\x6D\x69\x6C", - "\x6D\x6F\x6C", "\x50\x48", - "\x70\x2E\x6D\x2E", "\x50\x50\x4D", - "\x50\x52", "\x73\x72", - "\x53\x76", "\x57\x62", - "\x56\xE2\x88\x95\x6D", "\x41\xE2\x88\x95\x6D", - "\x31\xE6\x97\xA5", "\x32\xE6\x97\xA5", - "\x33\xE6\x97\xA5", "\x34\xE6\x97\xA5", - "\x35\xE6\x97\xA5", "\x36\xE6\x97\xA5", - "\x37\xE6\x97\xA5", "\x38\xE6\x97\xA5", - "\x39\xE6\x97\xA5", "\x31\x30\xE6\x97\xA5", - "\x31\x31\xE6\x97\xA5", "\x31\x32\xE6\x97\xA5", - "\x31\x33\xE6\x97\xA5", "\x31\x34\xE6\x97\xA5", - "\x31\x35\xE6\x97\xA5", "\x31\x36\xE6\x97\xA5", - "\x31\x37\xE6\x97\xA5", "\x31\x38\xE6\x97\xA5", - "\x31\x39\xE6\x97\xA5", "\x32\x30\xE6\x97\xA5", - "\x32\x31\xE6\x97\xA5", "\x32\x32\xE6\x97\xA5", - "\x32\x33\xE6\x97\xA5", "\x32\x34\xE6\x97\xA5", - "\x32\x35\xE6\x97\xA5", "\x32\x36\xE6\x97\xA5", - "\x32\x37\xE6\x97\xA5", "\x32\x38\xE6\x97\xA5", - "\x32\x39\xE6\x97\xA5", "\x33\x30\xE6\x97\xA5", - "\x33\x31\xE6\x97\xA5", "\x67\x61\x6C", -}; - -static const char *const decompCompatPage166[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xD1\x8A", "\xD1\x8C", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage167[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xEA\x9D\xAF", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xC4\xA6", "\xC5\x93", - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage171[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xEA\x9C\xA7", "\xEA\xAC\xB7", - "\xC9\xAB", "\xEA\xAD\x92", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xCA\x8D", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage251[0x100] = { - "\x66\x66", "\x66\x69", - "\x66\x6C", "\x66\x66\x69", - "\x66\x66\x6C", "\x73\x74", - "\x73\x74", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xD5\xB4\xD5\xB6", - "\xD5\xB4\xD5\xA5", "\xD5\xB4\xD5\xAB", - "\xD5\xBE\xD5\xB6", "\xD5\xB4\xD5\xAD", - NULL, NULL, - NULL, NULL, - NULL, "\xD7\x99\xD6\xB4", - NULL, "\xD7\xB2\xD6\xB7", - "\xD7\xA2", "\xD7\x90", - "\xD7\x93", "\xD7\x94", - "\xD7\x9B", "\xD7\x9C", - "\xD7\x9D", "\xD7\xA8", - "\xD7\xAA", "\x2B", - "\xD7\xA9\xD7\x81", "\xD7\xA9\xD7\x82", - "\xD7\xA9\xD6\xBC\xD7\x81", "\xD7\xA9\xD6\xBC\xD7\x82", - "\xD7\x90\xD6\xB7", "\xD7\x90\xD6\xB8", - "\xD7\x90\xD6\xBC", "\xD7\x91\xD6\xBC", - "\xD7\x92\xD6\xBC", "\xD7\x93\xD6\xBC", - "\xD7\x94\xD6\xBC", "\xD7\x95\xD6\xBC", - "\xD7\x96\xD6\xBC", NULL, - "\xD7\x98\xD6\xBC", "\xD7\x99\xD6\xBC", - "\xD7\x9A\xD6\xBC", "\xD7\x9B\xD6\xBC", - "\xD7\x9C\xD6\xBC", NULL, - "\xD7\x9E\xD6\xBC", NULL, - "\xD7\xA0\xD6\xBC", "\xD7\xA1\xD6\xBC", - NULL, "\xD7\xA3\xD6\xBC", - "\xD7\xA4\xD6\xBC", NULL, - "\xD7\xA6\xD6\xBC", "\xD7\xA7\xD6\xBC", - "\xD7\xA8\xD6\xBC", "\xD7\xA9\xD6\xBC", - "\xD7\xAA\xD6\xBC", "\xD7\x95\xD6\xB9", - "\xD7\x91\xD6\xBF", "\xD7\x9B\xD6\xBF", - "\xD7\xA4\xD6\xBF", "\xD7\x90\xD7\x9C", - "\xD9\xB1", "\xD9\xB1", - "\xD9\xBB", "\xD9\xBB", - "\xD9\xBB", "\xD9\xBB", - "\xD9\xBE", "\xD9\xBE", - "\xD9\xBE", "\xD9\xBE", - "\xDA\x80", "\xDA\x80", - "\xDA\x80", "\xDA\x80", - "\xD9\xBA", "\xD9\xBA", - "\xD9\xBA", "\xD9\xBA", - "\xD9\xBF", "\xD9\xBF", - "\xD9\xBF", "\xD9\xBF", - "\xD9\xB9", "\xD9\xB9", - "\xD9\xB9", "\xD9\xB9", - "\xDA\xA4", "\xDA\xA4", - "\xDA\xA4", "\xDA\xA4", - "\xDA\xA6", "\xDA\xA6", - "\xDA\xA6", "\xDA\xA6", - "\xDA\x84", "\xDA\x84", - "\xDA\x84", "\xDA\x84", - "\xDA\x83", "\xDA\x83", - "\xDA\x83", "\xDA\x83", - "\xDA\x86", "\xDA\x86", - "\xDA\x86", "\xDA\x86", - "\xDA\x87", "\xDA\x87", - "\xDA\x87", "\xDA\x87", - "\xDA\x8D", "\xDA\x8D", - "\xDA\x8C", "\xDA\x8C", - "\xDA\x8E", "\xDA\x8E", - "\xDA\x88", "\xDA\x88", - "\xDA\x98", "\xDA\x98", - "\xDA\x91", "\xDA\x91", - "\xDA\xA9", "\xDA\xA9", - "\xDA\xA9", "\xDA\xA9", - "\xDA\xAF", "\xDA\xAF", - "\xDA\xAF", "\xDA\xAF", - "\xDA\xB3", "\xDA\xB3", - "\xDA\xB3", "\xDA\xB3", - "\xDA\xB1", "\xDA\xB1", - "\xDA\xB1", "\xDA\xB1", - "\xDA\xBA", "\xDA\xBA", - "\xDA\xBB", "\xDA\xBB", - "\xDA\xBB", "\xDA\xBB", - "\xDB\x95\xD9\x94", "\xDB\x95\xD9\x94", - "\xDB\x81", "\xDB\x81", - "\xDB\x81", "\xDB\x81", - "\xDA\xBE", "\xDA\xBE", - "\xDA\xBE", "\xDA\xBE", - "\xDB\x92", "\xDB\x92", - "\xDB\x92\xD9\x94", "\xDB\x92\xD9\x94", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xDA\xAD", - "\xDA\xAD", "\xDA\xAD", - "\xDA\xAD", "\xDB\x87", - "\xDB\x87", "\xDB\x86", - "\xDB\x86", "\xDB\x88", - "\xDB\x88", "\xDB\x87\xD9\xB4", - "\xDB\x8B", "\xDB\x8B", - "\xDB\x85", "\xDB\x85", - "\xDB\x89", "\xDB\x89", - "\xDB\x90", "\xDB\x90", - "\xDB\x90", "\xDB\x90", - "\xD9\x89", "\xD9\x89", - "\xD9\x8A\xD9\x94\xD8\xA7", "\xD9\x8A\xD9\x94\xD8\xA7", - "\xD9\x8A\xD9\x94\xDB\x95", "\xD9\x8A\xD9\x94\xDB\x95", - "\xD9\x8A\xD9\x94\xD9\x88", "\xD9\x8A\xD9\x94\xD9\x88", - "\xD9\x8A\xD9\x94\xDB\x87", "\xD9\x8A\xD9\x94\xDB\x87", - "\xD9\x8A\xD9\x94\xDB\x86", "\xD9\x8A\xD9\x94\xDB\x86", - "\xD9\x8A\xD9\x94\xDB\x88", "\xD9\x8A\xD9\x94\xDB\x88", - "\xD9\x8A\xD9\x94\xDB\x90", "\xD9\x8A\xD9\x94\xDB\x90", - "\xD9\x8A\xD9\x94\xDB\x90", "\xD9\x8A\xD9\x94\xD9\x89", - "\xD9\x8A\xD9\x94\xD9\x89", "\xD9\x8A\xD9\x94\xD9\x89", - "\xDB\x8C", "\xDB\x8C", - "\xDB\x8C", "\xDB\x8C", -}; - -static const char *const decompCompatPage252[0x100] = { - "\xD9\x8A\xD9\x94\xD8\xAC", "\xD9\x8A\xD9\x94\xD8\xAD", - "\xD9\x8A\xD9\x94\xD9\x85", "\xD9\x8A\xD9\x94\xD9\x89", - "\xD9\x8A\xD9\x94\xD9\x8A", "\xD8\xA8\xD8\xAC", - "\xD8\xA8\xD8\xAD", "\xD8\xA8\xD8\xAE", - "\xD8\xA8\xD9\x85", "\xD8\xA8\xD9\x89", - "\xD8\xA8\xD9\x8A", "\xD8\xAA\xD8\xAC", - "\xD8\xAA\xD8\xAD", "\xD8\xAA\xD8\xAE", - "\xD8\xAA\xD9\x85", "\xD8\xAA\xD9\x89", - "\xD8\xAA\xD9\x8A", "\xD8\xAB\xD8\xAC", - "\xD8\xAB\xD9\x85", "\xD8\xAB\xD9\x89", - "\xD8\xAB\xD9\x8A", "\xD8\xAC\xD8\xAD", - "\xD8\xAC\xD9\x85", "\xD8\xAD\xD8\xAC", - "\xD8\xAD\xD9\x85", "\xD8\xAE\xD8\xAC", - "\xD8\xAE\xD8\xAD", "\xD8\xAE\xD9\x85", - "\xD8\xB3\xD8\xAC", "\xD8\xB3\xD8\xAD", - "\xD8\xB3\xD8\xAE", "\xD8\xB3\xD9\x85", - "\xD8\xB5\xD8\xAD", "\xD8\xB5\xD9\x85", - "\xD8\xB6\xD8\xAC", "\xD8\xB6\xD8\xAD", - "\xD8\xB6\xD8\xAE", "\xD8\xB6\xD9\x85", - "\xD8\xB7\xD8\xAD", "\xD8\xB7\xD9\x85", - "\xD8\xB8\xD9\x85", "\xD8\xB9\xD8\xAC", - "\xD8\xB9\xD9\x85", "\xD8\xBA\xD8\xAC", - "\xD8\xBA\xD9\x85", "\xD9\x81\xD8\xAC", - "\xD9\x81\xD8\xAD", "\xD9\x81\xD8\xAE", - "\xD9\x81\xD9\x85", "\xD9\x81\xD9\x89", - "\xD9\x81\xD9\x8A", "\xD9\x82\xD8\xAD", - "\xD9\x82\xD9\x85", "\xD9\x82\xD9\x89", - "\xD9\x82\xD9\x8A", "\xD9\x83\xD8\xA7", - "\xD9\x83\xD8\xAC", "\xD9\x83\xD8\xAD", - "\xD9\x83\xD8\xAE", "\xD9\x83\xD9\x84", - "\xD9\x83\xD9\x85", "\xD9\x83\xD9\x89", - "\xD9\x83\xD9\x8A", "\xD9\x84\xD8\xAC", - "\xD9\x84\xD8\xAD", "\xD9\x84\xD8\xAE", - "\xD9\x84\xD9\x85", "\xD9\x84\xD9\x89", - "\xD9\x84\xD9\x8A", "\xD9\x85\xD8\xAC", - "\xD9\x85\xD8\xAD", "\xD9\x85\xD8\xAE", - "\xD9\x85\xD9\x85", "\xD9\x85\xD9\x89", - "\xD9\x85\xD9\x8A", "\xD9\x86\xD8\xAC", - "\xD9\x86\xD8\xAD", "\xD9\x86\xD8\xAE", - "\xD9\x86\xD9\x85", "\xD9\x86\xD9\x89", - "\xD9\x86\xD9\x8A", "\xD9\x87\xD8\xAC", - "\xD9\x87\xD9\x85", "\xD9\x87\xD9\x89", - "\xD9\x87\xD9\x8A", "\xD9\x8A\xD8\xAC", - "\xD9\x8A\xD8\xAD", "\xD9\x8A\xD8\xAE", - "\xD9\x8A\xD9\x85", "\xD9\x8A\xD9\x89", - "\xD9\x8A\xD9\x8A", "\xD8\xB0\xD9\xB0", - "\xD8\xB1\xD9\xB0", "\xD9\x89\xD9\xB0", - "\x20\xD9\x8C\xD9\x91", "\x20\xD9\x8D\xD9\x91", - "\x20\xD9\x8E\xD9\x91", "\x20\xD9\x8F\xD9\x91", - "\x20\xD9\x90\xD9\x91", "\x20\xD9\x91\xD9\xB0", - "\xD9\x8A\xD9\x94\xD8\xB1", "\xD9\x8A\xD9\x94\xD8\xB2", - "\xD9\x8A\xD9\x94\xD9\x85", "\xD9\x8A\xD9\x94\xD9\x86", - "\xD9\x8A\xD9\x94\xD9\x89", "\xD9\x8A\xD9\x94\xD9\x8A", - "\xD8\xA8\xD8\xB1", "\xD8\xA8\xD8\xB2", - "\xD8\xA8\xD9\x85", "\xD8\xA8\xD9\x86", - "\xD8\xA8\xD9\x89", "\xD8\xA8\xD9\x8A", - "\xD8\xAA\xD8\xB1", "\xD8\xAA\xD8\xB2", - "\xD8\xAA\xD9\x85", "\xD8\xAA\xD9\x86", - "\xD8\xAA\xD9\x89", "\xD8\xAA\xD9\x8A", - "\xD8\xAB\xD8\xB1", "\xD8\xAB\xD8\xB2", - "\xD8\xAB\xD9\x85", "\xD8\xAB\xD9\x86", - "\xD8\xAB\xD9\x89", "\xD8\xAB\xD9\x8A", - "\xD9\x81\xD9\x89", "\xD9\x81\xD9\x8A", - "\xD9\x82\xD9\x89", "\xD9\x82\xD9\x8A", - "\xD9\x83\xD8\xA7", "\xD9\x83\xD9\x84", - "\xD9\x83\xD9\x85", "\xD9\x83\xD9\x89", - "\xD9\x83\xD9\x8A", "\xD9\x84\xD9\x85", - "\xD9\x84\xD9\x89", "\xD9\x84\xD9\x8A", - "\xD9\x85\xD8\xA7", "\xD9\x85\xD9\x85", - "\xD9\x86\xD8\xB1", "\xD9\x86\xD8\xB2", - "\xD9\x86\xD9\x85", "\xD9\x86\xD9\x86", - "\xD9\x86\xD9\x89", "\xD9\x86\xD9\x8A", - "\xD9\x89\xD9\xB0", "\xD9\x8A\xD8\xB1", - "\xD9\x8A\xD8\xB2", "\xD9\x8A\xD9\x85", - "\xD9\x8A\xD9\x86", "\xD9\x8A\xD9\x89", - "\xD9\x8A\xD9\x8A", "\xD9\x8A\xD9\x94\xD8\xAC", - "\xD9\x8A\xD9\x94\xD8\xAD", "\xD9\x8A\xD9\x94\xD8\xAE", - "\xD9\x8A\xD9\x94\xD9\x85", "\xD9\x8A\xD9\x94\xD9\x87", - "\xD8\xA8\xD8\xAC", "\xD8\xA8\xD8\xAD", - "\xD8\xA8\xD8\xAE", "\xD8\xA8\xD9\x85", - "\xD8\xA8\xD9\x87", "\xD8\xAA\xD8\xAC", - "\xD8\xAA\xD8\xAD", "\xD8\xAA\xD8\xAE", - "\xD8\xAA\xD9\x85", "\xD8\xAA\xD9\x87", - "\xD8\xAB\xD9\x85", "\xD8\xAC\xD8\xAD", - "\xD8\xAC\xD9\x85", "\xD8\xAD\xD8\xAC", - "\xD8\xAD\xD9\x85", "\xD8\xAE\xD8\xAC", - "\xD8\xAE\xD9\x85", "\xD8\xB3\xD8\xAC", - "\xD8\xB3\xD8\xAD", "\xD8\xB3\xD8\xAE", - "\xD8\xB3\xD9\x85", "\xD8\xB5\xD8\xAD", - "\xD8\xB5\xD8\xAE", "\xD8\xB5\xD9\x85", - "\xD8\xB6\xD8\xAC", "\xD8\xB6\xD8\xAD", - "\xD8\xB6\xD8\xAE", "\xD8\xB6\xD9\x85", - "\xD8\xB7\xD8\xAD", "\xD8\xB8\xD9\x85", - "\xD8\xB9\xD8\xAC", "\xD8\xB9\xD9\x85", - "\xD8\xBA\xD8\xAC", "\xD8\xBA\xD9\x85", - "\xD9\x81\xD8\xAC", "\xD9\x81\xD8\xAD", - "\xD9\x81\xD8\xAE", "\xD9\x81\xD9\x85", - "\xD9\x82\xD8\xAD", "\xD9\x82\xD9\x85", - "\xD9\x83\xD8\xAC", "\xD9\x83\xD8\xAD", - "\xD9\x83\xD8\xAE", "\xD9\x83\xD9\x84", - "\xD9\x83\xD9\x85", "\xD9\x84\xD8\xAC", - "\xD9\x84\xD8\xAD", "\xD9\x84\xD8\xAE", - "\xD9\x84\xD9\x85", "\xD9\x84\xD9\x87", - "\xD9\x85\xD8\xAC", "\xD9\x85\xD8\xAD", - "\xD9\x85\xD8\xAE", "\xD9\x85\xD9\x85", - "\xD9\x86\xD8\xAC", "\xD9\x86\xD8\xAD", - "\xD9\x86\xD8\xAE", "\xD9\x86\xD9\x85", - "\xD9\x86\xD9\x87", "\xD9\x87\xD8\xAC", - "\xD9\x87\xD9\x85", "\xD9\x87\xD9\xB0", - "\xD9\x8A\xD8\xAC", "\xD9\x8A\xD8\xAD", - "\xD9\x8A\xD8\xAE", "\xD9\x8A\xD9\x85", - "\xD9\x8A\xD9\x87", "\xD9\x8A\xD9\x94\xD9\x85", - "\xD9\x8A\xD9\x94\xD9\x87", "\xD8\xA8\xD9\x85", - "\xD8\xA8\xD9\x87", "\xD8\xAA\xD9\x85", - "\xD8\xAA\xD9\x87", "\xD8\xAB\xD9\x85", - "\xD8\xAB\xD9\x87", "\xD8\xB3\xD9\x85", - "\xD8\xB3\xD9\x87", "\xD8\xB4\xD9\x85", - "\xD8\xB4\xD9\x87", "\xD9\x83\xD9\x84", - "\xD9\x83\xD9\x85", "\xD9\x84\xD9\x85", - "\xD9\x86\xD9\x85", "\xD9\x86\xD9\x87", - "\xD9\x8A\xD9\x85", "\xD9\x8A\xD9\x87", - "\xD9\x80\xD9\x8E\xD9\x91", "\xD9\x80\xD9\x8F\xD9\x91", - "\xD9\x80\xD9\x90\xD9\x91", "\xD8\xB7\xD9\x89", - "\xD8\xB7\xD9\x8A", "\xD8\xB9\xD9\x89", - "\xD8\xB9\xD9\x8A", "\xD8\xBA\xD9\x89", - "\xD8\xBA\xD9\x8A", "\xD8\xB3\xD9\x89", - "\xD8\xB3\xD9\x8A", "\xD8\xB4\xD9\x89", - "\xD8\xB4\xD9\x8A", "\xD8\xAD\xD9\x89", -}; - -static const char *const decompCompatPage253[0x100] = { - "\xD8\xAD\xD9\x8A", "\xD8\xAC\xD9\x89", - "\xD8\xAC\xD9\x8A", "\xD8\xAE\xD9\x89", - "\xD8\xAE\xD9\x8A", "\xD8\xB5\xD9\x89", - "\xD8\xB5\xD9\x8A", "\xD8\xB6\xD9\x89", - "\xD8\xB6\xD9\x8A", "\xD8\xB4\xD8\xAC", - "\xD8\xB4\xD8\xAD", "\xD8\xB4\xD8\xAE", - "\xD8\xB4\xD9\x85", "\xD8\xB4\xD8\xB1", - "\xD8\xB3\xD8\xB1", "\xD8\xB5\xD8\xB1", - "\xD8\xB6\xD8\xB1", "\xD8\xB7\xD9\x89", - "\xD8\xB7\xD9\x8A", "\xD8\xB9\xD9\x89", - "\xD8\xB9\xD9\x8A", "\xD8\xBA\xD9\x89", - "\xD8\xBA\xD9\x8A", "\xD8\xB3\xD9\x89", - "\xD8\xB3\xD9\x8A", "\xD8\xB4\xD9\x89", - "\xD8\xB4\xD9\x8A", "\xD8\xAD\xD9\x89", - "\xD8\xAD\xD9\x8A", "\xD8\xAC\xD9\x89", - "\xD8\xAC\xD9\x8A", "\xD8\xAE\xD9\x89", - "\xD8\xAE\xD9\x8A", "\xD8\xB5\xD9\x89", - "\xD8\xB5\xD9\x8A", "\xD8\xB6\xD9\x89", - "\xD8\xB6\xD9\x8A", "\xD8\xB4\xD8\xAC", - "\xD8\xB4\xD8\xAD", "\xD8\xB4\xD8\xAE", - "\xD8\xB4\xD9\x85", "\xD8\xB4\xD8\xB1", - "\xD8\xB3\xD8\xB1", "\xD8\xB5\xD8\xB1", - "\xD8\xB6\xD8\xB1", "\xD8\xB4\xD8\xAC", - "\xD8\xB4\xD8\xAD", "\xD8\xB4\xD8\xAE", - "\xD8\xB4\xD9\x85", "\xD8\xB3\xD9\x87", - "\xD8\xB4\xD9\x87", "\xD8\xB7\xD9\x85", - "\xD8\xB3\xD8\xAC", "\xD8\xB3\xD8\xAD", - "\xD8\xB3\xD8\xAE", "\xD8\xB4\xD8\xAC", - "\xD8\xB4\xD8\xAD", "\xD8\xB4\xD8\xAE", - "\xD8\xB7\xD9\x85", "\xD8\xB8\xD9\x85", - "\xD8\xA7\xD9\x8B", "\xD8\xA7\xD9\x8B", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xD8\xAA\xD8\xAC\xD9\x85", "\xD8\xAA\xD8\xAD\xD8\xAC", - "\xD8\xAA\xD8\xAD\xD8\xAC", "\xD8\xAA\xD8\xAD\xD9\x85", - "\xD8\xAA\xD8\xAE\xD9\x85", "\xD8\xAA\xD9\x85\xD8\xAC", - "\xD8\xAA\xD9\x85\xD8\xAD", "\xD8\xAA\xD9\x85\xD8\xAE", - "\xD8\xAC\xD9\x85\xD8\xAD", "\xD8\xAC\xD9\x85\xD8\xAD", - "\xD8\xAD\xD9\x85\xD9\x8A", "\xD8\xAD\xD9\x85\xD9\x89", - "\xD8\xB3\xD8\xAD\xD8\xAC", "\xD8\xB3\xD8\xAC\xD8\xAD", - "\xD8\xB3\xD8\xAC\xD9\x89", "\xD8\xB3\xD9\x85\xD8\xAD", - "\xD8\xB3\xD9\x85\xD8\xAD", "\xD8\xB3\xD9\x85\xD8\xAC", - "\xD8\xB3\xD9\x85\xD9\x85", "\xD8\xB3\xD9\x85\xD9\x85", - "\xD8\xB5\xD8\xAD\xD8\xAD", "\xD8\xB5\xD8\xAD\xD8\xAD", - "\xD8\xB5\xD9\x85\xD9\x85", "\xD8\xB4\xD8\xAD\xD9\x85", - "\xD8\xB4\xD8\xAD\xD9\x85", "\xD8\xB4\xD8\xAC\xD9\x8A", - "\xD8\xB4\xD9\x85\xD8\xAE", "\xD8\xB4\xD9\x85\xD8\xAE", - "\xD8\xB4\xD9\x85\xD9\x85", "\xD8\xB4\xD9\x85\xD9\x85", - "\xD8\xB6\xD8\xAD\xD9\x89", "\xD8\xB6\xD8\xAE\xD9\x85", - "\xD8\xB6\xD8\xAE\xD9\x85", "\xD8\xB7\xD9\x85\xD8\xAD", - "\xD8\xB7\xD9\x85\xD8\xAD", "\xD8\xB7\xD9\x85\xD9\x85", - "\xD8\xB7\xD9\x85\xD9\x8A", "\xD8\xB9\xD8\xAC\xD9\x85", - "\xD8\xB9\xD9\x85\xD9\x85", "\xD8\xB9\xD9\x85\xD9\x85", - "\xD8\xB9\xD9\x85\xD9\x89", "\xD8\xBA\xD9\x85\xD9\x85", - "\xD8\xBA\xD9\x85\xD9\x8A", "\xD8\xBA\xD9\x85\xD9\x89", - "\xD9\x81\xD8\xAE\xD9\x85", "\xD9\x81\xD8\xAE\xD9\x85", - "\xD9\x82\xD9\x85\xD8\xAD", "\xD9\x82\xD9\x85\xD9\x85", - "\xD9\x84\xD8\xAD\xD9\x85", "\xD9\x84\xD8\xAD\xD9\x8A", - "\xD9\x84\xD8\xAD\xD9\x89", "\xD9\x84\xD8\xAC\xD8\xAC", - "\xD9\x84\xD8\xAC\xD8\xAC", "\xD9\x84\xD8\xAE\xD9\x85", - "\xD9\x84\xD8\xAE\xD9\x85", "\xD9\x84\xD9\x85\xD8\xAD", - "\xD9\x84\xD9\x85\xD8\xAD", "\xD9\x85\xD8\xAD\xD8\xAC", - "\xD9\x85\xD8\xAD\xD9\x85", "\xD9\x85\xD8\xAD\xD9\x8A", - "\xD9\x85\xD8\xAC\xD8\xAD", "\xD9\x85\xD8\xAC\xD9\x85", - "\xD9\x85\xD8\xAE\xD8\xAC", "\xD9\x85\xD8\xAE\xD9\x85", - NULL, NULL, - "\xD9\x85\xD8\xAC\xD8\xAE", "\xD9\x87\xD9\x85\xD8\xAC", - "\xD9\x87\xD9\x85\xD9\x85", "\xD9\x86\xD8\xAD\xD9\x85", - "\xD9\x86\xD8\xAD\xD9\x89", "\xD9\x86\xD8\xAC\xD9\x85", - "\xD9\x86\xD8\xAC\xD9\x85", "\xD9\x86\xD8\xAC\xD9\x89", - "\xD9\x86\xD9\x85\xD9\x8A", "\xD9\x86\xD9\x85\xD9\x89", - "\xD9\x8A\xD9\x85\xD9\x85", "\xD9\x8A\xD9\x85\xD9\x85", - "\xD8\xA8\xD8\xAE\xD9\x8A", "\xD8\xAA\xD8\xAC\xD9\x8A", - "\xD8\xAA\xD8\xAC\xD9\x89", "\xD8\xAA\xD8\xAE\xD9\x8A", - "\xD8\xAA\xD8\xAE\xD9\x89", "\xD8\xAA\xD9\x85\xD9\x8A", - "\xD8\xAA\xD9\x85\xD9\x89", "\xD8\xAC\xD9\x85\xD9\x8A", - "\xD8\xAC\xD8\xAD\xD9\x89", "\xD8\xAC\xD9\x85\xD9\x89", - "\xD8\xB3\xD8\xAE\xD9\x89", "\xD8\xB5\xD8\xAD\xD9\x8A", - "\xD8\xB4\xD8\xAD\xD9\x8A", "\xD8\xB6\xD8\xAD\xD9\x8A", - "\xD9\x84\xD8\xAC\xD9\x8A", "\xD9\x84\xD9\x85\xD9\x8A", - "\xD9\x8A\xD8\xAD\xD9\x8A", "\xD9\x8A\xD8\xAC\xD9\x8A", - "\xD9\x8A\xD9\x85\xD9\x8A", "\xD9\x85\xD9\x85\xD9\x8A", - "\xD9\x82\xD9\x85\xD9\x8A", "\xD9\x86\xD8\xAD\xD9\x8A", - "\xD9\x82\xD9\x85\xD8\xAD", "\xD9\x84\xD8\xAD\xD9\x85", - "\xD8\xB9\xD9\x85\xD9\x8A", "\xD9\x83\xD9\x85\xD9\x8A", - "\xD9\x86\xD8\xAC\xD8\xAD", "\xD9\x85\xD8\xAE\xD9\x8A", - "\xD9\x84\xD8\xAC\xD9\x85", "\xD9\x83\xD9\x85\xD9\x85", - "\xD9\x84\xD8\xAC\xD9\x85", "\xD9\x86\xD8\xAC\xD8\xAD", - "\xD8\xAC\xD8\xAD\xD9\x8A", "\xD8\xAD\xD8\xAC\xD9\x8A", - "\xD9\x85\xD8\xAC\xD9\x8A", "\xD9\x81\xD9\x85\xD9\x8A", - "\xD8\xA8\xD8\xAD\xD9\x8A", "\xD9\x83\xD9\x85\xD9\x85", - "\xD8\xB9\xD8\xAC\xD9\x85", "\xD8\xB5\xD9\x85\xD9\x85", - "\xD8\xB3\xD8\xAE\xD9\x8A", "\xD9\x86\xD8\xAC\xD9\x8A", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xD8\xB5\xD9\x84\xDB\x92", "\xD9\x82\xD9\x84\xDB\x92", - "\xD8\xA7\xD9\x84\xD9\x84\xD9\x87", "\xD8\xA7\xD9\x83\xD8\xA8\xD8\xB1", - "\xD9\x85\xD8\xAD\xD9\x85\xD8\xAF", "\xD8\xB5\xD9\x84\xD8\xB9\xD9\x85", - "\xD8\xB1\xD8\xB3\xD9\x88\xD9\x84", "\xD8\xB9\xD9\x84\xD9\x8A\xD9\x87", - "\xD9\x88\xD8\xB3\xD9\x84\xD9\x85", "\xD8\xB5\xD9\x84\xD9\x89", - "\xD8\xB5\xD9\x84\xD9\x89\x20\xD8\xA7\xD9\x84\xD9\x84\xD9\x87\x20\xD8\xB9\xD9\x84\xD9\x8A\xD9\x87\x20\xD9\x88\xD8\xB3\xD9\x84\xD9\x85", "\xD8\xAC\xD9\x84\x20\xD8\xAC\xD9\x84\xD8\xA7\xD9\x84\xD9\x87", - "\xD8\xB1\xDB\x8C\xD8\xA7\xD9\x84", NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage254[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x2C", "\xE3\x80\x81", - "\xE3\x80\x82", "\x3A", - "\x3B", "\x21", - "\x3F", "\xE3\x80\x96", - "\xE3\x80\x97", "\x2E\x2E\x2E", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x2E\x2E", "\xE2\x80\x94", - "\xE2\x80\x93", "\x5F", - "\x5F", "\x28", - "\x29", "\x7B", - "\x7D", "\xE3\x80\x94", - "\xE3\x80\x95", "\xE3\x80\x90", - "\xE3\x80\x91", "\xE3\x80\x8A", - "\xE3\x80\x8B", "\xE3\x80\x88", - "\xE3\x80\x89", "\xE3\x80\x8C", - "\xE3\x80\x8D", "\xE3\x80\x8E", - "\xE3\x80\x8F", NULL, - NULL, "\x5B", - "\x5D", "\x20\xCC\x85", - "\x20\xCC\x85", "\x20\xCC\x85", - "\x20\xCC\x85", "\x5F", - "\x5F", "\x5F", - "\x2C", "\xE3\x80\x81", - "\x2E", NULL, - "\x3B", "\x3A", - "\x3F", "\x21", - "\xE2\x80\x94", "\x28", - "\x29", "\x7B", - "\x7D", "\xE3\x80\x94", - "\xE3\x80\x95", "\x23", - "\x26", "\x2A", - "\x2B", "\x2D", - "\x3C", "\x3E", - "\x3D", NULL, - "\x5C", "\x24", - "\x25", "\x40", - NULL, NULL, - NULL, NULL, - "\x20\xD9\x8B", "\xD9\x80\xD9\x8B", - "\x20\xD9\x8C", NULL, - "\x20\xD9\x8D", NULL, - "\x20\xD9\x8E", "\xD9\x80\xD9\x8E", - "\x20\xD9\x8F", "\xD9\x80\xD9\x8F", - "\x20\xD9\x90", "\xD9\x80\xD9\x90", - "\x20\xD9\x91", "\xD9\x80\xD9\x91", - "\x20\xD9\x92", "\xD9\x80\xD9\x92", - "\xD8\xA1", "\xD8\xA7\xD9\x93", - "\xD8\xA7\xD9\x93", "\xD8\xA7\xD9\x94", - "\xD8\xA7\xD9\x94", "\xD9\x88\xD9\x94", - "\xD9\x88\xD9\x94", "\xD8\xA7\xD9\x95", - "\xD8\xA7\xD9\x95", "\xD9\x8A\xD9\x94", - "\xD9\x8A\xD9\x94", "\xD9\x8A\xD9\x94", - "\xD9\x8A\xD9\x94", "\xD8\xA7", - "\xD8\xA7", "\xD8\xA8", - "\xD8\xA8", "\xD8\xA8", - "\xD8\xA8", "\xD8\xA9", - "\xD8\xA9", "\xD8\xAA", - "\xD8\xAA", "\xD8\xAA", - "\xD8\xAA", "\xD8\xAB", - "\xD8\xAB", "\xD8\xAB", - "\xD8\xAB", "\xD8\xAC", - "\xD8\xAC", "\xD8\xAC", - "\xD8\xAC", "\xD8\xAD", - "\xD8\xAD", "\xD8\xAD", - "\xD8\xAD", "\xD8\xAE", - "\xD8\xAE", "\xD8\xAE", - "\xD8\xAE", "\xD8\xAF", - "\xD8\xAF", "\xD8\xB0", - "\xD8\xB0", "\xD8\xB1", - "\xD8\xB1", "\xD8\xB2", - "\xD8\xB2", "\xD8\xB3", - "\xD8\xB3", "\xD8\xB3", - "\xD8\xB3", "\xD8\xB4", - "\xD8\xB4", "\xD8\xB4", - "\xD8\xB4", "\xD8\xB5", - "\xD8\xB5", "\xD8\xB5", - "\xD8\xB5", "\xD8\xB6", - "\xD8\xB6", "\xD8\xB6", - "\xD8\xB6", "\xD8\xB7", - "\xD8\xB7", "\xD8\xB7", - "\xD8\xB7", "\xD8\xB8", - "\xD8\xB8", "\xD8\xB8", - "\xD8\xB8", "\xD8\xB9", - "\xD8\xB9", "\xD8\xB9", - "\xD8\xB9", "\xD8\xBA", - "\xD8\xBA", "\xD8\xBA", - "\xD8\xBA", "\xD9\x81", - "\xD9\x81", "\xD9\x81", - "\xD9\x81", "\xD9\x82", - "\xD9\x82", "\xD9\x82", - "\xD9\x82", "\xD9\x83", - "\xD9\x83", "\xD9\x83", - "\xD9\x83", "\xD9\x84", - "\xD9\x84", "\xD9\x84", - "\xD9\x84", "\xD9\x85", - "\xD9\x85", "\xD9\x85", - "\xD9\x85", "\xD9\x86", - "\xD9\x86", "\xD9\x86", - "\xD9\x86", "\xD9\x87", - "\xD9\x87", "\xD9\x87", - "\xD9\x87", "\xD9\x88", - "\xD9\x88", "\xD9\x89", - "\xD9\x89", "\xD9\x8A", - "\xD9\x8A", "\xD9\x8A", - "\xD9\x8A", "\xD9\x84\xD8\xA7\xD9\x93", - "\xD9\x84\xD8\xA7\xD9\x93", "\xD9\x84\xD8\xA7\xD9\x94", - "\xD9\x84\xD8\xA7\xD9\x94", "\xD9\x84\xD8\xA7\xD9\x95", - "\xD9\x84\xD8\xA7\xD9\x95", "\xD9\x84\xD8\xA7", - "\xD9\x84\xD8\xA7", NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage255[0x100] = { - NULL, "\x21", - "\x22", "\x23", - "\x24", "\x25", - "\x26", "\x27", - "\x28", "\x29", - "\x2A", "\x2B", - "\x2C", "\x2D", - "\x2E", "\x2F", - "\x30", "\x31", - "\x32", "\x33", - "\x34", "\x35", - "\x36", "\x37", - "\x38", "\x39", - "\x3A", "\x3B", - "\x3C", "\x3D", - "\x3E", "\x3F", - "\x40", "\x41", - "\x42", "\x43", - "\x44", "\x45", - "\x46", "\x47", - "\x48", "\x49", - "\x4A", "\x4B", - "\x4C", "\x4D", - "\x4E", "\x4F", - "\x50", "\x51", - "\x52", "\x53", - "\x54", "\x55", - "\x56", "\x57", - "\x58", "\x59", - "\x5A", "\x5B", - "\x5C", "\x5D", - "\x5E", "\x5F", - "\x60", "\x61", - "\x62", "\x63", - "\x64", "\x65", - "\x66", "\x67", - "\x68", "\x69", - "\x6A", "\x6B", - "\x6C", "\x6D", - "\x6E", "\x6F", - "\x70", "\x71", - "\x72", "\x73", - "\x74", "\x75", - "\x76", "\x77", - "\x78", "\x79", - "\x7A", "\x7B", - "\x7C", "\x7D", - "\x7E", "\xE2\xA6\x85", - "\xE2\xA6\x86", "\xE3\x80\x82", - "\xE3\x80\x8C", "\xE3\x80\x8D", - "\xE3\x80\x81", "\xE3\x83\xBB", - "\xE3\x83\xB2", "\xE3\x82\xA1", - "\xE3\x82\xA3", "\xE3\x82\xA5", - "\xE3\x82\xA7", "\xE3\x82\xA9", - "\xE3\x83\xA3", "\xE3\x83\xA5", - "\xE3\x83\xA7", "\xE3\x83\x83", - "\xE3\x83\xBC", "\xE3\x82\xA2", - "\xE3\x82\xA4", "\xE3\x82\xA6", - "\xE3\x82\xA8", "\xE3\x82\xAA", - "\xE3\x82\xAB", "\xE3\x82\xAD", - "\xE3\x82\xAF", "\xE3\x82\xB1", - "\xE3\x82\xB3", "\xE3\x82\xB5", - "\xE3\x82\xB7", "\xE3\x82\xB9", - "\xE3\x82\xBB", "\xE3\x82\xBD", - "\xE3\x82\xBF", "\xE3\x83\x81", - "\xE3\x83\x84", "\xE3\x83\x86", - "\xE3\x83\x88", "\xE3\x83\x8A", - "\xE3\x83\x8B", "\xE3\x83\x8C", - "\xE3\x83\x8D", "\xE3\x83\x8E", - "\xE3\x83\x8F", "\xE3\x83\x92", - "\xE3\x83\x95", "\xE3\x83\x98", - "\xE3\x83\x9B", "\xE3\x83\x9E", - "\xE3\x83\x9F", "\xE3\x83\xA0", - "\xE3\x83\xA1", "\xE3\x83\xA2", - "\xE3\x83\xA4", "\xE3\x83\xA6", - "\xE3\x83\xA8", "\xE3\x83\xA9", - "\xE3\x83\xAA", "\xE3\x83\xAB", - "\xE3\x83\xAC", "\xE3\x83\xAD", - "\xE3\x83\xAF", "\xE3\x83\xB3", - "\xE3\x82\x99", "\xE3\x82\x9A", - "\xE1\x85\xA0", "\xE1\x84\x80", - "\xE1\x84\x81", "\xE1\x86\xAA", - "\xE1\x84\x82", "\xE1\x86\xAC", - "\xE1\x86\xAD", "\xE1\x84\x83", - "\xE1\x84\x84", "\xE1\x84\x85", - "\xE1\x86\xB0", "\xE1\x86\xB1", - "\xE1\x86\xB2", "\xE1\x86\xB3", - "\xE1\x86\xB4", "\xE1\x86\xB5", - "\xE1\x84\x9A", "\xE1\x84\x86", - "\xE1\x84\x87", "\xE1\x84\x88", - "\xE1\x84\xA1", "\xE1\x84\x89", - "\xE1\x84\x8A", "\xE1\x84\x8B", - "\xE1\x84\x8C", "\xE1\x84\x8D", - "\xE1\x84\x8E", "\xE1\x84\x8F", - "\xE1\x84\x90", "\xE1\x84\x91", - "\xE1\x84\x92", NULL, - NULL, NULL, - "\xE1\x85\xA1", "\xE1\x85\xA2", - "\xE1\x85\xA3", "\xE1\x85\xA4", - "\xE1\x85\xA5", "\xE1\x85\xA6", - NULL, NULL, - "\xE1\x85\xA7", "\xE1\x85\xA8", - "\xE1\x85\xA9", "\xE1\x85\xAA", - "\xE1\x85\xAB", "\xE1\x85\xAC", - NULL, NULL, - "\xE1\x85\xAD", "\xE1\x85\xAE", - "\xE1\x85\xAF", "\xE1\x85\xB0", - "\xE1\x85\xB1", "\xE1\x85\xB2", - NULL, NULL, - "\xE1\x85\xB3", "\xE1\x85\xB4", - "\xE1\x85\xB5", NULL, - NULL, NULL, - "\xC2\xA2", "\xC2\xA3", - "\xC2\xAC", "\x20\xCC\x84", - "\xC2\xA6", "\xC2\xA5", - "\xE2\x82\xA9", NULL, - "\xE2\x94\x82", "\xE2\x86\x90", - "\xE2\x86\x91", "\xE2\x86\x92", - "\xE2\x86\x93", "\xE2\x96\xA0", - "\xE2\x97\x8B", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage465[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xF0\x9D\x85\x97\xF0\x9D\x85\xA5", "\xF0\x9D\x85\x98\xF0\x9D\x85\xA5", - "\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\xF0\x9D\x85\xAE", "\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\xF0\x9D\x85\xAF", - "\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\xF0\x9D\x85\xB0", "\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\xF0\x9D\x85\xB1", - "\xF0\x9D\x85\x98\xF0\x9D\x85\xA5\xF0\x9D\x85\xB2", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, "\xF0\x9D\x86\xB9\xF0\x9D\x85\xA5", - "\xF0\x9D\x86\xBA\xF0\x9D\x85\xA5", "\xF0\x9D\x86\xB9\xF0\x9D\x85\xA5\xF0\x9D\x85\xAE", - "\xF0\x9D\x86\xBA\xF0\x9D\x85\xA5\xF0\x9D\x85\xAE", "\xF0\x9D\x86\xB9\xF0\x9D\x85\xA5\xF0\x9D\x85\xAF", - "\xF0\x9D\x86\xBA\xF0\x9D\x85\xA5\xF0\x9D\x85\xAF", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage468[0x100] = { - "\x41", "\x42", - "\x43", "\x44", - "\x45", "\x46", - "\x47", "\x48", - "\x49", "\x4A", - "\x4B", "\x4C", - "\x4D", "\x4E", - "\x4F", "\x50", - "\x51", "\x52", - "\x53", "\x54", - "\x55", "\x56", - "\x57", "\x58", - "\x59", "\x5A", - "\x61", "\x62", - "\x63", "\x64", - "\x65", "\x66", - "\x67", "\x68", - "\x69", "\x6A", - "\x6B", "\x6C", - "\x6D", "\x6E", - "\x6F", "\x70", - "\x71", "\x72", - "\x73", "\x74", - "\x75", "\x76", - "\x77", "\x78", - "\x79", "\x7A", - "\x41", "\x42", - "\x43", "\x44", - "\x45", "\x46", - "\x47", "\x48", - "\x49", "\x4A", - "\x4B", "\x4C", - "\x4D", "\x4E", - "\x4F", "\x50", - "\x51", "\x52", - "\x53", "\x54", - "\x55", "\x56", - "\x57", "\x58", - "\x59", "\x5A", - "\x61", "\x62", - "\x63", "\x64", - "\x65", "\x66", - "\x67", NULL, - "\x69", "\x6A", - "\x6B", "\x6C", - "\x6D", "\x6E", - "\x6F", "\x70", - "\x71", "\x72", - "\x73", "\x74", - "\x75", "\x76", - "\x77", "\x78", - "\x79", "\x7A", - "\x41", "\x42", - "\x43", "\x44", - "\x45", "\x46", - "\x47", "\x48", - "\x49", "\x4A", - "\x4B", "\x4C", - "\x4D", "\x4E", - "\x4F", "\x50", - "\x51", "\x52", - "\x53", "\x54", - "\x55", "\x56", - "\x57", "\x58", - "\x59", "\x5A", - "\x61", "\x62", - "\x63", "\x64", - "\x65", "\x66", - "\x67", "\x68", - "\x69", "\x6A", - "\x6B", "\x6C", - "\x6D", "\x6E", - "\x6F", "\x70", - "\x71", "\x72", - "\x73", "\x74", - "\x75", "\x76", - "\x77", "\x78", - "\x79", "\x7A", - "\x41", NULL, - "\x43", "\x44", - NULL, NULL, - "\x47", NULL, - NULL, "\x4A", - "\x4B", NULL, - NULL, "\x4E", - "\x4F", "\x50", - "\x51", NULL, - "\x53", "\x54", - "\x55", "\x56", - "\x57", "\x58", - "\x59", "\x5A", - "\x61", "\x62", - "\x63", "\x64", - NULL, "\x66", - NULL, "\x68", - "\x69", "\x6A", - "\x6B", "\x6C", - "\x6D", "\x6E", - NULL, "\x70", - "\x71", "\x72", - "\x73", "\x74", - "\x75", "\x76", - "\x77", "\x78", - "\x79", "\x7A", - "\x41", "\x42", - "\x43", "\x44", - "\x45", "\x46", - "\x47", "\x48", - "\x49", "\x4A", - "\x4B", "\x4C", - "\x4D", "\x4E", - "\x4F", "\x50", - "\x51", "\x52", - "\x53", "\x54", - "\x55", "\x56", - "\x57", "\x58", - "\x59", "\x5A", - "\x61", "\x62", - "\x63", "\x64", - "\x65", "\x66", - "\x67", "\x68", - "\x69", "\x6A", - "\x6B", "\x6C", - "\x6D", "\x6E", - "\x6F", "\x70", - "\x71", "\x72", - "\x73", "\x74", - "\x75", "\x76", -}; - -static const char *const decompCompatPage469[0x100] = { - "\x77", "\x78", - "\x79", "\x7A", - "\x41", "\x42", - NULL, "\x44", - "\x45", "\x46", - "\x47", NULL, - NULL, "\x4A", - "\x4B", "\x4C", - "\x4D", "\x4E", - "\x4F", "\x50", - "\x51", NULL, - "\x53", "\x54", - "\x55", "\x56", - "\x57", "\x58", - "\x59", NULL, - "\x61", "\x62", - "\x63", "\x64", - "\x65", "\x66", - "\x67", "\x68", - "\x69", "\x6A", - "\x6B", "\x6C", - "\x6D", "\x6E", - "\x6F", "\x70", - "\x71", "\x72", - "\x73", "\x74", - "\x75", "\x76", - "\x77", "\x78", - "\x79", "\x7A", - "\x41", "\x42", - NULL, "\x44", - "\x45", "\x46", - "\x47", NULL, - "\x49", "\x4A", - "\x4B", "\x4C", - "\x4D", NULL, - "\x4F", NULL, - NULL, NULL, - "\x53", "\x54", - "\x55", "\x56", - "\x57", "\x58", - "\x59", NULL, - "\x61", "\x62", - "\x63", "\x64", - "\x65", "\x66", - "\x67", "\x68", - "\x69", "\x6A", - "\x6B", "\x6C", - "\x6D", "\x6E", - "\x6F", "\x70", - "\x71", "\x72", - "\x73", "\x74", - "\x75", "\x76", - "\x77", "\x78", - "\x79", "\x7A", - "\x41", "\x42", - "\x43", "\x44", - "\x45", "\x46", - "\x47", "\x48", - "\x49", "\x4A", - "\x4B", "\x4C", - "\x4D", "\x4E", - "\x4F", "\x50", - "\x51", "\x52", - "\x53", "\x54", - "\x55", "\x56", - "\x57", "\x58", - "\x59", "\x5A", - "\x61", "\x62", - "\x63", "\x64", - "\x65", "\x66", - "\x67", "\x68", - "\x69", "\x6A", - "\x6B", "\x6C", - "\x6D", "\x6E", - "\x6F", "\x70", - "\x71", "\x72", - "\x73", "\x74", - "\x75", "\x76", - "\x77", "\x78", - "\x79", "\x7A", - "\x41", "\x42", - "\x43", "\x44", - "\x45", "\x46", - "\x47", "\x48", - "\x49", "\x4A", - "\x4B", "\x4C", - "\x4D", "\x4E", - "\x4F", "\x50", - "\x51", "\x52", - "\x53", "\x54", - "\x55", "\x56", - "\x57", "\x58", - "\x59", "\x5A", - "\x61", "\x62", - "\x63", "\x64", - "\x65", "\x66", - "\x67", "\x68", - "\x69", "\x6A", - "\x6B", "\x6C", - "\x6D", "\x6E", - "\x6F", "\x70", - "\x71", "\x72", - "\x73", "\x74", - "\x75", "\x76", - "\x77", "\x78", - "\x79", "\x7A", - "\x41", "\x42", - "\x43", "\x44", - "\x45", "\x46", - "\x47", "\x48", - "\x49", "\x4A", - "\x4B", "\x4C", - "\x4D", "\x4E", - "\x4F", "\x50", - "\x51", "\x52", - "\x53", "\x54", - "\x55", "\x56", - "\x57", "\x58", - "\x59", "\x5A", - "\x61", "\x62", - "\x63", "\x64", - "\x65", "\x66", - "\x67", "\x68", - "\x69", "\x6A", - "\x6B", "\x6C", - "\x6D", "\x6E", - "\x6F", "\x70", - "\x71", "\x72", -}; - -static const char *const decompCompatPage470[0x100] = { - "\x73", "\x74", - "\x75", "\x76", - "\x77", "\x78", - "\x79", "\x7A", - "\x41", "\x42", - "\x43", "\x44", - "\x45", "\x46", - "\x47", "\x48", - "\x49", "\x4A", - "\x4B", "\x4C", - "\x4D", "\x4E", - "\x4F", "\x50", - "\x51", "\x52", - "\x53", "\x54", - "\x55", "\x56", - "\x57", "\x58", - "\x59", "\x5A", - "\x61", "\x62", - "\x63", "\x64", - "\x65", "\x66", - "\x67", "\x68", - "\x69", "\x6A", - "\x6B", "\x6C", - "\x6D", "\x6E", - "\x6F", "\x70", - "\x71", "\x72", - "\x73", "\x74", - "\x75", "\x76", - "\x77", "\x78", - "\x79", "\x7A", - "\x41", "\x42", - "\x43", "\x44", - "\x45", "\x46", - "\x47", "\x48", - "\x49", "\x4A", - "\x4B", "\x4C", - "\x4D", "\x4E", - "\x4F", "\x50", - "\x51", "\x52", - "\x53", "\x54", - "\x55", "\x56", - "\x57", "\x58", - "\x59", "\x5A", - "\x61", "\x62", - "\x63", "\x64", - "\x65", "\x66", - "\x67", "\x68", - "\x69", "\x6A", - "\x6B", "\x6C", - "\x6D", "\x6E", - "\x6F", "\x70", - "\x71", "\x72", - "\x73", "\x74", - "\x75", "\x76", - "\x77", "\x78", - "\x79", "\x7A", - "\x41", "\x42", - "\x43", "\x44", - "\x45", "\x46", - "\x47", "\x48", - "\x49", "\x4A", - "\x4B", "\x4C", - "\x4D", "\x4E", - "\x4F", "\x50", - "\x51", "\x52", - "\x53", "\x54", - "\x55", "\x56", - "\x57", "\x58", - "\x59", "\x5A", - "\x61", "\x62", - "\x63", "\x64", - "\x65", "\x66", - "\x67", "\x68", - "\x69", "\x6A", - "\x6B", "\x6C", - "\x6D", "\x6E", - "\x6F", "\x70", - "\x71", "\x72", - "\x73", "\x74", - "\x75", "\x76", - "\x77", "\x78", - "\x79", "\x7A", - "\xC4\xB1", "\xC8\xB7", - NULL, NULL, - "\xCE\x91", "\xCE\x92", - "\xCE\x93", "\xCE\x94", - "\xCE\x95", "\xCE\x96", - "\xCE\x97", "\xCE\x98", - "\xCE\x99", "\xCE\x9A", - "\xCE\x9B", "\xCE\x9C", - "\xCE\x9D", "\xCE\x9E", - "\xCE\x9F", "\xCE\xA0", - "\xCE\xA1", "\xCE\x98", - "\xCE\xA3", "\xCE\xA4", - "\xCE\xA5", "\xCE\xA6", - "\xCE\xA7", "\xCE\xA8", - "\xCE\xA9", "\xE2\x88\x87", - "\xCE\xB1", "\xCE\xB2", - "\xCE\xB3", "\xCE\xB4", - "\xCE\xB5", "\xCE\xB6", - "\xCE\xB7", "\xCE\xB8", - "\xCE\xB9", "\xCE\xBA", - "\xCE\xBB", "\xCE\xBC", - "\xCE\xBD", "\xCE\xBE", - "\xCE\xBF", "\xCF\x80", - "\xCF\x81", "\xCF\x82", - "\xCF\x83", "\xCF\x84", - "\xCF\x85", "\xCF\x86", - "\xCF\x87", "\xCF\x88", - "\xCF\x89", "\xE2\x88\x82", - "\xCE\xB5", "\xCE\xB8", - "\xCE\xBA", "\xCF\x86", - "\xCF\x81", "\xCF\x80", - "\xCE\x91", "\xCE\x92", - "\xCE\x93", "\xCE\x94", - "\xCE\x95", "\xCE\x96", - "\xCE\x97", "\xCE\x98", - "\xCE\x99", "\xCE\x9A", - "\xCE\x9B", "\xCE\x9C", - "\xCE\x9D", "\xCE\x9E", - "\xCE\x9F", "\xCE\xA0", - "\xCE\xA1", "\xCE\x98", - "\xCE\xA3", "\xCE\xA4", - "\xCE\xA5", "\xCE\xA6", - "\xCE\xA7", "\xCE\xA8", - "\xCE\xA9", "\xE2\x88\x87", - "\xCE\xB1", "\xCE\xB2", - "\xCE\xB3", "\xCE\xB4", -}; - -static const char *const decompCompatPage471[0x100] = { - "\xCE\xB5", "\xCE\xB6", - "\xCE\xB7", "\xCE\xB8", - "\xCE\xB9", "\xCE\xBA", - "\xCE\xBB", "\xCE\xBC", - "\xCE\xBD", "\xCE\xBE", - "\xCE\xBF", "\xCF\x80", - "\xCF\x81", "\xCF\x82", - "\xCF\x83", "\xCF\x84", - "\xCF\x85", "\xCF\x86", - "\xCF\x87", "\xCF\x88", - "\xCF\x89", "\xE2\x88\x82", - "\xCE\xB5", "\xCE\xB8", - "\xCE\xBA", "\xCF\x86", - "\xCF\x81", "\xCF\x80", - "\xCE\x91", "\xCE\x92", - "\xCE\x93", "\xCE\x94", - "\xCE\x95", "\xCE\x96", - "\xCE\x97", "\xCE\x98", - "\xCE\x99", "\xCE\x9A", - "\xCE\x9B", "\xCE\x9C", - "\xCE\x9D", "\xCE\x9E", - "\xCE\x9F", "\xCE\xA0", - "\xCE\xA1", "\xCE\x98", - "\xCE\xA3", "\xCE\xA4", - "\xCE\xA5", "\xCE\xA6", - "\xCE\xA7", "\xCE\xA8", - "\xCE\xA9", "\xE2\x88\x87", - "\xCE\xB1", "\xCE\xB2", - "\xCE\xB3", "\xCE\xB4", - "\xCE\xB5", "\xCE\xB6", - "\xCE\xB7", "\xCE\xB8", - "\xCE\xB9", "\xCE\xBA", - "\xCE\xBB", "\xCE\xBC", - "\xCE\xBD", "\xCE\xBE", - "\xCE\xBF", "\xCF\x80", - "\xCF\x81", "\xCF\x82", - "\xCF\x83", "\xCF\x84", - "\xCF\x85", "\xCF\x86", - "\xCF\x87", "\xCF\x88", - "\xCF\x89", "\xE2\x88\x82", - "\xCE\xB5", "\xCE\xB8", - "\xCE\xBA", "\xCF\x86", - "\xCF\x81", "\xCF\x80", - "\xCE\x91", "\xCE\x92", - "\xCE\x93", "\xCE\x94", - "\xCE\x95", "\xCE\x96", - "\xCE\x97", "\xCE\x98", - "\xCE\x99", "\xCE\x9A", - "\xCE\x9B", "\xCE\x9C", - "\xCE\x9D", "\xCE\x9E", - "\xCE\x9F", "\xCE\xA0", - "\xCE\xA1", "\xCE\x98", - "\xCE\xA3", "\xCE\xA4", - "\xCE\xA5", "\xCE\xA6", - "\xCE\xA7", "\xCE\xA8", - "\xCE\xA9", "\xE2\x88\x87", - "\xCE\xB1", "\xCE\xB2", - "\xCE\xB3", "\xCE\xB4", - "\xCE\xB5", "\xCE\xB6", - "\xCE\xB7", "\xCE\xB8", - "\xCE\xB9", "\xCE\xBA", - "\xCE\xBB", "\xCE\xBC", - "\xCE\xBD", "\xCE\xBE", - "\xCE\xBF", "\xCF\x80", - "\xCF\x81", "\xCF\x82", - "\xCF\x83", "\xCF\x84", - "\xCF\x85", "\xCF\x86", - "\xCF\x87", "\xCF\x88", - "\xCF\x89", "\xE2\x88\x82", - "\xCE\xB5", "\xCE\xB8", - "\xCE\xBA", "\xCF\x86", - "\xCF\x81", "\xCF\x80", - "\xCE\x91", "\xCE\x92", - "\xCE\x93", "\xCE\x94", - "\xCE\x95", "\xCE\x96", - "\xCE\x97", "\xCE\x98", - "\xCE\x99", "\xCE\x9A", - "\xCE\x9B", "\xCE\x9C", - "\xCE\x9D", "\xCE\x9E", - "\xCE\x9F", "\xCE\xA0", - "\xCE\xA1", "\xCE\x98", - "\xCE\xA3", "\xCE\xA4", - "\xCE\xA5", "\xCE\xA6", - "\xCE\xA7", "\xCE\xA8", - "\xCE\xA9", "\xE2\x88\x87", - "\xCE\xB1", "\xCE\xB2", - "\xCE\xB3", "\xCE\xB4", - "\xCE\xB5", "\xCE\xB6", - "\xCE\xB7", "\xCE\xB8", - "\xCE\xB9", "\xCE\xBA", - "\xCE\xBB", "\xCE\xBC", - "\xCE\xBD", "\xCE\xBE", - "\xCE\xBF", "\xCF\x80", - "\xCF\x81", "\xCF\x82", - "\xCF\x83", "\xCF\x84", - "\xCF\x85", "\xCF\x86", - "\xCF\x87", "\xCF\x88", - "\xCF\x89", "\xE2\x88\x82", - "\xCE\xB5", "\xCE\xB8", - "\xCE\xBA", "\xCF\x86", - "\xCF\x81", "\xCF\x80", - "\xCF\x9C", "\xCF\x9D", - NULL, NULL, - "\x30", "\x31", - "\x32", "\x33", - "\x34", "\x35", - "\x36", "\x37", - "\x38", "\x39", - "\x30", "\x31", - "\x32", "\x33", - "\x34", "\x35", - "\x36", "\x37", - "\x38", "\x39", - "\x30", "\x31", - "\x32", "\x33", - "\x34", "\x35", - "\x36", "\x37", - "\x38", "\x39", - "\x30", "\x31", - "\x32", "\x33", - "\x34", "\x35", - "\x36", "\x37", - "\x38", "\x39", - "\x30", "\x31", - "\x32", "\x33", - "\x34", "\x35", - "\x36", "\x37", - "\x38", "\x39", -}; - -static const char *const decompCompatPage494[0x100] = { - "\xD8\xA7", "\xD8\xA8", - "\xD8\xAC", "\xD8\xAF", - NULL, "\xD9\x88", - "\xD8\xB2", "\xD8\xAD", - "\xD8\xB7", "\xD9\x8A", - "\xD9\x83", "\xD9\x84", - "\xD9\x85", "\xD9\x86", - "\xD8\xB3", "\xD8\xB9", - "\xD9\x81", "\xD8\xB5", - "\xD9\x82", "\xD8\xB1", - "\xD8\xB4", "\xD8\xAA", - "\xD8\xAB", "\xD8\xAE", - "\xD8\xB0", "\xD8\xB6", - "\xD8\xB8", "\xD8\xBA", - "\xD9\xAE", "\xDA\xBA", - "\xDA\xA1", "\xD9\xAF", - NULL, "\xD8\xA8", - "\xD8\xAC", NULL, - "\xD9\x87", NULL, - NULL, "\xD8\xAD", - NULL, "\xD9\x8A", - "\xD9\x83", "\xD9\x84", - "\xD9\x85", "\xD9\x86", - "\xD8\xB3", "\xD8\xB9", - "\xD9\x81", "\xD8\xB5", - "\xD9\x82", NULL, - "\xD8\xB4", "\xD8\xAA", - "\xD8\xAB", "\xD8\xAE", - NULL, "\xD8\xB6", - NULL, "\xD8\xBA", - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xD8\xAC", NULL, - NULL, NULL, - NULL, "\xD8\xAD", - NULL, "\xD9\x8A", - NULL, "\xD9\x84", - NULL, "\xD9\x86", - "\xD8\xB3", "\xD8\xB9", - NULL, "\xD8\xB5", - "\xD9\x82", NULL, - "\xD8\xB4", NULL, - NULL, "\xD8\xAE", - NULL, "\xD8\xB6", - NULL, "\xD8\xBA", - NULL, "\xDA\xBA", - NULL, "\xD9\xAF", - NULL, "\xD8\xA8", - "\xD8\xAC", NULL, - "\xD9\x87", NULL, - NULL, "\xD8\xAD", - "\xD8\xB7", "\xD9\x8A", - "\xD9\x83", NULL, - "\xD9\x85", "\xD9\x86", - "\xD8\xB3", "\xD8\xB9", - "\xD9\x81", "\xD8\xB5", - "\xD9\x82", NULL, - "\xD8\xB4", "\xD8\xAA", - "\xD8\xAB", "\xD8\xAE", - NULL, "\xD8\xB6", - "\xD8\xB8", "\xD8\xBA", - "\xD9\xAE", NULL, - "\xDA\xA1", NULL, - "\xD8\xA7", "\xD8\xA8", - "\xD8\xAC", "\xD8\xAF", - "\xD9\x87", "\xD9\x88", - "\xD8\xB2", "\xD8\xAD", - "\xD8\xB7", "\xD9\x8A", - NULL, "\xD9\x84", - "\xD9\x85", "\xD9\x86", - "\xD8\xB3", "\xD8\xB9", - "\xD9\x81", "\xD8\xB5", - "\xD9\x82", "\xD8\xB1", - "\xD8\xB4", "\xD8\xAA", - "\xD8\xAB", "\xD8\xAE", - "\xD8\xB0", "\xD8\xB6", - "\xD8\xB8", "\xD8\xBA", - NULL, NULL, - NULL, NULL, - NULL, "\xD8\xA8", - "\xD8\xAC", "\xD8\xAF", - NULL, "\xD9\x88", - "\xD8\xB2", "\xD8\xAD", - "\xD8\xB7", "\xD9\x8A", - NULL, "\xD9\x84", - "\xD9\x85", "\xD9\x86", - "\xD8\xB3", "\xD8\xB9", - "\xD9\x81", "\xD8\xB5", - "\xD9\x82", "\xD8\xB1", - "\xD8\xB4", "\xD8\xAA", - "\xD8\xAB", "\xD8\xAE", - "\xD8\xB0", "\xD8\xB6", - "\xD8\xB8", "\xD8\xBA", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage497[0x100] = { - "\x30\x2E", "\x30\x2C", - "\x31\x2C", "\x32\x2C", - "\x33\x2C", "\x34\x2C", - "\x35\x2C", "\x36\x2C", - "\x37\x2C", "\x38\x2C", - "\x39\x2C", NULL, - NULL, NULL, - NULL, NULL, - "\x28\x41\x29", "\x28\x42\x29", - "\x28\x43\x29", "\x28\x44\x29", - "\x28\x45\x29", "\x28\x46\x29", - "\x28\x47\x29", "\x28\x48\x29", - "\x28\x49\x29", "\x28\x4A\x29", - "\x28\x4B\x29", "\x28\x4C\x29", - "\x28\x4D\x29", "\x28\x4E\x29", - "\x28\x4F\x29", "\x28\x50\x29", - "\x28\x51\x29", "\x28\x52\x29", - "\x28\x53\x29", "\x28\x54\x29", - "\x28\x55\x29", "\x28\x56\x29", - "\x28\x57\x29", "\x28\x58\x29", - "\x28\x59\x29", "\x28\x5A\x29", - "\xE3\x80\x94\x53\xE3\x80\x95", "\x43", - "\x52", "\x43\x44", - "\x57\x5A", NULL, - "\x41", "\x42", - "\x43", "\x44", - "\x45", "\x46", - "\x47", "\x48", - "\x49", "\x4A", - "\x4B", "\x4C", - "\x4D", "\x4E", - "\x4F", "\x50", - "\x51", "\x52", - "\x53", "\x54", - "\x55", "\x56", - "\x57", "\x58", - "\x59", "\x5A", - "\x48\x56", "\x4D\x56", - "\x53\x44", "\x53\x53", - "\x50\x50\x56", "\x57\x43", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x4D\x43", "\x4D\x44", - "\x4D\x52", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x44\x4A", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage498[0x100] = { - "\xE3\x81\xBB\xE3\x81\x8B", "\xE3\x82\xB3\xE3\x82\xB3", - "\xE3\x82\xB5", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE6\x89\x8B", "\xE5\xAD\x97", - "\xE5\x8F\x8C", "\xE3\x83\x86\xE3\x82\x99", - "\xE4\xBA\x8C", "\xE5\xA4\x9A", - "\xE8\xA7\xA3", "\xE5\xA4\xA9", - "\xE4\xBA\xA4", "\xE6\x98\xA0", - "\xE7\x84\xA1", "\xE6\x96\x99", - "\xE5\x89\x8D", "\xE5\xBE\x8C", - "\xE5\x86\x8D", "\xE6\x96\xB0", - "\xE5\x88\x9D", "\xE7\xB5\x82", - "\xE7\x94\x9F", "\xE8\xB2\xA9", - "\xE5\xA3\xB0", "\xE5\x90\xB9", - "\xE6\xBC\x94", "\xE6\x8A\x95", - "\xE6\x8D\x95", "\xE4\xB8\x80", - "\xE4\xB8\x89", "\xE9\x81\x8A", - "\xE5\xB7\xA6", "\xE4\xB8\xAD", - "\xE5\x8F\xB3", "\xE6\x8C\x87", - "\xE8\xB5\xB0", "\xE6\x89\x93", - "\xE7\xA6\x81", "\xE7\xA9\xBA", - "\xE5\x90\x88", "\xE6\xBA\x80", - "\xE6\x9C\x89", "\xE6\x9C\x88", - "\xE7\x94\xB3", "\xE5\x89\xB2", - "\xE5\x96\xB6", "\xE9\x85\x8D", - NULL, NULL, - NULL, NULL, - "\xE3\x80\x94\xE6\x9C\xAC\xE3\x80\x95", "\xE3\x80\x94\xE4\xB8\x89\xE3\x80\x95", - "\xE3\x80\x94\xE4\xBA\x8C\xE3\x80\x95", "\xE3\x80\x94\xE5\xAE\x89\xE3\x80\x95", - "\xE3\x80\x94\xE7\x82\xB9\xE3\x80\x95", "\xE3\x80\x94\xE6\x89\x93\xE3\x80\x95", - "\xE3\x80\x94\xE7\x9B\x97\xE3\x80\x95", "\xE3\x80\x94\xE5\x8B\x9D\xE3\x80\x95", - "\xE3\x80\x94\xE6\x95\x97\xE3\x80\x95", NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\xE5\xBE\x97", "\xE5\x8F\xAF", - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - -static const char *const decompCompatPage507[0x100] = { - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - NULL, NULL, - "\x30", "\x31", - "\x32", "\x33", - "\x34", "\x35", - "\x36", "\x37", - "\x38", "\x39", - NULL, NULL, - NULL, NULL, - NULL, NULL, -}; - const OFUnichar *const OFUnicodeUppercaseTable[0x1EA] = { uppercasePage0, uppercasePage1, uppercasePage2, uppercasePage3, uppercasePage4, uppercasePage5, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, @@ -12428,11 +2148,11 @@ emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, uppercasePage255, emptyPage, emptyPage, emptyPage, emptyPage, - uppercasePage260, emptyPage, emptyPage, emptyPage, + uppercasePage260, uppercasePage261, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, uppercasePage268, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, uppercasePage280, emptyPage, emptyPage, emptyPage, @@ -12554,11 +2274,11 @@ emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, lowercasePage255, emptyPage, emptyPage, emptyPage, emptyPage, - lowercasePage260, emptyPage, emptyPage, emptyPage, + lowercasePage260, lowercasePage261, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, lowercasePage268, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, lowercasePage280, emptyPage, emptyPage, emptyPage, @@ -12680,11 +2400,11 @@ emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, uppercasePage255, emptyPage, emptyPage, emptyPage, emptyPage, - uppercasePage260, emptyPage, emptyPage, emptyPage, + uppercasePage260, uppercasePage261, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, uppercasePage268, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, uppercasePage280, emptyPage, emptyPage, emptyPage, @@ -12828,11 +2548,11 @@ emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, lowercasePage255, emptyPage, emptyPage, emptyPage, emptyPage, lowercasePage260, - emptyPage, emptyPage, emptyPage, + lowercasePage261, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, lowercasePage268, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, @@ -12907,520 +2627,5 @@ emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, emptyPage, lowercasePage489 }; -const char *const *OFUnicodeDecompositionTable[0x2FB] = { - decompositionPage0, decompositionPage1, decompositionPage2, - decompositionPage3, decompositionPage4, emptyDecompositionPage, - decompositionPage6, emptyDecompositionPage, emptyDecompositionPage, - decompositionPage9, decompositionPage10, decompositionPage11, - decompositionPage12, decompositionPage13, emptyDecompositionPage, - decompositionPage15, decompositionPage16, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - decompositionPage27, emptyDecompositionPage, emptyDecompositionPage, - decompositionPage30, decompositionPage31, decompositionPage32, - decompositionPage33, decompositionPage34, decompositionPage35, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - decompositionPage42, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - decompositionPage48, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - decompositionPage249, decompositionPage250, decompositionPage251, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, decompositionPage272, - decompositionPage273, emptyDecompositionPage, decompositionPage275, - decompositionPage276, decompositionPage277, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, decompositionPage281, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - decompositionPage465, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, decompositionPage760, decompositionPage761, - decompositionPage762 -}; - -const char *const *OFUnicodeDecompositionCompatTable[0x2FB] = { - decompCompatPage0, decompCompatPage1, decompCompatPage2, - decompCompatPage3, decompositionPage4, decompCompatPage5, - decompCompatPage6, emptyDecompositionPage, emptyDecompositionPage, - decompositionPage9, decompositionPage10, decompositionPage11, - decompCompatPage12, decompCompatPage13, decompCompatPage14, - decompCompatPage15, decompCompatPage16, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - decompositionPage27, emptyDecompositionPage, decompCompatPage29, - decompCompatPage30, decompCompatPage31, decompCompatPage32, - decompCompatPage33, decompCompatPage34, decompositionPage35, - decompCompatPage36, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - decompCompatPage42, emptyDecompositionPage, decompCompatPage44, - decompCompatPage45, decompCompatPage46, decompCompatPage47, - decompCompatPage48, decompCompatPage49, decompCompatPage50, - decompCompatPage51, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, decompCompatPage166, decompCompatPage167, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - decompCompatPage171, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - decompositionPage249, decompositionPage250, decompCompatPage251, - decompCompatPage252, decompCompatPage253, decompCompatPage254, - decompCompatPage255, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, decompositionPage272, - decompositionPage273, emptyDecompositionPage, decompositionPage275, - decompositionPage276, decompositionPage277, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, decompositionPage281, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - decompCompatPage465, emptyDecompositionPage, emptyDecompositionPage, - decompCompatPage468, decompCompatPage469, decompCompatPage470, - decompCompatPage471, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, decompCompatPage494, - emptyDecompositionPage, emptyDecompositionPage, decompCompatPage497, - decompCompatPage498, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - decompCompatPage507, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, emptyDecompositionPage, emptyDecompositionPage, - emptyDecompositionPage, decompositionPage760, decompositionPage761, - decompositionPage762 -}; Index: tests/ForwardingTests.m ================================================================== --- tests/ForwardingTests.m +++ tests/ForwardingTests.m @@ -206,12 +206,12 @@ isEqual: RESULT]) /* * Don't try fpret on Win64 if we don't have stret forwarding, as * long double is handled as a struct there. */ -# if !defined(OF_WINDOWS) || !defined(OF_X86_64) || \ - defined(OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET) +# if !defined(OF_WINDOWS) || !defined(OF_AMD64) || \ + defined(OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET) TEST(@"-[forwardingTargetForSelector:] fp return", [testObject forwardingTargetFPRetTest] == 12345678.00006103515625) # endif # ifdef OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET TEST(@"-[forwardingTargetForSelector:] struct return", Index: tests/OFINIFileTests.m ================================================================== --- tests/OFINIFileTests.m +++ tests/OFINIFileTests.m @@ -64,51 +64,52 @@ TEST(@"-[categoryForName:]", tests != nil && foobar != nil && types != nil) module = @"OFINICategory"; - TEST(@"-[stringForKey:]", - [[tests stringForKey: @"foo"] isEqual: @"bar"] && - [[foobar stringForKey: @"quxquxqux"] isEqual: @"hello\"wörld"]) - - TEST(@"-[setString:forKey:]", - R([tests setString: @"baz" forKey: @"foo"]) && - R([tests setString: @"new" forKey: @"new"]) && - R([foobar setString: @"a\fb" forKey: @"qux3"])) - - TEST(@"-[longLongForKey:defaultValue:]", - [types longLongForKey: @"integer" defaultValue: 2] == 0x20) - - TEST(@"-[setLongLong:forKey:]", - R([types setLongLong: 0x10 forKey: @"integer"])) - - TEST(@"-[boolForKey:defaultValue:]", - [types boolForKey: @"bool" defaultValue: false] == true) - - TEST(@"-[setBool:forKey:]", R([types setBool: false forKey: @"bool"])) - - TEST(@"-[floatForKey:defaultValue:]", - [types floatForKey: @"float" defaultValue: 1] == 0.5f) - - TEST(@"-[setFloat:forKey:]", - R([types setFloat: 0.25f forKey: @"float"])) - - TEST(@"-[doubleForKey:defaultValue:]", - [types doubleForKey: @"double" defaultValue: 3] == 0.25) - - TEST(@"-[setDouble:forKey:]", - R([types setDouble: 0.75 forKey: @"double"])) + TEST(@"-[stringValueForKey:]", + [[tests stringValueForKey: @"foo"] isEqual: @"bar"] && + [[foobar stringValueForKey: @"quxquxqux"] isEqual: @"hello\"wörld"]) + + TEST(@"-[setStringValue:forKey:]", + R([tests setStringValue: @"baz" forKey: @"foo"]) && + R([tests setStringValue: @"new" forKey: @"new"]) && + R([foobar setStringValue: @"a\fb" forKey: @"qux3"])) + + TEST(@"-[longLongValueForKey:defaultValue:]", + [types longLongValueForKey: @"integer" defaultValue: 2] == 0x20) + + TEST(@"-[setLongLongValue:forKey:]", + R([types setLongLongValue: 0x10 forKey: @"integer"])) + + TEST(@"-[boolValueForKey:defaultValue:]", + [types boolValueForKey: @"bool" defaultValue: false] == true) + + TEST(@"-[setBoolValue:forKey:]", + R([types setBoolValue: false forKey: @"bool"])) + + TEST(@"-[floatValueForKey:defaultValue:]", + [types floatValueForKey: @"float" defaultValue: 1] == 0.5f) + + TEST(@"-[setFloatValue:forKey:]", + R([types setFloatValue: 0.25f forKey: @"float"])) + + TEST(@"-[doubleValueForKey:defaultValue:]", + [types doubleValueForKey: @"double" defaultValue: 3] == 0.25) + + TEST(@"-[setDoubleValue:forKey:]", + R([types setDoubleValue: 0.75 forKey: @"double"])) array = [OFArray arrayWithObjects: @"1", @"2", nil]; - TEST(@"-[stringArrayForKey:]", - [[types stringArrayForKey: @"array1"] isEqual: array] && - [[types stringArrayForKey: @"array2"] isEqual: array] && - [[types stringArrayForKey: @"array3"] isEqual: [OFArray array]]) + TEST(@"-[arrayValueForKey:]", + [[types arrayValueForKey: @"array1"] isEqual: array] && + [[types arrayValueForKey: @"array2"] isEqual: array] && + [[types arrayValueForKey: @"array3"] isEqual: [OFArray array]]) array = [OFArray arrayWithObjects: @"foo", @"bar", nil]; - TEST(@"-[setStringArray:forKey:]", - R([types setStringArray: array forKey: @"array1"])) + TEST(@"-[setArrayValue:forKey:]", + R([types setArrayValue: array forKey: @"array1"])) TEST(@"-[removeValueForKey:]", R([foobar removeValueForKey: @"quxqux "]) && R([types removeValueForKey: @"array2"])) Index: tests/OFSetTests.m ================================================================== --- tests/OFSetTests.m +++ tests/OFSetTests.m @@ -16,12 +16,12 @@ #include "config.h" #import "TestsAppDelegate.h" #import "OFSet.h" -#import "OFMapTableSet.h" -#import "OFMutableMapTableSet.h" +#import "OFConcreteSet.h" +#import "OFConcreteMutableSet.h" static OFString *module; @interface SimpleSet: OFSet { @@ -286,10 +286,10 @@ { module = @"OFSet"; [self setTestsWithClass: [SimpleSet class] mutableClass: [SimpleMutableSet class]]; - module = @"OFMapTableSet"; - [self setTestsWithClass: [OFMapTableSet class] - mutableClass: [OFMutableMapTableSet class]]; + module = @"OFConcreteSet"; + [self setTestsWithClass: [OFConcreteSet class] + mutableClass: [OFConcreteMutableSet class]]; } @end Index: tests/OFStringTests.m ================================================================== --- tests/OFStringTests.m +++ tests/OFStringTests.m @@ -1405,20 +1405,10 @@ (mutableString1 = [mutableStringClass stringWithString: whitespace[1]]) && R([mutableString1 deleteEnclosingWhitespaces]) && [mutableString1 isEqual: @""]) -#ifdef OF_HAVE_UNICODE_TABLES - TEST(@"-[decomposedStringWithCanonicalMapping]", - [C(@"H\xC3\xA4llj\xC3\xB6").decomposedStringWithCanonicalMapping - isEqual: @"H\x61\xCC\x88llj\x6F\xCC\x88"]); - - TEST(@"-[decomposedStringWithCompatibilityMapping]", - [C(@"H\xC3\xA4llj\xC3\xB6").decomposedStringWithCompatibilityMapping - isEqual: @"H\x61\xCC\x88llj\x6F\xCC\x88"]); -#endif - TEST(@"-[stringByXMLEscaping]", (string = C(@" &world'\"!&").stringByXMLEscaping) && [string isEqual: @"<hello> &world'"!&"]) TEST(@"-[stringByXMLUnescaping]", Index: tests/OFSystemInfoTests.m ================================================================== --- tests/OFSystemInfoTests.m +++ tests/OFSystemInfoTests.m @@ -82,11 +82,11 @@ [OFSystemInfo CPUVendor]]; [OFStdOut writeFormat: @"[OFSystemInfo] CPU model: %@\n", [OFSystemInfo CPUModel]]; -#if defined(OF_X86_64) || defined(OF_X86) +#if defined(OF_AMD64) || defined(OF_X86) [OFStdOut writeFormat: @"[OFSystemInfo] Supports MMX: %d\n", [OFSystemInfo supportsMMX]]; [OFStdOut writeFormat: @"[OFSystemInfo] Supports 3DNow!: %d\n", [OFSystemInfo supports3DNow]]; Index: tests/OFUNIXStreamSocketTests.m ================================================================== --- tests/OFUNIXStreamSocketTests.m +++ tests/OFUNIXStreamSocketTests.m @@ -79,16 +79,16 @@ TEST(@"-[readIntoBuffer:length:]", [sockClient readIntoBuffer: buffer length: 5] == 5 && memcmp(buffer, "Hello", 5) == 0) - TEST(@"-[remoteAddress]", - OFSocketAddressUNIXPath(sockAccepted.remoteAddress) == nil) + TEST(@"-[remoteAddress]", OFSocketAddressUNIXPath( + sockAccepted.remoteAddress).length == 0) } @finally { #ifdef OF_HAVE_FILES [[OFFileManager defaultManager] removeItemAtPath: path]; #endif } objc_autoreleasePoolPop(pool); } @end Index: tests/RuntimeARCTests.m ================================================================== --- tests/RuntimeARCTests.m +++ tests/RuntimeARCTests.m @@ -25,11 +25,11 @@ @implementation RuntimeARCTest - (instancetype)init { self = [super init]; -#if defined(OF_WINDOWS) && defined(OF_X86_64) +#if defined(OF_WINDOWS) && defined(OF_AMD64) /* * Clang has a bug on Windows where it creates an invalid call into * objc_retainAutoreleasedReturnValue(). Work around it by not using an * autoreleased exception. */ Index: utils/ofarc/Archive.h ================================================================== --- utils/ofarc/Archive.h +++ utils/ofarc/Archive.h @@ -14,19 +14,25 @@ */ #import "OFObject.h" #import "OFFile.h" #import "OFArray.h" + +OF_ASSUME_NONNULL_BEGIN @protocol Archive -+ (instancetype)archiveWithStream: (OF_KINDOF(OFStream *))stream - mode: (OFString *)mode - encoding: (OFStringEncoding)encoding; -- (instancetype)initWithStream: (OF_KINDOF(OFStream *))stream - mode: (OFString *)mode - encoding: (OFStringEncoding)encoding; ++ (instancetype)archiveWithPath: (nullable OFString *)path + stream: (OF_KINDOF(OFStream *))stream + mode: (OFString *)mode + encoding: (OFStringEncoding)encoding; +- (instancetype)initWithPath: (nullable OFString *)path + stream: (OF_KINDOF(OFStream *))stream + mode: (OFString *)mode + encoding: (OFStringEncoding)encoding; - (void)listFiles; - (void)extractFiles: (OFArray OF_GENERIC(OFString *) *)files; - (void)printFiles: (OFArray OF_GENERIC(OFString *) *)files; @optional - (void)addFiles: (OFArray OF_GENERIC(OFString *) *)files; @end + +OF_ASSUME_NONNULL_END Index: utils/ofarc/GZIPArchive.m ================================================================== --- utils/ofarc/GZIPArchive.m +++ utils/ofarc/GZIPArchive.m @@ -63,22 +63,25 @@ { if (self == [GZIPArchive class]) app = (OFArc *)[OFApplication sharedApplication].delegate; } -+ (instancetype)archiveWithStream: (OF_KINDOF(OFStream *))stream - mode: (OFString *)mode - encoding: (OFStringEncoding)encoding -{ - return [[[self alloc] initWithStream: stream - mode: mode - encoding: encoding] autorelease]; -} - -- (instancetype)initWithStream: (OF_KINDOF(OFStream *))stream - mode: (OFString *)mode - encoding: (OFStringEncoding)encoding ++ (instancetype)archiveWithPath: (OFString *)path + stream: (OF_KINDOF(OFStream *))stream + mode: (OFString *)mode + encoding: (OFStringEncoding)encoding +{ + return [[[self alloc] initWithPath: path + stream: stream + mode: mode + encoding: encoding] autorelease]; +} + +- (instancetype)initWithPath: (OFString *)path + stream: (OF_KINDOF(OFStream *))stream + mode: (OFString *)mode + encoding: (OFStringEncoding)encoding { self = [super init]; @try { _stream = [[OFGZIPStream alloc] initWithStream: stream Index: utils/ofarc/LHAArchive.m ================================================================== --- utils/ofarc/LHAArchive.m +++ utils/ofarc/LHAArchive.m @@ -81,22 +81,25 @@ { if (self == [LHAArchive class]) app = (OFArc *)[OFApplication sharedApplication].delegate; } -+ (instancetype)archiveWithStream: (OF_KINDOF(OFStream *))stream - mode: (OFString *)mode - encoding: (OFStringEncoding)encoding ++ (instancetype)archiveWithPath: (OFString *)path + stream: (OF_KINDOF(OFStream *))stream + mode: (OFString *)mode + encoding: (OFStringEncoding)encoding { - return [[[self alloc] initWithStream: stream - mode: mode - encoding: encoding] autorelease]; + return [[[self alloc] initWithPath: path + stream: stream + mode: mode + encoding: encoding] autorelease]; } -- (instancetype)initWithStream: (OF_KINDOF(OFStream *))stream - mode: (OFString *)mode - encoding: (OFStringEncoding)encoding +- (instancetype)initWithPath: (OFString *)path + stream: (OF_KINDOF(OFStream *))stream + mode: (OFString *)mode + encoding: (OFStringEncoding)encoding { self = [super init]; @try { _archive = [[OFLHAArchive alloc] initWithStream: stream Index: utils/ofarc/OFArc.m ================================================================== --- utils/ofarc/OFArc.m +++ utils/ofarc/OFArc.m @@ -486,15 +486,17 @@ } [OFApplication terminateWithStatus: _exitStatus]; } -- (id )openArchiveWithPath: (OFString *)path +- (id )openArchiveWithPath: (OFString *)path_ type: (OFString *)type mode: (char)mode encoding: (OFStringEncoding)encoding { + /* To make clang-analyzer happy about assigning nil to path later. */ + OFString *path = path_; OFString *modeString, *fileModeString; OFStream *file = nil; id archive = nil; [_archivePath release]; @@ -532,10 +534,12 @@ file = OFStdIn; break; default: @throw [OFInvalidArgumentException exception]; } + + path = nil; } else { @try { file = [OFFile fileWithPath: path mode: fileModeString]; } @catch (OFOpenItemFailedException *e) { OFString *error = [OFString @@ -566,32 +570,37 @@ type = @"zip"; } @try { if ([type isEqual: @"gz"]) - archive = [GZIPArchive archiveWithStream: file - mode: modeString - encoding: encoding]; + archive = [GZIPArchive archiveWithPath: path + stream: file + mode: modeString + encoding: encoding]; else if ([type isEqual: @"lha"]) - archive = [LHAArchive archiveWithStream: file - mode: modeString - encoding: encoding]; + archive = [LHAArchive archiveWithPath: path + stream: file + mode: modeString + encoding: encoding]; else if ([type isEqual: @"tar"]) - archive = [TarArchive archiveWithStream: file - mode: modeString - encoding: encoding]; + archive = [TarArchive archiveWithPath: path + stream: file + mode: modeString + encoding: encoding]; else if ([type isEqual: @"tgz"]) { OFStream *GZIPStream = [OFGZIPStream streamWithStream: file mode: modeString]; - archive = [TarArchive archiveWithStream: GZIPStream - mode: modeString - encoding: encoding]; + archive = [TarArchive archiveWithPath: path + stream: GZIPStream + mode: modeString + encoding: encoding]; } else if ([type isEqual: @"zip"]) - archive = [ZIPArchive archiveWithStream: file - mode: modeString - encoding: encoding]; + archive = [ZIPArchive archiveWithPath: path + stream: file + mode: modeString + encoding: encoding]; else { [OFStdErr writeLine: OF_LOCALIZED( @"unknown_archive_type", @"Unknown archive type: %[type]", @"type", type)]; @@ -638,15 +647,15 @@ } return archive; error: - if (mode == 'c') + if (mode == 'c' && path != nil) [[OFFileManager defaultManager] removeItemAtPath: path]; [OFApplication terminateWithStatus: 1]; - return nil; + abort(); } - (bool)shouldExtractFile: (OFString *)fileName outFileName: (OFString *)outFileName { Index: utils/ofarc/TarArchive.m ================================================================== --- utils/ofarc/TarArchive.m +++ utils/ofarc/TarArchive.m @@ -74,22 +74,25 @@ { if (self == [TarArchive class]) app = (OFArc *)[OFApplication sharedApplication].delegate; } -+ (instancetype)archiveWithStream: (OF_KINDOF(OFStream *))stream - mode: (OFString *)mode - encoding: (OFStringEncoding)encoding ++ (instancetype)archiveWithPath: (OFString *)path + stream: (OF_KINDOF(OFStream *))stream + mode: (OFString *)mode + encoding: (OFStringEncoding)encoding { - return [[[self alloc] initWithStream: stream - mode: mode - encoding: encoding] autorelease]; + return [[[self alloc] initWithPath: path + stream: stream + mode: mode + encoding: encoding] autorelease]; } -- (instancetype)initWithStream: (OF_KINDOF(OFStream *))stream - mode: (OFString *)mode - encoding: (OFStringEncoding)encoding +- (instancetype)initWithPath: (OFString *)path + stream: (OF_KINDOF(OFStream *))stream + mode: (OFString *)mode + encoding: (OFStringEncoding)encoding { self = [super init]; @try { _archive = [[OFTarArchive alloc] initWithStream: stream Index: utils/ofarc/ZIPArchive.h ================================================================== --- utils/ofarc/ZIPArchive.h +++ utils/ofarc/ZIPArchive.h @@ -15,10 +15,11 @@ #import "OFZIPArchive.h" #import "Archive.h" -@interface ZIPArchive: OFObject +@interface ZIPArchive: OFObject { + OFString *_path; OFZIPArchive *_archive; } @end Index: utils/ofarc/ZIPArchive.m ================================================================== --- utils/ofarc/ZIPArchive.m +++ utils/ofarc/ZIPArchive.m @@ -81,28 +81,33 @@ { if (self == [ZIPArchive class]) app = (OFArc *)[OFApplication sharedApplication].delegate; } -+ (instancetype)archiveWithStream: (OF_KINDOF(OFStream *))stream - mode: (OFString *)mode - encoding: (OFStringEncoding)encoding ++ (instancetype)archiveWithPath: (OFString *)path + stream: (OF_KINDOF(OFStream *))stream + mode: (OFString *)mode + encoding: (OFStringEncoding)encoding { - return [[[self alloc] initWithStream: stream - mode: mode - encoding: encoding] autorelease]; + return [[[self alloc] initWithPath: path + stream: stream + mode: mode + encoding: encoding] autorelease]; } -- (instancetype)initWithStream: (OF_KINDOF(OFStream *))stream - mode: (OFString *)mode - encoding: (OFStringEncoding)encoding +- (instancetype)initWithPath: (OFString *)path + stream: (OF_KINDOF(OFStream *))stream + mode: (OFString *)mode + encoding: (OFStringEncoding)encoding { self = [super init]; @try { + _path = [path copy]; _archive = [[OFZIPArchive alloc] initWithStream: stream mode: mode]; + _archive.delegate = self; } @catch (id e) { [self release]; @throw e; } @@ -109,14 +114,37 @@ return self; } - (void)dealloc { + [_path release]; [_archive release]; [super dealloc]; } + +- (OFSeekableStream *)archive: (OFZIPArchive *)archive + wantsPartNumbered: (unsigned int)partNumber + lastPartNumber: (unsigned int)lastPartNumber +{ + OFString *path; + + if ([_path.pathExtension caseInsensitiveCompare: @"zip"] != + OFOrderedSame) + return nil; + + if (partNumber > 98) + return nil; + + if (partNumber == lastPartNumber) + path = _path; + else + path = [_path.stringByDeletingPathExtension + stringByAppendingFormat: @".z%02u", partNumber + 1]; + + return [OFFile fileWithPath: path mode: @"r"]; +} - (void)listFiles { for (OFZIPArchiveEntry *entry in _archive.entries) { void *pool = objc_autoreleasePoolPush(); Index: utils/ofhttp/Makefile ================================================================== --- utils/ofhttp/Makefile +++ utils/ofhttp/Makefile @@ -15,14 +15,12 @@ CPPFLAGS += -I../../src \ -I../../src/runtime \ -I../../src/exceptions \ -I../../src/tls \ -I../.. \ - -DLOCALIZATION_DIR='"${datadir}/ofhttp/localization"' \ - -DLIB_PREFIX='"${LIB_PREFIX}"' \ - -DLIB_SUFFIX='"${LIB_SUFFIX}"' + -DLOCALIZATION_DIR='"${datadir}/ofhttp/localization"' LIBS := -L../../src -L../../src/linklib -L../../src/tls \ ${OFHTTP_LIBS} ${OBJFW_LIBS} \ -L../../src/runtime -L../../src/runtime/linklib ${RUNTIME_LIBS} \ ${LIBS} LD = ${OBJC} LDFLAGS += ${LDFLAGS_RPATH} Index: utils/ofhttp/OFHTTP.m ================================================================== --- utils/ofhttp/OFHTTP.m +++ utils/ofhttp/OFHTTP.m @@ -50,10 +50,11 @@ #import "OFOpenItemFailedException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFResolveHostFailedException.h" #import "OFSetItemAttributesFailedException.h" +#import "OFTLSHandshakeFailedException.h" #import "OFUnsupportedProtocolException.h" #import "OFWriteFailedException.h" #import "ProgressBar.h" @@ -858,10 +859,26 @@ @" In order to download via HTTPS, you need to " @"either build ObjFW with TLS\n" @" support or preload a library adding TLS " @"support to ObjFW!", @"prog", [OFApplication programName])]; + } else if ([exception isKindOfClass: + [OFTLSHandshakeFailedException class]]) { + OFString *error = OFTLSStreamErrorCodeDescription( + ((OFTLSHandshakeFailedException *)exception) + .errorCode); + + if (!_quiet) + [OFStdOut writeString: @"\n"]; + + [OFStdErr writeLine: OF_LOCALIZED( + @"download_failed_tls_handshake_failed", + @"%[prog]: Failed to download <%[iri]>!\n" + @" TLS handshake failed: %[error]", + @"prog", [OFApplication programName], + @"iri", request.IRI.string, + @"error", error)]; } else if ([exception isKindOfClass: [OFReadOrWriteFailedException class]]) { OFString *error = OF_LOCALIZED( @"download_failed_read_or_write_failed_any", @"Read or write failed"); @@ -1094,11 +1111,11 @@ _currentFileName = [_outputPath copy]; if (_currentFileName == nil) _currentFileName = [IRI.path.lastPathComponent copy]; - if ([_currentFileName isEqual: @"/"]) { + if ([_currentFileName isEqual: @"/"] || _currentFileName.length == 0) { [_currentFileName release]; _currentFileName = nil; } if (_currentFileName == nil) Index: utils/ofhttp/localization/de.json ================================================================== --- utils/ofhttp/localization/de.json +++ utils/ofhttp/localization/de.json @@ -58,10 +58,14 @@ "Unterstützung\n", " kompilieren oder eine Bibliothek mittels „preload” laden, welche ", "TLS-Support\n", " zu ObjFW hinzufügt!" ], + "download_failed_tls_handshake_failed": [ + "%[prog]: Fehler beim Download von <%[iri]>!\n", + " TLS-Handshake fehlgeschlagen: %[error]" + ], "download_failed_read_or_write_failed_any": "Lesen oder Schreiben", "download_failed_read_or_write_failed_read": "Lesen", "download_failed_read_or_write_failed_write": "Schreiben", "download_failed_read_or_write_failed": [ "%[prog]: Fehler beim Download von <%[iri]>!\n",