mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
libgpo: add gp_inifile_getbool().
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
c329a6abcc
commit
12c7b9498c
@ -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,
|
||||
|
@ -42,4 +42,5 @@ NTSTATUS parse_gpt_ini(TALLOC_CTX *ctx,
|
||||
char **display_name);
|
||||
NTSTATUS gp_inifile_getstring(struct gp_inifile_context *ctx, const char *key, char **ret);
|
||||
NTSTATUS gp_inifile_getint(struct gp_inifile_context *ctx, const char *key, int *ret);
|
||||
NTSTATUS gp_inifile_getbool(struct gp_inifile_context *ctx, const char *key, bool *ret);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user