Update local deps

This commit is contained in:
Ahrimdon 2024-02-25 14:26:13 -05:00
parent 85abd2b6d8
commit 61b6161768
75 changed files with 743 additions and 500 deletions

View File

@ -12,7 +12,7 @@ jobs:
run:
working-directory: build
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Create build directory
run: mkdir -p build

View File

@ -13,7 +13,7 @@ jobs:
matrix:
os: [ ubuntu-latest, macos-latest ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.14.0

View File

@ -12,7 +12,7 @@ jobs:
run:
working-directory: build
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Create build directory
run: mkdir -p build

View File

@ -167,7 +167,7 @@ constexpr byte to_byte(T t) noexcept
{
static_assert(std::is_same<T, unsigned char>::value,
"gsl::to_byte(t) must be provided an unsigned char, otherwise data loss may occur. "
"If you are calling to_byte with an integer contant use: gsl::to_byte<t>() version.");
"If you are calling to_byte with an integer constant use: gsl::to_byte<t>() version.");
return byte(t);
}

View File

@ -100,19 +100,19 @@ public:
static_assert(details::is_comparable_to_nullptr<T>::value, "T cannot be compared to nullptr.");
template <typename U, typename = std::enable_if_t<std::is_convertible<U, T>::value>>
constexpr not_null(U&& u) : ptr_(std::forward<U>(u))
constexpr not_null(U&& u) noexcept(std::is_nothrow_move_constructible<T>::value) : ptr_(std::forward<U>(u))
{
Expects(ptr_ != nullptr);
}
template <typename = std::enable_if_t<!std::is_same<std::nullptr_t, T>::value>>
constexpr not_null(T u) : ptr_(std::move(u))
constexpr not_null(T u) noexcept(std::is_nothrow_move_constructible<T>::value) : ptr_(std::move(u))
{
Expects(ptr_ != nullptr);
}
template <typename U, typename = std::enable_if_t<std::is_convertible<U, T>::value>>
constexpr not_null(const not_null<U>& other) : not_null(other.get())
constexpr not_null(const not_null<U>& other) noexcept(std::is_nothrow_move_constructible<T>::value) : not_null(other.get())
{}
not_null(const not_null& other) = default;

View File

@ -42,7 +42,7 @@
#pragma warning(disable : 4702) // unreachable code
// Turn MSVC /analyze rules that generate too much noise. TODO: fix in the tool.
#pragma warning(disable : 26495) // uninitalized member when constructor calls constructor
#pragma warning(disable : 26495) // uninitialized member when constructor calls constructor
#pragma warning(disable : 26446) // parser bug does not allow attributes on some templates
#endif // _MSC_VER
@ -53,7 +53,7 @@
#define GSL_USE_STATIC_CONSTEXPR_WORKAROUND
#endif // !(defined(__cplusplus) && (__cplusplus >= 201703L))
// GCC 7 does not like the signed unsigned missmatch (size_t ptrdiff_t)
// GCC 7 does not like the signed unsigned mismatch (size_t ptrdiff_t)
// While there is a conversion from signed to unsigned, it happens at
// compiletime, so the compiler wouldn't have to warn indiscriminately, but
// could check if the source value actually doesn't fit into the target type

View File

@ -24,6 +24,7 @@
#include <sstream> // for operator<<, ostringstream, basic_ostream:...
#include <string> // for basic_string, operator==, string, operator<<
#include <typeinfo> // for type_info
#include <variant> // for variant, monostate, get
#include "deathTestCommon.h"
using namespace gsl;
@ -514,6 +515,17 @@ TEST(notnull_tests, TestNotNullConstructorTypeDeduction)
}
#endif
}
TEST(notnull_tests, TestVariantEmplace)
{
int i = 0;
std::variant<std::monostate, not_null<int*>> v;
v.emplace<not_null<int*>>(&i);
EXPECT_FALSE(v.valueless_by_exception());
EXPECT_TRUE(v.index() == 1);
EXPECT_TRUE(std::get<not_null<int*>>(v) == &i);
}
#endif // #if defined(__cplusplus) && (__cplusplus >= 201703L)
TEST(notnull_tests, TestMakeNotNull)

View File

@ -615,7 +615,7 @@ public:
RAPIDJSON_ASSERT(regex_.IsValid());
if (!allocator_)
ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)();
stateSet_ = static_cast<unsigned*>(allocator_->Malloc(GetStateSetSize()));
stateSet_ = static_cast<uint32_t*>(allocator_->Malloc(GetStateSetSize()));
state0_.template Reserve<SizeType>(regex_.stateCount_);
state1_.template Reserve<SizeType>(regex_.stateCount_);
}

View File

@ -24,13 +24,9 @@
#if !defined(RAPIDJSON_SCHEMA_USE_INTERNALREGEX)
#define RAPIDJSON_SCHEMA_USE_INTERNALREGEX 1
#else
#define RAPIDJSON_SCHEMA_USE_INTERNALREGEX 0
#endif
#if !RAPIDJSON_SCHEMA_USE_INTERNALREGEX && defined(RAPIDJSON_SCHEMA_USE_STDREGEX) && (__cplusplus >=201103L || (defined(_MSC_VER) && _MSC_VER >= 1800))
#define RAPIDJSON_SCHEMA_USE_STDREGEX 1
#else
#if !defined(RAPIDJSON_SCHEMA_USE_STDREGEX) || !(__cplusplus >=201103L || (defined(_MSC_VER) && _MSC_VER >= 1800))
#define RAPIDJSON_SCHEMA_USE_STDREGEX 0
#endif
@ -1645,9 +1641,13 @@ private:
bool CheckDoubleMultipleOf(Context& context, double d) const {
double a = std::abs(d), b = std::abs(multipleOf_.GetDouble());
double q = std::floor(a / b);
double r = a - q * b;
if (r > 0.0) {
double q = a / b;
double qRounded = std::floor(q + 0.5);
double scaledEpsilon = (q + qRounded) * std::numeric_limits<double>::epsilon();
double difference = std::abs(qRounded - q);
bool isMultiple = (difference <= scaledEpsilon)
|| (difference < std::numeric_limits<double>::min());
if (!isMultiple) {
context.error_handler.NotMultipleOf(d, multipleOf_);
RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMultipleOf);
}

208
deps/zlib/.github/workflows/c-std.yml vendored Normal file
View File

@ -0,0 +1,208 @@
name: C Standard
# Compile with as many C standards as possible.
# The worflow is setup to fail on any compilation warnings.
on:
workflow_dispatch:
push:
pull_request:
jobs:
main:
name: ${{ matrix.os.name }} ${{ matrix.compiler }} ${{ matrix.arch.name }} ${{ matrix.std.name }} ${{ matrix.builder }}
runs-on: ${{ matrix.os.value }}
strategy:
fail-fast: false
matrix:
os:
- name: Linux
value: ubuntu-latest
- name: MacOS
value: macos-latest
- name: Windows
value: windows-latest
cmake-opt: -G Ninja
compiler:
- gcc
- clang
arch:
- name: 64-bit
tag: amd64
compiler-opt: -m64
cmake-opt: -A x64
- name: 32-bit
tag: i386
compiler-opt: -m32
cmake-opt: -A Win32
builder:
- configure
- cmake
std:
- name: c89
value: c89
- name: gnu89
value: gnu89
- name: c94
value: iso9899:199409
- name: c99
value: c99
- name: gnu99
value: gnu99
- name: c11
value: c11
- name: gnu11
value: gnu11
- name: c17
value: c17
- name: gnu17
value: gnu17
- name: c2x
value: c2x
- name: gnu2x
value: gnu2x
exclude:
# Don't run 32-bit on MacOS
- { os: { name: MacOS },
arch: { tag: i386 } }
# Don't run configure on Windows
- { os: { name: Windows },
builder: configure }
# Don't run gcc 32-bit on Windows
- { os: { name: Windows },
arch: { tag: i386 } }
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
show-progress: 'false'
- name: Install packages (Linux)
if: runner.os == 'Linux' && matrix.arch.tag == 'i386'
run: |
sudo apt-get update
sudo apt install gcc-multilib libc6-dev-i386-cross
- name: Install packages (Windows)
if: runner.os == 'Windows'
run: |
choco install --no-progress ninja
- name: Generate project files (configure)
if: matrix.builder == 'configure'
run: |
./configure
env:
CC: ${{ matrix.compiler }}
CFLAGS: -std=${{ matrix.std.value }} ${{ matrix.arch.compiler-opt }} -Werror -Wall -Wextra
- name: Compile source code (configure)
if: matrix.builder == 'configure'
run: make -j2
- name: Run test cases (configure)
if: matrix.builder == 'configure'
run: |
make test
make cover
- name: Generate project files (cmake)
if: matrix.builder == 'cmake'
run: |
cmake -S . -B . -D CMAKE_BUILD_TYPE=Release -D ZLIB_BUILD_EXAMPLES=OFF ${{ matrix.os.cmake-opt }}
env:
CC: ${{ matrix.compiler }}
CFLAGS: -std=${{ matrix.std.value }} ${{ matrix.arch.compiler-opt }} -Werror -Wall -Wextra
- name: Compile source code (cmake)
if: matrix.builder == 'cmake'
run: cmake --build . --config Release
- name: Run test cases (cmake)
if: matrix.builder == 'cmake'
run: ctest -C Release --output-on-failure --max-width 120
msvc:
name: ${{ matrix.os.name }} ${{ matrix.compiler }} ${{ matrix.arch.name }} ${{ matrix.std.name }} ${{ matrix.builder }}
runs-on: ${{ matrix.os.value }}
strategy:
fail-fast: false
matrix:
os:
- name: Windows
value: windows-latest
compiler:
- cl
arch:
- name: 32-bit
value: -A Win32
- name: 64-bit
value: -A x64
builder:
- cmake
std:
- name: default
value: ""
- name: C11
value: /std:c11
- name: C17
value: /std:c17
# not available on the runner yet
# - name: C20
# value: /std:c20
- name: latest
value: /std:clatest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
show-progress: 'false'
- name: Generate project files (cmake)
run: |
cmake -S . -B . ${{ matrix.arch.value }} -D CMAKE_BUILD_TYPE=Release
env:
CC: ${{ matrix.compiler }}
CFLAGS: /WX ${{ matrix.std.value }}
- name: Compile source code (cmake)
run: cmake --build . --config Release -v
- name: Run test cases (cmake)
run: ctest -C Release --output-on-failure --max-width 120

View File

@ -11,54 +11,63 @@ jobs:
- name: Ubuntu GCC
os: ubuntu-latest
compiler: gcc
cflags: -Werror -Wall -Wextra
# Test out of source builds
- name: Ubuntu GCC OSB
os: ubuntu-latest
compiler: gcc
cflags: -Werror -Wall -Wextra
build-dir: ../build
src-dir: ../zlib
- name: Ubuntu GCC -O3
os: ubuntu-latest
compiler: gcc
cflags: -O3
cflags: -O3 -Werror -Wall -Wextra
- name: Ubuntu Clang
os: ubuntu-latest
compiler: clang
cflags: -Werror -Wall -Wextra
- name: Ubuntu Clang Debug
os: ubuntu-latest
compiler: clang
cflags: -Werror -Wall -Wextra
build-config: Debug
- name: Windows MSVC Win32
os: windows-latest
compiler: cl
cflags: /WX /W3
cmake-args: -A Win32
- name: Windows MSVC Win64
os: windows-latest
compiler: cl
cflags: /WX /W3
cmake-args: -A x64
- name: Windows GCC
os: windows-latest
compiler: gcc
cflags: -Werror -Wall -Wextra
cmake-args: -G Ninja
- name: macOS Clang
os: macos-latest
compiler: clang
cflags: -Werror -Wall -Wextra
- name: macOS GCC
os: macos-latest
compiler: gcc-11
cflags: -Werror -Wall -Wextra
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install packages (Windows)
if: runner.os == 'Windows'
@ -79,7 +88,7 @@ jobs:
working-directory: ${{ matrix.build-dir || '.' }}
- name: Upload build errors
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.name }} (cmake)

