Querying Attribute Information
Function Syntax
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.
Parent topic: Information Query