Skip to content

nc_inq_var_szip() does not have a way to tell user that szip compression is not in use, but it needs to #1618

@edwardhartnett

Description

@edwardhartnett

The prototype for nc_inq_var_deflate() is:

EXTERNL int
nc_inq_var_deflate(int ncid, int varid, int *shufflep,
                   int *deflatep, int *deflate_levelp);

The deflatep pointer allows netcdf to return a 0 if the zlib filter is not in use on this var. This same convention is used with shuffle filter and fletcher32. But not szip.

The prototype for nc_inq_var_szip() lacks this extra parameter:

EXTERNL int
nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp);

Well this is my mistake, I didn't include a parameter to pass back whether the szip filter was in use or not, just its parameters.

In this case I will use the options_maskp for this purpose. The options mask is never 0 when szip is in use, so I will return a 0 in the options_maskp pointer (if not NULL) and that will allow the user (and my tests) to know that the var does not have szip compression on. I will then document this.

Currently the code returns NC_EFILTER if szip is not in use on the var. That's not how we handle this in the case of deflate, fletcher32, or shuffle filter, or any other inq function, so I am going to make szip work like deflate in this regard. That is, it will return NC_NOERR for a var without szip compression, but will set options_maskp to point at 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions