Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
59a7f2b5
Commit
59a7f2b5
authored
Nov 07, 2019
by
Uwe Schulzweida
Browse files
Added cdiInqVarKeyStringPtr().
parent
949a0a3f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cdi_key.c
View file @
59a7f2b5
...
...
@@ -4,7 +4,6 @@
#include "vlist.h"
#include "resource_unpack.h"
enum
{
KEY_INT
=
1
,
KEY_FLOAT
,
KEY_BYTES
};
static
cdi_keys_t
*
vlist_get_keysp
(
vlist_t
*
vlistptr
,
int
varID
)
...
...
@@ -379,6 +378,17 @@ int cdiInqKeyString(int cdiID, int varID, int key, char *string, int *length)
return
status
;
}
const
char
*
cdiInqVarKeyStringPtr
(
cdi_keys_t
*
keysp
,
int
key
)
{
cdi_key_t
*
keyp
=
find_key
(
keysp
,
key
);
if
(
keyp
!=
NULL
)
// key in use
{
if
(
keyp
->
type
==
KEY_BYTES
)
return
(
const
char
*
)
keyp
->
v
.
s
;
}
return
NULL
;
}
/*
* Local Variables:
* c-file-style: "Java"
...
...
src/cdi_key.h
View file @
59a7f2b5
...
...
@@ -22,10 +22,12 @@ typedef struct {
cdi_key_t
value
[
MAX_KEYS
];
}
cdi_keys_t
;
enum
{
KEY_INT
=
1
,
KEY_FLOAT
,
KEY_BYTES
};
void
cdiDefVarKeyInt
(
cdi_keys_t
*
keysp
,
int
key
,
int
value
);
void
cdiDefVarKeyBytes
(
cdi_keys_t
*
keysp
,
int
key
,
const
unsigned
char
*
bytes
,
int
length
);
cdi_key_t
*
find_key
(
cdi_keys_t
*
keysp
,
int
key
);
const
char
*
cdiInqVarKeyStringPtr
(
cdi_keys_t
*
keysp
,
int
key
);
void
cdiCopyVarKeys
(
cdi_keys_t
*
keysp
,
int
cdiID2
,
int
varID2
);
void
cdiDeleteVarKeys
(
cdi_keys_t
*
keysp
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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