6.18 Learn About Endian Parameters for a Variable: nc_inq_var_endian
The function nc_inq_var_endian returns the endianness settings for a
variable in a netCDF-4 file.
Usage
nc_inq_var_endian(int ncid, int varid, int *endianp);
ncid
- NetCDF ID, from a previous call to nc_open or nc_create.
varid
- Variable ID.
*endianp
- If not-NULL, the nc_inq_var_endian function will set the int
pointed to this to NC_ENDIAN_LITTLE if this variable is stored in
little-endian format, NC_ENDIAN_BIG if it is stored in big-endian
format, and NC_ENDIAN_NATIVE if the endianness is not set, and the
variable is not created yet.
Errors
nc_inq_var_endian returns the value NC_NOERR if no errors
occurred. Otherwise, the returned status indicates an error.
Possible return codes include:
NC_NOERR
- No error.
NC_BADID
- Bad ncid.
NC_ENOTNC4
- Not a netCDF-4 file.
NC_ENOTVAR
- Can't find this variable.
Example