@@ -32,15 +32,11 @@ OF_SUBCLASSING_RESTRICTED @interface OFZIPArchive: OFObject { OFStream *_stream; int64_t _offset; - enum { - OF_ZIP_ARCHIVE_MODE_READ, - OF_ZIP_ARCHIVE_MODE_WRITE, - OF_ZIP_ARCHIVE_MODE_APPEND - } _mode; + uint_least8_t _mode; uint32_t _diskNumber, _centralDirectoryDisk; uint64_t _centralDirectoryEntriesInDisk, _centralDirectoryEntries; uint64_t _centralDirectorySize; int64_t _centralDirectoryOffset; OFString *_Nullable _archiveComment; @@ -74,12 +70,11 @@ * @param mode The mode for the ZIP file. Valid modes are "r" for reading, * "w" for creating a new file and "a" for appending to an existing * archive. * @return A new, autoreleased OFZIPArchive */ -+ (instancetype)archiveWithStream: (OFStream *)stream - mode: (OFString *)mode; ++ (instancetype)archiveWithStream: (OFStream *)stream mode: (OFString *)mode; #ifdef OF_HAVE_FILES /** * @brief Creates a new OFZIPArchive object with the specified file. * @@ -87,12 +82,11 @@ * @param mode The mode for the ZIP file. Valid modes are "r" for reading, * "w" for creating a new file and "a" for appending to an existing * archive. * @return A new, autoreleased OFZIPArchive */ -+ (instancetype)archiveWithPath: (OFString *)path - mode: (OFString *)mode; ++ (instancetype)archiveWithPath: (OFString *)path mode: (OFString *)mode; #endif - (instancetype)init OF_UNAVAILABLE; /** @@ -118,12 +112,11 @@ * @param mode The mode for the ZIP file. Valid modes are "r" for reading, * "w" for creating a new file and "a" for appending to an existing * archive. * @return An initialized OFZIPArchive */ -- (instancetype)initWithPath: (OFString *)path - mode: (OFString *)mode; +- (instancetype)initWithPath: (OFString *)path mode: (OFString *)mode; #endif /** * @brief Returns a stream for reading the specified file from the archive. * @@ -172,7 +165,18 @@ /** * @brief Closes the OFZIPArchive. */ - (void)close; @end + +#ifdef __cplusplus +extern "C" { +#endif +extern uint32_t OFZIPArchiveReadField32(const uint8_t *_Nonnull *_Nonnull, + uint16_t *_Nonnull); +extern uint64_t OFZIPArchiveReadField64(const uint8_t *_Nonnull *_Nonnull, + uint16_t *_Nonnull); +#ifdef __cplusplus +} +#endif OF_ASSUME_NONNULL_END