View File

@ -95,7 +95,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install packages (Ubuntu)
if: runner.os == 'Linux' && matrix.packages
@ -110,7 +110,7 @@ jobs:
${{ matrix.src-dir || '.' }}/configure ${{ matrix.configure-args }}
env:
CC: ${{ matrix.compiler }}
CFLAGS: ${{ matrix.cflags }}
CFLAGS: ${{ matrix.cflags }} -Werror
LDFLAGS: ${{ matrix.ldflags }}
CHOST: ${{ matrix.chost }}
@ -127,7 +127,7 @@ jobs:
QEMU_RUN: ${{ matrix.qemu-run }}
- name: Upload build errors
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.name }} (configure)

View File

@ -18,7 +18,7 @@ jobs:
dry-run: false
- name: Upload Crash
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: artifacts

View File

@ -3,7 +3,9 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
project(zlib C)
set(VERSION "1.3.0.1")
set(VERSION "1.3.1.1")
option(ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" ON)
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
@ -63,7 +65,8 @@ if(MSVC)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
endif()
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
option(RENAME_ZCONF "Rename the zconf when building out of source" ON)
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND RENAME_ZCONF)
# If we're doing an out of source build and the user has a zconf.h
# in their source tree...
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
@ -148,7 +151,13 @@ if(MINGW)
endif(MINGW)
add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
target_include_directories(zlib PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
target_include_directories(zlibstatic PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
set_target_properties(zlib PROPERTIES SOVERSION 1)
@ -166,7 +175,7 @@ endif()
if(UNIX)
# On unix-like platforms the library is almost always called libz
set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
if(NOT APPLE)
if(NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
endif()
elseif(BUILD_SHARED_LIBS AND WIN32)
@ -193,15 +202,15 @@ endif()
#============================================================================
# Example binaries
#============================================================================
if(ZLIB_BUILD_EXAMPLES)
add_executable(example test/example.c)
target_link_libraries(example zlib)
add_test(example example)
add_executable(example test/example.c)
target_link_libraries(example zlib)
add_test(example example)
add_executable(minigzip test/minigzip.c)
target_link_libraries(minigzip zlib)
add_executable(minigzip test/minigzip.c)
target_link_libraries(minigzip zlib)
if(HAVE_OFF64_T)
if(HAVE_OFF64_T)
add_executable(example64 test/example.c)
target_link_libraries(example64 zlib)
set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
@ -210,4 +219,5 @@ if(HAVE_OFF64_T)
add_executable(minigzip64 test/minigzip.c)
target_link_libraries(minigzip64 zlib)
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
endif()
endif()

12
deps/zlib/ChangeLog vendored
View File

@ -1,9 +1,19 @@
ChangeLog file for zlib
Changes in 1.3.0.1 (xx Aug 2023)
Changes in 1.3.1.1 (xx Jan 2024)
-
Changes in 1.3.1 (22 Jan 2024)
- Reject overflows of zip header fields in minizip
- Fix bug in inflateSync() for data held in bit buffer
- Add LIT_MEM define to use more memory for a small deflate speedup
- Fix decision on the emission of Zip64 end records in minizip
- Add bounds checking to ERR_MSG() macro, used by zError()
- Neutralize zip file traversal attacks in miniunz
- Fix a bug in ZLIB_DEBUG compiles in check_match()
- Various portability and appearance improvements
Changes in 1.3 (18 Aug 2023)
- Remove K&R function definitions and zlib2ansi
- Fix bug in deflateBound() for level 0 and memLevel 9

5
deps/zlib/FAQ vendored
View File

@ -14,13 +14,12 @@ The latest zlib FAQ is at http://zlib.net/zlib_faq.html
2. Where can I get a Windows DLL version?
The zlib sources can be compiled without change to produce a DLL. See the
file win32/DLL_FAQ.txt in the zlib distribution. Pointers to the
precompiled DLL are found in the zlib web site at http://zlib.net/ .
file win32/DLL_FAQ.txt in the zlib distribution.
3. Where can I get a Visual Basic interface to zlib?
See
* http://marknelson.us/1997/01/01/zlib-engine/
* https://marknelson.us/posts/1997/01/01/zlib-engine.html
* win32/DLL_FAQ.txt in the zlib distribution
4. compress() returns Z_BUF_ERROR.

2
deps/zlib/LICENSE vendored
View File

@ -1,6 +1,6 @@
Copyright notice:
(C) 1995-2022 Jean-loup Gailly and Mark Adler
(C) 1995-2024 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

16
deps/zlib/Makefile.in vendored
View File

@ -1,5 +1,5 @@
# Makefile for zlib
# Copyright (C) 1995-2017 Jean-loup Gailly, Mark Adler
# Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
# For conditions of distribution and use, see copyright notice in zlib.h
# To compile and test, type:
@ -22,13 +22,13 @@ CFLAGS=-O
SFLAGS=-O
LDFLAGS=
TEST_LDFLAGS=$(LDFLAGS) -L. libz.a
TEST_LIBS=-L. libz.a
LDSHARED=$(CC)
CPP=$(CC) -E
STATICLIB=libz.a
SHAREDLIB=libz.so
SHAREDLIBV=libz.so.1.3.0.1
SHAREDLIBV=libz.so.1.3.1.1
SHAREDLIBM=libz.so.1
LIBS=$(STATICLIB) $(SHAREDLIBV)
@ -282,10 +282,10 @@ placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
-@rmdir objs
example$(EXE): example.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ example.o $(TEST_LIBS)
minigzip$(EXE): minigzip.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ minigzip.o $(TEST_LIBS)
examplesh$(EXE): example.o $(SHAREDLIBV)
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(SHAREDLIBV)
@ -294,10 +294,10 @@ minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(SHAREDLIBV)
example64$(EXE): example64.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ example64.o $(TEST_LIBS)
minigzip64$(EXE): minigzip64.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ minigzip64.o $(TEST_LIBS)
install-libs: $(LIBS)
-@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
@ -360,7 +360,7 @@ zconf: $(SRCDIR)zconf.h.in
cp -p $(SRCDIR)zconf.h.in zconf.h
minizip-test: static
cd contrib/minizip && { CFLAGS="$(CFLAGS)" $(MAKE) test ; cd ../.. ; }
cd contrib/minizip && { CC="$(CC)" CFLAGS="$(CFLAGS)" $(MAKE) test ; cd ../.. ; }
minizip-clean:
cd contrib/minizip && { $(MAKE) clean ; cd ../.. ; }

8
deps/zlib/README vendored
View File

@ -1,6 +1,6 @@
ZLIB DATA COMPRESSION LIBRARY
zlib 1.3.0.1 is a general purpose data compression library. All the code is
zlib 1.3.1.1 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files
http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
@ -31,7 +31,7 @@ Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
issue of Dr. Dobb's Journal; a copy of the article is available at
https://marknelson.us/posts/1997/01/01/zlib-engine.html .
The changes made in version 1.3.0.1 are documented in the file ChangeLog.
The changes made in version 1.3.1.1 are documented in the file ChangeLog.
Unsupported third party contributions are provided in directory contrib/ .
@ -69,8 +69,6 @@ Notes for some targets:
- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
other compilers. Use "make test" to check your compiler.
- gzdopen is not supported on RISCOS or BEOS.
- For PalmOs, see http://palmzlib.sourceforge.net/
@ -83,7 +81,7 @@ Acknowledgments:
Copyright notice:
(C) 1995-2023 Jean-loup Gailly and Mark Adler
(C) 1995-2024 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

14
deps/zlib/configure vendored
View File

@ -25,7 +25,7 @@ if test $SRCDIR = "."; then
ZINCOUT="-I."
SRCDIR=""
else
ZINC='-include zconf.h'
ZINC='-I. -include zconf.h'
ZINCOUT='-I. -I$(SRCDIR)'
SRCDIR="$SRCDIR/"
fi
@ -91,6 +91,7 @@ warn=0
debug=0
address=0
memory=0
unknown=0
old_cc="$CC"
old_cflags="$CFLAGS"
OBJC='$(OBJZ) $(OBJG)'
@ -144,12 +145,12 @@ case "$1" in
--sanitize) address=1; shift ;;
--address) address=1; shift ;;
--memory) memory=1; shift ;;
*)
echo "unknown option: $1" | tee -a configure.log
echo "$0 --help for help" | tee -a configure.log
leave 1;;
*) unknown=1; echo "unknown option ignored: $1" | tee -a configure.log; shift;;
esac
done
if test $unknown -eq 1; then
echo "$0 --help for help" | tee -a configure.log
fi
# temporary file name
test=ztest$$
@ -258,6 +259,7 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
SHAREDLIB='libz.sl' ;;
esac ;;
AIX*)
LDSHARED=${LDSHARED-"$cc -shared"}
LDFLAGS="${LDFLAGS} -Wl,-brtl" ;;
Darwin* | darwin* | *-darwin*)
shared_ext='.dylib'
@ -442,7 +444,7 @@ EOF
if test $shared -eq 1; then
echo Checking for shared library support... | tee -a configure.log
# we must test in two steps (cc then ld), required at least on SunOS 4.x
if try $CC -w -c $SFLAGS $test.c &&
if try $CC -c $SFLAGS $test.c &&
try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
elif test -z "$old_cc" -a -z "$old_cflags"; then

View File

