[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #NGW-449875]: nc_def_var_chunking() backwards compatibility



> As you know, the API for nc_def_var_chunking() changed
> in about 200906. NCO must build on both new and old APIs.
> So we define, manually, a token
> 
> HAVE_NEW_CHUNKING_API
> 
> which describes which API to expect. It would be great
> if the netCDF header file netcdf.h included version
> number manipulable by the C pre-processor so code could
> easily check what to expect based on the version.
> Or netcdf.h could itself supply the token HAVE_NEW_CHUNKING_API.
> Almost anything is preferable to requesting users to
> know what to set such tokens to.
> 
> Here, e.g., is what NCO does for stubs:
> 
> # ifdef HAVE_NEW_CHUNKING_API
> /* Newer, post-200906 netCDF4 API has chk_sz as const */
> int nc_def_var_chunking(const int nc_id,const int var_id,const int
> srg_typ,const size_t * const cnk_sz){return 1;}
> # else /* !HAVE_NEW_CHUNKING_API */
> /* Older, pre-200906 netCDF4 API has chk_sz as non-const */
> int nc_def_var_chunking(const int nc_id,const int var_id,const int
> srg_typ,size_t * const cnk_sz){return 1;}
> # endif /* !HAVE_NEW_CHUNKING_API */
> 
> I hope you consider adding some backward compatibility
> mechanism to make adapting to the new API easier.
> 
> Thanks,
> Chalrie
> --

Howdy Charlie!

I have added this, but called it NC_HAVE_NEW_CHUNKING_API. It will be in 
tonight's snapshot. Thanks for the suggestion.

Ed


Ticket Details
===================
Ticket ID: NGW-449875
Department: Support netCDF
Priority: Critical
Status: Closed