The helper function is not used elsewhere, thus move it.
---
 client/commands.c |   26 ++++++++++++++++++++++++++
 client/services.c |   26 --------------------------
 client/services.h |    1 -
 3 files changed, 26 insertions(+), 27 deletions(-)

diff --git a/client/commands.c b/client/commands.c
index 9182d01..40a8664 100644
--- a/client/commands.c
+++ b/client/commands.c
@@ -58,6 +58,32 @@ static char *ipv6[] = {
 
 static int cmd_help(char *args[], int num, struct option *options);
 
+static int parse_boolean(char *arg)
+{
+       if (arg == NULL)
+               return -1;
+
+       if (strcasecmp(arg, "no") == 0 ||
+                       strcasecmp(arg, "false") == 0 ||
+                       strcasecmp(arg, "off" ) == 0 ||
+                       strcasecmp(arg, "disable" ) == 0 ||
+                       strcasecmp(arg, "n") == 0 ||
+                       strcasecmp(arg, "f") == 0 ||
+                       strcasecmp(arg, "0") == 0)
+               return 0;
+
+       if (strcasecmp(arg, "yes") == 0 ||
+                       strcasecmp(arg, "true") == 0 ||
+                       strcasecmp(arg, "on") == 0 ||
+                       strcasecmp(arg, "enable" ) == 0 ||
+                       strcasecmp(arg, "y") == 0 ||
+                       strcasecmp(arg, "t") == 0 ||
+                       strcasecmp(arg, "1") == 0)
+               return 1;
+
+       return -1;
+}
+
 static int parse_args(char *arg, struct option *options)
 {
        int i;
diff --git a/client/services.c b/client/services.c
index 737e073..d325036 100644
--- a/client/services.c
+++ b/client/services.c
@@ -34,32 +34,6 @@
 
 #include "services.h"
 
-int parse_boolean(char *arg)
-{
-       if (arg == NULL)
-               return -1;
-
-       if (strcasecmp(arg, "no") == 0 ||
-                       strcasecmp(arg, "false") == 0 ||
-                       strcasecmp(arg, "off" ) == 0 ||
-                       strcasecmp(arg, "disable" ) == 0 ||
-                       strcasecmp(arg, "n") == 0 ||
-                       strcasecmp(arg, "f") == 0 ||
-                       strcasecmp(arg, "0") == 0)
-               return 0;
-
-       if (strcasecmp(arg, "yes") == 0 ||
-                       strcasecmp(arg, "true") == 0 ||
-                       strcasecmp(arg, "on") == 0 ||
-                       strcasecmp(arg, "enable" ) == 0 ||
-                       strcasecmp(arg, "y") == 0 ||
-                       strcasecmp(arg, "t") == 0 ||
-                       strcasecmp(arg, "1") == 0)
-               return 1;
-
-       return -1;
-}
-
 static void print_service(char *path, DBusMessageIter *iter)
 {
        char *name = "", *str = NULL;
diff --git a/client/services.h b/client/services.h
index 84830e9..9a4f56c 100644
--- a/client/services.h
+++ b/client/services.h
@@ -21,5 +21,4 @@
 
 #include <dbus/dbus.h>
 
-int parse_boolean(char *arg);
 void __connmanctl_services_list(DBusMessageIter *iter);
-- 
1.7.10.4

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to