@ -2,7 +2,7 @@
Release 1.3
ZLib.Ada is a thick binding interface to the popular ZLib data
compression library, available at http://www.gzip.org/zlib/.
compression library, available at https://zlib.net/.
It provides Ada-style access to the ZLib C library.

View File

@ -152,7 +152,7 @@ procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
const OutBuf: Pointer; BufSize: Integer);
const
zlib_version = '1.3.0';
zlib_version = '1.3.1.1';
type
EZlibError = class(Exception);

View File

@ -34,7 +34,7 @@ namespace DotZLib
}
/// <summary>
/// Initializes a new instance of the checksum generator basewith a specified value
/// Initializes a new instance of the checksum generator base with a specified value
/// </summary>
/// <param name="initialValue">The value to set the current checksum to</param>
public ChecksumGeneratorBase(uint initialValue)

View File

@ -156,7 +156,7 @@ namespace DotZLibTests
public void Info_Version()
{
Info info = new Info();
Assert.AreEqual("1.3.0", Info.Version);
Assert.AreEqual("1.3.1.1", Info.Version);
Assert.AreEqual(32, info.SizeOfUInt);
Assert.AreEqual(32, info.SizeOfULong);
Assert.AreEqual(32, info.SizeOfPointer);

View File

@ -177,7 +177,7 @@ printf("#define dsNiceMatch %u\n",(int)(((char*)&(s->nice_match))-((char*)s)
;
; gcc on macosx-linux:
; see http://www.x86-64.org/documentation/abi-0.99.pdf
; see https://refspecs.linuxbase.org/elf/x86_64-abi-0.99.pdf
; param 1 in rdi, param 2 in rsi
; rbx, rsp, rbp, r12 to r15 must be preserved

View File

@ -1,5 +1,5 @@
/* inftree9.c -- generate Huffman trees for efficient decoding
* Copyright (C) 1995-2023 Mark Adler
* Copyright (C) 1995-2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -9,7 +9,7 @@
#define MAXBITS 15
const char inflate9_copyright[] =
" inflate9 1.3.0.1 Copyright 1995-2023 Mark Adler ";
" inflate9 1.3.1.1 Copyright 1995-2024 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@ -59,7 +59,7 @@ int inflate_table9(codetype type, unsigned short FAR *lens, unsigned codes,
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
133, 133, 133, 133, 144, 70, 200};
133, 133, 133, 133, 144, 73, 200};
static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,

View File

@ -413,7 +413,7 @@ template<typename T1, typename T2>
class gzomanip2
{
public:
// Allows insertor to peek at internals
// Allows inserter to peek at internals
template <typename Ta, typename Tb>
friend gzofstream&
operator<<(gzofstream&,
@ -452,7 +452,7 @@ template<typename T1, typename T2>
: func(f), val1(v1), val2(v2)
{ }
// Insertor applies underlying manipulator function to stream
// Inserter applies underlying manipulator function to stream
template<typename T1, typename T2>
inline gzofstream&
operator<<(gzofstream& s, const gzomanip2<T1,T2>& m)

View File

@ -1,4 +1,4 @@
CC=cc
CC?=cc
CFLAGS := $(CFLAGS) -O -I../..
UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a

View File

@ -1,7 +1,7 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT([minizip], [1.3.0.1], [bugzilla.redhat.com])
AC_INIT([minizip], [1.3.1.1], [bugzilla.redhat.com])
AC_CONFIG_SRCDIR([minizip.c])
AM_INIT_AUTOMAKE([foreign])
LT_INIT

View File

@ -79,7 +79,7 @@
/* change_file_date : change the date/time of a file
filename : the filename of the file where date/time must be modified
dosdate : the new date at the MSDos format (4 bytes)
dosdate : the new date at the MSDOS format (4 bytes)
tmu_date : the SAME new date at the tm_unz format */
static void change_file_date(const char *filename, uLong dosdate, tm_unz tmu_date) {
#ifdef _WIN32
@ -240,7 +240,7 @@ static int do_list(unzFile uf) {
printf(" ------ ------ ---- ----- ---- ---- ------ ----\n");
for (i=0;i<gi.number_entry;i++)
{
char filename_inzip[256];
char filename_inzip[65536+1];
unz_file_info64 file_info;
uLong ratio=0;
const char *string_method = "";
@ -305,7 +305,7 @@ static int do_list(unzFile uf) {
static int do_extract_currentfile(unzFile uf, const int* popt_extract_without_path, int* popt_overwrite, const char* password) {
char filename_inzip[256];
char filename_inzip[65536+1];
char* filename_withoutpath;
char* p;
int err=UNZ_OK;
@ -356,6 +356,20 @@ static int do_extract_currentfile(unzFile uf, const int* popt_extract_without_pa
else
write_filename = filename_withoutpath;
if (write_filename[0]!='\0')
{
const char* relative_check = write_filename;
while (relative_check[1]!='\0')
{
if (relative_check[0]=='.' && relative_check[1]=='.')
write_filename = relative_check;
relative_check++;
}
}
while (write_filename[0]=='/' || write_filename[0]=='.')
write_filename++;
err = unzOpenCurrentFilePassword(uf,password);
if (err!=UNZ_OK)
{

View File

@ -68,10 +68,6 @@
#include <stdlib.h>
#include <string.h>
#ifndef NOUNCRYPT
#define NOUNCRYPT
#endif
#include "zlib.h"
#include "unzip.h"
@ -117,7 +113,7 @@
const char unz_copyright[] =
" unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
/* unz_file_info_interntal contain internal info about a file in zipfile*/
/* unz_file_info64_internal contain internal info about a file in zipfile*/
typedef struct unz_file_info64_internal_s
{
ZPOS64_T offset_curfile;/* relative offset of local header 8 bytes */
@ -497,9 +493,9 @@ local unzFile unzOpenInternal(const void *path,
ZPOS64_T central_pos;
uLong uL;
uLong number_disk; /* number of the current dist, used for
uLong number_disk; /* number of the current disk, used for
spanning ZIP, unsupported, always 0*/
uLong number_disk_with_CD; /* number the the disk with central dir, used
uLong number_disk_with_CD; /* number the disk with central dir, used
for spanning ZIP, unsupported, always 0*/
ZPOS64_T number_entry_CD; /* total number of entries in
the central dir

View File

@ -306,13 +306,17 @@ extern int ZEXPORT unzGetCurrentFileInfo(unzFile file,
Get Info about the current file
if pfile_info!=NULL, the *pfile_info structure will contain some info about
the current file
if szFileName!=NULL, the filemane string will be copied in szFileName
if szFileName!=NULL, the filename string will be copied in szFileName
(fileNameBufferSize is the size of the buffer)
if extraField!=NULL, the extra field information will be copied in extraField
(extraFieldBufferSize is the size of the buffer).
This is the Central-header version of the extra field
if szComment!=NULL, the comment string of the file will be copied in szComment
(commentBufferSize is the size of the buffer)
The file name and comment will be zero-terminated if there is room in the
provided buffer. Otherwise the buffer will contain as much as will fit. If at
least 65537 bytes of room is provided, then the result will always be
complete and zero-terminated.
*/

View File

@ -1027,7 +1027,6 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char* filename, c
int err = ZIP_OK;
# ifdef NOCRYPT
(crcForCrypting);
if (password != NULL)
return ZIP_PARAMERROR;
# endif
@ -1608,7 +1607,7 @@ extern int ZEXPORT zipCloseFileInZipRaw64(zipFile file, ZPOS64_T uncompressed_si
if((uLong)(datasize + 4) > zi->ci.size_centralExtraFree)
{
// we can not write more data to the buffer that we have room for.
// we cannot write more data to the buffer that we have room for.
return ZIP_BADZIPFILE;
}

View File

@ -6,8 +6,8 @@
<PackageId Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(PackageId).win</PackageId>
<PackageId Condition="$([MSBuild]::IsOSPlatform('Linux'))">$(PackageId).linux</PackageId>
<PackageId Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(PackageId).osx</PackageId>
<Copyright>(C) 1995-2023 Jean-loup Gailly and Mark Adler</Copyright>
<version>1.3.0.1</version>
<Copyright>(C) 1995-2024 Jean-loup Gailly and Mark Adler</Copyright>
<version>1.3.1.1</version>
<PackageDescription>NuGet Package for consuming native builds of zlib into .NET without complexity.</PackageDescription>
<!--
Warns about not having any lib or ref assemblies (.NET Assemblies) in those directories.

View File

@ -10,7 +10,7 @@ unit zlibpas;
interface
const
ZLIB_VERSION = '1.3.0.1';
ZLIB_VERSION = '1.3.1.1';
ZLIB_VERNUM = $12a0;
type

View File

@ -593,10 +593,10 @@ local int fixed(struct state *s)
* provided for each of the literal/length symbols, and for each of the
* distance symbols.
*
* - If a symbol is not used in the block, this is represented by a zero as
* as the code length. This does not mean a zero-length code, but rather
* that no code should be created for this symbol. There is no way in the
* deflate format to represent a zero-length code.
* - If a symbol is not used in the block, this is represented by a zero as the
* code length. This does not mean a zero-length code, but rather that no
* code should be created for this symbol. There is no way in the deflate
* format to represent a zero-length code.
*
* - The maximum number of bits in a code is 15, so the possible lengths for
* any code are 1..15.

View File

@ -16,6 +16,10 @@
testing, and causes pufftest to fail with not enough output space (-f does
a write like -w, so -w is not required). */
#if defined(_WIN32) && !defined(_CRT_NONSTDC_NO_DEPRECATE)
# define _CRT_NONSTDC_NO_DEPRECATE
#endif
#include <stdio.h>
#include <stdlib.h>
#include "puff.h"

View File

@ -1,4 +1,4 @@
Building instructions for the DLL versions of Zlib 1.3.0.1
Building instructions for the DLL versions of Zlib 1.3.1.1
========================================================
This directory contains projects that build zlib and minizip using

View File

@ -2,8 +2,8 @@
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
FILEVERSION 1, 3, 0, 1
PRODUCTVERSION 1, 3, 0, 1
FILEVERSION 1, 3, 1, 1
PRODUCTVERSION 1, 3, 1, 1
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
@ -17,12 +17,12 @@ BEGIN
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
VALUE "FileVersion", "1.3.0.1\0"
VALUE "FileVersion", "1.3.1.1\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"
VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"

View File

@ -2,8 +2,8 @@
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
FILEVERSION 1, 3, 0, 1
PRODUCTVERSION 1, 3, 0, 1
FILEVERSION 1, 3, 1, 1
PRODUCTVERSION 1, 3, 1, 1
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
@ -17,12 +17,12 @@ BEGIN
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
VALUE "FileVersion", "1.3.0.1\0"
VALUE "FileVersion", "1.3.1.1\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"
VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"

View File

@ -2,8 +2,8 @@
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
FILEVERSION 1, 3, 0, 1
PRODUCTVERSION 1, 3, 0, 1
FILEVERSION 1, 3, 1, 1
PRODUCTVERSION 1, 3, 1, 1
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
@ -17,12 +17,12 @@ BEGIN
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
VALUE "FileVersion", "1.3.0.1\0"
VALUE "FileVersion", "1.3.1.1\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"
VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"

View File

@ -2,8 +2,8 @@
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
FILEVERSION 1, 3, 0, 1
PRODUCTVERSION 1, 3, 0, 1
FILEVERSION 1, 3, 1, 1
PRODUCTVERSION 1, 3, 1, 1
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
@ -17,12 +17,12 @@ BEGIN
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
VALUE "FileVersion", "1.3.0.1\0"
VALUE "FileVersion", "1.3.1.1\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"
VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"

View File

@ -2,8 +2,8 @@
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
FILEVERSION 1, 3, 0, 1
PRODUCTVERSION 1, 3, 0, 1
FILEVERSION 1, 3, 1, 1
PRODUCTVERSION 1, 3, 1, 1
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
@ -17,12 +17,12 @@ BEGIN
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
VALUE "FileVersion", "1.3.0.1\0"
VALUE "FileVersion", "1.3.1.1\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"
VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"

View File

@ -2,8 +2,8 @@
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
FILEVERSION 1, 3, 0, 1
PRODUCTVERSION 1, 3, 0, 1
FILEVERSION 1, 3, 1, 1
PRODUCTVERSION 1, 3, 1, 1
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
@ -17,12 +17,12 @@ BEGIN
BEGIN
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
VALUE "FileVersion", "1.3.0.1\0"
VALUE "FileVersion", "1.3.1.1\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlibwapi.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
VALUE "LegalCopyright", "(C) 1995-2023 Jean-loup Gailly & Mark Adler\0"
VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"

45
deps/zlib/deflate.c vendored
View File

@ -1,5 +1,5 @@
/* deflate.c -- compress data using the deflation algorithm
* Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler
* Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -52,7 +52,7 @@
#include "deflate.h"
const char deflate_copyright[] =
" deflate 1.3.0.1 Copyright 1995-2023 Jean-loup Gailly and Mark Adler ";
" deflate 1.3.1.1 Copyright 1995-2024 Jean-loup Gailly and Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@ -493,11 +493,7 @@ int ZEXPORT deflateInit2_(z_streamp strm, int level, int method,
* symbols from which it is being constructed.
*/
#ifdef LIT_MEM
s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, 5);
#else
s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, 4);
#endif
s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, LIT_BUFS);
s->pending_buf_size = (ulg)s->lit_bufsize * 4;
if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
@ -1310,7 +1306,7 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) {
ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));
ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));
ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, 4);
ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, LIT_BUFS);
if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
ds->pending_buf == Z_NULL) {
@ -1321,7 +1317,7 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) {
zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos));
zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos));
zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
zmemcpy(ds->pending_buf, ss->pending_buf, ds->lit_bufsize * LIT_BUFS);
ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
#ifdef LIT_MEM
@ -1560,13 +1556,21 @@ local uInt longest_match(deflate_state *s, IPos cur_match) {
*/
local void check_match(deflate_state *s, IPos start, IPos match, int length) {
/* check that the match is indeed a match */
if (zmemcmp(s->window + match,
s->window + start, length) != EQUAL) {
fprintf(stderr, " start %u, match %u, length %d\n",
start, match, length);
Bytef *back = s->window + (int)match, *here = s->window + start;
IPos len = length;
if (match == (IPos)-1) {
/* match starts one byte before the current window -- just compare the
subsequent length-1 bytes */
back++;
here++;
len--;
}
if (zmemcmp(back, here, len) != EQUAL) {
fprintf(stderr, " start %u, match %d, length %d\n",
start, (int)match, length);
do {
fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
} while (--length != 0);
fprintf(stderr, "(%02x %02x)", *back++, *here++);
} while (--len != 0);
z_error("invalid match");
}
if (z_verbose > 1) {
@ -1631,7 +1635,8 @@ local block_state deflate_stored(deflate_state *s, int flush) {
* possible. If flushing, copy the remaining available input to next_out as
* stored blocks, if there is enough space.
*/
unsigned len, left, have, last = 0;
int last = 0;
unsigned len, left, have;
unsigned used = s->strm->avail_in;
do {
/* Set len to the maximum size block that we can copy directly with the
@ -1667,10 +1672,10 @@ local block_state deflate_stored(deflate_state *s, int flush) {
_tr_stored_block(s, (char *)0, 0L, last);
/* Replace the lengths in the dummy stored block with len. */
s->pending_buf[s->pending - 4] = len;
s->pending_buf[s->pending - 3] = len >> 8;
s->pending_buf[s->pending - 2] = ~len;
s->pending_buf[s->pending - 1] = ~len >> 8;
s->pending_buf[s->pending - 4] = (Bytef)len;
s->pending_buf[s->pending - 3] = (Bytef)(len >> 8);
s->pending_buf[s->pending - 2] = (Bytef)~len;
s->pending_buf[s->pending - 1] = (Bytef)(~len >> 8);
/* Write the stored block header bytes. */
flush_pending(s->strm);

4
deps/zlib/deflate.h vendored
View File

@ -1,5 +1,5 @@
/* deflate.h -- internal compression state
* Copyright (C) 1995-2018 Jean-loup Gailly
* Copyright (C) 1995-2024 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -222,9 +222,11 @@ typedef struct internal_state {
*/
#ifdef LIT_MEM
# define LIT_BUFS 5
ushf *d_buf; /* buffer for distances */
uchf *l_buf; /* buffer for literals/lengths */
#else
# define LIT_BUFS 4
uchf *sym_buf; /* buffer for distances and literals/lengths */
#endif

View File

@ -212,8 +212,8 @@
to the appropriate recovery below. If there is no foo.add file, provide
a zero data length to the recovery. In that case, the append recovery
restores the foo.gz to the previous compressed + uncompressed data state.
For the the compress recovery, a missing foo.add file results in foo.gz
being restored to the previous compressed-only data state.
For the compress recovery, a missing foo.add file results in foo.gz being
restored to the previous compressed-only data state.
- Append recovery:
- Pick up append at + step above
- Compress recovery:

View File

@ -10,6 +10,10 @@
// the data, so it is fast, but no advantage is gained from the history that
// could be available across member boundaries.
#if defined(_WIN32) && !defined(_CRT_NONSTDC_NO_DEPRECATE)
# define _CRT_NONSTDC_NO_DEPRECATE
#endif
#include <stdio.h> // fread, fwrite, putc, fflush, ferror, fprintf,
// vsnprintf, stdout, stderr, NULL, FILE
#include <stdlib.h> // malloc, free

View File

@ -12,6 +12,10 @@
Avoid some compiler warnings for input and output buffers
*/
#if defined(_WIN32) && !defined(_CRT_NONSTDC_NO_DEPRECATE)
# define _CRT_NONSTDC_NO_DEPRECATE
#endif
#include <stdio.h>
#include <string.h>
#include <assert.h>

View File

@ -1,7 +1,7 @@
/* zran.c -- example of deflate stream indexing and random access
* Copyright (C) 2005, 2012, 2018, 2023 Mark Adler
* Copyright (C) 2005, 2012, 2018, 2023, 2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
* Version 1.4 13 Apr 2023 Mark Adler */
* Version 1.5 4 Feb 2024 Mark Adler */
/* Version History:
1.0 29 May 2005 First version
@ -14,6 +14,10 @@
Do a binary search over the index for an access point
Expose the access point type to enable save and load
1.4 13 Apr 2023 Add a NOPRIME define to not use inflatePrime()
1.5 4 Feb 2024 Set returned index to NULL on an index build error
Stop decoding once request is satisfied
Provide a reusable inflate engine in the index
Allocate the dictionaries to reduce memory usage
*/
// Illustrate the use of Z_BLOCK, inflatePrime(), and inflateSetDictionary()
@ -67,7 +71,11 @@
// See comments in zran.h.
void deflate_index_free(struct deflate_index *index) {
if (index != NULL) {
size_t i = index->have;
while (i)
free(index->list[--i].window);
free(index->list);
inflateEnd(&index->strm);
free(index);
}
}
@ -76,26 +84,12 @@ void deflate_index_free(struct deflate_index *index) {
// list and return NULL. index->mode is temporarily the allocated number of
// access points, until it is time for deflate_index_build() to return. Then
// index->mode is set to the mode of inflation.
static struct deflate_index *add_point(struct deflate_index *index, int bits,
off_t in, off_t out, unsigned left,
static struct deflate_index *add_point(struct deflate_index *index, off_t in,
off_t out, off_t beg,
unsigned char *window) {
if (index == NULL) {
// The list is empty. Create it, starting with eight access points.
index = malloc(sizeof(struct deflate_index));
if (index == NULL)
return NULL;
index->have = 0;
index->mode = 8;
index->list = malloc(sizeof(point_t) * index->mode);
if (index->list == NULL) {
free(index);
return NULL;
}
}
else if (index->have == index->mode) {
if (index->have == index->mode) {
// The list is full. Make it bigger.
index->mode <<= 1;
index->mode = index->mode ? index->mode << 1 : 8;
point_t *next = realloc(index->list, sizeof(point_t) * index->mode);
if (next == NULL) {
deflate_index_free(index);
@ -113,11 +107,18 @@ static struct deflate_index *add_point(struct deflate_index *index, int bits,
}
next->out = out;
next->in = in;
next->bits = bits;
if (left)
memcpy(next->window, window + WINSIZE - left, left);
if (left < WINSIZE)
memcpy(next->window + left, window, WINSIZE - left);
next->bits = index->strm.data_type & 7;
next->dict = out - beg > WINSIZE ? WINSIZE : (unsigned)(out - beg);
next->window = malloc(next->dict);
if (next->window == NULL) {
deflate_index_free(index);
return NULL;
}
unsigned recent = WINSIZE - index->strm.avail_out;
unsigned copy = recent > next->dict ? next->dict : recent;
memcpy(next->window + next->dict - copy, window + recent - copy, copy);
copy = next->dict - copy;
memcpy(next->window, window + WINSIZE - copy, copy);
// Return the index, which may have been newly allocated or destroyed.
return index;
@ -130,25 +131,39 @@ static struct deflate_index *add_point(struct deflate_index *index, int bits,
// See comments in zran.h.
int deflate_index_build(FILE *in, off_t span, struct deflate_index **built) {
// Set up inflation state.
z_stream strm = {0}; // inflate engine (gets fired up later)
// If this returns with an error, any attempt to use the index will cleanly
// return an error.
*built = NULL;
// Create and initialize the index list.
struct deflate_index *index = malloc(sizeof(struct deflate_index));
if (index == NULL)
return Z_MEM_ERROR;
index->have = 0;
index->mode = 0; // entries in index->list allocation
index->list = NULL;
index->strm.state = Z_NULL; // so inflateEnd() can work
// Set up the inflation state.
index->strm.avail_in = 0;
index->strm.avail_out = 0;
unsigned char buf[CHUNK]; // input buffer
unsigned char win[WINSIZE] = {0}; // output sliding window
off_t totin = 0; // total bytes read from input
off_t totout = 0; // total bytes uncompressed
off_t beg = 0; // starting offset of last history reset
int mode = 0; // mode: RAW, ZLIB, or GZIP (0 => not set yet)
// Decompress from in, generating access points along the way.
int ret; // the return value from zlib, or Z_ERRNO
off_t last; // last access point uncompressed offset
struct deflate_index *index = NULL; // list of access points
do {
// Assure available input, at least until reaching EOF.
if (strm.avail_in == 0) {
strm.avail_in = fread(buf, 1, sizeof(buf), in);
totin += strm.avail_in;
strm.next_in = buf;
if (strm.avail_in < sizeof(buf) && ferror(in)) {
if (index->strm.avail_in == 0) {
index->strm.avail_in = fread(buf, 1, sizeof(buf), in);
totin += index->strm.avail_in;
index->strm.next_in = buf;
if (index->strm.avail_in < sizeof(buf) && ferror(in)) {
ret = Z_ERRNO;
break;
}
@ -159,11 +174,14 @@ int deflate_index_build(FILE *in, off_t span, struct deflate_index **built) {
// in a false positive for zlib, but in practice the fill bits
// after a stored block are always zeros, so a raw stream won't
// start with an 8 in the low nybble.
mode = strm.avail_in == 0 ? RAW : // empty -- will fail
(strm.next_in[0] & 0xf) == 8 ? ZLIB :
strm.next_in[0] == 0x1f ? GZIP :
mode = index->strm.avail_in == 0 ? RAW : // will fail
(index->strm.next_in[0] & 0xf) == 8 ? ZLIB :
index->strm.next_in[0] == 0x1f ? GZIP :
/* else */ RAW;
ret = inflateInit2(&strm, mode);
index->strm.zalloc = Z_NULL;
index->strm.zfree = Z_NULL;
index->strm.opaque = Z_NULL;
ret = inflateInit2(&index->strm, mode);
if (ret != Z_OK)
break;
}
@ -171,32 +189,32 @@ int deflate_index_build(FILE *in, off_t span, struct deflate_index **built) {
// Assure available output. This rotates the output through, for use as
// a sliding window on the uncompressed data.
if (strm.avail_out == 0) {
strm.avail_out = sizeof(win);
strm.next_out = win;
if (index->strm.avail_out == 0) {
index->strm.avail_out = sizeof(win);
index->strm.next_out = win;
}
if (mode == RAW && index == NULL)
if (mode == RAW && index->have == 0)
// We skip the inflate() call at the start of raw deflate data in
// order generate an access point there. Set data_type to imitate
// the end of a header.
strm.data_type = 0x80;
index->strm.data_type = 0x80;
else {
// Inflate and update the number of uncompressed bytes.
unsigned before = strm.avail_out;
ret = inflate(&strm, Z_BLOCK);
totout += before - strm.avail_out;
unsigned before = index->strm.avail_out;
ret = inflate(&index->strm, Z_BLOCK);
totout += before - index->strm.avail_out;
}
if ((strm.data_type & 0xc0) == 0x80 &&
(index == NULL || totout - last >= span)) {
if ((index->strm.data_type & 0xc0) == 0x80 &&
(index->have == 0 || totout - last >= span)) {
// We are at the end of a header or a non-last deflate block, so we
// can add an access point here. Furthermore, we are either at the
// very start for the first access point, or there has been span or
// more uncompressed bytes since the last access point, so we want
// to add an access point here.
index = add_point(index, strm.data_type & 7, totin - strm.avail_in,
totout, strm.avail_out, win);
index = add_point(index, totin - index->strm.avail_in, totout, beg,
win);
if (index == NULL) {
ret = Z_MEM_ERROR;
break;
@ -205,16 +223,17 @@ int deflate_index_build(FILE *in, off_t span, struct deflate_index **built) {
}
if (ret == Z_STREAM_END && mode == GZIP &&
(strm.avail_in || ungetc(getc(in), in) != EOF))
(index->strm.avail_in || ungetc(getc(in), in) != EOF)) {
// There is more input after the end of a gzip member. Reset the
// inflate state to read another gzip member. On success, this will
// set ret to Z_OK to continue decompressing.
ret = inflateReset2(&strm, GZIP);
ret = inflateReset2(&index->strm, GZIP);
beg = totout; // reset history
}
// Keep going until Z_STREAM_END or error. If the compressed data ends
// prematurely without a file read error, Z_BUF_ERROR is returned.
} while (ret == Z_OK);
inflateEnd(&strm);
if (ret != Z_STREAM_END) {
// An error was encountered. Discard the index and return a negative
@ -223,17 +242,9 @@ int deflate_index_build(FILE *in, off_t span, struct deflate_index **built) {
return ret == Z_NEED_DICT ? Z_DATA_ERROR : ret;
}
// Shrink the index to only the occupied access points and return it.
// Return the index.
index->mode = mode;
index->length = totout;
point_t *list = realloc(index->list, sizeof(point_t) * index->have);
if (list == NULL) {
// Seems like a realloc() to make something smaller should always work,
// but just in case.
deflate_index_free(index);
return Z_MEM_ERROR;
}
index->list = list;
*built = index;
return index->have;
}
@ -267,7 +278,7 @@ static inline void append_bits(unsigned value, int bits,
}
}
// Insert enough bits in the form of empty deflate blocks in front of the the
// Insert enough bits in the form of empty deflate blocks in front of the
// low bits bits of value, in order to bring the sequence to a byte boundary.
// Then feed that to inflate(). This does what inflatePrime() does, except that
// a negative value of bits is not supported. bits must be in 0..16. If the
@ -330,7 +341,8 @@ static int inflatePreface(z_stream *strm, int bits, int value) {
ptrdiff_t deflate_index_extract(FILE *in, struct deflate_index *index,
off_t offset, unsigned char *buf, size_t len) {
// Do a quick sanity check on the index.
if (index == NULL || index->have < 1 || index->list[0].out != 0)
if (index == NULL || index->have < 1 || index->list[0].out != 0 ||
index->strm.state == Z_NULL)
return Z_STREAM_ERROR;
// If nothing to extract, return zero bytes extracted.
@ -356,13 +368,13 @@ ptrdiff_t deflate_index_extract(FILE *in, struct deflate_index *index,
int ch = 0;
if (point->bits && (ch = getc(in)) == EOF)
return ferror(in) ? Z_ERRNO : Z_BUF_ERROR;
z_stream strm = {0};
ret = inflateInit2(&strm, RAW);
index->strm.avail_in = 0;
ret = inflateReset2(&index->strm, RAW);
if (ret != Z_OK)
return ret;
if (point->bits)
INFLATEPRIME(&strm, point->bits, ch >> (8 - point->bits));
inflateSetDictionary(&strm, point->window, WINSIZE);
INFLATEPRIME(&index->strm, point->bits, ch >> (8 - point->bits));
inflateSetDictionary(&index->strm, point->window, point->dict);
// Skip uncompressed bytes until offset reached, then satisfy request.
unsigned char input[CHUNK];
@ -372,48 +384,54 @@ ptrdiff_t deflate_index_extract(FILE *in, struct deflate_index *index,
do {
if (offset) {
// Discard up to offset uncompressed bytes.
strm.avail_out = offset < WINSIZE ? (unsigned)offset : WINSIZE;
strm.next_out = discard;
index->strm.avail_out = offset < WINSIZE ? (unsigned)offset :
WINSIZE;
index->strm.next_out = discard;
}
else {
// Uncompress up to left bytes into buf.
strm.avail_out = left < UINT_MAX ? (unsigned)left : UINT_MAX;
strm.next_out = buf + len - left;
index->strm.avail_out = left < UINT_MAX ? (unsigned)left :
UINT_MAX;
index->strm.next_out = buf + len - left;
}
// Uncompress, setting got to the number of bytes uncompressed.
if (strm.avail_in == 0) {
if (index->strm.avail_in == 0) {
// Assure available input.
strm.avail_in = fread(input, 1, CHUNK, in);
if (strm.avail_in < CHUNK && ferror(in)) {
index->strm.avail_in = fread(input, 1, CHUNK, in);
if (index->strm.avail_in < CHUNK && ferror(in)) {
ret = Z_ERRNO;
break;
}
strm.next_in = input;
index->strm.next_in = input;
}
unsigned got = strm.avail_out;
ret = inflate(&strm, Z_NO_FLUSH);
got -= strm.avail_out;
unsigned got = index->strm.avail_out;
ret = inflate(&index->strm, Z_NO_FLUSH);
got -= index->strm.avail_out;
// Update the appropriate count.
if (offset)
offset -= got;
else
else {
left -= got;
if (left == 0)
// Request satisfied.
break;
}
// If we're at the end of a gzip member and there's more to read,
// continue to the next gzip member.
if (ret == Z_STREAM_END && index->mode == GZIP) {
// Discard the gzip trailer.
unsigned drop = 8; // length of gzip trailer
if (strm.avail_in >= drop) {
strm.avail_in -= drop;
strm.next_in += drop;
if (index->strm.avail_in >= drop) {
index->strm.avail_in -= drop;
index->strm.next_in += drop;
}
else {
// Read and discard the remainder of the gzip trailer.
drop -= strm.avail_in;
strm.avail_in = 0;
drop -= index->strm.avail_in;
index->strm.avail_in = 0;
do {
if (getc(in) == EOF)
// The input does not have a complete trailer.
@ -421,33 +439,32 @@ ptrdiff_t deflate_index_extract(FILE *in, struct deflate_index *index,
} while (--drop);
}
if (strm.avail_in || ungetc(getc(in), in) != EOF) {
if (index->strm.avail_in || ungetc(getc(in), in) != EOF) {
// There's more after the gzip trailer. Use inflate to skip the
// gzip header and resume the raw inflate there.
inflateReset2(&strm, GZIP);
inflateReset2(&index->strm, GZIP);
do {
if (strm.avail_in == 0) {
strm.avail_in = fread(input, 1, CHUNK, in);
if (strm.avail_in < CHUNK && ferror(in)) {
if (index->strm.avail_in == 0) {
index->strm.avail_in = fread(input, 1, CHUNK, in);
if (index->strm.avail_in < CHUNK && ferror(in)) {
ret = Z_ERRNO;
break;
}
strm.next_in = input;
index->strm.next_in = input;
}
strm.avail_out = WINSIZE;
strm.next_out = discard;
ret = inflate(&strm, Z_BLOCK); // stop at end of header
} while (ret == Z_OK && (strm.data_type & 0x80) == 0);
index->strm.avail_out = WINSIZE;
index->strm.next_out = discard;
ret = inflate(&index->strm, Z_BLOCK); // stop after header
} while (ret == Z_OK && (index->strm.data_type & 0x80) == 0);
if (ret != Z_OK)
break;
inflateReset2(&strm, RAW);
inflateReset2(&index->strm, RAW);
}
}
// Continue until we have the requested data, the deflate data has
// ended, or an error is encountered.
} while (ret == Z_OK && left);
inflateEnd(&strm);
} while (ret == Z_OK);
// Return the number of uncompressed bytes read into buf, or the error.
return ret == Z_OK || ret == Z_STREAM_END ? len - left : ret;

View File

@ -1,7 +1,7 @@
/* zran.h -- example of deflated stream indexing and random access
* Copyright (C) 2005, 2012, 2018, 2023 Mark Adler
* Copyright (C) 2005, 2012, 2018, 2023, 2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
* Version 1.3 18 Feb 2023 Mark Adler */
* Version 1.5 4 Feb 2024 Mark Adler */
#include <stdio.h>
#include "zlib.h"
@ -11,7 +11,8 @@ typedef struct point {
off_t out; // offset in uncompressed data
off_t in; // offset in compressed file of first full byte
int bits; // 0, or number of bits (1-7) from byte at in-1
unsigned char window[32768]; // preceding 32K of uncompressed data
unsigned dict; // number of bytes in window to use as a dictionary
unsigned char *window; // preceding 32K (or less) of uncompressed data
} point_t;
// Access point list.
@ -20,6 +21,7 @@ struct deflate_index {
int mode; // -15 for raw, 15 for zlib, or 31 for gzip
off_t length; // total length of uncompressed data
point_t *list; // allocated list of access points
z_stream strm; // re-usable inflate engine for extraction
};
// Make one pass through a zlib, gzip, or raw deflate compressed stream and
@ -30,7 +32,7 @@ struct deflate_index {
// the number of access points on success (>= 1), Z_MEM_ERROR for out of
// memory, Z_BUF_ERROR for a premature end of input, Z_DATA_ERROR for a format
// or verification error in the input file, or Z_ERRNO for a file read error.
// On success, *built points to the resulting index.
// On success, *built points to the resulting index, otherwise it's NULL.
int deflate_index_build(FILE *in, off_t span, struct deflate_index **built);
// Use the index to read len bytes from offset into buf. Return the number of

52
deps/zlib/gzguts.h vendored
View File

@ -1,5 +1,5 @@
/* gzguts.h -- zlib internal header definitions for gz* operations
* Copyright (C) 2004-2019 Mark Adler
* Copyright (C) 2004-2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -17,6 +17,13 @@
# define ZLIB_INTERNAL
#endif
#if defined(_WIN32) && !defined(_CRT_SECURE_NO_WARNINGS)
# define _CRT_SECURE_NO_WARNINGS
#endif
#if defined(_WIN32) && !defined(_CRT_NONSTDC_NO_DEPRECATE)
# define _CRT_NONSTDC_NO_DEPRECATE
#endif
#include <stdio.h>
#include "zlib.h"
#ifdef STDC
@ -25,8 +32,8 @@
# include <limits.h>
#endif
#ifndef _POSIX_SOURCE
# define _POSIX_SOURCE
#ifndef _POSIX_C_SOURCE
# define _POSIX_C_SOURCE 200112L
#endif
#include <fcntl.h>
@ -36,19 +43,13 @@
#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)
# include <io.h>
# include <sys/stat.h>
#endif
#if defined(_WIN32)
#if defined(_WIN32) && !defined(WIDECHAR)
# define WIDECHAR
#endif
#ifdef WINAPI_FAMILY
# define open _open
# define read _read
# define write _write
# define close _close
#endif
#ifdef NO_DEFLATE /* for compatibility with old definition */
# define NO_GZCOMPRESS
#endif
@ -72,33 +73,28 @@
#endif
#ifndef HAVE_VSNPRINTF
# ifdef MSDOS
# if !defined(NO_vsnprintf) && \
(defined(MSDOS) || defined(__TURBOC__) || defined(__SASC) || \
defined(VMS) || defined(__OS400) || defined(__MVS__))
/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
but for now we just assume it doesn't. */
# define NO_vsnprintf
# endif
# ifdef __TURBOC__
# define NO_vsnprintf
# endif
# ifdef WIN32
/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
# if !defined(vsnprintf) && !defined(NO_vsnprintf)
# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
# ifndef vsnprintf
# define vsnprintf _vsnprintf
# endif
# endif
# elif !defined(__STDC_VERSION__) || __STDC_VERSION__-0 < 199901L
/* Otherwise if C89/90, assume no C99 snprintf() or vsnprintf() */
# ifndef NO_snprintf
# define NO_snprintf
# endif
# ifdef __SASC
# ifndef NO_vsnprintf
# define NO_vsnprintf
# endif
# ifdef VMS
# define NO_vsnprintf
# endif
# ifdef __OS400__
# define NO_vsnprintf
# endif
# ifdef __MVS__
# define NO_vsnprintf
# endif
#endif
@ -210,9 +206,5 @@ char ZLIB_INTERNAL *gz_strwinerror(DWORD error);
/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
value -- needed when comparing unsigned to z_off64_t, which is signed
(possible z_off64_t types off_t, off64_t, and long are all signed) */
#ifdef INT_MAX
# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
#else
unsigned ZLIB_INTERNAL gz_intmax(void);
# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
#endif
#define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())

43
deps/zlib/gzlib.c vendored
View File

@ -1,19 +1,21 @@
/* gzlib.c -- zlib functions common to reading and writing gzip files
* Copyright (C) 2004-2019 Mark Adler
* Copyright (C) 2004-2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "gzguts.h"
#if defined(_WIN32) && !defined(__BORLANDC__)
#if defined(UNDER_CE)
# define LSEEK _wcelseek
#elif defined(__DJGPP__)
# define LSEEK llseek
#elif defined(_WIN32) && !defined(__BORLANDC__)
# define LSEEK _lseeki64
#else
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
#elif defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
# define LSEEK lseek64
#else
# define LSEEK lseek
#endif
#endif
#if defined UNDER_CE
@ -52,7 +54,7 @@ char ZLIB_INTERNAL *gz_strwinerror(DWORD error) {
msgbuf[chars] = 0;
}
wcstombs(buf, msgbuf, chars + 1);
wcstombs(buf, msgbuf, chars + 1); // assumes buf is big enough
LocalFree(msgbuf);
}
else {
@ -179,11 +181,8 @@ local gzFile gz_open(const void *path, int fd, const char *mode) {
/* save the path name for error messages */
#ifdef WIDECHAR
if (fd == -2) {
if (fd == -2)
len = wcstombs(NULL, path, 0);
if (len == (z_size_t)-1)
len = 0;
}
else
#endif
len = strlen((const char *)path);
@ -193,18 +192,21 @@ local gzFile gz_open(const void *path, int fd, const char *mode) {
return NULL;
}
#ifdef WIDECHAR
if (fd == -2)
if (fd == -2) {
if (len)
wcstombs(state->path, path, len + 1);
else
*(state->path) = 0;
}
else
#endif
{
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
(void)snprintf(state->path, len + 1, "%s", (const char *)path);
#else
strcpy(state->path, path);
#endif
}
/* compute the flags for open() */
oflag =
@ -228,11 +230,14 @@ local gzFile gz_open(const void *path, int fd, const char *mode) {
O_APPEND)));
/* open the file with the appropriate flags (or just use fd) */
state->fd = fd > -1 ? fd : (
if (fd == -1)
state->fd = open((const char *)path, oflag, 0666);
#ifdef WIDECHAR
fd == -2 ? _wopen(path, oflag, 0666) :
else if (fd == -2)
state->fd = _wopen(path, oflag, _S_IREAD | _S_IWRITE);
#endif
open((const char *)path, oflag, 0666));
else
state->fd = fd;
if (state->fd == -1) {
free(state->path);
free(state);
@ -563,20 +568,20 @@ void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) {
#endif
}
#ifndef INT_MAX
/* portably return maximum value for an int (when limits.h presumed not
available) -- we need to do this to cover cases where 2's complement not
used, since C standard permits 1's complement and sign-bit representations,
otherwise we could just use ((unsigned)-1) >> 1 */
unsigned ZLIB_INTERNAL gz_intmax(void) {
unsigned p, q;
p = 1;
#ifdef INT_MAX
return INT_MAX;
#else
unsigned p = 1, q;
do {
q = p;
p <<= 1;
p++;
} while (p > q);
return q >> 1;
}
#endif
}

3
deps/zlib/gzread.c vendored
View File

@ -374,7 +374,8 @@ int ZEXPORT gzread(gzFile file, voidp buf, unsigned len) {
}
/* -- see zlib.h -- */
z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems, gzFile file) {
z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems,
gzFile file) {
z_size_t len;
gz_statep state;

View File

@ -1,5 +1,5 @@
/* inftrees.c -- generate Huffman trees for efficient decoding
* Copyright (C) 1995-2023 Mark Adler
* Copyright (C) 1995-2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -9,7 +9,7 @@
#define MAXBITS 15
const char inflate_copyright[] =
" inflate 1.3.0.1 Copyright 1995-2023 Mark Adler ";
" inflate 1.3.1.1 Copyright 1995-2024 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@ -57,7 +57,7 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 70, 200};
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 73, 200};
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,

View File

@ -3,7 +3,7 @@
# test works out-of-the-box, installs `somewhere' on demand
# Toolflags:
CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fah
CCflags = -c -depend !Depend -IC: -g -throwback -fah
C++flags = -c -depend !Depend -IC: -throwback
Linkflags = -aif -c++ -o $@
ObjAsmflags = -throwback -NoCache -depend !Depend

View File

@ -115,7 +115,7 @@ SUCCESS Then
ReDim Preserve bytaryCpr(lngCprSiz - 1)
Open strCprPth For Binary Access Write As #1
Put #1, , bytaryCpr()
Put #1, , lngOriSiz 'Add the the original size value to the end
Put #1, , lngOriSiz 'Add the original size value to the end
(last 4 bytes)
Close #1
Else

View File

@ -1,4 +1,4 @@
ZLIB version 1.3.0.1 for OS/400 installation instructions
ZLIB version 1.3.1.1 for OS/400 installation instructions
1) Download and unpack the zlib tarball to some IFS directory.
(i.e.: /path/to/the/zlib/ifs/source/directory)

View File

@ -1,7 +1,7 @@
* ZLIB.INC - Interface to the general purpose compression library
*
* ILE RPG400 version by Patrick Monnerat, DATASPHERE.
* Version 1.3.0.1
* Version 1.3.1.1
*
*
* WARNING:
@ -22,12 +22,12 @@
*
* Versioning information.
*
D ZLIB_VERSION C '1.3.0.1'
D ZLIB_VERSION C '1.3.1.1'
D ZLIB_VERNUM C X'12a0'
D ZLIB_VER_MAJOR C 1
D ZLIB_VER_MINOR C 3
D ZLIB_VER_REVISION...
D C 0
D C 1
D ZLIB_VER_SUBREVISION...
D C 1
*

View File

@ -25,10 +25,10 @@
<QPG:Files>
<QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/>
<QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/>
<QPG:Add file="../libz.so.1.3.0.1" install="/opt/lib/" user="root:bin" permission="644"/>
<QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.3.0.1"/>
<QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.3.0.1"/>
<QPG:Add file="../libz.so.1.3.0.1" install="/opt/lib/" component="slib"/>
<QPG:Add file="../libz.so.1.3.1.1" install="/opt/lib/" user="root:bin" permission="644"/>
<QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.3.1.1"/>
<QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.3.1.1"/>
<QPG:Add file="../libz.so.1.3.1.1" install="/opt/lib/" component="slib"/>
</QPG:Files>
<QPG:PackageFilter>
@ -58,12 +58,12 @@
<QPM:ProductIconLarge></QPM:ProductIconLarge>
<QPM:ProductDescriptionShort>A massively spiffy yet delicately unobtrusive compression library.</QPM:ProductDescriptionShort>
<QPM:ProductDescriptionLong>zlib is designed to be a free, general-purpose, legally unencumbered, lossless data compression library for use on virtually any computer hardware and operating system.</QPM:ProductDescriptionLong>
<QPM:ProductDescriptionURL>http://www.gzip.org/zlib</QPM:ProductDescriptionURL>
<QPM:ProductDescriptionURL>https://zlib.net/</QPM:ProductDescriptionURL>
<QPM:ProductDescriptionEmbedURL></QPM:ProductDescriptionEmbedURL>
</QPM:ProductDescription>
<QPM:ReleaseDescription>
<QPM:ReleaseVersion>1.3.0.1</QPM:ReleaseVersion>
<QPM:ReleaseVersion>1.3.1.1</QPM:ReleaseVersion>
<QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
<QPM:ReleaseStability>Stable</QPM:ReleaseStability>
<QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor>

View File

@ -5,6 +5,10 @@
/* @(#) $Id$ */
#if defined(_WIN32) && !defined(_CRT_SECURE_NO_WARNINGS)
# define _CRT_SECURE_NO_WARNINGS
#endif
#include "zlib.h"
#include <stdio.h>
@ -13,8 +17,10 @@
# include <stdlib.h>
#endif
#if defined(VMS) || defined(RISCOS)
#if defined(VMS)
# define TESTFILE "foo-gz"
#elif defined(__riscos) && !defined(__TARGET_UNIXLIB__)
# define TESTFILE "foo/gz"
#else
# define TESTFILE "foo.gz"
#endif

View File

@ -185,7 +185,7 @@ local void mem_used(z_stream *strm, char *prefix)
{
struct mem_zone *zone = strm->opaque;
fprintf(stderr, "%s: %lu allocated\n", prefix, zone->total);
fprintf(stderr, "%s: %zu allocated\n", prefix, zone->total);
}
/* show the high water allocation in bytes */
@ -193,7 +193,7 @@ local void mem_high(z_stream *strm, char *prefix)
{
struct mem_zone *zone = strm->opaque;
fprintf(stderr, "%s: %lu high water mark\n", prefix, zone->highwater);
fprintf(stderr, "%s: %zu high water mark\n", prefix, zone->highwater);
}
/* release the memory allocation zone -- if there are any surprises, notify */
@ -218,7 +218,7 @@ local void mem_done(z_stream *strm, char *prefix)
/* issue alerts about anything unexpected */
if (count || zone->total)
fprintf(stderr, "** %s: %lu bytes in %d blocks not freed\n",
fprintf(stderr, "** %s: %zu bytes in %d blocks not freed\n",
prefix, zone->total, count);
if (zone->notlifo)
fprintf(stderr, "** %s: %d frees not LIFO\n", prefix, zone->notlifo);

View File

@ -15,6 +15,17 @@
/* @(#) $Id$ */
#ifndef _POSIX_C_SOURCE
# define _POSIX_C_SOURCE 200112L
#endif
#if defined(_WIN32) && !defined(_CRT_SECURE_NO_WARNINGS)
# define _CRT_SECURE_NO_WARNINGS
#endif
#if defined(_WIN32) && !defined(_CRT_NONSTDC_NO_DEPRECATE)
# define _CRT_NONSTDC_NO_DEPRECATE
#endif
#include "zlib.h"
#include <stdio.h>
@ -40,18 +51,16 @@
# define SET_BINARY_MODE(file)
#endif
#if defined(_MSC_VER) && _MSC_VER < 1900
# define snprintf _snprintf
#endif
#ifdef VMS
# define unlink delete
# define GZ_SUFFIX "-gz"
#endif
#ifdef RISCOS
#if defined(__riscos) && !defined(__TARGET_UNIXLIB__)
# define GZ_SUFFIX "/gz"
# ifndef __GNUC__
# define unlink remove
# define GZ_SUFFIX "-gz"
# define fileno(file) file->__file
# endif
#endif
#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
# include <unix.h> /* for fileno */
@ -142,6 +151,25 @@ static void pwinerror (s)
# define local
#endif
/* ===========================================================================
* Safe string copy. Copy up to len bytes from src to dst, if src terminates
* with a null by then. If not, copy len-1 bytes from src, terminating it with
* a null in dst[len-1], cutting src short. Return a pointer to the terminating
* null. If len is zero, nothing is written to *dst and NULL is returned.
*/
static char *string_copy(char *dst, char const *src, z_size_t len) {
if (len == 0)
return NULL;
while (--len) {
*dst = *src++;
if (*dst == 0)
return dst;
dst++;
}
*dst = 0;
return dst;
}
#ifdef Z_SOLO
/* for Z_SOLO, create simplified gz* functions using deflate and inflate */
@ -303,7 +331,7 @@ static void error(const char *msg) {
#ifdef USE_MMAP /* MMAP version, Miguel Albrecht <malbrech@eso.org> */
/* Try compressing the input file at once using mmap. Return Z_OK if
* if success, Z_ERRNO otherwise.
* success, Z_ERRNO otherwise.
*/
static int gz_compress_mmap(FILE *in, gzFile out) {
int len;
@ -391,7 +419,7 @@ static void gz_uncompress(gzFile in, FILE *out) {
* original.
*/
static void file_compress(char *file, char *mode) {
local char outfile[MAX_NAME_LEN];
local char outfile[MAX_NAME_LEN+1], *end;
FILE *in;
gzFile out;
@ -400,12 +428,8 @@ static void file_compress(char *file, char *mode) {
exit(1);
}
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
snprintf(outfile, sizeof(outfile), "%s%s", file, GZ_SUFFIX);
#else
strcpy(outfile, file);
strcat(outfile, GZ_SUFFIX);
#endif
end = string_copy(outfile, file, sizeof(outfile));
string_copy(end, GZ_SUFFIX, sizeof(outfile) - (z_size_t)(end - outfile));
in = fopen(file, "rb");
if (in == NULL) {
@ -427,7 +451,7 @@ static void file_compress(char *file, char *mode) {
* Uncompress the given file and remove the original.
*/
static void file_uncompress(char *file) {
local char buf[MAX_NAME_LEN];
local char buf[MAX_NAME_LEN+1];
char *infile, *outfile;
FILE *out;
gzFile in;
@ -438,11 +462,7 @@ static void file_uncompress(char *file) {
exit(1);
}
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
snprintf(buf, sizeof(buf), "%s", file);
#else
strcpy(buf, file);
#endif
string_copy(buf, file, sizeof(buf));
if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {
infile = file;
@ -451,11 +471,7 @@ static void file_uncompress(char *file) {
} else {
outfile = file;
infile = buf;
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
snprintf(buf + len, sizeof(buf) - len, "%s", GZ_SUFFIX);
#else
strcat(infile, GZ_SUFFIX);
#endif
string_copy(buf + len, GZ_SUFFIX, sizeof(buf) - len);
}
in = gzopen(infile, "rb");
if (in == NULL) {
@ -488,14 +504,9 @@ int main(int argc, char *argv[]) {
int copyout = 0;
int uncompr = 0;
gzFile file;
char *bname, outmode[20];
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
snprintf(outmode, sizeof(outmode), "%s", "wb6 ");
#else
strcpy(outmode, "wb6 ");
#endif
char *bname, outmode[5];
string_copy(outmode, "wb6 ", sizeof(outmode));
prog = argv[0];
bname = strrchr(argv[0], '/');
if (bname)

View File

@ -1,6 +1,6 @@
<?xml version="1.0" ?>
<package name="zlib" version="1.3.0.1">
<library name="zlib" dlversion="1.3.0.1" dlname="z">
<package name="zlib" version="1.3.1.1">
<library name="zlib" dlversion="1.3.1.1" dlname="z">
<property name="description"> zip compression library </property>
<property name="include-target-dir" value="$(@PACKAGE/install-includedir)" />

6
deps/zlib/trees.c vendored
View File

@ -1,5 +1,5 @@
/* trees.c -- output deflated data using Huffman coding
* Copyright (C) 1995-2021 Jean-loup Gailly
* Copyright (C) 1995-2024 Jean-loup Gailly
* detect_data_type() function provided freely by Cosmin Truta, 2006
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -724,7 +724,7 @@ local void scan_tree(deflate_state *s, ct_data *tree, int max_code) {
if (++count < max_count && curlen == nextlen) {
continue;
} else if (count < min_count) {
s->bl_tree[curlen].Freq += count;
s->bl_tree[curlen].Freq += (ush)count;
} else if (curlen != 0) {
if (curlen != prevlen) s->bl_tree[curlen].Freq++;
s->bl_tree[REP_3_6].Freq++;
@ -938,7 +938,7 @@ local void compress_block(deflate_state *s, const ct_data *ltree,
/* Check for no overlay of pending_buf on needed symbols */
#ifdef LIT_MEM
Assert(s->pending < (s->lit_bufsize << 1) + sx, "pendingBuf overflow");
Assert(s->pending < 2 * (s->lit_bufsize + sx), "pendingBuf overflow");
#else
Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
#endif

View File

@ -3,21 +3,17 @@
This document describes the design, the rationale, and the usage
of the official DLL build of zlib, named ZLIB1.DLL. If you have
of the common DLL build of zlib, named ZLIB1.DLL. If you have
general questions about zlib, you should see the file "FAQ" found
in the zlib distribution, or at the following location:
http://www.gzip.org/zlib/zlib_faq.html
https://www.zlib.net/zlib_faq.html
1. What is ZLIB1.DLL, and how can I get it?
- ZLIB1.DLL is the official build of zlib as a DLL.
- ZLIB1.DLL is the common build of zlib as a DLL.
(Please remark the character '1' in the name.)
Pointers to a precompiled ZLIB1.DLL can be found in the zlib
web site at:
http://www.zlib.net/
Applications that link to ZLIB1.DLL can rely on the following
specification:
@ -379,18 +375,6 @@ in the zlib distribution, or at the following location:
code. But you can make your own private DLL build, under a
different file name, as suggested in the previous answer.
17. I made my own ZLIB1.DLL build. Can I test it for compliance?
- We prefer that you download the official DLL from the zlib
web site. If you need something peculiar from this DLL, you
can send your suggestion to the zlib mailing list.
However, in case you do rebuild the DLL yourself, you can run
it with the test programs found in the DLL distribution.
Running these test programs is not a guarantee of compliance,
but a failure can imply a detected problem.
**
This document is written and maintained by

View File

@ -1,6 +1,6 @@
ZLIB DATA COMPRESSION LIBRARY
zlib 1.3.0.1 is a general purpose data compression library. All the code is
zlib 1.3.1.1 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
@ -22,7 +22,7 @@ asking for help.
Manifest:
The package zlib-1.3.0.1-win32-x86.zip will contain the following files:
The package zlib-1.3.1.1-win32-x86.zip will contain the following files:
README-WIN32.txt This document
ChangeLog Changes since previous zlib packages

26
deps/zlib/zconf.h vendored
View File

@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
* Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -300,14 +300,6 @@
# 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
#endif
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
@ -478,12 +470,8 @@ typedef uLong FAR uLongf;
#endif
#ifndef Z_HAVE_UNISTD_H
# ifdef __WATCOMC__
# define Z_HAVE_UNISTD_H
# endif
#endif
#ifndef Z_HAVE_UNISTD_H
# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
# if defined(__WATCOMC__) || defined(__GO32__) || \
(defined(_LARGEFILE64_SOURCE) && !defined(_WIN32))
# define Z_HAVE_UNISTD_H
# endif
#endif
@ -523,12 +511,12 @@ typedef uLong FAR uLongf;
#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
#else
# if defined(_WIN32) && !defined(__GNUC__)
#elif defined(_WIN32) && !defined(__GNUC__)
# define z_off64_t __int64
# else
#elif defined(__GO32__)
# define z_off64_t offset_t
#else
# define z_off64_t z_off_t
# endif
#endif
/* MVS linker does not support external names larger than 8 bytes */

View File

@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
* Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -302,14 +302,6 @@
# 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
#endif
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
@ -480,12 +472,8 @@ typedef uLong FAR uLongf;
#endif
#ifndef Z_HAVE_UNISTD_H
# ifdef __WATCOMC__
# define Z_HAVE_UNISTD_H
# endif
#endif
#ifndef Z_HAVE_UNISTD_H
# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
# if defined(__WATCOMC__) || defined(__GO32__) || \
(defined(_LARGEFILE64_SOURCE) && !defined(_WIN32))
# define Z_HAVE_UNISTD_H
# endif
#endif
@ -525,12 +513,12 @@ typedef uLong FAR uLongf;
#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
#else
# if defined(_WIN32) && !defined(__GNUC__)
#elif defined(_WIN32) && !defined(__GNUC__)
# define z_off64_t __int64
# else
#elif defined(__GO32__)
# define z_off64_t offset_t
#else
# define z_off64_t z_off_t
# endif
#endif
/* MVS linker does not support external names larger than 8 bytes */

26
deps/zlib/zconf.h.in vendored
View File

@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
* Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -300,14 +300,6 @@
# 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
#endif
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
@ -478,12 +470,8 @@ typedef uLong FAR uLongf;
#endif
#ifndef Z_HAVE_UNISTD_H
# ifdef __WATCOMC__
# define Z_HAVE_UNISTD_H
# endif
#endif
#ifndef Z_HAVE_UNISTD_H
# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
# if defined(__WATCOMC__) || defined(__GO32__) || \
(defined(_LARGEFILE64_SOURCE) && !defined(_WIN32))
# define Z_HAVE_UNISTD_H
# endif
#endif
@ -523,12 +511,12 @@ typedef uLong FAR uLongf;
#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
#else
# if defined(_WIN32) && !defined(__GNUC__)
#elif defined(_WIN32) && !defined(__GNUC__)
# define z_off64_t __int64
# else
#elif defined(__GO32__)
# define z_off64_t offset_t
#else
# define z_off64_t z_off_t
# endif
#endif
/* MVS linker does not support external names larger than 8 bytes */

8
deps/zlib/zlib.3 vendored
View File

@ -1,4 +1,4 @@
.TH ZLIB 3 "xx Aug 2023"
.TH ZLIB 3 "xx Jan 2024"
.SH NAME
zlib \- compression/decompression library
.SH SYNOPSIS
@ -86,7 +86,7 @@ Mark Nelson wrote an article about
for the Jan. 1997 issue of Dr. Dobb's Journal;
a copy of the article is available at:
.IP
http://marknelson.us/1997/01/01/zlib-engine/
https://marknelson.us/posts/1997/01/01/zlib-engine.html
.SH "REPORTING PROBLEMS"
Before reporting a problem,
please check the
@ -105,9 +105,9 @@ before asking for help.
Send questions and/or comments to zlib@gzip.org,
or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
.SH AUTHORS AND LICENSE
Version 1.3.0.1
Version 1.3.1.1
.LP
Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler
Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
.LP
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

BIN
deps/zlib/zlib.3.pdf vendored

Binary file not shown.

47
deps/zlib/zlib.h vendored
View File

@ -1,7 +1,7 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.3.0.1, August xxth, 2023
version 1.3.1.1, January xxth, 2024
Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler
Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -37,11 +37,11 @@
extern "C" {
#endif
#define ZLIB_VERSION "1.3.0.1-motley"
#define ZLIB_VERNUM 0x1301
#define ZLIB_VERSION "1.3.1.1-motley"
#define ZLIB_VERNUM 0x1311
#define ZLIB_VER_MAJOR 1
#define ZLIB_VER_MINOR 3
#define ZLIB_VER_REVISION 0
#define ZLIB_VER_REVISION 1
#define ZLIB_VER_SUBREVISION 1
/*
@ -587,18 +587,21 @@ ZEXTERN int ZEXPORT deflateInit2(z_streamp strm,
The strategy parameter is used to tune the compression algorithm. Use the
value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
string match), or Z_RLE to limit match distances to one (run-length
encoding). Filtered data consists mostly of small values with a somewhat
random distribution. In this case, the compression algorithm is tuned to
compress them better. The effect of Z_FILTERED is to force more Huffman
coding and less string matching; it is somewhat intermediate between
Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as
fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The
strategy parameter only affects the compression ratio but not the
correctness of the compressed output even if it is not set appropriately.
Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
decoder for special applications.
filter (or predictor), Z_RLE to limit match distances to one (run-length
encoding), or Z_HUFFMAN_ONLY to force Huffman encoding only (no string
matching). Filtered data consists mostly of small values with a somewhat
random distribution, as produced by the PNG filters. In this case, the
compression algorithm is tuned to compress them better. The effect of
Z_FILTERED is to force more Huffman coding and less string matching than the
default; it is intermediate between Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY.
Z_RLE is almost as fast as Z_HUFFMAN_ONLY, but should give better
compression for PNG image data than Huffman only. The degree of string
matching from most to none is: Z_DEFAULT_STRATEGY, Z_FILTERED, Z_RLE, then
Z_HUFFMAN. The strategy parameter affects the compression ratio but never
the correctness of the compressed output, even if it is not set optimally
for the given data. Z_FIXED uses the default string matching, but prevents
the use of dynamic Huffman codes, allowing for a simpler decoder for special
applications.
deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
@ -1758,14 +1761,14 @@ ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2);
seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
len2.
len2. len2 must be non-negative.
*/
/*
ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2);
Return the operator corresponding to length len2, to be used with
crc32_combine_op().
crc32_combine_op(). len2 must be non-negative.
*/
ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op);
@ -1888,9 +1891,9 @@ ZEXTERN int ZEXPORT gzgetc_(gzFile file); /* backward compatibility */
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);
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
#else
ZEXTERN gzFile ZEXPORT gzopen(const char *, const char *);

38
deps/zlib/zutil.h vendored
View File

@ -1,5 +1,5 @@
/* zutil.h -- internal interface and configuration of the compression library
* Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler
* Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@ -56,7 +56,7 @@ typedef unsigned long ulg;
extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
/* (size given to avoid silly warnings with Visual C++) */
#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
#define ERR_RETURN(strm,err) \
return (strm->msg = ERR_MSG(err), (err))
@ -137,20 +137,11 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# endif
#endif
#if defined(MACOS) || defined(TARGET_OS_MAC)
#if defined(MACOS)
# define OS_CODE 7
# ifndef Z_SOLO
# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
# include <unix.h> /* for fdopen */
# else
# ifndef fdopen
# define fdopen(fd,mode) NULL /* No fdopen() */
# endif
# endif
# endif
#endif
#ifdef __acorn
#if defined(__acorn) || defined(__riscos)
# define OS_CODE 13
#endif
@ -170,18 +161,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define OS_CODE 19
#endif
#if defined(_BEOS_) || defined(RISCOS)
# define fdopen(fd,mode) NULL /* No fdopen() */
#endif
#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
# if defined(_WIN32_WCE)
# define fdopen(fd,mode) NULL /* No fdopen() */
# else
# define fdopen(fd,type) _fdopen(fd,type)
# endif
#endif
#if defined(__BORLANDC__) && !defined(MSDOS)
#pragma warn -8004
#pragma warn -8008
@ -189,11 +168,10 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#endif
/* provide prototypes for these when building zlib without LFS */
#if !defined(_WIN32) && \
(!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
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);
#ifndef Z_LARGE64
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
/* common defaults */