Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
52c5ad8e
Commit
52c5ad8e
authored
Feb 22, 2018
by
Uwe Schulzweida
Browse files
Added function cdiInqKeyLen().
parent
57250f4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cdi.h
View file @
52c5ad8e
...
...
@@ -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
...
...
src/cdi_key.c
View file @
52c5ad8e
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment