1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Add get_config_str

This commit is contained in:
Alasdair Kergon 2002-07-11 14:07:43 +00:00
parent 38f3949b25
commit 48450b8f43
2 changed files with 18 additions and 0 deletions

View File

@ -682,3 +682,18 @@ int get_config_uint64(struct config_node *cn, const char *path,
*result = (uint64_t) n->v->v.i;
return 1;
}
int get_config_str(struct config_node *cn, const char *path,
char sep, char **result)
{
struct config_node *n;
n = find_config_node(cn, path, sep);
if (!n || !n->v || n->v->type != CFG_STRING)
return 0;
*result = n->v->v.str;
return 1;
}

View File

@ -68,5 +68,8 @@ int get_config_uint32(struct config_node *cn, const char *path,
int get_config_uint64(struct config_node *cn, const char *path,
char sep, uint64_t *result);
int get_config_str(struct config_node *cn, const char *path,
char sep, char **result);
#endif