Adjust coding rules 49/63749/5 accepted/tizen/common/20160406.143436 accepted/tizen/ivi/20160406.012040 accepted/tizen/mobile/20160406.011930 accepted/tizen/tv/20160406.011956 accepted/tizen/wearable/20160406.012017 submit/tizen/20160405.001024
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 25 Mar 2016 12:43:22 +0000 (21:43 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 29 Mar 2016 10:43:55 +0000 (19:43 +0900)
Change-Id: Ibec386e1e1be9976fde5aa09a9cdd0a2da724f4a
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
13 files changed:
doc/appcore-watch_doc.h
include/appcore-watch.h
include/watch_app.h
include/watch_app_efl.h
src/appcore-watch-i18n.c
src/appcore-watch-internal.h
src/appcore-watch-log.h
src/appcore-watch-signal.c
src/appcore-watch-signal.h
src/appcore-watch.c
src/watch_app_error.c
src/watch_app_main.c
src/watch_app_private.h

index 6d337ad..71956d1 100755 (executable)
@@ -1,7 +1,5 @@
 /*
- * app-core
- *
- * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index c8b3aaa..2aa6f3e 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
 #ifndef __APPCORE_WATCH_H__
 #define __APPCORE_WATCH_H__
 
-
 #include <libintl.h>
 #include <bundle.h>
 
 #include "app_control.h"
 
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 struct watchcore_ops {
-       void *data;
-           /**< Callback data */
+       void *data; /**< Callback data */
        int (*create) (int w, int h, void *); /**< This callback function is called at the start of the application. */
        int (*app_control) (app_control_h, void *); /**< This callback function is called when other application send the launch request to the application. */
-       int (*pause) (void *);  /**< Called when every window goes back */
-       int (*resume) (void *);         /**< Called when any window comes on top */
+       int (*pause) (void *); /**< Called when every window goes back */
+       int (*resume) (void *); /**< Called when any window comes on top */
        int (*terminate) (void *); /**< This callback function is called once after the main loop of application exits. */
        void (*time_tick) (void *, void *);
        void (*ambient_tick) (void *, void *);
        void (*ambient_changed) (int, void *);
-
-       void *reserved[6];
-                  /**< Reserved */
+       void *reserved[6]; /**< Reserved */
 };
 
 enum watch_core_event {
-       /**< Unknown event */
-       WATCH_CORE_EVENT_UNKNOWN,
-
-       /**< Low memory */
-       WATCH_CORE_EVENT_LOW_MEMORY,
-
-       /**< Low battery */
-       WATCH_CORE_EVENT_LOW_BATTERY,
-
-       /**< Language setting is changed */
-       WATCH_CORE_EVENT_LANG_CHANGE,
-
-       /**< Region setting is changed */
-       WATCH_CORE_EVENT_REGION_CHANGE,
+       WATCH_CORE_EVENT_UNKNOWN, /**< Unknown event */
+       WATCH_CORE_EVENT_LOW_MEMORY, /**< Low memory */
+       WATCH_CORE_EVENT_LOW_BATTERY, /**< Low battery */
+       WATCH_CORE_EVENT_LANG_CHANGE, /**< Language setting is changed */
+       WATCH_CORE_EVENT_REGION_CHANGE, /**< Region setting is changed */
 };
 
-struct watch_time_s
-{
+struct watch_time_s {
        int year;
        int month;
        int day_of_week;
@@ -76,21 +61,18 @@ struct watch_time_s
        char *timezone;
 };
 
-int watch_core_main(const char *appid, int argc, char **argv, struct watchcore_ops *ops);
-
+int watch_core_main(const char *appid, int argc, char **argv,
+               struct watchcore_ops *ops);
 int watch_core_terminate();
-
 int watch_core_set_event_callback(enum watch_core_event event,
-                       int (*cb)(void *, void *), void *data);
-
+               int (*cb) (void *, void *), void *data);
 const char *watch_core_get_appid();
-
 void watch_core_get_timeinfo(struct watch_time_s *timeinfo);
-
 bool watch_core_get_24h_mode(void);
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif                         /* __APPCORE_WATCH_H__ */
+#endif /* __APPCORE_WATCH_H__ */
+
index d7e8b88..e17d4e2 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
  * limitations under the License.
  */
 
-
 #ifndef __TIZEN_APPFW_WATCH_APP_H__
 #define __TIZEN_APPFW_WATCH_APP_H__
 
