Commit 2e504bd8 authored by Uwe Schulzweida's avatar Uwe Schulzweida

Added function cdiInqAttLen().

parent e44461eb
2020-02-25 Uwe Schulzweida
* Added function cdiInqAttLen()
2020-02-20 Uwe Schulzweida
* zaxisDuplicate: init target attributes (bug fix) [report: Fabian Wachsmann]
......
......@@ -683,6 +683,7 @@ int vlistInqVarIntKey(int vlistID, int varID, const char *name);
int cdiInqNatts(int cdiID, int varID, int *nattsp);
// cdiInqAtt: Get information about an attribute
int cdiInqAtt(int cdiID, int varID, int attrnum, char *name, int *typep, int *lenp);
int cdiInqAttLen(int cdiID, int varID, const char *name);
int cdiDelAtt(int cdiID, int varID, const char *name);
int cdiCopyAtts(int cdiID1, int varID1, int cdiID2, int varID2);
......
......@@ -187,6 +187,29 @@ int cdiInqAtt(int cdiID, int varID, int attnum, char *name, int *typep, int *len
}
int cdiInqAttLen(int cdiID, int varID, const char *name)
{
int length = -1;
xassert(name != NULL);
cdi_atts_t *attsp = cdi_get_attsp(cdiID, varID);
xassert(attsp != NULL);
for ( int attid = 0; attid < (int)attsp->nelems; attid++ )
{
cdi_att_t *attp = &(attsp->value[attid]);
if (strcmp(attp->name, name) == 0)
{
length = (int)attp->nelems;
printf("name >%s< >%s< length %d\n", attp->name, name, length);
}
}
return length;
}
int cdiDeleteAtts(int cdiID, int varID)
{
int status = CDI_NOERR;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment