summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-08-01 17:59:21 +0200
committerThomas Haller <thaller@redhat.com>2018-08-10 10:38:19 +0200
commit64f1e78e285bfa50078dd2a1585be919c85345eb (patch)
tree932c66b67497c747cb914442478d0675dd849ef4
parentbcbea6fe35dbf9305adab2f157c8ff6da45eec10 (diff)
downloadNetworkManager-64f1e78e285bfa50078dd2a1585be919c85345eb.tar.gz
cli: drop NMCTriStateValue for NMTernary
-rw-r--r--clients/common/nm-client-utils.c8
-rw-r--r--clients/common/nm-client-utils.h8
-rw-r--r--clients/common/nm-meta-setting-desc.c10
3 files changed, 10 insertions, 16 deletions
diff --git a/clients/common/nm-client-utils.c b/clients/common/nm-client-utils.c
index 2e3d45ca38..8c7553d83f 100644
--- a/clients/common/nm-client-utils.c
+++ b/clients/common/nm-client-utils.c
@@ -132,7 +132,7 @@ nmc_string_to_bool (const char *str, gboolean *val_bool, GError **error)
}
gboolean
-nmc_string_to_tristate (const char *str, NMCTriStateValue *val, GError **error)
+nmc_string_to_ternary (const char *str, NMTernary *val, GError **error)
{
const char *s_true[] = { "true", "yes", "on", NULL };
const char *s_false[] = { "false", "no", "off", NULL };
@@ -150,11 +150,11 @@ nmc_string_to_tristate (const char *str, NMCTriStateValue *val, GError **error)
}
if (nmc_string_is_valid (str, s_true, NULL))
- *val = NMC_TRI_STATE_YES;
+ *val = NM_TERNARY_TRUE;
else if (nmc_string_is_valid (str, s_false, NULL))
- *val = NMC_TRI_STATE_NO;
+ *val = NM_TERNARY_FALSE;
else if (nmc_string_is_valid (str, s_unknown, NULL))
- *val = NMC_TRI_STATE_UNKNOWN;
+ *val = NM_TERNARY_DEFAULT;
else {
g_set_error (error, 1, 0,
_("'%s' is not valid; use [%s], [%s] or [%s]"),
diff --git a/clients/common/nm-client-utils.h b/clients/common/nm-client-utils.h
index cc0b7330ac..9d818873c0 100644
--- a/clients/common/nm-client-utils.h
+++ b/clients/common/nm-client-utils.h
@@ -24,12 +24,6 @@
#include "nm-active-connection.h"
#include "nm-device.h"
-typedef enum {
- NMC_TRI_STATE_NO,
- NMC_TRI_STATE_YES,
- NMC_TRI_STATE_UNKNOWN,
-} NMCTriStateValue;
-
const NMObject **nmc_objects_sort_by_path (const NMObject *const*objs, gssize len);
const char *nmc_string_is_valid (const char *input, const char **allowed, GError **error);
@@ -40,7 +34,7 @@ gboolean nmc_string_to_uint (const char *str,
unsigned long int max,
unsigned long int *value);
gboolean nmc_string_to_bool (const char *str, gboolean *val_bool, GError **error);
-gboolean nmc_string_to_tristate (const char *str, NMCTriStateValue *val, GError **error);
+gboolean nmc_string_to_ternary (const char *str, NMTernary *val, GError **error);
gboolean matches (const char *cmd, const char *pattern);
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c
index aa21ce1023..5dbbc50384 100644
--- a/clients/common/nm-meta-setting-desc.c
+++ b/clients/common/nm-meta-setting-desc.c
@@ -2719,19 +2719,19 @@ static gboolean
_set_fcn_connection_metered (ARGS_SET_FCN)
{
NMMetered metered;
- NMCTriStateValue ts_val;
+ NMTernary ts_val;
- if (!nmc_string_to_tristate (value, &ts_val, error))
+ if (!nmc_string_to_ternary (value, &ts_val, error))
return FALSE;
switch (ts_val) {
- case NMC_TRI_STATE_YES:
+ case NM_TERNARY_TRUE:
metered = NM_METERED_YES;
break;
- case NMC_TRI_STATE_NO:
+ case NM_TERNARY_FALSE:
metered = NM_METERED_NO;
break;
- case NMC_TRI_STATE_UNKNOWN:
+ case NM_TERNARY_DEFAULT:
metered = NM_METERED_UNKNOWN;
break;
default: