Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Elsa Gonsiorowski
codes
Commits
a1e0df0a
Commit
a1e0df0a
authored
Jan 28, 2014
by
Shane Snyder
Browse files
Merge branch 'master' of git.mcs.anl.gov:radix/codes-base
parents
5c429633
13258a3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
codes/configuration.h
View file @
a1e0df0a
...
...
@@ -72,6 +72,24 @@ int configuration_get_value(ConfigHandle *handle,
char
*
value
,
size_t
length
);
/*
* Get's the values for a give section/key pair which has multiple values.
* Caller's responsible for transforming it to a useable type.
* Assumes the key name is a MULTIKEY configuration type.
*
* handle - configuration handle
* section_name - name of the section the key is in
* key_name - name of the key
* values - array of points to values (must be freed by caller)
* length - number of value items
*/
int
configuration_get_multivalue
(
ConfigHandle
*
handle
,
const
char
*
section_name
,
const
char
*
key_name
,
char
***
values
,
size_t
*
length
);
/*
* Get's the value for a give section/key pair and converts it to an int.
* Assumes the key name is a KEY configuration type.
...
...
src/util/configuration.c
View file @
a1e0df0a
...
...
@@ -87,6 +87,26 @@ int configuration_get_value(ConfigHandle *handle,
return
rc
;
}
int
configuration_get_multivalue
(
ConfigHandle
*
handle
,
const
char
*
section_name
,
const
char
*
key_name
,
char
***
values
,
size_t
*
len
)
{
SectionHandle
section_handle
;
int
rc
;
rc
=
cf_openSection
(
*
handle
,
ROOT_SECTION
,
section_name
,
&
section_handle
);
assert
(
rc
==
1
);
rc
=
cf_getMultiKey
(
*
handle
,
section_handle
,
key_name
,
values
,
len
);
assert
(
rc
);
(
void
)
cf_closeSection
(
*
handle
,
section_handle
);
return
rc
;
}
int
configuration_get_value_int
(
ConfigHandle
*
handle
,
const
char
*
section_name
,
const
char
*
key_name
,
...
...
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