diff options
author | Günther Deschner <gd@samba.org> | 2013-12-11 00:44:49 +0100 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2013-12-12 13:34:51 +0100 |
commit | 12c7b9498c02e75440e3923cdc4b8c6e03f8afd8 (patch) | |
tree | b9982993f679543a2dc31cbc4795a7f07f079068 /libgpo/gpo_ini.c | |
parent | c329a6abcc236101665d2453a70375d740b73944 (diff) | |
download | samba-12c7b9498c02e75440e3923cdc4b8c6e03f8afd8.tar.gz |
libgpo: add gp_inifile_getbool().
Guenther
Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'libgpo/gpo_ini.c')
-rw-r--r-- | libgpo/gpo_ini.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libgpo/gpo_ini.c b/libgpo/gpo_ini.c index a2cb106d73c..1f69eecc42e 100644 --- a/libgpo/gpo_ini.c +++ b/libgpo/gpo_ini.c @@ -165,6 +165,30 @@ NTSTATUS gp_inifile_getint(struct gp_inifile_context *ctx, const char *key, int /**************************************************************** ****************************************************************/ +NTSTATUS gp_inifile_getbool(struct gp_inifile_context *ctx, const char *key, bool *ret) +{ + char *value; + NTSTATUS result; + + result = gp_inifile_getstring(ctx,key, &value); + if (!NT_STATUS_IS_OK(result)) { + return result; + } + + if (strequal(value, "Yes")) { + *ret = true; + return NT_STATUS_OK; + } else if (strequal(value, "No")) { + *ret = false; + return NT_STATUS_OK; + } + + return NT_STATUS_NOT_FOUND; +} + +/**************************************************************** +****************************************************************/ + NTSTATUS gp_inifile_init_context(TALLOC_CTX *mem_ctx, uint32_t flags, const char *unix_path, |