From e267ab292e0757336829e632161ec5dd31ecd905 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Sun, 6 Sep 2026 00:02:40 +0200 Subject: [PATCH 1/4] [core] deprecate implementation detail zip headers since there is RZip public interface --- core/lz4/inc/ZipLZ4.h | 2 + core/lz4/src/ZipLZ4.cxx | 27 ++++++++++++- core/lzma/inc/ZipLZMA.h | 2 + core/lzma/src/ZipLZMA.c | 29 +++++++++++++- core/zip/src/RZip.cxx | 84 +++++++++++++++++++++++++++++++++++++-- core/zstd/inc/ZipZSTD.h | 2 + core/zstd/src/ZipZSTD.cxx | 26 +++++++++++- 7 files changed, 166 insertions(+), 6 deletions(-) diff --git a/core/lz4/inc/ZipLZ4.h b/core/lz4/inc/ZipLZ4.h index abe5083066e3b..475997c38a8fa 100644 --- a/core/lz4/inc/ZipLZ4.h +++ b/core/lz4/inc/ZipLZ4.h @@ -11,6 +11,8 @@ #ifndef ROOT_ZipLZ4 #define ROOT_ZipLZ4 +#warning "This header is deprecated and will be removed in 6.46, use instead methods within RZip.h" + // NOTE: the ROOT compression libraries aren't consistently written in C++; hence the // #ifdef's to avoid problems with C code. #ifdef __cplusplus diff --git a/core/lz4/src/ZipLZ4.cxx b/core/lz4/src/ZipLZ4.cxx index 6fdafb851f5ba..bf9c2be970b0a 100644 --- a/core/lz4/src/ZipLZ4.cxx +++ b/core/lz4/src/ZipLZ4.cxx @@ -8,7 +8,32 @@ * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ -#include "ZipLZ4.h" +// Author: Brian Bockelman March 2015 + +/************************************************************************* + * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef ROOT_ZipLZ4 +#define ROOT_ZipLZ4 + +// NOTE: the ROOT compression libraries aren't consistently written in C++; hence the +// #ifdef's to avoid problems with C code. +#ifdef __cplusplus +extern "C" { +#endif +void R__zipLZ4(int cxlevel, int *srcsize, const char *src, int *tgtsize, char *tgt, int *irep); +void R__unzipLZ4(int *srcsize, const unsigned char *src, int *tgtsize, unsigned char *tgt, int *irep); +#ifdef __cplusplus +} +#endif + +#endif + #include "ROOT/RConfig.hxx" diff --git a/core/lzma/inc/ZipLZMA.h b/core/lzma/inc/ZipLZMA.h index 35897965bc6a3..7333a9720437a 100644 --- a/core/lzma/inc/ZipLZMA.h +++ b/core/lzma/inc/ZipLZMA.h @@ -12,6 +12,8 @@ #ifndef ROOT_ZipLZMA #define ROOT_ZipLZMA +#warning "This header is deprecated and will be removed in 6.46, use instead methods within RZip.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/core/lzma/src/ZipLZMA.c b/core/lzma/src/ZipLZMA.c index 4582c59873837..00c5432f04f3d 100644 --- a/core/lzma/src/ZipLZMA.c +++ b/core/lzma/src/ZipLZMA.c @@ -12,7 +12,34 @@ #ifdef _MSC_VER #define LZMA_API_STATIC #endif -#include "ZipLZMA.h" +// @(#)root/lzma:$Id$ +// Author: David Dagenhart May 2011 + +/************************************************************************* + * Copyright (C) 1995-2011, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef ROOT_ZipLZMA +#define ROOT_ZipLZMA + +#ifdef __cplusplus +extern "C" { +#endif + +void R__zipLZMA(int cxlevel, int *srcsize, const char *src, int *tgtsize, char *tgt, int *irep); + +void R__unzipLZMA(int *srcsize, const unsigned char *src, int *tgtsize, unsigned char *tgt, int *irep); + +#ifdef __cplusplus +} +#endif + +#endif + #include "lzma.h" #include diff --git a/core/zip/src/RZip.cxx b/core/zip/src/RZip.cxx index c7fab1dde5d73..2731ad596b78a 100644 --- a/core/zip/src/RZip.cxx +++ b/core/zip/src/RZip.cxx @@ -10,9 +10,87 @@ #include "RConfigure.h" #include "RZip.h" #include "Bits.h" -#include "ZipLZMA.h" -#include "ZipLZ4.h" -#include "ZipZSTD.h" + +// Author: Brian Bockelman March 2015 + +/************************************************************************* + * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef ROOT_ZipLZ4 +#define ROOT_ZipLZ4 + +// NOTE: the ROOT compression libraries aren't consistently written in C++; hence the +// #ifdef's to avoid problems with C code. +#ifdef __cplusplus +extern "C" { +#endif +void R__zipLZ4(int cxlevel, int *srcsize, const char *src, int *tgtsize, char *tgt, int *irep); +void R__unzipLZ4(int *srcsize, const unsigned char *src, int *tgtsize, unsigned char *tgt, int *irep); +#ifdef __cplusplus +} +#endif + +#endif + + +// @(#)root/lzma:$Id$ +// Author: David Dagenhart May 2011 + +/************************************************************************* + * Copyright (C) 1995-2011, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef ROOT_ZipLZMA +#define ROOT_ZipLZMA + +#ifdef __cplusplus +extern "C" { +#endif + +void R__zipLZMA(int cxlevel, int *srcsize, const char *src, int *tgtsize, char *tgt, int *irep); + +void R__unzipLZMA(int *srcsize, const unsigned char *src, int *tgtsize, unsigned char *tgt, int *irep); + +#ifdef __cplusplus +} +#endif + +#endif + +// Original Author: Brian Bockelman +/************************************************************************* + * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef ROOT_ZipZSTD +#define ROOT_ZipZSTD + +// NOTE: the ROOT compression libraries aren't consistently written in C++; hence the +// #ifdef's to avoid problems with C code. +#ifdef __cplusplus +extern "C" { +#endif +void R__zipZSTD(int cxlevel, int *srcsize, const char *src, int *tgtsize, char *tgt, int *irep); +void R__unzipZSTD(int *srcsize, const unsigned char *src, int *tgtsize, unsigned char *tgt, int *irep); +#ifdef __cplusplus +} +#endif + +#endif + #include "zlib.h" diff --git a/core/zstd/inc/ZipZSTD.h b/core/zstd/inc/ZipZSTD.h index b26925e77a1e7..71547b8ef6fc8 100644 --- a/core/zstd/inc/ZipZSTD.h +++ b/core/zstd/inc/ZipZSTD.h @@ -10,6 +10,8 @@ #ifndef ROOT_ZipZSTD #define ROOT_ZipZSTD +#warning "This header is deprecated and will be removed in 6.46, use instead methods within RZip.h" + // NOTE: the ROOT compression libraries aren't consistently written in C++; hence the // #ifdef's to avoid problems with C code. #ifdef __cplusplus diff --git a/core/zstd/src/ZipZSTD.cxx b/core/zstd/src/ZipZSTD.cxx index a9b6f61dfd080..e0230716f686e 100644 --- a/core/zstd/src/ZipZSTD.cxx +++ b/core/zstd/src/ZipZSTD.cxx @@ -8,7 +8,31 @@ * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ -#include "ZipZSTD.h" +// Original Author: Brian Bockelman +/************************************************************************* + * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef ROOT_ZipZSTD +#define ROOT_ZipZSTD + +// NOTE: the ROOT compression libraries aren't consistently written in C++; hence the +// #ifdef's to avoid problems with C code. +#ifdef __cplusplus +extern "C" { +#endif +void R__zipZSTD(int cxlevel, int *srcsize, const char *src, int *tgtsize, char *tgt, int *irep); +void R__unzipZSTD(int *srcsize, const unsigned char *src, int *tgtsize, unsigned char *tgt, int *irep); +#ifdef __cplusplus +} +#endif + +#endif + #include "ROOT/RConfig.hxx" From d49c5930bcfb1edf97f6d116aab3af39013b21d8 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Sun, 6 Sep 2026 00:07:19 +0200 Subject: [PATCH 2/4] [RN] mention deprecation --- README/ReleaseNotes/v642/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README/ReleaseNotes/v642/index.md b/README/ReleaseNotes/v642/index.md index 7a16b865e42e2..8271860c7db4e 100644 --- a/README/ReleaseNotes/v642/index.md +++ b/README/ReleaseNotes/v642/index.md @@ -69,6 +69,7 @@ Users are encouraged to export their models to ONNX and use the retained ONNX pa * Support for the AIX operating system has been removed from the codebase. This support has not been tested since the late v5 releases and the LLVM JIT is not yet supporting AIX. * The headers Htypes.h and Gtypes.h that were deprecated in ROOT 6.20 will now emit warnings and will be fully removed in ROOT 6.44. * The header GLConstants.h is no longer part of ROOT installed headers. +* The headers `ZipLZMA.h`, `ZipLZ4.h` and `ZipZSTD.h` are deprecated and will be removed in ROOT 6.46, use instead the public methods in the `RZip.h` interface. * The `ROOT::Math::ParamFunctionBase`, `ROOT::Math::ParamFunctorHandler` and `ROOT::Math::ParamMemFunHandler` classes in `Math/ParamFunctor.h` are removed, together with the `ParamFunctor::GetImpl()` and `ParamFunctor::SetFunction()` methods that exposed them. They implemented the type erasure that `ParamFunctor` now gets from `std::function`, mirroring what was already done for `ROOT::Math::Functor`. Constructing and calling a `ParamFunctor` is unchanged, except that the constructor from an object and one of its member functions now takes a plain pointer to the object instead of anything dereferenceable, so smart pointers are no longer accepted there. ## Build System From 80d919d8691761f82442ff6aa012e465b11059a6 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Sun, 6 Sep 2026 11:10:48 +0200 Subject: [PATCH 3/4] [zip] do not use deprecated header --- builtins/zip/ZInflate.c | 59 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/builtins/zip/ZInflate.c b/builtins/zip/ZInflate.c index 844240a6dc2eb..fb7cee7d5022b 100644 --- a/builtins/zip/ZInflate.c +++ b/builtins/zip/ZInflate.c @@ -19,8 +19,63 @@ static const int qflag = 0; #include "zlib.h" #include "RConfigure.h" -#include "ZipLZMA.h" -#include "ZipLZ4.h" + +// @(#)root/lzma:$Id$ +// Author: David Dagenhart May 2011 + +/************************************************************************* + * Copyright (C) 1995-2011, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef ROOT_ZipLZMA +#define ROOT_ZipLZMA + +#ifdef __cplusplus +extern "C" { +#endif + +void R__zipLZMA(int cxlevel, int *srcsize, const char *src, int *tgtsize, char *tgt, int *irep); + +void R__unzipLZMA(int *srcsize, const unsigned char *src, int *tgtsize, unsigned char *tgt, int *irep); + +#ifdef __cplusplus +} +#endif + +#endif + +// Author: Brian Bockelman March 2015 + +/************************************************************************* + * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef ROOT_ZipLZ4 +#define ROOT_ZipLZ4 + +// NOTE: the ROOT compression libraries aren't consistently written in C++; hence the +// #ifdef's to avoid problems with C code. +#ifdef __cplusplus +extern "C" { +#endif +void R__zipLZ4(int cxlevel, int *srcsize, const char *src, int *tgtsize, char *tgt, int *irep); +void R__unzipLZ4(int *srcsize, const unsigned char *src, int *tgtsize, unsigned char *tgt, int *irep); +#ifdef __cplusplus +} +#endif + +#endif + + + /* inflate.c -- put in the public domain by Mark Adler version c14o, 23 August 1994 */ From 8b0943e641043fb1cb4b28949b1771a51cd3abc1 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 8 Sep 2026 17:52:03 +0200 Subject: [PATCH 4/4] [nfc] mention temporary duplications as suggested by pcanal --- builtins/zip/ZInflate.c | 2 ++ core/lz4/src/ZipLZ4.cxx | 1 + core/lzma/src/ZipLZMA.c | 1 + core/zip/src/RZip.cxx | 4 +++- core/zstd/src/ZipZSTD.cxx | 1 + 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/builtins/zip/ZInflate.c b/builtins/zip/ZInflate.c index fb7cee7d5022b..2ae650c4b93bd 100644 --- a/builtins/zip/ZInflate.c +++ b/builtins/zip/ZInflate.c @@ -20,6 +20,7 @@ static const int qflag = 0; #include "zlib.h" #include "RConfigure.h" +// TEMPORARY DUPLICATION OF ZipLZMA.h until header is removed from public interface and can be made fully private // @(#)root/lzma:$Id$ // Author: David Dagenhart May 2011 @@ -48,6 +49,7 @@ void R__unzipLZMA(int *srcsize, const unsigned char *src, int *tgtsize, unsigned #endif +// TEMPORARY DUPLICATION OF ZipLZ4.h until header is removed from public interface and can be made fully private // Author: Brian Bockelman March 2015 /************************************************************************* diff --git a/core/lz4/src/ZipLZ4.cxx b/core/lz4/src/ZipLZ4.cxx index bf9c2be970b0a..9096507489c1d 100644 --- a/core/lz4/src/ZipLZ4.cxx +++ b/core/lz4/src/ZipLZ4.cxx @@ -8,6 +8,7 @@ * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ +// TEMPORARY DUPLICATION OF ZipLZ4.h until header is removed from public interface and can be made fully private // Author: Brian Bockelman March 2015 /************************************************************************* diff --git a/core/lzma/src/ZipLZMA.c b/core/lzma/src/ZipLZMA.c index 00c5432f04f3d..a8f80afff2619 100644 --- a/core/lzma/src/ZipLZMA.c +++ b/core/lzma/src/ZipLZMA.c @@ -12,6 +12,7 @@ #ifdef _MSC_VER #define LZMA_API_STATIC #endif +// TEMPORARY DUPLICATION OF ZipLZMA.h until header is removed from public interface and can be made fully private // @(#)root/lzma:$Id$ // Author: David Dagenhart May 2011 diff --git a/core/zip/src/RZip.cxx b/core/zip/src/RZip.cxx index 2731ad596b78a..3424fee86e2ec 100644 --- a/core/zip/src/RZip.cxx +++ b/core/zip/src/RZip.cxx @@ -11,6 +11,7 @@ #include "RZip.h" #include "Bits.h" +// TEMPORARY DUPLICATION OF ZipLZ4.h until header is removed from public interface and can be made fully private // Author: Brian Bockelman March 2015 /************************************************************************* @@ -37,7 +38,7 @@ void R__unzipLZ4(int *srcsize, const unsigned char *src, int *tgtsize, unsigned #endif - +// TEMPORARY DUPLICATION OF ZipLZMA.h until header is removed from public interface and can be made fully private // @(#)root/lzma:$Id$ // Author: David Dagenhart May 2011 @@ -66,6 +67,7 @@ void R__unzipLZMA(int *srcsize, const unsigned char *src, int *tgtsize, unsigned #endif +// TEMPORARY DUPLICATION OF ZipZSTD.h until header is removed from public interface and can be made fully private // Original Author: Brian Bockelman /************************************************************************* * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. * diff --git a/core/zstd/src/ZipZSTD.cxx b/core/zstd/src/ZipZSTD.cxx index e0230716f686e..62a22bacd6157 100644 --- a/core/zstd/src/ZipZSTD.cxx +++ b/core/zstd/src/ZipZSTD.cxx @@ -8,6 +8,7 @@ * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ +// TEMPORARY DUPLICATION OF ZipZSTD.h until header is removed from public interface and can be made fully private // Original Author: Brian Bockelman /************************************************************************* * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *