Commit a1e0df0a authored by Shane Snyder's avatar Shane Snyder

Merge branch 'master' of git.mcs.anl.gov:radix/codes-base

parents 5c429633 13258a3a
...@@ -72,6 +72,24 @@ int configuration_get_value(ConfigHandle *handle, ...@@ -72,6 +72,24 @@ int configuration_get_value(ConfigHandle *handle,
char *value, char *value,
size_t length); 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. * 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. * Assumes the key name is a KEY configuration type.
......
...@@ -87,6 +87,26 @@ int configuration_get_value(ConfigHandle *handle, ...@@ -87,6 +87,26 @@ int configuration_get_value(ConfigHandle *handle,
return rc; 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, int configuration_get_value_int (ConfigHandle *handle,
const char *section_name, const char *section_name,
const char *key_name, const char *key_name,
......
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