Adjust coding rules
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 28 Mar 2016 04:53:36 +0000 (13:53 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 30 Mar 2016 23:37:45 +0000 (08:37 +0900)
Change-Id: If4c986183703015e54c53abd4be25a83a3589109
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
37 files changed:
alarm/alarm.c
app_common/app_error.c
app_common/app_event.c
app_common/app_finalizer.c
app_common/app_package.c
app_common/app_path.c
app_control/app_control.c
doc/appfw_alarm_doc.h
doc/appfw_app_common_doc.h
doc/appfw_app_control_doc.h
doc/appfw_app_doc.h
doc/appfw_event_doc.h
doc/appfw_i18n_doc.h
doc/appfw_preference_doc.h
doc/appfw_resource_manager_doc.h
include/app.h
include/app_alarm.h
include/app_common.h
include/app_control.h
include/app_control_internal.h
include/app_event.h
include/app_extension.h
include/app_i18n.h
include/app_internal.h
include/app_preference.h
include/app_preference_internal.h
include/app_preference_log.h
include/app_resource_manager.h
include/app_types.h
preference/preference.c
preference/preference_db.c
preference/preference_inoti.c
src/app_device.c
src/app_main.c
src/app_resource.c
src/app_resource_manager.c
src/i18n.c

index dc67d8ba0960aa4ce549d3b012399b561eb7f445..2d7863fd4223b771e62f874973629f0984f5a06e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
 
 typedef struct {
        alarm_registered_alarm_cb cb;
-       voiduser_data;
-       boolforeach_break;
+       void *user_data;
+       bool *foreach_break;
 } alarm_foreach_item_cb_context;
 
 static int alarm_registered_alarm_cb_broker(int alarm_id, void *user_data)
 {
-       alarm_foreach_item_cb_contextforeach_cb_context = NULL;
+       alarm_foreach_item_cb_context *foreach_cb_context = NULL;
 
        if (user_data == NULL)
                return 0;
 
-       foreach_cb_context = (alarm_foreach_item_cb_context*)user_data;
+       foreach_cb_context = (alarm_foreach_item_cb_context *)user_data;
 
        if (foreach_cb_context != NULL && *(foreach_cb_context->foreach_break) == false) {
                if (foreach_cb_context->cb(alarm_id, foreach_cb_context->user_data) == false)
@@ -59,7 +59,7 @@ static int alarm_registered_alarm_cb_broker(int alarm_id, void *user_data)
        return 0;
 }
 
-static int convert_error_code_to_alarm(const charfunction, alarm_error_t alarm_error)
+static int convert_error_code_to_alarm(const char *function, alarm_error_t alarm_error)
 {
        switch (alarm_error) {
        case ERR_ALARM_INVALID_PARAM:
@@ -103,7 +103,7 @@ static int convert_error_code_to_alarm(const char* function, alarm_error_t alarm
        }
 }
 
-int alarm_get_scheduled_date(int alarm_id, struct tmdate)
+int alarm_get_scheduled_date(int alarm_id, struct tm *date)
 {
        alarm_error_t result;
        time_t due_time = 0;
@@ -122,7 +122,7 @@ int alarm_get_scheduled_date(int alarm_id, struct tm* date)
        return ALARM_ERROR_NONE;
 }
 
-int alarm_get_scheduled_period(int alarm_id, intperiod)
+int alarm_get_scheduled_period(int alarm_id, int *period)
 {
        alarm_error_t result;
        alarm_entry_t *entry = NULL;
@@ -188,7 +188,7 @@ int alarm_schedule_after_delay(app_control_h app_control, int delay, int period,
 int alarm_schedule_at_date(app_control_h app_control, struct tm *date, int period_in_second, int *alarm_id)
 {
        alarm_date_t internal_time;
-       alarm_entry_talarm_info;
+       alarm_entry_t *alarm_info;
        bundle *bundle_data;
        int result;
 
@@ -269,7 +269,7 @@ int alarm_schedule_once_after_delay(app_control_h app_control, int delay, int *a
 int alarm_schedule_once_at_date(app_control_h app_control, struct tm *date, int *alarm_id)
 {
        alarm_date_t internal_time;
-       alarm_entry_talarm_info;
+       alarm_entry_t *alarm_info;
        bundle *bundle_data;
        int result;
 
@@ -344,7 +344,7 @@ int alarm_cancel_all()
        return convert_error_code_to_alarm(__FUNCTION__, result);
 }
 
-int alarm_foreach_registered_alarm(alarm_registered_alarm_cb callback, voiduser_data)
+int alarm_foreach_registered_alarm(alarm_registered_alarm_cb callback, void *user_data)
 {
        int result;
        bool foreach_break = false;
@@ -366,7 +366,7 @@ int alarm_foreach_registered_alarm(alarm_registered_alarm_cb callback, void* use
        return convert_error_code_to_alarm(__FUNCTION__, result);
 }
 
-int alarm_get_current_time(struct tmdate)
+int alarm_get_current_time(struct tm *date)
 {
        time_t now;
 
@@ -383,7 +383,7 @@ int alarm_get_current_time(struct tm* date)
 int alarm_schedule_with_recurrence_week_flag(app_control_h app_control, struct tm *date, int week_flag, int *alarm_id)
 {
        alarm_date_t internal_time;
-       alarm_entry_talarm_info;
+       alarm_entry_t *alarm_info;
        bundle *bundle_data;
        int result;
 
@@ -509,3 +509,4 @@ int alarm_get_app_control(int alarm_id, app_control_h *app_control)
 
        return ALARM_ERROR_NONE;
 }
+
index e71b7daef52a2cd3327263368238f0f1ba4f49aa..bd251224f11613617e99d19d8faa296ff28041c0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -27,7 +27,7 @@
 
 #define LOG_TAG "CAPI_APPFW_APPLICATION"
 
-static const charapp_error_to_string(app_error_e error)
+static const char *app_error_to_string(app_error_e error)
 {
        switch (error) {
        case APP_ERROR_NONE:
@@ -47,7 +47,7 @@ static const char* app_error_to_string(app_error_e error)
        }
 }
 
-int app_error(app_error_e error, const charfunction, const char *description)
+int app_error(app_error_e error, const char *function, const char *description)
 {
        if (description)
                LOGE("[%s] %s(0x%08x) : %s", function, app_error_to_string(error), error, description);
@@ -56,3 +56,4 @@ int app_error(app_error_e error, const char* function, const char *description)
 
        return error;
 }
+
index fa108b3b004d7e84cd0b7865bacb97dce30d44a8..c3676b5f27119a455475c63523d09ceb5d411c19 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -163,3 +163,4 @@ int app_event_get_suspended_state(app_event_info_h event_info, app_suspended_sta
 
        return APP_ERROR_NONE;
 }
+
index fc8f967ea44289d074430e00c674e1278c5a7562..2e840ea42789dfbcb3c790381cdaac8c2e652002 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -97,3 +97,4 @@ void app_finalizer_execute(void)
 
        finalizer_head.next = NULL;
 }
+
index eb8c9734651cd924c8532f593eeeb39803ba837e..8a7cbfa41b15bcee6da48ac0b0ad253022473dd5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -171,4 +171,3 @@ int app_get_version(char **version)
        return APP_ERROR_NONE;
 }
 
-
index 17ad228015d8152e42b92ce358ae3d57be022b68..39f640d1f7edaa643e30ddd4e1d8a4dbd5feb03b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014 - 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.
@@ -91,3 +91,4 @@ char *app_get_tep_resource_path(void)
        const char *buf = aul_get_app_tep_resource_path();
        return _STRDUP(buf);
 }
+
index ff9d3d12b4b1f1b406541689b699819f859e7912..0d6b5bef5ec90ce6a8ecf10567cf08e52d0d96cc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -77,7 +77,7 @@ extern int appsvc_allow_transient_app(bundle *b, unsigned int id);
 extern int appsvc_request_transient_app(bundle *b, unsigned int callee_id, appsvc_host_res_fn cbfunc, void *data);
 static int app_control_create_reply(bundle *data, struct app_control_s **app_control);
 
-static const charapp_control_error_to_string(app_control_error_e error)
+static const char *app_control_error_to_string(app_control_error_e error)
 {
        switch (error) {
        case APP_CONTROL_ERROR_NONE:
@@ -109,7 +109,7 @@ static const char* app_control_error_to_string(app_control_error_e error)
        }
 }
 
-int app_control_error(app_control_error_e error, const charfunction, const char *description)
+int app_control_error(app_control_error_e error, const char *function, const char *description)
 {
        if (description)
                LOGE("[%s] %s(0x%08x) : %s", function, app_control_error_to_string(error), error, description);
@@ -799,7 +799,7 @@ static bool app_control_copy_reply_data_cb(app_control_h app_control, const char
 
        if (appsvc_data_is_array(app_control->data, key)) {
                app_control_get_extra_data_array(app_control, key, &value_array, &value_array_length);
-               appsvc_add_data_array(reply_data, key, (const char**)value_array, value_array_length);
+               appsvc_add_data_array(reply_data, key, (const char **)value_array, value_array_length);
 
                for (value_array_index = 0; value_array_index < value_array_length; value_array_index++)
                        free(value_array[value_array_index]);
@@ -962,7 +962,7 @@ int app_control_get_extra_data_array(app_control_h app_control, const char *key,
                        return app_control_error(APP_CONTROL_ERROR_KEY_NOT_FOUND, __FUNCTION__, NULL);
        }
 
-       array_data_clone = calloc(array_data_length, sizeof(char*));
+       array_data_clone = calloc(array_data_length, sizeof(char *));
        if (array_data_clone == NULL)
                return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
 
@@ -996,19 +996,19 @@ int app_control_is_extra_data_array(app_control_h app_control, const char *key,
 typedef struct {
        app_control_h app_control;
        app_control_extra_data_cb callback;
-       voiduser_data;
+       void *user_data;
        bool foreach_break;
 } foreach_context_extra_data_t;
 
 static void app_control_cb_broker_bundle_iterator(const char *key, const int type, const bundle_keyval_t *kv, void *user_data)
 {
-       foreach_context_extra_data_tforeach_context = NULL;
+       foreach_context_extra_data_t *foreach_context = NULL;
        app_control_extra_data_cb extra_data_cb;
 
        if (key == NULL || !(type == BUNDLE_TYPE_STR || type == BUNDLE_TYPE_STR_ARRAY))
                return;
 
-       foreach_context = (foreach_context_extra_data_t*)user_data;
+       foreach_context = (foreach_context_extra_data_t *)user_data;
        if (foreach_context->foreach_break == true)
                return;
 
@@ -1046,7 +1046,7 @@ int app_control_foreach_extra_data(app_control_h app_control, app_control_extra_
 typedef struct {
        app_control_h app_control;
        app_control_app_matched_cb callback;
-       voiduser_data;
+       void *user_data;
        bool foreach_break;
 } foreach_context_launchable_app_t;
 
@@ -1060,7 +1060,7 @@ int app_control_cb_broker_foreach_app_matched(const char *package, void *data)
                return -1;
        }
 
-       foreach_context = (foreach_context_launchable_app_t*)data;
+       foreach_context = (foreach_context_launchable_app_t *)data;
        if (foreach_context->foreach_break == true)
                return -1;
 
@@ -1198,3 +1198,4 @@ int app_control_enable_app_started_result_event(app_control_h app_control)
 
        return APP_CONTROL_ERROR_NONE;
 }
+
index 35043368dd3ecd159428ae3ec35ed1da04e12a06..7295c89ea72426c36f6d4e5df7f25d1dd218ca3c 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
  * There are 3 ways to set an alarm.
  * <table>
  * <tr>
- *    <th>FUNCTION</th>
- *    <th>DESCRIPTION </th>
+ * <th>FUNCTION</th>
+ * <th>DESCRIPTION</th>
  * </tr>
  * <tr>
- *     <td>alarm_schedule_once_after_delay()</td>
- *     <td>Sets an alarm to be triggered at specific time once</td>
+ * <td>alarm_schedule_once_after_delay()</td>
+ * <td>Sets an alarm to be triggered at specific time once</td>
  * </tr>
  * <tr>
- *     <td>alarm_schedule_once_at_date()</td>
- *     <td>Sets an alarm to be triggered after specific delay once</td>
+ * <td>alarm_schedule_once_at_date()</td>
+ * <td>Sets an alarm to be triggered after specific delay once</td>
  * </tr>
  * <tr>
- *     <td>alarm_schedule_with_recurrence_week_flag()</td>
- *     <td>Sets an alarm to be triggered at specific time with recurrent days of the week(can repeat on days of the week)</td>
+ * <td>alarm_schedule_with_recurrence_week_flag()</td>
+ * <td>Sets an alarm to be triggered at specific time with recurrent days of the week(can repeat on days of the week)</td>
  * </tr>
  * <tr>
- *     <td>alarm_schedule_after_delay()</td>
- *     <td>Sets an alarm to be triggered after specific time(Since 2.4, this api does not support exact period and delay for minimizing the wakeups of the device. The system can adjust when the alarm expires.)</td>
+ * <td>alarm_schedule_after_delay()</td>
+ * <td>Sets an alarm to be triggered after specific time(Since 2.4, this api does not support exact period and delay for minimizing the wakeups of the device. The system can adjust when the alarm expires.)</td>
  * </tr>
  * </table>
  * \n
@@ -63,3 +63,4 @@
  */
 
 #endif /* __TIZEN_APPFW_ALARM_DOC_H__ */
+
index d91cd2090cd67060fbeaf5feb9397da9d4c14c67..42ca620f7640fdf72c27749655cb38055a5a2228 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014 - 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.
@@ -82,3 +82,4 @@
  */
 
 #endif /* __TIZEN_APPFW_APP_COMMON_DOC_H__ */
+
index 150dda07cb1cb2602d0146f02f586bf8770ef8fc..6f5b199f785fec59788d244e9f1d533038288fd9 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -32,3 +32,4 @@
  */
 
 #endif /* __TIZEN_APPFW_APP_CONTROL_DOC_H__ */
+
index 6da6facce270b74837d920219547cdd79376ce03..6f1601ebf92cb1a7bc8ecdf54b722752684d79f6 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
 */
 
 #endif /* __TIZEN_APPFW_APP_DOC_H__ */
+
index eebf48f7a9eed20748df2bf62b4b453e93a8b076..d9205b2e5795242579ca1eddf0df41acd31a9e2c 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.
  */
 
 #endif /* __TIZEN_APPFW_EVENT_DOC_H__ */
+
index 8b874f3c9f7b713e40dda2e6eeaf7cd6d12957ea..cd7bd585064ab47707121069d15b23618766a5d0 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -43,3 +43,4 @@
 
 
 #endif /* __TIZEN_APPFW_I18N_DOC_H__ */
+
index 2b04552f6f99c3c61782b42fe9f879c1b9cea043..3b1042da1618aba0bac146430ca01c85f2178843 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -42,3 +42,4 @@
  */
 
 #endif /* __TIZEN_APPFW_PREFERENCE_DOC_H__ */
+
index 8f45226dbd368ded76cd38bd4063506bd5eacfd6..0458c3623f07209ebd1790d54a07947d14cc414a 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.
@@ -79,3 +79,4 @@
  */
 
 #endif /* __TIZEN_APPFW_APP_RESOURCE_MANAGER_DOC_H__ */
+
index be26f5c160070f61411a98db89106790173cda55..f9304b4aed2082b0f28d2eef524d04282aeb745a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -232,3 +232,4 @@ int ui_app_remove_event_handler(app_event_handler_h event_handler);
 }
 #endif
 #endif /* __TIZEN_APPFW_APP_H__ */
+
index c8e736d5884750f0f490edc9c36f13c5353eeaf8..c29862a22d2cd4b43811a686f86e6db485ff90dd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -250,7 +250,7 @@ int alarm_schedule_once_at_date(app_control_h app_control, struct tm *date, int
  * @see alarm_get_scheduled_date()
  * @see        #alarm_week_flag_e
  */
-int alarm_schedule_with_recurrence_week_flag(app_control_h app_control, struct tm *date, int week_flag,int *alarm_id);
+int alarm_schedule_with_recurrence_week_flag(app_control_h app_control, struct tm *date, int week_flag, int *alarm_id);
 
 
 /**
index c990e82f065470c7ae6e4a7a02950f85f1dfaa50..0041666268108f997f1a76f3b0edcce3e0943838 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014 - 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.
@@ -96,7 +96,7 @@ typedef enum {
  * @see app_remove_event_handler
  * @see app_event_info_h
  */
-typedef struct app_event_handlerapp_event_handler_h;
+typedef struct app_event_handler *app_event_handler_h;
 
 
 /**
@@ -110,7 +110,7 @@ typedef struct app_event_handler* app_event_handler_h;
  * @see app_event_get_device_orientation
  * @see app_event_get_suspended_state
  */
-typedef struct app_event_infoapp_event_info_h;
+typedef struct app_event_info *app_event_info_h;
 
 
 /**
@@ -475,3 +475,4 @@ char *app_get_tep_resource_path(void);
 #endif
 
 #endif /* __TIZEN_APPFW_APP_H__ */
+
index 84d955e315dc28ef587b05be8e78ef7c99ee68da..b8d65bc367eb3d520c66810d95cde024e2dcd83d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014 - 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.
@@ -41,7 +41,7 @@ typedef unsigned char bundle_raw;
  * @brief App Control handle.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  */
-typedef struct app_control_sapp_control_h;
+typedef struct app_control_s *app_control_h;
 
 
 /**
@@ -1126,3 +1126,4 @@ int app_control_unset_defapp(const char *app_id);
 #endif
 
 #endif /* __TIZEN_APPFW_APP_CONTROL_H__ */
+
index 54502c29993e41a7db804032dc85aeb69d480a3b..ec620fa1631dd9870743f85b1aa582e1a42cadf8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014 - 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.
@@ -162,3 +162,4 @@ int app_control_request_transient_app(app_control_h app_control, unsigned int ca
 #endif
 
 #endif /* __TIZEN_APPFW_APP_CONTROL_INTERNAL_H__ */
+
index a4a45cb5f8b4e144b862ded4c081abce73acd096..722ae9d63e915781e3821986928d0cab632614a7 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.
@@ -38,7 +38,7 @@ extern "C" {
  * @brief Event handle.
  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
  */
-typedef struct event_handlerevent_handler_h;
+typedef struct event_handler *event_handler_h;
 
 /**
  * @brief Event callback.
@@ -898,3 +898,4 @@ int event_publish_trusted_app_event(const char *event_name, bundle *event_data);
 #endif
 
 #endif /* __TIZEN_APPFW_EVENT_H__ */
+
index 05cb2eed8695a7c73c0c5931fa4f0945d811db60..a66852fdf75493b53e5869e8ede97f87890c4801 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -62,3 +62,4 @@ void *app_get_preinitialized_conformant(void);
 #endif
 
 #endif /* __TIZEN_APPFW_APP_EXTENSION_H__ */
+
index 69e0ce7e0a341f85de4a671688063d39e99c2efe..4dfbf7ec0c543866e841b405f28eac4238f6a019 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -54,7 +54,7 @@ extern "C"
  * @return  The localized translation for the given @a message on success,
  *          otherwise the given @a message
  */
-chari18n_get_text(const char *message);
+char *i18n_get_text(const char *message);
 
 /**
  * @}
@@ -65,3 +65,4 @@ char* i18n_get_text(const char *message);
 #endif
 
 #endif /* __TIZEN_APPFW_I18N_H__ */
+
index 8380602cc725e87ddf91b5477cc3d92c8ac76043..66f0520174fed37654266f6e127927bd02a09b9f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -57,7 +57,7 @@ app_device_orientation_e app_convert_appcore_rm(enum appcore_rm rm);
 
 typedef void (*app_finalizer_cb) (void *data);
 
-int app_error(app_error_e error, const charfunction, const char *description);
+int app_error(app_error_e error, const char *function, const char *description);
 
 app_device_orientation_e app_convert_appcore_rm(enum appcore_rm rm);
 
@@ -262,3 +262,4 @@ void app_efl_exit(void);
 #endif
 
 #endif /* __TIZEN_APPFW_APP_INTERNAL_H__ */
+
index 01e01365893d07bfca973a4d6df169f7deb00fe0..fb37afd4b7ebc06a025a3e416987d07a3d993b2c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -324,3 +324,4 @@ int preference_foreach_item(preference_item_cb callback, void *user_data);
 #endif
 
 #endif /* __TIZEN_APPFW_PREFERENCE_H__ */
+
index 12706edd280dcf02ed33012fd2a91bc36395f681..8cafdcb9ecc5d2639c6545eca8e4d3fe5de181fd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -29,7 +29,7 @@ extern "C" {
 #define PREF_DIR       ".pref/"
 
 #define PREFERENCE_KEY_PATH_LEN        1024
-#define ERR_LEN                        128
+#define ERR_LEN                        1024
 
 #define PREF_DB_NAME           ".pref.db"
 #define PREF_TBL_NAME          "pref"
@@ -149,3 +149,4 @@ inline void _preference_keynode_free(keynode_t *keynode);
 #endif
 
 #endif /* __TIZEN_APPFW_PREFERENCE_INTERNAL_H__ */
+
index 8bd87a7ad119c881ccf1092a854d9d7907cdca11..5aa8144072841b28152e6f3f18146b1e5500e0e9 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.
@@ -90,3 +90,4 @@
 
 
 #endif                         /* __PREFERENCE_LOG_H__ */
+
index 8e1632174ea0829dce4ab17bdf06fa15e6373aa8..d282459e93c06dc9588d080a16fd796b1557d6d8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -97,7 +97,7 @@ int app_resource_manager_get(app_resource_e type, const char *id, char **path);
  *
  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
  * @remarks Please make sure that the instance of resource manager should be released when the application is closing only.
- *                     It is highly recommended way to improve run-time performance.
+ *          It is highly recommended way to improve run-time performance.
  * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #APP_RESOURCE_ERROR_NONE Successful
index 0ca857553df6abd8df8b20179d37cf20e79c36e3..391aa8a94a8b448751f58fe8703dba7697f9ff8c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -50,3 +50,4 @@ typedef enum {
  */
 
 #endif /* __TIZEN_APPFW_APP_TYPES_H__ */
+
index e4a2fde2b3799d830629778d5230e79eecd683e6..fa96f8749a7d1b91791d2117883e3db102e932a3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -84,7 +84,7 @@ int init_time(void)
 }
 #endif
 
-char_preference_get_pref_dir_path()
+char *_preference_get_pref_dir_path()
 {
        char *app_data_path = NULL;
 
@@ -219,7 +219,7 @@ int _preference_get_key_path(keynode_t *keynode, char *path)
                return PREFERENCE_ERROR_IO_ERROR;
        }
 
-       key = (const char*)convert_key;
+       key = (const char *)convert_key;
 
        snprintf(path, PATH_MAX-1, "%s%s", pref_dir_path, key);
 
@@ -232,6 +232,7 @@ static int _preference_set_key_check_pref_dir()
 {
        char *pref_dir_path = NULL;
        mode_t dir_mode = 0664 | 0111;
+       char err_buf[ERR_LEN] = {0,};
 
        pref_dir_path = _preference_get_pref_dir_path();
        if (!pref_dir_path) {
@@ -241,7 +242,6 @@ static int _preference_set_key_check_pref_dir()
 
        if (access(pref_dir_path, F_OK) < 0) {
                if (mkdir(pref_dir_path, dir_mode) < 0) {
-                       char err_buf[ERR_LEN] = {0,};
                        strerror_r(errno, err_buf, sizeof(err_buf));
                        ERR("mkdir() failed(%d/%s)", errno, err_buf);
                        return PREFERENCE_ERROR_IO_ERROR;
@@ -251,16 +251,17 @@ static int _preference_set_key_check_pref_dir()
        return PREFERENCE_ERROR_NONE;
 }
 
-static int _preference_set_key_creation(const charpath)
+static int _preference_set_key_creation(const char *path)
 {
        int fd;
        mode_t temp;
+       char err_buf[ERR_LEN] = {0,};
+
        temp = umask(0000);
        fd = open(path, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
        umask(temp);
 
        if (fd == -1) {
-               char err_buf[ERR_LEN] = {0,};
                strerror_r(errno, err_buf, sizeof(err_buf));
                ERR("open(rdwr,create) error: %d(%s)", errno, err_buf);
                return PREFERENCE_ERROR_IO_ERROR;
@@ -351,13 +352,14 @@ static void _preference_log_subject_label(void)
 static int _preference_check_retry_err(keynode_t *keynode, int preference_errno, int io_errno, int op_type)
 {
        int is_busy_err = 0;
+       int rc = 0;
+       char path[PATH_MAX] = {0,};
+       char err_buf[ERR_LEN] = {0,};
 
        if (preference_errno == PREFERENCE_ERROR_FILE_OPEN) {
                switch (io_errno) {
                case ENOENT:
                        if (op_type == PREFERENCE_OP_SET) {
-                               int rc = 0;
-                               char path[PATH_MAX] = {0,};
                                rc = _preference_get_key_path(keynode, path);
                                if (rc != PREFERENCE_ERROR_NONE) {
                                        ERR("_preference_get_key_path error");
@@ -425,10 +427,9 @@ static int _preference_check_retry_err(keynode_t *keynode, int preference_errno,
                is_busy_err = 0;
        }
 
-       if (is_busy_err == 1)
+       if (is_busy_err == 1) {
                return 1;
-       else {
-               char err_buf[ERR_LEN] = {0,};
+       } else {
                strerror_r(errno, err_buf, sizeof(err_buf));
                ERR("key(%s), check retry err: %d/(%d/%s).", keynode->keyname, preference_errno, io_errno, err_buf);
                return 0;
@@ -627,13 +628,14 @@ static int _preference_set_key(keynode_t *keynode)
  */
 API int preference_set_int(const char *key, int intval)
 {
+       int func_ret = PREFERENCE_ERROR_NONE;
+       keynode_t *pKeyNode;
+
        START_TIME_CHECK
 
        retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is NULL");
 
-       int func_ret = PREFERENCE_ERROR_NONE;
-
-       keynode_t* pKeyNode = _preference_keynode_new();
+       pKeyNode = _preference_keynode_new();
        retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
 
        func_ret = _preference_keynode_set_keyname(pKeyNode, key);
@@ -667,12 +669,14 @@ API int preference_set_int(const char *key, int intval)
 */
 API int preference_set_boolean(const char *key, bool boolval)
 {
+       int func_ret = PREFERENCE_ERROR_NONE;
+       keynode_t *pKeyNode;
+
        START_TIME_CHECK
 
        retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is NULL");
 
-       int func_ret = PREFERENCE_ERROR_NONE;
-       keynode_t* pKeyNode = _preference_keynode_new();
+       pKeyNode = _preference_keynode_new();
        retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
 
        func_ret = _preference_keynode_set_keyname(pKeyNode, key);
@@ -705,12 +709,14 @@ API int preference_set_boolean(const char *key, bool boolval)
  */
 API int preference_set_double(const char *key, double dblval)
 {
+       int func_ret = PREFERENCE_ERROR_NONE;
+       keynode_t *pKeyNode;
+
        START_TIME_CHECK
 
        retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is NULL");
 
-       int func_ret = PREFERENCE_ERROR_NONE;
-       keynode_t* pKeyNode = _preference_keynode_new();
+       pKeyNode = _preference_keynode_new();
        retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
 
        func_ret = _preference_keynode_set_keyname(pKeyNode, key);
@@ -743,13 +749,15 @@ API int preference_set_double(const char *key, double dblval)
  */
 API int preference_set_string(const char *key, const char *strval)
 {
+       int func_ret = PREFERENCE_ERROR_NONE;
+       keynode_t *pKeyNode;
+
        START_TIME_CHECK
 
        retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is NULL");
        retvm_if(strval == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: value is NULL");
 
-       int func_ret = PREFERENCE_ERROR_NONE;
-       keynode_t* pKeyNode = _preference_keynode_new();
+       pKeyNode = _preference_keynode_new();
        retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
 
        func_ret = _preference_keynode_set_keyname(pKeyNode, key);
@@ -849,7 +857,7 @@ retry:
        /* read data value */
        switch (type) {
        case PREFERENCE_TYPE_INT:
-               read_size = fread((void*)&value_int, sizeof(int), 1, fp);
+               read_size = fread((void *)&value_int, sizeof(int), 1, fp);
                if ((read_size <= 0) || (read_size > sizeof(int))) {
                        if (!ferror(fp))
                                LOGW("number of read items for value is wrong. err : %d", errno);
@@ -863,7 +871,7 @@ retry:
 
                break;
        case PREFERENCE_TYPE_DOUBLE:
-               read_size = fread((void*)&value_dbl, sizeof(double), 1, fp);
+               read_size = fread((void *)&value_dbl, sizeof(double), 1, fp);
                if ((read_size <= 0) || (read_size > sizeof(double))) {
                        if (!ferror(fp))
                                LOGW("number of read items for value is wrong. err : %d", errno);
@@ -877,7 +885,7 @@ retry:
 
                break;
        case PREFERENCE_TYPE_BOOLEAN:
-               read_size = fread((void*)&value_int, sizeof(int), 1, fp);
+               read_size = fread((void *)&value_int, sizeof(int), 1, fp);
                if ((read_size <= 0) || (read_size > sizeof(int))) {
                        if (!ferror(fp))
                                LOGW("number of read items for value is wrong. err : %d", errno);
@@ -1000,13 +1008,15 @@ int _preference_get_key(keynode_t *keynode)
  */
 API int preference_get_int(const char *key, int *intval)
 {
+       int func_ret = PREFERENCE_ERROR_IO_ERROR;
+       keynode_t *pKeyNode;
+
        START_TIME_CHECK
 
        retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
        retvm_if(intval == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: output buffer is null");
 
-       int func_ret = PREFERENCE_ERROR_IO_ERROR;
-       keynode_t* pKeyNode = _preference_keynode_new();
+       pKeyNode = _preference_keynode_new();
        retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
 
        func_ret = _preference_keynode_set_keyname(pKeyNode, key);
@@ -1045,13 +1055,15 @@ API int preference_get_int(const char *key, int *intval)
  */
 API int preference_get_boolean(const char *key, bool *boolval)
 {
+       int func_ret = PREFERENCE_ERROR_IO_ERROR;
+       keynode_t *pKeyNode;
+
        START_TIME_CHECK
 
        retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
        retvm_if(boolval == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: output buffer is null");
 
-       int func_ret = PREFERENCE_ERROR_IO_ERROR;
-       keynode_t* pKeyNode = _preference_keynode_new();
+       pKeyNode = _preference_keynode_new();
        retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
 
        func_ret = _preference_keynode_set_keyname(pKeyNode, key);
@@ -1091,13 +1103,15 @@ API int preference_get_boolean(const char *key, bool *boolval)
  */
 API int preference_get_double(const char *key, double *dblval)
 {
+       int func_ret = PREFERENCE_ERROR_IO_ERROR;
+       keynode_t *pKeyNode;
+
        START_TIME_CHECK
 
        retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
        retvm_if(dblval == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: output buffer is null");
 
-       int func_ret = PREFERENCE_ERROR_IO_ERROR;
-       keynode_t* pKeyNode = _preference_keynode_new();
+       pKeyNode = _preference_keynode_new();
        retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
 
        func_ret = _preference_keynode_set_keyname(pKeyNode, key);
@@ -1137,13 +1151,16 @@ API int preference_get_double(const char *key, double *dblval)
  */
 API int preference_get_string(const char *key, char **value)
 {
+       int func_ret = PREFERENCE_ERROR_IO_ERROR;
+       keynode_t *pKeyNode;
+       char *tempstr = NULL;
+
        START_TIME_CHECK
 
        retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
        retvm_if(value == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: output buffer is null");
 
-       int func_ret = PREFERENCE_ERROR_IO_ERROR;
-       keynode_t* pKeyNode = _preference_keynode_new();
+       pKeyNode = _preference_keynode_new();
        retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
 
        func_ret = _preference_keynode_set_keyname(pKeyNode, key);
@@ -1153,15 +1170,13 @@ API int preference_get_string(const char *key, char **value)
                return PREFERENCE_ERROR_IO_ERROR;
        }
 
-       char *tempstr = NULL;
        func_ret = _preference_get_key(pKeyNode);
-
        if (func_ret != PREFERENCE_ERROR_NONE) {
                ERR("preference_get_string(%d) : %s error", getpid(), key);
        } else {
-               if (pKeyNode->type == PREFERENCE_TYPE_STRING)
+               if (pKeyNode->type == PREFERENCE_TYPE_STRING) {
                        tempstr = pKeyNode->value.s;
-               else {
+               else {
                        ERR("The type(%d) of keynode(%s) is not STR", pKeyNode->type, pKeyNode->keyname);
                        func_ret = PREFERENCE_ERROR_INVALID_PARAMETER;
                }
@@ -1186,16 +1201,17 @@ API int preference_get_string(const char *key, char **value)
  */
 API int preference_remove(const char *key)
 {
-       START_TIME_CHECK
-
        char path[PATH_MAX] = {0,};
        int ret = -1;
        int err_retry = PREFERENCE_ERROR_RETRY_CNT;
        int func_ret = PREFERENCE_ERROR_NONE;
+       char err_buf[ERR_LEN] = {0,};
+
+       START_TIME_CHECK
 
        retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
 
-       keynode_tpKeyNode = _preference_keynode_new();
+       keynode_t *pKeyNode = _preference_keynode_new();
        retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
 
        ret = _preference_keynode_set_keyname(pKeyNode, key);
@@ -1221,7 +1237,6 @@ API int preference_remove(const char *key)
        do {
                ret = remove(path);
                if (ret == -1) {
-                       char err_buf[ERR_LEN] = {0,};
                        strerror_r(errno, err_buf, sizeof(err_buf));
                        ERR("preference_remove() failed. ret=%d(%s), key(%s)", errno, err_buf, key);
                        func_ret = PREFERENCE_ERROR_IO_ERROR;
@@ -1240,8 +1255,6 @@ API int preference_remove(const char *key)
 
 API int preference_remove_all(void)
 {
-       START_TIME_CHECK
-
        int ret = -1;
        int err_retry = PREFERENCE_ERROR_RETRY_CNT;
        int func_ret = PREFERENCE_ERROR_NONE;
@@ -1250,6 +1263,11 @@ API int preference_remove_all(void)
        struct dirent *result = NULL;
        char *pref_dir_path = NULL;
        char err_buf[ERR_LEN] = {0,};
+       const char *entry;
+       char *keyname = NULL;
+       char path[PATH_MAX] = {0,};
+
+       START_TIME_CHECK
 
        pref_dir_path = _preference_get_pref_dir_path();
        if (!pref_dir_path) {
@@ -1264,7 +1282,7 @@ API int preference_remove_all(void)
                return PREFERENCE_ERROR_IO_ERROR;
        }
 
-       keynode_tpKeyNode = _preference_keynode_new();
+       keynode_t *pKeyNode = _preference_keynode_new();
        if (pKeyNode == NULL) {
                ERR("key malloc fail");
                closedir(dir);
@@ -1272,10 +1290,7 @@ API int preference_remove_all(void)
        }
 
        while (readdir_r(dir, &dent, &result) == 0 && result != NULL) {
-               const char *entry = dent.d_name;
-               char *keyname = NULL;
-               char path[PATH_MAX] = {0,};
-
+               entry = dent.d_name;
                if (entry[0] == '.')
                        continue;
 
@@ -1327,16 +1342,17 @@ API int preference_remove_all(void)
 
 int preference_is_existing(const char *key, bool *exist)
 {
-       START_TIME_CHECK
-
        char path[PATH_MAX] = {0,};
        int ret = -1;
        int func_ret = PREFERENCE_ERROR_NONE;
+       keynode_t *pKeyNode;
+
+       START_TIME_CHECK
 
        retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
        retvm_if(exist == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
 
-       keynode_t* pKeyNode = _preference_keynode_new();
+       pKeyNode = _preference_keynode_new();
        retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
 
        ret = _preference_keynode_set_keyname(pKeyNode, key);
@@ -1367,17 +1383,17 @@ int preference_is_existing(const char *key, bool *exist)
        return func_ret;
 }
 
-
 API int preference_set_changed_cb(const char *key, preference_changed_cb callback, void *user_data)
 {
+       int func_ret = PREFERENCE_ERROR_IO_ERROR;
+       keynode_t *pKeyNode;
+
        START_TIME_CHECK
 
        retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
        retvm_if(callback == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: cb(%p)", callback);
 
-       int func_ret = PREFERENCE_ERROR_IO_ERROR;
-
-       keynode_t* pKeyNode = _preference_keynode_new();
+       pKeyNode = _preference_keynode_new();
        retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
 
        func_ret = _preference_keynode_set_keyname(pKeyNode, key);
@@ -1408,13 +1424,15 @@ API int preference_set_changed_cb(const char *key, preference_changed_cb callbac
 
 API int preference_unset_changed_cb(const char *key)
 {
-       START_TIME_CHECK
-
        int func_ret = PREFERENCE_ERROR_IO_ERROR;
+       keynode_t *pKeyNode;
+       char err_buf[ERR_LEN] = {0,};
+
+       START_TIME_CHECK
 
        retvm_if(key == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: key is null");
 
-       keynode_t* pKeyNode = _preference_keynode_new();
+       pKeyNode = _preference_keynode_new();
        retvm_if(pKeyNode == NULL, PREFERENCE_ERROR_OUT_OF_MEMORY, "key malloc fail");
 
        func_ret = _preference_keynode_set_keyname(pKeyNode, key);
@@ -1430,7 +1448,6 @@ API int preference_unset_changed_cb(const char *key)
                        _preference_keynode_free(pKeyNode);
                        return PREFERENCE_ERROR_NO_KEY;
                } else if (errno != 0) {
-                       char err_buf[ERR_LEN] = {0,};
                        strerror_r(errno, err_buf, sizeof(err_buf));
                        ERR("preference_unset_changed_cb() failed: key(%s) error(%d/%s)", key, errno, err_buf);
                        _preference_keynode_free(pKeyNode);
@@ -1448,16 +1465,19 @@ API int preference_unset_changed_cb(const char *key)
 
 API int preference_foreach_item(preference_item_cb callback, void *user_data)
 {
-       START_TIME_CHECK
-
-       retvm_if(callback == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: cb(%p)", callback);
-
        int ret = 0;
        DIR *dir;
        struct dirent dent;
        struct dirent *result = NULL;
        char *pref_dir_path = NULL;
        char err_buf[ERR_LEN] = {0,};
+       const char *entry;
+       char *keyname = NULL;
+       char path[PATH_MAX] = {0,};
+
+
+       START_TIME_CHECK
+       retvm_if(callback == NULL, PREFERENCE_ERROR_INVALID_PARAMETER, "Invalid argument: cb(%p)", callback);
 
        pref_dir_path = _preference_get_pref_dir_path();
        if (!pref_dir_path) {
@@ -1473,10 +1493,7 @@ API int preference_foreach_item(preference_item_cb callback, void *user_data)
        }
 
        while (readdir_r(dir, &dent, &result) == 0 && result != NULL) {
-               const char *entry = dent.d_name;
-               char *keyname = NULL;
-               char path[PATH_MAX] = {0,};
-
+               entry = dent.d_name;
                if (entry[0] == '.')
                        continue;
 
@@ -1498,3 +1515,4 @@ API int preference_foreach_item(preference_item_cb callback, void *user_data)
 
        return PREFERENCE_ERROR_NONE;
 }
+
index 8d1fab3597aaee0df6bd584dd1e348db025c91cc..e87b34a1c4f8a4ebe65f7479752aa2f4a9146229 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.
@@ -320,7 +320,6 @@ int preference_get_double(const char *key, double *value)
 {
        char type[2];
        char data[BUF_LEN];
-
        int ret;
 
        if (value == NULL) {
@@ -363,7 +362,6 @@ int preference_get_string(const char *key, char **value)
 {
        char type[2];
        char data[BUF_LEN];
-
        int ret;
 
        if (value == NULL) {
@@ -469,7 +467,7 @@ int preference_is_existing(const char *key, bool *exist)
        return PREFERENCE_ERROR_NONE;
 }
 
-static pref_changed_cb_node_t_find_node(const char *key)
+static pref_changed_cb_node_t *_find_node(const char *key)
 {
        pref_changed_cb_node_t *tmp_node;
 
@@ -501,7 +499,7 @@ static int _add_node(const char *key, preference_changed_cb cb, void *user_data)
                tmp_node->cb = cb;
                tmp_node->user_data = user_data;
        } else {
-               tmp_node = (pref_changed_cb_node_t*)malloc(sizeof(pref_changed_cb_node_t));
+               tmp_node = (pref_changed_cb_node_t *)malloc(sizeof(pref_changed_cb_node_t));
                if (tmp_node == NULL) {
                        LOGE("OUT_OF_MEMORY(0x%08x)", PREFERENCE_ERROR_OUT_OF_MEMORY);
                        return PREFERENCE_ERROR_OUT_OF_MEMORY;
@@ -794,3 +792,4 @@ int preference_foreach_item(preference_item_cb callback, void *user_data)
 
        return PREFERENCE_ERROR_NONE;
 }
+
index c41c16c7e1347f66bf80522705803130cb6c2d93..83cdecf9251394973adbd8c1885e789faf736c40 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.
@@ -60,11 +60,12 @@ static pthread_mutex_t _kdb_g_ns_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 static GSource *_kdb_handler;
 
-static GList_preference_copy_noti_list(GList *orig_notilist)
+static GList *_preference_copy_noti_list(GList *orig_notilist)
 {
        GList *copy_notilist = NULL;
        struct noti_node *n = NULL;
        struct noti_node *t = NULL;
+       char err_buf[ERR_LEN] = {0,};
 
        if (!orig_notilist)
                return NULL;
@@ -76,7 +77,6 @@ static GList* _preference_copy_noti_list(GList *orig_notilist)
        while (orig_notilist) {
                do {
                        t = orig_notilist->data;
-
                        if (t == NULL) {
                                WARN("noti item data is null");
                                break;
@@ -95,7 +95,6 @@ static GList* _preference_copy_noti_list(GList *orig_notilist)
 
                        n->keyname = strndup(t->keyname, PREFERENCE_KEY_PATH_LEN);
                        if (n->keyname == NULL) {
-                               char err_buf[ERR_LEN] = {0,};
                                strerror_r(errno, err_buf, sizeof(err_buf));
                                ERR("The memory is insufficient, errno: %d (%s)", errno, err_buf);
                                free(n);
@@ -115,7 +114,7 @@ static GList* _preference_copy_noti_list(GList *orig_notilist)
 
 static void _preference_free_noti_node(gpointer data)
 {
-       struct noti_node *n = (struct noti_node*)data;
+       struct noti_node *n = (struct noti_node *)data;
        g_free(n->keyname);
        g_free(n);
 }
@@ -131,6 +130,9 @@ static gboolean _preference_kdb_gio_cb(GIOChannel *src, GIOCondition cond, gpoin
        int fd, r, res;
        struct inotify_event ie;
        GList *l_notilist = NULL;
+       struct noti_node *t = NULL;
+       GList *noti_list = NULL;
+       keynode_t *keynode;
 
        fd = g_io_channel_unix_get_fd(src);
        r = read(fd, &ie, sizeof(ie));
@@ -145,23 +147,17 @@ static gboolean _preference_kdb_gio_cb(GIOChannel *src, GIOCondition cond, gpoin
                        pthread_mutex_unlock(&_kdb_g_ns_mutex);
 
                        if (l_notilist) {
-
-                               struct noti_node *t = NULL;
-                               GList *noti_list = NULL;
-
                                noti_list = g_list_first(l_notilist);
-
                                while (noti_list) {
                                        t = noti_list->data;
 
-                                       keynode_t* keynode = _preference_keynode_new();
+                                       keynode = _preference_keynode_new();
                                        if (keynode == NULL) {
                                                ERR("key malloc fail");
                                                break;
                                        }
 
                                        if ((t) && (t->wd == ie.wd) && (t->keyname)) {
-
                                                res = _preference_keynode_set_keyname(keynode, t->keyname);
                                                if (res != PREFERENCE_ERROR_NONE) {
                                                        ERR("_preference_keynode_set_keyname() failed(%d)", res);
@@ -205,6 +201,7 @@ static int _preference_kdb_noti_init(void)
 {
        GIOChannel *gio;
        int ret = 0;
+       char err_buf[ERR_LEN] = { 0, };
 
        pthread_mutex_lock(&_kdb_inoti_fd_mutex);
 
@@ -215,7 +212,6 @@ static int _preference_kdb_noti_init(void)
        }
        _kdb_inoti_fd = inotify_init();
        if (_kdb_inoti_fd == -1) {
-               char err_buf[100] = { 0, };
                strerror_r(errno, err_buf, sizeof(err_buf));
                ERR("inotify init: %s", err_buf);
                pthread_mutex_unlock(&_kdb_inoti_fd_mutex);
@@ -224,7 +220,6 @@ static int _preference_kdb_noti_init(void)
 
        ret = fcntl(_kdb_inoti_fd, F_SETFD, FD_CLOEXEC);
        if (ret < 0) {
-               char err_buf[100] = { 0, };
                strerror_r(errno, err_buf, sizeof(err_buf));
                ERR("inotify init: %s", err_buf);
                pthread_mutex_unlock(&_kdb_inoti_fd_mutex);
@@ -233,7 +228,6 @@ static int _preference_kdb_noti_init(void)
 
        ret = fcntl(_kdb_inoti_fd, F_SETFL, O_NONBLOCK);
        if (ret < 0) {
-               char err_buf[100] = { 0, };
                strerror_r(errno, err_buf, sizeof(err_buf));
                ERR("inotify init: %s", err_buf);
                pthread_mutex_unlock(&_kdb_inoti_fd_mutex);
@@ -281,7 +275,7 @@ int _preference_kdb_add_notify(keynode_t *keynode, preference_changed_cb cb, voi
                return PREFERENCE_ERROR_INVALID_PARAMETER;
        }
 
-       if (0 != access(path, F_OK)) {
+       if (access(path, F_OK) != 0) {
                if (errno == ENOENT) {
                        ERR("_preference_kdb_add_notify : Key(%s) does not exist", keyname);
                        return PREFERENCE_ERROR_IO_ERROR;
@@ -364,7 +358,7 @@ int _preference_kdb_del_notify(keynode_t *keynode)
                return PREFERENCE_ERROR_INVALID_PARAMETER;
        }
 
-       if (0 != access(path, F_OK)) {
+       if (access(path, F_OK) != 0) {
                if (errno == ENOENT) {
                        ERR("_preference_kdb_del_notify : Key(%s) does not exist", keyname);
                        return PREFERENCE_ERROR_IO_ERROR;
@@ -427,3 +421,4 @@ int _preference_kdb_del_notify(keynode_t *keynode)
 
        return func_ret;
 }
+
index 4aba0ac3b97bbc1695c16c0c4247a58e5fb29ac7..47f9e1afebd4b30c87560d2d004ce10300202feb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -47,3 +47,4 @@ app_device_orientation_e app_get_device_orientation(void)
 
        return dev_orientation;
 }
+
index 6ca4bcce4e1b95fd342c6eaa576a77f22c7855db..ccf972c59ffa1d4b0a07224579a1700b936275b5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -469,7 +469,7 @@ static int _ui_app_appcore_suspended_state_changed(void *event_info, void *data)
        struct app_event_info event;
 
        LOGI("_ui_app_appcore_suspended_state_changed");
-       LOGI("[__SUSPEND__] suspended state: %d (0: suspend, 1: wake)", *(int*)event_info);
+       LOGI("[__SUSPEND__] suspended state: %d (0: suspend, 1: wake)", *(int *)event_info);
 
        event.type = APP_EVENT_SUSPENDED_STATE_CHANGED;
        event.value = event_info;
index 197b565a28f86c42e5d5f67fe1cc598ab4205656..374472b5cff8af39ab9d19f2fb07afa6e18aa3c0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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.
@@ -46,3 +46,4 @@ void *app_get_preinitialized_conformant(void)
 {
        return elm_conformant_precreated_object_get();
 }
+
index fecec4b26c59f8defae0e8eed47e4e175796d18f..f7f5ba09b3a518a023e54bfd3490aa6a8671900c 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.
index babfa9915e03023917ab43560e2705a2821324fa..c22ebbf8b90a2b61f7d1b3f462d66d271cebb3d3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011 - 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,7 +22,7 @@
 
 #include <app_i18n.h>
 
-chari18n_get_text(const char *message)
+char *i18n_get_text(const char *message)
 {
        return gettext(message);
 }