ifcfg: add svSetValueBoolean_cond_true() helper

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

View file

@ -1356,6 +1356,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

@ -96,6 +96,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);