mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
Add get_config_str
This commit is contained in:
parent
38f3949b25
commit
48450b8f43
@ -682,3 +682,18 @@ int get_config_uint64(struct config_node *cn, const char *path,
|
|||||||
*result = (uint64_t) n->v->v.i;
|
*result = (uint64_t) n->v->v.i;
|
||||||
return 1;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -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,
|
int get_config_uint64(struct config_node *cn, const char *path,
|
||||||
char sep, uint64_t *result);
|
char sep, uint64_t *result);
|
||||||
|
|
||||||
|
int get_config_str(struct config_node *cn, const char *path,
|
||||||
|
char sep, char **result);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user