@@ -36,7 +35,7 @@ extern "C" {
  * @brief watch_time_h watch_time handle
  * @since_tizen 2.3.1
  */
-typedef struct _watch_time_swatch_time_h;
+typedef struct _watch_time_s *watch_time_h;
 
 /**
  * @brief Called when the application starts.
@@ -162,8 +161,7 @@ typedef void (*watch_app_ambient_changed_cb) (bool ambient_mode, void *user_data
  * @see watch_app_ambient_changed_cb()
  * @see watch_app_terminate_cb()
  */
-typedef struct
-{
+typedef struct {
        watch_app_create_cb create; /**< This callback function is called at the start of the application. */
        watch_app_control_cb app_control; /**< This callback function is called when another application sends the launch request to the application. */
        watch_app_pause_cb pause; /**< This callback function is called each time the application is completely obscured by another application and becomes invisible to the user. */
@@ -172,7 +170,6 @@ typedef struct
        watch_app_time_tick_cb time_tick; /**< This callback function is called at each second. */
        watch_app_ambient_tick_cb ambient_tick; /**< This callback function is called at each minute in ambient mode. */
        watch_app_ambient_changed_cb ambient_changed; /**< This callback function is called when the device enters or exits ambient mode. */
-
 } watch_app_lifecycle_callback_s;
 
 
@@ -268,7 +265,7 @@ void watch_app_exit(void);
  * @retval #APP_ERROR_OUT_OF_MEMORY Out of Memory
  * @retval #APP_ERROR_NONE Successful
  */
-int watch_time_get_current_time(watch_time_hwatch_time);
+int watch_time_get_current_time(watch_time_h *watch_time);
 
 /**
  * @brief Deletes the watch time handle and releases all its resources.
@@ -449,3 +446,4 @@ int watch_time_get_time_zone(watch_time_h watch_time, char **time_zone_id);
 #endif
 
 #endif /* __TIZEN_APPFW_WATCH_APP_H__ */
+
index f4863a6..c9e92cd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
@@ -53,3 +53,4 @@ int watch_app_get_elm_win(Evas_Object **win);
 #endif
 
 #endif
+
index 9f2c83e..8532144 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
@@ -22,9 +22,9 @@
 #include <errno.h>
 #include <unistd.h>
 #include <linux/limits.h>
+
 #include <glib.h>
 #include <tzplatform_config.h>
-
 #include <aul.h>
 #include <vconf.h>
 
 
 void _update_lang(void)
 {
+       char *r;
        char *lang = vconf_get_str(VCONFKEY_LANGSET);
        if (lang) {
                setenv("LANG", lang, 1);
                setenv("LC_MESSAGES", lang, 1);
 
-               char *r = setlocale(LC_ALL, "");
+               r = setlocale(LC_ALL, "");
                if (r == NULL) {
                        r = setlocale(LC_ALL, lang);
-                       if (r) {
+                       if (r)
                                _D("*****appcore setlocale=%s\n", r);
-                       }
                }
                free(lang);
        } else {
@@ -77,9 +77,8 @@ void _update_region(void)
                setenv("LC_MEASUREMENT", region, 1);
                setenv("LC_IDENTIFICATION", region, 1);
                r = setlocale(LC_ALL, "");
-               if (r != NULL) {
+               if (r != NULL)
                        _D("*****appcore setlocale=%s\n", r);
-               }
                free(region);
        } else {
                _E("failed to get current region format for set region env");
@@ -102,7 +101,6 @@ static int __get_dir_name(char *dirname)
 
        r = snprintf(dirname, PATH_MAX, "%s/%s" PATH_RES PATH_LOCALE,
                        PATH_APP_ROOT, pkg_name);
-
        if (r < 0)
                return -1;
 
@@ -111,7 +109,6 @@ static int __get_dir_name(char *dirname)
 
        r = snprintf(dirname, PATH_MAX, "%s/%s" PATH_RES PATH_LOCALE,
                        PATH_SYS_RO_APP_ROOT, pkg_name);
-
        if (r < 0)
                return -1;
 
@@ -120,18 +117,17 @@ static int __get_dir_name(char *dirname)
 
        r = snprintf(dirname, PATH_MAX, "%s/%s" PATH_RES PATH_LOCALE,
                        PATH_SYS_RW_APP_ROOT, pkg_name);
-
        if (r < 0)
                return -1;
 
        return 0;
 }
 
-
 static int __set_i18n(const char *domain)
 {
        char *r;
        char dirname[PATH_MAX];
+       char *lang;
 
        if (domain == NULL) {
                errno = EINVAL;
@@ -144,28 +140,23 @@ static int __set_i18n(const char *domain)
        r = setlocale(LC_ALL, "");
        /* if locale is not set properly, try again to set as language base */
        if (r == NULL) {
-               char *lang = vconf_get_str(VCONFKEY_LANGSET);
+               lang = vconf_get_str(VCONFKEY_LANGSET);
                r = setlocale(LC_ALL, lang);
-               if (r) {
+               if (r)
                        _D("*****appcore setlocale=%s\n", r);
-               }
-               if (lang) {
+               if (lang)
                        free(lang);
-               }
        }
-       if (r == NULL) {
+       if (r == NULL)
                _E("appcore: setlocale() error");
-       }
 
        r = bindtextdomain(domain, dirname);
-       if (r == NULL) {
+       if (r == NULL)
                _E("appcore: bindtextdomain() error");
-       }
 
        r = textdomain(domain);
-       if (r == NULL) {
+       if (r == NULL)
                _E("appcore: textdomain() error");
-       }
 
        return 0;
 }
index 3ae04ea..5034692 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
@@ -23,3 +23,4 @@ void _update_lang(void);
 void _update_region(void);
 
 #endif /* __APPCORE_WATCH_INTERNAL_H__ */
+
index 49f0d8f..d9190d2 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
  * limitations under the License.
  */
 
-
 #ifndef __APPFW_WATCH_LOG_H__
 #define __APPFW_WATCH_LOG_H__
 
@@ -77,5 +76,5 @@
                } \
        } while (0)
 
+#endif /*__APPFW_WATCH_LOG_H_ */
 
-#endif //__APPFW_WATCH_LOG_H_
index 0f4eea4..a281fdf 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
@@ -14,9 +14,6 @@
  * limitations under the License.
  */
 
-
-
-
 #define _GNU_SOURCE
 
 #include <errno.h>
@@ -27,7 +24,6 @@
 #include <malloc.h>
 
 #include <dlog.h>
-
 #include <dbus/dbus.h>
 #include <dbus/dbus-glib-lowlevel.h>
 
 
 #define LOG_TAG "WATCH_CORE"
 
-
 #define MAX_BUFFER_SIZE                512
 
 static DBusConnection *bus = NULL;
-
 static int (*_deviced_signal_alpm_handler) (int ambient, void *data);
 static void *_deviced_signal_alpm_data;
 
-static DBusHandlerResult
-__dbus_signal_filter(DBusConnection *conn, DBusMessage *message,
-                              void *user_data)
+static DBusHandlerResult __dbus_signal_filter(DBusConnection *conn,
+               DBusMessage *message, void *user_data)
 {
        const char *sender;
        const char *interface;
@@ -69,23 +62,21 @@ __dbus_signal_filter(DBusConnection *conn, DBusMessage *message,
                return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
        }
 
-       if (dbus_message_is_signal(message, interface, DEVICED_SIGNAL_HOME_SCREEN))
-       {
-               if (dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &value, DBUS_TYPE_INVALID) == FALSE) {
+       if (dbus_message_is_signal(message, interface,
+                               DEVICED_SIGNAL_HOME_SCREEN)) {
+               if (dbus_message_get_args(message, &error, DBUS_TYPE_STRING,
+                                       &value, DBUS_TYPE_INVALID) == FALSE) {
                        _E("Failed to get data: %s", error.message);
                        dbus_error_free(&error);
                }
 
-               if (_deviced_signal_alpm_handler)
-               {
+               if (_deviced_signal_alpm_handler) {
                        if (strcmp(value, CLOCK_START) == 0)
-                       {
-                               _deviced_signal_alpm_handler(1, _deviced_signal_alpm_data);
-                       }
+                               _deviced_signal_alpm_handler(1,
+                                               _deviced_signal_alpm_data);
                        else if (strcmp(value, CLOCK_STOP) == 0)
-                       {
-                               _deviced_signal_alpm_handler(0, _deviced_signal_alpm_data);
-                       }
+                               _deviced_signal_alpm_handler(0,
+                                               _deviced_signal_alpm_data);
                }
        }
 
@@ -94,10 +85,11 @@ __dbus_signal_filter(DBusConnection *conn, DBusMessage *message,
 
 static int __dbus_init(void)
 {
+       DBusError error;
+
        if (bus)
                return 0;
 
-       DBusError error;
        dbus_error_init(&error);
        bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error);
        if (!bus) {
@@ -111,15 +103,16 @@ static int __dbus_init(void)
        return 0;
 }
 
-static int __dbus_signal_handler_init(const char* path, const char* interface)
+static int __dbus_signal_handler_init(const char *path, const char *interface)
 {
        char rule[MAX_BUFFER_SIZE] = {0,};
-
        DBusError error;
+
        dbus_error_init(&error);
 
        snprintf(rule, MAX_BUFFER_SIZE,
-                       "path='%s',type='signal',interface='%s'", path, interface);
+                       "path='%s',type='signal',interface='%s'", path,
+                       interface);
 
        dbus_bus_add_match(bus, rule, &error);
        if (dbus_error_is_set(&error)) {
@@ -128,7 +121,8 @@ static int __dbus_signal_handler_init(const char* path, const char* interface)
                return -1;
        }
 
-       if (dbus_connection_add_filter(bus, __dbus_signal_filter, NULL, NULL) == FALSE) {
+       if (dbus_connection_add_filter(bus, __dbus_signal_filter, NULL,
+                               NULL) == FALSE) {
                _E("add filter fail");
                return -1;
        }
@@ -142,8 +136,7 @@ int _watch_core_listen_alpm_handler(int (*func) (int, void *), void *data)
 
        __dbus_init();
 
-       if(__dbus_signal_handler_init(DEVICED_PATH, DEVICED_INTERFACE) < 0)
-       {
+       if (__dbus_signal_handler_init(DEVICED_PATH, DEVICED_INTERFACE) < 0) {
                _E("error app signal init");
                return -1;
        }
@@ -161,8 +154,7 @@ int _watch_core_send_alpm_update_done(void)
        __dbus_init();
 
        message = dbus_message_new_signal(ALPM_VIEWER_PATH,
-                                                                       ALPM_VIEWER_INTERFACE,
-                                                                       ALPM_VIEWER_SIGNAL_DRAW_DONE);
+                       ALPM_VIEWER_INTERFACE, ALPM_VIEWER_SIGNAL_DRAW_DONE);
 
        if (dbus_message_append_args(message,
                                DBUS_TYPE_INVALID) == FALSE) {
index 6a35b47..a3178e5 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  */
 
-
 #ifndef __APPCORE_WATCH_SIGNAL_H__
 #define __APPCORE_WATCH_SIGNAL_H__
 
-
 #include <dbus/dbus.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#define ALPM_VIEWER_PATH                               "/Org/Tizen/Coreapps/Alpmviewer/Clockdraw"
-#define ALPM_VIEWER_INTERFACE                  "org.tizen.coreapps.alpmviewer.clockdraw"
-#define ALPM_VIEWER_SIGNAL_DRAW_DONE   "drawdone"
+#define ALPM_VIEWER_PATH "/Org/Tizen/Coreapps/Alpmviewer/Clockdraw"
+#define ALPM_VIEWER_INTERFACE "org.tizen.coreapps.alpmviewer.clockdraw"
+#define ALPM_VIEWER_SIGNAL_DRAW_DONE "drawdone"
 
-
-#define DEVICED_PATH                                   "/Org/Tizen/System/DeviceD"
-#define DEVICED_INTERFACE                              "org.tizen.system.deviced"
-#define DEVICED_SIGNAL_HOME_SCREEN             "HomeScreen"
-#define CLOCK_START                                            "clockbegin"
-#define CLOCK_STOP                                             "clockstop"
+#define DEVICED_PATH "/Org/Tizen/System/DeviceD"
+#define DEVICED_INTERFACE "org.tizen.system.deviced"
+#define DEVICED_SIGNAL_HOME_SCREEN "HomeScreen"
+#define CLOCK_START "clockbegin"
+#define CLOCK_STOP "clockstop"
 
 int _watch_core_listen_alpm_handler(int (*func) (int, void *), void *data);
 int _watch_core_send_alpm_update_done(void);
@@ -44,3 +41,4 @@ int _watch_core_send_alpm_update_done(void);
 #endif
 
 #endif /* __APPCORE_WATCH_SIGNAL_H__ */
+
index de22d51..5f728df 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
  * limitations under the License.
  */
 
-
 #define _GNU_SOURCE
 
 #include <errno.h>
 #include <assert.h>
 
 #include <bundle_internal.h>
-
 #include <Elementary.h>
-
 #include <app_control.h>
 #include <app_control_internal.h>
-
 #include <aul.h>
 #include <dlog.h>
 #include <vconf.h>
 #include <alarm.h>
 #include <glib-object.h>
-
-
 #include <widget_app.h>
 
 #include "appcore-watch.h"
 #include <unicode/udatpg.h>
 #include <unicode/ustring.h>
 
-#define WATCH_ID                       "internal://WATCH_ID"
-
-#define AUL_K_CALLER_APPID      "__AUL_CALLER_APPID__"
-#define APPID_BUFFER_MAX               255
-
-#define TIMEZONE_BUFFER_MAX            1024
-#define LOCAL_TIME_PATH                        "/opt/etc/localtime"
-
+#define WATCH_ID "internal://WATCH_ID"
+#define AUL_K_CALLER_APPID "__AUL_CALLER_APPID__"
+#define APPID_BUFFER_MAX 255
+#define TIMEZONE_BUFFER_MAX 1024
+#define LOCAL_TIME_PATH "/opt/etc/localtime"
 #define ONE_SECOND  1000
 #define ONE_MINUTE  60
 #define ONE_HOUR    60
 
 static Ecore_Timer *watch_tick = NULL;
-
 static alarm_id_t alarm_id = 0;
 
 /**
@@ -110,7 +100,6 @@ enum watch_event {
        WE_MAX
 };
 
-
 static enum watch_core_event to_ae[SE_MAX] = {
        WATCH_CORE_EVENT_UNKNOWN,       /* SE_UNKNOWN */
        WATCH_CORE_EVENT_LOW_MEMORY,    /* SE_LOWMEM */
@@ -223,13 +212,16 @@ static void __watch_core_time_tick_cancel(void);
 
 static int __watch_core_ambient_tick(alarm_id_t id, void *data);
 
-static int __widget_create(const char *id, const char *content, int w, int h, void *data);
+static int __widget_create(const char *id, const char *content, int w, int h,
+               void *data);
 static int __widget_resize(const char *id, int w, int h, void *data);
-static int __widget_destroy(const char *id, widget_app_destroy_type_e reason, void *data);
+static int __widget_destroy(const char *id, widget_app_destroy_type_e reason,
+               void *data);
 static int __widget_pause(const char *id, void *data);
 static int __widget_resume(const char *id, void *data);
 
-extern int app_control_create_event(bundle *data, struct app_control_s **app_control);
+extern int app_control_create_event(bundle *data,
+               struct app_control_s **app_control);
 
 static void __exit_loop(void *data)
 {
@@ -240,117 +232,94 @@ static void __do_app(enum watch_event event, void *data, bundle * b)
 {
        struct watch_priv *watch_data = data;
        app_control_h app_control = NULL;
+       int r;
 
        _ret_if(watch_data == NULL);
 
-       if (event == WE_TERMINATE)
-       {
+       if (event == WE_TERMINATE) {
                watch_data->state = WS_DYING;
-               ecore_main_loop_thread_safe_call_sync((Ecore_Data_Cb)__exit_loop, NULL);
+               ecore_main_loop_thread_safe_call_sync(
+                               (Ecore_Data_Cb)__exit_loop, NULL);
                return;
        }
 
        _ret_if(watch_data->ops == NULL);
 
-       switch (event)
-       {
-               case WE_APPCONTROL:
-                       _D("appcontrol request");
-
-                       if (app_control_create_event(b, &app_control) != 0)
-                       {
-                               _E("failed to get the app_control handle");
-                               return;
-                       }
-
-                       if (watch_data->ops->app_control)
-                               watch_data->ops->app_control(app_control, watch_data->ops->data);
-
-                       app_control_destroy(app_control);
-
-                       break;
-
-               case WE_PAUSE:
-                       _D("WE_PAUSE");
-
-                       if (watch_data->state == WS_CREATED)
-                       {
-                               _E("Invalid state");
-
-                               return;
-                       }
-
-                       // Handling the ambient mode
-                       if (watch_data->ambient_mode)
-                       {
-                               watch_data->ambient_mode_skip_resume = 1;
-                       }
+       switch (event) {
+       case WE_APPCONTROL:
+               _D("appcontrol request");
+               if (app_control_create_event(b, &app_control) != 0) {
+                       _E("failed to get the app_control handle");
+                       return;
+               }
 
-                       // Cancel the time_tick callback
-                       __watch_core_time_tick_cancel();
+               if (watch_data->ops->app_control)
+                       watch_data->ops->app_control(app_control,
+                                       watch_data->ops->data);
 
-                       if (watch_data->state == WS_RUNNING)
-                       {
+               app_control_destroy(app_control);
+               break;
+       case WE_PAUSE:
+               _D("WE_PAUSE");
+               if (watch_data->state == WS_CREATED) {
+                       _E("Invalid state");
+                       return;
+               }
 
-                               if (watch_data->ops->pause) {
-                                       int r = priv.ops->pause(priv.ops->data);
-                                       if (r < 0) {
-                                               _E("pause() fails");
-                                       }
-                               }
+               /* Handling the ambient mode */
+               if (watch_data->ambient_mode)
+                       watch_data->ambient_mode_skip_resume = 1;
+
+               /* Cancel the time_tick callback */
+               __watch_core_time_tick_cancel();
+               if (watch_data->state == WS_RUNNING) {
+                       if (watch_data->ops->pause) {
+                               r = priv.ops->pause(priv.ops->data);
+                               if (r < 0)
+                                       _E("pause() fails");
                        }
+               }
 
-                       watch_data->state = WS_PAUSED;
-                       break;
-
-               case WE_RESUME:
-                       _D("WE_RESUME");
+               watch_data->state = WS_PAUSED;
+               break;
+       case WE_RESUME:
+               _D("WE_RESUME");
 
-                       // Handling the ambient mode
-                       if (watch_data->ambient_mode)
-                       {
-                               watch_data->ambient_mode_skip_resume = 0;
-                               return;
-                       }
+               /* Handling the ambient mode */
+               if (watch_data->ambient_mode) {
+                       watch_data->ambient_mode_skip_resume = 0;
+                       return;
+               }
 
-                       if (watch_data->state == WS_PAUSED || watch_data->state == WS_CREATED)
-                       {
-                               if (watch_data->ops->resume) {
-                                       int r = priv.ops->resume(priv.ops->data);
-                                       if (r < 0) {
-                                               _E("resume() fails");
-                                       }
-                               }
+               if (watch_data->state == WS_PAUSED ||
+                               watch_data->state == WS_CREATED) {
+                       if (watch_data->ops->resume) {
+                               r = priv.ops->resume(priv.ops->data);
+                               if (r < 0)
+                                       _E("resume() fails");
                        }
 
                        watch_data->state = WS_RUNNING;
 
-                       // Set the time tick callback
-                       if (!watch_tick)
-                       {
+                       /* Set the time tick callback */
+                       if (!watch_tick) {
                                __watch_core_time_tick(NULL);
-                       }
-                       else
-                       {
+                       } else {
                                __watch_core_time_tick_cancel();
                                __watch_core_time_tick(NULL);
                        }
+               }
+               break;
+       case WE_AMBIENT:
+               _D("WE_AMBIENT");
+               if (priv.ops && priv.ops->ambient_changed)
+                       priv.ops->ambient_changed(watch_data->ambient_mode,
+                                       priv.ops->data);
 
-                       break;
-
-               case WE_AMBIENT:
-                       _D("WE_AMBIENT");
-
-                       if (priv.ops && priv.ops->ambient_changed) {
-                               priv.ops->ambient_changed(watch_data->ambient_mode, priv.ops->data);
-                       }
-
-                       break;
-
-               default:
-                       break;
+               break;
+       default:
+               break;
        }
-
 }
 
 static struct watch_ops w_ops = {
@@ -358,21 +327,18 @@ static struct watch_ops w_ops = {
        .cb_app = __do_app,
 };
 
-char* __get_domain_name(const char *appid)
+static char *__get_domain_name(const char *appid)
 {
        char *name_token = NULL;
 
-       if (appid == NULL)
-       {
+       if (appid == NULL) {
                _E("appid is NULL");
                return NULL;
        }
 
-       // com.vendor.name -> name
+       /* com.vendor.name -> name */
        name_token = strrchr(appid, '.');
-
-       if (name_token == NULL)
-       {
+       if (name_token == NULL) {
                _E("appid is invalid");
                return NULL;
        }
@@ -382,7 +348,8 @@ char* __get_domain_name(const char *appid)
        return strdup(name_token);
 }
 
-static int __set_data(struct watch_priv *watch, const char *appid, struct watchcore_ops *ops)
+static int __set_data(struct watch_priv *watch, const char *appid,
+               struct watchcore_ops *ops)
 {
        if (ops == NULL) {
                errno = EINVAL;
@@ -390,7 +357,6 @@ static int __set_data(struct watch_priv *watch, const char *appid, struct watchc
        }
 
        watch->ops = ops;
-
        watch->appid = strdup(appid);
        watch->name = __get_domain_name(appid);
        watch->pid = getpid();
@@ -398,7 +364,7 @@ static int __set_data(struct watch_priv *watch, const char *appid, struct watchc
        return 0;
 }
 
-static int __watch_appcontrol(void *data, bundle * k)
+static int __watch_appcontrol(void *data, bundle *k)
 {
        struct watch_core *wc = data;
        _retv_if(wc == NULL || wc->ops == NULL, -1);
@@ -423,22 +389,19 @@ static int __watch_terminate(void *data)
 
 static int __sys_do_default(struct watch_core *wc, enum sys_event event)
 {
-       int r;
-
        switch (event) {
        case SE_LOWBAT:
                /*r = __def_lowbatt(wc);*/
-               r = 0;
                break;
        default:
-               r = 0;
                break;
-       };
+       }
 
-       return r;
+       return 0;
 }
 
-static int __sys_do(struct watch_core *wc, void *event_info, enum sys_event event)
+static int __sys_do(struct watch_core *wc, void *event_info,
+               enum sys_event event)
 {
        struct sys_op *op;
 
@@ -547,29 +510,25 @@ static void __vconf_cb(keynode_t *key, void *data)
 {
        int i;
        const char *name;
+       struct watch_priv *watch_data = data;
+       struct evt_ops *eo;
 
        name = vconf_keynode_get_name(key);
        _ret_if(name == NULL);
 
        _D("vconf changed: %s", name);
 
-       // Check the time changed event
-       if (!strcmp(name, VCONFKEY_SYSTEM_TIME_CHANGED))
-       {
-               struct watch_priv *watch_data = data;
-
+       /* Check the time changed event */
+       if (!strcmp(name, VCONFKEY_SYSTEM_TIME_CHANGED)) {
                _D("ambient_mode: %d", watch_data->ambient_mode);
-
                if (watch_data->ambient_mode)
-               {
                        __watch_core_ambient_tick(0, NULL);
-               }
 
                return;
        }
 
        for (i = 0; i < sizeof(evtops) / sizeof(evtops[0]); i++) {
-               struct evt_ops *eo = &evtops[i];
+               eo = &evtops[i];
 
                switch (eo->type) {
                case _CB_VCONF:
@@ -588,19 +547,23 @@ static int __add_vconf(struct watch_core *wc, enum sys_event se)
 
        switch (se) {
        case SE_LOWMEM:
-               r = vconf_notify_key_changed(VCONFKEY_SYSMAN_LOW_MEMORY, __vconf_cb, wc);
+               r = vconf_notify_key_changed(VCONFKEY_SYSMAN_LOW_MEMORY,
+                               __vconf_cb, wc);
                break;
        case SE_LOWBAT:
-               r = vconf_notify_key_changed(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, __vconf_cb, wc);
+               r = vconf_notify_key_changed(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW,
+                               __vconf_cb, wc);
                break;
        case SE_LANGCHG:
                r = vconf_notify_key_changed(VCONFKEY_LANGSET, __vconf_cb, wc);
                break;
        case SE_REGIONCHG:
-               r = vconf_notify_key_changed(VCONFKEY_REGIONFORMAT, __vconf_cb, wc);
+               r = vconf_notify_key_changed(VCONFKEY_REGIONFORMAT, __vconf_cb,
+                               wc);
                break;
        case SE_TIMECHG:
-               r = vconf_notify_key_changed(VCONFKEY_SYSTEM_TIME_CHANGED, __vconf_cb, &priv);
+               r = vconf_notify_key_changed(VCONFKEY_SYSTEM_TIME_CHANGED,
+                               __vconf_cb, &priv);
                break;
        default:
                r = -1;
@@ -616,10 +579,12 @@ static int __del_vconf(enum sys_event se)
 
        switch (se) {
        case SE_LOWMEM:
-               r = vconf_ignore_key_changed(VCONFKEY_SYSMAN_LOW_MEMORY, __vconf_cb);
+               r = vconf_ignore_key_changed(VCONFKEY_SYSMAN_LOW_MEMORY,
+                               __vconf_cb);
                break;
        case SE_LOWBAT:
-               r = vconf_ignore_key_changed(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, __vconf_cb);
+               r = vconf_ignore_key_changed(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW,
+                               __vconf_cb);
                break;
        case SE_LANGCHG:
                r = vconf_ignore_key_changed(VCONFKEY_LANGSET, __vconf_cb);
@@ -628,7 +593,8 @@ static int __del_vconf(enum sys_event se)
                r = vconf_ignore_key_changed(VCONFKEY_REGIONFORMAT, __vconf_cb);
                break;
        case SE_TIMECHG:
-               r = vconf_ignore_key_changed(VCONFKEY_SYSTEM_TIME_CHANGED, __vconf_cb);
+               r = vconf_ignore_key_changed(VCONFKEY_SYSTEM_TIME_CHANGED,
+                               __vconf_cb);
                break;
        default:
                r = -1;
@@ -677,7 +643,7 @@ static int __aul_handler(aul_type type, bundle *b, void *data)
 }
 
 EXPORT_API int watch_core_set_event_callback(enum watch_core_event event,
-                                         int (*cb) (void *, void *), void *data)
+               int (*cb) (void *, void *), void *data)
 {
        struct watch_core *wc = &core;
        struct sys_op *op;
@@ -717,40 +683,38 @@ EXPORT_API int watch_core_set_event_callback(enum watch_core_event event,
        return 0;
 }
 
-static char__get_timezone(void)
+static char *__get_timezone(void)
 {
        char buf[TIMEZONE_BUFFER_MAX] = {0,};
-
-       ssize_t len = readlink(LOCAL_TIME_PATH, buf, sizeof(buf)-1);
+       ssize_t len = readlink(LOCAL_TIME_PATH, buf, sizeof(buf) - 1);
 
        if (len != -1)
-       {
                buf[len] = '\0';
-       }
-       else  // handle error condition
-       {
+       else  /* handle error condition */
                return vconf_get_str(VCONFKEY_SETAPPL_TIMEZONE_ID);
-       }
 
-       return strdup(buf+20);
+       return strdup(buf + 20);
 }
 
 static void __get_timeinfo(struct watch_time_s *timeinfo)
 {
        UErrorCode status = U_ZERO_ERROR;
-
-       // UTC time
        struct timeval current;
+       char *timezone;
+       UCalendar *cal;
+
+       /* UTC time */
        gettimeofday(&current, NULL);
        timeinfo->timestamp = current.tv_sec;
 
-       // Time zone
-       char* timezone = __get_timezone();
+       /* Time zone */
+       timezone = __get_timezone();
        UChar utf16_timezone[64] = {0};
        u_uastrncpy(utf16_timezone, timezone, 64);
 
-       // Local time
-       UCalendar *cal = ucal_open(utf16_timezone, u_strlen(utf16_timezone), uloc_getDefault(), UCAL_TRADITIONAL, &status);
+       /* Local time */
+       cal = ucal_open(utf16_timezone, u_strlen(utf16_timezone),
+                       uloc_getDefault(), UCAL_TRADITIONAL, &status);
        if (cal == NULL)
                return;
 
@@ -773,7 +737,7 @@ static void __get_timeinfo(struct watch_time_s *timeinfo)
 }
 
 int watch_core_init(const char *name, const struct watch_ops *ops,
-                               int argc, char **argv)
+               int argc, char **argv)
 {
        int r;
 
@@ -814,7 +778,7 @@ int watch_core_init(const char *name, const struct watch_ops *ops,
 
        return 0;
 
- err:
+err:
        return -1;
 }
 
@@ -823,6 +787,7 @@ static void __watch_core_alarm_init(void)
        int r = 0;
        int pid = getpid();
        char appid[APPID_BUFFER_MAX] = {0,};
+
        r = aul_app_get_appid_bypid(pid, appid, APPID_BUFFER_MAX);
        if (r < 0) {
                _E("fail to get the appid from the pid : %d", pid);
@@ -831,16 +796,14 @@ static void __watch_core_alarm_init(void)
 
        r = alarmmgr_init(appid);
        if (r < 0) {
-               _E("fail to alarmmgr_init : error_code : %d",r);
+               _E("fail to alarmmgr_init : error_code : %d", r);
                assert(0);
        }
-
 }
 
 static void __watch_core_time_tick_cancel(void)
 {
-       if (watch_tick)
-       {
+       if (watch_tick) {
                ecore_timer_del(watch_tick);
                watch_tick = NULL;
        }
@@ -848,19 +811,19 @@ static void __watch_core_time_tick_cancel(void)
 
 static Eina_Bool __watch_core_time_tick(void *data)
 {
+       struct watch_time_s timeinfo;
+       double sec;
+
        _D("state: %d", priv.state);
 
-       if (priv.ops && priv.ops->time_tick && priv.state != WS_PAUSED)
-       {
-               struct watch_time_s timeinfo;
+       if (priv.ops && priv.ops->time_tick && priv.state != WS_PAUSED) {
                __get_timeinfo(&timeinfo);
 
-               // Set a next timer
-               double sec = (ONE_SECOND - timeinfo.millisecond) / 1000.0;
+               /* Set a next timer */
+               sec = (ONE_SECOND - timeinfo.millisecond) / 1000.0;
                watch_tick = ecore_timer_add(sec, __watch_core_time_tick, NULL);
 
                _D("next time tick: %f", sec);
-
                priv.ops->time_tick(&timeinfo, priv.ops->data);
        }
 
@@ -869,28 +832,26 @@ static Eina_Bool __watch_core_time_tick(void *data)
 
 static int __watch_core_ambient_tick(alarm_id_t id, void *data)
 {
-       _D("state: %d", priv.state);
+       struct watch_time_s timeinfo;
 
-       if (priv.ops && priv.ops->ambient_tick && priv.state != WS_RUNNING)
-       {
-               struct watch_time_s timeinfo;
+       _D("state: %d", priv.state);
+       if (priv.ops && priv.ops->ambient_tick && priv.state != WS_RUNNING) {
                __get_timeinfo(&timeinfo);
-
                priv.ops->ambient_tick(&timeinfo, priv.ops->data);
        }
 
        return 0;
 }
 
-static int __widget_create(const char *id, const char *content, int w, int h, void *data)
+static int __widget_create(const char *id, const char *content, int w, int h,
+               void *data)
 {
+       int r;
        _D("widget_create");
 
-       if (priv.ops && priv.ops->create)
-       {
-               int r = priv.ops->create(w, h, priv.ops->data);
-               if (r < 0)
-               {
+       if (priv.ops && priv.ops->create) {
+               r = priv.ops->create(w, h, priv.ops->data);
+               if (r < 0) {
                        _E("Failed to initialize the application");
                        __exit_loop(NULL);
                }
@@ -900,7 +861,7 @@ static int __widget_create(const char *id, const char *content, int w, int h, vo
 
        _D("widget_create done");
 
-       // Alarm init
+       /* Alarm init */
        __watch_core_alarm_init();
 
        return WIDGET_ERROR_NONE;
@@ -912,7 +873,8 @@ static int __widget_resize(const char *id, int w, int h, void *data)
        return WIDGET_ERROR_NONE;
 }
 
-static int __widget_destroy(const char *id, widget_app_destroy_type_e reason, void *data)
+static int __widget_destroy(const char *id, widget_app_destroy_type_e reason,
+               void *data)
 {
        _D("widget_destory");
 
@@ -941,24 +903,23 @@ static int __widget_resume(const char *id, void *data)
 
 static int __signal_alpm_handler(int ambient, void *data)
 {
+       struct watch_time_s timeinfo;
+       int sec;
+       int r;
+
        _D("_signal_alpm_handler: ambient: %d, state: %d", ambient, priv.state);
 
-       if (priv.ambient_mode == ambient)
-       {
+       if (priv.ambient_mode == ambient) {
                _E("invalid state");
                return 0;
        }
 
-       // Enter the ambient mode
-       if (ambient)
-       {
-               if (priv.state != WS_PAUSED)
-               {
+       /* Enter the ambient mode */
+       if (ambient) {
+               if (priv.state != WS_PAUSED) {
                        __do_app(WE_PAUSE, &priv, NULL);
                        priv.ambient_mode_skip_resume = 0;
-               }
-               else
-               {
+               } else {
                        priv.ambient_mode_skip_resume = 1;
                }
 
@@ -966,43 +927,37 @@ static int __signal_alpm_handler(int ambient, void *data)
                __do_app(WE_AMBIENT, &priv, NULL);
 
                if (priv.ops && priv.ops->ambient_tick) {
-                       struct watch_time_s timeinfo;
                        __get_timeinfo(&timeinfo);
-
-                       int sec = ONE_MINUTE - timeinfo.second;
+                       sec = ONE_MINUTE - timeinfo.second;
 
                        _D("next time tick: %d", sec);
 
-                       // Set a next alarm
-                       int r = alarmmgr_add_alarm_withcb(ALARM_TYPE_VOLATILE, sec, 60,
-                                       __watch_core_ambient_tick, data, &alarm_id);
-                       if (r < 0) {
-                               _E("fail to alarmmgr_add_alarm_withcb : error_code : %d",r);
-                       }
+                       /* Set a next alarm */
+                       r = alarmmgr_add_alarm_withcb(ALARM_TYPE_VOLATILE, sec,
+                                       60, __watch_core_ambient_tick, data,
+                                       &alarm_id);
+                       if (r < 0)
+                               _E("fail to alarmmgr_add_alarm_withcb : "
+                                               "error_code : %d", r);
 
                        priv.ops->ambient_tick(&timeinfo, priv.ops->data);
                }
 
-               // Send a update done signal
+               /* Send a update done signal */
                _watch_core_send_alpm_update_done();
 
-       }
-       // Exit the ambient mode
-       else
-       {
+       } else { /* Exit the ambient mode */
                priv.ambient_mode = 0;
                __do_app(WE_AMBIENT, &priv, NULL);
 
                _D("Resume check: %d", priv.ambient_mode_skip_resume);
-               if (!priv.ambient_mode_skip_resume)
-               {
+               if (!priv.ambient_mode_skip_resume) {
                        _D("Call the resume after ambient mode changed");
                        __do_app(WE_RESUME, &priv, NULL);
                }
 
-               // Disable alarm
-               if (alarm_id)
-               {
+               /* Disable alarm */
+               if (alarm_id) {
                        alarmmgr_remove_alarm(alarm_id);
                        alarm_id = 0;
                }
@@ -1018,7 +973,15 @@ static void __watch_core_signal_init(void)
 
 static int __before_loop(struct watch_priv *watch, int argc, char **argv)
 {
-       int r = 0;
+       int r;
+       bundle *kb = NULL;
+       char *wayland_display = NULL;
+       char *xdg_runtime_dir = NULL;
+       char *width_str = NULL;
+       char *height_str = NULL;
+       int width = 360;
+       int height = 360;
+
 
        if (argc <= 0 || argv == NULL) {
                errno = EINVAL;
@@ -1033,13 +996,6 @@ static int __before_loop(struct watch_priv *watch, int argc, char **argv)
        g_type_init();
 #endif
 
-       bundle *kb = NULL;
-       char *wayland_display = NULL;
-       char *xdg_runtime_dir = NULL;
-       char *width_str = NULL;
-       char *height_str = NULL;
-       int width = 360;
-       int height = 360;
        kb = bundle_import_from_argv(argc, argv);
        if (kb) {
                bundle_get_str(kb, "XDG_RUNTIME_DIR", &xdg_runtime_dir);
@@ -1050,14 +1006,16 @@ static int __before_loop(struct watch_priv *watch, int argc, char **argv)
                if (xdg_runtime_dir) {
                        _E("senenv: %s", xdg_runtime_dir);
                        setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1);
-               } else
+               } else {
                        _E("failed to get xdgruntimedir");
+               }
 
                if (wayland_display) {
                        _E("setenv: %s", wayland_display);
                        setenv("WAYLAND_DISPLAY", wayland_display, 1);
-               } else
+               } else {
                        _E("failed to get waylanddisplay");
+               }
 
                if (width_str)
                        width = atoi(width_str);
@@ -1066,8 +1024,9 @@ static int __before_loop(struct watch_priv *watch, int argc, char **argv)
                        height = atoi(height_str);
 
                bundle_free(kb);
-       } else
+       } else {
                _E("failed to get launch argv");
+       }
 
        elm_init(argc, argv);
 
@@ -1099,7 +1058,6 @@ static void __after_loop(struct watch_priv *watch)
        alarmmgr_fini();
 }
 
-
 EXPORT_API int watch_core_main(const char *appid, int argc, char **argv,
                                struct watchcore_ops *ops)
 {
@@ -1140,3 +1098,4 @@ EXPORT_API const char *watch_core_get_appid()
 {
        return priv.appid;
 }
+
index 1da14fe..757c125 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
  * limitations under the License.
  */
 
-
 #include <string.h>
 #include <libintl.h>
 
 
 #define LOG_TAG "CAPI_APPFW_APPLICATION"
 
-static const charwatch_app_error_to_string(app_error_e error)
+static const char *watch_app_error_to_string(app_error_e error)
 {
-       switch (error)
-       {
+       switch (error) {
        case APP_ERROR_NONE:
                return "NONE";
-
        case APP_ERROR_INVALID_PARAMETER:
                return "INVALID_PARAMETER";
-
        case APP_ERROR_OUT_OF_MEMORY:
                return "OUT_OF_MEMORY";
-
        case APP_ERROR_INVALID_CONTEXT:
                return "INVALID_CONTEXT";
-
        case APP_ERROR_NO_SUCH_FILE:
                return "NO_SUCH_FILE";
-
        case APP_ERROR_ALREADY_RUNNING:
                return "ALREADY_RUNNING";
-
-       default :
+       default:
                return "UNKNOWN";
        }
 }
 
-int watch_app_error(app_error_e error, const char* function, const char *description)
+int watch_app_error(app_error_e error, const char *function,
+               const char *description)
 {
        if (description)
-       {
-               LOGE("[%s] %s(0x%08x) : %s", function, watch_app_error_to_string(error), error, description);
-       }
+               LOGE("[%s] %s(0x%08x) : %s", function,
+                               watch_app_error_to_string(error), error,
+                               description);
        else
-       {
-               LOGE("[%s] %s(0x%08x)", function, watch_app_error_to_string(error), error);
-       }
+               LOGE("[%s] %s(0x%08x)", function,
+                               watch_app_error_to_string(error), error);
 
        return error;
 }
+
index 6b99141..1029fdd 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
  * limitations under the License.
  */
 
-
 #include <stdlib.h>
 
 #include <bundle.h>
@@ -22,7 +21,6 @@
 #include <dlog.h>
 #include <app_common.h>
 #include <app_control.h>
-
 #include <Eina.h>
 #include <Evas.h>
 #include <Elementary.h>
 
 #define LOG_TAG "CAPI_WATCH_APPLICATION"
 
-#define WATCH_ID                       "internal://WATCH_ID"
+#define WATCH_ID "internal://WATCH_ID"
 
 typedef enum {
-       WATCH_APP_STATE_NOT_RUNNING, // The application has been launched or was running but was terminated
-       WATCH_APP_STATE_CREATING, // The application is initializing the resources on watch_app_create_cb callback
-       WATCH_APP_STATE_RUNNING, // The application is running in the foreground and background
+       WATCH_APP_STATE_NOT_RUNNING, /* The application has been launched or was running but was terminated */
+       WATCH_APP_STATE_CREATING, /* The application is initializing the resources on watch_app_create_cb callback */
+       WATCH_APP_STATE_RUNNING, /* The application is running in the foreground and background */
 } watch_app_state_e;
 
 typedef struct {
@@ -55,8 +53,7 @@ typedef struct {
 
 typedef watch_app_context_s *watch_app_context_h;
 
-struct _watch_time_s
-{
+struct _watch_time_s {
        int year;
        int month;
        int day_of_week;
@@ -70,7 +67,6 @@ struct _watch_time_s
        char *timezone;
 };
 
-
 #define WATCH_APP_EVENT_MAX 5
 static Eina_List *handler_list[WATCH_APP_EVENT_MAX] = {NULL, };
 static int _initialized = 0;
@@ -154,7 +150,8 @@ static int _watch_core_lang_changed(void *event_info, void *data)
        event.type = APP_EVENT_LANGUAGE_CHANGED;
        event.value = event_info;
 
-       EINA_LIST_FOREACH(handler_list[APP_EVENT_LANGUAGE_CHANGED], l, handler) {
+       EINA_LIST_FOREACH(handler_list[APP_EVENT_LANGUAGE_CHANGED], l,
+                       handler) {
                handler->cb(&event, handler->data);
        }
 
@@ -172,51 +169,60 @@ static int _watch_core_region_changed(void *event_info, void *data)
        event.type = APP_EVENT_REGION_FORMAT_CHANGED;
        event.value = event_info;
 
-       EINA_LIST_FOREACH(handler_list[APP_EVENT_REGION_FORMAT_CHANGED], l, handler) {
+       EINA_LIST_FOREACH(handler_list[APP_EVENT_REGION_FORMAT_CHANGED], l,
+                       handler) {
                handler->cb(&event, handler->data);
        }
 
        return APP_ERROR_NONE;
 }
 
-static void _watch_core_set_appcore_event_cb(struct watch_app_context *app_context)
+static void _watch_core_set_appcore_event_cb(
+               struct watch_app_context *app_context)
 {
-       watch_core_set_event_callback(WATCH_CORE_EVENT_LOW_MEMORY, _watch_core_low_memory, app_context);
-       watch_core_set_event_callback(WATCH_CORE_EVENT_LANG_CHANGE, _watch_core_lang_changed, app_context);
-       watch_core_set_event_callback(WATCH_CORE_EVENT_REGION_CHANGE, _watch_core_region_changed, app_context);
+       watch_core_set_event_callback(WATCH_CORE_EVENT_LOW_MEMORY,
+                       _watch_core_low_memory, app_context);
+       watch_core_set_event_callback(WATCH_CORE_EVENT_LANG_CHANGE,
+                       _watch_core_lang_changed, app_context);
+       watch_core_set_event_callback(WATCH_CORE_EVENT_REGION_CHANGE,
+                       _watch_core_region_changed, app_context);
 
        if (eina_list_count(handler_list[APP_EVENT_LOW_BATTERY]) > 0)
-               watch_core_set_event_callback(WATCH_CORE_EVENT_LOW_BATTERY, _watch_core_low_battery, app_context);
+               watch_core_set_event_callback(WATCH_CORE_EVENT_LOW_BATTERY,
+                               _watch_core_low_battery, app_context);
 }
 
 static void _watch_core_unset_appcore_event_cb(void)
 {
        watch_core_set_event_callback(WATCH_CORE_EVENT_LOW_MEMORY, NULL, NULL);
        watch_core_set_event_callback(WATCH_CORE_EVENT_LANG_CHANGE, NULL, NULL);
-       watch_core_set_event_callback(WATCH_CORE_EVENT_REGION_CHANGE, NULL, NULL);
+       watch_core_set_event_callback(WATCH_CORE_EVENT_REGION_CHANGE, NULL,
+                       NULL);
 
        if (eina_list_count(handler_list[APP_EVENT_LOW_BATTERY]) > 0)
-               watch_core_set_event_callback(WATCH_CORE_EVENT_LOW_BATTERY, NULL, NULL);
+               watch_core_set_event_callback(WATCH_CORE_EVENT_LOW_BATTERY,
+                               NULL, NULL);
 }
 
 static int _watch_core_create(int w, int h, void *data)
 {
-       _W("_watch_core_create");
        struct watch_app_context *app_context = data;
        watch_app_create_cb create_cb;
 
-       if (app_context == NULL) {
-               return watch_app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, NULL);
-       }
+       _W("_watch_core_create");
+
+       if (app_context == NULL)
+               return watch_app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__,
+                               NULL);
 
        watch_core_initialized = 1;
        _watch_core_set_appcore_event_cb(app_context);
 
        create_cb = app_context->callback->create;
 
-       if (create_cb == NULL || create_cb(w, h, app_context->data) == false) {
-               return watch_app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "watch_app_create_cb() returns false");
-       }
+       if (create_cb == NULL || create_cb(w, h, app_context->data) == false)
+               return watch_app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__,
+                               "watch_app_create_cb() returns false");
 
        app_context->state = WATCH_APP_STATE_RUNNING;
 
@@ -225,12 +231,14 @@ static int _watch_core_create(int w, int h, void *data)
 
 static int _watch_core_control(app_control_h app_control, void *data)
 {
-       _W("_watch_core_control");
        struct watch_app_context *app_context = data;
        watch_app_control_cb app_control_cb;
 
+       _W("_watch_core_control");
+
        if (app_context == NULL)
-               return watch_app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__,
+                               NULL);
 
        app_control_cb = app_context->callback->app_control;
 
@@ -242,12 +250,14 @@ static int _watch_core_control(app_control_h app_control, void *data)
 
 static int _watch_core_pause(void *data)
 {
-       _W("_watch_core_pause");
        struct watch_app_context *app_context = data;
        watch_app_pause_cb pause_cb;
 
+       _W("_watch_core_pause");
+
        if (app_context == NULL)
-               return watch_app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__,
+                               NULL);
 
        pause_cb = app_context->callback->pause;
 
@@ -259,12 +269,14 @@ static int _watch_core_pause(void *data)
 
 static int _watch_core_resume(void *data)
 {
-       _W("_watch_core_resume");
        struct watch_app_context *app_context = data;
        watch_app_resume_cb resume_cb;
 
+       _W("_watch_core_resume");
+
        if (app_context == NULL)
-               return watch_app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__,
+                               NULL);
 
        resume_cb = app_context->callback->resume;
 
@@ -276,12 +288,14 @@ static int _watch_core_resume(void *data)
 
 static int _watch_core_terminate(void *data)
 {
-       _W("_watch_core_terminate");
        struct watch_app_context *app_context = data;
        watch_app_terminate_cb terminate_cb;
 
+       _W("_watch_core_terminate");
+
        if (app_context == NULL)
-               return watch_app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__,
+                               NULL);
 
        terminate_cb = app_context->callback->terminate;
 
@@ -298,10 +312,11 @@ static int _watch_core_terminate(void *data)
 
 static void _watch_core_time_tick(void *watchtime, void *data)
 {
-       _I("_watch_core_time_tick");
        struct watch_app_context *app_context = data;
        watch_app_time_tick_cb time_tick_cb;
 
+       _I("_watch_core_time_tick");
+
        if (app_context == NULL)
                return;
 
@@ -313,10 +328,11 @@ static void _watch_core_time_tick(void *watchtime, void *data)
 
 static void _watch_core_ambient_tick(void *watchtime, void *data)
 {
-       _W("_watch_core_ambient_tick");
        struct watch_app_context *app_context = data;
        watch_app_ambient_tick_cb ambient_tick_cb;
 
+       _W("_watch_core_ambient_tick");
+
        if (app_context == NULL)
                return;
 
@@ -328,10 +344,11 @@ static void _watch_core_ambient_tick(void *watchtime, void *data)
 
 static void _watch_core_ambient_changed(int ambient, void *data)
 {
-       _W("_watch_core_ambient_changed: %d", ambient);
        struct watch_app_context *app_context = data;
        watch_app_ambient_changed_cb ambient_changed_cb;
 
+       _W("_watch_core_ambient_changed: %d", ambient);
+
        if (app_context == NULL)
                return;
 
@@ -342,7 +359,8 @@ static void _watch_core_ambient_changed(int ambient, void *data)
 }
 
 
-EXPORT_API int watch_app_main(int argc, char **argv, watch_app_lifecycle_callback_s *callback, void *user_data)
+EXPORT_API int watch_app_main(int argc, char **argv,
+               watch_app_lifecycle_callback_s *callback, void *user_data)
 {
        struct watch_app_context app_context = {
                .appid = NULL,
@@ -364,16 +382,22 @@ EXPORT_API int watch_app_main(int argc, char **argv, watch_app_lifecycle_callbac
        };
 
        if (argc <= 0 || argv == NULL || callback == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        if (callback->create == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "watch_app_create_cb() callback must be registered");
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__,
+                               "watch_app_create_cb() callback must be "
+                               "registered");
 
        if (app_context.state != WATCH_APP_STATE_NOT_RUNNING)
-               return watch_app_error(APP_ERROR_ALREADY_RUNNING, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_ALREADY_RUNNING, __FUNCTION__,
+                               NULL);
 
        if (app_get_id(&(app_context.appid)) != APP_ERROR_NONE)
-               return watch_app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, "failed to get the appid");
+               return watch_app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__,
+                               "failed to get the appid");
 
        app_context.state = WATCH_APP_STATE_CREATING;
 
@@ -390,7 +414,9 @@ EXPORT_API void watch_app_exit(void)
        watch_core_terminate();
 }
 
-EXPORT_API int watch_app_add_event_handler(app_event_handler_h *event_handler, app_event_type_e event_type, app_event_cb callback, void *user_data)
+EXPORT_API int watch_app_add_event_handler(app_event_handler_h *event_handler,
+               app_event_type_e event_type, app_event_cb callback,
+               void *user_data)
 {
        app_event_handler_h handler;
        Eina_List *l_itr;
@@ -401,19 +427,24 @@ EXPORT_API int watch_app_add_event_handler(app_event_handler_h *event_handler, a
        }
 
        if (event_handler == NULL || callback == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
-       if (event_type < APP_EVENT_LOW_MEMORY || event_type > APP_EVENT_REGION_FORMAT_CHANGED)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+       if (event_type < APP_EVENT_LOW_MEMORY ||
+                       event_type > APP_EVENT_REGION_FORMAT_CHANGED)
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        EINA_LIST_FOREACH(handler_list[event_type], l_itr, handler) {
                if (handler->cb == callback)
-                       return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+                       return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                                       __FUNCTION__, NULL);
        }
 
        handler = calloc(1, sizeof(struct app_event_handler));
        if (!handler)
-               return watch_app_error(APP_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_OUT_OF_MEMORY, __FUNCTION__,
+                               NULL);
 
        handler->type = event_type;
        handler->cb = callback;
@@ -422,9 +453,11 @@ EXPORT_API int watch_app_add_event_handler(app_event_handler_h *event_handler, a
        if (watch_core_initialized
                        && event_type == APP_EVENT_LOW_BATTERY
                        && eina_list_count(handler_list[event_type]) == 0)
-               watch_core_set_event_callback(WATCH_CORE_EVENT_LOW_BATTERY, _watch_core_low_battery, NULL);
+               watch_core_set_event_callback(WATCH_CORE_EVENT_LOW_BATTERY,
+                               _watch_core_low_battery, NULL);
 
-       handler_list[event_type] = eina_list_append(handler_list[event_type], handler);
+       handler_list[event_type] = eina_list_append(handler_list[event_type],
+                       handler);
 
        *event_handler = handler;
 
@@ -439,7 +472,8 @@ EXPORT_API int watch_app_remove_event_handler(app_event_handler_h event_handler)
        Eina_List *l_next;
 
        if (event_handler == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        if (!_initialized) {
                _I("handler list is not initialized");
@@ -447,36 +481,44 @@ EXPORT_API int watch_app_remove_event_handler(app_event_handler_h event_handler)
        }
 
        type = event_handler->type;
-       if (type < APP_EVENT_LOW_MEMORY || type > APP_EVENT_REGION_FORMAT_CHANGED)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+       if (type < APP_EVENT_LOW_MEMORY ||
+                       type > APP_EVENT_REGION_FORMAT_CHANGED)
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        EINA_LIST_FOREACH_SAFE(handler_list[type], l_itr, l_next, handler) {
                if (handler == event_handler) {
                        free(handler);
-                       handler_list[type] = eina_list_remove_list(handler_list[type], l_itr);
+                       handler_list[type] = eina_list_remove_list(
+                                       handler_list[type], l_itr);
 
                        if (watch_core_initialized
-                                       && type == APP_EVENT_LOW_BATTERY
-                                       && eina_list_count(handler_list[type]) == 0)
-                               watch_core_set_event_callback(WATCH_CORE_EVENT_LOW_BATTERY, NULL, NULL);
+                               && type == APP_EVENT_LOW_BATTERY
+                               && eina_list_count(handler_list[type]) == 0)
+                               watch_core_set_event_callback(
+                                               WATCH_CORE_EVENT_LOW_BATTERY,
+                                               NULL, NULL);
 
                        return APP_ERROR_NONE;
                }
        }
 
-       return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "cannot find such handler");
+       return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__,
+                       "cannot find such handler");
 }
 
-EXPORT_API int watch_time_get_current_time(watch_time_hwatch_time)
+EXPORT_API int watch_time_get_current_time(watch_time_h *watch_time)
 {
-       if (watch_time == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
-
        struct watch_time_s *time_info;
 
+       if (watch_time == NULL)
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
+
        time_info = calloc(1, sizeof(struct watch_time_s));
        if (time_info == NULL)
-               return watch_app_error(APP_ERROR_OUT_OF_MEMORY, __FUNCTION__, "failed to create a handle");
+               return watch_app_error(APP_ERROR_OUT_OF_MEMORY, __FUNCTION__,
+                               "failed to create a handle");
 
        watch_core_get_timeinfo(time_info);
 
@@ -488,7 +530,8 @@ EXPORT_API int watch_time_get_current_time(watch_time_h* watch_time)
 EXPORT_API int watch_time_delete(watch_time_h watch_time)
 {
        if (watch_time == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        if (watch_time->timezone)
                free(watch_time->timezone);
@@ -501,7 +544,8 @@ EXPORT_API int watch_time_delete(watch_time_h watch_time)
 EXPORT_API int watch_time_get_year(watch_time_h watch_time, int *year)
 {
        if (watch_time == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        *year = watch_time->year;
        return APP_ERROR_NONE;
@@ -510,7 +554,8 @@ EXPORT_API int watch_time_get_year(watch_time_h watch_time, int *year)
 EXPORT_API int watch_time_get_month(watch_time_h watch_time, int *month)
 {
        if (watch_time == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        *month = watch_time->month;
        return APP_ERROR_NONE;
@@ -519,16 +564,19 @@ EXPORT_API int watch_time_get_month(watch_time_h watch_time, int *month)
 EXPORT_API int watch_time_get_day(watch_time_h watch_time, int *day)
 {
        if (watch_time == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        *day = watch_time->day;
        return APP_ERROR_NONE;
 }
 
-EXPORT_API int watch_time_get_day_of_week(watch_time_h watch_time, int *day_of_week)
+EXPORT_API int watch_time_get_day_of_week(watch_time_h watch_time,
+               int *day_of_week)
 {
        if (watch_time == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        *day_of_week = watch_time->day_of_week;
        return APP_ERROR_NONE;
@@ -537,7 +585,8 @@ EXPORT_API int watch_time_get_day_of_week(watch_time_h watch_time, int *day_of_w
 EXPORT_API int watch_time_get_hour(watch_time_h watch_time, int *hour)
 {
        if (watch_time == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        *hour = watch_time->hour;
        return APP_ERROR_NONE;
@@ -546,7 +595,8 @@ EXPORT_API int watch_time_get_hour(watch_time_h watch_time, int *hour)
 EXPORT_API int watch_time_get_hour24(watch_time_h watch_time, int *hour24)
 {
        if (watch_time == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        *hour24 = watch_time->hour24;
        return APP_ERROR_NONE;
@@ -555,7 +605,8 @@ EXPORT_API int watch_time_get_hour24(watch_time_h watch_time, int *hour24)
 EXPORT_API int watch_time_get_minute(watch_time_h watch_time, int *minute)
 {
        if (watch_time == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        *minute = watch_time->minute;
        return APP_ERROR_NONE;
@@ -564,47 +615,59 @@ EXPORT_API int watch_time_get_minute(watch_time_h watch_time, int *minute)
 EXPORT_API int watch_time_get_second(watch_time_h watch_time, int *second)
 {
        if (watch_time == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        *second = watch_time->second;
        return APP_ERROR_NONE;
 }
 
-EXPORT_API int watch_time_get_millisecond(watch_time_h watch_time, int *millisecond)
+EXPORT_API int watch_time_get_millisecond(watch_time_h watch_time,
+               int *millisecond)
 {
        if (watch_time == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        *millisecond = watch_time->millisecond;
        return APP_ERROR_NONE;
 }
 
-EXPORT_API int watch_time_get_utc_time(watch_time_h watch_time, struct tm *utc_time)
+EXPORT_API int watch_time_get_utc_time(watch_time_h watch_time,
+               struct tm *utc_time)
 {
+       time_t timestamp;
+
        if (watch_time == NULL || utc_time == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
-       time_t timestamp = watch_time->timestamp;
+       timestamp = watch_time->timestamp;
 
        gmtime_r(&timestamp, utc_time);
 
        return APP_ERROR_NONE;
 }
 
-EXPORT_API int watch_time_get_utc_timestamp(watch_time_h watch_time, time_t *utc_timestamp)
+EXPORT_API int watch_time_get_utc_timestamp(watch_time_h watch_time,
+               time_t *utc_timestamp)
 {
        if (watch_time == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        *utc_timestamp = watch_time->timestamp;
 
        return APP_ERROR_NONE;
 }
 
-EXPORT_API int watch_time_get_time_zone(watch_time_h watch_time, char **time_zone_id)
+EXPORT_API int watch_time_get_time_zone(watch_time_h watch_time,
+               char **time_zone_id)
 {
-       if (watch_time == NULL || watch_time->timezone == NULL || time_zone_id == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+       if (watch_time == NULL || watch_time->timezone == NULL
+                       || time_zone_id == NULL)
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        *time_zone_id = strdup(watch_time->timezone);
 
@@ -616,11 +679,13 @@ EXPORT_API int watch_app_get_elm_win(Evas_Object **win)
        Evas_Object *ret_win;
 
        if (win == NULL)
-               return watch_app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
 
        ret_win = elm_win_add(NULL, watch_core_get_appid(), ELM_WIN_BASIC);
        if (ret_win == NULL)
-               return watch_app_error(APP_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+               return watch_app_error(APP_ERROR_OUT_OF_MEMORY, __FUNCTION__,
+                               NULL);
 
        *win = ret_win;
        return APP_ERROR_NONE;
index 65a6c04..0313f6e 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
 extern "C" {
 #endif
 
-int watch_app_error(app_error_e error, const char* function, const char *description);
+int watch_app_error(app_error_e error, const char *function,
+               const char *description);
 
 #ifdef __cplusplus
 }
 #endif
 
 #endif /* __WATCH_APP_PRIVATE_H__ */
+