Commit 52c5ad8e authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Added function cdiInqKeyLen().

parent 57250f4c
......@@ -829,6 +829,9 @@ int cdiDefKeyBytes(int cdiID, int varID, int key, unsigned char *bytes, int
// cdiInqKeyBytes: Get a bytes array from a key of a CDI variable
int cdiInqKeyBytes(int cdiID, int varID, int key, unsigned char *bytes, int *length);
// cdiInqKeyLen: Get the length of the string representation of the key
int cdiInqKeyLen(int cdiID, int varID, int key, int *length);
int cdiCopyKeys(int cdiID1, int varID1, int cdiID2, int varID2);
// CDI grid keys
......
......@@ -199,6 +199,24 @@ int cdiDefKeyBytes(int cdiID, int varID, int key, unsigned char *bytes, int leng
return status;
}
// cdiInqKeyLen: Get the length of the string representation of the key
int cdiInqKeyLen(int cdiID, int varID, int key, int *length)
{
int status = -1;
cdi_keys_t *keysp = cdi_get_keysp(cdiID, varID);
xassert(keysp != NULL);
cdi_key_t *keyp = find_key(keysp, key);
if ( keyp != NULL )
{
*length = keyp->length;
status = CDI_NOERR;
}
return status;
}
// cdiInqKeyBytes: Get a bytes array from a key of a CDI variable
int cdiInqKeyBytes(int cdiID, int varID, int key, unsigned char *bytes, int *length)
{
......
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