diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-29 18:17:47 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-29 18:18:59 +0100 |
| commit | 65254486efff0fd1bb78a48ff90b7713a5ce539f (patch) | |
| tree | 20ce02c12a74ba9e6cd382bf9c1f09a0c611cb4d /Public | |
| parent | f03986937db0b927da4b10554801e18e4dc7c43f (diff) | |
Kernel: Update TODO.
Src: Refactorings according to clang-format.
Meta: Update specification.
Public: Remove useless UIKit.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Public')
| -rw-r--r-- | Public/SDK/SystemKit/FileAPI.hxx | 39 | ||||
| -rw-r--r-- | Public/SDK/SystemKit/HeapAPI.hxx | 67 | ||||
| -rw-r--r-- | Public/SDK/SystemKit/ThreadAPI.hxx | 33 | ||||
| -rw-r--r-- | Public/SDK/UIKit/UIKitCore.cxx | 11 | ||||
| -rw-r--r-- | Public/SDK/UIKit/UIKitCore.hxx | 55 | ||||
| -rw-r--r-- | Public/SDK/UIKit/UILookAndFeel+UIDC.cxx | 10 | ||||
| -rw-r--r-- | Public/SDK/UIKit/UILookAndFeel+UIDC.hxx | 142 | ||||
| -rw-r--r-- | Public/SDK/UIKit/makefile | 21 | ||||
| -rw-r--r-- | Public/SDK/ZipKit/NewFS-Addon.hpp | 1 | ||||
| -rw-r--r-- | Public/SDK/ZipKit/Zip.cxx | 87 | ||||
| -rw-r--r-- | Public/SDK/ZipKit/Zip.hpp | 39 | ||||
| -rw-r--r-- | Public/SDK/ZipKit/zconf.hpp | 695 | ||||
| -rw-r--r-- | Public/SDK/ZipKit/zlib.hpp | 436 |
13 files changed, 671 insertions, 965 deletions
diff --git a/Public/SDK/SystemKit/FileAPI.hxx b/Public/SDK/SystemKit/FileAPI.hxx index 089a5882..12b57a41 100644 --- a/Public/SDK/SystemKit/FileAPI.hxx +++ b/Public/SDK/SystemKit/FileAPI.hxx @@ -15,27 +15,26 @@ using namespace hCore; -class HFile final -{ - public: - explicit HFile(const char *path); - ~HFile(); - - public: - HCORE_COPY_DEFAULT(HFile); - - public: - void *Read(SizeT off, SizeT sz); - void Write(void *buf, SizeT off, SizeT sz); - void Seek(SizeT off); - void *Read(SizeT sz); - void Write(void *buf, SizeT sz); - void Rewind(); - - public: - void SetMIME(const char *mime); +class HFile final { + public: + explicit HFile(const char *path); + ~HFile(); + + public: + HCORE_COPY_DEFAULT(HFile); + + public: + void *Read(SizeT off, SizeT sz); + void Write(void *buf, SizeT off, SizeT sz); + void Seek(SizeT off); + void *Read(SizeT sz); + void Write(void *buf, SizeT sz); + void Rewind(); + + public: + void SetMIME(const char *mime); }; typedef HFile *HFilePtr; -#endif // ifndef _SYSTEM_KIT_HCORE_FILE_HPP +#endif // ifndef _SYSTEM_KIT_HCORE_FILE_HPP diff --git a/Public/SDK/SystemKit/HeapAPI.hxx b/Public/SDK/SystemKit/HeapAPI.hxx index 8f89235c..aa082ca6 100644 --- a/Public/SDK/SystemKit/HeapAPI.hxx +++ b/Public/SDK/SystemKit/HeapAPI.hxx @@ -18,51 +18,48 @@ class HMemoryException; typedef VoidPtr HHeapPtr; -enum -{ - kHeapExpandable = 2, - kHeapNoExecute = 4, - kHeapShared = 6, - kHeapReadOnly = 8, - kHeapNoFlags = 0 +enum { + kHeapExpandable = 2, + kHeapNoExecute = 4, + kHeapShared = 6, + kHeapReadOnly = 8, + kHeapNoFlags = 0 }; -class HHeap final -{ - private: - explicit HHeap(); +class HHeap final { + private: + explicit HHeap(); - public: - ~HHeap(); + public: + ~HHeap(); - public: - HCORE_COPY_DEFAULT(HHeap); + public: + HCORE_COPY_DEFAULT(HHeap); - public: - static HHeap *Shared() noexcept; + public: + static HHeap *Shared() noexcept; - public: - void Delete(HHeapPtr me) noexcept; - SizeT Tell(HHeapPtr me) noexcept; - HHeapPtr New(const SizeT &sz, const Int32 flags = kHeapNoFlags); + public: + void Delete(HHeapPtr me) noexcept; + SizeT Tell(HHeapPtr me) noexcept; + HHeapPtr New(const SizeT &sz, const Int32 flags = kHeapNoFlags); }; -class HMemoryException final -{ - public: - HMemoryException() = default; - ~HMemoryException() = default; +class HMemoryException final { + public: + HMemoryException() = default; + ~HMemoryException() = default; - public: - HCORE_COPY_DEFAULT(HMemoryException); + public: + HCORE_COPY_DEFAULT(HMemoryException); - public: - const char *Name(); - const char *Reason(); + public: + const char *Name(); + const char *Reason(); - private: - const char *mReason{"Memory error!"}; + private: + const char *mReason{"Memory error!"}; - private: - friend HHeap; + private: + friend HHeap; }; diff --git a/Public/SDK/SystemKit/ThreadAPI.hxx b/Public/SDK/SystemKit/ThreadAPI.hxx index 8d948a35..24fc8507 100644 --- a/Public/SDK/SystemKit/ThreadAPI.hxx +++ b/Public/SDK/SystemKit/ThreadAPI.hxx @@ -16,27 +16,24 @@ #include <NewKit/Defines.hpp> -namespace hCore -{ +namespace hCore { /// @brief Thread Information Block for Local Storage. /// Located in GS on AMD64, Virtual Address 0x10000 (64x0, 32x0, ARM64) -struct ThreadInformationBlock final -{ - const Char TIB_NAME[255]; // Module Name - const UIntPtr TIB_START_CODE; // Start Address - const UIntPtr TIB_START_ALLOC; // Allocation Heap - const UIntPtr TIB_START_STACK; // Stack Pointer. - const Int32 TIB_ARCH; // Architecture and/or platform. +struct ThreadInformationBlock final { + const Char TIB_NAME[255]; // Module Name + const UIntPtr TIB_START_CODE; // Start Address + const UIntPtr TIB_START_ALLOC; // Allocation Heap + const UIntPtr TIB_START_STACK; // Stack Pointer. + const Int32 TIB_ARCH; // Architecture and/or platform. }; -enum -{ - kPC_IA64, - kPC_AMD64 = kPC_IA64, - kPC_ARM, - kMACS_64x0, - kMACS_32x0, +enum { + kPC_IA64, + kPC_AMD64 = kPC_IA64, + kPC_ARM, + kMACS_64x0, + kMACS_32x0, }; -} // namespace hCore +} // namespace hCore -#endif // __THREAD_API__ +#endif // __THREAD_API__ diff --git a/Public/SDK/UIKit/UIKitCore.cxx b/Public/SDK/UIKit/UIKitCore.cxx deleted file mode 100644 index e43f5a14..00000000 --- a/Public/SDK/UIKit/UIKitCore.cxx +++ /dev/null @@ -1,11 +0,0 @@ -/* - * ======================================================== - * - * hCore - * Copyright Mahrouss Logic, all rights reserved. - * - * ======================================================== - */ - -#include "UIKitCore.hxx" - diff --git a/Public/SDK/UIKit/UIKitCore.hxx b/Public/SDK/UIKit/UIKitCore.hxx deleted file mode 100644 index 05274e97..00000000 --- a/Public/SDK/UIKit/UIKitCore.hxx +++ /dev/null @@ -1,55 +0,0 @@ -/* - * ======================================================== - * - * hCore - * Copyright Mahrouss Logic, all rights reserved. - * - * ======================================================== - */ - -#pragma once - -#include <NewKit/Defines.hpp> - -namespace hCore -{ - //! @brief Window Delegate system. - class CWindowDelegate - { - public: - CWindowDelegate() = default; - ~CWindowDelegate() = default; - - public: - CWindowDelegate& operator=(const CWindowDelegate&) = default; - CWindowDelegate(const CWindowDelegate&) = default; - - virtual void DispatchMessage(UInt32, VoidPtr, SizeT) = 0; - - }; - - typedef CWindowDelegate* CWindowDelegatePtr; - - //! @brief A Window message manager. - //! Takes care of sending message and delegates data to the window. - class CWindowMessage final - { - public: - explicit CWindowMessage() = default; - ~CWindowMessage() = default; - - CWindowMessage& operator=(const CWindowMessage&) = default; - CWindowMessage(const CWindowMessage&) = default; - - //! @brief updates window with message, rpc data, and it's size. - inline void operator()(UInt32 msg, VoidPtr rpc, SizeT rpcSize) - { - fWindowDelegate->DispatchMessage(msg, rpc, rpcSize); - } - - CWindowDelegatePtr fWindowDelegate; - - }; - - typedef VoidPtr CWindowRef; -} diff --git a/Public/SDK/UIKit/UILookAndFeel+UIDC.cxx b/Public/SDK/UIKit/UILookAndFeel+UIDC.cxx deleted file mode 100644 index b4745d7b..00000000 --- a/Public/SDK/UIKit/UILookAndFeel+UIDC.cxx +++ /dev/null @@ -1,10 +0,0 @@ -/* - * ======================================================== - * - * hCore - * Copyright Mahrouss Logic, all rights reserved. - * - * ======================================================== - */ - -#include "UILookAndFeel+UIDC.hxx" diff --git a/Public/SDK/UIKit/UILookAndFeel+UIDC.hxx b/Public/SDK/UIKit/UILookAndFeel+UIDC.hxx deleted file mode 100644 index 75642b50..00000000 --- a/Public/SDK/UIKit/UILookAndFeel+UIDC.hxx +++ /dev/null @@ -1,142 +0,0 @@ -/* - * ======================================================== - * - * hCore - * Copyright Mahrouss Logic, all rights reserved. - * - * ======================================================== - */ - -#pragma once - -#include <UIKit/UIKitCore.hxx> - -namespace hCore -{ -// -// @brief Window Device Context. -// Takes care of drawing the stuff. -// - -class CWindowDC -{ - public: - explicit CWindowDC() = default; - virtual ~CWindowDC() = default; - - CWindowDC &operator=(const CWindowDC &) = default; - CWindowDC(const CWindowDC &) = default; - - public: - //! @brief Draws a rectangle. - //! label: text to show. - //! x: x position. - //! y: y position. - //! w: width - //! h: height - virtual bool DrawRectangle(Int32 x, Int32 y, Int32 w, Int32 h, Int32 r, Int32 g, Int32 b, Int32 a) = 0; - - //! @brief Draws circles.. - //! x: x position. - //! y: y position. - //! enable: enable control. - virtual bool DrawCircle(Int32 x, Int32 y, Int32 w, Int32 h, float radius) = 0; - - //! @brief Draws text. - //! x: x position. - //! y: y position. - virtual bool DrawText(const char *text, Int32 x, Int32 y, Int32 w, Int32 h) = 0; - - //! @brief Draws an icon - //! x: x position. - //! y: y position. - //! w: width - //! h: height - //! sz: size of icon - //! icon: icon pointer. - virtual bool DrawIcon(VoidPtr icon, SizeT sz, Int32 y, Int32 w, Int32 h, Int32 bpp); -}; - -// -// @brief Window Look and feel class. -// Takes care of drawing the stuff. -// - -class CWindowLookAndFeel -{ - public: - CWindowLookAndFeel() = default; - virtual ~CWindowLookAndFeel() = default; - - CWindowLookAndFeel &operator=(const CWindowLookAndFeel &) = default; - CWindowLookAndFeel(const CWindowLookAndFeel &) = default; - - public: - //! @brief Draw button virtual method. - //! label: text to show. - //! x: x position. - //! y: y position. - //! w: width - //! h: height - virtual bool DrawButton(const char *label, Int32 x, Int32 y, Int32 w, Int32 h) = 0; - - //! @brief Draw button (hovered) virtual method. - //! label: text to show. - //! x: x position. - //! y: y position. - //! w: width - //! h: height - virtual bool DrawButtonHovered(const char *label, Int32 x, Int32 y, Int32 w, Int32 h) = 0; - - //! @brief Draws a radio checkbox. - //! x: x position. - //! y: y position. - //! enable: enable control. - virtual bool DrawRadio(const bool enable, Int32 x, Int32 y) = 0; - - //! @brief Draws a check-box. - //! x: x position. - //! y: y position. - virtual bool DrawCheckbox(const bool enable, Int32 x, Int32 y) = 0; - - //! @brief Draws a textbox. - //! x: x position. - //! y: y position. - virtual bool DrawTextBox(const char *content, Int32 x, Int32 y, Int32 w, Int32 h) = 0; - - //! @brief Draws a window. - //! x: x position. - //! y: y position. - virtual bool DrawWindow(const char *title, Int32 x, Int32 y, Int32 w, Int32 h) = 0; - - //! @brief Draws a window in focused mode. - //! x: x position. - //! y: y position. - virtual bool DrawWindowFocused(const char *title, Int32 x, Int32 y, Int32 w, Int32 h) = 0; - - // does something similar to this. - // ----- MY GROUP NAME -------------- - // | THIS IS A LABEL | - // | | - // | | BUTTON | | - // |--------------------------------- - virtual bool DrawGroupBox(const char *title) = 0; - - // This enum is telling how to draw the cursor - enum - { - kQuestion, - kPointer, - kSelection, - kText, - }; - - virtual bool DrawCursor(Int32 x, Int32 y, Int32 type) = 0; -}; -} // namespace hCore - -// These macros are used to pass colors as arguments. -// pDC->DrawRectangle(0, 0, 10, 10, RgbArg(255, 255, 255)); - -#define RgbArg(R, G, B) R / 255, G / 255, B / 255 -#define RgbaArg(R, G, B, A) RgbArg(R, G, B), A / 255 diff --git a/Public/SDK/UIKit/makefile b/Public/SDK/UIKit/makefile deleted file mode 100644 index 103bc0c8..00000000 --- a/Public/SDK/UIKit/makefile +++ /dev/null @@ -1,21 +0,0 @@ -################################################## -# ; (C) Mahrouss Logic, 2024, all rights reserved. -# This is the UIKit Makefile. -################################################## - -CC=x86_64-w64-mingw32-g++ -CCFLAGS=-c -ffreestanding -fno-rtti -fno-exceptions -std=c++20 -ASM=nasm -ASMFLAGS=-f elf64 - -.PHONY: build_uikit -build_uikit: - $(CC) -I../ -I../../../Private/ $(CCFLAGS) *.cxx - -.PHONY: all -all: build_uikit - @echo "Done." - -.PHONY: clean -clean: - rm -f *.o diff --git a/Public/SDK/ZipKit/NewFS-Addon.hpp b/Public/SDK/ZipKit/NewFS-Addon.hpp index de308389..0325f81e 100644 --- a/Public/SDK/ZipKit/NewFS-Addon.hpp +++ b/Public/SDK/ZipKit/NewFS-Addon.hpp @@ -16,4 +16,3 @@ // NewFS catalog has password attached to it. #define kNewFSHasPassword 256 - diff --git a/Public/SDK/ZipKit/Zip.cxx b/Public/SDK/ZipKit/Zip.cxx index 79788a8e..71523143 100644 --- a/Public/SDK/ZipKit/Zip.cxx +++ b/Public/SDK/ZipKit/Zip.cxx @@ -14,67 +14,64 @@ #define kInitialSz 4096 -namespace ZipKit -{ -ZipStream::ZipStream() : fSharedData(HHeap::Shared()->New(kInitialSz, kHeapExpandable)), fSharedSz(kInitialSz) -{ -} +namespace ZipKit { +ZipStream::ZipStream() + : fSharedData(HHeap::Shared()->New(kInitialSz, kHeapExpandable)), + fSharedSz(kInitialSz) {} -ZipStream::~ZipStream() noexcept -{ - if (fSharedData) - HHeap::Shared()->Delete(fSharedData); +ZipStream::~ZipStream() noexcept { + if (fSharedData) HHeap::Shared()->Delete(fSharedData); } -HFilePtr ZipStream::FlushToFile(const char *name) -{ - HFilePtr fp = new HFile(name); - MUST_PASS(fp); +HFilePtr ZipStream::FlushToFile(const char *name) { + HFilePtr fp = new HFile(name); + MUST_PASS(fp); - this->fSharedSz = HHeap::Shared()->Tell(this->fSharedData); + this->fSharedSz = HHeap::Shared()->Tell(this->fSharedData); - fp->SetMIME("application/x-bzip"); - fp->Write(this->fSharedData, this->fSharedSz); + fp->SetMIME("application/x-bzip"); + fp->Write(this->fSharedData, this->fSharedSz); - return fp; + return fp; } -void *ZipStream::Deflate(const char *name) -{ - z_stream deflate_stream{0}; +void *ZipStream::Deflate(const char *name) { + z_stream deflate_stream{0}; - deflate_stream.zalloc = Z_NULL; - deflate_stream.zfree = Z_NULL; - deflate_stream.opaque = Z_NULL; + deflate_stream.zalloc = Z_NULL; + deflate_stream.zfree = Z_NULL; + deflate_stream.opaque = Z_NULL; - deflate_stream.avail_in = (uInt)this->fSharedSz + 1; // size of input, string + terminator - deflate_stream.next_in = (Bytef *)this->fSharedData; // input char array - deflate_stream.avail_out = (uInt)this->fSharedSz; // size of output - deflate_stream.next_out = (Bytef *)this->fSharedData; // output char array + deflate_stream.avail_in = + (uInt)this->fSharedSz + 1; // size of input, string + terminator + deflate_stream.next_in = (Bytef *)this->fSharedData; // input char array + deflate_stream.avail_out = (uInt)this->fSharedSz; // size of output + deflate_stream.next_out = (Bytef *)this->fSharedData; // output char array - deflateInit(&deflate_stream, 1); - deflate(&deflate_stream, Z_NO_FLUSH); - deflateEnd(&deflate_stream); + deflateInit(&deflate_stream, 1); + deflate(&deflate_stream, Z_NO_FLUSH); + deflateEnd(&deflate_stream); - return this->fSharedData; + return this->fSharedData; } -void ZipStream::Inflate(const char *name, void *data) -{ - z_stream inflate_stream{0}; +void ZipStream::Inflate(const char *name, void *data) { + z_stream inflate_stream{0}; - inflate_stream.zalloc = Z_NULL; - inflate_stream.zfree = Z_NULL; - inflate_stream.opaque = Z_NULL; + inflate_stream.zalloc = Z_NULL; + inflate_stream.zfree = Z_NULL; + inflate_stream.opaque = Z_NULL; - inflate_stream.avail_in = (SizeT)((char *)(inflate_stream.next_out - (Bytef *)this->fSharedData)); // size of input + inflate_stream.avail_in = + (SizeT)((char *)(inflate_stream.next_out - + (Bytef *)this->fSharedData)); // size of input - inflate_stream.next_in = (Bytef *)this->fSharedData; // input char array - inflate_stream.avail_out = (uInt)this->fSharedSz; // size of output - inflate_stream.next_out = (Bytef *)this->fSharedData; // output char array + inflate_stream.next_in = (Bytef *)this->fSharedData; // input char array + inflate_stream.avail_out = (uInt)this->fSharedSz; // size of output + inflate_stream.next_out = (Bytef *)this->fSharedData; // output char array - inflateInit(&inflate_stream); - inflate(&inflate_stream, Z_NO_FLUSH); - inflateEnd(&inflate_stream); + inflateInit(&inflate_stream); + inflate(&inflate_stream, Z_NO_FLUSH); + inflateEnd(&inflate_stream); } -} // namespace ZipKit +} // namespace ZipKit diff --git a/Public/SDK/ZipKit/Zip.hpp b/Public/SDK/ZipKit/Zip.hpp index 0130a021..91ecde51 100644 --- a/Public/SDK/ZipKit/Zip.hpp +++ b/Public/SDK/ZipKit/Zip.hpp @@ -11,34 +11,31 @@ #define Z_SOLO 1 -#include <ZipKit/Defines.hpp> - #include <CompilerKit/Compiler.hpp> +#include <ZipKit/Defines.hpp> #include <ZipKit/zlib.hpp> -namespace ZipKit -{ +namespace ZipKit { class ZipStream; -class ZipStream final -{ - public: - explicit ZipStream(); - ~ZipStream() noexcept; +class ZipStream final { + public: + explicit ZipStream(); + ~ZipStream() noexcept; - public: - HCORE_COPY_DEFAULT(ZipStream); + public: + HCORE_COPY_DEFAULT(ZipStream); - public: - HFilePtr FlushToFile(const char *name); - void *Deflate(const char *name); - void Inflate(const char *name, void *data); + public: + HFilePtr FlushToFile(const char *name); + void *Deflate(const char *name); + void Inflate(const char *name, void *data); - private: - VoidPtr fSharedData{nullptr}; - SizeT fSharedSz{0}; + private: + VoidPtr fSharedData{nullptr}; + SizeT fSharedSz{0}; - private: - z_stream fStream; + private: + z_stream fStream; }; -} // namespace ZipKit +} // namespace ZipKit diff --git a/Public/SDK/ZipKit/zconf.hpp b/Public/SDK/ZipKit/zconf.hpp index 0eb08624..14ab12d7 100644 --- a/Public/SDK/ZipKit/zconf.hpp +++ b/Public/SDK/ZipKit/zconf.hpp @@ -14,177 +14,177 @@ * Even better than compiling with -DZ_PREFIX would be to use configure to set * this permanently in zconf.h using "./configure --zprefix". */ -#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ -# define Z_PREFIX_SET +#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ +#define Z_PREFIX_SET /* all linked symbols and init macros */ -# define _dist_code z__dist_code -# define _length_code z__length_code -# define _tr_align z__tr_align -# define _tr_flush_bits z__tr_flush_bits -# define _tr_flush_block z__tr_flush_block -# define _tr_init z__tr_init -# define _tr_stored_block z__tr_stored_block -# define _tr_tally z__tr_tally -# define adler32 z_adler32 -# define adler32_combine z_adler32_combine -# define adler32_combine64 z_adler32_combine64 -# define adler32_z z_adler32_z -# ifndef Z_SOLO -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# endif -# define crc32 z_crc32 -# define crc32_combine z_crc32_combine -# define crc32_combine64 z_crc32_combine64 -# define crc32_z z_crc32_z -# define deflate z_deflate -# define deflateBound z_deflateBound -# define deflateCopy z_deflateCopy -# define deflateEnd z_deflateEnd -# define deflateGetDictionary z_deflateGetDictionary -# define deflateInit z_deflateInit -# define deflateInit2 z_deflateInit2 -# define deflateInit2_ z_deflateInit2_ -# define deflateInit_ z_deflateInit_ -# define deflateParams z_deflateParams -# define deflatePending z_deflatePending -# define deflatePrime z_deflatePrime -# define deflateReset z_deflateReset -# define deflateResetKeep z_deflateResetKeep -# define deflateSetDictionary z_deflateSetDictionary -# define deflateSetHeader z_deflateSetHeader -# define deflateTune z_deflateTune -# define deflate_copyright z_deflate_copyright -# define get_crc_table z_get_crc_table -# ifndef Z_SOLO -# define gz_error z_gz_error -# define gz_intmax z_gz_intmax -# define gz_strwinerror z_gz_strwinerror -# define gzbuffer z_gzbuffer -# define gzclearerr z_gzclearerr -# define gzclose z_gzclose -# define gzclose_r z_gzclose_r -# define gzclose_w z_gzclose_w -# define gzdirect z_gzdirect -# define gzdopen z_gzdopen -# define gzeof z_gzeof -# define gzerror z_gzerror -# define gzflush z_gzflush -# define gzfread z_gzfread -# define gzfwrite z_gzfwrite -# define gzgetc z_gzgetc -# define gzgetc_ z_gzgetc_ -# define gzgets z_gzgets -# define gzoffset z_gzoffset -# define gzoffset64 z_gzoffset64 -# define gzopen z_gzopen -# define gzopen64 z_gzopen64 -# ifdef _WIN32 -# define gzopen_w z_gzopen_w -# endif -# define gzprintf z_gzprintf -# define gzputc z_gzputc -# define gzputs z_gzputs -# define gzread z_gzread -# define gzrewind z_gzrewind -# define gzseek z_gzseek -# define gzseek64 z_gzseek64 -# define gzsetparams z_gzsetparams -# define gztell z_gztell -# define gztell64 z_gztell64 -# define gzungetc z_gzungetc -# define gzvprintf z_gzvprintf -# define gzwrite z_gzwrite -# endif -# define inflate z_inflate -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define inflateBackInit z_inflateBackInit -# define inflateBackInit_ z_inflateBackInit_ -# define inflateCodesUsed z_inflateCodesUsed -# define inflateCopy z_inflateCopy -# define inflateEnd z_inflateEnd -# define inflateGetDictionary z_inflateGetDictionary -# define inflateGetHeader z_inflateGetHeader -# define inflateInit z_inflateInit -# define inflateInit2 z_inflateInit2 -# define inflateInit2_ z_inflateInit2_ -# define inflateInit_ z_inflateInit_ -# define inflateMark z_inflateMark -# define inflatePrime z_inflatePrime -# define inflateReset z_inflateReset -# define inflateReset2 z_inflateReset2 -# define inflateResetKeep z_inflateResetKeep -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateUndermine z_inflateUndermine -# define inflateValidate z_inflateValidate -# define inflate_copyright z_inflate_copyright -# define inflate_fast z_inflate_fast -# define inflate_table z_inflate_table -# ifndef Z_SOLO -# define uncompress z_uncompress -# define uncompress2 z_uncompress2 -# endif -# define zError z_zError -# ifndef Z_SOLO -# define zcalloc z_zcalloc -# define zcfree z_zcfree -# endif -# define zlibCompileFlags z_zlibCompileFlags -# define zlibVersion z_zlibVersion +#define _dist_code z__dist_code +#define _length_code z__length_code +#define _tr_align z__tr_align +#define _tr_flush_bits z__tr_flush_bits +#define _tr_flush_block z__tr_flush_block +#define _tr_init z__tr_init +#define _tr_stored_block z__tr_stored_block +#define _tr_tally z__tr_tally +#define adler32 z_adler32 +#define adler32_combine z_adler32_combine +#define adler32_combine64 z_adler32_combine64 +#define adler32_z z_adler32_z +#ifndef Z_SOLO +#define compress z_compress +#define compress2 z_compress2 +#define compressBound z_compressBound +#endif +#define crc32 z_crc32 +#define crc32_combine z_crc32_combine +#define crc32_combine64 z_crc32_combine64 +#define crc32_z z_crc32_z +#define deflate z_deflate +#define deflateBound z_deflateBound +#define deflateCopy z_deflateCopy +#define deflateEnd z_deflateEnd +#define deflateGetDictionary z_deflateGetDictionary +#define deflateInit z_deflateInit +#define deflateInit2 z_deflateInit2 +#define deflateInit2_ z_deflateInit2_ +#define deflateInit_ z_deflateInit_ +#define deflateParams z_deflateParams +#define deflatePending z_deflatePending +#define deflatePrime z_deflatePrime +#define deflateReset z_deflateReset +#define deflateResetKeep z_deflateResetKeep +#define deflateSetDictionary z_deflateSetDictionary +#define deflateSetHeader z_deflateSetHeader +#define deflateTune z_deflateTune +#define deflate_copyright z_deflate_copyright +#define get_crc_table z_get_crc_table +#ifndef Z_SOLO +#define gz_error z_gz_error +#define gz_intmax z_gz_intmax +#define gz_strwinerror z_gz_strwinerror +#define gzbuffer z_gzbuffer +#define gzclearerr z_gzclearerr +#define gzclose z_gzclose +#define gzclose_r z_gzclose_r +#define gzclose_w z_gzclose_w +#define gzdirect z_gzdirect +#define gzdopen z_gzdopen +#define gzeof z_gzeof +#define gzerror z_gzerror +#define gzflush z_gzflush +#define gzfread z_gzfread +#define gzfwrite z_gzfwrite +#define gzgetc z_gzgetc +#define gzgetc_ z_gzgetc_ +#define gzgets z_gzgets +#define gzoffset z_gzoffset +#define gzoffset64 z_gzoffset64 +#define gzopen z_gzopen +#define gzopen64 z_gzopen64 +#ifdef _WIN32 +#define gzopen_w z_gzopen_w +#endif +#define gzprintf z_gzprintf +#define gzputc z_gzputc +#define gzputs z_gzputs +#define gzread z_gzread +#define gzrewind z_gzrewind +#define gzseek z_gzseek +#define gzseek64 z_gzseek64 +#define gzsetparams z_gzsetparams +#define gztell z_gztell +#define gztell64 z_gztell64 +#define gzungetc z_gzungetc +#define gzvprintf z_gzvprintf +#define gzwrite z_gzwrite +#endif +#define inflate z_inflate +#define inflateBack z_inflateBack +#define inflateBackEnd z_inflateBackEnd +#define inflateBackInit z_inflateBackInit +#define inflateBackInit_ z_inflateBackInit_ +#define inflateCodesUsed z_inflateCodesUsed +#define inflateCopy z_inflateCopy +#define inflateEnd z_inflateEnd +#define inflateGetDictionary z_inflateGetDictionary +#define inflateGetHeader z_inflateGetHeader +#define inflateInit z_inflateInit +#define inflateInit2 z_inflateInit2 +#define inflateInit2_ z_inflateInit2_ +#define inflateInit_ z_inflateInit_ +#define inflateMark z_inflateMark +#define inflatePrime z_inflatePrime +#define inflateReset z_inflateReset +#define inflateReset2 z_inflateReset2 +#define inflateResetKeep z_inflateResetKeep +#define inflateSetDictionary z_inflateSetDictionary +#define inflateSync z_inflateSync +#define inflateSyncPoint z_inflateSyncPoint +#define inflateUndermine z_inflateUndermine +#define inflateValidate z_inflateValidate +#define inflate_copyright z_inflate_copyright +#define inflate_fast z_inflate_fast +#define inflate_table z_inflate_table +#ifndef Z_SOLO +#define uncompress z_uncompress +#define uncompress2 z_uncompress2 +#endif +#define zError z_zError +#ifndef Z_SOLO +#define zcalloc z_zcalloc +#define zcfree z_zcfree +#endif +#define zlibCompileFlags z_zlibCompileFlags +#define zlibVersion z_zlibVersion /* all zlib typedefs in zlib.h and zconf.h */ -# define Byte z_Byte -# define Bytef z_Bytef -# define alloc_func z_alloc_func -# define charf z_charf -# define free_func z_free_func -# ifndef Z_SOLO -# define gzFile z_gzFile -# endif -# define gz_header z_gz_header -# define gz_headerp z_gz_headerp -# define in_func z_in_func -# define intf z_intf -# define out_func z_out_func -# define uInt z_uInt -# define uIntf z_uIntf -# define uLong z_uLong -# define uLongf z_uLongf -# define voidp z_voidp -# define voidpc z_voidpc -# define voidpf z_voidpf +#define Byte z_Byte +#define Bytef z_Bytef +#define alloc_func z_alloc_func +#define charf z_charf +#define free_func z_free_func +#ifndef Z_SOLO +#define gzFile z_gzFile +#endif +#define gz_header z_gz_header +#define gz_headerp z_gz_headerp +#define in_func z_in_func +#define intf z_intf +#define out_func z_out_func +#define uInt z_uInt +#define uIntf z_uIntf +#define uLong z_uLong +#define uLongf z_uLongf +#define voidp z_voidp +#define voidpc z_voidpc +#define voidpf z_voidpf /* all zlib structs in zlib.h and zconf.h */ -# define gz_header_s z_gz_header_s -# define internal_state z_internal_state +#define gz_header_s z_gz_header_s +#define internal_state z_internal_state #endif #if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS +#define MSDOS #endif #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 +#define OS2 #endif #if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS +#define WINDOWS #endif #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif +#ifndef WIN32 +#define WIN32 +#endif #endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif +#if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) +#ifndef SYS16BIT +#define SYS16BIT +#endif +#endif #endif /* @@ -192,73 +192,73 @@ * than 64k bytes at a time (needed on systems with 16-bit int). */ #ifdef SYS16BIT -# define MAXSEG_64K +#define MAXSEG_64K #endif #ifdef MSDOS -# define UNALIGNED_OK +#define UNALIGNED_OK #endif #ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif +#ifndef STDC +#define STDC +#endif +#if __STDC_VERSION__ >= 199901L +#ifndef STDC99 +#define STDC99 +#endif +#endif #endif #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC +#define STDC #endif #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC +#define STDC #endif #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC +#define STDC #endif #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC +#define STDC #endif -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC +#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ +#define STDC #endif #ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif +#ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +#define const /* note: need a more gentle solution here */ +#endif #endif #if defined(ZLIB_CONST) && !defined(z_const) -# define z_const const +#define z_const const #else -# define z_const +#define z_const #endif #ifdef Z_SOLO - typedef unsigned long z_size_t; +typedef unsigned long z_size_t; +#else +#define z_longlong long long +#if defined(NO_SIZE_T) +typedef unsigned NO_SIZE_T z_size_t; +#elif defined(STDC) +#include <stddef.h> +typedef size_t z_size_t; #else -# define z_longlong long long -# if defined(NO_SIZE_T) - typedef unsigned NO_SIZE_T z_size_t; -# elif defined(STDC) -# include <stddef.h> - typedef size_t z_size_t; -# else - typedef unsigned long z_size_t; -# endif -# undef z_longlong +typedef unsigned long z_size_t; +#endif +#undef z_longlong #endif /* Maximum value for memLevel in deflateInit2 */ #ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif +#ifdef MAXSEG_64K +#define MAX_MEM_LEVEL 8 +#else +#define MAX_MEM_LEVEL 9 +#endif #endif /* Maximum value for windowBits in deflateInit2 and inflateInit2. @@ -267,7 +267,7 @@ * gzip.) */ #ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ +#define MAX_WBITS 15 /* 32K LZ77 window */ #endif /* The memory requirements for deflate are (in bytes): @@ -283,22 +283,22 @@ for small objects. */ - /* Type declarations */ +/* Type declarations */ #ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif +#ifdef STDC +#define OF(args) args +#else +#define OF(args) () +#endif #endif #ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif +#if defined(STDC) || defined(Z_HAVE_STDARG_H) +#define Z_ARG(args) args +#else +#define Z_ARG(args) () +#endif #endif /* The following definitions for FAR are needed only for MSDOS mixed @@ -308,153 +308,152 @@ * just define FAR to be empty. */ #ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif +#if defined(M_I86SM) || defined(M_I86MM) +/* MSC small or medium model */ +#define SMALL_MEDIUM +#ifdef _MSC_VER +#define FAR _far +#else +#define FAR far +#endif +#endif +#if (defined(__SMALL__) || defined(__MEDIUM__)) +/* Turbo C small or medium model */ +#define SMALL_MEDIUM +#ifdef __BORLANDC__ +#define FAR _far +#else +#define FAR far +#endif +#endif #endif #if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include <windows.h> - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - - -#if defined (__hCore__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT -# define ZEXPORTVA -# else -# define ZEXPORT -# define ZEXPORTVA -# endif -# endif +/* If building or using zlib as a DLL, define ZLIB_DLL. + * This is not mandatory, but it offers a little performance increase. + */ +#ifdef ZLIB_DLL +#if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) +#ifdef ZLIB_INTERNAL +#define ZEXTERN extern __declspec(dllexport) +#else +#define ZEXTERN extern __declspec(dllimport) +#endif +#endif +#endif /* ZLIB_DLL */ + /* If building or using zlib with the WINAPI/WINAPIV calling convention, + * define ZLIB_WINAPI. + * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. + */ +#ifdef ZLIB_WINAPI +#ifdef FAR +#undef FAR +#endif +#include <windows.h> +/* No need for _export, use ZLIB.DEF instead. */ +/* For complete Windows compatibility, use WINAPI, not __stdcall. */ +#define ZEXPORT WINAPI +#ifdef WIN32 +#define ZEXPORTVA WINAPIV +#else +#define ZEXPORTVA FAR CDECL +#endif +#endif +#endif + +#if defined(__BEOS__) +#ifdef ZLIB_DLL +#ifdef ZLIB_INTERNAL +#define ZEXPORT __declspec(dllexport) +#define ZEXPORTVA __declspec(dllexport) +#else +#define ZEXPORT __declspec(dllimport) +#define ZEXPORTVA __declspec(dllimport) +#endif +#endif +#endif + +#if defined(__HCORE__) +#ifdef ZLIB_DLL +#ifdef ZLIB_INTERNAL +#define ZEXPORT +#define ZEXPORTVA +#else +#define ZEXPORT +#define ZEXPORTVA +#endif +#endif #endif #ifndef ZEXTERN -# define ZEXTERN extern +#define ZEXTERN extern #endif #ifndef ZEXPORT -# define ZEXPORT +#define ZEXPORT #endif #ifndef ZEXPORTVA -# define ZEXPORTVA +#define ZEXPORTVA #endif #ifndef FAR -# define FAR +#define FAR #endif #if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ +typedef unsigned char Byte; /* 8 bits */ #endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ #ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR +/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +#define Bytef Byte FAR #else - typedef Byte FAR Bytef; +typedef Byte FAR Bytef; #endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; typedef uLong FAR uLongf; #ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; +typedef void const *voidpc; +typedef void FAR *voidpf; +typedef void *voidp; #else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; +typedef Byte const *voidpc; +typedef Byte FAR *voidpf; +typedef Byte *voidp; #endif typedef unsigned long z_crc_t; #if defined(__APPLE__) /* avoid unistd.h on Win32 */ -#if 1 /* was set to #if 1 by ./configure */ -# define Z_HAVE_UNISTD_H +#if 1 /* was set to #if 1 by ./configure */ +#define Z_HAVE_UNISTD_H #endif #endif /* defined(__APPLE__) */ -#if 1 /* was set to #if 1 by ./configure */ -# define Z_HAVE_STDARG_H +#if 1 /* was set to #if 1 by ./configure */ +#define Z_HAVE_STDARG_H #endif #ifdef STDC -# ifndef Z_SOLO -# include <sys/types.h> /* for off_t */ -# endif +#ifndef Z_SOLO +#include <sys/types.h> /* for off_t */ +#endif #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) -# ifndef Z_SOLO -# include <stdarg.h> /* for va_list */ -# endif +#ifndef Z_SOLO +#include <stdarg.h> /* for va_list */ +#endif #endif #ifdef _WIN32 -# ifndef Z_SOLO -# include <stddef.h> /* for wchar_t */ -# endif +#ifndef Z_SOLO +#include <stddef.h> /* for wchar_t */ +#endif #endif /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and @@ -464,74 +463,74 @@ typedef unsigned long z_crc_t; * equivalently requesting no 64-bit operations */ #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 -# undef _LARGEFILE64_SOURCE +#undef _LARGEFILE64_SOURCE #endif #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) -# define Z_HAVE_UNISTD_H +#define Z_HAVE_UNISTD_H #endif #ifndef Z_SOLO -# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) -# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ -# ifdef VMS -# include <unixio.h> /* for off_t */ -# endif -# if !defined(z_off_t) && !defined(__APPLE__) -# define z_off_t off_t -# endif -# endif +#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) +#include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ +#ifdef VMS +#include <unixio.h> /* for off_t */ +#endif +#if !defined(z_off_t) && !defined(__APPLE__) +#define z_off_t off_t +#endif +#endif #endif -#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 -# define Z_LFS64 +#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE - 0 +#define Z_LFS64 #endif #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) -# define Z_LARGE64 +#define Z_LARGE64 #endif -#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) -# define Z_WANT64 +#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS - 0 == 64 && \ + defined(Z_LFS64) +#define Z_WANT64 #endif #if !defined(SEEK_SET) && !defined(Z_SOLO) -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#define SEEK_SET 0 /* Seek from beginning of file. */ +#define SEEK_CUR 1 /* Seek from current position. */ +#define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif #ifndef z_off_t -# define z_off_t long +#define z_off_t long #endif #if !defined(_WIN32) && defined(Z_LARGE64) -# define z_off64_t off64_t +#define z_off64_t off64_t #elif defined(__APPLE__) -# define z_off64_t off_t +#define z_off64_t off_t #else -# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) -# define z_off64_t __int64 -# else -# define z_off64_t z_off_t -# endif +#if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) +#define z_off64_t __int64 +#else +#define z_off64_t z_off_t +#endif #endif /* MVS linker does not support external names larger than 8 bytes */ #if defined(__MVS__) - #pragma map(deflateInit_,"DEIN") - #pragma map(deflateInit2_,"DEIN2") - #pragma map(deflateEnd,"DEEND") - #pragma map(deflateBound,"DEBND") - #pragma map(inflateInit_,"ININ") - #pragma map(inflateInit2_,"ININ2") - #pragma map(inflateEnd,"INEND") - #pragma map(inflateSync,"INSY") - #pragma map(inflateSetDictionary,"INSEDI") - #pragma map(compressBound,"CMBND") - #pragma map(inflate_table,"INTABL") - #pragma map(inflate_fast,"INFA") - #pragma map(inflate_copyright,"INCOPY") +#pragma map(deflateInit_, "DEIN") +#pragma map(deflateInit2_, "DEIN2") +#pragma map(deflateEnd, "DEEND") +#pragma map(deflateBound, "DEBND") +#pragma map(inflateInit_, "ININ") +#pragma map(inflateInit2_, "ININ2") +#pragma map(inflateEnd, "INEND") +#pragma map(inflateSync, "INSY") +#pragma map(inflateSetDictionary, "INSEDI") +#pragma map(compressBound, "CMBND") +#pragma map(inflate_table, "INTABL") +#pragma map(inflate_fast, "INFA") +#pragma map(inflate_copyright, "INCOPY") #endif #endif /* ZCONF_H */ - diff --git a/Public/SDK/ZipKit/zlib.hpp b/Public/SDK/ZipKit/zlib.hpp index 3b576f67..540ab3e8 100644 --- a/Public/SDK/ZipKit/zlib.hpp +++ b/Public/SDK/ZipKit/zlib.hpp @@ -82,30 +82,30 @@ extern "C" { */ typedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size); -typedef void (*free_func)(voidpf opaque, voidpf address); +typedef void (*free_func)(voidpf opaque, voidpf address); struct internal_state; typedef struct z_stream_s { - z_const Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total number of input bytes read so far */ + z_const Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total number of input bytes read so far */ - Bytef *next_out; /* next output byte will go here */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total number of bytes output so far */ + Bytef *next_out; /* next output byte will go here */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total number of bytes output so far */ - z_const char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ + z_const char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ - int data_type; /* best guess about the data type: binary or text - for deflate, or the decoding state for inflate */ - uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ + int data_type; /* best guess about the data type: binary or text + for deflate, or the decoding state for inflate */ + uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ } z_stream; typedef z_stream FAR *z_streamp; @@ -115,20 +115,20 @@ typedef z_stream FAR *z_streamp; for more details on the meanings of these fields. */ typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ + int text; /* true if compressed data believed to be text */ + uLong time; /* modification time */ + int xflags; /* extra flags (not used when writing a gzip file) */ + int os; /* operating system */ + Bytef *extra; /* pointer to extra field or Z_NULL if none */ + uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ + uInt extra_max; /* space at extra (only when reading header) */ + Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ + uInt name_max; /* space at name (only when reading header) */ + Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ + uInt comm_max; /* space at comment (only when reading header) */ + int hcrc; /* true if there was or will be a header crc */ + int done; /* true when done reading gzip header (not used + when writing a gzip file) */ } gz_header; typedef gz_header FAR *gz_headerp; @@ -166,61 +166,60 @@ typedef gz_header FAR *gz_headerp; if the decompressor wants to decompress everything in a single step). */ - /* constants */ +/* constants */ -#define Z_NO_FLUSH 0 +#define Z_NO_FLUSH 0 #define Z_PARTIAL_FLUSH 1 -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -#define Z_TREES 6 +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +#define Z_BLOCK 5 +#define Z_TREES 6 /* Allowed flush values; see deflate() and inflate() below for details */ -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) #define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) #define Z_VERSION_ERROR (-6) /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) /* compression levels */ -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_RLE 3 +#define Z_FIXED 4 +#define Z_DEFAULT_STRATEGY 0 /* compression strategy; see deflateInit2() below for details */ -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 +#define Z_BINARY 0 +#define Z_TEXT 1 +#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ +#define Z_UNKNOWN 2 /* Possible values of the data_type field for deflate() */ -#define Z_DEFLATED 8 +#define Z_DEFLATED 8 /* The deflate compression method (the only one supported in this version) */ -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ #define zlib_version zlibVersion() /* for compatibility with versions < 1.0.2 */ +/* basic functions */ - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion(void); +ZEXTERN const char *ZEXPORT zlibVersion(void); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. This check @@ -249,7 +248,6 @@ ZEXTERN int ZEXPORT deflateInit(z_streamp strm, int level); this will be done by deflate(). */ - ZEXTERN int ZEXPORT deflate(z_streamp strm, int flush); /* deflate compresses as much data as possible, and stops when the input @@ -362,7 +360,6 @@ ZEXTERN int ZEXPORT deflate(z_streamp strm, int flush); continue compressing. */ - ZEXTERN int ZEXPORT deflateEnd(z_streamp strm); /* All dynamically allocated data structures for this stream are freed. @@ -376,7 +373,6 @@ ZEXTERN int ZEXPORT deflateEnd(z_streamp strm); deallocated). */ - /* ZEXTERN int ZEXPORT inflateInit(z_streamp strm); @@ -400,7 +396,6 @@ ZEXTERN int ZEXPORT inflateInit(z_streamp strm); that is deferred until inflate() is called. */ - ZEXTERN int ZEXPORT inflate(z_streamp strm, int flush); /* inflate decompresses as much data as possible, and stops when the input @@ -520,7 +515,6 @@ ZEXTERN int ZEXPORT inflate(z_streamp strm, int flush); recovery of the data is to be attempted. */ - ZEXTERN int ZEXPORT inflateEnd(z_streamp strm); /* All dynamically allocated data structures for this stream are freed. @@ -531,8 +525,7 @@ ZEXTERN int ZEXPORT inflateEnd(z_streamp strm); was inconsistent. */ - - /* Advanced functions */ +/* Advanced functions */ /* The following functions are needed only in some special applications. @@ -613,7 +606,7 @@ ZEXTERN int ZEXPORT deflateInit2(z_streamp strm, ZEXTERN int ZEXPORT deflateSetDictionary(z_streamp strm, const Bytef *dictionary, - uInt dictLength); + uInt dictLength); /* Initializes the compression dictionary from the given byte sequence without producing any compressed output. When using the zlib format, this @@ -655,9 +648,8 @@ ZEXTERN int ZEXPORT deflateSetDictionary(z_streamp strm, not perform any compression: this will be done by deflate(). */ -ZEXTERN int ZEXPORT deflateGetDictionary(z_streamp strm, - Bytef *dictionary, - uInt *dictLength); +ZEXTERN int ZEXPORT deflateGetDictionary(z_streamp strm, Bytef *dictionary, + uInt *dictLength); /* Returns the sliding dictionary being maintained by deflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied @@ -677,8 +669,7 @@ ZEXTERN int ZEXPORT deflateGetDictionary(z_streamp strm, stream state is inconsistent. */ -ZEXTERN int ZEXPORT deflateCopy(z_streamp dest, - z_streamp source); +ZEXTERN int ZEXPORT deflateCopy(z_streamp dest, z_streamp source); /* Sets the destination stream as a complete copy of the source stream. @@ -706,9 +697,7 @@ ZEXTERN int ZEXPORT deflateReset(z_streamp strm); stream state was inconsistent (such as zalloc or state being Z_NULL). */ -ZEXTERN int ZEXPORT deflateParams(z_streamp strm, - int level, - int strategy); +ZEXTERN int ZEXPORT deflateParams(z_streamp strm, int level, int strategy); /* Dynamically update the compression level and compression strategy. The interpretation of level and strategy is as in deflateInit2(). This can be @@ -744,11 +733,8 @@ ZEXTERN int ZEXPORT deflateParams(z_streamp strm, retried with more output space. */ -ZEXTERN int ZEXPORT deflateTune(z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain); +ZEXTERN int ZEXPORT deflateTune(z_streamp strm, int good_length, int max_lazy, + int nice_length, int max_chain); /* Fine tune deflate's internal compression parameters. This should only be used by someone who understands the algorithm used by zlib's deflate for @@ -761,8 +747,7 @@ ZEXTERN int ZEXPORT deflateTune(z_streamp strm, returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. */ -ZEXTERN uLong ZEXPORT deflateBound(z_streamp strm, - uLong sourceLen); +ZEXTERN uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen); /* deflateBound() returns an upper bound on the compressed size after deflation of sourceLen bytes. It must be called after deflateInit() or @@ -776,8 +761,7 @@ ZEXTERN uLong ZEXPORT deflateBound(z_streamp strm, than Z_FINISH or Z_NO_FLUSH are used. */ -ZEXTERN int ZEXPORT deflatePending(z_streamp strm, - unsigned *pending, +ZEXTERN int ZEXPORT deflatePending(z_streamp strm, unsigned *pending, int *bits); /* deflatePending() returns the number of bytes and bits of output that have @@ -791,9 +775,7 @@ ZEXTERN int ZEXPORT deflatePending(z_streamp strm, stream state was inconsistent. */ -ZEXTERN int ZEXPORT deflatePrime(z_streamp strm, - int bits, - int value); +ZEXTERN int ZEXPORT deflatePrime(z_streamp strm, int bits, int value); /* deflatePrime() inserts bits in the deflate output stream. The intent is that this function is used to start off the deflate output with the bits @@ -808,8 +790,7 @@ ZEXTERN int ZEXPORT deflatePrime(z_streamp strm, source stream state was inconsistent. */ -ZEXTERN int ZEXPORT deflateSetHeader(z_streamp strm, - gz_headerp head); +ZEXTERN int ZEXPORT deflateSetHeader(z_streamp strm, gz_headerp head); /* deflateSetHeader() provides gzip header information for when a gzip stream is requested by deflateInit2(). deflateSetHeader() may be called @@ -890,7 +871,7 @@ ZEXTERN int ZEXPORT inflateInit2(z_streamp strm, ZEXTERN int ZEXPORT inflateSetDictionary(z_streamp strm, const Bytef *dictionary, - uInt dictLength); + uInt dictLength); /* Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate, @@ -911,9 +892,8 @@ ZEXTERN int ZEXPORT inflateSetDictionary(z_streamp strm, inflate(). */ -ZEXTERN int ZEXPORT inflateGetDictionary(z_streamp strm, - Bytef *dictionary, - uInt *dictLength); +ZEXTERN int ZEXPORT inflateGetDictionary(z_streamp strm, Bytef *dictionary, + uInt *dictLength); /* Returns the sliding dictionary being maintained by inflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied @@ -945,8 +925,7 @@ ZEXTERN int ZEXPORT inflateSync(z_streamp strm); input each time, until success or end of the input data. */ -ZEXTERN int ZEXPORT inflateCopy(z_streamp dest, - z_streamp source); +ZEXTERN int ZEXPORT inflateCopy(z_streamp dest, z_streamp source); /* Sets the destination stream as a complete copy of the source stream. @@ -972,8 +951,7 @@ ZEXTERN int ZEXPORT inflateReset(z_streamp strm); stream state was inconsistent (such as zalloc or state being Z_NULL). */ -ZEXTERN int ZEXPORT inflateReset2(z_streamp strm, - int windowBits); +ZEXTERN int ZEXPORT inflateReset2(z_streamp strm, int windowBits); /* This function is the same as inflateReset, but it also permits changing the wrap and window size requests. The windowBits parameter is interpreted @@ -986,9 +964,7 @@ ZEXTERN int ZEXPORT inflateReset2(z_streamp strm, the windowBits parameter is invalid. */ -ZEXTERN int ZEXPORT inflatePrime(z_streamp strm, - int bits, - int value); +ZEXTERN int ZEXPORT inflatePrime(z_streamp strm, int bits, int value); /* This function inserts bits in the inflate input stream. The intent is that this function is used to start inflating at a bit position in the @@ -1035,8 +1011,7 @@ ZEXTERN long ZEXPORT inflateMark(z_streamp strm); source stream state was inconsistent. */ -ZEXTERN int ZEXPORT inflateGetHeader(z_streamp strm, - gz_headerp head); +ZEXTERN int ZEXPORT inflateGetHeader(z_streamp strm, gz_headerp head); /* inflateGetHeader() requests that gzip header information be stored in the provided gz_header structure. inflateGetHeader() may be called after @@ -1097,12 +1072,10 @@ ZEXTERN int ZEXPORT inflateBackInit(z_streamp strm, int windowBits, the version of the header file. */ -typedef unsigned (*in_func)(void FAR *, - z_const unsigned char FAR * FAR *); +typedef unsigned (*in_func)(void FAR *, z_const unsigned char FAR *FAR *); typedef int (*out_func)(void FAR *, unsigned char FAR *, unsigned); -ZEXTERN int ZEXPORT inflateBack(z_streamp strm, - in_func in, void FAR *in_desc, +ZEXTERN int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc, out_func out, void FAR *out_desc); /* inflateBack() does a raw inflate with a single call using a call-back @@ -1222,7 +1195,7 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags(void); #ifndef Z_SOLO - /* utility functions */ +/* utility functions */ /* The following utility functions are implemented on top of the basic @@ -1232,8 +1205,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags(void); you need special options. */ -ZEXTERN int ZEXPORT compress(Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen); +ZEXTERN int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, + uLong sourceLen); /* Compresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size @@ -1247,9 +1220,8 @@ ZEXTERN int ZEXPORT compress(Bytef *dest, uLongf *destLen, buffer. */ -ZEXTERN int ZEXPORT compress2(Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level); +ZEXTERN int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source, + uLong sourceLen, int level); /* Compresses the source buffer into the destination buffer. The level parameter has the same meaning as in deflateInit. sourceLen is the byte @@ -1270,7 +1242,7 @@ ZEXTERN uLong ZEXPORT compressBound(uLong sourceLen); compress() or compress2() call to allocate the destination buffer. */ -ZEXTERN int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, +ZEXTERN int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); /* Decompresses the source buffer into the destination buffer. sourceLen is @@ -1288,7 +1260,7 @@ ZEXTERN int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, buffer with the uncompressed data up to that point. */ -ZEXTERN int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, +ZEXTERN int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source, uLong *sourceLen); /* Same as uncompress, except that sourceLen is a pointer, where the @@ -1296,7 +1268,7 @@ ZEXTERN int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, source bytes consumed. */ - /* gzip file access functions */ +/* gzip file access functions */ /* This library supports reading and writing files in gzip (.gz) format with @@ -1305,7 +1277,7 @@ ZEXTERN int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, wrapper, documented in RFC 1952, wrapped around a deflate stream. */ -typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ +typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ /* ZEXTERN gzFile ZEXPORT gzopen(const char *path, const char *mode); @@ -1457,8 +1429,8 @@ ZEXTERN int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len); returns the number of uncompressed bytes written or 0 in case of error. */ -ZEXTERN z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size, - z_size_t nitems, gzFile file); +ZEXTERN z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size, z_size_t nitems, + gzFile file); /* Compress and write nitems items of size size from buf to file, duplicating the interface of stdio's fwrite(), with size_t request and return types. If @@ -1494,7 +1466,7 @@ ZEXTERN int ZEXPORT gzputs(gzFile file, const char *s); gzputs returns the number of characters written, or -1 in case of error. */ -ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len); +ZEXTERN char *ZEXPORT gzgets(gzFile file, char *buf, int len); /* Read and decompress bytes from file into buf, until len-1 characters are read, or until a newline character is read and transferred to buf, or an @@ -1570,7 +1542,7 @@ ZEXTERN z_off_t ZEXPORT gzseek(gzFile file, would be before the current position. */ -ZEXTERN int ZEXPORT gzrewind(gzFile file); +ZEXTERN int ZEXPORT gzrewind(gzFile file); /* Rewind file. This function is supported only for reading. @@ -1634,7 +1606,7 @@ ZEXTERN int ZEXPORT gzdirect(gzFile file); gzip file reading and decompression, which may not be desired.) */ -ZEXTERN int ZEXPORT gzclose(gzFile file); +ZEXTERN int ZEXPORT gzclose(gzFile file); /* Flush all pending output for file, if necessary, close file and deallocate the (de)compression state. Note that once file is closed, you @@ -1659,7 +1631,7 @@ ZEXTERN int ZEXPORT gzclose_w(gzFile file); zlib library. */ -ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum); +ZEXTERN const char *ZEXPORT gzerror(gzFile file, int *errnum); /* Return the error message for the last error which occurred on file. errnum is set to zlib error number. If an error occurred in the file system @@ -1684,7 +1656,7 @@ ZEXTERN void ZEXPORT gzclearerr(gzFile file); #endif /* !Z_SOLO */ - /* checksum functions */ +/* checksum functions */ /* These functions are not related to compression but are exported @@ -1712,8 +1684,7 @@ ZEXTERN uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len); if (adler != original_adler) error(); */ -ZEXTERN uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, - z_size_t len); +ZEXTERN uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len); /* Same as adler32(), but with a size_t length. */ @@ -1748,8 +1719,7 @@ ZEXTERN uLong ZEXPORT crc32(uLong crc, const Bytef *buf, uInt len); if (crc != original_crc) error(); */ -ZEXTERN uLong ZEXPORT crc32_z(uLong crc, const Bytef *buf, - z_size_t len); +ZEXTERN uLong ZEXPORT crc32_z(uLong crc, const Bytef *buf, z_size_t len); /* Same as crc32(), but with a size_t length. */ @@ -1778,54 +1748,49 @@ ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op); crc32_combine() if the generated op is used more than once. */ - - /* various hacks, don't look :) */ +/* various hacks, don't look :) */ /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ -ZEXTERN int ZEXPORT deflateInit_(z_streamp strm, int level, - const char *version, int stream_size); -ZEXTERN int ZEXPORT inflateInit_(z_streamp strm, - const char *version, int stream_size); -ZEXTERN int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size); -ZEXTERN int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, +ZEXTERN int ZEXPORT deflateInit_(z_streamp strm, int level, const char *version, + int stream_size); +ZEXTERN int ZEXPORT inflateInit_(z_streamp strm, const char *version, + int stream_size); +ZEXTERN int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, + int windowBits, int memLevel, int strategy, + const char *version, int stream_size); +ZEXTERN int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, const char *version, int stream_size); ZEXTERN int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits, unsigned char FAR *window, - const char *version, - int stream_size); + const char *version, int stream_size); #ifdef Z_PREFIX_SET -# define z_deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) -# define z_inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) -# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) -# define z_inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ - (int)sizeof(z_stream)) -# define z_inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, (int)sizeof(z_stream)) +#define z_deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +#define z_inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +#define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm), (level), (method), (windowBits), (memLevel), \ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +#define z_inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, (int)sizeof(z_stream)) +#define z_inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), ZLIB_VERSION, \ + (int)sizeof(z_stream)) #else -# define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) -# define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) -# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) -# define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ - (int)sizeof(z_stream)) -# define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, (int)sizeof(z_stream)) +#define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +#define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm), (level), (method), (windowBits), (memLevel), \ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, (int)sizeof(z_stream)) +#define inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), ZLIB_VERSION, \ + (int)sizeof(z_stream)) #endif #ifndef Z_SOLO @@ -1838,18 +1803,18 @@ ZEXTERN int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits, * only be used by the gzgetc() macro. You have been warned. */ struct gzFile_s { - unsigned have; - unsigned char *next; - z_off64_t pos; + unsigned have; + unsigned char *next; + z_off64_t pos; }; -ZEXTERN int ZEXPORT gzgetc_(gzFile file); /* backward compatibility */ +ZEXTERN int ZEXPORT gzgetc_(gzFile file); /* backward compatibility */ #ifdef Z_PREFIX_SET -# undef z_gzgetc -# define z_gzgetc(g) \ - ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) +#undef z_gzgetc +#define z_gzgetc(g) \ + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) #else -# define gzgetc(g) \ - ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) +#define gzgetc(g) \ + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) #endif /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or @@ -1859,79 +1824,76 @@ ZEXTERN int ZEXPORT gzgetc_(gzFile file); /* backward compatibility */ * without large file support, _LFS64_LARGEFILE must also be true */ #ifdef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *); - ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int); - ZEXTERN z_off64_t ZEXPORT gztell64(gzFile); - ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile); - ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t); - ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t); - ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t); +ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *); +ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int); +ZEXTERN z_off64_t ZEXPORT gztell64(gzFile); +ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile); +ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t); +ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t); +ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t); #endif #if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) -# ifdef Z_PREFIX_SET -# define z_gzopen z_gzopen64 -# define z_gzseek z_gzseek64 -# define z_gztell z_gztell64 -# define z_gzoffset z_gzoffset64 -# define z_adler32_combine z_adler32_combine64 -# define z_crc32_combine z_crc32_combine64 -# define z_crc32_combine_gen z_crc32_combine_gen64 -# else -# define gzopen gzopen64 -# define gzseek gzseek64 -# define gztell gztell64 -# define gzoffset gzoffset64 -# define adler32_combine adler32_combine64 -# define crc32_combine crc32_combine64 -# define crc32_combine_gen crc32_combine_gen64 -# endif -# ifndef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *); - ZEXTERN z_off_t ZEXPORT gzseek64(gzFile, z_off_t, int); - ZEXTERN z_off_t ZEXPORT gztell64(gzFile); - ZEXTERN z_off_t ZEXPORT gzoffset64(gzFile); - ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t); - ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t); - ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t); -# endif +#ifdef Z_PREFIX_SET +#define z_gzopen z_gzopen64 +#define z_gzseek z_gzseek64 +#define z_gztell z_gztell64 +#define z_gzoffset z_gzoffset64 +#define z_adler32_combine z_adler32_combine64 +#define z_crc32_combine z_crc32_combine64 +#define z_crc32_combine_gen z_crc32_combine_gen64 +#else +#define gzopen gzopen64 +#define gzseek gzseek64 +#define gztell gztell64 +#define gzoffset gzoffset64 +#define adler32_combine adler32_combine64 +#define crc32_combine crc32_combine64 +#define crc32_combine_gen crc32_combine_gen64 +#endif +#ifndef Z_LARGE64 +ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *); +ZEXTERN z_off_t ZEXPORT gzseek64(gzFile, z_off_t, int); +ZEXTERN z_off_t ZEXPORT gztell64(gzFile); +ZEXTERN z_off_t ZEXPORT gzoffset64(gzFile); +ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t); +ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t); +ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t); +#endif #else - ZEXTERN gzFile ZEXPORT gzopen(const char *, const char *); - ZEXTERN z_off_t ZEXPORT gzseek(gzFile, z_off_t, int); - ZEXTERN z_off_t ZEXPORT gztell(gzFile); - ZEXTERN z_off_t ZEXPORT gzoffset(gzFile); - ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t); - ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t); - ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t); +ZEXTERN gzFile ZEXPORT gzopen(const char *, const char *); +ZEXTERN z_off_t ZEXPORT gzseek(gzFile, z_off_t, int); +ZEXTERN z_off_t ZEXPORT gztell(gzFile); +ZEXTERN z_off_t ZEXPORT gzoffset(gzFile); +ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t); +ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t); +ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t); #endif #else /* Z_SOLO */ - ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t); - ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t); - ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t); +ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t); +ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t); +ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t); #endif /* !Z_SOLO */ /* undocumented functions */ -ZEXTERN const char * ZEXPORT zError(int); -ZEXTERN int ZEXPORT inflateSyncPoint(z_streamp); -ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void); -ZEXTERN int ZEXPORT inflateUndermine(z_streamp, int); -ZEXTERN int ZEXPORT inflateValidate(z_streamp, int); -ZEXTERN unsigned long ZEXPORT inflateCodesUsed(z_streamp); -ZEXTERN int ZEXPORT inflateResetKeep(z_streamp); -ZEXTERN int ZEXPORT deflateResetKeep(z_streamp); +ZEXTERN const char *ZEXPORT zError(int); +ZEXTERN int ZEXPORT inflateSyncPoint(z_streamp); +ZEXTERN const z_crc_t FAR *ZEXPORT get_crc_table(void); +ZEXTERN int ZEXPORT inflateUndermine(z_streamp, int); +ZEXTERN int ZEXPORT inflateValidate(z_streamp, int); +ZEXTERN unsigned long ZEXPORT inflateCodesUsed(z_streamp); +ZEXTERN int ZEXPORT inflateResetKeep(z_streamp); +ZEXTERN int ZEXPORT deflateResetKeep(z_streamp); #if defined(_WIN32) && !defined(Z_SOLO) -ZEXTERN gzFile ZEXPORT gzopen_w(const wchar_t *path, - const char *mode); +ZEXTERN gzFile ZEXPORT gzopen_w(const wchar_t *path, const char *mode); #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) -# ifndef Z_SOLO -ZEXTERN int ZEXPORTVA gzvprintf(gzFile file, - const char *format, - va_list va); -# endif +#ifndef Z_SOLO +ZEXTERN int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va); +#endif #endif #ifdef __cplusplus @@ -1939,5 +1901,3 @@ ZEXTERN int ZEXPORTVA gzvprintf(gzFile file, #endif #endif /* ZLIB_H */ - - |
