virEnumFromString;
virEnumToString;
virTristateBoolFromBool;
+virTristateBoolToBool;
virTristateBoolTypeFromString;
virTristateBoolTypeToString;
virTristateSwitchFromBool;
+virTristateSwitchToBool;
virTristateSwitchTypeFromString;
virTristateSwitchTypeToString;
}
+/**
+ * virTristateBoolToBool:
+ * @t: a virTristateBool value
+ * @b: pointer to a boolean to be updated according to the value of @t
+ *
+ * The value pointed to by @b is updated if the tristate value @t is not absent.
+ */
+void
+virTristateBoolToBool(virTristateBool t,
+ bool *b)
+{
+ switch (t) {
+ case VIR_TRISTATE_BOOL_YES:
+ *b = true;
+ break;
+
+ case VIR_TRISTATE_BOOL_NO:
+ *b = false;
+ break;
+
+ case VIR_TRISTATE_BOOL_ABSENT:
+ case VIR_TRISTATE_BOOL_LAST:
+ break;
+ }
+}
+
+
virTristateSwitch
virTristateSwitchFromBool(bool val)
{
}
+/**
+ * virTristateSwitchToBool:
+ * @t: a virTristateSwitch value
+ * @b: pointer to a boolean to be updated according to the value of @t
+ *
+ * The value pointed to by @b is updated if the tristate value @t is not absent.
+ */
+void
+virTristateSwitchToBool(virTristateSwitch t,
+ bool *b)
+{
+ switch (t) {
+ case VIR_TRISTATE_SWITCH_ON:
+ *b = true;
+ break;
+
+ case VIR_TRISTATE_SWITCH_OFF:
+ *b = false;
+ break;
+
+ case VIR_TRISTATE_SWITCH_ABSENT:
+ case VIR_TRISTATE_SWITCH_LAST:
+ break;
+ }
+}
+
+
int
virEnumFromString(const char * const *types,
unsigned int ntypes,
VIR_ENUM_DECL(virTristateSwitch);
virTristateBool virTristateBoolFromBool(bool val);
+void virTristateBoolToBool(virTristateBool t, bool *b);
virTristateSwitch virTristateSwitchFromBool(bool val);
+void virTristateSwitchToBool(virTristateSwitch t, bool *b);
/* the two enums must be in sync to be able to use helpers interchangeably in
* some special cases */