Rate This Document
Findability
Accuracy
Completeness
Readability

Querying Attribute Information

Function Syntax

  • Query attribute information.

    nc_inq_att(int ncid, int varid, const char *name, nc_type *xtypep, size_t *lenp)

  • Query the attribute name.

    nc_inq_attname(int ncid, int varid, int attnum, char *name)

Parameters

Parameter

Description

Value Range

Input/Output

ncid

File ID

Non-negative integer

Input

varid

Variable ID

Non-negative integer or -1

Input

attnum

Attribute number

Non-negative integer

Input

const *name

Attribute name

Non-empty string of less than 256 bytes

Input

*xtypep

Pointer to the data type

Non-empty

Output

*lenp

Pointer to the attribute length

Non-empty

Output

*name

Pointer to the attribute name

Non-empty

Output

Return Value

  • Success: NC_NOERR
  • Failure: An error code is returned.

Error Code

Error Code

Description

NC_EBADID

Invalid ncid

NC_ENOTVAR

Invalid variable ID

NC_ENOTATT

Attribute not found

NC_ENOMEM

Insufficient memory

Notes

*xtypep, *lenp, and *name can be null pointers only if no data needs to be obtained.