From ecd87f2264d0f946817869038f0d231fd79be473 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 d703226369bd1bf525f8c291ea15f173c85dc761 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 317fa53b195d1..338afc796030e 100644 --- a/README/ReleaseNotes/v642/index.md +++ b/README/ReleaseNotes/v642/index.md @@ -77,6 +77,7 @@ The `TMVA_SOFIE_GNN` tutorials have been migrated to this workflow and produce i * The header `snprintf.h` is deprecated (will emit warnings) and will be removed in ROOT 6.44. Use instead ``. * The header `Strlen.h` is deprecated and will be removed in ROOT 6.44. Use `` directly as a replacement. `NEED_STRING` macro should not be defined or an error will be raised. * The header `Rstrstream.h` is deprecated and will be removed after ROOT 6.44, use instead ``. +* 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 84c56e58b3881faf3f5f38f328ba0bbb25164ee6 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 85f5d5e16d135d72cdd1b3cefc7c770af1fae052 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. *