mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 22:10:09 +01:00
ifcfg-rh: add svSetValueEnum()
This commit is contained in:
parent
a7fdf09848
commit
e81bdf19fa
2 changed files with 11 additions and 0 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue