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:
Ian Campbell committed 2012-03-01 12:26:14 +00:00
1 parent 966deb4db6
commit 50cbda0d0b
11 files changed
+144 -2

No files matched your search

+15
View File
@@ -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;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.