From 9b71ea65c62c8e18a40be3c8d7119f1a79cf7848 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 7 Jul 2026 13:57:54 -0500 Subject: [PATCH] Move H5Z_entry_t's full definition into H5Zprivate.h The struct was forward-declared in H5Zprivate.h with its full definition in H5Zpkg.h, but every actual user (H5Z.c, H5Pocpl.c) already includes H5Zpkg.h directly, so the indirection didn't hide anything from anyone. H5Zprivate.h already pulls in H5Z_class2_t/H5Z_class3_t/H5Z_func2_t via H5Zpublic.h/H5Zdevelop.h, so nothing blocks defining it there directly. --- src/H5Zpkg.h | 20 -------------------- src/H5Zprivate.h | 23 +++++++++++++++++++++-- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/H5Zpkg.h b/src/H5Zpkg.h index 80a6dd974b7..ee3c07109f2 100644 --- a/src/H5Zpkg.h +++ b/src/H5Zpkg.h @@ -25,26 +25,6 @@ * H5Z_CLASS_T_VERS_MAX. */ #define H5Z_CLASS3_T_VERS_INTERNAL (2) -/* - * Internal filter table entry. H5Z_class2_t is embedded as the first member - * so that a pointer to H5Z_entry_t can be safely cast to H5Z_class2_t * per - * C11 ยง6.7.2.1p15 without relying on struct-layout coincidence. V3-specific - * fields are zero-initialised for filters registered via H5Z_class2_t or - * H5Z_class1_t. - */ -typedef struct H5Z_entry_t { - H5Z_class2_t base; /* must stay first; safe to cast to H5Z_class2_t * */ - /* --- V3 extensions (NULL for v1/v2 plugins) --- */ - H5Z_func2_t filter2; /* Extended callback (class3); NULL for class1/class2 */ - H5Z_set_config_func_t set_config; - H5Z_get_config_func_t get_config; - const char *description; /* free-form description; may be NULL */ - /* --- Reserved blob callbacks (NULL until activated by RFC-HDFG-2026-*) --- */ - void *write_blob; - void *read_blob; - void *close_blob; -} H5Z_entry_t; - /********************/ /* Internal filters */ /********************/ diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index fe07cf7c7a1..b02eaa7ccab 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -63,6 +63,26 @@ struct H5Z_filter_info_t { unsigned *cd_values; /*client data values */ }; +/* + * Internal filter table entry. H5Z_class2_t is embedded as the first member + * so that a pointer to H5Z_entry_t can be safely cast to H5Z_class2_t * per + * C11 6.7.2.1p15 without relying on struct-layout coincidence. V3-specific + * fields are zero-initialised for filters registered via H5Z_class2_t or + * H5Z_class1_t. + */ +typedef struct H5Z_entry_t { + H5Z_class2_t base; /* must stay first; safe to cast to H5Z_class2_t * */ + /* --- V3 extensions (NULL for v1/v2 plugins) --- */ + H5Z_func2_t filter2; /* Extended callback (class3); NULL for class1/class2 */ + H5Z_set_config_func_t set_config; + H5Z_get_config_func_t get_config; + const char *description; /* free-form description; may be NULL */ + /* --- Reserved blob callbacks (NULL until activated by RFC-HDFG-2026-*) --- */ + void *write_blob; + void *read_blob; + void *close_blob; +} H5Z_entry_t; + /*****************************/ /* Library-private Variables */ /*****************************/ @@ -86,8 +106,7 @@ H5_DLL herr_t H5Z_pipeline(const struct H5O_pline_t *pline, unsigned flags, hid_ size_t *buf_size /*in,out*/, void **buf /*in,out*/); H5_DLL herr_t H5Z_find(bool attempt, H5Z_filter_t id, H5Z_class2_t **cls); /* Find filter entry; returns pointer into internal table (cast-compatible with H5Z_class2_t *) */ -struct H5Z_entry_t; /* forward decl; full def in H5Zpkg.h */ -H5_DLL herr_t H5Z_find_entry(bool attempt, H5Z_filter_t id, struct H5Z_entry_t **entry); +H5_DLL herr_t H5Z_find_entry(bool attempt, H5Z_filter_t id, H5Z_entry_t **entry); H5_DLL herr_t H5Z_can_apply(hid_t dcpl_id, hid_t type_id); H5_DLL herr_t H5Z_set_local(hid_t dcpl_id, hid_t type_id); H5_DLL herr_t H5Z_can_apply_direct(const struct H5O_pline_t *pline);