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
{
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
{
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
{
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);
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
{
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;
}
/* 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
{
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,
_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
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)
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)
}
/* 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;
}
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;
}
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)
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;
}
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)
};
static guint haptic_id = 0;
-static list *handle_list;
+static GList *handle_list;
static int is_haptic_supported(void)
{
//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));
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;
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;
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,
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;
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;
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,
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;
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;
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;
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;
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;