From: Marcel Holtmann Date: Tue, 30 Jun 2009 20:21:20 +0000 (-0700) Subject: Move error conversion helper to different location X-Git-Tag: 0.20~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9e3fbfc285207317db09cbb0fb8932eab7ff741d;p=platform%2Fupstream%2Fconnman.git Move error conversion helper to different location --- diff --git a/src/service.c b/src/service.c index 94ef22d..f2886cf 100644 --- a/src/service.c +++ b/src/service.c @@ -179,6 +179,26 @@ static const char *state2string(enum connman_service_state state) return NULL; } +static const char *error2string(enum connman_service_error error) +{ + switch (error) { + case CONNMAN_SERVICE_ERROR_UNKNOWN: + break; + case CONNMAN_SERVICE_ERROR_DHCP_FAILED: + return "dhcp-failed"; + } + + return NULL; +} + +static enum connman_service_error string2error(const char *error) +{ + if (g_strcmp0(error, "dhcp-failed") == 0) + return CONNMAN_SERVICE_ERROR_DHCP_FAILED; + + return CONNMAN_SERVICE_ERROR_UNKNOWN; +} + static void state_changed(struct connman_service *service) { DBusMessage *signal; @@ -1273,26 +1293,6 @@ done: return service; } -static const char *error2string(enum connman_service_error error) -{ - switch (error) { - case CONNMAN_SERVICE_ERROR_UNKNOWN: - break; - case CONNMAN_SERVICE_ERROR_DHCP_FAILED: - return "dhcp-failed"; - } - - return NULL; -} - -static enum connman_service_error string2error(const char *error) -{ - if (g_strcmp0(error, "dhcp-failed") == 0) - return CONNMAN_SERVICE_ERROR_DHCP_FAILED; - - return CONNMAN_SERVICE_ERROR_UNKNOWN; -} - static int service_load(struct connman_service *service) { GKeyFile *keyfile;