ifcfg-rh: add svSetValueEnum()

This commit is contained in:
Thomas Haller 2017-04-28 11:28:04 +02:00
parent a7fdf09848
commit e81bdf19fa
2 changed files with 11 additions and 0 deletions

View file

@ -38,6 +38,7 @@
#include "nm-core-internal.h"
#include "nm-core-utils.h"
#include "nm-utils/nm-enum-utils.h"
/*****************************************************************************/
@ -1127,6 +1128,15 @@ svSetValueBoolean (shvarFile *s, const char *key, gboolean value)
svSetValue (s, key, value ? "yes" : "no");
}
void
svSetValueEnum (shvarFile *s, const char *key, GType gtype, int value)
{
gs_free char *v = NULL;
v = _nm_utils_enum_to_str_full (gtype, value, " ");
svSetValueStr (s, key, v);
}
void
svUnsetValue (shvarFile *s, const char *key)
{

View file

@ -73,6 +73,7 @@ void svSetValue (shvarFile *s, const char *key, const char *value);
void svSetValueStr (shvarFile *s, const char *key, const char *value);
void svSetValueBoolean (shvarFile *s, const char *key, gboolean value);
void svSetValueInt64 (shvarFile *s, const char *key, gint64 value);
void svSetValueEnum (shvarFile *s, const char *key, GType gtype, int value);
void svUnsetValue (shvarFile *s, const char *key);