summaryrefslogtreecommitdiff
path: root/libgpo/gpo_ini.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2013-12-11 00:44:49 +0100
committerAndreas Schneider <asn@samba.org>2013-12-12 13:34:51 +0100
commit12c7b9498c02e75440e3923cdc4b8c6e03f8afd8 (patch)
treeb9982993f679543a2dc31cbc4795a7f07f079068 /libgpo/gpo_ini.c
parentc329a6abcc236101665d2453a70375d740b73944 (diff)
downloadsamba-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.c24
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,