diff options
author | Thomas Haller <thaller@redhat.com> | 2017-04-28 11:28:04 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-04-28 12:21:10 +0200 |
commit | e81bdf19fa826750ef4e157c200f422179abc16e (patch) | |
tree | 173a750a31251636fef5a7113863aeb6c865c730 | |
parent | a7fdf09848070990710529946fff782fc60c1461 (diff) | |
download | NetworkManager-e81bdf19fa826750ef4e157c200f422179abc16e.tar.gz |
ifcfg-rh: add svSetValueEnum()
-rw-r--r-- | src/settings/plugins/ifcfg-rh/shvar.c | 10 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/shvar.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/settings/plugins/ifcfg-rh/shvar.c b/src/settings/plugins/ifcfg-rh/shvar.c index 25a012cf3c..76c8d7c926 100644 --- a/src/settings/plugins/ifcfg-rh/shvar.c +++ b/src/settings/plugins/ifcfg-rh/shvar.c @@ -38,6 +38,7 @@ #include "nm-core-internal.h" #include "nm-core-utils.h" +#include "nm-utils/nm-enum-utils.h" /*****************************************************************************/ @@ -1128,6 +1129,15 @@ svSetValueBoolean (shvarFile *s, const char *key, gboolean value) } 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) { svSetValue (s, key, NULL); diff --git a/src/settings/plugins/ifcfg-rh/shvar.h b/src/settings/plugins/ifcfg-rh/shvar.h index 8eaf9b878e..7ad2bc8863 100644 --- a/src/settings/plugins/ifcfg-rh/shvar.h +++ b/src/settings/plugins/ifcfg-rh/shvar.h @@ -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); |