Change prefix of list definition 73/250973/2 accepted/tizen/unified/20210111.125507 submit/tizen/20210108.041937
authorYunmi Ha <yunmi.ha@samsung.com>
Wed, 6 Jan 2021 07:48:36 +0000 (16:48 +0900)
committerYunmi Ha <yunmi.ha@samsung.com>
Wed, 6 Jan 2021 10:21:44 +0000 (19:21 +0900)
- list to SYS_G_LIST

Change-Id: I293acdeb5f475e477d088573e61fb2f538f568c3
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
src/callback.c
src/haptic.c

index f973d06..d2adebb 100644 (file)
@@ -36,7 +36,7 @@ struct device_cb_info {
        void *data;
 };
 
-static list *device_cb_list[DEVICE_CALLBACK_MAX];
+static GList *device_cb_list[DEVICE_CALLBACK_MAX];
 static int flash_sigid;
 
 //LCOV_EXCL_START Not called Callback
@@ -44,13 +44,13 @@ static void battery_capacity_cb(keynode_t *key, void *data)
 {
        static device_callback_e type = DEVICE_CALLBACK_BATTERY_CAPACITY;
        struct device_cb_info *cb_info;
-       list *elem, *elem_next;
+       GList *elem, *elem_next;
        int val;
 
        val = vconf_keynode_get_int(key);
 
        /* invoke the each callback with value */
-       LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info)
+       SYS_G_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info)
                cb_info->cb(type, (void*)val, cb_info->data);
 }
 //LCOV_EXCL_STOP
@@ -60,13 +60,13 @@ static void battery_charging_cb(keynode_t *key, void *data)
 {
        static device_callback_e type = DEVICE_CALLBACK_BATTERY_CHARGING;
        struct device_cb_info *cb_info;
-       list *elem, *elem_next;
+       GList *elem, *elem_next;
        int val;
 
        val = vconf_keynode_get_int(key);
 
        /* invoke the each callback with value */
-       LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info)
+       SYS_G_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info)
                cb_info->cb(type, (void*)val, cb_info->data);
 }
 //LCOV_EXCL_STOP
@@ -76,7 +76,7 @@ static void battery_level_cb(keynode_t *key, void *data)
 {
        static device_callback_e type = DEVICE_CALLBACK_BATTERY_LEVEL;
        struct device_cb_info *cb_info;
-       list *elem, *elem_next;
+       GList *elem, *elem_next;
        int val, status;
 
        val = vconf_keynode_get_int(key);
@@ -95,7 +95,7 @@ static void battery_level_cb(keynode_t *key, void *data)
                status = -1;
 
        /* invoke the each callback with value */
-       LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info)
+       SYS_G_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info)
                cb_info->cb(type, (void*)status, cb_info->data);
 }
 //LCOV_EXCL_STOP
@@ -105,7 +105,7 @@ static void display_changed_cb(keynode_t *key, void *data)
 {
        static device_callback_e type = DEVICE_CALLBACK_DISPLAY_STATE;
        struct device_cb_info *cb_info;
-       list *elem, *elem_next;
+       GList *elem, *elem_next;
        display_state_e state;
        int val;
 
@@ -123,7 +123,7 @@ static void display_changed_cb(keynode_t *key, void *data)
        }
 
        /* invoke the each callback with value */
-       LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info)
+       SYS_G_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info)
                cb_info->cb(type, (void*)state, cb_info->data);
 }
 //LCOV_EXCL_STOP
