/* #define CYNARA_ENABLE 1 */
-typedef struct
-{
+typedef struct {
pid_t pid;
char *uid;
char *smack;
const char *progress_cnt,
int transfer_id);
-gboolean _bt_update_notification_status(struct bt_appdata *ad );
+gboolean _bt_update_notification_status(struct bt_appdata *ad);
void _bt_register_notification_cb(struct bt_appdata *ad);
return -1;
}
- if(state == TRUE) {
+ if (state == TRUE) {
block_cnt++;
- if(bt_device_state & BT_STATUS_TRANSFER)
+ if (bt_device_state & BT_STATUS_TRANSFER)
return 0;
bt_device_state |= BT_STATUS_TRANSFER;
event_val = EVT_VAL_BT_TRANSFERING;
} else {
- if(block_cnt > 0)
+ if (block_cnt > 0)
block_cnt--;
- if(block_cnt != 0)
+ if (block_cnt != 0)
return 0;
bt_device_state ^= BT_STATUS_TRANSFER;
event_val = EVT_VAL_BT_NON_TRANSFERING;
int ret;
ret = cynara_initialize(&_cynara, NULL);
- if (ret != CYNARA_API_SUCCESS)
- {
+ if (ret != CYNARA_API_SUCCESS) {
cynara_strerror(ret, error_msg, error_msg_size);
ERR("cynara_initialize failed: %s\n", error_msg);
return BT_SHARE_FAIL;
char byte;
char *file_path = NULL;
char mime_type[BT_MIME_TYPE_MAX_LEN] = { 0 };
- unsigned int file_size=0;
+ unsigned int file_size = 0;
struct stat file_attr;
int len;
opc_transfer_info_t *data;
else
data->file_path[i] = g_strdup(ptr);
- if(aul_get_mime_from_file(data->file_path[i], mime_type,
+ if (aul_get_mime_from_file(data->file_path[i], mime_type,
BT_MIME_TYPE_MAX_LEN) == AUL_R_OK) {
g_free(data->type[i]);
data->type[i] = g_strdup(mime_type);
ret = _request_file_send(node);
if (ret == BLUETOOTH_ERROR_IN_PROGRESS) {
DBG("Aleady OPC progressing. Once completed previous job, will be started\n");
- } else if ( ret != BLUETOOTH_ERROR_NONE) {
+ } else if (ret != BLUETOOTH_ERROR_NONE) {
_bt_create_warning_popup(BLUETOOTH_ERROR_INTERNAL, BT_STR_UNABLE_TO_SEND);
g_slist_free_full(bt_transfer_list,
(GDestroyNotify)_free_transfer_info);
ret = _request_file_send(node);
if (ret == BLUETOOTH_ERROR_IN_PROGRESS) {
DBG("Aleady OPC progressing. Once completed previous job, will be started\n");
- } else if ( ret != BLUETOOTH_ERROR_NONE) {
+ } else if (ret != BLUETOOTH_ERROR_NONE) {
_bt_create_warning_popup(BLUETOOTH_ERROR_INTERNAL, BT_STR_UNABLE_TO_SEND);
g_slist_free_full(bt_transfer_list,
(GDestroyNotify)_free_transfer_info);
char str[BT_TEXT_LEN_MAX] = { 0, };
bundle *b;
- DBG("error_type: %d",error_type);
+ DBG("error_type: %d", error_type);
switch (error_type) {
case BLUETOOTH_ERROR_SERVICE_NOT_FOUND:
case BLUETOOTH_ERROR_NOT_CONNECTED:
bt_tr_data_t *tmp;
tmp = g_malloc0(sizeof(bt_tr_data_t));
- if(tmp == NULL)
+ if (tmp == NULL)
return;
tmp->tr_status = BT_TR_FAIL;
return FALSE;
tmp = g_malloc0(sizeof(bt_tr_data_t));
- if(tmp == NULL)
+ if (tmp == NULL)
return FALSE;
tmp->tr_status = status;
if (dbus_error_is_set(&err))
goto failed;
- if(DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER == ret_code) {
+ if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER == ret_code) {
dbus_connection_unref(conn);
return TRUE;
}
/* Check if the DB exists; if not, create it and initialize it */
ret = stat(BT_TRANSFER_DB, &sts);
- if (ret == -1 && errno == ENOENT)
- {
+ if (ret == -1 && errno == ENOENT) {
DBG("DB %s doesn't exist, it needs to be created and initialized", BT_TRANSFER_DB);
DBG("script path: %s", SCRIPT_INIT_DB);
ret = system(SCRIPT_INIT_DB);
}
ret = appcore_set_event_callback(APPCORE_EVENT_LANG_CHANGE, __bt_lang_changed_cb, NULL);
- if(ret < 0)
+ if (ret < 0)
DBG("Failed to excute the change of language");
-
/* init internationalization */
if (appcore_set_i18n(BT_COMMON_PKG, BT_COMMON_RES) < 0)
return -1;
DBG("__bt_default_memory_changed_cb\n");
- ret_if (node == NULL);
+ ret_if(node == NULL);
DBG("key=%s\n", vconf_keynode_get_name(node));
int _bt_update_notification(struct bt_appdata *ad, notification_h noti,
char *title, char *content, char *icon_path)
{
- retvm_if (!noti, BT_SHARE_FAIL, "noti is NULL");
+ retvm_if(!noti, BT_SHARE_FAIL, "noti is NULL");
INFO("Update noti : %d", noti);
notification_error_e ret = NOTIFICATION_ERROR_NONE;
}
if (content) {
- if (noti == ad->send_noti|| noti == ad->receive_noti) {
+ if (noti == ad->send_noti || noti == ad->receive_noti) {
if (success == 1)
ret = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
NULL, content,
return ret;
}
-gboolean _bt_update_notification_status(struct bt_appdata *ad )
+gboolean _bt_update_notification_status(struct bt_appdata *ad)
{
notification_h noti = NULL;
notification_list_h list_head = NULL;
int priv_id = 0;
int ret;
- retv_if (ad == NULL, FALSE);
+ retv_if(ad == NULL, FALSE);
/* When bt-share is launched, need to update notification status */
{
DBG("__bt_notification_changed_cb");
- retm_if (data == NULL, "Invalid data");
+ retm_if(data == NULL, "Invalid data");
struct bt_appdata *ad = (struct bt_appdata *)data;
gboolean is_sent_noti_exist = FALSE;
gboolean is_received_noti_exist = FALSE;
int priv_id;
sqlite3 *db = NULL;
- retm_if (op_list == NULL, "Invalid op_list");
+ retm_if(op_list == NULL, "Invalid op_list");
if (type != NOTIFICATION_TYPE_NOTI ||
(op_list->type != NOTIFICATION_OP_DELETE &&
return;
noti_err = notification_get_list(type, -1, ¬i_list);
- ret_if (noti_err != NOTIFICATION_ERROR_NONE);
+ ret_if(noti_err != NOTIFICATION_ERROR_NONE);
noti_list = notification_list_get_head(noti_list);
while (noti_list) {
DBG("+\n");
b = bundle_create();
- if(b == NULL) {
+ if (b == NULL) {
ERR("bundle_create failed");
return -1;
}
DBG("noti_id : %d", noti_data->noti_id);
ret = bluetooth_obex_server_cancel_transfer(noti_data->transfer_id);
- if(ret != BLUETOOTH_ERROR_NONE) {
+ if (ret != BLUETOOTH_ERROR_NONE) {
ERR("bluetooth_obex_server_cancel_transfer[ret:%d]", ret);
}
}
INFO("BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED");
isFirstReceivedPacket = TRUE;
transfer_info = param->param_data;
- if(transfer_info->file_size > (100 * 1024)) {
+ if (transfer_info->file_size > (100 * 1024)) {
if (0 == g_strcmp0(transfer_info->type, TRANSFER_GET)) {
/*GET request */
noti = _bt_insert_notification(ad, BT_SENDING_NOTI, 0, 0);
if (isFirstReceivedPacket)
_bt_update_notification(ad, data->noti_handle, transfer_info->filename, "", NULL);
- if(data && data->noti_id)
+ if (data && data->noti_id)
_bt_update_notification_progress(
data->noti_handle,
data->noti_id,
} else {
_bt_update_notification(ad, ad->receive_noti, NULL, NULL, NULL);
}
- }else if(0 == g_strcmp0(transfer_info->type, TRANSFER_GET)){
+ } else if (0 == g_strcmp0(transfer_info->type, TRANSFER_GET)) {
INFO("TRANSFER_GET");
}
regex = g_regex_new("[*\"<>;?|\\^:/]", 0, 0, NULL);
name = g_regex_replace(regex, server_auth_info->filename, -1, 0, "_", 0, NULL);
- g_regex_unref(regex );
+ g_regex_unref(regex);
if (g_strcmp0(name, server_auth_info->filename) != 0) {
g_free(server_auth_info->filename);
server_auth_info->filename = name;
goto reject;
}
- INFO("File Length =%ld",server_auth_info->length);
+ INFO("File Length = %ld", server_auth_info->length);
if (val == BT_DEFAULT_MEM_MMC) {
ret = __bt_get_available_ext_memory(&available_ext_mem_size);
if (ret != CALENDAR_ERROR_NONE) {
ERR("[error] = %d \n", ret);
ret = calendar_disconnect();
- if ( ret != CALENDAR_ERROR_NONE) {
+ if (ret != CALENDAR_ERROR_NONE) {
ERR("calendar_disconnect error = %d \n", ret);
}
return FALSE;
BT_SHARE_ERR_INTERNAL = -1,
BT_SHARE_ERR_INVALID_PARAM = -2,
BT_SHARE_ERR_UNKNOWN = -3
-}bt_share_err_e;
+} bt_share_err_e;
typedef struct {
char *type;
char *content;
unsigned int size;
-}bt_tr_data_t;
+} bt_tr_data_t;
typedef enum {
return count;
}
-static int __bt_db_delete_record(sqlite3 *db, const char *query )
+static int __bt_db_delete_record(sqlite3 *db, const char *query)
{
int ret = 0;
sqlite3_stmt *stmt = NULL;