ifcfg: add svSetValueBoolean_cond_true() helper

(cherry picked from commit 87af96a9d6)
(cherry picked from commit f449ace2f1)
This commit is contained in:
Thomas Haller 2019-11-22 11:26:51 +01:00
parent 57e2f76f57
commit 28b159eeaf
2 changed files with 7 additions and 0 deletions

View file

@ -1357,6 +1357,12 @@ svSetValueBoolean (shvarFile *s, const char *key, gboolean value)
return svSetValue (s, key, value ? "yes" : "no");
}
gboolean
svSetValueBoolean_cond_true (shvarFile *s, const char *key, gboolean value)
{
return svSetValue (s, key, value ? "yes" : NULL);
}
gboolean
svSetValueEnum (shvarFile *s, const char *key, GType gtype, int value)
{

View file

@ -97,6 +97,7 @@ gboolean svGetValueEnum (shvarFile *s, const char *key,
gboolean svSetValue (shvarFile *s, const char *key, const char *value);
gboolean svSetValueStr (shvarFile *s, const char *key, const char *value);
gboolean svSetValueBoolean (shvarFile *s, const char *key, gboolean value);
gboolean svSetValueBoolean_cond_true (shvarFile *s, const char *key, gboolean value);
gboolean svSetValueInt64 (shvarFile *s, const char *key, gint64 value);
gboolean svSetValueInt64_cond (shvarFile *s, const char *key, gboolean do_set, gint64 value);
gboolean svSetValueEnum (shvarFile *s, const char *key, GType gtype, int value);