mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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 <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
966deb4db6
commit
50cbda0d0b
11 files changed
+144
-2
No files matched your search
@@ -156,6 +156,21 @@ int genwrap__ll_set(PyObject *v, long long *val, long long mask)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject *genwrap__defbool_get(libxl_defbool *db)
|
||||
{
|
||||
PyObject *ret;
|
||||
ret = libxl_defbool_val(*db) ? Py_True : Py_False;
|
||||
Py_INCREF(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int genwrap__defbool_set(PyObject *v, libxl_defbool *db)
|
||||
{
|
||||
bool val = !(NULL == v || Py_None == v || Py_False == v);
|
||||
libxl_defbool_set(db, val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fixed_bytearray_set(PyObject *v, uint8_t *ptr, size_t len)
|
||||
{
|
||||
char *tmp;
|
||||
|
||||