From e10e88f32d89b097a3eec09151c19564af68e92d Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Sat, 20 Apr 2024 20:38:38 -0600 Subject: [PATCH] filter1 --- libnczarr/zformat2.c | 10 +++++----- libnczarr/zformat3.c | 7 +++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/libnczarr/zformat2.c b/libnczarr/zformat2.c index e2a06f51c2..7a31e55644 100644 --- a/libnczarr/zformat2.c +++ b/libnczarr/zformat2.c @@ -93,14 +93,15 @@ static int parse_group_content(const NCjson* jcontent, NClist* dimdefs, NClist* static int parse_group_content_pure(NC_FILE_INFO_T* zinfo, NC_GRP_INFO_T* grp, NClist* varnames, NClist* subgrps); static int searchvars(NCZ_FILE_INFO_T* zfile, NC_GRP_INFO_T* grp, NClist* varnames); static int searchsubgrps(NCZ_FILE_INFO_T* zfile, NC_GRP_INFO_T* grp, NClist* subgrpnames); -static int json2filter(NC_FILE_INFO_T* file, const NCjson* jfilter, NCZ_Filter** zfilterp, NClist* filterlist); static int nctype2dtype(nc_type nctype, int endianness, int purezarr, size_t len, char** dnamep, const char** tagp); static int dtype2nctype(const char* dtype, nc_type* nctypep, size_t* typelenp, int* endianp); static int get_att_types(int purezarr, NCjson* jatts, struct Ainfo* ainfo); static int collectdimrefs(const NCjson* jdimrefs, struct CVARGS* cvargs, NCZ_DimInfo* diminfo); static int collectxarraydims(const NCjson* jxarray, struct CVARGS* cvargs, NCZ_DimInfo* diminfo); static int NCZ_computedimrefs(NC_FILE_INFO_T* file, NC_GRP_INFO_T* grp, size_t ndims, size64_t* shape, NCZ_DimInfo* diminfo, int* isscalarp); - +#ifdef NETCDF_ENABLE_NCZARR_FILTERS +static int json2filter(NC_FILE_INFO_T* file, const NCjson* jfilter, NCZ_Filter** zfilterp, NClist* filterlist); +#endif /**************************************************/ /** @@ -2153,6 +2154,7 @@ dtype2nctype(const char* dtype, nc_type* nctypep, size_t* typelenp, int* endianp return stat; } +#ifdef NETCDF_ENABLE_NCZARR_FILTERS /** * Convert a JSON codec to an instance of NCZ_Filter * @param jfilter json codec @@ -2206,9 +2208,7 @@ json2filter(NC_FILE_INFO_T* file, const NCjson* jfilter, NCZ_Filter** zfilterp, NCZ_filter_free(filter); return THROW(stat); } - - - +#endif /*NETCDF_ENABLE_NCZARR_FILTERS*/ /**************************************************/ /* Format Dispatch table */ diff --git a/libnczarr/zformat3.c b/libnczarr/zformat3.c index 55f9115b32..d564835523 100644 --- a/libnczarr/zformat3.c +++ b/libnczarr/zformat3.c @@ -133,8 +133,10 @@ static int dtype2nctype(const char* dtype, const char* dalias, nc_type* nctypep, static int parse_rnnn(const char* dtype, size_t* typelenp); static int jtypes2atypes(int purezarr, const NCjson* jattrs, const NCjson* jtypes, nc_type** atypesp); static int infer_maxstrlen(const NCjson* jadata, int* typelenp); -static int json2filter(NC_FILE_INFO_T* file, const NCjson* jfilter, NCZ_Filter** zfilterp, NClist* filterlist); static int NCZ_computedimrefs(NC_FILE_INFO_T* file, NC_GRP_INFO_T* grp, size_t ndims, size64_t* shape, NCZ_DimInfo* diminfo); +#ifdef NETCDF_ENABLE_NCZARR_FILTERS +static int json2filter(NC_FILE_INFO_T* file, const NCjson* jfilter, NCZ_Filter** zfilterp, NClist* filterlist); +#endif /**************************************************/ @@ -2177,6 +2179,7 @@ parse_rnnn(const char* dtype, size_t* typelenp) return 1; } +#ifdef NETCDF_ENABLE_NCZARR_FILTERS /** * Convert a JSON codec to an instance of NCZ_Filter * @param jfilter json codec @@ -2230,7 +2233,7 @@ json2filter(NC_FILE_INFO_T* file, const NCjson* jfilter, NCZ_Filter** zfilterp, NCZ_filter_free(filter); return THROW(stat); } - +#endif /*NETCDF_ENABLE_NCZARR_FILTERS*/ /*************************************************/