From 8be0c1a85f2f5a2645a63a91f1af3be50b382ed9 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Sun, 6 Sep 2026 00:02:40 +0200 Subject: [PATCH 1/3] [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 9cc9082aa3c7d0c719aaa9757d0956945142928b Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Sun, 6 Sep 2026 00:07:19 +0200 Subject: [PATCH 2/3] [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 8eb3d7de6b291..67ae6685019ef 100644 --- a/README/ReleaseNotes/v642/index.md +++ b/README/ReleaseNotes/v642/index.md @@ -68,6 +68,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. ## Build System From 3ab4509203b656959044bbf24b2e764be6856156 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Sun, 6 Sep 2026 11:10:48 +0200 Subject: [PATCH 3/3] [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 */