@@ -139,7 +139,7 @@ static void flash_state_cb(GDBusConnection *conn,
 {
        static int type = DEVICE_CALLBACK_FLASH_BRIGHTNESS;
        struct device_cb_info *cb_info;
-       list *elem, *elem_next;
+       GList *elem, *elem_next;
        int val;
 
        if (strncmp(signal, SIGNAL_FLASH_STATE,
@@ -153,7 +153,7 @@ static void flash_state_cb(GDBusConnection *conn,
        _D("%s - %d", signal, val);
 
        /* invoke the each callback with value */
-       LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info)
+       SYS_G_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info)
                cb_info->cb(type, (void*)val, cb_info->data);
 }
 //LCOV_EXCL_STOP
@@ -289,7 +289,7 @@ static int release_request(device_callback_e type)
 int device_add_callback(device_callback_e type, device_changed_cb cb, void *data)
 {
        struct device_cb_info *cb_info;
-       list *elem, *elem_next;
+       GList *elem, *elem_next;
        int ret, n;
 
        if (!is_display_supported() && type == DEVICE_CALLBACK_DISPLAY_STATE)
@@ -302,7 +302,7 @@ int device_add_callback(device_callback_e type, device_changed_cb cb, void *data
                return DEVICE_ERROR_INVALID_PARAMETER;
 
        /* check if it is the first request */
-       n = LIST_LENGTH(device_cb_list[type]);
+       n = SYS_G_LIST_LENGTH(device_cb_list[type]);
        if (n == 0) {
                ret = register_request(type);
                if (ret < 0)
@@ -310,7 +310,7 @@ int device_add_callback(device_callback_e type, device_changed_cb cb, void *data
        }
 
        /* check for the same request */
-       LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info) {
+       SYS_G_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info) {
                if (cb_info->cb == cb)
                        return DEVICE_ERROR_ALREADY_IN_PROGRESS;
        }
@@ -323,7 +323,7 @@ int device_add_callback(device_callback_e type, device_changed_cb cb, void *data
        cb_info->cb = cb;
        cb_info->data = data;
 
-       LIST_APPEND(device_cb_list[type], cb_info);
+       SYS_G_LIST_APPEND(device_cb_list[type], cb_info);
 
        return DEVICE_ERROR_NONE;
 }
@@ -331,7 +331,7 @@ int device_add_callback(device_callback_e type, device_changed_cb cb, void *data
 int device_remove_callback(device_callback_e type, device_changed_cb cb)
 {
        struct device_cb_info *cb_info;
-       list *elem, *elem_next;
+       GList *elem, *elem_next;
        int ret, n;
 
        if (!is_display_supported() && type == DEVICE_CALLBACK_DISPLAY_STATE)
@@ -344,7 +344,7 @@ int device_remove_callback(device_callback_e type, device_changed_cb cb)
                return DEVICE_ERROR_INVALID_PARAMETER;
 
        /* search for the same element with callback */
-       LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info) {
+       SYS_G_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info) {
                if (cb_info->cb == cb)
                        break;
        }
@@ -353,11 +353,11 @@ int device_remove_callback(device_callback_e type, device_changed_cb cb)
                return DEVICE_ERROR_INVALID_PARAMETER;
 
        /* remove device callback from list (local) */
-       LIST_REMOVE(device_cb_list[type], cb_info);
+       SYS_G_LIST_REMOVE(device_cb_list[type], cb_info);
        free(cb_info);
 
        /* check if this callback is last element */
-       n = LIST_LENGTH(device_cb_list[type]);
+       n = SYS_G_LIST_LENGTH(device_cb_list[type]);
        if (n == 0) {
                ret = release_request(type);
                if (ret < 0)
index d4e75f9..6d44d43 100644 (file)
@@ -54,7 +54,7 @@ struct haptic_handle {
 };
 
 static guint haptic_id = 0;
-static list *handle_list;
+static GList *handle_list;
 
 static int is_haptic_supported(void)
 {
@@ -107,11 +107,11 @@ int device_haptic_get_count(int *device_number)
 //LCOV_EXCL_START Not called Callback
 static void restart_callback(void)
 {
-       list *elem, *elem_next;
+       GList *elem, *elem_next;
        struct haptic_handle *temp;
        int ret;
 
-       LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
+       SYS_G_LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
                ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
                                VIBRATOR_PATH_HAPTIC, VIBRATOR_INTERFACE_HAPTIC,
                                METHOD_OPEN_DEVICE, g_variant_new("(i)", temp->index));
@@ -154,7 +154,7 @@ static void haptic_signal_callback(GDBusConnection  *conn,
 
 int device_haptic_open(int device_index, haptic_device_h *device_handle)
 {
-       list *elem, *elem_next;
+       GList *elem, *elem_next;
        struct haptic_handle *handle;
        struct haptic_handle *temp;
        int ret, max;
@@ -181,7 +181,7 @@ int device_haptic_open(int device_index, haptic_device_h *device_handle)
        if (ret < 0)
                return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
 
-       LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
+       SYS_G_LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
                if (temp->handle == ret) {
                        found = true;
                        temp->index = device_index;
@@ -200,10 +200,10 @@ int device_haptic_open(int device_index, haptic_device_h *device_handle)
 
                handle->handle = ret;
                handle->index = device_index;
-               LIST_APPEND(handle_list, handle);
+               SYS_G_LIST_APPEND(handle_list, handle);
                *device_handle = (haptic_device_h)handle;
        }
-       if (LIST_LENGTH(handle_list) == 1) {
+       if (SYS_G_LIST_LENGTH(handle_list) == 1) {
                haptic_id = subscribe_dbus_signal(NULL,
                                VIBRATOR_PATH_HAPTIC,
                                VIBRATOR_INTERFACE_HAPTIC,
@@ -220,7 +220,7 @@ int device_haptic_open(int device_index, haptic_device_h *device_handle)
 
 int device_haptic_close(haptic_device_h device_handle)
 {
-       list *elem, *elem_next;
+       GList *elem, *elem_next;
        struct haptic_handle *handle = (struct haptic_handle *)device_handle;
        struct haptic_handle *temp;
        int ret;
@@ -233,7 +233,7 @@ int device_haptic_close(haptic_device_h device_handle)
        if (!ret)
                return DEVICE_ERROR_NOT_SUPPORTED;
 
-       LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
+       SYS_G_LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
                if (temp->handle != handle->handle)
                        continue;
                found = true;
@@ -242,7 +242,7 @@ int device_haptic_close(haptic_device_h device_handle)
 
        if (!found)
                return DEVICE_ERROR_OPERATION_FAILED;
-       LIST_REMOVE(handle_list, handle);
+       SYS_G_LIST_REMOVE(handle_list, handle);
 
        /* request to deviced to open haptic device */
        ret = dbus_handle_method_sync_var(VIBRATOR_BUS_NAME,
@@ -254,7 +254,7 @@ int device_haptic_close(haptic_device_h device_handle)
        if (ret < 0)
                return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
 
-       if (LIST_LENGTH(handle_list) == 0)
+       if (SYS_G_LIST_LENGTH(handle_list) == 0)
                unsubscribe_dbus_signal(NULL, haptic_id);
 
        return DEVICE_ERROR_NONE;
@@ -262,7 +262,7 @@ int device_haptic_close(haptic_device_h device_handle)
 
 int device_haptic_vibrate(haptic_device_h device_handle, int duration, int feedback, haptic_effect_h *effect_handle)
 {
-       list *elem, *elem_next;
+       GList *elem, *elem_next;
        struct haptic_handle *handle = (struct haptic_handle *)device_handle;
        struct haptic_handle *temp;
        int ret, priority;
@@ -283,7 +283,7 @@ int device_haptic_vibrate(haptic_device_h device_handle, int duration, int feedb
 
        priority = HAPTIC_PRIORITY_MIN;
 
-       LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
+       SYS_G_LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
                if (temp != handle)
                        continue;
                found = true;
@@ -308,7 +308,7 @@ int device_haptic_vibrate(haptic_device_h device_handle, int duration, int feedb
 
 int device_haptic_stop(haptic_device_h device_handle, haptic_effect_h effect_handle)
 {
-       list *elem, *elem_next;
+       GList *elem, *elem_next;
        struct haptic_handle *handle = (struct haptic_handle *)device_handle;
        struct haptic_handle *temp;
        int ret;
@@ -321,7 +321,7 @@ int device_haptic_stop(haptic_device_h device_handle, haptic_effect_h effect_han
        if (!ret)
                return DEVICE_ERROR_NOT_SUPPORTED;
 
-       LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
+       SYS_G_LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
                if (temp != handle)
                        continue;
                found = true;