From 50cbda0d0b1bffa4a7af91b5ff8a65d88191fdbb Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 1 Mar 2012 12:26:14 +0000 Subject: libxl: add new "defbool" built in type. This type is a but like a "boolean" but with a third state "default" (so really I suppose it's a tristate). Signed-off-by: Ian Campbell Acked-by: Ian Jackson --- tools/libxl/libxlu_cfg.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tools/libxl/libxlu_cfg.c') diff --git a/tools/libxl/libxlu_cfg.c b/tools/libxl/libxlu_cfg.c index e3659c7654..c32cf046c1 100644 --- a/tools/libxl/libxlu_cfg.c +++ b/tools/libxl/libxlu_cfg.c @@ -237,6 +237,17 @@ int xlu_cfg_get_long(const XLU_Config *cfg, const char *n, return 0; } +int xlu_cfg_get_defbool(const XLU_Config *cfg, const char *n, libxl_defbool *b, + int dont_warn) +{ + int ret; + long l; + + ret = xlu_cfg_get_long(cfg, n, &l, dont_warn); + if (ret) return ret; + libxl_defbool_set(b, !!l); + return 0; +} int xlu_cfg_get_list(const XLU_Config *cfg, const char *n, XLU_ConfigList **list_r, int *entries_r, int dont_warn) { -- cgit v1.2.3