Index: src/OFASPrintF.m ================================================================== --- src/OFASPrintF.m +++ src/OFASPrintF.m @@ -39,12 +39,13 @@ #ifdef OF_HAVE_SYS_TYPES_H # include #endif #import "OFASPrintF.h" -#import "OFString.h" #import "OFLocale.h" +#import "OFString.h" +#import "OFString+Private.h" #import "OFInitializationFailedException.h" #define maxSubformatLen 64 Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -39,10 +39,14 @@ #import "OFNotificationCenter.h" #import "OFPair.h" #import "OFRunLoop+Private.h" #import "OFRunLoop.h" #import "OFSandbox.h" +#ifdef OF_HAVE_SOCKETS +# import "OFSocket.h" +# import "OFSocket+Private.h" +#endif #import "OFStdIOStream.h" #import "OFString.h" #import "OFSystemInfo.h" #import "OFThread+Private.h" #import "OFThread.h" Index: src/OFConcreteValue.m ================================================================== --- src/OFConcreteValue.m +++ src/OFConcreteValue.m @@ -18,10 +18,11 @@ */ #import "OFConcreteValue.h" #import "OFMethodSignature.h" #import "OFString.h" +#import "OFString+Private.h" #import "OFOutOfRangeException.h" @implementation OFConcreteValue - (instancetype)initWithBytes: (const void *)bytes Index: src/OFConstantString.m ================================================================== --- src/OFConstantString.m +++ src/OFConstantString.m @@ -24,10 +24,11 @@ #include #include #import "OFConstantString.h" #import "OFUTF8String.h" +#import "OFUTF8String+Private.h" #import "OFInitializationFailedException.h" #import "OFInvalidEncodingException.h" #import "OFOutOfMemoryException.h" Index: src/OFDNSResolver.m ================================================================== --- src/OFDNSResolver.m +++ src/OFDNSResolver.m @@ -30,10 +30,12 @@ #import "OFDate.h" #import "OFDictionary.h" #import "OFHostAddressResolver.h" #import "OFNumber.h" #import "OFPair.h" +#import "OFSocket.h" +#import "OFSocket+Private.h" #import "OFString.h" #import "OFTCPSocket.h" #import "OFTimer.h" #import "OFUDPSocket.h" #import "OFUDPSocket+Private.h" Index: src/OFHTTPServer.m ================================================================== --- src/OFHTTPServer.m +++ src/OFHTTPServer.m @@ -32,11 +32,14 @@ #import "OFDictionary.h" #import "OFHTTPRequest.h" #import "OFHTTPResponse.h" #import "OFIRI.h" #import "OFNumber.h" +#import "OFSocket.h" #import "OFSocket+Private.h" +#import "OFString.h" +#import "OFString+Private.h" #import "OFTCPSocket.h" #import "OFThread.h" #import "OFTimer.h" #import "OFAlreadyOpenException.h" Index: src/OFIRI+Private.h ================================================================== --- src/OFIRI+Private.h +++ src/OFIRI+Private.h @@ -22,7 +22,17 @@ OF_ASSUME_NONNULL_BEGIN @interface OFIRI () - (instancetype)of_init OF_METHOD_FAMILY(init); @end + +#ifdef __cplusplus +extern "C" { +#endif +extern bool _OFIRIIsIPv6Host(OFString *host) OF_VISIBILITY_HIDDEN; +extern void _OFIRIVerifyIsEscaped(OFString *, OFCharacterSet *, bool) + OF_VISIBILITY_HIDDEN; +#ifdef __cplusplus +} +#endif OF_ASSUME_NONNULL_END Index: src/OFIRI.h ================================================================== --- src/OFIRI.h +++ src/OFIRI.h @@ -406,18 +406,8 @@ * @return The characters allowed in the fragment part of an IRI. */ + (OFCharacterSet *)IRIFragmentAllowedCharacterSet; @end -#ifdef __cplusplus -extern "C" { -#endif -extern bool _OFIRIIsIPv6Host(OFString *host) OF_VISIBILITY_HIDDEN; -extern void _OFIRIVerifyIsEscaped(OFString *, OFCharacterSet *, bool) - OF_VISIBILITY_HIDDEN; -#ifdef __cplusplus -} -#endif - OF_ASSUME_NONNULL_END #import "OFMutableIRI.h" Index: src/OFLocale.m ================================================================== --- src/OFLocale.m +++ src/OFLocale.m @@ -25,10 +25,11 @@ #import "OFArray.h" #import "OFDictionary.h" #import "OFIRI.h" #import "OFNumber.h" #import "OFString.h" +#import "OFString+Private.h" #import "OFOnce.h" #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" Index: src/OFMutableIRI.m ================================================================== --- src/OFMutableIRI.m +++ src/OFMutableIRI.m @@ -18,10 +18,11 @@ */ #include "config.h" #import "OFMutableIRI.h" +#import "OFIRI.h" #import "OFIRI+Private.h" #import "OFArray.h" #import "OFDictionary.h" #ifdef OF_HAVE_FILES # import "OFFileManager.h" Index: src/OFMutableUTF8String.m ================================================================== --- src/OFMutableUTF8String.m +++ src/OFMutableUTF8String.m @@ -24,11 +24,13 @@ #include #import "OFMutableUTF8String.h" #import "OFASPrintF.h" #import "OFString.h" +#import "OFString+Private.h" #import "OFUTF8String.h" +#import "OFUTF8String+Private.h" #import "OFInvalidArgumentException.h" #import "OFInvalidEncodingException.h" #import "OFInvalidFormatException.h" #import "OFOutOfMemoryException.h" Index: src/OFSocket+Private.h ================================================================== --- src/OFSocket+Private.h +++ src/OFSocket+Private.h @@ -93,5 +93,32 @@ net_setsockopt(sock, level, name, value, len) # define socket(domain, type, proto) net_socket(domain, type, proto) typedef u32 in_addr_t; typedef u32 nfds_t; #endif + +OF_ASSUME_NONNULL_BEGIN + +#ifdef __cplusplus +extern "C" { +#endif +extern bool _OFSocketInit(void) OF_VISIBILITY_HIDDEN; +#if defined(OF_HAVE_THREADS) && defined(OF_AMIGAOS) && !defined(OF_MORPHOS) +extern void _OFSocketDeinit(void) OF_VISIBILITY_HIDDEN; +#endif +extern int _OFSocketErrNo(void) OF_VISIBILITY_HIDDEN; +#if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) +extern int _OFGetSockName(OFSocketHandle sock, struct sockaddr *restrict addr, + socklen_t *restrict addrLen) OF_VISIBILITY_HIDDEN; +#endif + +#if defined(OF_HAVE_THREADS) && defined(OF_AMIGAOS) && !defined(OF_MORPHOS) +extern OFTLSKey _OFSocketBaseKey OF_VISIBILITY_HIDDEN; +# ifdef OF_AMIGAOS4 +extern OFTLSKey _OFSocketInterfaceKey OF_VISIBILITY_HIDDEN; +# endif +#endif +#ifdef __cplusplus +} +#endif + +OF_ASSUME_NONNULL_END Index: src/OFSocket.h ================================================================== --- src/OFSocket.h +++ src/OFSocket.h @@ -443,27 +443,10 @@ * @param address The address on which to get the port * @return The port of the address */ extern uint8_t OFSocketAddressAppleTalkPort( const OFSocketAddress *_Nonnull address); - -extern bool _OFSocketInit(void) OF_VISIBILITY_HIDDEN; -#if defined(OF_HAVE_THREADS) && defined(OF_AMIGAOS) && !defined(OF_MORPHOS) -extern void _OFSocketDeinit(void) OF_VISIBILITY_HIDDEN; -#endif -extern int _OFSocketErrNo(void) OF_VISIBILITY_HIDDEN; -#if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) -extern int _OFGetSockName(OFSocketHandle sock, struct sockaddr *restrict addr, - socklen_t *restrict addrLen) OF_VISIBILITY_HIDDEN; -#endif - -#if defined(OF_HAVE_THREADS) && defined(OF_AMIGAOS) && !defined(OF_MORPHOS) -extern OFTLSKey _OFSocketBaseKey OF_VISIBILITY_HIDDEN; -# ifdef OF_AMIGAOS4 -extern OFTLSKey _OFSocketInterfaceKey OF_VISIBILITY_HIDDEN; -# endif -#endif #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/OFSocket.m ================================================================== --- src/OFSocket.m +++ src/OFSocket.m @@ -28,19 +28,19 @@ # include /* For memalign() */ #endif #include +#import "OFSocket.h" +#import "OFSocket+Private.h" #import "OFArray.h" #import "OFCharacterSet.h" #import "OFLocale.h" #ifdef OF_HAVE_THREADS # import "OFMutex.h" #endif #import "OFOnce.h" -#import "OFSocket.h" -#import "OFSocket+Private.h" #import "OFString.h" #ifdef OF_HAVE_THREADS # import "OFTLSKey.h" #endif Index: src/OFStreamSocket.m ================================================================== --- src/OFStreamSocket.m +++ src/OFStreamSocket.m @@ -29,10 +29,11 @@ #import "OFStreamSocket.h" #import "OFStreamSocket+Private.h" #import "OFRunLoop.h" #import "OFRunLoop+Private.h" +#import "OFSocket.h" #import "OFSocket+Private.h" #import "OFAcceptSocketFailedException.h" #import "OFAlreadyOpenException.h" #import "OFInitializationFailedException.h" Index: src/OFString+JSONParsing.m ================================================================== --- src/OFString+JSONParsing.m +++ src/OFString+JSONParsing.m @@ -23,10 +23,11 @@ #include #include #import "OFString+JSONParsing.h" +#import "OFString+Private.h" #import "OFArray.h" #import "OFDictionary.h" #import "OFNumber.h" #import "OFNull.h" Index: src/OFString+PercentEncoding.m ================================================================== --- src/OFString+PercentEncoding.m +++ src/OFString+PercentEncoding.m @@ -21,10 +21,11 @@ #include #include #import "OFString+PercentEncoding.h" +#import "OFString+Private.h" #import "OFCharacterSet.h" #import "OFInvalidFormatException.h" #import "OFInvalidEncodingException.h" #import "OFOutOfMemoryException.h" ADDED src/OFString+Private.h Index: src/OFString+Private.h ================================================================== --- /dev/null +++ src/OFString+Private.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2008-2024 Jonathan Schleifer + * + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 3.0 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * version 3.0 for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * version 3.0 along with this program. If not, see + * . + */ + +#import "OFString.h" + +OF_ASSUME_NONNULL_BEGIN + +#ifdef __cplusplus +extern "C" { +#endif +extern char *_Nullable _OFStrDup(const char *_Nonnull) OF_VISIBILITY_HIDDEN; +extern size_t _OFUTF8StringEncode(OFUnichar, char *) OF_VISIBILITY_HIDDEN; +extern ssize_t _OFUTF8StringDecode(const char *, size_t, OFUnichar *) + OF_VISIBILITY_HIDDEN; +#ifdef __cplusplus +} +#endif + +OF_ASSUME_NONNULL_END Index: src/OFString+XMLUnescaping.m ================================================================== --- src/OFString+XMLUnescaping.m +++ src/OFString+XMLUnescaping.m @@ -19,11 +19,12 @@ #include "config.h" #include -#import "OFString.h" +#import "OFString+XMLUnescaping.h" +#import "OFString+Private.h" #import "OFInvalidFormatException.h" #import "OFUnknownXMLEntityException.h" int _OFString_XMLUnescaping_reference; Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -1352,15 +1352,10 @@ * * @param string The UTF-32 string * @return The length of the specified UTF-32 string */ extern size_t OFUTF32StringLength(const OFChar32 *string); - -extern char *_Nullable _OFStrDup(const char *_Nonnull) OF_VISIBILITY_HIDDEN; -extern size_t _OFUTF8StringEncode(OFUnichar, char *) OF_VISIBILITY_HIDDEN; -extern ssize_t _OFUTF8StringDecode(const char *, size_t, OFUnichar *) - OF_VISIBILITY_HIDDEN; #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -32,10 +32,11 @@ #ifdef HAVE_XLOCALE_H # include #endif #import "OFString.h" +#import "OFString+Private.h" #import "OFASPrintF.h" #import "OFArray.h" #import "OFCharacterSet.h" #import "OFData.h" #import "OFDictionary.h" Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -104,10 +104,11 @@ #if defined(OF_HAVE_THREADS) # import "OFTLSKey.h" # if defined(OF_AMIGAOS) && defined(OF_HAVE_SOCKETS) # import "OFSocket.h" +# import "OFSocket+Private.h" # endif static OFTLSKey threadSelfKey; static OFThread *mainThread; #elif defined(OF_HAVE_SOCKETS) Index: src/OFUTF8String+Private.h ================================================================== --- src/OFUTF8String+Private.h +++ src/OFUTF8String+Private.h @@ -25,7 +25,18 @@ @interface OFUTF8String () - (instancetype)of_initWithUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength storage: (char *)storage OF_METHOD_FAMILY(init); @end + +#ifdef __cplusplus +extern "C" { +#endif +extern int _OFUTF8StringCheck(const char *, size_t, size_t *) + OF_VISIBILITY_HIDDEN; +extern size_t _OFUTF8StringIndexToPosition(const char *, size_t, size_t) + OF_VISIBILITY_HIDDEN; +#ifdef __cplusplus +} +#endif OF_ASSUME_NONNULL_END Index: src/OFUTF8String.h ================================================================== --- src/OFUTF8String.h +++ src/OFUTF8String.h @@ -41,17 +41,6 @@ } *restrict _s; struct OFUTF8StringIvars _storage; } @end -#ifdef __cplusplus -extern "C" { -#endif -extern int _OFUTF8StringCheck(const char *, size_t, size_t *) - OF_VISIBILITY_HIDDEN; -extern size_t _OFUTF8StringIndexToPosition(const char *, size_t, size_t) - OF_VISIBILITY_HIDDEN; -#ifdef __cplusplus -} -#endif - OF_ASSUME_NONNULL_END Index: src/OFUTF8String.m ================================================================== --- src/OFUTF8String.m +++ src/OFUTF8String.m @@ -31,10 +31,12 @@ #import "OFUTF8String+Private.h" #import "OFASPrintF.h" #import "OFArray.h" #import "OFData.h" #import "OFMutableUTF8String.h" +#import "OFString.h" +#import "OFString+Private.h" #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFInvalidEncodingException.h" #import "OFInvalidFormatException.h" ADDED src/OFZIPArchive+Private.h Index: src/OFZIPArchive+Private.h ================================================================== --- /dev/null +++ src/OFZIPArchive+Private.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2008-2024 Jonathan Schleifer + * + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 3.0 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * version 3.0 for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * version 3.0 along with this program. If not, see + * . + */ + +#import "OFZIPArchive.h" + +OF_ASSUME_NONNULL_BEGIN + +#ifdef __cplusplus +extern "C" { +#endif +extern uint32_t _OFZIPArchiveReadField32(const uint8_t *_Nonnull *_Nonnull, + uint16_t *_Nonnull) OF_VISIBILITY_HIDDEN; +extern uint64_t _OFZIPArchiveReadField64(const uint8_t *_Nonnull *_Nonnull, + uint16_t *_Nonnull) OF_VISIBILITY_HIDDEN; +#ifdef __cplusplus +} +#endif + +OF_ASSUME_NONNULL_END Index: src/OFZIPArchive.h ================================================================== --- src/OFZIPArchive.h +++ src/OFZIPArchive.h @@ -239,17 +239,6 @@ * @throw OFNotOpenException The archive is not open */ - (void)close; @end -#ifdef __cplusplus -extern "C" { -#endif -extern uint32_t _OFZIPArchiveReadField32(const uint8_t *_Nonnull *_Nonnull, - uint16_t *_Nonnull) OF_VISIBILITY_HIDDEN; -extern uint64_t _OFZIPArchiveReadField64(const uint8_t *_Nonnull *_Nonnull, - uint16_t *_Nonnull) OF_VISIBILITY_HIDDEN; -#ifdef __cplusplus -} -#endif - OF_ASSUME_NONNULL_END Index: src/OFZIPArchive.m ================================================================== --- src/OFZIPArchive.m +++ src/OFZIPArchive.m @@ -22,10 +22,11 @@ #include "config.h" #include #import "OFZIPArchive.h" +#import "OFZIPArchive+Private.h" #import "OFZIPArchiveEntry.h" #import "OFZIPArchiveEntry+Private.h" #import "OFArchiveIRIHandler.h" #import "OFArray.h" #import "OFCRC32.h" Index: src/OFZIPArchiveEntry.m ================================================================== --- src/OFZIPArchiveEntry.m +++ src/OFZIPArchiveEntry.m @@ -23,10 +23,12 @@ #import "OFZIPArchiveEntry+Private.h" #import "OFData.h" #import "OFDate.h" #import "OFStream.h" #import "OFString.h" +#import "OFZIPArchive.h" +#import "OFZIPArchive+Private.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFOutOfRangeException.h" Index: src/platform/Windows/OFWin32ConsoleStdIOStream.m ================================================================== --- src/platform/Windows/OFWin32ConsoleStdIOStream.m +++ src/platform/Windows/OFWin32ConsoleStdIOStream.m @@ -49,10 +49,11 @@ #import "OFWin32ConsoleStdIOStream.h" #import "OFColor.h" #import "OFData.h" #import "OFStdIOStream+Private.h" #import "OFString.h" +#import "OFString+Private.h" #import "OFSystemInfo.h" #import "OFInvalidArgumentException.h" #import "OFInvalidEncodingException.h" #import "OFOutOfRangeException.h"