target_time.min = timeInfo->tm_min;
target_time.sec = timeInfo->tm_sec;
- MSG_DEBUG( "Alarm Time : [%d-%d-%d %d:%d:%d] ",
+ MSG_DEBUG("Alarm Time : [%d-%d-%d %d:%d:%d] ",
target_time.year, target_time.month, target_time.day,
target_time.hour, target_time.min, target_time.sec);
void MsgLbsSms(const char *msgBody, int msgSize) {
-
int ret = LBS_AGPS_ERROR_NONE;
ret = lbs_agps_sms(msgBody, msgSize);
void MsgLbsWapPush(const char *pushHeader, const char *pushBody, int pushBodySize) {
-
int ret = LBS_AGPS_ERROR_NONE;
ret = lbs_agps_wap_push(pushHeader, pushBody, pushBodySize);
MSG_END();
return err;
-
}
msg_error_t MsgInsertOnlyActiveNotification(msg_notification_type_t noti_type, MSG_MESSAGE_INFO_S *msg_info)
#ifndef MSG_WEARABLE_PROFILE
notification_h noti_h = NULL;
- MSG_NOTI_INFO_S noti_info = {0,};
+ MSG_NOTI_INFO_S noti_info = {0, };
noti_info.type = noti_type;
noti_info.active_noti_button_num = 1;
msg_error_t MsgRefreshNotification(msg_notification_type_t noti_type, bool bFeedback, msg_active_notification_type_t active_type)
{
-
msg_error_t msg_err = MSG_SUCCESS;
#ifndef MSG_WEARABLE_PROFILE
#ifndef MSG_WEARABLE_PROFILE
notification_h noti_h = NULL;
- MSG_NOTI_INFO_S noti_info = {0,};
+ MSG_NOTI_INFO_S noti_info = {0, };
noti_info.type = noti_type;
int noti_err = NOTIFICATION_ERROR_NONE;
if (noti_type == MSG_NOTI_TYPE_ALL) {
-
noti_err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
-
} else if (noti_type == MSG_NOTI_TYPE_VOICE_1 || noti_type == MSG_NOTI_TYPE_VOICE_2 || noti_type == MSG_NOTI_TYPE_SIM) {
int notiId = 0;
if (allow_to_notify) {
MSG_DEBUG("message notification is allowed");
- // check do not disturb mode
+ /* check do not disturb mode */
err = notification_system_setting_load_system_setting(&system_setting);
if (err != NOTIFICATION_ERROR_NONE || system_setting == NULL) {
noti_id = MsgSettingGetInt(MSG_SENTFAIL_NOTI_ID);
break;
case MSG_NOTI_TYPE_VOICE_1: {
- char keyName[MAX_VCONFKEY_NAME_LEN] = {0,};
+ char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
snprintf(keyName, sizeof(keyName), "%s/%d", VOICE_NOTI_ID_1, sim_idx);
noti_id = MsgSettingGetInt(keyName);
break;
}
case MSG_NOTI_TYPE_VOICE_2: {
- char keyName[MAX_VCONFKEY_NAME_LEN] = {0,};
+ char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
snprintf(keyName, sizeof(keyName), "%s/%d", VOICE_NOTI_ID_2, sim_idx);
noti_id = MsgSettingGetInt(keyName);
break;
err = MsgSettingSetInt(MSG_SENTFAIL_NOTI_ID, noti_id);
break;
case MSG_NOTI_TYPE_VOICE_1: {
- char keyName[MAX_VCONFKEY_NAME_LEN] = {0,};
+ char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
snprintf(keyName, sizeof(keyName), "%s/%d", VOICE_NOTI_ID_1, sim_idx);
err = MsgSettingSetInt(keyName, noti_id);
break;
}
case MSG_NOTI_TYPE_VOICE_2: {
- char keyName[MAX_VCONFKEY_NAME_LEN] = {0,};
+ char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
snprintf(keyName, sizeof(keyName), "%s/%d", VOICE_NOTI_ID_2, sim_idx);
err = MsgSettingSetInt(keyName, noti_id);
break;
setServiceOperation(noti_info->svc_h, APP_CONTROL_OPERATION_CALL);
setServiceUri(noti_info->svc_h, MSG_TEL_URI_VOICEMAIL);
- char slot_id[5] = {0,};
+ char slot_id[5] = {0, };
snprintf(slot_id, sizeof(slot_id), "%d", msg_info->sim_idx - 1);
addServiceExtraData(noti_info->svc_h, "slot_id", slot_id);
}
setServiceOperation(noti_info->svc_h, APP_CONTROL_OPERATION_CALL);
setServiceUri(noti_info->svc_h, MSG_TEL_URI_VOICEMAIL);
- char slot_id[5] = {0,};
+ char slot_id[5] = {0, };
snprintf(slot_id, sizeof(slot_id), "%d", msg_info->sim_idx - 1);
addServiceExtraData(noti_info->svc_h, "slot_id", slot_id);
}
}
snprintf(msg_info->addressList[0].displayName, sizeof(msg_info->addressList[0].displayName), "%s", contactInfo.firstName);
-#endif //MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /*MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
if (msg_info->addressList[0].displayName[0] == '\0')
- snprintf(noti_info->sender, sizeof(noti_info->sender), "%s",msg_info->addressList[0].addressVal);
+ snprintf(noti_info->sender, sizeof(noti_info->sender), "%s", msg_info->addressList[0].addressVal);
else
- snprintf(noti_info->sender, sizeof(noti_info->sender), "%s",msg_info->addressList[0].displayName);
+ snprintf(noti_info->sender, sizeof(noti_info->sender), "%s", msg_info->addressList[0].displayName);
snprintf(noti_info->number, sizeof(noti_info->number), "%s", msg_info->addressList[0].addressVal);
}
snprintf(msg_info->addressList[0].displayName, sizeof(msg_info->addressList[0].displayName), "%s", contactInfo.firstName);
-#endif //MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /*MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
if (msg_info->addressList[0].displayName[0] == '\0')
- snprintf(noti_info->sender, sizeof(noti_info->sender), "%s",msg_info->addressList[0].addressVal);
+ snprintf(noti_info->sender, sizeof(noti_info->sender), "%s", msg_info->addressList[0].addressVal);
else
- snprintf(noti_info->sender, sizeof(noti_info->sender), "%s",msg_info->addressList[0].displayName);
+ snprintf(noti_info->sender, sizeof(noti_info->sender), "%s", msg_info->addressList[0].displayName);
if (msg_info->addressList[0].displayName[0] == '\0')
- snprintf(noti_info->sender, sizeof(noti_info->sender), "%s",msg_info->addressList[0].addressVal);
+ snprintf(noti_info->sender, sizeof(noti_info->sender), "%s", msg_info->addressList[0].addressVal);
else
- snprintf(noti_info->sender, sizeof(noti_info->sender), "%s",msg_info->addressList[0].displayName);
+ snprintf(noti_info->sender, sizeof(noti_info->sender), "%s", msg_info->addressList[0].displayName);
- snprintf(noti_info->number, sizeof(noti_info->number), "%s",msg_info->addressList[0].addressVal);
+ snprintf(noti_info->number, sizeof(noti_info->number), "%s", msg_info->addressList[0].addressVal);
MsgDbHandler *dbhandler = getDbHandle();
char sqlQuery[MAX_QUERY_LEN+1];
{
MSG_BEGIN();
- char unreadMsgCntStr[10] = {0,};
+ char unreadMsgCntStr[10] = {0, };
bool bPreview;
if (MsgSettingGetBool(MSG_SETTING_PREVIEW, &bPreview) != MSG_SUCCESS) {
}
MSG_END();
-
}
void setIcon(notification_h noti_h, MSG_NOTI_INFO_S *noti_info)
switch (noti_info->type) {
#ifdef MSG_NOTI_INTEGRATION
- case MSG_NOTI_TYPE_NORMAL :
- case MSG_NOTI_TYPE_CB :
- case MSG_NOTI_TYPE_SIM :
- {
+ case MSG_NOTI_TYPE_NORMAL:
+ case MSG_NOTI_TYPE_CB:
+ case MSG_NOTI_TYPE_SIM: {
setNotiImage(noti_h, NOTIFICATION_IMAGE_TYPE_ICON_FOR_INDICATOR, MSG_NORMAL_STATUS_ICON);
if (noti_info->count > 1 && noti_info->senderCount > 1) {
setNotiImage(noti_h, NOTIFICATION_IMAGE_TYPE_ICON_FOR_LOCK, MSG_NORMAL_ICON_PATH);
break;
}
#else
- case MSG_NOTI_TYPE_NORMAL :
- {
+ case MSG_NOTI_TYPE_NORMAL: {
setNotiImage(noti_h, NOTIFICATION_IMAGE_TYPE_ICON_FOR_INDICATOR, MSG_NORMAL_STATUS_ICON);
setNotiImage(noti_h, NOTIFICATION_IMAGE_TYPE_ICON_FOR_LOCK, MSG_NORMAL_ICON_PATH);
}
MSG_END();
-
}
MSG_BEGIN();
switch (noti_info->type) {
- case MSG_NOTI_TYPE_NORMAL :
- case MSG_NOTI_TYPE_SIM :
- {
+ case MSG_NOTI_TYPE_NORMAL:
+ case MSG_NOTI_TYPE_SIM: {
switch (noti_info->active_subtype) {
- case MSG_CB_SMS :
+ case MSG_CB_SMS:
setNotiImage(noti_h, NOTIFICATION_IMAGE_TYPE_ICON, MSG_CB_ICON_PATH);
break;
- case MSG_WAP_SI_SMS :
- case MSG_WAP_SL_SMS :
+ case MSG_WAP_SI_SMS:
+ case MSG_WAP_SL_SMS:
setNotiImage(noti_h, NOTIFICATION_IMAGE_TYPE_ICON, MSG_ACTIVE_PUSH_ICON_PATH);
- case MSG_SYNCML_CP :
+ case MSG_SYNCML_CP:
setNotiImage(noti_h, NOTIFICATION_IMAGE_TYPE_ICON, MSG_OTA_ICON_PATH);
- default :
+ default:
if (noti_info->imagePath[0] != '\0')
setNotiImage(noti_h, NOTIFICATION_IMAGE_TYPE_ICON, noti_info->imagePath);
else
break;
}
- case MSG_NOTI_TYPE_CB :
- {
+ case MSG_NOTI_TYPE_CB: {
setNotiImage(noti_h, NOTIFICATION_IMAGE_TYPE_ICON, MSG_CB_ICON_PATH);
break;
}
- case MSG_NOTI_TYPE_CLASS0 :
+ case MSG_NOTI_TYPE_CLASS0:
setNotiImage(noti_h, NOTIFICATION_IMAGE_TYPE_ICON, MSG_NORMAL_ICON_PATH);
break;
default:
if (msg_err == MSG_SUCCESS) {
MSG_DEBUG("Unread count [%d]", noti_info.count);
if (noti_info.count == 1) {
- MSG_SEC_DEBUG("noti_info.sender [%s]",noti_info.sender);
+ MSG_SEC_DEBUG("noti_info.sender [%s]", noti_info.sender);
setNotiText(noti, NOTIFICATION_TEXT_TYPE_TITLE, noti_info.sender, NULL);
setNotiText(noti, NOTIFICATION_TEXT_TYPE_CONTENT, noti_info.text, NULL);
} else if (noti_info.count > 1) {
setNotiImage(noti, NOTIFICATION_IMAGE_TYPE_ICON, MSG_NORMAL_ICON_PATH);
}
break;
-
}
case MSG_NOTI_TYPE_FAILED: {
notiMsg = getTranslateText(MSG_APP_PACKAGE_NAME, MSG_APP_LOCALEDIR, FAILED_TO_SEND_MESSAGE);
MSG_DEBUG("Active Notification button 1 - Msg Id = [%d]", noti_info->msg_id);
- char tel_num[MSG_NOTI_TEXT_LEN_S] = {0,};
+ char tel_num[MSG_NOTI_TEXT_LEN_S] = {0, };
snprintf(tel_num, sizeof(tel_num), "tel:%s", noti_info->number);
MSG_SEC_DEBUG("Active sender number [%s]", noti_info->number);
setServiceUri(noti_info->active_noti_svc_h[0], tel_num);
addServiceExtraData(noti_info->active_noti_svc_h[1], "type", "reply");
addServiceExtraData(noti_info->active_noti_svc_h[1], "msgId", noti_info->msg_id);
- char slot_id[5] = {0,};
+ char slot_id[5] = {0, };
snprintf(slot_id, sizeof(slot_id), "%d", noti_info->sim_idx - 1);
addServiceExtraData(noti_info->active_noti_svc_h[1], "slot_id", slot_id);
}
addServiceExtraData(noti_info->active_noti_svc_h[2], "msgId", noti_info->msg_id);
addServiceExtraData(noti_info->active_noti_svc_h[2], "CALLER", "active_noti");
- char slot_id[5] = {0,};
+ char slot_id[5] = {0, };
snprintf(slot_id, sizeof(slot_id), "%d", noti_info->sim_idx - 1);
addServiceExtraData(noti_info->active_noti_svc_h[2], "slot_id", slot_id);
}
case MSG_NOTI_TYPE_CB:
case MSG_NOTI_TYPE_SIM:
#endif
- {
- int smsUnreadCnt = 0;
+ {
+ int smsUnreadCnt = 0;
int mmsUnreadCnt = 0;
char sqlQuery[MAX_QUERY_LEN+1];
return MSG_ERR_DB_PREPARE;
if (dbhandler->stepQuery() == MSG_ERR_DB_ROW) {
-
smsUnreadCnt = dbhandler->columnInt(6);
mmsUnreadCnt = dbhandler->columnInt(7);
msgSize = dbhandler->columnInt(8);
MsgSoundSetRepeatAlarm();
}
} else {
-
MSG_DEBUG("No unread message.");
MSG_DEBUG("notiPrivId [%d]", noti_info->id);
if (MsgSettingSetInt(NOTIFICATION_PRIV_ID, noti_info->id) != MSG_SUCCESS)
MSG_DEBUG("MsgSettingSetInt fail : NOTIFICATION_PRIV_ID");
- MsgSettingHandleNewMsg(0,0);
+ MsgSettingHandleNewMsg(0, 0);
MsgInsertBadge(0);
MsgSoundSetRepeatAlarm();
}
return MSG_ERR_DB_PREPARE;
if (dbhandler->stepQuery() == MSG_ERR_DB_ROW) {
-
noti_info->count = dbhandler->columnInt(4);
if (noti_info->count > 0) {
MSG_DEBUG("unread SIM message [%d].", noti_info->msg_id);
} else {
-
MSG_DEBUG("No unread SIM message.");
MSG_DEBUG("notiPrivId [%d]", noti_info->id);
return MSG_ERR_DB_PREPARE;
if (dbhandler->stepQuery() == MSG_ERR_DB_ROW) {
-
noti_info->count = dbhandler->columnInt(6);
if (noti_info->count > 0) {
}
}
} else {
-
MSG_DEBUG("No sent failed message.");
MSG_DEBUG("failedNotiId [%d]", noti_info->id);
}
*/
+#if 0
static int MsgSoundPlayCallback(int message, void *param, void *user_param)
{
#ifdef _USE_MM_FW_
#endif
return 1;
}
+#endif
/*==================================================================================================
IMPLEMENTATION OF MsgSoundPlayer - Member Functions
MsgSoundPlayer::~MsgSoundPlayer()
{
-
}
tmpFilePath = NULL;
}
#endif /* MSG_WEARABLE_PROFILE */
-
}
bool bMsgSettingNoti = true; /* Alert for message notification */
bool bMsgSettingVibration = false; /* vibration for message notification */
- MSG_RINGTONE_TYPE_T ringtoneType = MSG_RINGTONE_TYPE_DEFAULT; //sound type for message notification
+ MSG_RINGTONE_TYPE_T ringtoneType = MSG_RINGTONE_TYPE_DEFAULT; /*sound type for message notification */
bool bMsgSettingSound = true;
MsgSettingGetBool(MSG_SETTING_VIBRATION, &bMsgSettingVibration);
pthread_mutex_lock(&muMmPlay);
- if (bPlaying == true && hPlayerHandle != 0 ) {
+ if (bPlaying == true && hPlayerHandle != 0) {
MSG_DEBUG("stopping the player.");
/* Stop playing media contents */
int err = mm_player_stop(hPlayerHandle);
memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILTER_ID FROM %s WHERE FILTER_TYPE = %d AND '%s' LIKE (CASE WHEN LENGTH(FILTER_VALUE)>%d-1 THEN '%%'||SUBSTR(FILTER_VALUE, LENGTH(FILTER_VALUE)-%d+1) ELSE FILTER_VALUE END) AND FILTER_ACTIVE = 1 \
- UNION SELECT FILTER_ID FROM %s WHERE FILTER_TYPE = %d AND '%s' LIKE SUBSTR(FILTER_VALUE,1)||'%%' AND FILTER_ACTIVE = 1 \
- UNION SELECT FILTER_ID FROM %s WHERE FILTER_TYPE = %d AND '%s' LIKE '%%'||SUBSTR(FILTER_VALUE,1)||'%%' AND FILTER_ACTIVE = 1 \
- UNION SELECT FILTER_ID FROM %s WHERE FILTER_TYPE = %d AND '%s' LIKE '%%'||SUBSTR(FILTER_VALUE,1) AND FILTER_ACTIVE = 1;",
+ snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILTER_ID FROM %s WHERE FILTER_TYPE = %d AND '%s' LIKE (CASE WHEN LENGTH(FILTER_VALUE) > %d-1 THEN '%%' || SUBSTR(FILTER_VALUE, LENGTH(FILTER_VALUE)-%d+1) ELSE FILTER_VALUE END) AND FILTER_ACTIVE = 1 \
+ UNION SELECT FILTER_ID FROM %s WHERE FILTER_TYPE = %d AND '%s' LIKE SUBSTR(FILTER_VALUE, 1) || '%%' AND FILTER_ACTIVE = 1 \
+ UNION SELECT FILTER_ID FROM %s WHERE FILTER_TYPE = %d AND '%s' LIKE '%%' || SUBSTR(FILTER_VALUE, 1) || '%%' AND FILTER_ACTIVE = 1 \
+ UNION SELECT FILTER_ID FROM %s WHERE FILTER_TYPE = %d AND '%s' LIKE '%%' || SUBSTR(FILTER_VALUE, 1) AND FILTER_ACTIVE = 1;",
MSGFW_FILTER_TABLE_NAME, MSG_FILTER_BY_ADDRESS_SAME, pMsgInfo->addressList[0].addressVal, MsgContactGetMinMatchDigit(), MsgContactGetMinMatchDigit(),
MSGFW_FILTER_TABLE_NAME, MSG_FILTER_BY_ADDRESS_START, pMsgInfo->addressList[0].addressVal,
MSGFW_FILTER_TABLE_NAME, MSG_FILTER_BY_ADDRESS_INCLUDE, pMsgInfo->addressList[0].addressVal,
MSG_DEBUG("VCONFKEY_SETAPPL_DRIVINGMODE_DRIVINGMODE [%d]", isTTSOn);
if(isTTSOn) {
-
bool isVoiceMail = false;
if (msgSubType == MSG_MWI_VOICE_SMS) {
if (pMsgInfo->folderId == MSG_INBOX_ID)
MsgInsertNotification(pMsgInfo);
- } else if (subType == MSG_RETRIEVE_MANUALCONF_MMS) {
+ } else if (subType == MSG_RETRIEVE_MANUALCONF_MMS) {
if (pMsgInfo->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS) {
MSG_DEBUG("Manual success");
#if 0 //disable as per UX request to not show success notification : 2015.9.18
MsgInsertTicker("Retrieving message failed", RETRIEVING_MESSAGE_FAILED, true, pMsgInfo->msgId);
}
}
- }
- else if (pMsgInfo->msgType.subType == MSG_SENDREQ_MMS || pMsgInfo->msgType.subType == MSG_SENDCONF_MMS)
- {
+ } else if (pMsgInfo->msgType.subType == MSG_SENDREQ_MMS || pMsgInfo->msgType.subType == MSG_SENDCONF_MMS) {
MsgPlugin *plg = MsgPluginManager::instance()->getPlugin(pMsgInfo->msgType.mainType);
if (plg == NULL)
return MSG_ERR_NULL_POINTER;
if (err != MSG_SUCCESS)
return MSG_ERR_STORAGE_ERROR;
- if (pMsgInfo->networkStatus == MSG_NETWORK_SEND_SUCCESS)
- {
+ if (pMsgInfo->networkStatus == MSG_NETWORK_SEND_SUCCESS) {
err = MsgStoMoveMessageToFolder(pMsgInfo->msgId, MSG_SENTBOX_ID);
if (err != MSG_SUCCESS)
return MSG_ERR_STORAGE_ERROR;
MsgDisplayLock();
if (pMsgInfo->msgType.mainType == MSG_SMS_TYPE) {
-
bool bOnlyNoti = false;
err = MsgHandleSMS(pMsgInfo, pSendNoti, &bOnlyNoti);
- if (err == MSG_SUCCESS && ((*pSendNoti)||bOnlyNoti)) {
+ if (err == MSG_SUCCESS && ((*pSendNoti) || bOnlyNoti)) {
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
bool isFavorites = false;
if (!checkBlockingMode(pMsgInfo->addressList[0].addressVal, &isFavorites)) {
#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
MsgInsertNotification(pMsgInfo);
}
- }
- else if (pMsgInfo->msgType.mainType == MSG_MMS_TYPE)
- {
+ } else if (pMsgInfo->msgType.mainType == MSG_MMS_TYPE) {
err = MsgHandleMMS(pMsgInfo, pSendNoti);
}
(pMsgInfo->folderId == MSG_INBOX_ID || pMsgInfo->folderId == MSG_SPAMBOX_ID) &&
(pMsgInfo->msgType.mainType == MSG_SMS_TYPE) &&
(pMsgInfo->msgType.subType != MSG_WAP_SL_SMS)) {
-
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
MSG_DEBUG("Enter MsgAddPhoneLog() : pMsg->folderId [%d]", pMsgInfo->folderId);
-
MsgAddPhoneLog(pMsgInfo);
#endif //MSG_CONTACTS_SERVICE_NOT_SUPPORTED
}
}
} else if ((pMsgInfo->msgType.subType == MSG_WAP_SI_SMS) || (pMsgInfo->msgType.subType == MSG_WAP_CO_SMS) || (pMsgInfo->msgType.subType == MSG_WAP_SL_SMS)) {
MSG_DEBUG("Add WAP Push Message");
- switch (pMsgInfo->msgType.subType)
- {
+ switch (pMsgInfo->msgType.subType) {
case MSG_WAP_SI_SMS:
case MSG_WAP_SL_SMS:
err = MsgStoAddWAPMsg(pMsgInfo);
}
} else if ((pMsgInfo->msgType.subType == MSG_CB_SMS) || (pMsgInfo->msgType.subType == MSG_JAVACB_SMS)) {
/** check add message option */
- }
- else if (pMsgInfo->msgType.subType == MSG_STATUS_REPORT_SMS) {
+ } else if (pMsgInfo->msgType.subType == MSG_STATUS_REPORT_SMS) {
MSG_DEBUG("Add Report Message");
- }
- else if (pMsgInfo->msgType.subType >= MSG_MWI_VOICE_SMS && pMsgInfo->msgType.subType <= MSG_MWI_OTHER_SMS) {
+ } else if (pMsgInfo->msgType.subType >= MSG_MWI_VOICE_SMS && pMsgInfo->msgType.subType <= MSG_MWI_OTHER_SMS) {
char keyName[MAX_VCONFKEY_NAME_LEN];
memset(keyName, 0x00, sizeof(keyName));
snprintf(keyName, sizeof(keyName), "%s/%d", VOICEMAIL_NUMBER, pMsgInfo->sim_idx);
app_control_h svc_handle = NULL;
switch (pMsgInfo->msgType.subType) {
- case MSG_WAP_SL_SMS:
- {
+ case MSG_WAP_SL_SMS: {
*pSendNoti = true;
if (serviceType == MSG_PUSH_SERVICE_ALWAYS) {
app_control_destroy(svc_handle);
} else if (serviceType == MSG_PUSH_SERVICE_PROMPT) {
-
MSG_DEBUG("WAP Message SL(Always Ask) start.");
app_control_h svc_h;
} else {
MSG_DEBUG("Process Message Fail : processReceivedInd()");
}
-
}
}
return err;
}
-
MSG_DEBUG("Start InitMsgServer.");
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
- // Init contact digit number
+ /* Init contact digit number */
MsgInitContactSvc();
-#endif // MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
MsgInitCallStatusManager();
- //CID 356902: Moving try block up to include MsgStoInitDB which also throws MsgException
- try
- {
- // storage handler initialize
+ try {
+ /* storage handler initialize */
err = MsgStoInitDB(false);
if (err != MSG_SUCCESS) {
MSG_ERR("FAIL TO INITIALIZE STORAGE HANDLER [%d]", err);
MsgInitNoti();
- // plugin manager initialize
+ /* plugin manager initialize */
MsgPluginManager::instance()->initialize();
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
- }
- catch (exception& e)
- {
+ } catch (exception& e) {
MSG_FATAL("%s", e.what());
}
-
-// MsgSoundPlayer::instance()->MsgSoundInitRepeatAlarm();
+/* MsgSoundPlayer::instance()->MsgSoundInitRepeatAlarm(); */
MsgStoDisconnectDB();
void* StartMsgServer(void*)
{
- try
- {
+ try {
if (MsgTransactionManager::instance()->initCynara() == false) {
MSG_ERR("Cynara initialize failed. It will try again when API is called.");
}
MsgTransactionManager::instance()->run();
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
- }
- catch (exception& e)
- {
+ } catch (exception& e) {
MSG_FATAL("%s", e.what());
}
#if !GLIB_CHECK_VERSION(2, 36, 0)
g_type_init();
#endif
- // Reset message server ready flag
+ /* Reset message server ready flag */
if(MsgSettingSetBool(VCONFKEY_MSG_SERVER_READY, false) != MSG_SUCCESS)
MSG_DEBUG("MsgSettingSetBool FAIL: VCONFKEY_MSG_SERVER_READY");
- // init server
+ /* init server */
InitMsgServer(NULL);
pthread_t startThreadId;
- // start transaction manager
- if (pthread_create(&startThreadId, NULL, StartMsgServer, NULL) != 0)
- {
+ /* start transaction manager */
+ if (pthread_create(&startThreadId, NULL, StartMsgServer, NULL) != 0) {
MSG_DEBUG("StartMsgServer not invoked: %s", g_strerror(errno));
return -1;
}
mainloop = g_main_loop_new(NULL, FALSE);
- if (mainloop != NULL)
- {
+ if (mainloop != NULL) {
MSG_DEBUG("Start Messaging Framework!!!");
- // Run GMainLoop
+ /* Run GMainLoop */
g_main_loop_run(mainloop);
- }
- else
- {
+ } else {
MSG_DEBUG("Fail to start Messaging Framework!!!");
}
- //contacts-service is not used for gear
+ /* contacts-service is not used for gear */
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
- // Close Contact Sevice
+ /* Close Contact Sevice */
MsgCloseContactSvc();
-#endif //MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /*MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
- // Disconnect to DB
+ /* Disconnect to DB */
MsgStoDisconnectDB();
MsgDeInitCallStatusManager();
MSG_DEBUG("SENT STATUS %d, %d", pSentStatus->reqId, pSentStatus->status);
- // establish connection to msgfw daemon
+ /* establish connection to msgfw daemon */
MsgIpcClientSocket client;
- try
- {
+ try {
client.connect(MSG_SOCKET_PATH);
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return;
}
-
-
- // composing command
- int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_SENT_STATUS_S); // cmd type, MSG_SENT_STATUS
+ /* composing command */
+ int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_SENT_STATUS_S); /* cmd type, MSG_SENT_STATUS */
char cmdBuf[cmdSize];
bzero(cmdBuf, cmdSize);
MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
- // Set Command Parameters
+ /* Set Command Parameters */
pCmd->cmdType = MSG_CMD_PLG_SENT_STATUS_CNF;
memset(pCmd->cmdCookie, 0x00, MAX_COOKIE_LEN);
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), pSentStatus, sizeof(MSG_SENT_STATUS_S));
- // Send Command to Transaction Manager
+ /* Send Command to Transaction Manager */
client.write(cmdBuf, cmdSize);
- // Receive result from Transaction Manager
+ /* Receive result from Transaction Manager */
MSG_DEBUG("Waiting result for SENT STATUS");
char *temp = NULL;
unsigned int len;
client.read(&temp, &len);
- // close connection to msgfw daemon
+ /* close connection to msgfw daemon */
client.close();
MSG_END();
MSG_DEBUG("StorageChangeType : [%d], msg ID : [%d]", storageChangeType, pMsgIdList->msgIdList[i]);
}
- // establish connection to msgfw daemon
+ /* establish connection to msgfw daemon */
MsgIpcClientSocket client;
- try
- {
- client.connect(MSG_SOCKET_PATH);
- }
- catch (MsgException& e)
- {
+ try {
+ client.connect(MSG_SOCKET_PATH);
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return;
}
- // composing command
+ /* composing command */
int cmdSize = sizeof(MSG_CMD_S) + sizeof(int) + sizeof(msg_message_id_t) * pMsgIdList->nCount + sizeof(msg_storage_change_type_t);
char cmdBuf[cmdSize];
MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
- // Set Command Parameters
+ /* Set Command Parameters */
pCmd->cmdType = MSG_CMD_PLG_STORAGE_CHANGE_IND;
memset(pCmd->cmdCookie, 0x00, MAX_COOKIE_LEN);
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(int)), (void*)pMsgIdList->msgIdList, sizeof(msg_message_id_t)*pMsgIdList->nCount);
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(int)+(sizeof(msg_message_id_t)*pMsgIdList->nCount)), &storageChangeType, sizeof(msg_storage_change_type_t));
- // Send Command to Transaction Manager
+ /* Send Command to Transaction Manager */
client.write(cmdBuf, cmdSize);
- // Receive result from Transaction Manager
+ /* Receive result from Transaction Manager */
MSG_DEBUG("Waiting result for STORAGE CHANGE");
char *temp = NULL;
unsigned int len;
client.read(&temp, &len);
- // close connection to msgfw daemon
+ /* close connection to msgfw daemon */
client.close();
MSG_END();
{
MSG_BEGIN();
- // establish connection to msgfw daemon
+ /* establish connection to msgfw daemon */
MsgIpcClientSocket client;
- try
- {
+ try {
client.connect(MSG_SOCKET_PATH);
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_UNKNOWN;
}
- // Check Invalid Message Structure
- if (pMsg == NULL)
- {
+ /* Check Invalid Message Structure */
+ if (pMsg == NULL) {
MSG_DEBUG("pMsg is NULL !!");
-
return MSG_ERR_NULL_MESSAGE;
}
- // Allocate Memory to Command Data
+ /* Allocate Memory to Command Data */
char* encodedData = NULL;
unique_ptr<char*, void(*)(char**)> buf(&encodedData, unique_ptr_deleter);
int dataSize = MsgEncodeMsgInfo(pMsg, &encodedData);
- // composing command
- int cmdSize = sizeof(MSG_CMD_S) + dataSize; // cmd type, MSG_MESSAGE_INFO_S
+ /* composing command */
+ int cmdSize = sizeof(MSG_CMD_S) + dataSize; /* cmd type, MSG_MESSAGE_INFO_S */
MSG_DEBUG("cmdSize: %d", cmdSize);
MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
- // Set Command Parameters
+ /* Set Command Parameters */
pCmd->cmdType = MSG_CMD_PLG_INCOMING_MSG_IND;
memset(pCmd->cmdCookie, 0x00, MAX_COOKIE_LEN);
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), encodedData, dataSize);
- // Send Command to Messaging FW
+ /* Send Command to Messaging FW */
client.write(cmdBuf, cmdSize);
char* retBuf = NULL;
client.read(&retBuf, &retSize);
- // close connection to msgfw daemon
+ /* close connection to msgfw daemon */
client.close();
- // Decoding the result from FW and Returning it to plugin
- // the result is used for making delivery report
+ /* Decoding the result from FW and Returning it to plugin */
+ /* the result is used for making delivery report */
MSG_EVENT_S* pEvent = (MSG_EVENT_S*)retBuf;
if (pEvent->eventType != MSG_EVENT_PLG_INCOMING_MSG_IND)
MSG_FATAL("Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
- //THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
+ /* THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType)); */
#ifdef FEATURE_SMS_CDMA
memcpy(&(pMsg->msgId), pEvent->data, sizeof(msg_message_id_t));
{
MSG_BEGIN();
- // establish connection to msgfw daemon
+ /* establish connection to msgfw daemon */
MsgIpcClientSocket client;
- try
- {
+ try {
client.connect(MSG_SOCKET_PATH);
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_UNKNOWN;
}
- // composing command
- int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_SYNCML_MESSAGE_DATA_S); // cmd type, MSG_SYNCML_MESSAGE_DATA_S
+ /* composing command */
+ int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_SYNCML_MESSAGE_DATA_S); /* cmd type, MSG_SYNCML_MESSAGE_DATA_S */
MSG_DEBUG("cmdSize: %d", cmdSize);
bzero(cmdBuf, cmdSize);
MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
- // Set Command Parameters
+ /* Set Command Parameters */
pCmd->cmdType = MSG_CMD_PLG_INCOMING_SYNCML_IND;
memset(pCmd->cmdCookie, 0x00, MAX_COOKIE_LEN);
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), pSyncMLData, sizeof(MSG_SYNCML_MESSAGE_DATA_S));
- // Send Command to Messaging FW
+ /* Send Command to Messaging FW */
client.write(cmdBuf, cmdSize);
- // Receive result from Transaction Manager
+ /* Receive result from Transaction Manager */
char* retBuf = NULL;
unique_ptr<char*, void(*)(char**)> wrap(&retBuf, unique_ptr_deleter);
unsigned int retSize;
client.read(&retBuf, &retSize);
- // close connection to msgfw daemon
+ /* close connection to msgfw daemon */
client.close();
- // Decoding the result from FW and Returning it to plugin
- // the result is used for making delivery report
+ /* Decoding the result from FW and Returning it to plugin */
+ /* the result is used for making delivery report */
MSG_EVENT_S* pEvent = (MSG_EVENT_S*)retBuf;
if (pEvent->eventType != MSG_EVENT_PLG_INCOMING_SYNCML_MSG_IND)
MSG_FATAL("Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
- //THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
+ /*THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType)); */
MSG_END();
{
MSG_BEGIN();
- // establish connection to msgfw daemon
+ /* establish connection to msgfw daemon */
MsgIpcClientSocket client;
- try
- {
+ try {
client.connect(MSG_SOCKET_PATH);
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_UNKNOWN;
}
- // composing command
- int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_PUSH_MESSAGE_DATA_S); // cmd type, MSG_SYNCML_MESSAGE_DATA_S
+ /* composing command */
+ int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_PUSH_MESSAGE_DATA_S); /* cmd type, MSG_SYNCML_MESSAGE_DATA_S */
MSG_DEBUG("cmdSize: %d", cmdSize);
bzero(cmdBuf, cmdSize);
MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
- // Set Command Parameters
+ /* Set Command Parameters */
pCmd->cmdType = MSG_CMD_PLG_INCOMING_PUSH_IND;
memset(pCmd->cmdCookie, 0x00, MAX_COOKIE_LEN);
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), pPushData, sizeof(MSG_PUSH_MESSAGE_DATA_S));
- // Send Command to Messaging FW
+ /* Send Command to Messaging FW */
client.write(cmdBuf, cmdSize);
- // Receive result from Transaction Manager
+ /* Receive result from Transaction Manager */
char* retBuf = NULL;
unique_ptr<char*, void(*)(char**)> wrap(&retBuf, unique_ptr_deleter);
unsigned int retSize;
client.read(&retBuf, &retSize);
- // close connection to msgfw daemon
+ /* close connection to msgfw daemon */
client.close();
- // Decoding the result from FW and Returning it to plugin
- // the result is used for making delivery report
+ /* Decoding the result from FW and Returning it to plugin */
+ /* the result is used for making delivery report */
MSG_EVENT_S* pEvent = (MSG_EVENT_S*)retBuf;
if (pEvent->eventType != MSG_EVENT_PLG_INCOMING_PUSH_MSG_IND)
MSG_FATAL("Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
- //THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
+ /*THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType)); */
MSG_END();
{
MSG_BEGIN();
- // establish connection to msgfw daemon
+ /* establish connection to msgfw daemon */
MsgIpcClientSocket client;
- try
- {
+ try {
client.connect(MSG_SOCKET_PATH);
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_UNKNOWN;
}
- // Check Invalid Message Structure
- if (pCbMsg == NULL)
- {
+ /* Check Invalid Message Structure */
+ if (pCbMsg == NULL) {
MSG_DEBUG("pMsg is NULL !!");
return MSG_ERR_NULL_MESSAGE;
}
+
int cmdSize = 0;
- // Allocate Memory to Command Data
+ /* Allocate Memory to Command Data */
char* encodedData = NULL;
unique_ptr<char*, void(*)(char**)> buf(&encodedData, unique_ptr_deleter);
int dataSize = MsgEncodeMsgInfo(pMsgInfo, &encodedData);
- // composing command
+ /* composing command */
if(pCbMsg->type == MSG_ETWS_SMS)
- cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_CB_MSG_S); // cmd type, MSG_CB_MSG_S
+ cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_CB_MSG_S); /* cmd type, MSG_CB_MSG_S */
else
- cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_CB_MSG_S) + dataSize; // cmd type, MSG_CB_MSG_S
+ cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_CB_MSG_S) + dataSize; /* cmd type, MSG_CB_MSG_S */
MSG_DEBUG("cmdSize: %d", cmdSize);
MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
- // Set Command Parameters
+ /* Set Command Parameters */
pCmd->cmdType = MSG_CMD_PLG_INCOMING_CB_IND;
memset(pCmd->cmdCookie, 0x00, MAX_COOKIE_LEN);
if(pCbMsg->type != MSG_ETWS_SMS)
memcpy((void*)((char*)pCmd + sizeof(MSG_CMD_TYPE_T)+ MAX_COOKIE_LEN + sizeof(MSG_CB_MSG_S)), encodedData, dataSize);
- // Send Command to Messaging FW
+ /* Send Command to Messaging FW */
client.write(cmdBuf, cmdSize);
char* retBuf = NULL;
client.read(&retBuf, &retSize);
- // close connection to msgfw daemon
+ /* close connection to msgfw daemon */
client.close();
- // Decoding the result from FW and Returning it to plugin
- // the result is used for making delivery report
+ /* Decoding the result from FW and Returning it to plugin */
+ /* the result is used for making delivery report */
MSG_EVENT_S* pEvent = (MSG_EVENT_S*)retBuf;
if (pEvent->eventType != MSG_EVENT_PLG_INCOMING_CB_MSG_IND)
MSG_FATAL("Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
- //THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
+ /*THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType)); */
MSG_END();
{
MSG_BEGIN();
- // establish connection to msgfw daemon
+ /* establish connection to msgfw daemon */
MsgIpcClientSocket client;
- try
- {
+ try {
client.connect(MSG_SOCKET_PATH);
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_UNKNOWN;
}
- // composing command
- int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_LBS_MESSAGE_DATA_S); // cmd type, MSG_LBS_MESSAGE_DATA_S
+ /* composing command */
+ int cmdSize = sizeof(MSG_CMD_S) + sizeof(MSG_LBS_MESSAGE_DATA_S); /* cmd type, MSG_LBS_MESSAGE_DATA_S */
MSG_DEBUG("cmdSize: %d", cmdSize);
bzero(cmdBuf, cmdSize);
MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
- // Set Command Parameters
+ /* Set Command Parameters */
pCmd->cmdType = MSG_CMD_PLG_INCOMING_LBS_IND;
memset(pCmd->cmdCookie, 0x00, MAX_COOKIE_LEN);
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), pLBSData, sizeof(MSG_LBS_MESSAGE_DATA_S));
- // Send Command to Messaging FW
+ /* Send Command to Messaging FW */
client.write(cmdBuf, cmdSize);
- // Receive result from Transaction Manager
+ /* Receive result from Transaction Manager */
char* retBuf = NULL;
unique_ptr<char*, void(*)(char**)> wrap(&retBuf, unique_ptr_deleter);
unsigned int retSize;
client.read(&retBuf, &retSize);
- // close connection to msgfw daemon
+ /* close connection to msgfw daemon */
client.close();
- // Decoding the result from FW and Returning it to plugin
- // the result is used for making delivery report
+ /* Decoding the result from FW and Returning it to plugin */
+ /* the result is used for making delivery report */
MSG_EVENT_S* pEvent = (MSG_EVENT_S*)retBuf;
if (pEvent->eventType != MSG_EVENT_PLG_INCOMING_LBS_MSG_IND)
MSG_FATAL("Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
- //THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
+ /*THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType)); */
MSG_END();
{
MSG_BEGIN();
- // establish connection to msgfw daemon
+ /* establish connection to msgfw daemon */
MsgIpcClientSocket client;
- try
- {
+ try {
client.connect(MSG_SOCKET_PATH);
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_UNKNOWN;
}
- // composing command
+ /* composing command */
int cmdSize = sizeof(MSG_CMD_S);
char cmdBuf[cmdSize];
MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
- // Set Command Parameters
+ /* Set Command Parameters */
pCmd->cmdType = MSG_CMD_PLG_INIT_SIM_BY_SAT;
- // Send Command to Transaction Manager
+ /* Send Command to Transaction Manager */
client.write(cmdBuf, cmdSize);
- // Receive result from Transaction Manager
+ /* Receive result from Transaction Manager */
char* retBuf = NULL;
unique_ptr<char*, void(*)(char**)> wrap(&retBuf, unique_ptr_deleter);
unsigned int retSize;
client.read(&retBuf, &retSize);
- // close connection to msgfw daemon
+ /* close connection to msgfw daemon */
client.close();
- // Decoding the result from FW and Returning it to plugin
+ /* Decoding the result from FW and Returning it to plugin */
MSG_EVENT_S* pEvent = (MSG_EVENT_S*)retBuf;
if (pEvent->eventType != MSG_EVENT_PLG_INIT_SIM_BY_SAT)
MSG_FATAL("Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
- //THROW(MsgException::INVALID_RESULT, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
+ /*THROW(MsgException::INVALID_RESULT, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType)); */
MSG_END();
MSG_BEGIN();
MSG_SEC_DEBUG("pMsg = %s, pReqId = %d ", pMsg->msgData, *pReqId);
- // establish connection to msgfw daemon
+ /* establish connection to msgfw daemon */
MsgIpcClientSocket client;
- try
- {
+ try {
client.connect(MSG_SOCKET_PATH);
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_UNKNOWN;
}
- // Allocate Memory to Command Data
+ /* Allocate Memory to Command Data */
char* encodedData = NULL;
unique_ptr<char*, void(*)(char**)> buf(&encodedData, unique_ptr_deleter);
int dataSize = MsgEncodeMsgInfo(pMsg, &encodedData);
- // composing command
- int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_request_id_t) + dataSize; // cmd type, MSG_MESSAGE_INFO_S, msg_request_id_t
+ /* composing command */
+ int cmdSize = sizeof(MSG_CMD_S) + sizeof(msg_request_id_t) + dataSize; /* cmd type, MSG_MESSAGE_INFO_S, msg_request_id_t */
MSG_DEBUG("cmdSize : %d", cmdSize);
char cmdBuf[cmdSize];
MSG_CMD_S *pCmd = (MSG_CMD_S *)cmdBuf;
- // Set Command Parameters
- pCmd->cmdType = MSG_CMD_PLG_INCOMING_MMS_CONF; // cmd type
+ /* Set Command Parameters */
+ pCmd->cmdType = MSG_CMD_PLG_INCOMING_MMS_CONF; /* cmd type */
- memset(pCmd->cmdCookie, 0x00, MAX_COOKIE_LEN); // cmd cookie
+ memset(pCmd->cmdCookie, 0x00, MAX_COOKIE_LEN); /* cmd cookie */
- // cmd data
+ /* cmd data */
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), pReqId, sizeof(msg_request_id_t));
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN + sizeof(msg_request_id_t)), encodedData, dataSize);
- // Send Command to Messaging FW
+ /* Send Command to Messaging FW */
client.write(cmdBuf, cmdSize);
- // Receive result from Transaction Manager
+ /* Receive result from Transaction Manager */
char *retBuf = NULL;
unique_ptr<char*, void(*)(char**)> wrap(&retBuf, unique_ptr_deleter);
unsigned int retSize = 0;
client.read(&retBuf, &retSize);
- // close connection to msgfw daemon
+ /* close connection to msgfw daemon */
client.close();
- // Decoding the result from FW and Returning it to plugin
+ /* Decoding the result from FW and Returning it to plugin */
MSG_EVENT_S *pEvent = (MSG_EVENT_S *)retBuf;
if(pEvent->eventType != MSG_EVENT_PLG_INCOMING_MMS_CONF)
MSG_FATAL("Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
- //THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
+ /*THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType)); */
MSG_END();
{
MSG_BEGIN();
- // establish connection to msgfw daemon
+ /* establish connection to msgfw daemon */
MsgIpcClientSocket client;
- try
- {
+ try {
client.connect(MSG_SOCKET_PATH);
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_UNKNOWN;
}
- // Check Invalid Message Structure
- if (pMsg == NULL)
- {
+ /* Check Invalid Message Structure */
+ if (pMsg == NULL) {
MSG_DEBUG("pMsg is NULL !!");
-
return MSG_ERR_NULL_MESSAGE;
}
- // Allocate Memory to Command Data
+ /* Allocate Memory to Command Data */
char* encodedData = NULL;
unique_ptr<char*, void(*)(char**)> buf(&encodedData, unique_ptr_deleter);
int dataSize = MsgEncodeMsgInfo(pMsg, &encodedData);
dataSize += ((sizeof(int)*size) + 1);
- // composing command
- int cmdSize = sizeof(MSG_CMD_S) + dataSize; // cmd type, MSG_MESSAGE_INFO_S
+ /* composing command */
+ int cmdSize = sizeof(MSG_CMD_S) + dataSize; /* cmd type, MSG_MESSAGE_INFO_S */
MSG_DEBUG("cmdSize: %d", cmdSize);
MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
- // Set Command Parameters
+ /* Set Command Parameters */
pCmd->cmdType = MSG_CMD_ADD_SIM_MSG;
memset(pCmd->cmdCookie, 0x00, MAX_COOKIE_LEN);
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), encodedData2, dataSize);
- // Send Command to Messaging FW
+ /* Send Command to Messaging FW */
client.write(cmdBuf, cmdSize);
char* retBuf = NULL;
client.read(&retBuf, &retSize);
- // close connection to msgfw daemon
+ /* close connection to msgfw daemon */
client.close();
- // Decoding the result from FW and Returning it to plugin
- // the result is used for making delivery report
+ /* Decoding the result from FW and Returning it to plugin */
+ /* the result is used for making delivery report */
MSG_EVENT_S* pEvent = (MSG_EVENT_S*)retBuf;
if (pEvent->eventType != MSG_EVENT_ADD_SIM_MSG)
MSG_FATAL("Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
- //THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
+ /*THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType)); */
- //CID 48645: pEvent->data is an array hence null check is not required on it.
+ /*CID 48645: pEvent->data is an array hence null check is not required on it. */
if (retMsgId) {
memcpy(retMsgId, pEvent->data, sizeof(msg_message_id_t));
MSG_DEBUG("Saved SIM message ID = [%d]", *retMsgId);
msg_error_t MsgResendMessageListener(void)
{
- // establish connection to msgfw daemon
+ /* establish connection to msgfw daemon */
MsgIpcClientSocket client;
- try
- {
+ try {
client.connect(MSG_SOCKET_PATH);
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_UNKNOWN;
}
- // composing command
+ /* composing command */
int cmdSize = sizeof(MSG_CMD_S);
char cmdBuf[cmdSize];
MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
- // Set Command Parameters
+ /* Set Command Parameters */
pCmd->cmdType = MSG_CMD_PLG_RESEND_MESSAGE;
- // Send Command to Transaction Manager
+ /* Send Command to Transaction Manager */
client.write(cmdBuf, cmdSize);
- // Receive result from Transaction Manager
+ /* Receive result from Transaction Manager */
char* retBuf = NULL;
unique_ptr<char*, void(*)(char**)> wrap(&retBuf, unique_ptr_deleter);
unsigned int retSize;
client.read(&retBuf, &retSize);
- // close connection to msgfw daemon
+ /* close connection to msgfw daemon */
client.close();
- // Decoding the result from FW and Returning it to plugin
+ /* Decoding the result from FW and Returning it to plugin */
MSG_EVENT_S* pEvent = (MSG_EVENT_S*)retBuf;
if (pEvent->eventType != MSG_EVENT_PLG_RESEND_MESSAGE)
MSG_FATAL("Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
- //THROW(MsgException::INVALID_RESULT, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
+ /*THROW(MsgException::INVALID_RESULT, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType)); */
MSG_END();
{
MSG_BEGIN();
- // establish connection to msgfw daemon
+ /* establish connection to msgfw daemon */
MsgIpcClientSocket client;
- try
- {
+ try {
client.connect(MSG_SOCKET_PATH);
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_UNKNOWN;
}
- // Check Invalid Message Structure
- if (p_msg == NULL)
- {
+ /* Check Invalid Message Structure */
+ if (p_msg == NULL) {
MSG_DEBUG("p_msg is NULL !!");
-
return MSG_ERR_NULL_MESSAGE;
}
- // Allocate Memory to Command Data
+ /* Allocate Memory to Command Data */
char* encodedData = NULL;
unique_ptr<char*, void(*)(char**)> buf(&encodedData, unique_ptr_deleter);
memcpy(p, p_msg, sizeof(MSG_UNIQUE_INDEX_S));
p = (void*)((char*)p + sizeof(MSG_UNIQUE_INDEX_S));
- // composing command
- int cmdSize = sizeof(MSG_CMD_S) + dataSize; // cmd type, MSG_MESSAGE_INFO_S
+ /* composing command */
+ int cmdSize = sizeof(MSG_CMD_S) + dataSize; /* cmd type, MSG_MESSAGE_INFO_S */
MSG_DEBUG("cmdSize: %d", cmdSize);
MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
- // Set Command Parameters
+ /* Set Command Parameters */
pCmd->cmdType = MSG_CMD_PLG_CHECK_UNIQUENESS;
memset(pCmd->cmdCookie, 0x00, MAX_COOKIE_LEN);
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), encodedData, dataSize);
- // Send Command to Messaging FW
+ /* Send Command to Messaging FW */
client.write(cmdBuf, cmdSize);
char* retBuf = NULL;
client.read(&retBuf, &retSize);
- // close connection to msgfw daemon
+ /* close connection to msgfw daemon */
client.close();
- // Decoding the result from FW and Returning it to plugin
- // the result is used for making delivery report
+ /* Decoding the result from FW and Returning it to plugin */
+ /* the result is used for making delivery report */
MSG_EVENT_S* pEvent = (MSG_EVENT_S*)retBuf;
if (pEvent->eventType != MSG_EVENT_PLG_CHECK_UNIQUENESS)
MSG_FATAL("Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
- //THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
+ /*THROW(MsgException::INCOMING_MSG_ERROR, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType)); */
MSG_END();
{
MSG_BEGIN();
- // establish connection to msgfw daemon
+ /* establish connection to msgfw daemon */
MsgIpcClientSocket client;
- try
- {
+ try {
client.connect(MSG_SOCKET_PATH);
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
return MSG_ERR_UNKNOWN;
}
- // composing command
+ /* composing command */
int cmdSize = sizeof(MSG_CMD_S) + sizeof(int);
char cmdBuf[cmdSize];
MSG_CMD_S* pCmd = (MSG_CMD_S*)cmdBuf;
- // Set Command Parameters
+ /* Set Command Parameters */
pCmd->cmdType = MSG_CMD_UPDATE_IMSI;
memset(pCmd->cmdCookie, 0x00, MAX_COOKIE_LEN);
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), (const void *)&sim_idx, sizeof(int));
- // Send Command to Transaction Manager
+ /* Send Command to Transaction Manager */
client.write(cmdBuf, cmdSize);
- // Receive result from Transaction Manager
+ /* Receive result from Transaction Manager */
char* retBuf = NULL;
unique_ptr<char*, void(*)(char**)> wrap(&retBuf, unique_ptr_deleter);
unsigned int retSize;
client.read(&retBuf, &retSize);
- // close connection to msgfw daemon
+ /* close connection to msgfw daemon */
client.close();
- // Decoding the result from FW and Returning it to plugin
+ /* Decoding the result from FW and Returning it to plugin */
MSG_EVENT_S* pEvent = (MSG_EVENT_S*)retBuf;
if (pEvent->eventType != MSG_EVENT_UPDATE_IMSI)
MSG_FATAL("Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
- //THROW(MsgException::INVALID_RESULT, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType));
+ /*THROW(MsgException::INVALID_RESULT, "Wrong result(evt type %d : %s) received", pEvent->eventType, MsgDbgEvtStr(pEvent->eventType)); */
MSG_END();
if (!mLibHandler)
THROW(MsgException::PLUGIN_ERROR, "ERROR dlopen library : [%s]", libPath);
- // assign the c function pointers
+ /* assign the c function pointers */
msg_error_t(*pFunc)(MSG_PLUGIN_HANDLER_S*) = NULL;
pFunc = (msg_error_t(*)(MSG_PLUGIN_HANDLER_S*))dlsym(mLibHandler, "MsgPlgCreateHandle");
if (registerListener(&fwListener) != MSG_SUCCESS)
THROW(MsgException::PLUGIN_ERROR, "ERROR to register listener");
- // Initialize Plug-in
+ /* Initialize Plug-in */
if (initialize() != MSG_SUCCESS)
THROW(MsgException::PLUGIN_ERROR, "ERROR to initialize plugin");
}
MsgPlugin::~MsgPlugin()
{
this->finalize();
- // close mLibHandler.
+ /* close mLibHandler. */
if (mLibHandler != NULL)
dlclose(mLibHandler);
}
msg_error_t MsgPlugin::restoreMsg(MSG_MESSAGE_INFO_S *pMsgInfo, char* pRecvBody, int rcvdBodyLen, char* filePath)
{
if (mPlgHandler.pfRestoreMsg != NULL)
- return mPlgHandler.pfRestoreMsg(pMsgInfo,pRecvBody, rcvdBodyLen, filePath);
+ return mPlgHandler.pfRestoreMsg(pMsgInfo, pRecvBody, rcvdBodyLen, filePath);
else
return MSG_ERR_INVALID_PLUGIN_HANDLE;
}
MsgPluginManager::MsgPluginManager()
{
-
}
MsgPlugin *newPlg = NULL;
- try
- {
+ try {
newPlg = new MsgPlugin(__msg_plg_items[i].type, __msg_plg_items[i].path);
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
continue;
}
if (newPlg)
plgMap.insert(make_pair(__msg_plg_items[i].type, newPlg));
-
}
}
{
MsgPluginMap::iterator it;
- for (it = plgMap.begin(); it != plgMap.end(); it++)
- {
+ for (it = plgMap.begin(); it != plgMap.end(); it++) {
MsgPlugin *temp = it->second;
delete temp;
}
#ifdef USE_GCONF
err = MsgGconfGetClient();
- if (err != MSG_SUCCESS)
- {
+ if (err != MSG_SUCCESS) {
MSG_DEBUG("Get GConf Client Error");
return MSG_ERR_NULL_POINTER;
}
MSG_DEBUG("Setting Type : %d", pSetting->type);
- switch (pSetting->type)
- {
+ switch (pSetting->type) {
case MSG_GENERAL_OPT :
err = MsgSetGeneralOpt(pSetting);
break;
break;
#ifndef FEATURE_SMS_CDMA
case MSG_SMSC_LIST :
- // Check SIM is present or not
+ /* Check SIM is present or not */
snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pSetting->option.smscList.simIndex);
simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName);
break;
case MSG_CBMSG_OPT :
if (pSetting->option.cbMsgOpt.simIndex != 0) {
- // Check SIM is present or not
+ /* Check SIM is present or not */
snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pSetting->option.cbMsgOpt.simIndex);
simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName);
err = MsgSetCBMsgOpt(pSetting, true);
break;
case MSG_VOICEMAIL_OPT :
- // Check SIM is present or not
+ /* Check SIM is present or not */
snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pSetting->option.voiceMailOpt.simIndex);
simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName);
#ifdef USE_GCONF
msg_error_t err = MsgGconfGetClient();
- if (err != MSG_SUCCESS)
- {
+ if (err != MSG_SUCCESS) {
MSG_DEBUG("Get GConf Client Error");
return MSG_ERR_NULL_POINTER;
}
#endif
- char keyName[MAX_VCONFKEY_NAME_LEN] = {0,};
+ char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
MSG_SIM_STATUS_T simStatus = MSG_SIM_STATUS_NOT_FOUND;
- switch (pSetting->type)
- {
- case MSG_GENERAL_OPT :
+ switch (pSetting->type) {
+ case MSG_GENERAL_OPT:
MsgGetGeneralOpt(pSetting);
break;
- case MSG_SMS_SENDOPT :
+ case MSG_SMS_SENDOPT:
MsgGetSMSSendOpt(pSetting);
break;
- case MSG_SMSC_LIST :
- {
- // Check SIM is present or not
+ case MSG_SMSC_LIST: {
+ /* Check SIM is present or not */
snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pSetting->option.smscList.simIndex);
simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName);
MsgGetSMSCList(pSetting);
}
break;
- case MSG_MMS_SENDOPT :
+ case MSG_MMS_SENDOPT:
MsgGetMMSSendOpt(pSetting);
break;
- case MSG_MMS_RECVOPT :
+ case MSG_MMS_RECVOPT:
MsgGetMMSRecvOpt(pSetting);
break;
- case MSG_MMS_STYLEOPT :
+ case MSG_MMS_STYLEOPT:
MsgGetMMSStyleOpt(pSetting);
break;
- case MSG_PUSHMSG_OPT :
+ case MSG_PUSHMSG_OPT:
MsgGetPushMsgOpt(pSetting);
break;
- case MSG_CBMSG_OPT :
- {
- // Check SIM is present or not
+ case MSG_CBMSG_OPT: {
+ /* Check SIM is present or not */
snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pSetting->option.cbMsgOpt.simIndex);
simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName);
MsgGetCBMsgOpt(pSetting);
}
break;
- case MSG_VOICEMAIL_OPT :
- // Check SIM is present or not
+ case MSG_VOICEMAIL_OPT:
+ /* Check SIM is present or not */
if (pSetting->option.voiceMailOpt.simIndex == 0) {
MSG_DEBUG("Invalid SIM Index [%d]", pSetting->option.voiceMailOpt.simIndex);
return MSG_ERR_INVALID_PARAMETER;
}
MsgGetVoiceMailOpt(pSetting);
break;
- case MSG_MSGSIZE_OPT :
+ case MSG_MSGSIZE_OPT:
MsgGetMsgSizeOpt(pSetting);
break;
int addrLen = 0;
int index = 0;
- MSG_SMSC_LIST_S smscList = {0,};
+ MSG_SMSC_LIST_S smscList = {0, };
memcpy(&smscList, &(pSetting->option.smscList), sizeof(MSG_SMSC_LIST_S));
-// int sel_id = smscList.selected;
+ /* int sel_id = smscList.selected; */
index = smscList.index;
else
addrLen = strlen(pSetting->option.smscList.smscData[index].smscAddr.address);
- if(addrLen > SMSC_ADDR_MAX) {
+ if (addrLen > SMSC_ADDR_MAX) {
MSG_DEBUG("SMSC address is too long [%d]", strlen(pSetting->option.smscList.smscData[index].smscAddr.address));
return MSG_ERR_SET_SIM_SET;
- } else if(addrLen < 2) {
+ } else if (addrLen < 2) {
MSG_DEBUG("SMSC address is too short [%d]", addrLen);
return MSG_ERR_SET_SIM_SET;
}
}
}
#ifdef __NOT_USED_BY_DESIGN_CHANGE__
- if (MsgSettingSetBool(MMS_SEND_KEEP_COPY, sendOpt.bKeepCopy) != MSG_SUCCESS)
- {
+ if (MsgSettingSetBool(MMS_SEND_KEEP_COPY, sendOpt.bKeepCopy) != MSG_SUCCESS) {
MSG_DEBUG("Error to set config data [%s]", MMS_SEND_KEEP_COPY);
return MSG_ERR_SET_SETTING;
}
MsgSettingGetBool(MMS_SEND_HIDE_RECIPIENTS, &bValue);
if (bValue != sendOpt.bHideRecipients) {
- if (MsgSettingSetBool(MMS_SEND_HIDE_RECIPIENTS, sendOpt.bHideRecipients) != MSG_SUCCESS)
- {
+ if (MsgSettingSetBool(MMS_SEND_HIDE_RECIPIENTS, sendOpt.bHideRecipients) != MSG_SUCCESS) {
MSG_DEBUG("Error to set config data [%s]", MMS_SEND_HIDE_RECIPIENTS);
return MSG_ERR_SET_SETTING;
}
MSG_DEBUG("SIM Index = [%d]", simIndex);
- if (bSetSim == true) {//if (bSetSim == true && simIndex != 0) {
+ if (bSetSim == true) { /* if (bSetSim == true && simIndex != 0) { */
#ifndef FEATURE_SMS_CDMA
if (simIndex != 0) {
memset(keyName, 0x00, sizeof(keyName));
cbOpt.maxSimCnt = MsgSettingGetInt(keyName);
if (cbOpt.channelData.channelCnt > cbOpt.maxSimCnt) {
- MSG_DEBUG("Channel Count [%d] is over Max SIM Count [%d]", cbOpt.channelData.channelCnt,cbOpt.maxSimCnt);
+ MSG_DEBUG("Channel Count [%d] is over Max SIM Count [%d]", cbOpt.channelData.channelCnt, cbOpt.maxSimCnt);
return MSG_ERR_SET_SIM_SET;
}
}
MSG_DEBUG("MsgStoAddCBChannelInfo : err=[%d]", err);
#ifndef FEATURE_SMS_CDMA
- if (bSetSim == true)
- {
- for (int i = MSG_CBLANG_TYPE_ALL; i < MSG_CBLANG_TYPE_MAX; i++)
- {
+ if (bSetSim == true) {
+ for (int i = MSG_CBLANG_TYPE_ALL; i < MSG_CBLANG_TYPE_MAX; i++) {
memset(keyName, 0x00, sizeof(keyName));
snprintf(keyName, DEF_BUF_LEN, "%s/%d", CB_LANGUAGE, i);
- if (MsgSettingSetBool(keyName, cbOpt.bLanguage[i]) != MSG_SUCCESS)
- {
+ if (MsgSettingSetBool(keyName, cbOpt.bLanguage[i]) != MSG_SUCCESS) {
MSG_DEBUG("Error to set config data [%s]", keyName);
return MSG_ERR_SET_SETTING;
}
MSG_ERR("MsgStoGetCBChannelInfo : err=[%d]", err);
#ifndef FEATURE_SMS_CDMA
- for (int i = MSG_CBLANG_TYPE_ALL; i < MSG_CBLANG_TYPE_MAX; i++)
- {
+ for (int i = MSG_CBLANG_TYPE_ALL; i < MSG_CBLANG_TYPE_MAX; i++) {
memset(keyName, 0x00, sizeof(keyName));
snprintf(keyName, DEF_BUF_LEN, "%s/%d", CB_LANGUAGE, i);
MsgPlugin* plg = MsgPluginManager::instance()->getPlugin(MSG_SMS_TYPE);
- // Get Setting Data from SIM
+ /* Get Setting Data from SIM */
if (plg != NULL)
err = plg->setConfigData(pSetting);
else
err = MSG_ERR_NULL_POINTER;
- if (err != MSG_SUCCESS)
- {
+ if (err != MSG_SUCCESS) {
MSG_DEBUG("Error. Error code is %d.", err);
return err;
}
MsgPlugin* plg = MsgPluginManager::instance()->getPlugin(MSG_SMS_TYPE);
- // Get Setting Data from SIM
+ /* Get Setting Data from SIM */
if (plg != NULL)
err = plg->getConfigData(pSetting);
else
err = MSG_ERR_NULL_POINTER;
- if (err != MSG_SUCCESS)
- {
+ if (err != MSG_SUCCESS) {
MSG_DEBUG("Error. Error code is %d.", err);
return err;
}
MSG_DEBUG("sql : %s", sqlQuery);
- if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
- {
+ if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
if (filterStr)
free(filterStr);
return MSG_ERR_DB_EXEC;
if (pFilterList->msg_struct_info != NULL) {
msg_struct_s* pTmp = NULL;
- for (int i = 0; i < rowCnt; i++)
- {
+ for (int i = 0; i < rowCnt; i++) {
pFilterList->msg_struct_info[i] = (msg_struct_t)new msg_struct_s;
pTmp = (msg_struct_s *)pFilterList->msg_struct_info[i];
msg_struct_s* pTmp = NULL;
- for (int i = 0; i < rowCnt; i++)
- {
+ for (int i = 0; i < rowCnt; i++) {
pFolderList->msg_struct_info[i] = (msg_struct_t)new msg_struct_s;
pTmp = (msg_struct_s *)pFolderList->msg_struct_info[i];
pTmp->type = MSG_STRUCT_FOLDER_INFO;
memset(pFolder->folderName, 0x00, sizeof(pFolder->folderName));
dbHandle->getColumnToString(index++, MAX_FOLDER_NAME_SIZE, pFolder->folderName);
-
}
dbHandle->freeTable();
MSG_DEBUG("dbVersion [%d]", dbVersion);
- switch (dbVersion)
- {
+ switch (dbVersion) {
case 0 :
MsgUpdateDBtoVer1();
/* no break */
return;
}
- int fd = shm_open (shm_file_name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); /* note: permission is not working */
+ int fd = shm_open(shm_file_name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); /* note: permission is not working */
if (fd < 0) {
MSG_FATAL("shm_open errno [%d]", errno);
return ;
}
- // initialize the data on mmap
+ /* initialize the data on mmap */
pthread_mutexattr_t mattr;
pthread_mutexattr_init(&mattr);
pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED);
pthread_mutex_init(mx, &mattr);
pthread_mutexattr_destroy(&mattr);
- close (fd);
+ close(fd);
if (munmap((void *)mx, sizeof(pthread_mutex_t)) != 0) {
MSG_FATAL("munmap() failed! (errno: %d)", errno);
msg_error_t MsgStoInitDB(bool bSimChanged)
{
MSG_BEGIN();
-// MsgDbHandler *dbHandle = getDbHandle();
+ /* MsgDbHandler *dbHandle = getDbHandle(); */
msg_error_t err = MSG_SUCCESS;
- // Init mmap mutex for DB access
+ /* Init mmap mutex for DB access */
MsgInitMmapMutex(SHM_FILE_FOR_DB_LOCK);
- // Check DB version.
+ /* Check DB version. */
MsgStoDBVerCheck();
- // Delete Msgs in Hidden Folder
+ /* Delete Msgs in Hidden Folder */
MsgStoDeleteAllMessageInFolder(0, true, NULL);
- // Reset network status
+ /* Reset network status */
MsgStoResetNetworkStatus();
#if 0
- // Reset Cb Message
+ /* Reset Cb Message */
MsgStoResetCBMessage();
#endif
- //clear abnormal mms message
+ /*clear abnormal mms message */
MsgStoCleanAbnormalMmsData();
- // Clear all old Sim data
+ /* Clear all old Sim data */
MsgStoClearSimMessageInDB();
- //update sim index to 0 for all messages
+ /*update sim index to 0 for all messages */
MsgStoUpdateIMSI(0);
MSG_END();
char sqlQuery[MAX_QUERY_LEN+1];
MsgDbHandler *dbHandle = getDbHandle();
- // INBOX
+ /* INBOX */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) FROM %s WHERE FOLDER_ID = %d;",
MSGFW_FOLDER_TABLE_NAME, MSG_INBOX_ID);
return MSG_ERR_DB_EXEC;
}
- // OUTBOX
+ /* OUTBOX */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) FROM %s WHERE FOLDER_ID = %d;",
MSGFW_FOLDER_TABLE_NAME, MSG_OUTBOX_ID);
return MSG_ERR_DB_EXEC;
}
- // SENTBOX
+ /* SENTBOX */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) FROM %s WHERE FOLDER_ID = %d;",
MSGFW_FOLDER_TABLE_NAME, MSG_SENTBOX_ID);
return MSG_ERR_DB_EXEC;
}
- // DRAFT
+ /* DRAFT */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) FROM %s WHERE FOLDER_ID = %d;",
MSGFW_FOLDER_TABLE_NAME, MSG_DRAFT_ID);
return MSG_ERR_DB_EXEC;
}
- // CBMSGBOX
+ /* CBMSGBOX */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) FROM %s WHERE FOLDER_ID = %d;",
MSGFW_FOLDER_TABLE_NAME, MSG_CBMSGBOX_ID);
return MSG_ERR_DB_EXEC;
}
- // SPAMBOX
+ /* SPAMBOX */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) FROM %s WHERE FOLDER_ID = %d;",
MSGFW_FOLDER_TABLE_NAME, MSG_SPAMBOX_ID);
dbHandle->beginTrans();
- // Delete Database
- for (int i = 0; i < listCnt; i++)
- {
+ /* Delete Database */
+ for (int i = 0; i < listCnt; i++) {
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s;", tableList[i]);
}
}
- // Delete Message Table
+ /* Delete Message Table */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE STORAGE_ID <> %d;",
MSGFW_MESSAGE_TABLE_NAME, MSG_STORAGE_SIM);
return MSG_ERR_DB_EXEC;
}
- // Delete Conversation Table
+ /* Delete Conversation Table */
err = MsgStoClearConversationTable(dbHandle);
if (err != MSG_SUCCESS) {
return err;
}
- // Add Default Folders
+ /* Add Default Folders */
if (MsgAddDefaultFolders() != MSG_SUCCESS) {
MSG_DEBUG("Add Default Folders Fail");
dbHandle->endTrans(false);
return MSG_ERR_DB_STORAGE_INIT;
}
- // Add Default Address
+ /* Add Default Address */
if (MsgAddDefaultAddress() != MSG_SUCCESS) {
MSG_DEBUG("Add Default Address Fail");
dbHandle->endTrans(false);
dbHandle->endTrans(true);
- // Delete MMS Files
+ /* Delete MMS Files */
MsgRmRf((char*)MSG_DATA_PATH);
MsgRmRf((char*)MSG_SMIL_FILE_PATH);
- // Reset SMS Count
+ /* Reset SMS Count */
if (MsgSettingSetIndicator(0, 0) != MSG_SUCCESS) {
MSG_DEBUG("MsgSettingSetIndicator() FAILED");
return MSG_ERR_SET_SETTING;
}
- // Reset MMS Count
+ /* Reset MMS Count */
if (MsgSettingSetIndicator(0, 0) != MSG_SUCCESS) {
MSG_DEBUG("MsgSettingSetIndicator() FAILED");
return MSG_ERR_SET_SETTING;
"SELECT MSG_ID FROM %s "
"WHERE STORAGE_ID = %d;",
MSGFW_MESSAGE_TABLE_NAME, MSG_STORAGE_PHONE);
-
}
err = dbHandle->getTable(sqlQuery, &rowCnt, NULL);
encoded_data = MsgVMessageEncode(&msgInfo);
if (msgInfo.bTextSms == false)
- {
- MsgDeleteFile(msgInfo.msgData); //ipc
- }
+ MsgDeleteFile(msgInfo.msgData); /*ipc */
+
if (encoded_data != NULL) {
if (MsgAppendFile(fileName, encoded_data, strlen(encoded_data)) == false) {
free(encoded_data);
MSG_END();
return MSG_SUCCESS;
-
}
msg_error_t MsgStoUpdateMms(MSG_MESSAGE_INFO_S *pMsg)
char *pFileData = NULL;
if (pMsg->msgType.subType == MSG_SENDCONF_MMS) {
-
memset(sqlQuery, 0x00, sizeof(sqlQuery));
dbHandle->beginTrans();
pFileData = NULL;
}
} else {
-
err = MsgStoUpdateMMSMessage(pMsg);
if (err != MSG_SUCCESS) {
MSG_DEBUG("MsgStoUpdateMMSMessage() error : %d", err);
}
-
}
return err;
}
msg_error_t err = MSG_SUCCESS;
- MSG_MESSAGE_INFO_S msgInfo = {0,};
+ MSG_MESSAGE_INFO_S msgInfo = {0, };
unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> addressListBuf(&msgInfo.addressList, unique_ptr_deleter);
VTree* vMsg = NULL;
pCurrent = pData;
- while ((pTemp = strstr(pCurrent, "END:VMSG")) != NULL)
- {
+ while ((pTemp = strstr(pCurrent, "END:VMSG")) != NULL) {
isMMS = false;
MSG_DEBUG("Start Position: %s", pCurrent);
MSG_DEBUG("Start Position2: %s", pCurrent);
- //decodes if it is sms
+ /*decodes if it is sms */
err = MsgVMessageDecodeSMS(pCurrent, &msgInfo);
- //decode if it is mms
+ /*decode if it is mms */
if (err == MSG_ERR_INVALID_MESSAGE) {
MSG_DEBUG("Vmsg is not an SMS, decoding for MMS...");
vMsg = vmsg_decode(pCurrent);
memset(&msgInfo, 0x00, sizeof(MSG_MESSAGE_INFO_S));
}
- while (1 && isMMS)
- {
- while (1)
- {
+ while (1 && isMMS) {
+ while (1) {
MSG_DEBUG("pObject type [%d], pObject Value [%s]", pObject->property, pObject->pszValue[0]);
- switch (pObject->property)
- {
- case VMSG_TYPE_MSGTYPE :
- {
- if (!strncmp(pObject->pszValue[0], "MMS RETRIEVED", strlen("MMS RETRIEVED"))) {
- msgInfo.msgType.mainType = MSG_MMS_TYPE;
- msgInfo.msgType.subType = MSG_RETRIEVE_AUTOCONF_MMS;
- } else if (!strncmp(pObject->pszValue[0], "MMS SEND", strlen("MMS SEND"))) {
- msgInfo.msgType.mainType = MSG_MMS_TYPE;
- msgInfo.msgType.subType = MSG_SENDCONF_MMS;
- } else if (!strncmp(pObject->pszValue[0], "MMS NOTIFICATION", strlen("MMS NOTIFICATION"))) {
- msgInfo.msgType.mainType = MSG_MMS_TYPE;
- msgInfo.msgType.subType = MSG_NOTIFICATIONIND_MMS;
- } else {
- vmsg_free_vtree_memory(vMsg);
- err = MSG_ERR_STORAGE_ERROR;
- goto __RETURN;
- }
+ switch (pObject->property) {
+ case VMSG_TYPE_MSGTYPE : {
+ if (!strncmp(pObject->pszValue[0], "MMS RETRIEVED", strlen("MMS RETRIEVED"))) {
+ msgInfo.msgType.mainType = MSG_MMS_TYPE;
+ msgInfo.msgType.subType = MSG_RETRIEVE_AUTOCONF_MMS;
+ } else if (!strncmp(pObject->pszValue[0], "MMS SEND", strlen("MMS SEND"))) {
+ msgInfo.msgType.mainType = MSG_MMS_TYPE;
+ msgInfo.msgType.subType = MSG_SENDCONF_MMS;
+ } else if (!strncmp(pObject->pszValue[0], "MMS NOTIFICATION", strlen("MMS NOTIFICATION"))) {
+ msgInfo.msgType.mainType = MSG_MMS_TYPE;
+ msgInfo.msgType.subType = MSG_NOTIFICATIONIND_MMS;
+ } else {
+ vmsg_free_vtree_memory(vMsg);
+ err = MSG_ERR_STORAGE_ERROR;
+ goto __RETURN;
}
- break;
+ }
+ break;
- case VMSG_TYPE_MSGBOX :
- {
- if(!strncmp(pObject->pszValue[0], "INBOX", strlen("INBOX"))) {
- msgInfo.folderId= MSG_INBOX_ID;
- msgInfo.direction=MSG_DIRECTION_TYPE_MT;
-
- if (msgInfo.msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS)
- msgInfo.networkStatus=MSG_NETWORK_RETRIEVE_SUCCESS;
- else if (msgInfo.msgType.subType == MSG_SENDCONF_MMS)
- msgInfo.networkStatus=MSG_NETWORK_SEND_SUCCESS;
- else
- msgInfo.networkStatus=MSG_NETWORK_RECEIVED;
-
- } else if(!strncmp(pObject->pszValue[0], "OUTBOX", strlen("OUTBOX"))) {
- msgInfo.folderId= MSG_OUTBOX_ID;
- msgInfo.direction=MSG_DIRECTION_TYPE_MO;
-
- msgInfo.networkStatus=MSG_NETWORK_SEND_FAIL;
- } else if(!strncmp(pObject->pszValue[0], "SENTBOX", strlen("SENTBOX"))) {
- msgInfo.folderId= MSG_SENTBOX_ID;
- msgInfo.direction=MSG_DIRECTION_TYPE_MO;
-
- msgInfo.networkStatus=MSG_NETWORK_SEND_SUCCESS;
- } else if(!strncmp(pObject->pszValue[0], "DRAFTBOX", strlen("DRAFTBOX"))) {
- msgInfo.folderId=MSG_DRAFT_ID;
- msgInfo.direction=MSG_DIRECTION_TYPE_MO;
-
- msgInfo.networkStatus=MSG_NETWORK_NOT_SEND;
- } else {
- vmsg_free_vtree_memory(vMsg);
- err = MSG_ERR_STORAGE_ERROR;
- goto __RETURN;
- }
+ case VMSG_TYPE_MSGBOX : {
+ if (!strncmp(pObject->pszValue[0], "INBOX", strlen("INBOX"))) {
+ msgInfo.folderId = MSG_INBOX_ID;
+ msgInfo.direction = MSG_DIRECTION_TYPE_MT;
+
+ if (msgInfo.msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS)
+ msgInfo.networkStatus = MSG_NETWORK_RETRIEVE_SUCCESS;
+ else if (msgInfo.msgType.subType == MSG_SENDCONF_MMS)
+ msgInfo.networkStatus = MSG_NETWORK_SEND_SUCCESS;
+ else
+ msgInfo.networkStatus = MSG_NETWORK_RECEIVED;
+
+ } else if (!strncmp(pObject->pszValue[0], "OUTBOX", strlen("OUTBOX"))) {
+ msgInfo.folderId = MSG_OUTBOX_ID;
+ msgInfo.direction = MSG_DIRECTION_TYPE_MO;
+
+ msgInfo.networkStatus = MSG_NETWORK_SEND_FAIL;
+ } else if (!strncmp(pObject->pszValue[0], "SENTBOX", strlen("SENTBOX"))) {
+ msgInfo.folderId = MSG_SENTBOX_ID;
+ msgInfo.direction = MSG_DIRECTION_TYPE_MO;
+
+ msgInfo.networkStatus = MSG_NETWORK_SEND_SUCCESS;
+ } else if (!strncmp(pObject->pszValue[0], "DRAFTBOX", strlen("DRAFTBOX"))) {
+ msgInfo.folderId = MSG_DRAFT_ID;
+ msgInfo.direction = MSG_DIRECTION_TYPE_MO;
+
+ msgInfo.networkStatus = MSG_NETWORK_NOT_SEND;
+ } else {
+ vmsg_free_vtree_memory(vMsg);
+ err = MSG_ERR_STORAGE_ERROR;
+ goto __RETURN;
}
- break;
+ }
+ break;
- case VMSG_TYPE_STATUS :
- {
- if(!strncmp(pObject->pszValue[0], "READ", strlen("READ"))) {
- msgInfo.bRead = true;
- } else if(!strncmp(pObject->pszValue[0], "UNREAD", strlen("UNREAD"))) {
- msgInfo.bRead = false;
- } else {
- vmsg_free_vtree_memory(vMsg);
- err = MSG_ERR_STORAGE_ERROR;
- goto __RETURN;
- }
+ case VMSG_TYPE_STATUS : {
+ if(!strncmp(pObject->pszValue[0], "READ", strlen("READ"))) {
+ msgInfo.bRead = true;
+ } else if (!strncmp(pObject->pszValue[0], "UNREAD", strlen("UNREAD"))) {
+ msgInfo.bRead = false;
+ } else {
+ vmsg_free_vtree_memory(vMsg);
+ err = MSG_ERR_STORAGE_ERROR;
+ goto __RETURN;
}
- break;
-
- case VMSG_TYPE_DATE :
- {
- struct tm displayTime;
+ }
+ break;
- if (!_convert_vdata_str_to_tm(pObject->pszValue[0], &displayTime)) {
- vmsg_free_vtree_memory( vMsg );
- err = MSG_ERR_STORAGE_ERROR;
- goto __RETURN;
- }
+ case VMSG_TYPE_DATE : {
+ struct tm displayTime;
- msgInfo.displayTime = mktime(&displayTime);
+ if (!_convert_vdata_str_to_tm(pObject->pszValue[0], &displayTime)) {
+ vmsg_free_vtree_memory(vMsg);
+ err = MSG_ERR_STORAGE_ERROR;
+ goto __RETURN;
}
- break;
- case VMSG_TYPE_SUBJECT :
- {
- MSG_DEBUG("subject length is [%d].", strlen(pObject->pszValue[0]));
+ msgInfo.displayTime = mktime(&displayTime);
+ }
+ break;
- if(strlen(pObject->pszValue[0]) > 0) {
- strncpy(msgInfo.subject, pObject->pszValue[0], MAX_SUBJECT_LEN);
- if ( msgInfo.subject[strlen(pObject->pszValue[0])-1] == '\r' )
- msgInfo.subject[strlen(pObject->pszValue[0])-1]= '\0';
- }
+ case VMSG_TYPE_SUBJECT : {
+ MSG_DEBUG("subject length is [%d].", strlen(pObject->pszValue[0]));
+
+ if(strlen(pObject->pszValue[0]) > 0) {
+ strncpy(msgInfo.subject, pObject->pszValue[0], MAX_SUBJECT_LEN);
+ if ( msgInfo.subject[strlen(pObject->pszValue[0])-1] == '\r' )
+ msgInfo.subject[strlen(pObject->pszValue[0])-1] = '\0';
}
- break;
+ }
+ break;
- case VMSG_TYPE_BODY :
- {
- if (msgInfo.msgType.mainType == MSG_MMS_TYPE) {
- msgInfo.bTextSms = true;
+ case VMSG_TYPE_BODY : {
+ if (msgInfo.msgType.mainType == MSG_MMS_TYPE) {
+ msgInfo.bTextSms = true;
#if 0
- if(msgInfo.msgType.subType == MSG_NOTIFICATIONIND_MMS) {
-
- msgInfo.bTextSms = true;
-
- // Save Message Data into File
- char fileName[MAX_COMMON_INFO_SIZE+1];
- memset(fileName, 0x00, sizeof(fileName));
-
- if (MsgCreateFileName(fileName) == false) {
- vmsg_free_vtree_memory(vMsg);
- return MSG_ERR_STORAGE_ERROR;
- }
-
- if (MsgWriteIpcFile(fileName, pObject->pszValue[0], pObject->numOfBiData) == false) {
- vmsg_free_vtree_memory(vMsg);
- return MSG_ERR_STORAGE_ERROR;
- }
- strncpy(msgInfo.msgData, MSG_IPC_DATA_PATH, MAX_MSG_DATA_LEN);
- strncat(msgInfo.msgData, fileName, MAX_MSG_DATA_LEN-strlen(msgInfo.msgData));
- msgInfo.dataSize = strlen(fileName);
- MsgPlugin* plg = MsgPluginManager::instance()->getPlugin(msgInfo.msgType.mainType);
- if (plg == NULL) {
- vmsg_free_vtree_memory(vMsg);
- return MSG_ERR_NULL_POINTER;
- }
- err = plg->restoreMsg(&msgInfo, pObject->pszValue[0], pObject->numOfBiData, NULL);
-
- } else {
-//////////////// From here was avaliable
- char retrievedFilePath[MAX_FULL_PATH_SIZE] = {0,};
- MsgPlugin* plg = MsgPluginManager::instance()->getPlugin(msgInfo.msgType.mainType);
- if (plg == NULL) {
- vmsg_free_vtree_memory(vMsg);
- return MSG_ERR_NULL_POINTER;
- }
- err = plg->restoreMsg(&msgInfo, pObject->pszValue[0], pObject->numOfBiData, retrievedFilePath);
- msgInfo.bTextSms = false;
-
- char fileName[MAX_COMMON_INFO_SIZE+1];
- memset(fileName, 0x00, sizeof(fileName));
-
- if (MsgCreateFileName(fileName) == false) {
- vmsg_free_vtree_memory(vMsg);
- return MSG_ERR_STORAGE_ERROR;
- }
- MSG_SEC_DEBUG("fileName: %s, retrievedFilePath: %s (%d)", fileName, retrievedFilePath, strlen(retrievedFilePath));
-
- if (MsgWriteIpcFile(fileName, retrievedFilePath, strlen(retrievedFilePath)+ 1) == false) {
- vmsg_free_vtree_memory(vMsg);
- return MSG_ERR_STORAGE_ERROR;
- }
- strncpy(msgInfo.msgData, fileName, MAX_MSG_DATA_LEN);
- msgInfo.dataSize = strlen(retrievedFilePath) + 1;
-
- if (err != MSG_SUCCESS)
- return vmsg_free_vtree_memory(vMsg);
-///////////////////////////
+ if(msgInfo.msgType.subType == MSG_NOTIFICATIONIND_MMS) {
+ msgInfo.bTextSms = true;
+
+ /* Save Message Data into File */
+ char fileName[MAX_COMMON_INFO_SIZE+1];
+ memset(fileName, 0x00, sizeof(fileName));
+
+ if (MsgCreateFileName(fileName) == false) {
+ vmsg_free_vtree_memory(vMsg);
+ return MSG_ERR_STORAGE_ERROR;
}
-#else
+ if (MsgWriteIpcFile(fileName, pObject->pszValue[0], pObject->numOfBiData) == false) {
+ vmsg_free_vtree_memory(vMsg);
+ return MSG_ERR_STORAGE_ERROR;
+ }
+ strncpy(msgInfo.msgData, MSG_IPC_DATA_PATH, MAX_MSG_DATA_LEN);
+ strncat(msgInfo.msgData, fileName, MAX_MSG_DATA_LEN-strlen(msgInfo.msgData));
+ msgInfo.dataSize = strlen(fileName);
+ MsgPlugin* plg = MsgPluginManager::instance()->getPlugin(msgInfo.msgType.mainType);
+ if (plg == NULL) {
+ vmsg_free_vtree_memory(vMsg);
+ return MSG_ERR_NULL_POINTER;
+ }
+ err = plg->restoreMsg(&msgInfo, pObject->pszValue[0], pObject->numOfBiData, NULL);
+
+ } else {
+/** From here was avaliable */
+ char retrievedFilePath[MAX_FULL_PATH_SIZE] = {0, };
+ MsgPlugin* plg = MsgPluginManager::instance()->getPlugin(msgInfo.msgType.mainType);
+ if (plg == NULL) {
+ vmsg_free_vtree_memory(vMsg);
+ return MSG_ERR_NULL_POINTER;
+ }
+ err = plg->restoreMsg(&msgInfo, pObject->pszValue[0], pObject->numOfBiData, retrievedFilePath);
msgInfo.bTextSms = false;
char fileName[MAX_COMMON_INFO_SIZE+1];
if (MsgCreateFileName(fileName) == false) {
vmsg_free_vtree_memory(vMsg);
- err = MSG_ERR_STORAGE_ERROR;
- goto __RETURN;
+ return MSG_ERR_STORAGE_ERROR;
}
+ MSG_SEC_DEBUG("fileName: %s, retrievedFilePath: %s (%d)", fileName, retrievedFilePath, strlen(retrievedFilePath));
- if (MsgWriteIpcFile(fileName, pObject->pszValue[0], pObject->numOfBiData) == false) {
+ if (MsgWriteIpcFile(fileName, retrievedFilePath, strlen(retrievedFilePath)+ 1) == false) {
vmsg_free_vtree_memory(vMsg);
- err = MSG_ERR_STORAGE_ERROR;
- goto __RETURN;
+ return MSG_ERR_STORAGE_ERROR;
}
-
- //set serialized mms data ipcfilename
strncpy(msgInfo.msgData, fileName, MAX_MSG_DATA_LEN);
-#endif
+ msgInfo.dataSize = strlen(retrievedFilePath) + 1;
+
+ if (err != MSG_SUCCESS)
+ return vmsg_free_vtree_memory(vMsg);
}
- }
- break;
+#else
- case VCARD_TYPE_TEL :
- {
- MSG_ADDRESS_INFO_S * addrInfo = NULL;
+ msgInfo.bTextSms = false;
- msgInfo.nAddressCnt++;
+ char fileName[MAX_COMMON_INFO_SIZE+1];
+ memset(fileName, 0x00, sizeof(fileName));
- if (msgInfo.addressList == NULL) {
- addrInfo = (MSG_ADDRESS_INFO_S *)calloc(1, sizeof(MSG_ADDRESS_INFO_S));
- } else {
- addrInfo = (MSG_ADDRESS_INFO_S *)realloc(msgInfo.addressList, msgInfo.nAddressCnt * sizeof(MSG_ADDRESS_INFO_S));
+ if (MsgCreateFileName(fileName) == false) {
+ vmsg_free_vtree_memory(vMsg);
+ err = MSG_ERR_STORAGE_ERROR;
+ goto __RETURN;
}
- if (addrInfo == NULL) {
+ if (MsgWriteIpcFile(fileName, pObject->pszValue[0], pObject->numOfBiData) == false) {
vmsg_free_vtree_memory(vMsg);
err = MSG_ERR_STORAGE_ERROR;
goto __RETURN;
-
}
- msgInfo.addressList = addrInfo;
+ /*set serialized mms data ipcfilename */
+ strncpy(msgInfo.msgData, fileName, MAX_MSG_DATA_LEN);
+#endif
+ }
+ }
+ break;
+
+ case VCARD_TYPE_TEL : {
+ MSG_ADDRESS_INFO_S * addrInfo = NULL;
- msgInfo.addressList[msgInfo.nAddressCnt-1].addressType = MSG_ADDRESS_TYPE_PLMN;
- msgInfo.addressList[msgInfo.nAddressCnt-1].recipientType = MSG_RECIPIENTS_TYPE_TO;
- strncpy(msgInfo.addressList[msgInfo.nAddressCnt-1].addressVal, pObject->pszValue[0], MAX_ADDRESS_VAL_LEN);
+ msgInfo.nAddressCnt++;
+ if (msgInfo.addressList == NULL) {
+ addrInfo = (MSG_ADDRESS_INFO_S *)calloc(1, sizeof(MSG_ADDRESS_INFO_S));
+ } else {
+ addrInfo = (MSG_ADDRESS_INFO_S *)realloc(msgInfo.addressList, msgInfo.nAddressCnt * sizeof(MSG_ADDRESS_INFO_S));
}
- break;
+
+ if (addrInfo == NULL) {
+ vmsg_free_vtree_memory(vMsg);
+ err = MSG_ERR_STORAGE_ERROR;
+ goto __RETURN;
+ }
+
+ msgInfo.addressList = addrInfo;
+
+ msgInfo.addressList[msgInfo.nAddressCnt-1].addressType = MSG_ADDRESS_TYPE_PLMN;
+ msgInfo.addressList[msgInfo.nAddressCnt-1].recipientType = MSG_RECIPIENTS_TYPE_TO;
+ strncpy(msgInfo.addressList[msgInfo.nAddressCnt-1].addressVal, pObject->pszValue[0], MAX_ADDRESS_VAL_LEN);
+ }
+ break;
}
if (pObject->pSibling != NULL)
}
}
- msgInfo.bBackup = true; // Set Backup Flag
- msgInfo.storageId = MSG_STORAGE_PHONE; // Set Storage Id
- msgInfo.priority = MSG_MESSAGE_PRIORITY_NORMAL; // Set Priority
+ msgInfo.bBackup = true; /* Set Backup Flag */
+ msgInfo.storageId = MSG_STORAGE_PHONE; /* Set Storage Id */
+ msgInfo.priority = MSG_MESSAGE_PRIORITY_NORMAL; /* Set Priority */
err = MsgStoAddMessage(&msgInfo, NULL);
if (err != MSG_SUCCESS) {
*result_id_list = msgIdList;
__RETURN:
- if(pData)
- {
- free( pData );
+ if (pData) {
+ free(pData);
pData = NULL;
pCurrent = NULL;
}
memset(sqlQuery, 0x00, sizeof(sqlQuery));
- // Check whether Same record exists or not.
+ /* Check whether Same record exists or not. */
#if 0
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT * FROM %s WHERE CONTENT_TYPE LIKE '%s' AND APP_ID LIKE '%s' AND (PKG_NAME LIKE '%s' OR SECURE = 1);",
MSGFW_PUSH_CONFIG_TABLE_NAME, pPushEvent->contentType, pPushEvent->appId, pPushEvent->pkgName);
if (pMsg->msgId > 0) {
rowId = pMsg->msgId;
} else {
- // get rowId
+ /* get rowId */
err = dbHandle->getRowId(MSGFW_MESSAGE_TABLE_NAME, &rowId);
if (err != MSG_SUCCESS) {
dbHandle->endTrans(false);
char *pFileData = NULL;
unique_ptr<char*, void(*)(char**)> buf(&pFileData, unique_ptr_deleter);
- // Get File Data
+ /* Get File Data */
if (pMsg->bTextSms == false) {
if (MsgOpenAndReadFile(pMsg->msgData, &pFileData, &fileSize) == false) {
dbHandle->endTrans(false);
char *imsi = MsgSettingGetString(keyName);
- // Add Message
+ /* Add Message */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, %d, %d, %u, %d, %d, %d, %d, %d, %d, %d, %d, ?, '', '', ?, 0, %d, '%s');",
#if 0
/* In the case of MMS Message, load the MMS plugin to save MMS PDU */
if (pMsg->msgType.mainType == MSG_MMS_TYPE) {
-
if (pMsg->msgType.subType != MSG_DELIVERYIND_MMS && pMsg->msgType.subType != MSG_READORGIND_MMS) {
-
MsgPlugin *plg = MsgPluginManager::instance()->getPlugin(MSG_MMS_TYPE);
if (plg == NULL) {
dbHandle->endTrans(false);
|| pMsg->msgType.subType == MSG_RETRIEVE_MMS
|| pMsg->msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS
|| pMsg->msgType.subType == MSG_RETRIEVE_MANUALCONF_MMS) {
-
MSG_DEBUG("pMsg->msgText: %s, pMsg->thumbPath: %s ", pMsg->msgText, pMsg->thumbPath);
err = MsgStoUpdateMMSMessage(pMsg);
dbHandle->endTrans(false);
return MSG_ERR_STORAGE_ERROR;
}
-
}
}
} else if (pMsg->msgType.mainType == MSG_SMS_TYPE && pSendOptInfo != NULL) {
unique_ptr<char*, void(*)(char**)> buf_mms(&pMmsSerializedData, unique_ptr_deleter);
if (pMsg->msgType.subType != MSG_DELIVERYIND_MMS && pMsg->msgType.subType != MSG_READORGIND_MMS) {
-
MsgPlugin *plg = MsgPluginManager::instance()->getPlugin(MSG_MMS_TYPE);
if (plg == NULL) {
dbHandle->endTrans(false);
return MSG_ERR_STORAGE_ERROR;
}
-
-// if (pMsg->msgText[0] != '\0') {
-// g_file_get_contents((gchar*)pMsg->msgText, (gchar**)&pFileData, (gsize*)&fileSize, NULL);
-// MSG_DEBUG("file size [%d]", fileSize);
-// }
+/*
+ * if (pMsg->msgText[0] != '\0') {
+ * g_file_get_contents((gchar*)pMsg->msgText, (gchar**)&pFileData, (gsize*)&fileSize, NULL);
+ * MSG_DEBUG("file size [%d]", fileSize);
+ * }
+ */
if (pMsg->msgType.subType == MSG_SENDREQ_MMS
|| pMsg->msgType.subType == MSG_RETRIEVE_MMS
|| pMsg->msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS
- || pMsg->msgType.subType == MSG_RETRIEVE_MANUALCONF_MMS)
- {
+ || pMsg->msgType.subType == MSG_RETRIEVE_MANUALCONF_MMS) {
MSG_DEBUG("pMsg->msgText: %s, pMsg->thumbPath: %s ", pMsg->msgText, pMsg->thumbPath);
-
err = MsgStoUpdateMMSMessage(pMsg);
}
-
}
} else {
-
- // Get File Data
if (pMsg->bTextSms == false) {
if (MsgOpenAndReadFile(pMsg->msgData, &pFileData, &fileSize) == false) {
dbHandle->endTrans(false);
prevType = dbHandle->columnInt(0);
dbHandle->finalizeQuery();
- //check msg type with previous type
+ /* check msg type with previous type */
if (prevType != pMsg->msgType.mainType) {
MSG_DEBUG("different msg type to update [prev : %d], [current : %d]", prevType, pMsg->msgType.mainType);
char *pFileData = NULL;
unique_ptr<char*, void(*)(char**)> buf(&pFileData, unique_ptr_deleter);
- // Get File Data
+ /* Get File Data */
if (pMsg->bTextSms == false) {
if (MsgOpenAndReadFile(pMsg->msgData, &pFileData, &fileSize) == false) {
dbHandle->endTrans(false);
}
if (pSendOptInfo != NULL) {
- // Get Global setting value if bSetting == false
+ /* Get Global setting value if bSetting == false */
if (pSendOptInfo->bSetting == false) {
MsgSettingGetBool(MSG_KEEP_COPY, &pSendOptInfo->bKeepCopy);
}
}
- // Update Message
+ /* Update Message */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET CONV_ID = %d, FOLDER_ID = %d, STORAGE_ID = %d, MAIN_TYPE = %d, SUB_TYPE = %d, \
if (bRead == true) {
#ifndef FEATURE_SMS_CDMA
- // Get STORAGE_ID
+ /* Get STORAGE_ID */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT STORAGE_ID FROM %s WHERE MSG_ID = %d;",
MSGFW_MESSAGE_TABLE_NAME, msgId);
MSG_DEBUG("StorageId:[%d]", storageId);
- // Update Read Status for SIM Msg
+ /* Update Read Status for SIM Msg */
if (storageId == MSG_STORAGE_SIM) {
MsgPlugin *plg = MsgPluginManager::instance()->getPlugin(MSG_SMS_TYPE);
return MSG_ERR_NULL_POINTER;
}
- // Get SIM Msg ID
+ /* Get SIM Msg ID */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT SIM_SLOT_ID, SIM_ID FROM %s WHERE MSG_ID = %d;",
MSGFW_SIM_MSG_TABLE_NAME, msgId);
dbHandle->freeTable();
/*** **/
- // set read status
+ /* set read status */
dbHandle->beginTrans();
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET READ_STATUS = %d "
char sqlQuery[MAX_QUERY_LEN+1];
MsgDbHandler *dbHandle = getDbHandle();
- // delete report notification
+ /* delete report notification */
char tempAddr[MAX_ADDRESS_VAL_LEN+1];
memset(tempAddr, 0x00, sizeof(tempAddr));
memset(sqlQuery, 0x00, sizeof(sqlQuery));
dbHandle->finalizeQuery();
- // Get SUB_TYPE, STORAGE_ID
+ /* Get SUB_TYPE, STORAGE_ID */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MAIN_TYPE, SUB_TYPE, FOLDER_ID, STORAGE_ID, READ_STATUS, CONV_ID, SIM_INDEX \
FROM %s WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, msgId);
dbHandle->beginTrans();
#ifndef FEATURE_SMS_CDMA
- // Check sim message
+ /* Check sim message */
if (storageId == MSG_STORAGE_SIM) {
msg_sim_id_t simMsgId;
msg_sim_slot_id_t sim_idx;
while (true) {
- // get sim message id
+ /* get sim message id */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT SIM_SLOT_ID, SIM_ID FROM %s WHERE MSG_ID = %d;",
MSGFW_SIM_MSG_TABLE_NAME, msgId);
dbHandle->finalizeQuery();
- //Sim message delete in db table
+ /*Sim message delete in db table */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE SIM_ID = %d AND SIM_SLOT_ID =%d;", MSGFW_SIM_MSG_TABLE_NAME, simMsgId, sim_idx);
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
MSGFW_SMS_SENDOPT_TABLE_NAME, msgId);
- // Delete SMS Send Option
+ /* Delete SMS Send Option */
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
MSGFW_SMS_REPORT_TABLE_NAME, msgId);
- // Delete Data from SMS_REPORT table
+ /* Delete Data from SMS_REPORT table */
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
MSGFW_CB_MSG_TABLE_NAME, msgId);
- // Delete Push Message from push table
+ /* Delete Push Message from push table */
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
MSGFW_PUSH_MSG_TABLE_NAME, msgId);
- // Delete Push Message from push table
+ /* Delete Push Message from push table */
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
MSGFW_SYNCML_MSG_TABLE_NAME, msgId);
- // Delete SyncML Message from syncML table
+ /* Delete SyncML Message from syncML table */
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
}
}
} else if (msgType.mainType == MSG_MMS_TYPE) {
+ char filePath[MSG_FILEPATH_LEN_MAX + 1] = {0, };
+ char dirPath[MSG_FILEPATH_LEN_MAX + 1]= {0, };
- char filePath[MSG_FILEPATH_LEN_MAX + 1] = {0,};
- char dirPath[MSG_FILEPATH_LEN_MAX + 1]= {0,};
-
- {//remove multipart
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILE_PATH FROM %s WHERE MSG_ID = %d;",
- MSGFW_MMS_MULTIPART_TABLE_NAME, msgId);
+ /*remove multipart */
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILE_PATH FROM %s WHERE MSG_ID = %d;",
+ MSGFW_MMS_MULTIPART_TABLE_NAME, msgId);
- if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_PREPARE;
- }
+ if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
+ dbHandle->endTrans(false);
+ return MSG_ERR_DB_PREPARE;
+ }
- while (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
- memset(filePath, 0x00, sizeof(filePath));
- strncpy(filePath, (char *)dbHandle->columnText(0), MSG_FILEPATH_LEN_MAX);
- if (remove(filePath) == -1)
- MSG_SEC_DEBUG("Fail to delete file [%s]", filePath);
- else
- MSG_SEC_DEBUG("Success to delete file [%s]", filePath);
- }
- dbHandle->finalizeQuery();
+ while (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
+ memset(filePath, 0x00, sizeof(filePath));
+ strncpy(filePath, (char *)dbHandle->columnText(0), MSG_FILEPATH_LEN_MAX);
+ if (remove(filePath) == -1)
+ MSG_SEC_DEBUG("Fail to delete file [%s]", filePath);
+ else
+ MSG_SEC_DEBUG("Success to delete file [%s]", filePath);
+ }
+ dbHandle->finalizeQuery();
- // Delete Data from Multipart table
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
- MSGFW_MMS_MULTIPART_TABLE_NAME, msgId);
+ /* Delete Data from Multipart table */
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
+ MSGFW_MMS_MULTIPART_TABLE_NAME, msgId);
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_EXEC;
- }
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ dbHandle->endTrans(false);
+ return MSG_ERR_DB_EXEC;
}
-
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILE_PATH FROM %s WHERE MSG_ID = %d;",
MMS_PLUGIN_MESSAGE_TABLE_NAME, msgId);
dbHandle->finalizeQuery();
- // remove thumbnail file
+ /* remove thumbnail file */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery),
"SELECT VALUE FROM %s "
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
MMS_PLUGIN_MESSAGE_TABLE_NAME, msgId);
- // Delete Data from MMS table
+ /* Delete Data from MMS table */
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
MSGFW_REPORT_TABLE_NAME, msgId);
- // Delete Data from MMS STATUS table
+ /* Delete Data from MMS STATUS table */
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, msgId);
- // Delete Message from msg table
+ /* Delete Message from msg table */
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;", MSGFW_UNIQUENESS_INFO_TABLE_NAME, msgId);
- // Delete Message from uniqueness table
+ /* Delete Message from uniqueness table */
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
#endif
if (convId > 0) {
- // Clear Conversation table
+ /* Clear Conversation table */
if (MsgStoClearConversationTable(dbHandle) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
}
- // Update conversation table.
+ /* Update conversation table. */
if (MsgStoUpdateConversation(dbHandle, convId) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_STORAGE_ERROR;
if (msgType.mainType == MSG_SMS_TYPE && folderId == MSG_INBOX_ID) {
msgType.classType = MSG_CLASS_NONE;
- // Set memory status in SIM
+ /* Set memory status in SIM */
if (MsgStoCheckMsgCntFull(dbHandle, &msgType, folderId) == MSG_SUCCESS) {
MSG_DEBUG("Set Memory Status");
int rowCnt = 0;
MsgDbHandler *dbHandle = getDbHandle();
- // Get conversation ID from Folder
+ /* Get conversation ID from Folder */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT DISTINCT(CONV_ID) FROM %s WHERE FOLDER_ID = %d",
goto FREE_MEMORY;
}
- //Delete phone log
-// MsgDeletePhoneLog(dbHandle->getColumnToInt(i));
+ /*Delete phone log */
+/* MsgDeletePhoneLog(dbHandle->getColumnToInt(i)); */
}
dbHandle->freeTable();
for (int i = 0; i < listCnt; i++) {
if (!strcmp(tableList[i], MMS_PLUGIN_MESSAGE_TABLE_NAME)) {
-
int rowCnt = 0;
- char filePath[MSG_FILEPATH_LEN_MAX] = {0,};
- char dirPath[MSG_FILEPATH_LEN_MAX] = {0,};
-
- {//remove multipart
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILE_PATH FROM %s;",
- MSGFW_MMS_MULTIPART_TABLE_NAME);
+ char filePath[MSG_FILEPATH_LEN_MAX] = {0, };
+ char dirPath[MSG_FILEPATH_LEN_MAX] = {0, };
+ /* remove multipart */
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILE_PATH FROM %s;",
+ MSGFW_MMS_MULTIPART_TABLE_NAME);
- if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
- dbHandle->endTrans(false);
- return MSG_ERR_DB_PREPARE;
- }
+ if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS) {
+ dbHandle->endTrans(false);
+ return MSG_ERR_DB_PREPARE;
+ }
- while (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
- memset(filePath, 0x00, sizeof(filePath));
- strncpy(filePath, (char *)dbHandle->columnText(0), MSG_FILEPATH_LEN_MAX);
- if (remove(filePath) == -1)
- MSG_SEC_DEBUG("Fail to delete file [%s]", filePath);
- else
- MSG_SEC_DEBUG("Success to delete file [%s]", filePath);
- }
- dbHandle->finalizeQuery();
+ while (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
+ memset(filePath, 0x00, sizeof(filePath));
+ strncpy(filePath, (char *)dbHandle->columnText(0), MSG_FILEPATH_LEN_MAX);
+ if (remove(filePath) == -1)
+ MSG_SEC_DEBUG("Fail to delete file [%s]", filePath);
+ else
+ MSG_SEC_DEBUG("Success to delete file [%s]", filePath);
+ }
+ dbHandle->finalizeQuery();
- // Delete Data from Multipart table
- memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s;",
- MSGFW_MMS_MULTIPART_TABLE_NAME);
+ /* Delete Data from Multipart table */
+ memset(sqlQuery, 0x00, sizeof(sqlQuery));
+ snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s;",
+ MSGFW_MMS_MULTIPART_TABLE_NAME);
- if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
- err = MSG_ERR_DB_EXEC;
- dbHandle->endTrans(false);
- goto FREE_MEMORY;
- }
+ if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
+ err = MSG_ERR_DB_EXEC;
+ dbHandle->endTrans(false);
+ goto FREE_MEMORY;
}
- //get mms msg id list
+ /*get mms msg id list */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT B.FILE_PATH FROM %s A, %s B \
WHERE A.FOLDER_ID = %d AND A.MAIN_TYPE = %d AND A.MSG_ID = B.MSG_ID",
}
for (int i = 1; i <= rowCnt; i++) {
-
memset(filePath, 0x00, sizeof(filePath));
dbHandle->getColumnToString(i, MSG_FILEPATH_LEN_MAX, filePath);
MSG_SEC_DEBUG("filePath [%s]", filePath);
- //delete raw file
+ /*delete raw file */
snprintf(dirPath, sizeof(dirPath), "%s.dir", filePath);
if (remove(filePath) == -1)
MsgRmRf(dirPath);
rmdir(dirPath);
-
}
dbHandle->freeTable();
}
- // delete thumbnail
- char filePath[MSG_FILEPATH_LEN_MAX] = {0,};
+ /* delete thumbnail */
+ char filePath[MSG_FILEPATH_LEN_MAX] = {0, };
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery),
"SELECT VALUE FROM %s "
(SELECT MSG_ID FROM %s WHERE FOLDER_ID = %d);",
tableList[i], MSGFW_MESSAGE_TABLE_NAME, folderId);
- // Delete Message in specific folder from table
+ /* Delete Message in specific folder from table */
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
MSG_DEBUG("sqlQuery [%s]", sqlQuery);
dbHandle->endTrans(false);
}
}
- // Clear Conversation table
+ /* Clear Conversation table */
if (MsgStoClearConversationTable(dbHandle) != MSG_SUCCESS) {
dbHandle->endTrans(false);
err = MSG_ERR_DB_EXEC;
goto FREE_MEMORY;
}
- // Update Address
+ /* Update Address */
while (!threadList.empty()) {
err = MsgStoUpdateConversation(dbHandle, threadList.front());
dbHandle->endTrans(true);
-/*** Set pMsgIdList **/
+ /* Set pMsgIdList */
if (pMsgIdList != NULL && pToDeleteMsgIdList->nCount > 0) {
pMsgIdList->nCount = pToDeleteMsgIdList->nCount;
pMsgIdList->msgIdList = (msg_message_id_t *)new char[sizeof(msg_message_id_t)*pToDeleteMsgIdList->nCount];
memcpy(pMsgIdList->msgIdList, pToDeleteMsgIdList->msgIdList, sizeof(msg_message_id_t)*pToDeleteMsgIdList->nCount);
}
-/*** **/
-/*** Create thread for noti and phone log delete. **/
+ /* Create thread for noti and phone log delete. */
if (!bOnlyDB) {
if (pToDeleteMsgIdList->nCount > 0) {
-// if (g_idle_add(startToDeletePhoneLog, (void *)pToDeleteMsgIdList) == 0) {
-// MSG_DEBUG("startToDeletePhoneLog not invoked: %s", strerror(errno));
- // memory free
- if (pToDeleteMsgIdList != NULL) {
- //free peer info list
- if (pToDeleteMsgIdList->msgIdList != NULL)
- delete [] pToDeleteMsgIdList->msgIdList;
-
- delete [] pToDeleteMsgIdList;
- }
-// err = MSG_ERR_UNKNOWN;
-// }
+ /* memory free */
+ if (pToDeleteMsgIdList != NULL) {
+ /*free peer info list */
+ if (pToDeleteMsgIdList->msgIdList != NULL)
+ delete [] pToDeleteMsgIdList->msgIdList;
+
+ delete [] pToDeleteMsgIdList;
+ }
MsgRefreshAllNotification(true, false, MSG_ACTIVE_NOTI_TYPE_NONE);
}
}
-/*** **/
return MSG_SUCCESS;
threadList.pop();
}
- // memory free
+ /* memory free */
if (pToDeleteMsgIdList != NULL) {
- //free peer info list
+ /*free peer info list */
if (pToDeleteMsgIdList->msgIdList != NULL)
delete [] pToDeleteMsgIdList->msgIdList;
}
return err;
-
}
MsgDbHandler *dbHandle = getDbHandle();
dbHandle->beginTrans();
- // reset msgid temp table
+ /* reset msgid temp table */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s;", MSGFW_TMP_MSGID_TABLE_NAME);
MSG_DEBUG("[%s]", sqlQuery);
}
dbHandle->freeTable();
- // delete report notification
+ /* delete report notification */
char tempAddr[MAX_ADDRESS_VAL_LEN+1];
while (!threadList1.empty()) {
memset(tempAddr, 0x00, sizeof(tempAddr));
}
}
dbHandle->freeTable();
- /*** **/
dbHandle->beginTrans();
for (int i = 0; i < listCnt; i++) {
if ( !i ) {
-
- char filePath[MSG_FILEPATH_LEN_MAX] = {0,};
- char dirPath[MSG_FILEPATH_LEN_MAX] = {0,};
+ char filePath[MSG_FILEPATH_LEN_MAX] = {0, };
+ char dirPath[MSG_FILEPATH_LEN_MAX] = {0, };
rowCnt = 0;
MSG_SEC_DEBUG("filePath [%s]", filePath);
- // Delete raw file.
+ /* Delete raw file. */
snprintf(dirPath, sizeof(dirPath), "%s.dir", filePath);
if (remove(filePath) == -1)
dbHandle->freeTable();
} else if (i == 1) {
-
- char filePath[MSG_FILEPATH_LEN_MAX] = {0,};
+ char filePath[MSG_FILEPATH_LEN_MAX] = {0, };
rowCnt = 0;
}
dbHandle->freeTable();
} else if (!strcmp(tableList[i], MSGFW_MMS_MULTIPART_TABLE_NAME)) {
- // MMS file path to delete.
- char filePath[MSG_FILEPATH_LEN_MAX] = {0,};
+ /* MMS file path to delete. */
+ char filePath[MSG_FILEPATH_LEN_MAX] = {0, };
rowCnt = 0;
}
dbHandle->freeTable();
- // MMS thumbnail path to delete
+ /* MMS thumbnail path to delete */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT THUMB_FILE_PATH FROM %s WHERE MSG_ID IN %s;", MSGFW_MMS_MULTIPART_TABLE_NAME, MSGFW_TMP_MSGID_TABLE_NAME);
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID IN %s;", tableList[i], MSGFW_TMP_MSGID_TABLE_NAME);
- // Delete Message in specific folder from table
+ /* Delete Message in specific folder from table */
err = dbHandle->execQuery(sqlQuery);
if (err != MSG_SUCCESS) {
MSG_DEBUG("Fail to execQuery().");
}
}
- // Clear Conversation table
+ /* Clear Conversation table */
err = MsgStoClearConversationTable(dbHandle);
if (err != MSG_SUCCESS) MSG_DEBUG("Fail to MsgStoClearConversationTable().");
- // Update Address
+ /* Update Address */
while (!threadList2.empty()) {
err = MsgStoUpdateConversation(dbHandle, threadList2.front());
if (err != MSG_SUCCESS) MSG_DEBUG("Fail to MsgStoUpdateConversation().");
MSG_DEBUG("msgId : %d, destStorageId : %d", msgId, destStorageId);
switch (destStorageId) {
- case MSG_STORAGE_SIM : // Move message to sim card
- case MSG_STORAGE_SIM2 :
- {
+ case MSG_STORAGE_SIM : /* Move message to sim card */
+ case MSG_STORAGE_SIM2 : {
MSG_MESSAGE_INFO_S msgInfo;
SMS_SIM_ID_LIST_S simIdList;
}
break;
- default: //Moving message to memory (when destination storage id is MSG_STORAGE_PHONE)
- {
+ default: { /* Moving message to memory (when destination storage id is MSG_STORAGE_PHONE) */
#ifndef FEATURE_SMS_CDMA
bool bSimMsg = false;
int rowCnt = 0;
msg_sim_id_t simMsgId;
msg_sim_slot_id_t sim_idx;
- // get sim message id
+ /* get sim message id */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT SIM_SLOT_ID, SIM_ID FROM %s WHERE MSG_ID = %d;",
return err;
}
- //Delete messages in sim card
+ /* Delete messages in sim card */
MsgPlugin *plg = MsgPluginManager::instance()->getPlugin(MSG_SMS_TYPE);
if (plg == NULL) {
MSG_DEBUG("SMS Plug-in is NULL");
dbHandle->beginTrans();
- //Delete Messages in SIM Msg table
+ /* Delete Messages in SIM Msg table */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = %d;",
MSGFW_SIM_MSG_TABLE_NAME, msgId);
return MSG_ERR_DB_EXEC;
}
- //Move storage id
+ /* Move storage id */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET STORAGE_ID = %d WHERE MSG_ID = %d;",
MSGFW_MESSAGE_TABLE_NAME, destStorageId, msgId);
memset(sqlQuery, 0x00, sizeof(sqlQuery));
MsgDbHandler *dbHandle = getDbHandle();
- // SMS
+ /* SMS */
if ((pMsgType->mainType == MSG_SMS_TYPE) &&
(pMsgType->subType == MSG_NORMAL_SMS || pMsgType->subType == MSG_STATUS_REPORT_SMS || pMsgType->subType == MSG_CONCAT_SIM_SMS)) {
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d, %d, %d);",
MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_NORMAL_SMS, MSG_STATUS_REPORT_SMS, MSG_CONCAT_SIM_SMS);
} else if ((pMsgType->mainType == MSG_SMS_TYPE) &&
(pMsgType->subType == MSG_WAP_SI_SMS || pMsgType->subType == MSG_WAP_SL_SMS)) {
- // PUSH
+ /* PUSH */
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d, %d);",
MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_WAP_SI_SMS, MSG_WAP_SL_SMS);
} else if ((pMsgType->mainType == MSG_MMS_TYPE) &&
(pMsgType->subType == MSG_SENDREQ_MMS || pMsgType->subType == MSG_SENDCONF_MMS || pMsgType->subType == MSG_RETRIEVE_AUTOCONF_MMS || pMsgType->subType == MSG_RETRIEVE_MANUALCONF_MMS)) {
- // MMS
+ /* MMS */
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d, %d, %d, %d);",
MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_SENDREQ_MMS, MSG_SENDCONF_MMS, MSG_RETRIEVE_AUTOCONF_MMS, MSG_RETRIEVE_MANUALCONF_MMS);
} else {
pMsg->bProtected = dbHandle->columnInt(10);
pMsg->bBackup = dbHandle->columnInt(11);
pMsg->priority = dbHandle->columnInt(12);
- pMsg->direction= dbHandle->columnInt(13);
+ pMsg->direction = dbHandle->columnInt(13);
strncpy(pMsg->subject, (char *)dbHandle->columnText(15), MAX_SUBJECT_LEN);
strncpy(msgData, (char *)dbHandle->columnText(16), pMsg->dataSize);
- // Save Message Data into File
+ /* Save Message Data into File */
char fileName[MSG_FILENAME_LEN_MAX+1];
memset(fileName, 0x00, sizeof(fileName));
memset(pMsg->msgText, 0x00, sizeof(pMsg->msgText));
strncpy(pMsg->msgText, (char *)dbHandle->columnText(16), pMsg->dataSize);
- // For WAP PUSH SI Message
+ /* For WAP PUSH SI Message */
if (pMsg->msgType.subType == MSG_WAP_SI_SMS) {
strncat(pMsg->msgText, "\n", MAX_MSG_TEXT_LEN-strlen(pMsg->msgText));
strncat(pMsg->msgText, pMsg->subject, MAX_MSG_TEXT_LEN-strlen(pMsg->msgText));
strncpy(pMsg->msgText, (char *)dbHandle->columnText(16), MAX_MSG_TEXT_LEN);
}
- // thumbnail path
+ /* thumbnail path */
if (dbHandle->columnText(17)!= NULL && ((char *)dbHandle->columnText(17))[0] != '\0') {
strncpy(pMsg->thumbPath, (char *)dbHandle->columnText(17), MSG_FILEPATH_LEN_MAX);
MSG_DEBUG("pMsg->thumbPath : [%s]", pMsg->thumbPath);
dbHandle->finalizeQuery();
- // get address information.
- //contacts-service is not used for gear
- //contactNameOrder is never used
+ /* get address information. */
+ /*contacts-service is not used for gear */
+ /*contactNameOrder is never used */
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
MsgStoGetAddressByMsgId(dbHandle, pMsg->msgId, MsgGetContactNameOrder(), &pMsg->nAddressCnt, &pMsg->addressList);
-#else // MSG_CONTACTS_SERVICE_NOT_SUPPORTED
-// MsgStoGetAddressByMsgId(dbHandle, pMsg->msgId, &pMsg->nAddressCnt, &pMsg->addressList);
-#endif //MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /*MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
- // Get MMS body if it is MMS.
+ /* Get MMS body if it is MMS. */
if ((pMsg->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS &&
(pMsg->msgType.subType == MSG_RETRIEVE_MMS || pMsg->msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS || pMsg->msgType.subType == MSG_RETRIEVE_MANUALCONF_MMS)) ||
pMsg->msgType.subType == MSG_SENDREQ_MMS || pMsg->msgType.subType == MSG_SENDCONF_MMS || pMsg->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
msg_error_t err = MSG_SUCCESS;
char *pDestMsg = NULL;
- int temp_size = pMsg->dataSize;//save raw file size;
+ int temp_size = pMsg->dataSize; /* save raw file size; */
- // call mms plugin to get mms specific message data
+ /* call mms plugin to get mms specific message data */
MsgPlugin *plg = MsgPluginManager::instance()->getPlugin(pMsg->msgType.mainType);
if (plg == NULL) {
MSG_DEBUG("SMS Plug-in is NULL");
memset(pMsg->msgData, 0, MAX_MSG_DATA_LEN+1);
- // Encode MMS specific data to MMS_MESSAGE_DATA_S
+ /* Encode MMS specific data to MMS_MESSAGE_DATA_S */
if (pMsg->dataSize > MAX_MSG_DATA_LEN) {
- // Save Message Data into File
+ /* Save Message Data into File */
char tempFileName[MSG_FILENAME_LEN_MAX+1];
memset(tempFileName, 0x00, sizeof(tempFileName));
if (MsgCreateFileName(tempFileName) == false) {
if(pDestMsg) {
- free (pDestMsg);
+ free(pDestMsg);
pDestMsg = NULL;
}
return MSG_ERR_STORAGE_ERROR;
if (MsgWriteIpcFile(tempFileName, pDestMsg, pMsg->dataSize) == false) {
if(pDestMsg) {
- free (pDestMsg);
+ free(pDestMsg);
pDestMsg = NULL;
}
return MSG_ERR_STORAGE_ERROR;
pMsg->bTextSms = true;
}
- pMsg->dataSize = temp_size;//raw file size;
+ pMsg->dataSize = temp_size; /*raw file size; */
if (pDestMsg) {
free(pDestMsg);
}
}
- // Get SMS Sending Options
+ /* Get SMS Sending Options */
if (pMsg->msgType.mainType == MSG_SMS_TYPE && pSendOptInfo != NULL)
MsgStoGetSmsSendOpt(pMsg, pSendOptInfo);
MSGFW_MESSAGE_TABLE_NAME, MSG_NETWORK_SEND_PENDING, MSG_NETWORK_RETRIEVE_PENDING, MSG_OUTBOX_ID, MSG_INBOX_ID);
err = dbHandle->getTable(sqlQuery, &rowCnt, &index);
- if(err == MSG_ERR_DB_NORECORD){
+ if(err == MSG_ERR_DB_NORECORD) {
dbHandle->freeTable();
return MSG_SUCCESS;
}
*count = rowCnt;
int *list = new int[rowCnt];
- for(int i=0; i<rowCnt; ++i){
+ for(int i = 0; i < rowCnt; ++i) {
list[i] = dbHandle->getColumnToInt(index++);
}
*failed_msg_list = list;
}
}
- // Add Message Table
+ /* Add Message Table */
pMsgInfo->threadId = convId;
rowId = MsgStoAddMessageTable(dbHandle, pMsgInfo);
MSGFW_MESSAGE_TABLE_NAME, MSG_INBOX_ID, MSG_MMS_TYPE, MSG_NOTIFICATIONIND_MMS);
}
- // Get Message ID
+ /* Get Message ID */
msg_message_id_t msgId;
if (dbHandle->prepareQuery(sqlQuery) != MSG_SUCCESS)
dbHandle->finalizeQuery();
- // Get Message Info
+ /* Get Message Info */
err = MsgStoGetMessage(msgId, pMsg, NULL);
return err;
unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> buf(&pAddrInfo, unique_ptr_deleter);
*count = 0;
- // get contact search list
+ /* get contact search list */
if (MsgGetContactSearchList(pSearchVal, &pAddrInfo, count) != MSG_SUCCESS) {
MSG_DEBUG("MsgGetContactSearchList fail.");
*count = 0;
char sqlQuery[MAX_QUERY_LEN+1];
dbHandle->beginTrans();
- // reset address temp table
+ /* reset address temp table */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s;", MSGFW_ADDRESS_TEMP_TABLE_NAME);
MSG_DEBUG("[%s]", sqlQuery);
if (pAddrInfo->contactId > 0) {
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) AS TOTAL, \
- SUM(CASE WHEN READ_STATUS=0 AND FOLDER_ID=%d THEN 1 ELSE 0 END), \
- SUM(CASE WHEN MAIN_TYPE=%d THEN 1 ELSE 0 END), \
- SUM(CASE WHEN MAIN_TYPE=%d THEN 1 ELSE 0 END) \
+ SUM(CASE WHEN READ_STATUS = 0 AND FOLDER_ID = %d THEN 1 ELSE 0 END), \
+ SUM(CASE WHEN MAIN_TYPE = %d THEN 1 ELSE 0 END), \
+ SUM(CASE WHEN MAIN_TYPE = %d THEN 1 ELSE 0 END) \
FROM (SELECT * FROM %s A JOIN %s B ON A.CONV_ID = B.CONV_ID WHERE B.CONTACT_ID = %d)",
MSG_INBOX_ID, MSG_SMS_TYPE, MSG_MMS_TYPE, MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, pAddrInfo->contactId);
} else {
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(*) AS TOTAL, \
- SUM(CASE WHEN READ_STATUS=0 AND FOLDER_ID=%d THEN 1 ELSE 0 END), \
- SUM(CASE WHEN MAIN_TYPE=%d THEN 1 ELSE 0 END), \
- SUM(CASE WHEN MAIN_TYPE=%d THEN 1 ELSE 0 END) \
- FROM (SELECT * FROM %s A JOIN %s B ON A.CONV_ID = B.CONV_ID WHERE B.ADDRESS_VAL = '%s')",
+ SUM(CASE WHEN READ_STATUS = 0 AND FOLDER_ID = %d THEN 1 ELSE 0 END), \
+ SUM(CASE WHEN MAIN_TYPE = %d THEN 1 ELSE 0 END), \
+ SUM(CASE WHEN MAIN_TYPE = %d THEN 1 ELSE 0 END) \
+ FROM (SELECT * FROM %s A JOIN %s B ON A.CONV_ID = B.CONV_ID WHERE B.ADDRESS_VAL = '%s')",
MSG_INBOX_ID, MSG_SMS_TYPE, MSG_MMS_TYPE, MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, pAddrInfo->msgAddrInfo.addressVal);
}
dbHandle->finalizeQuery();
- if (direction == MSG_DIRECTION_TYPE_MO) {//get received report list of MO message
-
+ if (direction == MSG_DIRECTION_TYPE_MO) {/*get received report list of MO message */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
- //MSG_ID INTEGER , ADDRESS_VAL TEXT , STATUS_TYPE INTEGER , STATUS INTEGER DEFAULT 0 , TIME DATETIME)
- //select * from MSG_REPORT_TABLE where MSG_ID=38 order by ADDRESS_VAL DESC, STATUS_TYPE ASC;
+ /*MSG_ID INTEGER , ADDRESS_VAL TEXT , STATUS_TYPE INTEGER , STATUS INTEGER DEFAULT 0 , TIME DATETIME) */
+ /*select * from MSG_REPORT_TABLE where MSG_ID=38 order by ADDRESS_VAL DESC, STATUS_TYPE ASC; */
snprintf(sqlQuery, sizeof(sqlQuery),
"SELECT ADDRESS_VAL, STATUS_TYPE, STATUS, TIME "
"FROM %s "
report_status[i].status = dbHandle->getColumnToInt(index++);
report_status[i].statusTime = (time_t)dbHandle->getColumnToInt(index++);
- MSG_DEBUG("(%d/%d) addr = %s, report_type = %d, report_status = %d, report_time = %d", i+1, rowCnt, report_status[i].addressVal, report_status[i].type, report_status[i].status, report_status[i].statusTime );
+ MSG_DEBUG("(%d/%d) addr = %s, report_type = %d, report_status = %d, report_time = %d", i+1, rowCnt, report_status[i].addressVal, report_status[i].type, report_status[i].status, report_status[i].statusTime);
}
*pReportStatus = report_status;
dbHandle->freeTable();
- } else if (direction == MSG_DIRECTION_TYPE_MT) {//read report sent status of MT message
-
+ } else if (direction == MSG_DIRECTION_TYPE_MT) { /*read report sent status of MT message */
int readReportSentStatus;
if (MsgStoCheckReadReportRequested(dbHandle, msgId) == false) {
MSG_DEBUG("report_type = %d, report_status = %d", report_status->type, report_status->status);
*pReportStatus = report_status;
-
-
}
return MSG_SUCCESS;
if (MsgExistAddress(dbHandle, pMsg, pThreadId) == true) {
MSG_DEBUG("Conversation ID : [%d]", *pThreadId);
- // check thread count
+ /* check thread count */
MSG_THREAD_VIEW_S threadInfo;
memset(&threadInfo, 0x00, sizeof(MSG_THREAD_VIEW_S));
MsgStoGetThreadInfo(*pThreadId, &threadInfo);
char sqlQuery[MAX_QUERY_LEN+1];
- // Get MSG_ID
+ /* Get MSG_ID */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s A \
WHERE CONV_ID = %d AND READ_STATUS = 0;", MSGFW_MESSAGE_TABLE_NAME, threadId);
char sqlQuery[MAX_QUERY_LEN+1];
if(MsgExistConversation(dbHandle, pMsg->threadId)) {
- // add message to address table which having same thread_id and datetime;
+ /* add message to address table which having same thread_id and datetime; */
for (int i = 0; i < pMsg->nAddressCnt; i++) {
if(MsgExistAddress(dbHandle, pMsg, pMsg->threadId, i) == false) {
unsigned int addrId;
MSG_CONTACT_INFO_S contactInfo;
memset(&contactInfo, 0x00, sizeof(MSG_CONTACT_INFO_S));
- // Get Contact Info
-// if (MsgGetContactInfo(&(pMsg->addressList[i]), &contactInfo) != MSG_SUCCESS) {
-// MSG_DEBUG("MsgGetContactInfo() fail.");
-// }
+ /* Get Contact Info */
+/* if (MsgGetContactInfo(&(pMsg->addressList[i]), &contactInfo) != MSG_SUCCESS) { */
+/* MSG_DEBUG("MsgGetContactInfo() fail."); */
+/* } */
err = dbHandle->getRowId(MSGFW_ADDRESS_TABLE_NAME, &addrId);
if (err != MSG_SUCCESS) {
MSG_DEBUG("pDbHandle->getRowId fail. [%d]", err);
return err;
}
- // Add Address
+ /* Add Address */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, '%s', %d, %d, ?, ?, ?, ?, ?, '%s', 0);",
MSGFW_ADDRESS_TABLE_NAME, addrId, pMsg->threadId, pMsg->addressList[i].addressType, pMsg->addressList[i].recipientType, pMsg->addressList[i].addressVal,
dbHandle->finalizeQuery();
- // set conversation display name by conv id
+ /* set conversation display name by conv id */
MsgStoSetConversationDisplayName(dbHandle, pMsg->threadId);
}
}
char *pFileData = NULL;
unique_ptr<char*, void(*)(char**)> buf(&pFileData, unique_ptr_deleter);
- // Get File Data
+ /* Get File Data */
if (pMsg->bTextSms == false) {
if (MsgOpenAndReadFile(pMsg->msgData, &pFileData, &fileSize) == false) {
return MSG_ERR_STORAGE_ERROR;
char *imsi = MsgSettingGetString(keyName);
- // Add Message
+ /* Add Message */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, %d, %d, %ld, %d, %d, %d, %d, %d, %d, 0, %d, ?, '', '', ?, 0, %d, '%s');",
if (err != MSG_SUCCESS)
return MSG_ERR_STORAGE_ERROR;
-
}
}
}
-
}
- }
- else
- {
- // add message to conversation, message, address table;
+ } else {
+ /* add message to conversation, message, address table; */
pMsg->msgId = 0;
err = MsgStoAddMessage(pMsg, pSendOptInfo);
}
MSG_DEBUG("simIdList exist.");
int simId = 0;
- for(int i=0; i < listSize; ++i)
- {
+ for(int i = 0; i < listSize; ++i) {
if(simIdList[i]) {
simId = simIdList[i] - 1;
char sqlQuery[MAX_QUERY_LEN+1];
MSG_BEGIN();
MSG_DEBUG("sim_idx = %d", sim_idx);
-// msg_error_t err = MSG_SUCCESS;
+/* msg_error_t err = MSG_SUCCESS; */
MsgDbHandler *dbHandle = getDbHandle();
char sqlQuery[MAX_QUERY_LEN+1];
dbHandle->beginTrans();
- if(sim_idx == 0){
+ if (sim_idx == 0) {
MSG_DEBUG("sim index is 0");
memset(sqlQuery, 0x00, sizeof(sqlQuery));
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
}
- }
- else
- {
+ } else {
MSG_DEBUG("sim index is %d", sim_idx);
memset(keyName, 0x00, sizeof(keyName));
return MSG_ERR_DB_PREPARE;
if(dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
-
char *subject = (char*)dbHandle->columnText(0);
char *text = (char*)dbHandle->columnText(1);
dbHandle->finalizeQuery();
return MSG_SUCCESS;
-
}
if(pMsg->msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS || pMsg->msgType.subType == MSG_RETRIEVE_MANUALCONF_MMS) {
if (pMsg->addressList) {
if (pMsg->nAddressCnt == 1) {
- char tmpAddressVal[MAX_ADDRESS_VAL_LEN+1] = {0,};
+ char tmpAddressVal[MAX_ADDRESS_VAL_LEN+1] = {0, };
msg_address_type_t tmpAddressType;
msg_recipient_type_t tmpRecipientType;
int tmpConvId;
if (tmpAddressType != pMsg->addressList->addressType ||
tmpRecipientType != pMsg->addressList->recipientType ||
(strncmp(tmpAddressVal, pMsg->addressList->addressVal, MAX_ADDRESS_VAL_LEN) != 0)) {
-
MSG_WARN("AddressList of NotiInd and MMSConf are different!!, Replace AddressList to MMSConf data");
MSG_WARN("AddType [NotiInd : %d], [MMSConf : %d]", tmpAddressType, pMsg->addressList->addressType);
MSG_WARN("RcptType [NotiInd : %d], [MMSConf : %d]", tmpRecipientType, pMsg->addressList->recipientType);
MSG_DEBUG("Conversation id:[%d]", convId);
if (convId > 0) {
-
if (MsgStoUpdateConversation(dbHandle, convId) != MSG_SUCCESS) {
MSG_DEBUG("MsgStoUpdateConversation() Error");
dbHandle->freeTable();
return err;
}
- for(int i = 0; i < rowCnt; i++)
- {
+ for (int i = 0; i < rowCnt; i++) {
pMsg->addressList[i].addressType = dbHandle->getColumnToInt(index++);
pMsg->addressList[i].recipientType = dbHandle->getColumnToInt(index++);
dbHandle->getColumnToString(index++, MAX_ADDRESS_VAL_LEN, pMsg->addressList[i].addressVal);
return MSG_ERR_DB_GETTABLE;
}
- pRecipientList->recipientCnt= rowCnt;
+ pRecipientList->recipientCnt = rowCnt;
MSG_DEBUG("pRecipientList->recipientCnt [%d]", pRecipientList->recipientCnt);
- pRecipientList->recipientAddr= (MSG_ADDRESS_INFO_S*)new char[sizeof(MSG_ADDRESS_INFO_S)*rowCnt];
+ pRecipientList->recipientAddr = (MSG_ADDRESS_INFO_S*)new char[sizeof(MSG_ADDRESS_INFO_S)*rowCnt];
MSG_ADDRESS_INFO_S* pTmp = pRecipientList->recipientAddr;
- for (int i = 0; i < rowCnt; i++)
- {
+ for (int i = 0; i < rowCnt; i++) {
pTmp->addressType = dbHandle->getColumnToInt(index++);
- pTmp->recipientType= dbHandle->getColumnToInt(index++);
+ pTmp->recipientType = dbHandle->getColumnToInt(index++);
memset(pTmp->addressVal, 0x00, sizeof(pTmp->addressVal));
dbHandle->getColumnToString(index++, MAX_ADDRESS_VAL_LEN, pTmp->addressVal);
queue<msg_thread_id_t> threadList;
- // Get Address ID of SIM Message
+ /* Get Address ID of SIM Message */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT DISTINCT(CONV_ID) FROM %s WHERE STORAGE_ID = %d",
return MSG_SUCCESS;
}
- for (int i = 1; i <= rowCnt; i++)
- {
+ for (int i = 1; i <= rowCnt; i++) {
MSG_DEBUG("thread ID : %d", dbHandle->getColumnToInt(i));
threadList.push((msg_thread_id_t)dbHandle->getColumnToInt(i));
}
dbHandle->beginTrans();
- for (int i = 0; i < listCnt; i++)
- {
+ for (int i = 0; i < listCnt; i++) {
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID IN \
(SELECT MSG_ID FROM %s WHERE STORAGE_ID = %d);",
tableList[i], MSGFW_MESSAGE_TABLE_NAME, MSG_STORAGE_SIM);
- // Delete SIM Message in tables
+ /* Delete SIM Message in tables */
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
}
}
- // Clear Conversation table
+ /* Clear Conversation table */
if (MsgStoClearConversationTable(dbHandle) != MSG_SUCCESS) {
dbHandle->endTrans(false);
return MSG_ERR_DB_EXEC;
}
- // Update Address
- while (!threadList.empty())
- {
+ /* Update Address */
+ while (!threadList.empty()) {
err = MsgStoUpdateConversation(dbHandle, threadList.front());
threadList.pop();
}
- for (int i = 0; i < rowCnt; i++)
- {
+ for (int i = 0; i < rowCnt; i++) {
memset(filePath, 0x00, sizeof(filePath));
msgId = dbHandle->getColumnToInt(index++);
MsgStoDeleteMessage(msgId, false);
}
}
-
}
dbHandle->freeTable();
MsgSettingGetBool(MSG_AUTO_ERASE, &bAutoErase);
if (bAutoErase) {
-
MSG_DEBUG("threadId [%d]", threadId);
//msg_id_list_s msgIdList;
MSGFW_MESSAGE_TABLE_NAME,
MSGFW_MESSAGE_TABLE_NAME,
threadId, MSG_ALLBOX_ID, MSG_SPAMBOX_ID, MSG_STORAGE_PHONE,
- MSG_SMS_TYPE, ((currentSmsCnt-limitSmsCnt)>0)?(currentSmsCnt-limitSmsCnt):0,
+ MSG_SMS_TYPE, ((currentSmsCnt-limitSmsCnt) > 0)?(currentSmsCnt-limitSmsCnt):0,
MSGFW_MESSAGE_TABLE_NAME,
threadId, MSG_ALLBOX_ID, MSG_SPAMBOX_ID, MSG_STORAGE_PHONE,
- MSG_MMS_TYPE, MSG_DELIVERYIND_MMS, MSG_READRECIND_MMS, MSG_READORGIND_MMS, ((currentMmsCnt-limitMmsCnt)>0)?(currentMmsCnt-limitMmsCnt):0);
+ MSG_MMS_TYPE, MSG_DELIVERYIND_MMS, MSG_READRECIND_MMS, MSG_READORGIND_MMS, ((currentMmsCnt-limitMmsCnt) > 0)?(currentMmsCnt-limitMmsCnt):0);
#else
snprintf(sqlQuery, sizeof(sqlQuery),
"SELECT DISTINCT(MSG_ID) FROM %s "
MSGFW_MESSAGE_TABLE_NAME,
MSGFW_MESSAGE_TABLE_NAME,
threadId, MSG_ALLBOX_ID, MSG_CBMSGBOX_ID, MSG_STORAGE_PHONE,
- MSG_SMS_TYPE, ((currentSmsCnt-limitSmsCnt)>0)?(currentSmsCnt-limitSmsCnt):0,
+ MSG_SMS_TYPE, ((currentSmsCnt-limitSmsCnt) > 0)?(currentSmsCnt-limitSmsCnt):0,
MSGFW_MESSAGE_TABLE_NAME,
threadId, MSG_ALLBOX_ID, MSG_CBMSGBOX_ID, MSG_STORAGE_PHONE,
- MSG_MMS_TYPE, MSG_DELIVERYIND_MMS, MSG_READRECIND_MMS, MSG_READORGIND_MMS, ((currentMmsCnt-limitMmsCnt)>0)?(currentMmsCnt-limitMmsCnt):0);
+ MSG_MMS_TYPE, MSG_DELIVERYIND_MMS, MSG_READRECIND_MMS, MSG_READORGIND_MMS, ((currentMmsCnt-limitMmsCnt) > 0)?(currentMmsCnt-limitMmsCnt):0);
#endif
err = dbHandle->getTable(sqlQuery, &rowCnt, &index);
dbHandle->beginTrans();
if (pMsgInfo->nAddressCnt > 0) {
-
err = MsgStoAddAddress(dbHandle, pMsgInfo, &convId);
if (err != MSG_SUCCESS) {
pPushMsg = (MSG_PUSH_CACHEOP_S*)pFileData;
for (int i = 0; i < pPushMsg->invalObjectCnt; i++) {
-
int msgid = -1;
memset(href, 0x00, sizeof(href));
err = dbHandle->prepareQuery(sqlQuery);
if ((dbHandle->stepQuery() == MSG_ERR_DB_ROW) && err == MSG_SUCCESS) {
-
msgid = dbHandle->columnInt(0);
memset(sqlQuery, 0x00, sizeof(sqlQuery));
}
for (int i = 0; i < pPushMsg->invalServiceCnt; i++) {
-
int msgid = -1;
memset(href, 0x00, sizeof(href));
err = dbHandle->prepareQuery(sqlQuery);
if ((dbHandle->stepQuery() == MSG_ERR_DB_ROW) && err == MSG_SUCCESS) {
-
msgid = dbHandle->columnInt(0);
memset(sqlQuery, 0x00, sizeof(sqlQuery));
if (err == MSG_ERR_DB_NORECORD) {
dbHandle->freeTable();
return MSG_SUCCESS;
- } else if ( err != MSG_SUCCESS) {
+ } else if (err != MSG_SUCCESS) {
dbHandle->freeTable();
return err;
}
for (int i = 0; i < rowCnt; i++) {
-
err = MsgStoUpdateConversation(dbHandle, index++);
if (err != MSG_SUCCESS)
MSG_DEBUG("==== bSetting = [%d] ====", pReqInfo->sendOptInfo.bSetting);
- if (pReqInfo->msgInfo.msgType.mainType == MSG_SMS_TYPE)
- {
+ if (pReqInfo->msgInfo.msgType.mainType == MSG_SMS_TYPE) {
MSG_DEBUG("==== deliver = [%d] ====", pReqInfo->sendOptInfo.bDeliverReq);
MSG_DEBUG("==== keepcopy = [%d] ====", pReqInfo->sendOptInfo.bKeepCopy);
MSG_DEBUG("==== bReplyPath = [%d] ====", pReqInfo->sendOptInfo.option.smsSendOptInfo.bReplyPath);
err = MsgSubmitReqSMS(pReqInfo);
- }
- else if (pReqInfo->msgInfo.msgType.mainType == MSG_MMS_TYPE)
- {
+ } else if (pReqInfo->msgInfo.msgType.mainType == MSG_MMS_TYPE) {
MSG_DEBUG("==== deliver = [%d] ====", pReqInfo->sendOptInfo.bDeliverReq);
MSG_DEBUG("==== keepcopy = [%d] ====", pReqInfo->sendOptInfo.bKeepCopy);
MSG_DEBUG("==== bReadReq = [%d] ====", pReqInfo->sendOptInfo.option.mmsSendOptInfo.bReadReq);
{
msg_error_t err = MSG_SUCCESS;
- // submit request based on msgType;
+ /* submit request based on msgType; */
MSG_MAIN_TYPE_T mainType = pReqInfo->msgInfo.msgType.mainType;
MsgPlugin* plg = MsgPluginManager::instance()->getPlugin(mainType);
return MSG_ERR_INVALID_PLUGIN_HANDLE;
}
- // If MSG ID > 0 -> MSG in DRAFT
- // Move Folder to OUTBOX
+ /* If MSG ID > 0 -> MSG in DRAFT */
+ /* Move Folder to OUTBOX */
if (pReqInfo->msgInfo.msgPort.valid == false) {
pReqInfo->msgInfo.folderId = MSG_OUTBOX_ID;
} else if (pReqInfo->msgInfo.sim_idx != defaultNetworkSimId) {
MSG_ERR("It is not default network SIM ID, request SIM=[%d], activated SIM=[%d]", pReqInfo->msgInfo.sim_idx, defaultNetworkSimId);
return MSG_ERR_INVALID_PARAMETER;
-
}
MSG_MAIN_TYPE_T msgMainType = pReqInfo->msgInfo.msgType.mainType;
MsgPlugin *plg = MsgPluginManager::instance()->getPlugin(msgMainType);
- if(!plg)
- {
+ if(!plg) {
MsgStoUpdateNetworkStatus(dbHandle, &(pReqInfo->msgInfo), MSG_NETWORK_SEND_FAIL);
MSG_DEBUG("No Plugin for %d type", msgMainType);
return MSG_ERR_INVALID_PLUGIN_HANDLE;
}
- // If MSG ID > 0 -> MSG in DRAFT
- // Move Folder to OUTBOX
+ /* If MSG ID > 0 -> MSG in DRAFT */
+ /* Move Folder to OUTBOX */
/* reject_msg_support */
MSG_DEBUG("Not scheduled MMS, pReqInfo->msgInfo.msgType.subType [%d]", pReqInfo->msgInfo.msgType.subType);
- if(pReqInfo->msgInfo.msgType.subType == MSG_SENDREQ_JAVA_MMS)
- {
+ if(pReqInfo->msgInfo.msgType.subType == MSG_SENDREQ_JAVA_MMS) {
char fileName[MSG_FILENAME_LEN_MAX+1] = {0};
- // copy whole of MMS PDU filepath to msgData
+ /* copy whole of MMS PDU filepath to msgData */
strncpy(fileName, pReqInfo->msgInfo.msgData, MSG_FILENAME_LEN_MAX);
memset(pReqInfo->msgInfo.msgData, 0x00, sizeof(pReqInfo->msgInfo.msgData));
snprintf(pReqInfo->msgInfo.msgData, sizeof(pReqInfo->msgInfo.msgData), "%s%s", MSG_IPC_DATA_PATH, fileName);
MSG_SEC_DEBUG("JAVA MMS PDU filepath:%s", pReqInfo->msgInfo.msgData);
- // submit request
+ /* submit request */
err = plg->submitReq(pReqInfo);
- if(err != MSG_SUCCESS)
- {
+ if(err != MSG_SUCCESS) {
MSG_DEBUG("Update Network Status : [%d]", err);
- MsgStoUpdateNetworkStatus(dbHandle, &(pReqInfo->msgInfo),MSG_NETWORK_SEND_FAIL);
+ MsgStoUpdateNetworkStatus(dbHandle, &(pReqInfo->msgInfo), MSG_NETWORK_SEND_FAIL);
}
return err;
- }
- else if((pReqInfo->msgInfo.msgType.subType == MSG_SENDREQ_MMS) || (pReqInfo->msgInfo.msgType.subType == MSG_FORWARD_MMS))
- {
+ } else if ((pReqInfo->msgInfo.msgType.subType == MSG_SENDREQ_MMS) || (pReqInfo->msgInfo.msgType.subType == MSG_FORWARD_MMS)) {
MSG_SEC_DEBUG("msgdata file path = [%s]", pReqInfo->msgInfo.msgData);
- if(pReqInfo->msgInfo.msgId > 0 && (pReqInfo->msgInfo.folderId == MSG_DRAFT_ID || pReqInfo->msgInfo.folderId == MSG_OUTBOX_ID)) {
+ if (pReqInfo->msgInfo.msgId > 0 && (pReqInfo->msgInfo.folderId == MSG_DRAFT_ID || pReqInfo->msgInfo.folderId == MSG_OUTBOX_ID)) {
MSG_DEBUG("Not New Message.");
pReqInfo->msgInfo.folderId = MSG_OUTBOX_ID;
err = MsgStoUpdateMessage(&(pReqInfo->msgInfo), &(pReqInfo->sendOptInfo));
pReqInfo->msgInfo.folderId = MSG_OUTBOX_ID;
err = MsgStoAddMessage(&(pReqInfo->msgInfo), &(pReqInfo->sendOptInfo));
}
- }
- else if(pReqInfo->msgInfo.msgType.subType == MSG_READREPLY_MMS)
- {
+ } else if (pReqInfo->msgInfo.msgType.subType == MSG_READREPLY_MMS) {
msg_read_report_status_t readStatus;
err = MsgStoCheckReadReportStatus(pReqInfo->msgInfo.msgId);
if(err != MSG_SUCCESS) {
-
MSG_INFO("msg id [%d], read report could NOT send [%d]", pReqInfo->msgInfo.msgId, err);
return err;
}
memcpy(&readStatus, pReqInfo->msgInfo.msgData, sizeof(msg_read_report_status_t));
if (readStatus == MSG_READ_REPORT_REJECT_BY_USER) {
-
MSG_INFO("msg id [%d], read report reject by user", pReqInfo->msgInfo.msgId);
err = MsgStoSetReadReportSendStatus(pReqInfo->msgInfo.msgId, MMS_RECEIVE_READ_REPORT_NO_SENT);
pReqInfo->msgInfo.nAddressCnt = pRecipientList.recipientCnt;
pReqInfo->msgInfo.addressList = pRecipientList.recipientAddr;
-// for(int i = 0; i < pRecipientList.recipientCnt; i++)
-// {
-// pReqInfo->msgInfo.addressList[i].addressType = pRecipientList.recipientAddr[i].addressType;
-// pReqInfo->msgInfo.addressList[i].recipientType = MSG_RECIPIENTS_TYPE_TO;
-// pReqInfo->msgInfo.addressList[i].contactId = pRecipientList.recipientAddr[i].contactId;
-// strncpy(pReqInfo->msgInfo.addressList[i].addressVal, pRecipientList.recipientAddr[i].addressVal, MAX_ADDRESS_VAL_LEN);
-// }
+ /*
+ for(int i = 0; i < pRecipientList.recipientCnt; i++)
+ {
+ pReqInfo->msgInfo.addressList[i].addressType = pRecipientList.recipientAddr[i].addressType;
+ pReqInfo->msgInfo.addressList[i].recipientType = MSG_RECIPIENTS_TYPE_TO;
+ pReqInfo->msgInfo.addressList[i].contactId = pRecipientList.recipientAddr[i].contactId;
+ strncpy(pReqInfo->msgInfo.addressList[i].addressVal, pRecipientList.recipientAddr[i].addressVal, MAX_ADDRESS_VAL_LEN);
+ }
+ */
char subject[MAX_SUBJECT_LEN+1];
err = MsgStoGetSubject(pReqInfo->msgInfo.msgId, subject);
- if(err != MSG_SUCCESS)
+ if (err != MSG_SUCCESS)
MSG_DEBUG("Getting subject returned not a MSG_SUCCESS");
strncpy(pReqInfo->msgInfo.subject, subject, MAX_SUBJECT_LEN);
err = plg->composeReadReport(&(pReqInfo->msgInfo));
- }
- else if(pReqInfo->msgInfo.msgType.subType == MSG_RETRIEVE_MMS)
- {
+ } else if (pReqInfo->msgInfo.msgType.subType == MSG_RETRIEVE_MMS) {
MsgStoUpdateNetworkStatus(dbHandle, &(pReqInfo->msgInfo), pReqInfo->msgInfo.networkStatus);
}
/* reject_msg_support */
- if(err != MSG_SUCCESS)
- {
+ if(err != MSG_SUCCESS) {
MSG_DEBUG("Fail to Add/Update Message : MsgStoMoveMessageToFolder()/MsgStoAddMessage()");
return err;
}
- switch(pReqInfo->msgInfo.msgType.subType)
- {
+ switch (pReqInfo->msgInfo.msgType.subType) {
case MSG_SENDREQ_MMS:
case MSG_FORWARD_MMS:
MsgDeleteFile(pReqInfo->msgInfo.msgData);
break;
}
- // update content location from db
+ /* update content location from db */
if(pReqInfo->msgInfo.msgType.subType == MSG_RETRIEVE_MMS)
err = MsgStoGetContentLocation(&(pReqInfo->msgInfo));
/* reject_msg_support */
- else if(pReqInfo->msgInfo.msgType.subType == MSG_NOTIFYRESPIND_MMS)
+ else if (pReqInfo->msgInfo.msgType.subType == MSG_NOTIFYRESPIND_MMS)
err = plg->updateRejectStatus(&(pReqInfo->msgInfo));
- /* reject_msg_support */
- // Check SIM is present or not
+ /* Check SIM is present or not */
char keyName[MAX_VCONFKEY_NAME_LEN];
memset(keyName, 0x00, sizeof(keyName));
snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pReqInfo->msgInfo.sim_idx);
MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName);
- if(simStatus == MSG_SIM_STATUS_NOT_FOUND)
- {
+ if(simStatus == MSG_SIM_STATUS_NOT_FOUND) {
MSG_DEBUG("SIM is not present...");
MsgStoUpdateNetworkStatus(dbHandle, &(pReqInfo->msgInfo), MSG_NETWORK_SEND_FAIL);
return MSG_ERR_NO_SIM;
}
- if(err == MSG_SUCCESS)
+ if (err == MSG_SUCCESS)
err = plg->submitReq(pReqInfo);
- if(err == MSG_SUCCESS && ( pReqInfo->msgInfo.msgType.subType == MSG_READREPLY_MMS || pReqInfo->msgInfo.msgType.subType == MSG_READRECIND_MMS ))
+ if (err == MSG_SUCCESS && ( pReqInfo->msgInfo.msgType.subType == MSG_READREPLY_MMS || pReqInfo->msgInfo.msgType.subType == MSG_READRECIND_MMS ))
MsgStoSetReadReportSendStatus(pReqInfo->msgInfo.msgId, MMS_RECEIVE_READ_REPORT_SENT);
- if (err != MSG_SUCCESS)
- {
+ if (err != MSG_SUCCESS) {
if(pReqInfo->msgInfo.msgType.subType == MSG_RETRIEVE_MMS )
MsgStoUpdateNetworkStatus(dbHandle, &(pReqInfo->msgInfo), MSG_NETWORK_RETRIEVE_FAIL);
else
MsgStoUpdateNetworkStatus(dbHandle, &(pReqInfo->msgInfo), MSG_NETWORK_SEND_FAIL);
}
-
return err;
}
#ifdef MSG_MMS_KEEPCOPY
MSG_SENDINGOPT_INFO_S sendOpt = {};
- if (msgType.mainType == MSG_MMS_TYPE)
- {
+ if (msgType.mainType == MSG_MMS_TYPE) {
if (MsgStoGetMmsSendOpt(MsgId, &sendOpt) == MSG_SUCCESS)
- {
bKeepCopy = sendOpt.bKeepCopy;
- }
else
- {
ret = MsgSettingGetBool(MSG_KEEP_COPY, &bKeepCopy);
- }
}
- // Move Msg to SENTBOX
- if (Status == MSG_NETWORK_SEND_SUCCESS)
- {
+ /* Move Msg to SENTBOX */
+ if (Status == MSG_NETWORK_SEND_SUCCESS) {
MSG_DEBUG("In Status == MSG_NETWORK_SEND_SUCCESS and bKeepCopy is [%d]", bKeepCopy);
if (bKeepCopy == true)
err = MsgStoMoveMessageToFolder(MsgId, MSG_SENTBOX_ID);
err = MsgStoDeleteMessage(MsgId, false);
}
#else
- // Move Msg to SENTBOX
- if (Status == MSG_NETWORK_SEND_SUCCESS)
- {
+ /* Move Msg to SENTBOX */
+ if (Status == MSG_NETWORK_SEND_SUCCESS) {
MSG_DEBUG("In Status == MSG_NETWORK_SEND_SUCCESS and bKeepCopy is [%d]", bKeepCopy);
if (bKeepCopy == true)
err = MsgStoMoveMessageToFolder(MsgId, MSG_SENTBOX_ID);
memset(pDest, 0x00, sizeof(MSG_REQUEST_INFO_S));
- // Copy Request ID
+ /* Copy Request ID */
pDest->reqId = pSrc->reqId;
- // Copy Msg Info
+ /* Copy Msg Info */
pDest->msgInfo.msgId = pSrc->msgInfo.msgId;
pDest->msgInfo.threadId = pSrc->msgInfo.threadId;
pDest->msgInfo.msgPort.valid = pSrc->msgInfo.msgPort.valid;
- if (pDest->msgInfo.msgPort.valid == true)
- {
+ if (pDest->msgInfo.msgPort.valid == true) {
pDest->msgInfo.msgPort.dstPort = pSrc->msgInfo.msgPort.dstPort;
pDest->msgInfo.msgPort.srcPort = pSrc->msgInfo.msgPort.srcPort;
}
strncpy(pDest->msgInfo.msgData, pSrc->msgInfo.msgData, MAX_MSG_DATA_LEN);
- if (pDest->msgInfo.bTextSms == true)
- {
+ if (pDest->msgInfo.bTextSms == true) {
memcpy(pDest->msgInfo.msgText, pSrc->msgInfo.msgText, pDest->msgInfo.dataSize);
pDest->msgInfo.msgText[pDest->msgInfo.dataSize] = '\0';
}
- // Set Sending Info
+ /* Set Sending Info */
pDest->sendOptInfo.bSetting = pSrc->sendOptInfo.bSetting;
- if (pDest->sendOptInfo.bSetting == true)
- {
+ if (pDest->sendOptInfo.bSetting == true) {
pDest->sendOptInfo.bDeliverReq = pSrc->sendOptInfo.bDeliverReq;
pDest->sendOptInfo.bKeepCopy = pSrc->sendOptInfo.bKeepCopy;
- if (pDest->msgInfo.msgType.mainType == MSG_SMS_TYPE)
- {
+ if (pDest->msgInfo.msgType.mainType == MSG_SMS_TYPE) {
pDest->sendOptInfo.option.smsSendOptInfo.bReplyPath = pSrc->sendOptInfo.option.smsSendOptInfo.bReplyPath;
- }
- else if (pDest->msgInfo.msgType.mainType == MSG_MMS_TYPE)
- {
+ } else if (pDest->msgInfo.msgType.mainType == MSG_MMS_TYPE) {
pDest->sendOptInfo.option.mmsSendOptInfo.priority = pSrc->sendOptInfo.option.mmsSendOptInfo.priority;
pDest->sendOptInfo.option.mmsSendOptInfo.bReadReq = pSrc->sendOptInfo.option.mmsSendOptInfo.bReadReq;
int eventSize = 0;
- // Get Filter Structure
+ /* Get Filter Structure */
MSG_FILTER_S* pFilter = (MSG_FILTER_S*)pCmd->cmdData;
- // Add Filter
+ /* Add Filter */
err = MsgStoAddFilter(pFilter);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoAddFilter()");
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoAddFilter()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_ADD_FILTER, err, (void**)ppEvent);
return eventSize;
int eventSize = 0;
- // Get Filter Structure
+ /* Get Filter Structure */
MSG_FILTER_S* pFilter = (MSG_FILTER_S*)pCmd->cmdData;
- // Update Filter
+ /* Update Filter */
err = MsgStoUpdateFilter(pFilter);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoUpdateFilter()");
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoUpdateFilter()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_UPDATE_FILTER, err, (void**)ppEvent);
return eventSize;
int eventSize = 0;
- // Get Filter Structure
+ /* Get Filter Structure */
msg_filter_id_t *pFilterId = (msg_filter_id_t *)pCmd->cmdData;
MSG_DEBUG("Delete Filter id : %d", *pFilterId);
- // Delete Filter
+ /* Delete Filter */
err = MsgStoDeleteFilter(*pFilterId);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoDeleteFilter()");
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoDeleteFilter()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_DELETE_FILTER, err, (void**)ppEvent);
return eventSize;
int eventSize = 0;
- // Get Filter Structure
+ /* Get Filter Structure */
msg_filter_id_t *pFilterId = (msg_filter_id_t *)pCmd->cmdData;
bool setFlag = false;
MSG_DEBUG("Filter id : %d", *pFilterId);
- // Delete Filter
+ /* Delete Filter */
err = MsgStoSetFilterActivation(*pFilterId, setFlag);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoSetFilterActivation()");
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoSetFilterActivation()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_SET_FILTER_ACTIVATION, err, (void**)ppEvent);
return eventSize;
int dataSize = 0, eventSize = 0;
- // Get Filter List
+ /* Get Filter List */
msg_struct_list_s filterList;
err = MsgStoGetFilterList(&filterList);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoGetFilterList()");
- // Encoding Filter List Data
+ /* Encoding Filter List Data */
dataSize = MsgEncodeFilterList(&filterList, &encodedData);
if (filterList.msg_struct_info) {
}
g_free(filterList.msg_struct_info);
}
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoGetFilterList()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_FILTERLIST, err, (void**)ppEvent);
return eventSize;
int eventSize = 0;
- // Get Filter Flag
+ /* Get Filter Flag */
bool setFlag = false;
memcpy(&setFlag, pCmd->cmdData, sizeof(bool));
- // Add Filter
+ /* Add Filter */
err = MsgSetFilterOperation(setFlag);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgSetFilterOperation()");
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgSetFilterOperation()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_SET_FILTER_OPERATION, err, (void**)ppEvent);
return eventSize;
int dataSize = 0, eventSize = 0;
- // Get Filter List
+ /* Get Filter List */
bool setFlag = false;
err = MsgGetFilterOperation(&setFlag);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgGetFilterOperation()");
- // Encoding Filter List Data
+ /* Encoding Filter List Data */
dataSize = MsgEncodeFilterFlag(&setFlag, &encodedData);
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgFilterGetFilterList()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_FILTER_OPERATION, err, (void**)ppEvent);
return eventSize;
int eventSize = 0;
int eventType = -1;
- // Get Setting Structure
+ /* Get Setting Structure */
MSG_SETTING_S* pSetting = (MSG_SETTING_S*)pCmd->cmdData;
- // Set Config Data
+ /* Set Config Data */
err = MsgSetConfigData(pSetting);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgSetConfigData()");
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgSetConfigData()");
}
- // Make Event Data
+ /* Make Event Data */
switch (pCmd->cmdType) {
case MSG_CMD_SET_SMSC_OPT :
eventType = MSG_EVENT_SET_SMSC_OPT;
int eventSize = 0;
int eventType = -1;
- // Get Option Type
+ /* Get Option Type */
MSG_OPTION_TYPE_T type = 0;
memcpy((void *)&type, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_OPTION_TYPE_T));
- // Get Config Data
+ /* Get Config Data */
MSG_SETTING_S setting;
setting.type = type;
err = MsgGetConfigData(&setting);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgGetConfigData()");
- // Encoding Config Data
- switch (setting.type)
- {
- case MSG_GENERAL_OPT :
- dataSize += sizeof(MSG_GENERAL_OPT_S);
- break;
- case MSG_SMS_SENDOPT :
- dataSize += sizeof(MSG_SMS_SENDOPT_S);
- break;
- case MSG_SMSC_LIST :
- dataSize += sizeof(MSG_SMSC_LIST_S);
- break;
- case MSG_MMS_SENDOPT :
- dataSize += sizeof(MSG_MMS_SENDOPT_S);
- break;
- case MSG_MMS_RECVOPT :
- dataSize += sizeof(MSG_MMS_RECVOPT_S);
- break;
- case MSG_MMS_STYLEOPT :
- dataSize += sizeof(MSG_MMS_STYLEOPT_S);
- break;
- case MSG_PUSHMSG_OPT :
- dataSize += sizeof(MSG_PUSHMSG_OPT_S);
- break;
- case MSG_CBMSG_OPT :
- dataSize += sizeof(MSG_CBMSG_OPT_S);
- break;
- case MSG_VOICEMAIL_OPT :
- dataSize += sizeof(MSG_VOICEMAIL_OPT_S);
- break;
- case MSG_MSGSIZE_OPT :
- dataSize += sizeof(MSG_MSGSIZE_OPT_S);
- break;
- default:
- break;
- }
+ /* Encoding Config Data */
+ switch (setting.type) {
+ case MSG_GENERAL_OPT :
+ dataSize += sizeof(MSG_GENERAL_OPT_S);
+ break;
+ case MSG_SMS_SENDOPT :
+ dataSize += sizeof(MSG_SMS_SENDOPT_S);
+ break;
+ case MSG_SMSC_LIST :
+ dataSize += sizeof(MSG_SMSC_LIST_S);
+ break;
+ case MSG_MMS_SENDOPT :
+ dataSize += sizeof(MSG_MMS_SENDOPT_S);
+ break;
+ case MSG_MMS_RECVOPT :
+ dataSize += sizeof(MSG_MMS_RECVOPT_S);
+ break;
+ case MSG_MMS_STYLEOPT :
+ dataSize += sizeof(MSG_MMS_STYLEOPT_S);
+ break;
+ case MSG_PUSHMSG_OPT :
+ dataSize += sizeof(MSG_PUSHMSG_OPT_S);
+ break;
+ case MSG_CBMSG_OPT :
+ dataSize += sizeof(MSG_CBMSG_OPT_S);
+ break;
+ case MSG_VOICEMAIL_OPT :
+ dataSize += sizeof(MSG_VOICEMAIL_OPT_S);
+ break;
+ case MSG_MSGSIZE_OPT :
+ dataSize += sizeof(MSG_MSGSIZE_OPT_S);
+ break;
+ default:
+ break;
+ }
- encodedData = (char*)new char[dataSize];
- void* p = (void*)encodedData;
+ encodedData = (char*)new char[dataSize];
+ void* p = (void*)encodedData;
- switch (setting.type)
- {
- case MSG_GENERAL_OPT :
- memcpy(p, &(setting.option.generalOpt), dataSize);
- break;
- case MSG_SMS_SENDOPT :
- memcpy(p, &(setting.option.smsSendOpt), dataSize);
- break;
- case MSG_SMSC_LIST :
- memcpy(p, &(setting.option.smscList), dataSize);
- break;
- case MSG_MMS_SENDOPT :
- memcpy(p, &(setting.option.mmsSendOpt), dataSize);
- break;
- case MSG_MMS_RECVOPT :
- memcpy(p, &(setting.option.mmsRecvOpt), dataSize);
- break;
- case MSG_MMS_STYLEOPT :
- memcpy(p, &(setting.option.mmsStyleOpt), dataSize);
- break;
- case MSG_PUSHMSG_OPT :
- memcpy(p, &(setting.option.pushMsgOpt), dataSize);
- break;
- case MSG_CBMSG_OPT :
- memcpy(p, &(setting.option.cbMsgOpt), dataSize);
- break;
- case MSG_VOICEMAIL_OPT :
- memcpy(p, &(setting.option.voiceMailOpt), dataSize);
- break;
- case MSG_MSGSIZE_OPT :
- memcpy(p, &(setting.option.msgSizeOpt), dataSize);
- break;
- default:
- break;
- }
+ switch (setting.type) {
+ case MSG_GENERAL_OPT :
+ memcpy(p, &(setting.option.generalOpt), dataSize);
+ break;
+ case MSG_SMS_SENDOPT :
+ memcpy(p, &(setting.option.smsSendOpt), dataSize);
+ break;
+ case MSG_SMSC_LIST :
+ memcpy(p, &(setting.option.smscList), dataSize);
+ break;
+ case MSG_MMS_SENDOPT :
+ memcpy(p, &(setting.option.mmsSendOpt), dataSize);
+ break;
+ case MSG_MMS_RECVOPT :
+ memcpy(p, &(setting.option.mmsRecvOpt), dataSize);
+ break;
+ case MSG_MMS_STYLEOPT :
+ memcpy(p, &(setting.option.mmsStyleOpt), dataSize);
+ break;
+ case MSG_PUSHMSG_OPT :
+ memcpy(p, &(setting.option.pushMsgOpt), dataSize);
+ break;
+ case MSG_CBMSG_OPT :
+ memcpy(p, &(setting.option.cbMsgOpt), dataSize);
+ break;
+ case MSG_VOICEMAIL_OPT :
+ memcpy(p, &(setting.option.voiceMailOpt), dataSize);
+ break;
+ case MSG_MSGSIZE_OPT :
+ memcpy(p, &(setting.option.msgSizeOpt), dataSize);
+ break;
+ default:
+ break;
+ }
} else {
MSG_DEBUG("Command Handle Fail : MsgGetConfigData()");
}
break;
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, eventType, err, (void**)ppEvent);
return eventSize;
#include "MsgUtilFile.h"
#include "MsgException.h"
#include "MsgCppTypes.h"
-//#include "MsgSoundPlayer.h"
+/*#include "MsgSoundPlayer.h" */
#include "MsgUtilFunction.h"
#include "MsgStorageHandler.h"
#include "MsgPluginManager.h"
mx.unlock();
return FALSE;
-
}
int MsgAddMessageHandler(const MSG_CMD_S *pCmd, char **ppEvent)
if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoRestoreMessage()");
- // Encoding Message ID
+ /* Encoding Message ID */
dataSize = MsgEncodeMsgId(&(msgInfo.msgId), &encodedData);
} else {
MSG_DEBUG("Command Handle Fail : MsgStoRestoreMessage()");
}
} else {
- // Add Message
+ /* Add Message */
msgInfo.msgId = 0;
err = MsgStoAddMessage(&msgInfo, &sendOptInfo);
if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoAddMessage()");
- // Encoding Message ID
+ /* Encoding Message ID */
dataSize = MsgEncodeMsgId(&(msgInfo.msgId), &encodedData);
} else {
MSG_DEBUG("Command Handle Fail : MsgStoAddMessage()");
}
}
- //storage change CB
+ /*storage change CB */
msg_id_list_s msgIdList;
msg_message_id_t msgIds[1];
memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
MsgTransactionManager::instance()->broadcastStorageChangeCB(MSG_SUCCESS, MSG_STORAGE_CHANGE_INSERT, &msgIdList);
- // Update unread message status
+ /* Update unread message status */
if (msgInfo.folderId == MSG_INBOX_ID && msgInfo.bRead == false) {
mx.lock();
g_job_cnt++;
mx.unlock();
}
- // Delete Temp File for Message Data
+ /* Delete Temp File for Message Data */
if (msgInfo.bTextSms == false)
- MsgDeleteFile(msgInfo.msgData); //ipc
+ MsgDeleteFile(msgInfo.msgData); /*ipc */
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_ADD_MSG, err, (void**)ppEvent);
return eventSize;
MsgDecodeMsgInfo((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(int)+sizeof(int), &msgInfo);
msgInfo.msgId = 0;
- // Add Message
+ /* Add Message */
err = MsgStoAddSyncMLMessage(&msgInfo, extId, pinCode);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoAddSyncMLMessage()");
- // Encoding Message ID
+ /* Encoding Message ID */
dataSize = MsgEncodeMsgId(&(msgInfo.msgId), &encodedData);
- // broadcast to listener threads, here
+ /* broadcast to listener threads, here */
MsgTransactionManager::instance()->broadcastIncomingMsgCB(err, &msgInfo);
- //storage change CB
+ /*storage change CB */
msg_id_list_s msgIdList;
msg_message_id_t msgIds[1];
memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
msgIdList.msgIdList = msgIds;
MsgTransactionManager::instance()->broadcastStorageChangeCB(err, MSG_STORAGE_CHANGE_INSERT, &msgIdList);
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoAddSyncMLMessage()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_ADD_SYNCML_MSG, err, (void**)ppEvent);
return eventSize;
MsgDecodeMsgInfo((char *)pCmd->cmdData, &msgInfo, &sendOptInfo);
- // Update Message
+ /* Update Message */
err = MsgStoUpdateMessage(&msgInfo, &sendOptInfo);
if (err == MSG_SUCCESS)
else
MSG_DEBUG("Command Handle Fail : MsgStoUpdateMessage()");
- // Delete Temp File for Message Data
+ /* Delete Temp File for Message Data */
if (msgInfo.bTextSms == false)
- MsgDeleteFile(msgInfo.msgData); //ipc
+ MsgDeleteFile(msgInfo.msgData); /*ipc */
- //storage change CB
+ /*storage change CB */
msg_id_list_s msgIdList;
msg_message_id_t msgIds[1];
memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
MsgTransactionManager::instance()->broadcastStorageChangeCB(err, MSG_STORAGE_CHANGE_UPDATE, &msgIdList);
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_UPDATE_MSG, err, (void**)ppEvent);
return eventSize;
memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_message_id_t));
memcpy(&readStatus, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_message_id_t)), sizeof(bool));
- // Update Read Status
+ /* Update Read Status */
err = MsgStoUpdateReadStatus(msgId, readStatus);
MSG_DEBUG("message id = [%d], readStatus = [%d]", msgId, readStatus);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoUpdateReadStatus()");
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoUpdateReadStatus()");
}
- //storage change CB
+ /*storage change CB */
msg_id_list_s msgIdList;
msg_message_id_t msgIds[1];
memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
MsgTransactionManager::instance()->broadcastStorageChangeCB(MSG_SUCCESS, MSG_STORAGE_CHANGE_UPDATE, &msgIdList);
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_UPDATE_READ, err, (void**)ppEvent);
return eventSize;
MSG_DEBUG("unReadCnt [%d]", unReadCnt);
if (unReadCnt > 0) {
-
msg_id_list_s msgIdList;
memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
delete [] (char*)msgIdList.msgIdList;
}
- // delete report notification
+ /* delete report notification */
if (err == MSG_SUCCESS) {
MsgDbHandler *dbHandle = getDbHandle();
char tempAddr[MAX_ADDRESS_VAL_LEN+1];
dbHandle->finalizeQuery();
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_UPDATE_THREAD_READ, err, (void**)ppEvent);
return eventSize;
-
}
memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_message_id_t));
memcpy(&protectedStatus, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_message_id_t)), sizeof(bool));
- // Update Protected Status
+ /* Update Protected Status */
err = MsgStoUpdateProtectedStatus(msgId, protectedStatus);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoUpdateProtectedStatus()");
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoUpdateProtectedStatus()");
}
- //storage change CB
+ /*storage change CB */
msg_id_list_s msgIdList;
msg_message_id_t msgIds[1];
memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
MsgTransactionManager::instance()->broadcastStorageChangeCB(MSG_SUCCESS, MSG_STORAGE_CHANGE_UPDATE, &msgIdList);
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_UPDATE_PROTECTED, err, (void**)ppEvent);
return eventSize;
MsgStoGetSyncMLExtId(*msgId, &extId);
- // Delete Message
+ /* Delete Message */
err = MsgStoDeleteMessage(*msgId, true);
if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoDeleteMessage()");
if(extId > 0) {
- // broadcast to listener threads, here
+ /* broadcast to listener threads, here */
MsgTransactionManager::instance()->broadcastSyncMLMsgOperationCB(err, -1, extId);
}
MSG_DEBUG("Command Handle Fail : MsgStoDeleteMessage()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_DELETE_MSG, err, (void**)ppEvent);
return eventSize;
msg_id_list_s msgIdList;
memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
- // Delete Message
+ /* Delete Message */
err = MsgStoDeleteAllMessageInFolder(*folderId, bOnlyDB, &msgIdList);
if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Fail : MsgStoDeleteAllMessageInFolder()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_DELALL_MSGINFOLDER, err, (void**)ppEvent);
return eventSize;
-
}
memcpy(&msgIds[i], (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(int)+sizeof(msg_message_id_t)*i), sizeof(msg_message_id_t));
}
- // Delete Message
+ /* Delete Message */
err = MsgStoDeleteMessageByList(&msgIdList);
if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Fail : MsgStoDeleteMessageByList()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_DELETE_MESSAGE_BY_LIST, err, (void**)ppEvent);
return eventSize;
memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_message_id_t));
memcpy(&folderId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_message_id_t)), sizeof(msg_folder_id_t));
- // Move Message
+ /* Move Message */
err = MsgStoMoveMessageToFolder(msgId, folderId);
if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Fail : MsgStoMoveMessageToFolder()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_MOVE_MSGTOFOLDER, err, (void**)ppEvent);
return eventSize;
memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_message_id_t));
memcpy(&storageId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_message_id_t)), sizeof(msg_storage_id_t));
- // Move Message
+ /* Move Message */
err = MsgStoMoveMessageToStorage(msgId, storageId);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoMoveMessageToStorage()");
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoMoveMessageToStorage()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_MOVE_MSGTOSTORAGE, err, (void**)ppEvent);
return eventSize;
int dataSize = 0, eventSize = 0;
- // Get Folder ID
+ /* Get Folder ID */
msg_folder_id_t* folderId = (msg_folder_id_t*)pCmd->cmdData;
- // Get Message Count
+ /* Get Message Count */
MSG_COUNT_INFO_S countInfo;
err = MsgStoCountMessage(*folderId, &countInfo);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoCountMessage()");
- // Encoding Messaging Count Data
+ /* Encoding Messaging Count Data */
dataSize = MsgEncodeCountInfo(&countInfo, &encodedData);
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoCountMessage()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_COUNT_MSG, err, (void**)ppEvent);
return eventSize;
int dataSize = 0, eventSize = 0;
- // Get Folder ID
+ /* Get Folder ID */
MSG_MESSAGE_TYPE_S* pMsgType = (MSG_MESSAGE_TYPE_S*)pCmd->cmdData;
int nMsgCnt = 0;
- // Get Message Count
+ /* Get Message Count */
err = MsgStoCountMsgByType(pMsgType, &nMsgCnt);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoCountMsgByType()");
- // Encoding Messaging Count Data
+ /* Encoding Messaging Count Data */
dataSize = MsgEncodeCountByMsgType(nMsgCnt, &encodedData);
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoCountMsgByType()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_COUNT_BY_MSGTYPE, err, (void**)ppEvent);
return eventSize;
return 0;
}
- // Get Message ID
+ /* Get Message ID */
msg_message_id_t* msgId = (msg_message_id_t*)pCmd->cmdData;
char* encodedData = NULL;
int dataSize = 0, eventSize = 0;
- // Get Message
+ /* Get Message */
MSG_MESSAGE_INFO_S msgInfo;
MSG_SENDINGOPT_INFO_S sendOptInfo;
err = MsgStoGetMessage(*msgId, &msgInfo, &sendOptInfo);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoGetMessage()");
- // Encoding Message Info Data
+ /* Encoding Message Info Data */
dataSize = MsgEncodeMsgInfo(&msgInfo, &sendOptInfo, &encodedData);
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoGetMessage()");
}
-// MsgSoundPlayStop();
+/* MsgSoundPlayStop(); */
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_MSG, err, (void**)ppEvent);
return eventSize;
int eventSize = 0;
- // Get Folder Info
+ /* Get Folder Info */
MSG_FOLDER_INFO_S* pFolderInfo = (MSG_FOLDER_INFO_S*)pCmd->cmdData;
- // Add Folder
+ /* Add Folder */
err = MsgStoAddFolder(pFolderInfo);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoAddFolder()");
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoAddFolder()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_ADD_FOLDER, err, (void**)ppEvent);
return eventSize;
int eventSize = 0;
- // Get Folder Info
+ /* Get Folder Info */
MSG_FOLDER_INFO_S* pFolderInfo = (MSG_FOLDER_INFO_S*)pCmd->cmdData;
- // Update Folder
+ /* Update Folder */
err = MsgStoUpdateFolder(pFolderInfo);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoUpdateFolder()");
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoUpdateFolder()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_UPDATE_FOLDER, err, (void**)ppEvent);
return eventSize;
int eventSize = 0;
- // Get Folder Info
+ /* Get Folder Info */
msg_folder_id_t* pFolderInfo = (msg_folder_id_t*)pCmd->cmdData;
- // Delete Folder
+ /* Delete Folder */
err = MsgStoDeleteFolder(*pFolderInfo);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoDeleteFolder()");
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoDeleteFolder()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_DELETE_FOLDER, err, (void**)ppEvent);
return eventSize;
int dataSize = 0, eventSize = 0;
- // Get Storage List
+ /* Get Storage List */
msg_struct_list_s folderList;
err = MsgStoGetFolderList(&folderList);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoGetFolderList()");
- // Encoding Folder List Data
+ /* Encoding Folder List Data */
dataSize = MsgEncodeFolderList(&folderList, &encodedData);
if (folderList.msg_struct_info) {
}
g_free(folderList.msg_struct_info);
}
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoGetFolderList()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_FOLDERLIST, err, (void**)ppEvent);
return eventSize;
int eventSize = 0;
- // Sim Init - Later
- //Run msg-init-app
+ /* Sim Init - Later */
+ /* Run msg-init-app */
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_INIT_SIM_BY_SAT, err, (void**)ppEvent);
return eventSize;
int dataSize = 0, eventSize = 0;
#if 0
- // Get Thread View List
+ /* Get Thread View List */
msg_struct_list_s msgThreadViewList;
- //err = MsgStoGetThreadViewList(&sortRule, &msgThreadViewList);
+ /*err = MsgStoGetThreadViewList(&sortRule, &msgThreadViewList); */
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoGetThreadViewList()");
- // Encoding Folder View List Data
+ /* Encoding Folder View List Data */
dataSize = MsgEncodeThreadViewList(&msgThreadViewList, &encodedData);
MSG_DEBUG("dataSize [%d]", dataSize);
}
g_free(msgThreadViewList.msg_struct_info);
}
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoGetThreadViewList()");
return err;
}
#endif
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_THREADVIEWLIST, err, (void**)ppEvent);
return eventSize;
MSG_DEBUG("Command Handle Success : MsgStoDeleteThreadMessageList()");
if(isSyncMLMsg == true) {
- // broadcast to listener threads, here
+ /* broadcast to listener threads, here */
MsgTransactionManager::instance()->broadcastSyncMLMsgOperationCB(err, -1, -1);
}
delete [] (char*)msgIdList.msgIdList;
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_DELETE_THREADMESSAGELIST, err, (void**)ppEvent);
return eventSize;
int search_len = 0;
memcpy(&search_len, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(int));
- char search_val[search_len + 1] = {0,};
+ char search_val[search_len + 1] = {0, };
memcpy(&search_val, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(int)), sizeof(char)*search_len);
int eventSize = 0;
if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoSetTmpAddressTable()");
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoSetTmpAddressTable()");
count = 0;
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(&count, sizeof(int), MSG_EVENT_SET_TEMP_ADDRESS_TABLE, err, (void**)ppEvent);
MSG_END();
return 0;
}
- // Get From address
+ /* Get From address */
MSG_THREAD_LIST_INDEX_S addrInfo;
memcpy(&addrInfo, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_THREAD_LIST_INDEX_S));
int dataSize = 0, eventSize = 0;
- // Get Message Common Info
+ /* Get Message Common Info */
MSG_THREAD_COUNT_INFO_S threadCountInfo = {0};
err = MsgStoCountMsgByContact(&addrInfo, &threadCountInfo);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoCountMsgByContact()");
- // Encoding Folder View List Data
+ /* Encoding Folder View List Data */
dataSize = MsgEncodeMsgGetContactCount(&threadCountInfo, &encodedData);
MSG_DEBUG("dataSize [%d]", dataSize);
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoCountMsgByContact()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_CONTACT_COUNT, err, (void**)ppEvent);
return eventSize;
return 0;
}
- // Get Message ID
+ /* Get Message ID */
msg_quickpanel_type_t* type = (msg_quickpanel_type_t*)pCmd->cmdData;
char* encodedData = NULL;
int dataSize = 0, eventSize = 0;
- // Get Message
+ /* Get Message */
MSG_MESSAGE_INFO_S msgInfo;
memset(&msgInfo, 0x00, sizeof(MSG_MESSAGE_INFO_S));
err = MsgStoGetQuickPanelData(*type, &msgInfo);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoGetQuickPanelData()");
- // Encoding Message Info Data
+ /* Encoding Message Info Data */
dataSize = MsgEncodeMsgInfo(&msgInfo, &encodedData);
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoGetQuickPanelData()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_QUICKPANEL_DATA, err, (void**)ppEvent);
return eventSize;
int eventSize = 0;
- // Reset DB
+ /* Reset DB */
err = MsgStoResetDatabase();
if (err == MSG_SUCCESS)
else
MSG_DEBUG("Command Handle Fail : MsgStoResetDatabase()");
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_RESET_DB, err, (void**)ppEvent);
return eventSize;
int dataSize = 0, eventSize = 0;
- // Get Memory size
+ /* Get Memory size */
unsigned int memsize = 0;
memsize = MsgDu(MSG_DATA_ROOT_PATH);
dataSize = MsgEncodeMemSize(&memsize, &encodedData);
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_MEMSIZE, err, (void**)ppEvent);
return eventSize;
}
int eventSize = 0;
- char path[MSG_FILEPATH_LEN_MAX+1] = {0,};
+ char path[MSG_FILEPATH_LEN_MAX+1] = {0, };
msg_message_backup_type_t type;
memcpy(&type, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_message_backup_type_t));
memcpy(&path, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_message_backup_type_t)), sizeof(path));
- char fullPath[MSG_FILEPATH_LEN_MAX+1] = {0,};
-
err = MsgStoBackupMessage(type, path);
if (err == MSG_SUCCESS)
MSG_DEBUG("Command Handle Success : MsgBackupMessageHandler()");
else
MSG_DEBUG("Command Handle Fail : MsgBackupMessageHandler()");
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_BACKUP_MESSAGE, err, (void**)ppEvent);
return eventSize;
int eventSize = 0;
msg_id_list_s *msgIdList = NULL;
- char path[MSG_FILEPATH_LEN_MAX+1] = {0,};
+ char path[MSG_FILEPATH_LEN_MAX+1] = {0, };
memcpy(&path, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(path));
MSG_DEBUG("path = %s", path);
- // Reset DB
+ /* Reset DB */
err = MsgStoRestoreMessage(path, &msgIdList);
if (err == MSG_SUCCESS) {
} else {
MSG_DEBUG("Not Exist msg id list to restore");
}
-
} else
MSG_DEBUG("Command Handle Fail : MsgStoRestoreMessage()");
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_RESTORE_MESSAGE, err, (void**)ppEvent);
return eventSize;
return 0;
}
- // Get Message ID
+ /* Get Message ID */
msg_message_id_t* msgId = (msg_message_id_t*)pCmd->cmdData;
- MSG_MESSAGE_TYPE_S msgType = {0,};
+ MSG_MESSAGE_TYPE_S msgType = {0, };
char* encodedData = NULL;
unique_ptr<char*, void(*)(char**)> buf(&encodedData, unique_ptr_deleter);
err = MSG_ERR_INVALID_MSG_TYPE;
}
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgGetReportStatusHandler()");
- // Encoding Report Status Data
+ /* Encoding Report Status Data */
dataSize = MsgEncodeReportStatus(reportStatus, report_count, &encodedData);
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgGetReportStatusHandler()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_REPORT_STATUS, err, (void**)ppEvent);
return eventSize;
msgInfo.addressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S) * msgInfo.nAddressCnt];
- for(int i=0; i<msgInfo.nAddressCnt; i++)
+ for(int i = 0; i < msgInfo.nAddressCnt; i++)
memcpy(&msgInfo.addressList[i], (MSG_ADDRESS_INFO_S *)(pCmd->cmdData+sizeof(int)+(sizeof(MSG_ADDRESS_INFO_S)*i)), sizeof(MSG_ADDRESS_INFO_S));
char* encodedData = NULL;
err = MsgStoGetThreadIdByAddress(&msgInfo, &threadId);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("threadId [%d]", threadId);
MSG_DEBUG("Command Handle Success : MsgGetThreadIdByAddressHandler()");
- // Encoding threadId Data
+ /* Encoding threadId Data */
dataSize = MsgEncodeThreadId(&threadId, &encodedData);
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgGetThreadIdByAddressHandler()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_THREAD_ID_BY_ADDRESS, err, (void**)ppEvent);
return eventSize;
if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoGetThreadInfo()");
- // Encoding thread Info Data
+ /* Encoding thread Info Data */
dataSize = MsgEncodeThreadInfo(&threadInfo, &encodedData);
} else {
MSG_DEBUG("Command Handle Fail : MsgStoGetThreadInfo()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_GET_THREAD_INFO, err, (void**)ppEvent);
return eventSize;
int dataSize = 0, eventSize = 0;
- // Get Message ID
+ /* Get Message ID */
msg_message_id_t* MsgId = (msg_message_id_t*)pCmd->cmdData;
- // Check ReadReport Is Requested
+ /* Check ReadReport Is Requested */
bool bReadReportRequested;
bReadReportRequested = MsgStoCheckReadReportRequested(*MsgId);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoCheckSendReadReport()");
- // Encoding ReadReportIsSent Data
+ /* Encoding ReadReportIsSent Data */
dataSize = MsgEncodeReadReportRequested(bReadReportRequested, &encodedData);
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoCheckReadReportIsSent()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeStorageEvent(encodedData, dataSize, MSG_EVENT_PLG_CHECK_READ_REPORT_REQUESTED, err, (void**)ppEvent);
return eventSize;
int dataSize = 0, eventSize = 0;
- // Get Message ID
+ /* Get Message ID */
msg_message_id_t* MsgId = (msg_message_id_t*)pCmd->cmdData;
- // Check ReadReport Is Sent
+ /* Check ReadReport Is Sent */
bool bReadReportIsSent;
MSG_DEBUG("#### MSGID = %d ####", *MsgId);
bReadReportIsSent = MsgStoCheckReadReportIsSent(*MsgId);
MSG_DEBUG("######## 1. bReadStatusIsSent = %d #######", bReadReportIsSent);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoCheckReadReportIsSent()");
- // Encoding ReadReportIsSent Data
+ /* Encoding ReadReportIsSent Data */
dataSize = MsgEncodeReadReportIsSent(bReadReportIsSent, &encodedData);
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoCheckReadReportIsSent()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeStorageEvent(encodedData, dataSize, MSG_EVENT_PLG_CHECK_READ_REPORT_IS_SENT, err, (void**)ppEvent);
return eventSize;
int dataSize = 0, eventSize = 0;
- // Get Message ID
+ /* Get Message ID */
msg_message_id_t msgId;
int readReportSendStatus;
memcpy(&msgId, (char*)pCmd + sizeof(MSG_CMD_TYPE_T), sizeof(msg_message_id_t));
memcpy(&readReportSendStatus, (char*)pCmd + sizeof(MSG_CMD_TYPE_T) + sizeof(msg_message_id_t), sizeof(int));
- // Set Read Report Send Status
+ /* Set Read Report Send Status */
err = MsgStoSetReadReportSendStatus(msgId, readReportSendStatus);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoUpdateReadStatus()");
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoUpdateReadStatus()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeStorageEvent(encodedData, dataSize, MSG_EVENT_PLG_SET_READ_REPORT_SEND_STATUS, err, (void**)ppEvent);
return eventSize;
int dataSize = 0, eventSize = 0;
- // Get Message ID
+ /* Get Message ID */
msg_message_id_t* MsgId = (msg_message_id_t*)pCmd->cmdData;
- // Check ReadReport Is Sent
+ /* Check ReadReport Is Sent */
int version;
MSG_DEBUG("#### MSGID = %d ####", *MsgId);
version = MsgStoGetMmsVersion(*MsgId);
MSG_DEBUG("######## 1. version = %x #######", version);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoCheckReadReportIsSent()");
- // Encoding ReadReportIsSent Data
+ /* Encoding ReadReportIsSent Data */
dataSize = MsgEncodeMmsVersion(version, &encodedData);
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoCheckReadReportIsSent()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeStorageEvent(encodedData, dataSize, MSG_EVENT_PLG_GET_MMS_VERSION, err, (void**)ppEvent);
return eventSize;
int dataSize = 0, eventSize = 0;
- // Get Message ID
+ /* Get Message ID */
msg_message_id_t* MsgId = (msg_message_id_t*)pCmd->cmdData;
MMS_STATUS_INFO_S mmsStatusInfo;
MSG_DEBUG("#### MSGID = %d ####", *MsgId);
- err = MsgStoGetMmsStatusInfo(*MsgId,&mmsStatusInfo);
- if (err == MSG_SUCCESS)
- {
+ err = MsgStoGetMmsStatusInfo(*MsgId, &mmsStatusInfo);
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgGetMmsStatusInfoHandler()");
- // Encoding ReadReportIsSent Data
+ /* Encoding ReadReportIsSent Data */
dataSize = MsgEncodeMmsStatusInfo(&mmsStatusInfo, &encodedData);
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgGetMmsStatusInfoHandler()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeStorageEvent(encodedData, dataSize, MSG_EVENT_PLG_GET_MMS_STATUS_INFO, err, (void**)ppEvent);
return eventSize;
int eventSize = 0;
- // Get Message Info
+ /* Get Message Info */
MSG_PUSH_EVENT_INFO_S* pPushEvent = (MSG_PUSH_EVENT_INFO_S*)pCmd->cmdData;
- // Add Message
+ /* Add Message */
err = MsgStoAddPushEvent(pPushEvent);
if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Fail : MsgStoAddPushEvent()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_ADD_PUSH_EVENT, err, (void**)ppEvent);
return eventSize;
int eventSize = 0;
- // Get Message Info
+ /* Get Message Info */
MSG_PUSH_EVENT_INFO_S* pPushEvent = (MSG_PUSH_EVENT_INFO_S*)pCmd->cmdData;
- // Add Message
+ /* Add Message */
err = MsgStoDeletePushEvent(pPushEvent);
if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Fail : MsgStoDeletePushEvent()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_DELETE_PUSH_EVENT, err, (void**)ppEvent);
return eventSize;
int eventSize = 0;
- // Get Message Info
+ /* Get Message Info */
MSG_PUSH_EVENT_INFO_S pSrc;
MSG_PUSH_EVENT_INFO_S pDst;
memcpy(&pSrc, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_PUSH_EVENT_INFO_S));
memcpy(&pDst, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_PUSH_EVENT_INFO_S)), sizeof(MSG_PUSH_EVENT_INFO_S));
- // Add Message
+ /* Add Message */
err = MsgStoUpdatePushEvent(&pSrc, &pDst);
if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Fail : MsgStoUpdatePushEvent()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_UPDATE_PUSH_EVENT, err, (void**)ppEvent);
return eventSize;
MSG_DEBUG("simIdList[0] [%d]", simIdList[0]);
- // Add Message
-#if 0 // Not to broadcast callback here.
+ /* Add Message */
+#if 0 /* Not to broadcast callback here. */
bool isReplaceMsg = false;
if (msgInfo.msgId <= 0)
if (msg_id > 0) {
MSG_DEBUG("Command Handle Success : MsgStoAddSimMessage()");
-#if 0 // Not to broadcast callback here.
- //storage change CB
+#if 0 /* Not to broadcast callback here. */
+ /*storage change CB */
msg_id_list_s msgIdList;
msg_message_id_t msgIds[1];
memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
err = MSG_ERR_INVALID_MESSAGE;
}
- // Delete Temp File for Message Data
+ /* Delete Temp File for Message Data */
if (msgInfo.bTextSms == false)
- MsgDeleteFile(msgInfo.msgData); //ipc
+ MsgDeleteFile(msgInfo.msgData); /*ipc */
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent((const void *)&msg_id, sizeof(msg_message_id_t), MSG_EVENT_ADD_SIM_MSG, err, (void**)ppEvent);
return eventSize;
int sim_idx = 0;
memcpy(&sim_idx, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(int));
- // Add Message
+ /* Add Message */
err = MsgStoUpdateIMSI(sim_idx);
if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Fail : MsgStoUpdateIMSI()");
}
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_UPDATE_IMSI, err, (void**)ppEvent);
return eventSize;
int ret[3];
int eventSize = 0;
- MSG_REQUEST_INFO_S reqInfo = {0,};
- MSG_PROXY_INFO_S proxyInfo = {0,};
+ MSG_REQUEST_INFO_S reqInfo = {0, };
+ MSG_PROXY_INFO_S proxyInfo = {0, };
reqInfo.msgInfo.addressList = NULL;
unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> addressListBuf(&reqInfo.msgInfo.addressList, unique_ptr_deleter);
- // Get Message Request
+ /* Get Message Request */
memcpy(&reqInfo.reqId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_request_id_t));
- // Storing Request ID, Proxy Info for Sent Status CNF
+ /* Storing Request ID, Proxy Info for Sent Status CNF */
memcpy(&proxyInfo, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_request_id_t)), sizeof(MSG_PROXY_INFO_S));
MsgDecodeMsgInfo((char *)(pCmd->cmdData+sizeof(msg_request_id_t)+sizeof(MSG_PROXY_INFO_S)), &reqInfo.msgInfo, &reqInfo.sendOptInfo);
if (reqInfo.msgInfo.msgId > 0)
bNewMsg = false;
- // Submit Request
+ /* Submit Request */
err = MsgSubmitReq(&reqInfo, false);
- if (err == MSG_SUCCESS){
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgSubmitReq()");
} else {
MSG_DEBUG("Command Handle Fail : MsgSubmitReq()");
if (reqInfo.msgInfo.msgType.mainType == MSG_SMS_TYPE) {
MsgTransactionManager::instance()->insertSentMsg(reqId, &proxyInfo);
} else if (reqInfo.msgInfo.msgType.mainType == MSG_MMS_TYPE) {
- // Retrieve MMS shall not be kept in sentMsg
+ /* Retrieve MMS shall not be kept in sentMsg */
if ((reqInfo.msgInfo.msgType.subType == MSG_SENDREQ_MMS) ||
(reqInfo.msgInfo.msgType.subType == MSG_FORWARD_MMS) ||
(reqInfo.msgInfo.msgType.subType == MSG_SENDREQ_JAVA_MMS))
MsgTransactionManager::instance()->insertSentMsg(reqId, &proxyInfo);
}
- // keep transaction Id list for distinguish java MMS sent msg when sendconf received
+ /* keep transaction Id list for distinguish java MMS sent msg when sendconf received */
if (reqInfo.msgInfo.msgType.mainType == MSG_MMS_TYPE &&
reqInfo.msgInfo.msgType.subType == MSG_SENDREQ_JAVA_MMS) {
- MSG_CMD_REG_INCOMING_JAVAMMS_TRID_S trId={0};
+ MSG_CMD_REG_INCOMING_JAVAMMS_TRID_S trId = {0};
memcpy(&trId.id, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(MSG_REQUEST_INFO_S)+sizeof(MSG_PROXY_INFO_S)), MMS_TR_ID_LEN);
char* pFileName;
pFileName = strstr(reqInfo.msgInfo.msgData, "MSG_");
strncpy(trId.pduFileName, pFileName, MAX_COMMON_INFO_SIZE);
- MSG_SEC_DEBUG("java MMS msg trId:%s filepath:%s ",trId.id, reqInfo.msgInfo.msgData);
+ MSG_SEC_DEBUG("java MMS msg trId:%s filepath:%s", trId.id, reqInfo.msgInfo.msgData);
MsgTransactionManager* tm = MsgTransactionManager::instance();
tm->setJavaMMSList(&trId);
ret[1] = reqInfo.msgInfo.msgId;
ret[2] = reqInfo.msgInfo.threadId;
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(ret, sizeof(ret), MSG_EVENT_SUBMIT_REQ, err, (void**)ppEvent);
/* reject_msg_support */
memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
MsgStoAutoDeleteConversation(reqInfo.msgInfo.threadId, &msgIdList);
- if (msgIdList.msgIdList)
- {
+ if (msgIdList.msgIdList) {
MsgTransactionManager::instance()->broadcastStorageChangeCB(err, MSG_STORAGE_CHANGE_DELETE, &msgIdList);
delete [] (char*)msgIdList.msgIdList;
}
int MsgRegSentStatusCallbackHandler(const MSG_CMD_S *pCmd, char **ppEvent)
{
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
}
- // Get Message Request
+ /* Get Message Request */
int listenerFd = 0;
memcpy(&listenerFd, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(int));
MSG_DEBUG("Registering sent status CB for %d", listenerFd);
- // storing dst fd in list
+ /* storing dst fd in list */
MsgTransactionManager::instance()->setSentStatusCB(listenerFd);
- // Make Event Data
+ /* Make Event Data */
int eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_REG_SENT_STATUS_CB, MSG_SUCCESS, (void**)ppEvent);
return eventSize;
int MsgRegIncomingMsgCallbackHandler(const MSG_CMD_S *pCmd, char **ppEvent)
{
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
}
- // Get Message Request
+ /* Get Message Request */
MSG_CMD_REG_INCOMING_MSG_CB_S *pCmdData = (MSG_CMD_REG_INCOMING_MSG_CB_S*) pCmd->cmdData;
MSG_DEBUG("Registering incoming SMS CB for fd %d mType %d port %d", pCmdData->listenerFd, pCmdData->msgType, pCmdData->port);
- // storing dst fd in list
+ /* storing dst fd in list */
MsgTransactionManager::instance()->setIncomingMsgCB(pCmdData);
- // Make Event Data
+ /* Make Event Data */
int eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_REG_INCOMING_MSG_CB, MSG_SUCCESS, (void**)ppEvent);
return eventSize;
int MsgRegIncomingMMSConfMsgCallbackHandler(const MSG_CMD_S *pCmd, char **ppEvent)
{
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
}
- // Get Message Request
+ /* Get Message Request */
MSG_CMD_REG_INCOMING_MMS_CONF_MSG_CB_S *pCmdData = (MSG_CMD_REG_INCOMING_MMS_CONF_MSG_CB_S*) pCmd->cmdData;
MSG_DEBUG("Registering incoming MMS Conf CB for fd:%d mType:%d appId:%s", pCmdData->listenerFd, pCmdData->msgType, pCmdData->appId);
- // storing dst fd in list
+ /* storing dst fd in list */
MsgTransactionManager::instance()->setMMSConfMsgCB(pCmdData);
- // Make Event Data
+ /* Make Event Data */
int eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_REG_INCOMING_MMS_CONF_MSG_CB, MSG_SUCCESS, (void**)ppEvent);
return eventSize;
int MsgRegIncomingPushMsgCallbackHandler(const MSG_CMD_S *pCmd, char **ppEvent)
{
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
}
- // Get Message Request
+ /* Get Message Request */
MSG_CMD_REG_INCOMING_PUSH_MSG_CB_S *pCmdData = (MSG_CMD_REG_INCOMING_PUSH_MSG_CB_S*) pCmd->cmdData;
MSG_DEBUG("Registering incoming Push Msg CB for fd:%d mType:%d appId:%s", pCmdData->listenerFd, pCmdData->msgType, pCmdData->appId);
- // storing dst fd in list
+ /* storing dst fd in list */
MsgTransactionManager::instance()->setPushMsgCB(pCmdData);
- //MsgTransactionManager::instance()->sendPendigPushMsg(pCmdData);
+ /* MsgTransactionManager::instance()->sendPendigPushMsg(pCmdData); */
- // Make Event Data
+ /* Make Event Data */
int eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_REG_INCOMING_PUSH_MSG_CB, MSG_SUCCESS, (void**)ppEvent);
return eventSize;
int MsgRegIncomingCBMsgCallbackHandler(const MSG_CMD_S *pCmd, char **ppEvent)
{
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
}
- // Get Message Request
+ /* Get Message Request */
MSG_CMD_REG_INCOMING_CB_MSG_CB_S *pCmdData = (MSG_CMD_REG_INCOMING_CB_MSG_CB_S*) pCmd->cmdData;
MSG_DEBUG("Registering incoming CB Msg CB for fd:%d mType:%d: bSave: %d", pCmdData->listenerFd, pCmdData->msgType, pCmdData->bsave);
- // storing dst fd in list
+ /* storing dst fd in list */
MsgTransactionManager::instance()->setCBMsgCB(pCmdData);
- // Make Event Data
+ /* Make Event Data */
int eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_REG_INCOMING_CB_MSG_CB, MSG_SUCCESS, (void**)ppEvent);
return eventSize;
int MsgRegIncomingSyncMLMsgCallbackHandler(const MSG_CMD_S *pCmd, char **ppEvent)
{
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
}
- // Get Message Request
+ /* Get Message Request */
MSG_CMD_REG_INCOMING_SYNCML_MSG_CB_S *pCmdData = (MSG_CMD_REG_INCOMING_SYNCML_MSG_CB_S*) pCmd->cmdData;
MSG_DEBUG("Registering incoming Sync ML Msg CB for fd %d mType %d", pCmdData->listenerFd, pCmdData->msgType);
- // storing dst fd in list
+ /* storing dst fd in list */
MsgTransactionManager::instance()->setSyncMLMsgCB(pCmdData);
- // Make Event Data
+ /* Make Event Data */
int eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_REG_INCOMING_SYNCML_MSG_CB, MSG_SUCCESS, (void**)ppEvent);
return eventSize;
int MsgRegIncomingLBSMsgCallbackHandler(const MSG_CMD_S *pCmd, char **ppEvent)
{
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
}
- // Get Message Request
+ /* Get Message Request */
MSG_CMD_REG_INCOMING_LBS_MSG_CB_S *pCmdData = (MSG_CMD_REG_INCOMING_LBS_MSG_CB_S*) pCmd->cmdData;
MSG_DEBUG("Registering incoming LBS Msg CB for fd %d mType %d", pCmdData->listenerFd, pCmdData->msgType);
- // storing dst fd in list
+ /* storing dst fd in list */
MsgTransactionManager::instance()->setLBSMsgCB(pCmdData);
- // Make Event Data
+ /* Make Event Data */
int eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_REG_INCOMING_LBS_MSG_CB, MSG_SUCCESS, (void**)ppEvent);
return eventSize;
int MsgRegSyncMLMsgOperationCallbackHandler(const MSG_CMD_S *pCmd, char **ppEvent)
{
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
}
- // Get Message Request
+ /* Get Message Request */
MSG_CMD_REG_SYNCML_MSG_OPERATION_CB_S *pCmdData = (MSG_CMD_REG_SYNCML_MSG_OPERATION_CB_S*) pCmd->cmdData;
MSG_DEBUG("Registering SyncML Msg ooperation CB for fd %d mType %d", pCmdData->listenerFd, pCmdData->msgType);
- // storing dst fd in list
+ /* storing dst fd in list */
MsgTransactionManager::instance()->setSyncMLMsgOperationCB(pCmdData);
- // Make Event Data
+ /* Make Event Data */
int eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_REG_SYNCML_MSG_OPERATION_CB, MSG_SUCCESS, (void**)ppEvent);
return eventSize;
int MsgRegStorageChangeCallbackHandler(const MSG_CMD_S *pCmd, char **ppEvent)
{
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
}
- // Get Message Request
+ /* Get Message Request */
int listenerFd = 0;
memcpy(&listenerFd, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(int));
MSG_DEBUG("Registering storage change CB for %d", listenerFd);
- // storing dst fd in list
+ /* storing dst fd in list */
MsgTransactionManager::instance()->setStorageChangeCB(listenerFd);
- // Make Event Data
+ /* Make Event Data */
int eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_REG_STORAGE_CHANGE_CB, MsgException::SUCCESS, (void**)ppEvent);
return eventSize;
int MsgRegIncomingReportMsgCallbackHandler(const MSG_CMD_S *pCmd, char **ppEvent)
{
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
}
- // Get Message Request
+ /* Get Message Request */
int listenerFd = 0;
memcpy(&listenerFd, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(int));
MSG_DEBUG("Registering report msg incoming CB for %d", listenerFd);
- // storing dst fd in list
+ /* storing dst fd in list */
MsgTransactionManager::instance()->setReportMsgCB(listenerFd);
- // Make Event Data
+ /* Make Event Data */
int eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_REG_REPORT_MSG_INCOMING_CB, MsgException::SUCCESS, (void**)ppEvent);
return eventSize;
int MsgSentStatusHandler(const MSG_CMD_S *pCmd, char **ppEvent)
{
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
}
- // Get Message Request
+ /* Get Message Request */
MSG_SENT_STATUS_S* pStatus = (MSG_SENT_STATUS_S*) pCmd->cmdData;
MSG_DEBUG("REQID %d, STATUS %d", pStatus->reqId, pStatus->status);
- // storing dst fd in list
+ /* storing dst fd in list */
MSG_PROXY_INFO_S* prxInfo = MsgTransactionManager::instance()->getProxyInfo(pStatus->reqId);
- // when no sent status cb is found
+ /* when no sent status cb is found */
if (!prxInfo) {
return MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_SENT_STATUS_CNF, MSG_SUCCESS, (void**)ppEvent);
}
MSG_DEBUG("REQID %d, listenerFD %d, handleAddr %x, msgId %d", pStatus->reqId, prxInfo->listenerFd, prxInfo->handleAddr, prxInfo->sentMsgId);
- // if APP send and quit(not exist at this time), don't send the data up.
- if (prxInfo->handleAddr == 0)
- {
- // just making data which will be passed to plugin. it indicates "handling evt success"
+ /* if APP send and quit(not exist at this time), don't send the data up. */
+ if (prxInfo->handleAddr == 0) {
+ /* just making data which will be passed to plugin. it indicates "handling evt success" */
MsgTransactionManager::instance()->delProxyInfo(pStatus->reqId);
return MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_SENT_STATUS_CNF, MSG_SUCCESS, (void**)ppEvent);
}
- unsigned long ret[3] = {0}; //3// reqid, status, object
+ unsigned long ret[3] = {0}; /* reqid, status, object */
ret[0] = (unsigned long)pStatus->reqId;
ret[1] = (unsigned long)pStatus->status;
ret[2] = prxInfo->handleAddr;
- // Make Event Data for APP
+ /* Make Event Data for APP */
int eventSize = MsgMakeEvent(ret, sizeof(ret), MSG_EVENT_PLG_SENT_STATUS_CNF, MSG_SUCCESS, (void**)ppEvent);
- // Send to listener thread, here
+ /* Send to listener thread, here */
MsgTransactionManager::instance()->write(prxInfo->listenerFd, *ppEvent, eventSize);
MsgTransactionManager::instance()->delProxyInfo(pStatus->reqId);
bool sendNoti = true;
bool isClass2msg = false;
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
}
- // Get Incoming Message
+ /* Get Incoming Message */
MSG_MESSAGE_INFO_S msgInfo;
memset(&msgInfo, 0x00, sizeof(MSG_MESSAGE_INFO_S));
MsgDecodeMsgInfo((char *)pCmd->cmdData, &msgInfo);
- // broadcast to listener threads, here
+ /* broadcast to listener threads, here */
msg_id_list_s msgIdList;
msg_message_id_t msgIds[2];
msg_message_id_t class2msgId = 0;
}
#endif
- // normal process
+ /* normal process */
err = MsgHandleIncomingMsg(&msgInfo, &sendNoti);
if (isClass2msg == true) {
if (sendNoti == true) {
MsgTransactionManager::instance()->broadcastIncomingMsgCB(err, &msgInfo);
- if (msgInfo.msgType.subType > MSG_TYPE0_SMS && msgInfo.msgType.subType < MSG_WAP_SI_SMS) { // if it is replacement message.
+ if (msgInfo.msgType.subType > MSG_TYPE0_SMS && msgInfo.msgType.subType < MSG_WAP_SI_SMS) { /* if it is replacement message. */
MsgTransactionManager::instance()->broadcastStorageChangeCB(err, MSG_STORAGE_CHANGE_UPDATE, &msgIdList);
} else {
MsgTransactionManager::instance()->broadcastStorageChangeCB(err, MSG_STORAGE_CHANGE_INSERT, &msgIdList);
memset(&msgIdList, 0x00, sizeof(msg_id_list_s));
MsgStoAutoDeleteConversation(msgInfo.threadId, &msgIdList);
- if (msgIdList.msgIdList)
- {
+ if (msgIdList.msgIdList) {
MsgTransactionManager::instance()->broadcastStorageChangeCB(err, MSG_STORAGE_CHANGE_DELETE, &msgIdList);
delete [] (char*)msgIdList.msgIdList;
}
#endif
if (msgInfo.bTextSms == false) {
- MsgDeleteFile(msgInfo.msgData); //ipc
+ MsgDeleteFile(msgInfo.msgData); /*ipc */
memset(msgInfo.msgData, 0x00, sizeof(msgInfo.msgData));
}
}
}
- // make return event
+ /* make return event */
eventsize = MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_INCOMING_MMS_CONF, MSG_SUCCESS, (void**)ppEvent);
} else if (msgInfo.msgType.subType == MSG_SENDREQ_MMS || msgInfo.msgType.subType == MSG_SENDCONF_MMS) {
MSG_PROXY_INFO_S* prxInfo = MsgTransactionManager::instance()->getProxyInfo(reqID);
- // when no sent status cb is found
+ /* when no sent status cb is found */
if (prxInfo) {
- // No need to update javaMMS sent messages
+ /* No need to update javaMMS sent messages */
javamms_list& listenerList = MsgTransactionManager::instance()->getJavaMMSList();
javamms_list::iterator it = listenerList.begin();
- MSG_DEBUG("listenerList size:%d ",listenerList.size());
+ MSG_DEBUG("listenerList size:%d ", listenerList.size());
if (msgInfo.networkStatus == MSG_NETWORK_SEND_FAIL && msgInfo.msgType.subType == MSG_SENDREQ_MMS) {
for ( ; it != listenerList.end() ; it++) {
if (strstr(it->pduFileName, "JAVA")) {
MSG_SEC_DEBUG("JAVA MMS fileName:%s", it->pduFileName);
- MsgDeleteFile(it->pduFileName); // ipc
+ MsgDeleteFile(it->pduFileName); /* ipc */
listenerList.erase(it);
goto __BYPASS_UPDATE;
}
}
} else {
- //msgData has MMS_RECV_DATA_S
+ /*msgData has MMS_RECV_DATA_S */
MMS_RECV_DATA_S* pMmsRecvData = (MMS_RECV_DATA_S*)msgInfo.msgData;
for ( ; it != listenerList.end() ; it++) {
if (!strcmp(it->id, pMmsRecvData->szTrID)) {
- MSG_SEC_DEBUG("find sent JAVA MMS message trId:%s from listener list trId:%s",pMmsRecvData->szTrID, it->id);
- MsgDeleteFile(it->pduFileName); // ipc
+ MSG_SEC_DEBUG("find sent JAVA MMS message trId:%s from listener list trId:%s", pMmsRecvData->szTrID, it->id);
+ MsgDeleteFile(it->pduFileName); /* ipc */
listenerList.erase(it);
goto __BYPASS_UPDATE;
}
if (msgInfo.networkStatus == MSG_NETWORK_SEND_FAIL) {
MSG_DEBUG("message-dialog: send fail");
MsgInsertTicker("Sending multimedia message failed.", SENDING_MULTIMEDIA_MESSAGE_FAILED, true, msgInfo.msgId);
-// MsgSoundPlayer::instance()->MsgSoundPlayStart(NULL, MSG_NORMAL_SOUND_PLAY);
+/* MsgSoundPlayer::instance()->MsgSoundPlayStart(NULL, MSG_NORMAL_SOUND_PLAY); */
} else {
MSG_DEBUG("message-dialog: send success");
-#if 0 // disabled as per UX request to not show success notification : 2015. 09. 18
+#if 0 /* disabled as per UX request to not show success notification : 2015. 09. 18 */
bool bTTS = false;
if (MsgSettingGetBool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &bTTS) != MSG_SUCCESS) {
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
MSG_SEC_DEBUG("Enter MsgAddPhoneLog() : msgInfo.addressList[0].addressVal [%s]", msgInfo.addressList[0].addressVal);
MsgAddPhoneLog(&msgInfo);
-#endif //MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /*MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
}
if (prxInfo) {
if (prxInfo->handleAddr == 0) {
- // just making data which will be passed to plugin. it indicates "handling evt success"
+ /* just making data which will be passed to plugin. it indicates "handling evt success" */
MsgTransactionManager::instance()->delProxyInfo(reqID);
} else {
-
- unsigned long ret[3] = {0}; //3// reqid, status, object
+ unsigned long ret[3] = {0}; /* reqid, status, object */
ret[0] = (unsigned long)reqID;
ret[1] = (unsigned long)msgInfo.networkStatus;
ret[2] = prxInfo->handleAddr;
- // Make Event Data for APP
+ /* Make Event Data for APP */
eventsize = MsgMakeEvent(ret, sizeof(ret), MSG_EVENT_PLG_SENT_STATUS_CNF, MSG_SUCCESS, (void**)ppEvent);
- // Send to listener thread, here
+ /* Send to listener thread, here */
MsgTransactionManager::instance()->write(prxInfo->listenerFd, *ppEvent, eventsize);
MsgTransactionManager::instance()->delProxyInfo(reqID);
eventsize = MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_INCOMING_MMS_CONF, MSG_SUCCESS, (void**)ppEvent);
MsgTransactionManager::instance()->broadcastStorageChangeCB(MSG_SUCCESS, MSG_STORAGE_CHANGE_UPDATE, &msgIdList);
} else {
- //To avoid prevent memory leak.. this case will not occur. eventsize will be return as 0.
+ /*To avoid prevent memory leak.. this case will not occur. eventsize will be return as 0. */
if (tmpAddr) {
delete[] tmpAddr;
tmpAddr = NULL;
int eventSize = 0;
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
MSG_PUSH_MESSAGE_DATA_S pushData;
memset(&pushData, 0x00, sizeof(MSG_PUSH_MESSAGE_DATA_S));
- // Get Incoming Message
+ /* Get Incoming Message */
memcpy(&pushData, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_PUSH_MESSAGE_DATA_S));
- // broadcast to listener threads, here
+ /* broadcast to listener threads, here */
MsgTransactionManager::instance()->broadcastPushMsgCB(MSG_SUCCESS, &pushData);
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_INCOMING_PUSH_MSG_IND, MSG_SUCCESS, (void**)ppEvent);
MSG_END();
msg_error_t err = MSG_SUCCESS;
int eventSize = 0;
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
}
- // Get Incoming Message
+ /* Get Incoming Message */
MSG_CB_MSG_S cbMsg;
memset(&cbMsg, 0x00, sizeof(MSG_CB_MSG_S));
int MsgIncomingSyncMLMsgHandler(const MSG_CMD_S *pCmd, char **ppEvent)
{
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
MSG_SYNCML_MESSAGE_DATA_S syncMLData;
memset(&syncMLData, 0x00, sizeof(MSG_SYNCML_MESSAGE_DATA_S));
- // Get Incoming Message
+ /* Get Incoming Message */
memcpy(&syncMLData, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_SYNCML_MESSAGE_DATA_S));
int eventSize = 0;
- // broadcast to listener threads, here
+ /* broadcast to listener threads, here */
MsgTransactionManager::instance()->broadcastSyncMLMsgCB(MSG_SUCCESS, &syncMLData);
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_INCOMING_SYNCML_MSG_IND, MSG_SUCCESS, (void**)ppEvent);
return eventSize;
{
int eventSize = 0;
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
MSG_LBS_MESSAGE_DATA_S lbsData;
memset(&lbsData, 0x00, sizeof(MSG_LBS_MESSAGE_DATA_S));
- // Get Incoming Message
+ /* Get Incoming Message */
memcpy(&lbsData, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(MSG_LBS_MESSAGE_DATA_S));
- // broadcast to listener threads, here
+ /* broadcast to listener threads, here */
MsgTransactionManager::instance()->broadcastLBSMsgCB(MSG_SUCCESS, &lbsData);
- // Make Event Data
+ /* Make Event Data */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_INCOMING_LBS_MSG_IND, MSG_SUCCESS, (void**)ppEvent);
return eventSize;
msg_message_id_t msgId = 0;
int extId = 0;
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
}
- // Get Data
+ /* Get Data */
memcpy(&msgId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(msg_message_id_t));
memcpy(&extId, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(msg_message_id_t)), sizeof(int));
err = MsgStoGetSyncMLExtId(msgId, &extId);
- if (err == MSG_SUCCESS)
- {
+ if (err == MSG_SUCCESS) {
MSG_DEBUG("Command Handle Success : MsgStoGetSyncMLExtId()");
- // broadcast to listener threads, here
+ /* broadcast to listener threads, here */
MsgTransactionManager::instance()->broadcastSyncMLMsgOperationCB(err, msgId, extId);
- }
- else
- {
+ } else {
MSG_DEBUG("Command Handle Fail : MsgStoGetSyncMLExtId()");
}
- // Make Event Data to Client
+ /* Make Event Data to Client */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_SYNCML_OPERATION, err, (void**)ppEvent);
return eventSize;
int MsgStorageChangeHandler(const MSG_CMD_S *pCmd, char **ppEvent)
{
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
MSG_DEBUG("storageChangeType : [%d], msg Id : [%d]", storageChangeType, msgIdList.msgIdList[i]);
}
- // broadcast to listener threads, here
+ /* broadcast to listener threads, here */
MsgTransactionManager::instance()->broadcastStorageChangeCB(MSG_SUCCESS, storageChangeType, &msgIdList);
if (msgIdList.msgIdList) {
delete [] msgIdList.msgIdList;
}
- // Make Event Data to Client
+ /* Make Event Data to Client */
eventSize = MsgMakeEvent(NULL, 0, MSG_EVENT_PLG_STORAGE_CHANGE_IND, MSG_SUCCESS, (void**)ppEvent);
return eventSize;
return 0;
}
- // Get the msgIdList of sending failed message.
+ /* Get the msgIdList of sending failed message. */
int *failed_msg_list = NULL;
int count = 0;
unique_ptr<int*, void(*)(int**)> failed_list(&failed_msg_list, unique_ptr_deleter);
MSG_DEBUG("MsgStoGetFailedMessage() Error!! [%d]", err);
}
- for(int i=0; i < count ; ++i)
- {
+ for (int i = 0; i < count ; ++i) {
MSG_REQUEST_INFO_S reqInfo = {0};
reqInfo.msgInfo.addressList = NULL;
unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> addressListBuf(&reqInfo.msgInfo.addressList, unique_ptr_deleter);
if (reqInfo.msgInfo.msgType.subType == MSG_GET_MMS || \
reqInfo.msgInfo.msgType.subType == MSG_NOTIFICATIONIND_MMS || \
- reqInfo.msgInfo.msgType.subType == MSG_RETRIEVE_MMS)
- {
+ reqInfo.msgInfo.msgType.subType == MSG_RETRIEVE_MMS) {
MSG_WARN("retrieve pending id[%d]", reqInfo.msgInfo.msgId);
/* For retrieving failed msg (MMS)*/
reqInfo.msgInfo.msgType.subType = MSG_RETRIEVE_MMS;
- reqInfo.msgInfo.folderId = MSG_OUTBOX_ID; // outbox fixed
+ reqInfo.msgInfo.folderId = MSG_OUTBOX_ID; /* outbox fixed */
reqInfo.msgInfo.networkStatus = MSG_NETWORK_RETRIEVING;
} else {
/* For sending failed msg */
msg_error_t err = MSG_SUCCESS;
int eventSize = 0;
- // input check
+ /* input check */
if (!pCmd || !ppEvent) {
MSG_DEBUG("pCmd or ppEvent is null");
return 0;
}
- // Get Incoming Message
+ /* Get Incoming Message */
bool bInsert;
memcpy(&bInsert, (void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), sizeof(bool));
handlerMap.clear();
-// Fill in mMsgHandlers, as given in the below.
+/* Fill in mMsgHandlers, as given in the below. */
handlerMap[MSG_CMD_ADD_MSG] = &MsgAddMessageHandler;
handlerMap[MSG_CMD_ADD_SYNCML_MSG] = &MsgAddSyncMLMessageHandler;
handlerMap[MSG_CMD_UPDATE_MSG] = &MsgUpdateMessageHandler;
MsgTransactionManager::~MsgTransactionManager()
{
-// pthread_cond_init(&retCV, NULL); // = PTHREAD_COND_INITIALIZER;
-
+/* pthread_cond_init(&retCV, NULL); */ /* = PTHREAD_COND_INITIALIZER; */
}
MSG_DEBUG("Start Transaction Manager");
- // Set Msg FW Ready Flag
+ /* Set Msg FW Ready Flag */
if(MsgSettingSetBool(VCONFKEY_MSG_SERVER_READY, true) != MSG_SUCCESS)
MSG_DEBUG("MsgSettingSetBool FAIL : VCONFKEY_MSG_SERVER_READY");
MSG_INFO("### VCONFKEY_MSG_SERVER_READY ###");
/* running worker for plg task */
pthread_t tv;
- if (pthread_create (&tv, NULL, &worker_event_queue, NULL) != 0) {
+ if (pthread_create(&tv, NULL, &worker_event_queue, NULL) != 0) {
THROW(MsgException::SERVER_READY_ERROR, "cannot create thread [%d]", errno);
}
- while(1)
- {
+ while(1) {
readfds = servSock.fdSet();
nfds = servSock.maxFd();
THROW(MsgException::SELECT_ERROR, "select error : %s", g_strerror(errno));
}
- try
- {
- for (int i=0 ; i < nfds; i++)
- {
- if (FD_ISSET(i, &readfds))
- {
- if (i == servSock.fd()) // if it is socket connection request
+ try {
+ for (int i=0 ; i < nfds; i++) {
+ if (FD_ISSET(i, &readfds)) {
+ if (i == servSock.fd()) /* if it is socket connection request */
servSock.accept();
else
handleRequest(i);
}
}
- }
- catch (MsgException& e)
- {
+ } catch (MsgException& e) {
MSG_FATAL("%s", e.what());
- }
- catch (exception& e)
- {
+ } catch (exception& e) {
MSG_FATAL("%s", e.what());
}
}
fd_map::iterator it = statusCBFdMap.find(pPrxInfo->listenerFd);
- if (it == statusCBFdMap.end()) { // if the status CB is not registered
+ if (it == statusCBFdMap.end()) { /* if the status CB is not registered */
MSG_DEBUG("No sent_status registered for fd %d", pPrxInfo->listenerFd);
} else {
sentMsgMap.insert(make_pair(reqId, *pPrxInfo));
{
sentmsg_map::iterator it = sentMsgMap.find(reqId);
- if (it == sentMsgMap.end())
- {
+ if (it == sentMsgMap.end()) {
MSG_DEBUG("No sent status cb found");
return NULL;
}
sentmsg_map::iterator it = sentMsgMap.find(reqId);
- if (it == sentMsgMap.end())
- {
+ if (it == sentMsgMap.end()) {
THROW(MsgException::SENT_STATUS_ERROR, "channel info does not exist");
}
while (1) {
mxQ.lock();
while (!eventQueue.front(&pCmd)) { /* if no item, wait */
- MSG_DEBUG ("waiting for task");
+ MSG_DEBUG("waiting for task");
cv.wait(mxQ.pMutex());
}
eventQueue.pop_front(); /* pop it from queue*/
}
memcpy (&fd, pCmd->cmdCookie, sizeof(int));
- if (fd < 0 ) {
+ if (fd < 0) {
MSG_FATAL("fd [%d] < 0", fd);
- g_free (pCmd); pCmd = NULL;
+ g_free(pCmd); pCmd = NULL;
continue;
}
pfHandler = handlerMap[pCmd->cmdType];
MSG_FATAL("No handler for %d", pCmd->cmdType);
MsgMakeErrorEvent(pCmd->cmdType, MSG_ERR_INVALID_PARAMETER, &eventSize, &pEventData);
} else {
- // run handler function
+ /* run handler function */
eventSize = pfHandler(pCmd, &pEventData);
if (eventSize == 0 || pEventData == NULL) {
MSG_DEBUG("Replying to fd [%d], size [%d]", fd, eventSize);
servSock.write(fd, pEventData, eventSize);
- g_free (pCmd); pCmd = NULL;
- g_free (pEventData); pEventData = NULL;
+ g_free(pCmd); pCmd = NULL;
+ g_free(pEventData); pEventData = NULL;
}
}
int len = 0;
int ret = servSock.read(fd, &buf, &len);
- if( ret == CLOSE_CONNECTION_BY_SIGNAL || ret == CLOSE_CONNECTION_BY_USER || ret < 0)
- {
+ if (ret == CLOSE_CONNECTION_BY_SIGNAL || ret == CLOSE_CONNECTION_BY_USER || ret < 0) {
MSG_DEBUG("Read value [%d]", ret);
cleanup(fd);
return;
int eventSize = 0;
- // decoding cmd from APP
+ /* decoding cmd from APP */
MSG_CMD_S* pCmd = (MSG_CMD_S*) buf;
MSG_DEBUG("Command Type [%d : %s]", pCmd->cmdType, MsgDbgCmdStr(pCmd->cmdType));
if (pCmd->cmdType > MSG_CMD_NUM)
THROW(MsgException::OUT_OF_RANGE, "request CMD is not defined");
- // check privilege
-// if (checkPrivilege(pCmd->cmdType, pCmd->cmdCookie) == false) {
+ /* check privilege */
+/* if (checkPrivilege(pCmd->cmdType, pCmd->cmdCookie) == false) { */
if (checkPrivilege(fd, pCmd->cmdType) == false) {
MSG_DEBUG("No Privilege rule. Not allowed.");
#ifdef MSG_CHECK_PRIVILEGE
#endif
}
- // determine the handler based on pCmd->cmdType
+ /* determine the handler based on pCmd->cmdType */
int (*pfHandler)(const MSG_CMD_S*, char**) = NULL;
switch (pCmd->cmdType) {
case MSG_CMD_PLG_INIT_SIM_BY_SAT:
case MSG_CMD_PLG_INCOMING_PUSH_IND:
case MSG_CMD_PLG_INCOMING_CB_IND: {
-
- MSG_CMD_S* pCmdDup = (MSG_CMD_S*) calloc (1, len); /* pCmdDup should be freed afterward */
+ MSG_CMD_S* pCmdDup = (MSG_CMD_S*)calloc(1, len); /* pCmdDup should be freed afterward */
if (pCmdDup != NULL) {
- memcpy (pCmdDup, pCmd, len);
- memcpy (pCmdDup->cmdCookie, &fd, sizeof(int)); /* Now, cmdCookie keeps fd for return */
+ memcpy(pCmdDup, pCmd, len);
+ memcpy(pCmdDup->cmdCookie, &fd, sizeof(int)); /* Now, cmdCookie keeps fd for return */
mxQ.lock(); /* aquire lock before adding cmd */
eventQueue.push_back(pCmdDup);
MSG_FATAL("No handler for %d", pCmd->cmdType);
MsgMakeErrorEvent(pCmd->cmdType, MSG_ERR_INVALID_PARAMETER, &eventSize, &pEventData);
} else {
- // run handler function
+ /* run handler function */
memcpy (pCmd->cmdCookie, &fd, sizeof(int)); /* Now, cmdCookie keeps fd for return */
eventSize = pfHandler(pCmd, &pEventData);
}
-// terminating the socket connection between ipc server and ipc client
+/* terminating the socket connection between ipc server and ipc client */
void MsgTransactionManager::cleanup(int fd)
{
MSG_BEGIN();
MSG_DEBUG("fd %d disonnected", fd);
- // remove sent msg info for fd
+ /* remove sent msg info for fd */
sentmsg_map::iterator sentmsg_it = sentMsgMap.begin();
- for (; sentmsg_it != sentMsgMap.end(); sentmsg_it++)
- {
- if (sentmsg_it->second.listenerFd == fd)
- {
+ for (; sentmsg_it != sentMsgMap.end(); sentmsg_it++) {
+ if (sentmsg_it->second.listenerFd == fd) {
sentmsg_it->second.listenerFd = 0;
sentmsg_it->second.handleAddr = 0;
}
}
- // remove sent status callback for fd
+ /* remove sent status callback for fd */
statusCBFdMap.erase(fd);
MSG_DEBUG("After erase fd [%d], statusCBFdMap has below.", fd);
fd_map::iterator it = statusCBFdMap.begin();
- for (; it!=statusCBFdMap.end(); ++it)
+ for (; it != statusCBFdMap.end(); ++it)
MSG_DEBUG("[%d]", it->first);
- // remove all newMsgCBs for fd
+ /* remove all newMsgCBs for fd */
newmsg_list::iterator newmsg_it = newMsgCBList.begin();
- while (newmsg_it != newMsgCBList.end())
- {
- if (newmsg_it->listenerFd == fd)
- {
+ while (newmsg_it != newMsgCBList.end()) {
+ if (newmsg_it->listenerFd == fd) {
newmsg_it = newMsgCBList.erase(newmsg_it);
- }
- else
- {
+ } else {
++newmsg_it;
}
}
- // remove all newMMSConfMsgCBs for fd
+ /* remove all newMMSConfMsgCBs for fd */
mmsconf_list::iterator mmsconf_it = newMMSConfMsgCBList.begin();
- while (mmsconf_it != newMMSConfMsgCBList.end())
- {
- if (mmsconf_it->listenerFd == fd)
- {
+ while (mmsconf_it != newMMSConfMsgCBList.end()) {
+ if (mmsconf_it->listenerFd == fd) {
mmsconf_it = newMMSConfMsgCBList.erase(mmsconf_it);
- }
- else
- {
+ } else {
++mmsconf_it;
}
}
- // remove all newSyncMLMsgCBs for fd
+ /* remove all newSyncMLMsgCBs for fd */
syncmlmsg_list::iterator syncmlmsg_it = newSyncMLMsgCBList.begin();
- while (syncmlmsg_it != newSyncMLMsgCBList.end())
- {
- if (syncmlmsg_it->listenerFd == fd)
- {
+ while (syncmlmsg_it != newSyncMLMsgCBList.end()) {
+ if (syncmlmsg_it->listenerFd == fd) {
syncmlmsg_it = newSyncMLMsgCBList.erase(syncmlmsg_it);
- }
- else
- {
+ } else {
++syncmlmsg_it;
}
}
- // remove all newLBSMsgCBs for fd
+ /* remove all newLBSMsgCBs for fd */
lbsmsg_list::iterator lbsmsg_it = newLBSMsgCBList.begin();
- while (lbsmsg_it != newLBSMsgCBList.end())
- {
- if (lbsmsg_it->listenerFd == fd)
- {
+ while (lbsmsg_it != newLBSMsgCBList.end()) {
+ if (lbsmsg_it->listenerFd == fd) {
lbsmsg_it = newLBSMsgCBList.erase(lbsmsg_it);
- }
- else
- {
+ } else {
++lbsmsg_it;
}
}
- // remove all newPushMsgCBs for fd
+ /* remove all newPushMsgCBs for fd */
pushmsg_list::iterator pushmsg_it = newPushMsgCBList.begin();
- while (pushmsg_it != newPushMsgCBList.end())
- {
- if (pushmsg_it->listenerFd == fd)
- {
+ while (pushmsg_it != newPushMsgCBList.end()) {
+ if (pushmsg_it->listenerFd == fd) {
pushmsg_it = newPushMsgCBList.erase(pushmsg_it);
- }
- else
- {
+ } else {
++pushmsg_it;
}
}
- // remove all newCBMsgCBs for fd
+ /* remove all newCBMsgCBs for fd */
cbmsg_list::iterator cbmsg_it = newCBMsgCBList.begin();
- //bool bSave = false;
+ /*bool bSave = false; */
- while (cbmsg_it != newCBMsgCBList.end())
- {
- if (cbmsg_it->listenerFd == fd)
- {
+ while (cbmsg_it != newCBMsgCBList.end()) {
+ if (cbmsg_it->listenerFd == fd) {
cbmsg_it = newCBMsgCBList.erase(cbmsg_it);
- }
- else
- {
- //if (cbmsg_it->bsave == true)
- // bSave = true;
+ } else {
+ /*if (cbmsg_it->bsave == true) */
+ /* bSave = true; */
++cbmsg_it;
}
}
- // remove all operationSyncMLMsgCBs for fd
+ /* remove all operationSyncMLMsgCBs for fd */
syncmlop_list::iterator syncmlop_it = operationSyncMLMsgCBList.begin();
- while (syncmlop_it != operationSyncMLMsgCBList.end())
- {
- if (syncmlop_it->listenerFd == fd)
- {
+ while (syncmlop_it != operationSyncMLMsgCBList.end()) {
+ if (syncmlop_it->listenerFd == fd) {
syncmlop_it = operationSyncMLMsgCBList.erase(syncmlop_it);
- }
- else
- {
+ } else {
++syncmlop_it;
}
}
- // remove storage change callback for fd
+ /* remove storage change callback for fd */
storageChangeFdMap.erase(fd);
MSG_DEBUG("After erase fd [%d], storageChangeFdMap has below.", fd);
it = storageChangeFdMap.begin();
- for (; it!=storageChangeFdMap.end(); ++it)
+ for (; it != storageChangeFdMap.end(); ++it)
MSG_DEBUG("[%d]", it->first);
- // remove report msg incoming callback for fd
+ /* remove report msg incoming callback for fd */
reportMsgCBFdMap.erase(fd);
MSG_DEBUG("After erase fd [%d], reportMsgCBFdMap has below.", fd);
it = reportMsgCBFdMap.begin();
- for (; it!=reportMsgCBFdMap.end(); ++it)
+ for (; it != reportMsgCBFdMap.end(); ++it)
MSG_DEBUG("[%d]", it->first);
MSG_END();
goto _END_OF_FUNC;
}
- switch(CmdType)
- {
+ switch(CmdType) {
case MSG_CMD_GET_MSG:
case MSG_CMD_COUNT_MSG:
case MSG_CMD_COUNT_BY_MSGTYPE:
case MSG_CMD_GET_PUSH_MSG_OPT:
case MSG_CMD_GET_VOICE_MSG_OPT:
case MSG_CMD_GET_GENERAL_MSG_OPT:
- case MSG_CMD_GET_MSG_SIZE_OPT:
- {
+ case MSG_CMD_GET_MSG_SIZE_OPT: {
ret = cynara_check(p_cynara, peer_client, peer_session, peer_user,
"http://tizen.org/privilege/message.read");
if (ret != CYNARA_API_ACCESS_ALLOWED) {
case MSG_CMD_SET_PUSH_MSG_OPT:
case MSG_CMD_SET_VOICE_MSG_OPT:
case MSG_CMD_SET_GENERAL_MSG_OPT:
- case MSG_CMD_SET_MSG_SIZE_OPT:
- {
+ case MSG_CMD_SET_MSG_SIZE_OPT: {
ret = cynara_check(p_cynara, peer_client, peer_session, peer_user,
"http://tizen.org/privilege/message.write");
if (ret != CYNARA_API_ACCESS_ALLOWED) {
void MsgTransactionManager::setSentStatusCB(int listenerFd)
{
if (listenerFd <= 0)
- THROW(MsgException::INVALID_PARAM,"InParam Error: listenerFd %d",listenerFd);
+ THROW(MsgException::INVALID_PARAM, "InParam Error: listenerFd %d", listenerFd);
statusCBFdMap[listenerFd] = true;
}
void MsgTransactionManager::setIncomingMsgCB(MSG_CMD_REG_INCOMING_MSG_CB_S *pCbInfo)
{
- if (!pCbInfo)
- {
+ if (!pCbInfo) {
MSG_FATAL("cbinfo NULL");
return;
}
newmsg_list::iterator it = newMsgCBList.begin();
- for (; it != newMsgCBList.end(); it++)
- {
- if ((it->listenerFd == pCbInfo->listenerFd) && (it->msgType == pCbInfo->msgType) && (it->port == pCbInfo->port))
- {
+ for (; it != newMsgCBList.end(); it++) {
+ if ((it->listenerFd == pCbInfo->listenerFd) && (it->msgType == pCbInfo->msgType) && (it->port == pCbInfo->port)) {
MSG_DEBUG("Duplicated messageCB info fd %d, mType %d, port %d", it->listenerFd, it->msgType, it->port);
return;
}
void MsgTransactionManager::setMMSConfMsgCB(MSG_CMD_REG_INCOMING_MMS_CONF_MSG_CB_S *pCbInfo)
{
- if (!pCbInfo)
- {
+ if (!pCbInfo) {
MSG_FATAL("cbinfo NULL");
return;
}
mmsconf_list::iterator it = newMMSConfMsgCBList.begin();
- for (; it != newMMSConfMsgCBList.end(); it++)
- {
- if ((it->listenerFd == pCbInfo->listenerFd) && (it->msgType == pCbInfo->msgType) && (!strncmp(it->appId, pCbInfo->appId, MAX_MMS_JAVA_APPID_LEN)))
- {
+ for (; it != newMMSConfMsgCBList.end(); it++) {
+ if ((it->listenerFd == pCbInfo->listenerFd) && (it->msgType == pCbInfo->msgType) && (!strncmp(it->appId, pCbInfo->appId, MAX_MMS_JAVA_APPID_LEN))) {
MSG_DEBUG("Duplicated MMSConfMessageCB info fd:%d, mType:%d, appId:%s", it->listenerFd, it->msgType, it->appId);
return;
}
void MsgTransactionManager::setPushMsgCB(MSG_CMD_REG_INCOMING_PUSH_MSG_CB_S *pCbInfo)
{
- if (!pCbInfo)
- {
+ if (!pCbInfo) {
MSG_FATAL("cbinfo NULL");
return;
}
pushmsg_list::iterator it = newPushMsgCBList.begin();
- for (; it != newPushMsgCBList.end(); it++)
- {
- if ((it->listenerFd == pCbInfo->listenerFd) && (it->msgType == pCbInfo->msgType) && !strncmp(it->appId, pCbInfo->appId, MAX_WAPPUSH_ID_LEN))
- {
+ for (; it != newPushMsgCBList.end(); it++) {
+ if ((it->listenerFd == pCbInfo->listenerFd) && (it->msgType == pCbInfo->msgType) && !strncmp(it->appId, pCbInfo->appId, MAX_WAPPUSH_ID_LEN)) {
MSG_DEBUG("Duplicated messageCB info fd %d, mType %d", it->listenerFd, it->msgType);
return;
}
void MsgTransactionManager::setCBMsgCB(MSG_CMD_REG_INCOMING_CB_MSG_CB_S *pCbInfo)
{
MSG_BEGIN();
- if (!pCbInfo)
- {
+ if (!pCbInfo) {
MSG_FATAL("cbinfo NULL");
return;
}
cbmsg_list::iterator it = newCBMsgCBList.begin();
- for (; it != newCBMsgCBList.end(); it++)
- {
- if ((it->listenerFd == pCbInfo->listenerFd) && (it->msgType == pCbInfo->msgType))
- {
+ for (; it != newCBMsgCBList.end(); it++) {
+ if ((it->listenerFd == pCbInfo->listenerFd) && (it->msgType == pCbInfo->msgType)) {
MSG_DEBUG("Duplicated messageCB info fd %d, mType %d", it->listenerFd, it->msgType);
return;
}
}
MSG_DEBUG("bSave : [%d]", pCbInfo->bsave);
- if(pCbInfo->bsave)
+ if(pCbInfo->bsave) {
if(MsgSettingSetBool(CB_SAVE, pCbInfo->bsave) != MSG_SUCCESS)
MSG_DEBUG("MsgSettingSetBool FAIL: CB_SAVE");
+ }
newCBMsgCBList.push_back(*pCbInfo);
void MsgTransactionManager::setSyncMLMsgCB(MSG_CMD_REG_INCOMING_SYNCML_MSG_CB_S *pCbInfo)
{
- if (!pCbInfo)
- {
+ if (!pCbInfo) {
MSG_FATAL("cbinfo NULL");
return;
}
syncmlmsg_list::iterator it = newSyncMLMsgCBList.begin();
- for (; it != newSyncMLMsgCBList.end(); it++)
- {
- if ((it->listenerFd == pCbInfo->listenerFd) && (it->msgType == pCbInfo->msgType))
- {
+ for (; it != newSyncMLMsgCBList.end(); it++) {
+ if ((it->listenerFd == pCbInfo->listenerFd) && (it->msgType == pCbInfo->msgType)) {
MSG_DEBUG("Duplicated messageCB info fd %d, mType %d", it->listenerFd, it->msgType);
return;
}
void MsgTransactionManager::setLBSMsgCB(MSG_CMD_REG_INCOMING_LBS_MSG_CB_S *pCbInfo)
{
- if (!pCbInfo)
- {
+ if (!pCbInfo) {
MSG_FATAL("cbinfo NULL");
return;
}
lbsmsg_list::iterator it = newLBSMsgCBList.begin();
- for (; it != newLBSMsgCBList.end(); it++)
- {
- if ((it->listenerFd == pCbInfo->listenerFd) && (it->msgType == pCbInfo->msgType))
- {
+ for (; it != newLBSMsgCBList.end(); it++) {
+ if ((it->listenerFd == pCbInfo->listenerFd) && (it->msgType == pCbInfo->msgType)) {
MSG_DEBUG("Duplicated messageCB info fd %d, mType %d", it->listenerFd, it->msgType);
return;
}
void MsgTransactionManager::setJavaMMSList(MSG_CMD_REG_INCOMING_JAVAMMS_TRID_S *pTrId)
{
- if (!pTrId)
- {
+ if (!pTrId) {
MSG_FATAL("trId NULL");
return;
}
javamms_list::iterator it;
- for (it = javaMMSList.begin(); it != javaMMSList.end(); it++)
- {
- if (!strcmp(it->id, pTrId->id))
- {
+ for (it = javaMMSList.begin(); it != javaMMSList.end(); it++) {
+ if (!strcmp(it->id, pTrId->id)) {
MSG_SEC_DEBUG("Duplicated javaMMS transaction Id:%s", it->id);
return;
}
void MsgTransactionManager::setSyncMLMsgOperationCB(MSG_CMD_REG_SYNCML_MSG_OPERATION_CB_S *pCbInfo)
{
- if (!pCbInfo)
- {
+ if (!pCbInfo) {
MSG_FATAL("cbinfo NULL");
return;
}
syncmlop_list::iterator it = operationSyncMLMsgCBList.begin();
- for (; it != operationSyncMLMsgCBList.end(); it++)
- {
- if ((it->listenerFd == pCbInfo->listenerFd) && (it->msgType == pCbInfo->msgType))
- {
+ for (; it != operationSyncMLMsgCBList.end(); it++) {
+ if ((it->listenerFd == pCbInfo->listenerFd) && (it->msgType == pCbInfo->msgType)) {
MSG_DEBUG("Duplicated messageCB info fd %d, mType %d", it->listenerFd, it->msgType);
return;
}
void MsgTransactionManager::setStorageChangeCB(int listenerFd)
{
if (listenerFd <= 0)
- THROW(MsgException::INVALID_PARAM,"InParam Error: listenerFd %d", listenerFd);
+ THROW(MsgException::INVALID_PARAM, "InParam Error: listenerFd %d", listenerFd);
MutexLocker lock(mx);
void MsgTransactionManager::setReportMsgCB(int listenerFd)
{
if (listenerFd <= 0)
- THROW(MsgException::INVALID_PARAM,"InParam Error: listenerFd %d", listenerFd);
+ THROW(MsgException::INVALID_PARAM, "InParam Error: listenerFd %d", listenerFd);
MutexLocker lock(mx);
newmsg_list::iterator it = newMsgCBList.begin();
- for (; it != newMsgCBList.end(); it++)
- {
- MSG_DEBUG("fd %d dstport %d",it->listenerFd, it->port);
+ for (; it != newMsgCBList.end(); it++) {
+ MSG_DEBUG("fd %d dstport %d", it->listenerFd, it->port);
if ((msgInfo->msgPort.valid == false) && (it->port == 0)) {
MSG_DEBUG("Send incoming normal msg to listener %d", it->listenerFd);
} else {
bundle_add(b, EVT_KEY_MSG_TYPE, EVT_VAL_SMS);
}
- char msgId[MSG_EVENT_MSG_ID_LEN] = {0,};
+ char msgId[MSG_EVENT_MSG_ID_LEN] = {0, };
snprintf(msgId, sizeof(msgId), "%u", msgInfo->msgId);
bundle_add(b, EVT_KEY_MSG_ID, msgId);
eventsystem_send_system_event(SYS_EVENT_INCOMMING_MSG, b);
mmsconf_list::iterator it = newMMSConfMsgCBList.begin();
- for (; it != newMMSConfMsgCBList.end(); it++)
- {
- MSG_DEBUG("fd:%d appId:%s",it->listenerFd, it->appId);
+ for (; it != newMMSConfMsgCBList.end(); it++) {
+ MSG_DEBUG("fd:%d appId:%s", it->listenerFd, it->appId);
- if (mmsRecvData->msgAppId.valid == true)
- {
- if (!strcmp(it->appId, mmsRecvData->msgAppId.appId))
- {
+ if (mmsRecvData->msgAppId.valid == true) {
+ if (!strcmp(it->appId, mmsRecvData->msgAppId.appId)) {
MSG_DEBUG("Send incoming java msg to listener %d", it->listenerFd);
write(it->listenerFd, pEventData, eventSize);
}
- }
- else
- {
- if (strlen(it->appId) <= 0)
- {
+ } else {
+ if (strlen(it->appId) <= 0) {
MSG_DEBUG("Send incoming normal msg to listener %d", it->listenerFd);
write(it->listenerFd, pEventData, eventSize);
}
pushmsg_list::iterator it = newPushMsgCBList.begin();
- for (; it != newPushMsgCBList.end(); it++)
- {
+ for (; it != newPushMsgCBList.end(); it++) {
MSG_DEBUG("registered_appid : %s, incoming_appid: %s", it->appId, pushData->pushAppId);
- if (!strcmp(it->appId, pushData->pushAppId))
- {
+ if (!strcmp(it->appId, pushData->pushAppId)) {
MSG_DEBUG("Send incoming Push information to listener %d", it->listenerFd);
write(it->listenerFd, pEventData, eventSize);
}
cbmsg_list::iterator it = newCBMsgCBList.begin();
- for (; it != newCBMsgCBList.end(); it++)
- {
+ for (; it != newCBMsgCBList.end(); it++) {
MSG_DEBUG("Send incoming CB information to listener %d", it->listenerFd);
write(it->listenerFd, pEventData, eventSize);
}
b = bundle_create();
if (b) {
bundle_add(b, EVT_KEY_MSG_TYPE, EVT_VAL_CB);
- char msgId[MSG_EVENT_MSG_ID_LEN] = {0,};
+ char msgId[MSG_EVENT_MSG_ID_LEN] = {0, };
snprintf(msgId, sizeof(msgId), "%u", cbMsgId);
bundle_add(b, EVT_KEY_MSG_ID, msgId);
eventsystem_send_system_event(SYS_EVENT_INCOMMING_MSG, b);
syncmlmsg_list::iterator it = newSyncMLMsgCBList.begin();
- for (; it != newSyncMLMsgCBList.end(); it++)
- {
+ for (; it != newSyncMLMsgCBList.end(); it++) {
MSG_DEBUG("Send incoming SyncML information to listener %d", it->listenerFd);
write(it->listenerFd, pEventData, eventSize);
}
lbsmsg_list::iterator it = newLBSMsgCBList.begin();
- for (; it != newLBSMsgCBList.end(); it++)
- {
+ for (; it != newLBSMsgCBList.end(); it++) {
MSG_DEBUG("Send incoming LBS msg to listener %d", it->listenerFd);
write(it->listenerFd, pEventData, eventSize);
}
char* encodedData = NULL;
unique_ptr<char*, void(*)(char**)> buf(&encodedData, unique_ptr_deleter);
- // Encoding Storage Change Data
+ /* Encoding Storage Change Data */
int dataSize = MsgEncodeSyncMLOperationData(msgId, extId, &encodedData);
int eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_SYNCML_OPERATION, err, (void**)(&pEventData));
syncmlop_list::iterator it = operationSyncMLMsgCBList.begin();
- for( ; it != operationSyncMLMsgCBList.end() ; it++ )
- {
+ for( ; it != operationSyncMLMsgCBList.end() ; it++ ) {
MSG_DEBUG("Send SyncML operation to listener %d", it->listenerFd);
write(it->listenerFd, pEventData, eventSize);
}
char* encodedData = NULL;
unique_ptr<char*, void(*)(char**)> buf(&encodedData, unique_ptr_deleter);
- // Encoding Storage Change Data
+ /* Encoding Storage Change Data */
dataSize = MsgEncodeStorageChangeData(storageChangeType, pMsgIdList, &encodedData);
int eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_PLG_STORAGE_CHANGE_IND, err, (void**)(&pEventData));
fd_map::iterator it = storageChangeFdMap.begin();
- for (; it != storageChangeFdMap.end(); it++)
- {
+ for (; it != storageChangeFdMap.end(); it++) {
MSG_DEBUG("Send Storage Change Callback to listener %d", it->first);
write(it->first, pEventData, eventSize);
}
char* encodedData = NULL;
unique_ptr<char*, void(*)(char**)> buf(&encodedData, unique_ptr_deleter);
- // Encoding Storage Change Data
+ /* Encoding Storage Change Data */
dataSize = MsgEncodeReportMsgData(reportMsgType, pMsgInfo, &encodedData);
int eventSize = MsgMakeEvent(encodedData, dataSize, MSG_EVENT_PLG_REPORT_MSG_INCOMING_IND, err, (void**)(&pEventData));
fd_map::iterator it = reportMsgCBFdMap.begin();
- for (; it != reportMsgCBFdMap.end(); it++)
- {
+ for (; it != reportMsgCBFdMap.end(); it++) {
MSG_DEBUG("Send Report Message Incoming Callback to listener %d", it->first);
write(it->first, pEventData, eventSize);
}
if (ret == CYNARA_API_SUCCESS) {
MSG_INFO("cynara_finish() is successful");
} else {
- MSG_INFO("cynara_finish() is failed [%d]",ret);
+ MSG_INFO("cynara_finish() is failed [%d]", ret);
}
p_cynara = NULL;
MSG_CMD_GET_STORAGELIST,
MSG_CMD_ADD_MSG,
MSG_CMD_ADD_SYNCML_MSG,
-// 5
+/* 5 */
MSG_CMD_UPDATE_MSG,
MSG_CMD_UPDATE_READ,
MSG_CMD_UPDATE_PROTECTED,
MSG_CMD_DELETE_MSG,
MSG_CMD_DELALL_MSGINFOLDER,
-// 10
+/* 10 */
MSG_CMD_MOVE_MSGTOFOLDER,
MSG_CMD_MOVE_MSGTOSTORAGE,
MSG_CMD_COUNT_MSG,
MSG_CMD_GET_MSG,
MSG_CMD_ADD_FOLDER,
-// 15
+/* 15 */
MSG_CMD_UPDATE_FOLDER,
MSG_CMD_DELETE_FOLDER,
MSG_CMD_GET_FOLDERLIST,
MSG_CMD_ADD_FILTER,
MSG_CMD_UPDATE_FILTER,
-// 20
+/* 20 */
MSG_CMD_DELETE_FILTER,
MSG_CMD_GET_FILTERLIST,
MSG_CMD_SET_FILTER_OPERATION,
MSG_CMD_GET_FILTER_OPERATION,
MSG_CMD_SUBMIT_REQ,
-// 25
+/* 25 */
MSG_CMD_REG_SENT_STATUS_CB,
MSG_CMD_REG_STORAGE_CHANGE_CB,
MSG_CMD_REG_INCOMING_MSG_CB,
MSG_CMD_REG_INCOMING_MMS_CONF_MSG_CB,
MSG_CMD_REG_INCOMING_SYNCML_MSG_CB,
-// 30
+/* 30 */
MSG_CMD_REG_INCOMING_LBS_MSG_CB,
MSG_CMD_PLG_SENT_STATUS_CNF,
MSG_CMD_PLG_STORAGE_CHANGE_IND,
MSG_CMD_PLG_INCOMING_MSG_IND,
MSG_CMD_PLG_INCOMING_MMS_CONF,
-//35
+/* 35 */
MSG_CMD_PLG_INCOMING_SYNCML_IND,
MSG_CMD_PLG_INCOMING_LBS_IND,
MSG_CMD_PLG_INIT_SIM_BY_SAT,
MSG_CMD_GET_THREADVIEWLIST,
MSG_CMD_DELETE_THREADMESSAGELIST,
-// 40
+/* 40 */
MSG_CMD_GET_CONTACT_COUNT,
MSG_CMD_GET_QUICKPANEL_DATA,
MSG_CMD_COUNT_BY_MSGTYPE,
MSG_CMD_RESET_DB,
MSG_CMD_GET_MEMSIZE,
-// 45
+/* 45 */
MSG_CMD_BACKUP_MESSAGE,
MSG_CMD_RESTORE_MESSAGE,
MSG_CMD_UPDATE_THREAD_READ,
MSG_CMD_REG_SYNCML_MSG_OPERATION_CB,
MSG_CMD_SYNCML_OPERATION,
-// 50
+/* 50 */
MSG_CMD_GET_REPORT_STATUS,
MSG_CMD_GET_THREAD_ID_BY_ADDRESS,
MSG_CMD_GET_THREAD_INFO,
MSG_CMD_GET_SMSC_OPT,
MSG_CMD_GET_CB_OPT,
-// 55
+/* 55 */
MSG_CMD_GET_SMS_SEND_OPT,
MSG_CMD_GET_MMS_SEND_OPT,
MSG_CMD_GET_MMS_RECV_OPT,
MSG_CMD_GET_PUSH_MSG_OPT,
MSG_CMD_GET_VOICE_MSG_OPT,
-// 60
+/* 60 */
MSG_CMD_GET_GENERAL_MSG_OPT,
MSG_CMD_GET_MSG_SIZE_OPT,
MSG_CMD_SET_SMSC_OPT,
MSG_CMD_SET_CB_OPT,
MSG_CMD_SET_SMS_SEND_OPT,
-// 65
+/* 65 */
MSG_CMD_SET_MMS_SEND_OPT,
MSG_CMD_SET_MMS_RECV_OPT,
MSG_CMD_SET_PUSH_MSG_OPT,
MSG_CMD_SET_VOICE_MSG_OPT,
MSG_CMD_SET_GENERAL_MSG_OPT,
-// 70
+/* 70 */
MSG_CMD_SET_MSG_SIZE_OPT,
MSG_CMD_REG_INCOMING_PUSH_MSG_CB,
MSG_CMD_PLG_INCOMING_PUSH_IND,
MSG_CMD_REG_INCOMING_CB_MSG_CB,
MSG_CMD_PLG_INCOMING_CB_IND,
-//75
+/* 75 */
MSG_CMD_ADD_PUSH_EVENT,
MSG_CMD_DELETE_PUSH_EVENT,
MSG_CMD_UPDATE_PUSH_EVENT,
MSG_CMD_DELETE_MESSAGE_BY_LIST,
MSG_CMD_SET_FILTER_ACTIVATION,
-// 80
+/* 80 */
MSG_CMD_ADD_SIM_MSG,
MSG_CMD_PLG_RESEND_MESSAGE,
MSG_CMD_REG_REPORT_MSG_INCOMING_CB,
#ifdef FEATURE_SMS_CDMA
MSG_CMD_PLG_CHECK_UNIQUENESS,
#endif
-// end of MSG_CMD; new CMD should be defined before MSG_CMD_NUM
+/* end of MSG_CMD; new CMD should be defined before MSG_CMD_NUM */
MSG_CMD_NUM
};
MSG_EVENT_GET_STORAGELIST,
MSG_EVENT_ADD_MSG,
MSG_EVENT_ADD_SYNCML_MSG,
-// 5
+/* 5 */
MSG_EVENT_UPDATE_MSG,
MSG_EVENT_UPDATE_READ,
MSG_EVENT_UPDATE_PROTECTED,
MSG_EVENT_DELETE_MSG,
MSG_EVENT_DELALL_MSGINFOLDER,
-// 10
+/* 10 */
MSG_EVENT_MOVE_MSGTOFOLDER,
MSG_EVENT_MOVE_MSGTOSTORAGE,
MSG_EVENT_COUNT_MSG,
MSG_EVENT_GET_MSG,
MSG_EVENT_ADD_FOLDER,
-// 15
+/* 15 */
MSG_EVENT_UPDATE_FOLDER,
MSG_EVENT_DELETE_FOLDER,
MSG_EVENT_GET_FOLDERLIST,
MSG_EVENT_ADD_FILTER,
MSG_EVENT_UPDATE_FILTER,
-// 20
+/* 20 */
MSG_EVENT_DELETE_FILTER,
MSG_EVENT_GET_FILTERLIST,
MSG_EVENT_SET_FILTER_OPERATION,
MSG_EVENT_GET_FILTER_OPERATION,
MSG_EVENT_SUBMIT_REQ,
-// 25
+/* 25 */
MSG_EVENT_REG_SENT_STATUS_CB,
MSG_EVENT_REG_STORAGE_CHANGE_CB,
MSG_EVENT_REG_INCOMING_MSG_CB,
MSG_EVENT_REG_INCOMING_MMS_CONF_MSG_CB,
MSG_EVENT_REG_INCOMING_SYNCML_MSG_CB,
-// 30
+/* 30 */
MSG_EVENT_REG_INCOMING_LBS_MSG_CB,
MSG_EVENT_PLG_SENT_STATUS_CNF,
MSG_EVENT_PLG_STORAGE_CHANGE_IND,
MSG_EVENT_PLG_INCOMING_MSG_IND,
MSG_EVENT_PLG_INCOMING_MMS_CONF,
-//35
+/* 35 */
MSG_EVENT_PLG_INCOMING_SYNCML_MSG_IND,
MSG_EVENT_PLG_INCOMING_LBS_MSG_IND,
MSG_EVENT_PLG_INIT_SIM_BY_SAT,
MSG_EVENT_GET_THREADVIEWLIST,
MSG_EVENT_DELETE_THREADMESSAGELIST,
-// 40
+/* 40 */
MSG_EVENT_GET_CONTACT_COUNT,
MSG_EVENT_GET_QUICKPANEL_DATA,
MSG_EVENT_COUNT_BY_MSGTYPE,
MSG_EVENT_RESET_DB,
MSG_EVENT_GET_MEMSIZE,
-//45
+/* 45 */
MSG_EVENT_BACKUP_MESSAGE,
MSG_EVENT_RESTORE_MESSAGE,
MSG_EVENT_UPDATE_THREAD_READ,
MSG_EVENT_REG_SYNCML_MSG_OPERATION_CB,
MSG_EVENT_SYNCML_OPERATION,
-// 50
+/* 50 */
MSG_EVENT_GET_REPORT_STATUS,
MSG_EVENT_GET_THREAD_ID_BY_ADDRESS,
MSG_EVENT_GET_THREAD_INFO,
MSG_EVENT_GET_SMSC_OPT,
MSG_EVENT_GET_CB_OPT,
-// 55
+/* 55 */
MSG_EVENT_GET_SMS_SEND_OPT,
MSG_EVENT_GET_MMS_SEND_OPT,
MSG_EVENT_GET_MMS_RECV_OPT,
MSG_EVENT_GET_PUSH_MSG_OPT,
MSG_EVENT_GET_VOICE_MSG_OPT,
-// 60
+/* 60 */
MSG_EVENT_GET_GENERAL_MSG_OPT,
MSG_EVENT_GET_MSG_SIZE_OPT,
MSG_EVENT_SET_SMSC_OPT,
MSG_EVENT_SET_CB_OPT,
MSG_EVENT_SET_SMS_SEND_OPT,
-// 65
+/* 65 */
MSG_EVENT_SET_MMS_SEND_OPT,
MSG_EVENT_SET_MMS_RECV_OPT,
MSG_EVENT_SET_PUSH_MSG_OPT,
MSG_EVENT_SET_VOICE_MSG_OPT,
MSG_EVENT_SET_GENERAL_MSG_OPT,
-// 70
+/* 70 */
MSG_EVENT_SET_MSG_SIZE_OPT,
MSG_EVENT_REG_INCOMING_PUSH_MSG_CB,
MSG_EVENT_PLG_INCOMING_PUSH_MSG_IND,
MSG_EVENT_REG_INCOMING_CB_MSG_CB,
MSG_EVENT_PLG_INCOMING_CB_MSG_IND,
-// 75
+/* 75 */
MSG_EVENT_ADD_PUSH_EVENT,
MSG_EVENT_DELETE_PUSH_EVENT,
MSG_EVENT_UPDATE_PUSH_EVENT,
MSG_EVENT_DELETE_MESSAGE_BY_LIST,
MSG_EVENT_SET_FILTER_ACTIVATION,
-// 80
+/* 80 */
MSG_EVENT_ADD_SIM_MSG,
MSG_EVENT_PLG_RESEND_MESSAGE,
MSG_EVENT_REG_REPORT_MSG_INCOMING_CB,
MSG_EVENT_PLG_CHECK_UNIQUENESS,
#endif
-// Enums that does not match _MSG_CMD_TYPE_E
+/* Enums that does not match _MSG_CMD_TYPE_E */
MSG_EVENT_PLG_REPORT_MSG_INCOMING_IND,
-// end of MSG_EVENT; new EVENT should be defined before MSG_EVENT_NUM
+/* end of MSG_EVENT; new EVENT should be defined before MSG_EVENT_NUM */
MSG_EVENT_NUM
};
-#endif // MSG_CMD_TYPES_H
+#endif /* MSG_CMD_TYPES_H */
#include <memory>
template <typename T>
-void unique_ptr_deleter( T **ptr ) {
+void unique_ptr_deleter(T **ptr) {
if (ptr && *ptr )
delete[] *ptr;
}
class AutoPtr
{
private:
- T** ptr; // Caution: Memory allocation should be done by "new" not "malloc"
+ T** ptr; /* Caution: Memory allocation should be done by "new" not "malloc" */
public:
}
};
-#endif // #ifndef __MSG_CPP_TYPES_H__
+#endif /* __MSG_CPP_TYPES_H__ */
* @}
*/
-#endif // MSG_FILTER_TYPES_H
+#endif /* MSG_FILTER_TYPES_H */
#define MSG_THUMBNAIL_PATH MSG_DATA_PATH"thumbnails/"
-// temporary
+/* temporary */
#define MSG_SIM_MSISDN "memory/private/msg-service/msisdn"
-#define MAX_FULL_PATH_SIZE 320 // max length for internal file path
+#define MAX_FULL_PATH_SIZE 320 /* max length for internal file path */
#define MAX_THREAD_ADDR_LEN 40
#define MAX_THREAD_NAME_LEN 195
#define MAX_THREAD_DATA_LEN 128
-#define MAX_CB_MSG_TEXT_LEN 4200 // 1page max char(93)*max page(15)*max bytes of UTF8 1 char(3)
+#define MAX_CB_MSG_TEXT_LEN 4200 /* 1page max char(93)*max page(15)*max bytes of UTF8 1 char(3) */
#define MAX_CB_MSG_LANGUAGE_TYPE_LEN 3
#define MAX_ETWS_WARNING_SECURITY_INFO_LEN 50
#define MAX_ME_IMEI_LEN 20
#define DEFAULT_SIM_COUNT_PATH DEFAULT_SETTING_PATH"/sim_count"
#define MSG_KEEP_COPY DEFAULT_GENERAL_OPT_PATH"/keep_copy"
-//#define MSG_ALERT_REP_TYPE DEFAULT_GENERAL_OPT_PATH"/alert_rep_type"
+/* #define MSG_ALERT_REP_TYPE DEFAULT_GENERAL_OPT_PATH"/alert_rep_type" */
#define MSG_ALERT_REP_TYPE "db/setting/sound/noti/msg_alert_rep_type"
#define MSG_AUTO_ERASE DEFAULT_GENERAL_OPT_PATH"/auto_erase"
#define MSG_BLOCK_MESSAGE DEFAULT_GENERAL_OPT_PATH"/block_msg"
MSG_MESSAGE_TYPE_S msgType; /**< Indicates the message type such as SMS and MMS */
msg_storage_id_t storageId; /**< Indicates where the message is saved. */
int nAddressCnt; /**< Indicates the count of addresses. */
-// MSG_ADDRESS_INFO_S addressList[MAX_TO_ADDRESS_CNT]; /**< Indicates the address information list. */
+#if 0
+ MSG_ADDRESS_INFO_S addressList[MAX_TO_ADDRESS_CNT]; /**< Indicates the address information list. */
+#endif
MSG_ADDRESS_INFO_S *addressList; /**< Indicates the address information list. */
char replyAddress[MAX_PHONE_NUMBER_LEN+1]; /**< Indicates the reply address. */
char subject[MAX_SUBJECT_LEN+1]; /**< Indicates the message subject. */
size_t textSize; /**< Indicates the data size. The unit is byte. */
char *pText; /**< Indicates the message payload information as a body. default character encoding is UTF-8*/
int tcs_bc_level;
- char firstMediaPath[MSG_FILEPATH_LEN_MAX+1]; // First Media Path in mms;
+ char firstMediaPath[MSG_FILEPATH_LEN_MAX+1]; /**< First Media Path in mms; */
msg_list_handle_t multipart_list;
int simIndex;
} MSG_CONVERSATION_VIEW_S;
time_t receivedTime;
unsigned short serialNum;
- unsigned short messageId; // Message Identifier
- unsigned char dcs; // data coding scheme
- int cbTextLen; // length of cbText
- unsigned char cbText[MAX_CB_MSG_TEXT_LEN];// cb message text (UTF8)
+ unsigned short messageId; /**< Message Identifier */
+ unsigned char dcs; /**< data coding scheme */
+ int cbTextLen; /**< length of cbText */
+ unsigned char cbText[MAX_CB_MSG_TEXT_LEN]; /**< cb message text (UTF8) */
unsigned short etwsWarningType;
unsigned char etwsWarningSecurityInfo[MAX_ETWS_WARNING_SECURITY_INFO_LEN];
{
time_t receivedTime;
unsigned short serialNum;
- unsigned short messageId; // Message Identifier
+ unsigned short messageId; /**< Message Identifier */
} MSG_CB_DUPLICATE_S;
#endif
char szAlt[MAX_SMIL_ALT_LEN + 1]; /**< Indicates the alternative text to be displayed in failure case */
MsgDrmType drmType; /**< Indicates the drm type. see enum MsgDrmType */
char szDrm2FullPath[MSG_FILEPATH_LEN_MAX + 1]; /**< Indicates the fullpath of the DRM */
- union{
+ union {
MmsSmilText sText; /**< Indicates the text attributes */
MmsSmilAVI sAVI; /**< Indicates the video attributes */
} sMedia;
MsgDrmType drmType; /**< Indicates the drm type. see enum MsgDrmType */
char szDrm2FullPath[MSG_FILEPATH_LEN_MAX + 1]; /**< Indicates the fullpath of the DRM */
char szContentType[MSG_MSG_ID_LEN + 1];
-
} MMS_ATTACH_S;
/**
int nMin; /**< Indicates the min attribute of the page */
int nMax; /**< Indicates the max attribute of the page */
int nRepeat; /**< Indicates the page needs to be displayed repeatedly */
-
}MMS_PAGE_S;
/**
MMS_LENGTH nLeft; /**< Indicates the left co-ordinate of the region */
MMS_LENGTH nTop; /**< Indicates the top co-ordinate of the region */
MMS_LENGTH width; /**< Indicates the width of the region */
- MMS_LENGTH height; /**< Indicates the width of the region */ // '%' rate should be supported
+ MMS_LENGTH height; /**< Indicates the width of the region, '%' rate should be supported */
bool bBgColor; /**< Indicates the background color set in the region */
int bgColor; /**< Indicates the background color of the region */
REGION_FIT_TYPE_T fit; /**< Indicates the fit type. see enum REGION_FIT_TYPE_T */
-
} MMS_SMIL_REGION;
/**
typedef struct
{
MMS_LENGTH width; /**< Indicates the width of the root layout */
- MMS_LENGTH height; /**< Indicates the height of the root layout */ // '%' rate should be supported
+ MMS_LENGTH height; /**< Indicates the height of the root layout, '%' rate should be supported */
bool bBgColor; /**< Indicates the background color set in the root layout */
int bgColor; /**< Indicates the background color of the root layout */
}MMS_SMIL_ROOTLAYOUT;
-#define MAX_FULL_PATH_SIZE_S 160 // max length for internal file path
+#define MAX_FULL_PATH_SIZE_S 160 /* max length for internal file path */
typedef struct
{
*/
typedef struct _MMS_HEADER_DATA_S
{
- MMSList *bcc;// Bcc
- MMSList *cc;// Cc
+ MMSList *bcc; /* Bcc */
+ MMSList *cc; /* Cc */
char contentLocation[MMS_LOCATION_LEN + 1];
- char szContentType[MSG_MSG_ID_LEN + 1];//string : ex) application/vnd.wap.multipart.related
+ char szContentType[MSG_MSG_ID_LEN + 1]; /* string : ex) application/vnd.wap.multipart.related */
unsigned long int date;
- bool bDeliveryReport; // X-Mms-Delivery-Report
- MmsTimeStruct delivery; // X-Mms-Delivery-Time
+ bool bDeliveryReport; /* X-Mms-Delivery-Report */
+ MmsTimeStruct delivery; /* X-Mms-Delivery-Time */
MmsTimeStruct expiry;
- char szFrom[254 * 3 + 11]; //"/TYPE=PLMN", /"TYPE=IPv4", "/TYPE=IPv6" // From
- int messageClass;//Personal | Advertisement | Informational | Auto
+ char szFrom[254 * 3 + 11]; /* "/TYPE=PLMN", /"TYPE=IPv4", "/TYPE=IPv6", From */
+ int messageClass; /* Personal | Advertisement | Informational | Auto */
char messageID[MSG_MSG_ID_LEN + 1];
- int messageType;//MmsMsgType : ex) sendreq
- int mmsVersion;//1.0 1.3
- int messageSize; //X-Mms-Message-Size
- int mmsPriority;//_MSG_PRIORITY_TYPE_E : Low | Normal | High
- bool bReadReport;// X-Mms-Read-Report
-// X-Mms-Report-Allowed
-// X-Mms-Response-Status
-// X-Mms-Response-Text
- bool bHideAddress;// X-Mms-Sender-Visibility
- msg_delivery_report_status_t mmsStatus;// X-Mms-Status
- char szSubject[MAX_SUBJECT_LEN + 1];// Subject
- MMSList *to;// Cc// To
+ int messageType; /* MmsMsgType : ex) sendreq */
+ int mmsVersion; /* 1.0 1.3 */
+ int messageSize; /* X-Mms-Message-Size */
+ int mmsPriority; /* _MSG_PRIORITY_TYPE_E : Low | Normal | High */
+ bool bReadReport; /* X-Mms-Read-Report */
+ bool bHideAddress; /* X-Mms-Sender-Visibility */
+ msg_delivery_report_status_t mmsStatus; /* X-Mms-Status */
+ char szSubject[MAX_SUBJECT_LEN + 1]; /* Subject */
+ MMSList *to; /* to */
char trID[MSG_MSG_ID_LEN + 1];
-// X-Mms-Retrieve-Status
-// X-Mms-Retrieve-Text
-// X-Mms-Read-Status
-// X-Mms-Reply-Charging
-// X-Mms-Reply-Charging-Deadline
-// X-Mms-Reply-Charging-ID
-// X-Mms-Reply-Charging-Size
-// X-Mms-Previously-Sent-By
-// X-Mms-Previously-Sent-Date
-// X-Mms-Store
-// X-Mms-MM-State
-// X-Mms-MM-Flags
-// X-Mms-Store-Status
-// X-Mms-Store-Status-Text
-// X-Mms-Stored
-// X-Mms-Attributes
-// X-Mms-Totals
-// X-Mms-Mbox-Totals
-// X-Mms-Quotas
-// X-Mms-Mbox-Quotas
-// X-Mms-Message-Count
-// Content
-// X-Mms-Start
-// Additional-headers
-// X-Mms-Distribution-Indicator
-// X-Mms-Element-Descriptor
-// X-Mms-Limit
-// X-Mms-Recommended-Retrieval-Mode
-// X-Mms-Recommended-Retrieval-Mode-Text
-// X-Mms-Status-Text
-// X-Mms-Applic-ID
-// X-Mms-Reply-Applic-ID
-// X-Mms-Aux-Applic-Info
- int contentClass;//text | image-basic| image-rich | video-basic | video-rich | megapixel | content-basic | content-rich
-// X-Mms-DRM-Content
-// X-Mms-Adaptation-Allowed
-// X-Mms-Replace-ID
-// X-Mms-Cancel-ID
-// X-Mms-Cancel-Status
-//------------------------------------------------------------------
- int contentType;//MimeType : ex) application/vnd.wap.multipart.related
-
+ int contentClass; /* text | image-basic| image-rich | video-basic | video-rich | megapixel | content-basic | content-rich */
+ int contentType; /* MimeType : ex) application/vnd.wap.multipart.related */
+#if 0
+ X-Mms-Report-Allowed
+ X-Mms-Response-Status
+ X-Mms-Response-Text
+ X-Mms-Retrieve-Status
+ X-Mms-Retrieve-Text
+ X-Mms-Read-Status
+ X-Mms-Reply-Charging
+ X-Mms-Reply-Charging-Deadline
+ X-Mms-Reply-Charging-ID
+ X-Mms-Reply-Charging-Size
+ X-Mms-Previously-Sent-By
+ X-Mms-Previously-Sent-Date
+ X-Mms-Store
+ X-Mms-MM-State
+ X-Mms-MM-Flags
+ X-Mms-Store-Status
+ X-Mms-Store-Status-Text
+ X-Mms-Stored
+ X-Mms-Attributes
+ X-Mms-Totals
+ X-Mms-Mbox-Totals
+ X-Mms-Quotas
+ X-Mms-Mbox-Quotas
+ X-Mms-Message-Count
+ X-Mms-Start
+ /* Additional-headers */
+ X-Mms-Distribution-Indicator
+ X-Mms-Element-Descriptor
+ X-Mms-Limit
+ X-Mms-Recommended-Retrieval-Mode
+ X-Mms-Recommended-Retrieval-Mode-Text
+ X-Mms-Status-Text
+ X-Mms-Applic-ID
+ X-Mms-Reply-Applic-ID
+ X-Mms-Aux-Applic-Info
+ X-Mms-DRM-Content
+ X-Mms-Adaptation-Allowed
+ X-Mms-Replace-ID
+ X-Mms-Cancel-ID
+ X-Mms-Cancel-Status
+#endif
} MMS_HEADER_DATA_S;
/**
*/
typedef struct _MMS_MESSAGE_DATA_S
{
- int backup_type; //normal = 0|| backup = 1;
+ int backup_type; /**< normal = 0|| backup = 1; */
char szSmilFilePath[MSG_FILEPATH_LEN_MAX + 1]; /**< Indicates the SMIL file path */
int pageCnt; /**< The count of the SMIL pages */
GList *pagelist; /**< The pointer to SMIL pages list */
GList *metalist; /**< The pointer to SMIL meta list */
MMS_SMIL_ROOTLAYOUT rootlayout; /**< Indicates the root layout information */
MMS_APPID_INFO_S msgAppId;
- MMS_HEADER_DATA_S header;//use for scloud
- MMS_MULTIPART_DATA_S smil;//use for scloud
+ MMS_HEADER_DATA_S header; /**< use for scloud */
+ MMS_MULTIPART_DATA_S smil;/**< use for scloud */
} MMS_MESSAGE_DATA_S;
/**
*/
typedef struct
{
- int backup_type; //none = 0 || scloud backup = 1 || kies backup = 2;
+ int backup_type; /* none = 0 || scloud backup = 1 || kies backup = 2; */
MMS_HEADER_DATA_S *header; /**< The header struct of MMS*/
MMS_MULTIPART_DATA_S *smil;
MMSList *multipartlist; /**< list of MMS_MULTIPART_DATA_S*/
-// Control API
+/* Control API */
/**
* \par Description:
typedef msg_error_t (*MsgPlgCheckDeviceStatus)();
-// Transport API
+/* Transport API */
/**
* \par Description:
typedef msg_error_t (*MsgPlgSubmitRequest)(MSG_REQUEST_INFO_S *pReqInfo);
-// Storage API
+/* Storage API */
/**
* \par Description:
typedef msg_error_t (*MsgPlgInitSimMessage)();
-// Storage API
+/* Storage API */
/**
* \par Description:
typedef msg_error_t (*MsgPlgSetMemoryStatus)(msg_sim_slot_id_t sim_idx, msg_error_t Error);
#endif
-// Setting API
+/* Setting API */
/**
* \par Description:
typedef msg_error_t (*MsgPlgInitConfigData)(MSG_SIM_STATUS_T SimStatus);
-// Setting API
+/* Setting API */
/**
* \par Description:
/*================================================================================================*/
typedef msg_error_t (*MsgPlgGetConfigData)(MSG_SETTING_S *pSetting);
-// MMS API
+/* MMS API */
/**
* \par Description:
typedef msg_error_t (*MsgPlgGetDefaultNetworkSimId) (int *simId);
-// framework defined callbacks.
+/* framework defined callbacks. */
typedef void (*MsgPlgOnSentStatus)(MSG_SENT_STATUS_S *pSentStatus);
typedef void (*MsgPlgOnStorageChange)(msg_storage_change_type_t storageChangeType, msg_id_list_s *pMsgIdList);
typedef msg_error_t (*MsgPlgOnMsgIncoming)(MSG_MESSAGE_INFO_S *pMsgInfo);
#include <list>
-template <typename T>
+template <typename T>
class MsgSimpleQ
{
public:
MsgSimpleQ(){};
- void pop_front ();
+ void pop_front();
bool front(T* qItem);
void push_front(T const & input);
void push_back(T const & input);
std::list <T> q;
};
-template <typename T>
+template <typename T>
void MsgSimpleQ<T>::pop_front()
{
- if( q.empty() ) return;
+ if(q.empty()) return;
q.pop_front();
}
-template <typename T>
+template <typename T>
bool MsgSimpleQ<T>::front(T* qItem)
{
if( qItem == NULL || q.empty() )
- return false; // Fail
+ return false; /* Fail */
- *qItem = q.front(); // copy
+ *qItem = q.front(); /* copy */
- return true; // Success
+ return true; /* Success */
}
-template <typename T>
+template <typename T>
void MsgSimpleQ<T>::push_back(T const & qItem)
{
q.push_back(qItem);
}
-template <typename T> void
+template <typename T> void
MsgSimpleQ<T>::push_front(T const & qItem)
{
q.push_front(qItem);
}
-template <typename T>
+template <typename T>
int MsgSimpleQ<T>::size()
{
return q.size();
}
-template <typename T>
+template <typename T>
bool MsgSimpleQ<T>::empty()
{
return q.empty();
}
-template <typename T>
+template <typename T>
void MsgSimpleQ<T>::clear()
{
q.clear();
}
-template <typename T>
+template <typename T>
bool MsgSimpleQ<T>::checkExist(T const & qItem, bool(cmp)(T const &, T const &))
{
- for(typename list<T>::iterator iterPos = q.begin(); iterPos != q.end(); ++iterPos) {
-
+ for (typename list<T>::iterator iterPos = q.begin(); iterPos != q.end(); ++iterPos) {
if (cmp(qItem, *iterPos) == true)
return true;
}
template <typename T>
void MsgSimpleQ<T>::remove(T const & qItem, bool(cmp)(T const &, T const &))
{
- for(typename list<T>::iterator iterPos = q.begin(); iterPos != q.end(); ) {
-
+ for (typename list<T>::iterator iterPos = q.begin(); iterPos != q.end(); ) {
if (cmp(qItem, *iterPos) == true)
q.erase(iterPos++);
else
++iterPos;
}
}
-#endif // __MsgThdSafeQ_H__
+#endif /* __MsgThdSafeQ_H__ */
{
MSG_MMS_HOME_RETRIEVE_TYPE_T homeNetwork; /**< Indicates the retrieve type for MMS home network. */
MSG_MMS_ABROAD_RETRIEVE_TYPE_T abroadNetwok; /**< Indicates the retrieve type for MMS abroad network. */
-// MSG_MMS_SEND_READ_REPORT_T readReceipt; /**< Indicates whether the read report will be sent or not. */
+#if 0
+ MSG_MMS_SEND_READ_REPORT_T readReceipt; /**< Indicates whether the read report will be sent or not. */
+#endif
bool readReceipt; /**< Indicates whether the read report will be sent or not. */
bool bDeliveryReceipt; /**< Indicates whether the delivery report will be sent or not. */
bool bRejectUnknown; /**< Indicates whether unknown addresses are rejected or not. */
{
MSG_OPTION_TYPE_T type; /**< The option type in a setting */
- union
- {
+ union {
MSG_GENERAL_OPT_S generalOpt; /**< General option */
MSG_SMS_SENDOPT_S smsSendOpt; /**< SMS send option */
MSG_SMSC_LIST_S smscList; /**< SMSC list option */
* @}
*/
-#endif // MSG_SETTING_TYPES_H
+#endif /* MSG_SETTING_TYPES_H */
*/
bool MsgSmilGenerateSmilDoc(MMS_MESSAGE_DATA_S *pstMsgMmsBody, char **ppSmilDoc);
-#endif//MSG_SMIL_H
+#endif /* MSG_SMIL_H */
char appid[MAX_WAPPUSH_ID_LEN];
} PUSH_APPLICATION_INFO_S;
-#endif // MSG_STORAGE_TYPES_H
+#endif /* MSG_STORAGE_TYPES_H */
public:
MsgThread(): thd(0) {};
- virtual void start()
- {
+ virtual void start() {
MSG_DEBUG("MsgThread::Start() called");
- if (pthread_create(&thd, NULL, &MsgThread::thdMain, this) < 0)
- {
+ if (pthread_create(&thd, NULL, &MsgThread::thdMain, this) < 0) {
MSG_DEBUG("pthread_create() error");
return;
}
pthread_detach(thd);
}
- virtual void stop()
- {
+ virtual void stop() {
MSG_DEBUG("MsgThread::stop() called");
}
- void wait()
- {
+ void wait() {
MSG_DEBUG("MsgThread::Wait() called");
void* pData;
pthread_join(thd, &pData);
}
private:
- static void* thdMain(void* pInst)
- {
+ static void* thdMain(void* pInst) {
MSG_DEBUG("MsgThread::thdMain() called");
MsgThread* pt = static_cast<MsgThread*>(pInst);
pt->run();
* @}
*/
-#endif // MSG_TRANSPORT_TYPES_H
+#endif /* MSG_TRANSPORT_TYPES_H */
/**
* @brief Defines the enabled MMS version
*/
-#define MMS_V1_2 // MMS Version : MMS_V1_0 / MMS_V1_1 / MMS_V1_2
+#define MMS_V1_2 /* MMS Version : MMS_V1_0 / MMS_V1_1 / MMS_V1_2 */
/**
* @brief Defines message struct handle.
*/
-typedef struct _msg_struct{
+typedef struct _msg_struct {
int type;
void *data;
}msg_struct_s;
bool bKeepCopy;
msg_struct_t mmsSendOpt;
msg_struct_t smsSendOpt;
-
} MSG_SENDINGOPT_S;
typedef enum
{
- MMS_TIMETYPE_NONE = -1, // fixme: backward compatibility
- MMS_TIMETYPE_ERROR = -1, // error return in Get method
- MMS_TIMETYPE_RELATIVE = 0, // default
+ MMS_TIMETYPE_NONE = -1, /**< fixme: backward compatibility */
+ MMS_TIMETYPE_ERROR = -1, /**< error return in Get method */
+ MMS_TIMETYPE_RELATIVE = 0, /**< default */
MMS_TIMETYPE_ABSOLUTE = 1
}MmsTimeType;
bool bDeliverReq;
bool bKeepCopy;
- union
- {
+ union {
MMS_SENDINGOPT_INFO_S mmsSendOptInfo;
SMS_SENDINGOPT_INFO_S smsSendOptInfo;
} option;
* @}
*/
-#endif // MSG_TYPES_H
+#endif /* MSG_TYPES_H */
==================================================================================================*/
#define MSG_SVC_PKG_NAME_BROWSER "org.tizen.browser"
-#endif // MSG_DELIVER_HANDLER_H
+#endif /* MSG_DELIVER_HANDLER_H */
msg_error_t getDefaultNetworkSimId(int *simId);
- // MMS handlers
+ /* MMS handlers */
msg_error_t addMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
msg_error_t updateMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, char *pFileData);
msg_error_t processReceivedInd(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_REQUEST_INFO_S *pRequest, bool *bReject);
msg_error_t restoreMsg(MSG_MESSAGE_INFO_S *pMsgInfo, char* pRecvBody, int rcvdBodyLen, char* filePath);
operator void*() const {
- return (mSupportedMsg==MSG_UNKNOWN_TYPE)? NULL:(void*) this;
+ return (mSupportedMsg == MSG_UNKNOWN_TYPE)? NULL:(void*) this;
}
private:
MSG_MAIN_TYPE_T mSupportedMsg;
MSG_PLUGIN_HANDLER_S mPlgHandler;
- void *mLibHandler; // plugin library pointer
+ void *mLibHandler; /* plugin library pointer */
};
MsgPluginMap plgMap;
};
-#endif // MSG_PLUGIN_MANAGER_H
+#endif /* MSG_PLUGIN_MANAGER_H */
msg_error_t MsgSetConfigInSim(const MSG_SETTING_S *pSetting);
msg_error_t MsgGetConfigInSim(MSG_SETTING_S *pSetting);
-//void MsgSetDefaultConfig();
+/* void MsgSetDefaultConfig(); */
#endif
msg_error_t MsgStoGetThreadInfo(msg_thread_id_t threadId, MSG_THREAD_VIEW_S *pThreadInfo);
-// Folder
+/* Folder */
msg_error_t MsgStoAddFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
msg_error_t MsgStoUpdateFolder(const MSG_FOLDER_INFO_S *pFolderInfo);
msg_error_t MsgStoDeleteFolder(msg_folder_id_t FolderId);
msg_error_t MsgStoGetFolderList(msg_struct_list_s *pFolderList);
-// Filter
+/* Filter */
msg_error_t MsgStoAddFilter(const MSG_FILTER_S *pFilter);
msg_error_t MsgStoUpdateFilter(const MSG_FILTER_S *pFilter);
msg_error_t MsgStoDeleteFilter(msg_filter_id_t FilterId);
msg_error_t MsgStoGetFilterList(msg_struct_list_s *pFilterList);
msg_error_t MsgStoSetFilterActivation(msg_filter_id_t filterId, bool bActive);
-// Sim Operation related Functions
+/* Sim Operation related Functions */
msg_error_t MsgStoClearSimMessageInDB();
-// Internal Function
+/* Internal Function */
msg_error_t MsgStoGetSmsSendOpt(MSG_MESSAGE_INFO_S *pMsg, MSG_SENDINGOPT_INFO_S* pSendOpt);
msg_error_t MsgStoGetMmsSendOpt(msg_message_id_t MsgId, MSG_SENDINGOPT_INFO_S* pSendOpt);
-// SyncML Msg
+/* SyncML Msg */
msg_error_t MsgStoGetSyncMLExtId(msg_message_id_t msgId, int *extId);
bool MsgStoCheckSyncMLMsgInThread(msg_thread_id_t threadId);
msg_error_t MsgStoSetReadReportSendStatus(msg_message_id_t msgId, int readReportSendStatus);
msg_error_t MsgStoGetReadReportSendStatus(msg_message_id_t msgId, int *pReadReportSendStatus);
-///////////////////////////////////////////////////////////////////////////////////
-// For MMS - will be removed
+/* For MMS - will be removed */
msg_error_t MsgStoGetOrgAddressList(MSG_MESSAGE_INFO_S *pMsg);
msg_error_t MsgStoGetSubject(msg_message_id_t MsgId, char* pSubject);
msg_error_t MsgStoGetRecipientList(msg_message_id_t msgId, MSG_RECIPIENTS_LIST_S *pRecipientList);
msg_error_t MsgStoGetReadStatus(msg_message_id_t MsgId, bool *pReadStatus);
msg_error_t MsgStoGetAddrInfo(msg_message_id_t MsgId, MSG_ADDRESS_INFO_S *pAddrInfo);
-///////////////////////////////////////////////////////////////////////////////////
msg_error_t MsgStoResetNetworkStatus();
#if 0
#endif
msg_error_t MsgStoUpdateIMSI(int sim_idx);
-#endif // MSG_STORAGE_HANDLER_H
+#endif /* MSG_STORAGE_HANDLER_H */
void MsgCopyReqInfo(MSG_REQUEST_INFO_S *pSrc, int addrIdx, MSG_REQUEST_INFO_S *pDest);
-#endif // MSG_SUBMIT_HANDLER_H
+#endif /* MSG_SUBMIT_HANDLER_H */
void workerEventQueue();
void write(int fd, const char* buf, int len);
- // methods for sent status event
+ /* methods for sent status event */
void insertSentMsg(int reqId, MSG_PROXY_INFO_S* pChInfo);
MSG_PROXY_INFO_S* getProxyInfo(int reqId);
void delProxyInfo(int reqId);
void handleRequest(int fd);
void cleanup(int fd);
-// bool checkPrivilege(MSG_CMD_TYPE_T CmdType, const char *pCookie);
+/* bool checkPrivilege(MSG_CMD_TYPE_T CmdType, const char *pCookie); */
bool checkPrivilege(int fd, MSG_CMD_TYPE_T CmdType);
static MsgTransactionManager* pInstance;
bool running;
handler_map handlerMap;
- sentmsg_map sentMsgMap; // req_id, listener_fd, msghandle_addr
- fd_map statusCBFdMap; // src_fd, true if registered
+ sentmsg_map sentMsgMap;
+ fd_map statusCBFdMap;
- newmsg_list newMsgCBList; // src_fd, msgType, port if registered
- mmsconf_list newMMSConfMsgCBList; // src_fd, msgType, port if registered
- pushmsg_list newPushMsgCBList; // src_fd, msgType, port if registered
- cbmsg_list newCBMsgCBList; // src_fd, msgType, port if registered
- syncmlmsg_list newSyncMLMsgCBList; // src_fd, msgType, port if registered
- lbsmsg_list newLBSMsgCBList; // src_fd, msgType, port if registered
- javamms_list javaMMSList; // trId list to distinguish sent Java MMS msg when sendconf received
- syncmlop_list operationSyncMLMsgCBList; // src_fd, msgType, port if registered
+ newmsg_list newMsgCBList;
+ mmsconf_list newMMSConfMsgCBList;
+ pushmsg_list newPushMsgCBList;
+ cbmsg_list newCBMsgCBList;
+ syncmlmsg_list newSyncMLMsgCBList;
+ lbsmsg_list newLBSMsgCBList;
+ javamms_list javaMMSList;
+ syncmlop_list operationSyncMLMsgCBList;
- fd_map storageChangeFdMap; // src_fd, true if registered
- fd_map reportMsgCBFdMap; // src_fd, true if registered
+ fd_map storageChangeFdMap;
+ fd_map reportMsgCBFdMap;
Mutex mx; /* mutex for shared resources like callback listeners */
Mutex mxQ; /* mutex for event queue */
enum cynara_user_creds user_method;
};
-#endif //MSG_TRANSACTION_MANAGER_H
+#endif /* MSG_TRANSACTION_MANAGER_H */
MSG_ERR("Feature [%s] not supported", (feature_name));\
return MSG_ERR_NOT_SUPPORTED; \
} \
- } while(0)
+ } while (0)
#define CHECK_MSG_SUPPORTED_RETURN_NULL(feature_name) \
do { \
MSG_ERR("Feature [%s] not supported", (feature_name));\
return NULL; \
} \
- } while(0)
+ } while (0)
/*==================================================================================================
FUNCTION PROTOTYPES
* This enum is used with storage change callback functions.
*/
enum _MSG_STORAGE_CHANGE_TYPE_E {
- // msg data
+ /* msg data */
MSG_STORAGE_CHANGE_INSERT = 1, /**< Indicates storage change by an INSERT operation*/
MSG_STORAGE_CHANGE_UPDATE, /**< Indicates storage change by an UPDATE operation*/
MSG_STORAGE_CHANGE_DELETE, /**< Indicates storage change by a DELETE operation*/
- // thread data
+ /* thread data */
MSG_STORAGE_CHANGE_CONTACT, /**< Indicates storage change by a CHANGE CONTACT operation*/
};
}
#endif
-#endif // MAPI_TRANSPORT_H
+#endif /* MAPI_TRANSPORT_H */
MSG_ERR_INVALID_STORAGE_ID = -4, /**< Storage ID is invalid */
MSG_ERR_INVALID_MSG_TYPE = -5, /**< Message type is invalid */
- MSG_ERR_INVALID_STORAGE_REG= -6, /**< Storage registry is invalid */
+ MSG_ERR_INVALID_STORAGE_REG = -6, /**< Storage registry is invalid */
MSG_ERR_INVALID_MESSAGE_ID = -7, /**< Message ID is invalid */
MSG_ERR_INVALID_MSGHANDLE = -8, /**< Message handle is invalid */
MSG_ERR_INVALID_PARAMETER = -9, /**< Parameter is invalid */
MSG_ERR_DB_PREPARE = -31, /**< DB prepare query error*/
MSG_ERR_DB_STEP = -32, /**< DB step query error*/
- MSG_ERR_DB_NORECORD= -33, /**< DB no-record error*/
+ MSG_ERR_DB_NORECORD = -33, /**< DB no-record error*/
MSG_ERR_DB_STORAGE_INIT = -34, /**< DB storage init error*/
MSG_ERR_DB_MAKE_DIR = -35, /**< mkdir error*/
MSG_ERR_DB_ROW = -36, /**< DB step() has another row ready */
MSG_ERR_DB_DONE = -37, /**< DB step() has finished executing */
- MSG_ERR_DB_GENERIC= -38, /**< Generic DB error*/
+ MSG_ERR_DB_GENERIC = -38, /**< Generic DB error*/
MSG_ERR_DB_END = -39, /**< DB end error*/
/* End Database Errors */
MIME_TYPE_VALUE_MAX = 0x7207, /**< Indicates the maximum MIME type */
MIME_UNKNOWN = 0xffff /**< Indicates the unknown MIME type */
-
} MimeType;
/**
MMS_SMIL_TRANS_IRISWIPE = 7, /**< Indicates the iris wipe transition */
MMS_SMIL_TRANS_BOXWIPE = 8, /**< Indicates the box wipe transition */
MMS_SMIL_TRANS_FOURBOXWIPE = 9, /**< Indicates the four box wipe transition */
- MMS_SMIL_TRANS_PUSHWIPE =10, /**< Indicates the push wipe transition */
+ MMS_SMIL_TRANS_PUSHWIPE = 10, /**< Indicates the push wipe transition */
MMS_SMIL_TRANS_ELLIPSEWIPE = 11 /**< Indicates the ellipse wipe transition */
}MmsSmilTransType;
void MsgDeInitCallStatusManager();
int MsgGetCallStatus();
-#endif // MSG_CALL_STATUS_MANAGER_H
+#endif /* MSG_CALL_STATUS_MANAGER_H */
#include "MsgStorageTypes.h"
#include "MsgInternalTypes.h"
-
-
-//contacts-service is not used for gear
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
/*==================================================================================================
FUNCTION PROTOTYPES
void MsgDeletePhoneLog(msg_message_id_t msgId);
bool checkBlockingMode(char *address, bool *pisFavorites);
-#endif //MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
int MsgContactGetMinMatchDigit();
void MsgConvertNumber(const char* pSrcNum, char* pDestNum, int destSize);
bool MsgIsNumber(const char* pSrc);
-#endif //MSG_CONTACT_H
+#endif /* MSG_CONTACT_H */
/*log macros*/
#define MSG_BEGIN()\
- do\
- {\
+ do { \
SLOGD(" BEGIN >>>> \n");\
- } while(0)
+ } while (0)
#define MSG_END()\
- do\
- {\
+ do { \
SLOGD(" END <<<< \n");\
- } while(0)
+ } while (0)
#define MSG_DEBUG(fmt, ...)\
- do\
- {\
+ do { \
SLOGD(fmt"\n", ##__VA_ARGS__);\
- } while(0)
+ } while (0)
#define MSG_INFO(fmt, ...)\
- do\
- {\
+ do { \
SLOGI("* Info * " fmt "\n", ##__VA_ARGS__);\
- } while(0)
+ } while (0)
#define MSG_WARN(fmt, ...)\
- do\
- {\
+ do { \
SLOGW("* Warning * " fmt "\n", ##__VA_ARGS__);\
- } while(0)
+ } while (0)
#define MSG_ERR(fmt, ...)\
- do\
- {\
+ do { \
SLOGE("* Error * " fmt "\n", ##__VA_ARGS__);\
- } while(0)
+ } while (0)
#define MSG_FATAL(fmt, ...)\
- do\
- {\
+ do { \
SLOGE(" ERROR << " fmt " >>\n", ##__VA_ARGS__);\
- } while(0)
+ } while (0)
/*secure log macros*/
#define MSG_SEC_DEBUG(fmt, ...)\
- do\
- {\
+ do { \
SECURE_SLOGD(fmt"\n", ##__VA_ARGS__);\
} while (0)
#define MSG_SEC_INFO(fmt, ...)\
- do\
- {\
+ do { \
SECURE_SLOGI("* Info * " fmt"\n", ##__VA_ARGS__);\
} while (0)
#define MSG_SEC_ERR(fmt, ...)\
- do\
- {\
+ do { \
SECURE_LOG(LOG_ERROR, LOG_TAG, "* Error *" fmt "\n", ##__VA_ARGS__);\
} while (0)
/*valid data log macros*/
#define MSG_SMS_VLD_INFO(fmt, ...)\
- do\
- {\
+ do { \
SLOG(LOG_DEBUG, MSG_SMS_VALID_TAG, "[SMS INFO]%s, " fmt "\n", __TIMESTAMP__, ##__VA_ARGS__);\
} while (0)
#define MSG_SMS_VLD_TXT(fmt, ...)\
- do\
- {\
+ do { \
SLOG(LOG_DEBUG, MSG_SMS_VALID_TAG, "[SMS_TEXT]%s, " fmt "\n", __TIMESTAMP__, ##__VA_ARGS__);\
} while (0)
#define MSG_MMS_VLD_INFO(fmt, ...)\
- do\
- {\
+ do { \
SLOG(LOG_DEBUG, MSG_MMS_VALID_TAG, "[MMS INFO]%s, " fmt "\n", __TIMESTAMP__, ##__VA_ARGS__);\
} while (0)
#define MSG_MMS_VLD_TXT(fmt, ...)\
- do\
- {\
+ do { \
SLOG(LOG_DEBUG, MSG_MMS_VALID_TAG, "[MMS TEXT]%s, " fmt "\n", __TIMESTAMP__, ##__VA_ARGS__);\
} while (0)
#define MSG_MMS_VLD_FILE(fmt, ...)\
- do\
- {\
+ do { \
SLOG(LOG_DEBUG, MSG_MMS_VALID_TAG, "[MMS FILE]%s, " fmt "\n", __TIMESTAMP__, ##__VA_ARGS__);\
} while (0)
/*err & warn return message log macros*/
#define MSG_ERR_RET_VM(expr, val, fmt, ...)\
- do\
- {\
+ do { \
if (expr) {\
MSG_ERR(fmt, ##__VA_ARGS__);\
return (val);\
}\
- } while(0)
+ } while (0)
#define MSG_ERR_RET_M(expr, fmt, ...)\
- do\
- {\
+ do { \
if (expr) {\
MSG_ERR(fmt, ##__VA_ARGS__);\
return;\
}\
- } while(0)
+ } while (0)
#define MSG_WARN_M(expr, fmt, ...)\
- do\
- {\
+ do { \
if (expr) {\
MSG_WARN(fmt, ##__VA_ARGS__);\
}\
- } while(0)
+ } while (0)
/*profile log macros*/
#define MSG_PROFILE_BEGIN(pfid) \
long __ds = __prf_2_##pfid.tv_sec - __prf_1_##pfid.tv_sec;\
long __dm = __prf_2_##pfid.tv_usec - __prf_1_##pfid.tv_usec;\
if ( __dm < 0 ) { __ds--; __dm = 1000000 + __dm; } \
- SLOGD("**PROFILE** [MSGFW: %s: %s() %u ~ %u] " #pfid " -> Elapsed Time: %u.%06u seconds\n",\
- rindex(__FILE__, '/')+1,\
+ SLOGD("**PROFILE** [MSGFW: %s: %s() %u ~ %u] " #pfid " -> Elapsed Time: %u.%06u seconds\n", \
+ rindex(__FILE__, '/')+1, \
__FUNCTION__, \
- __prf_l1_##pfid,\
- __prf_l2_##pfid,\
- (unsigned int)(__ds),\
+ __prf_l1_##pfid, \
+ __prf_l2_##pfid, \
+ (unsigned int)(__ds), \
(unsigned int)(__dm));\
} while (0)
int get_tid();
#define MSG_FATAL(fmt, ...) \
- do \
- {\
+ do { \
printf("\n[%d] [MSGFW: %s: %s(): %d] *FAILED* << " fmt" >>\n", get_tid(), rindex(__FILE__, '/')+1, __FUNCTION__, __LINE__, ##__VA_ARGS__);\
} while (0)
#define MSG_DEBUG(fmt, ...) \
- do\
- {\
+ do { \
printf("\n[%d] [MSGFW: %s: %s(): %d] " fmt"\n", get_tid(), rindex(__FILE__, '/')+1, __FUNCTION__, __LINE__, ##__VA_ARGS__);\
} while (0)
#define MSG_BEGIN() \
- do\
- {\
- printf("\n[%d] BEGIN >>>> %s() at [MSGFW: %s: %d]\n", get_tid(),__FUNCTION__, rindex(__FILE__, '/')+1, __LINE__ );\
- } while( 0 )
+ do { \
+ printf("\n[%d] BEGIN >>>> %s() at [MSGFW: %s: %d]\n", get_tid(), __FUNCTION__, rindex(__FILE__, '/')+1, __LINE__);\
+ } while (0)
#define MSG_END() \
- do\
- {\
+ do { \
printf("\n[%d] END <<<< %s() at [MSGFW: %s: %d]\n", get_tid(), __FUNCTION__, rindex(__FILE__, '/')+1, __LINE__); \
} \
- while( 0 )
+ while (0)
#define MSG_PROFILE_BEGIN(pfid) \
unsigned int __prf_l1_##pfid = __LINE__; \
#define MSG_FREE(x) \
({\
- if (x != NULL){\
+ if (x != NULL) {\
free(x);\
x = NULL;}\
})
const char * MsgDbgCmdStr(MSG_CMD_TYPE_T cmdType);
const char * MsgDbgEvtStr(MSG_EVENT_TYPE_T evtType);
-#endif //__MSG_DEBUG_H__
+#endif /*__MSG_DEBUG_H__ */
/*==================================================================================================
DEFINES
==================================================================================================*/
-#define THROW(errCode, debugFmt,...) \
+#define THROW(errCode, debugFmt, ...) \
do {\
char __debugBuf[256];\
snprintf(__debugBuf, 256, debugFmt, ##__VA_ARGS__);\
MsgException e(errCode, __debugBuf);\
MSG_FATAL("%s [%d]", e.what(), e.errorCode());\
throw e; \
-} while(0)
+} while (0)
/*==================================================================================================
CLASS DEFINITIONS
==================================================================================================*/
-class MsgException : public runtime_error //public exception
+class MsgException : public runtime_error /* public exception */
{
public:
MsgException(int errCode, const string& msg = "")
- : runtime_error( errorStrings[errCode] + " : " + msg), eCode(errCode)
- {}
+ : runtime_error(errorStrings[errCode] + " : " + msg), eCode(errCode) {
+ }
enum
{
SERVER_READY_ERROR = 13,
REQ_EXIST_ERROR,
- // dont erase NUM_ERRORS. place a new error code in ahead of NUM_ERRORS
+ /* dont erase NUM_ERRORS. place a new error code in ahead of NUM_ERRORS */
NUM_ERRORS
};
int eCode;
};
-#endif //#ifndef __MSG_EXCEPTION_H__
+#endif /* __MSG_EXCEPTION_H__ */
#ifndef MSG_GCONF_WRAPPER_H
#define MSG_GCONF_WRAPPER_H
-//#define USE_GCONF
+/* #define USE_GCONF */
/*==================================================================================================
INCLUDE FILES
==================================================================================================*/
void MsgSettingRegVconfCBCommon(const char *pKey, _vconf_change_cb pCb);
void MsgSettingRemoveVconfCBCommon(const char *pKey, _vconf_change_cb pCb);
-#endif // MSG_GCONF_WRAPPER_H
+#endif /* MSG_GCONF_WRAPPER_H */
{
public:
MsgIpcClientSocket();
-// ~MsgIpcClientSocket();
+/* ~MsgIpcClientSocket(); */
int maxFd() { return (maxfd+1); }
fd_set fdSet() { return fds; }
void addfd(int fd);
int getRemoteFd() {return remotefd; }
private:
- int readn(char *buf, unsigned int len );
- int writen (const char *buf, unsigned int len);
+ int readn(char *buf, unsigned int len);
+ int writen(const char *buf, unsigned int len);
bool wait_for_reply();
int sockfd, remotefd, maxfd;
void close(int fd);
/* read msg from client of fd */
- int read(int fd, char** buf, int* len );
+ int read(int fd, char** buf, int* len);
/* write msg to ipc client */
int write(int fd, const char* buf, unsigned int len);
void addfd(int fd);
void setSockfd(int fd) { sockfd = fd; }
private:
- int readn(int fd, char *buf, unsigned int len );
- int writen (int fd, const char *buf, unsigned int len);
+ int readn(int fd, char *buf, unsigned int len);
+ int writen(int fd, const char *buf, unsigned int len);
/* server socket fd */
int sockfd;
std::map<int, int> mapFds;
};
-#endif //__IPCSocket_H__
+#endif /*__IPCSocket_H__ */
char* msg_json_gen_make_json_msg(msg_json_gen_object *root_obj, unsigned long *len);
#define MSG_JSON_OBJ_SET_STR(json_obj, key, val)\
- if(json_obj && key && val){\
+ if (json_obj && key && val) {\
json_object_set_string_member(json_obj, key, val);\
} else {\
MSG_DEBUG("Error : json_obj = %p, key = %s, val = %s", json_obj, key, val);\
}
#define MSG_JSON_OBJ_SET_INT(json_obj, key, val)\
- if(json_obj && key){\
+ if (json_obj && key) {\
json_object_set_int_member(json_obj, key, val);\
} else {\
MSG_DEBUG("Error : json_obj = %p, key = %s, val = %d", json_obj, key, val);\
}
#define MSG_JSON_OBJ_SET_OBJ(json_obj, key, val)\
- if(json_obj && key){\
+ if (json_obj && key) {\
json_object_set_object_member(json_obj, key, val);\
} else {\
MSG_DEBUG("Error : json_obj = %p, key = %s, val = %p", json_obj, key, val);\
}
#define MSG_JSON_OBJ_SET_ARRAY(json_obj, key, json_array)\
- if(json_obj && key && json_array){\
+ if (json_obj && key && json_array) {\
json_object_set_array_member(json_obj, key, json_array);\
} else {\
MSG_DEBUG("Error : json_obj = %p, key = %s, json_array = %p", json_obj, key, json_array);\
}
#define MSG_JSON_ARRAY_ADD_OBJECT(json_array, json_obj)\
- if(json_array && json_obj){\
+ if (json_array && json_obj) {\
json_array_add_object_element(json_array, json_obj);\
} else {\
MSG_DEBUG("Error : json_array = %p, json_obj = %p", json_array, json_obj);\
#define GETSP() ({ unsigned int sp; asm volatile ("mov %0,sp " : "=r"(sp) ); sp;})
#define BUF_SIZE 256
#define PAGE_SIZE (1 << 12)
-#define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1)))
-#define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1)))
+#define _ALIGN_UP(addr, size) (((addr)+((size)-1))&(~((size)-1)))
+#define _ALIGN_DOWN(addr, size) ((addr)&(~((size)-1)))
#define PAGE_ALIGN(addr) _ALIGN_DOWN(addr, PAGE_SIZE)
sp = GETSP();
- snprintf(buf, BUF_SIZE, "/proc/%d/maps",getpid());
- file = fopen(buf,"r");
- while(fgets(buf, BUF_SIZE, file) != NULL) {
- if(strstr(buf, "[stack]")){
+ snprintf(buf, BUF_SIZE, "/proc/%d/maps", getpid());
+ file = fopen(buf, "r");
+ while (fgets(buf, BUF_SIZE, file) != NULL) {
+ if (strstr(buf, "[stack]")) {
found = 1;
break;
}
fclose(file);
if(found) {
- sscanf(buf,"%x-",&stacktop);
+ sscanf(buf, "%x-", &stacktop);
if(madvise((void*)PAGE_ALIGN(stacktop), PAGE_ALIGN(sp)-stacktop, MADV_DONTNEED) < 0)
perror("stack madvise fail");
}
void MsgReleaseMemory();
-#endif // __MSG_MEMORY_H__
+#endif /* __MSG_MEMORY_H__ */
int MsgMmsReleaseMultipartList(MMSList **ppMultipartList);
-int MsgMmsGetSmilMultipart(MMSList *pMultipartList, MMS_MULTIPART_DATA_S **smil_multipart);//TODO : delete
+int MsgMmsGetSmilMultipart(MMSList *pMultipartList, MMS_MULTIPART_DATA_S **smil_multipart); /*TODO : delete */
int MsgMmsConvertMmsDataToMmsMessageData(MMS_DATA_S *pSrc, MMS_MESSAGE_DATA_S *pDst);
int MsgMmsSetMultipartListFilePath(const char *dirPath, MMS_DATA_S *pMmsData);
int printMultipart(MMS_MULTIPART_DATA_S *multipart);
-int printMultipartList(MMSList *pMultipartList);//for debug
+int printMultipartList(MMSList *pMultipartList); /*for debug */
void _MsgMmsMultipartPrint(MMS_MULTIPART_DATA_S *multipart);
int MsgMmsCheckFilepathSmack(int fd, const char *ipc_filename);
-#endif // MSG_MMS_MESSAGE_H
+#endif /* MSG_MMS_MESSAGE_H */
class Mutex
{
public:
- Mutex(){
+ Mutex() {
pthread_mutexattr_t mattr;
pthread_mutexattr_init(&mattr);
pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&m, &mattr);
pthread_mutexattr_destroy(&mattr);
}
- ~Mutex(){ pthread_mutex_destroy(&m); }
- void lock(){ pthread_mutex_lock(&m); }
+ ~Mutex() { pthread_mutex_destroy(&m); }
+ void lock() { pthread_mutex_lock(&m); }
- int timedlock(){
+ int timedlock() {
struct timespec abs_time;
clock_gettime(CLOCK_REALTIME, &abs_time);
abs_time.tv_sec += 1;
return pthread_mutex_timedlock(&m, &abs_time);
}
- void unlock(){ pthread_mutex_unlock(&m); }
+ void unlock() { pthread_mutex_unlock(&m); }
pthread_mutex_t* pMutex() { return &m; }
private:
class MutexLocker
{
public:
- MutexLocker(Mutex& mx)
- {
+ MutexLocker(Mutex& mx) {
pm = &mx;
pm->lock();
}
- ~MutexLocker()
- {
+ ~MutexLocker() {
pm->unlock();
}
class CndVar
{
public:
- CndVar(){ pthread_cond_init(&c, 0); }
+ CndVar() { pthread_cond_init(&c, 0); }
void wait(pthread_mutex_t* m) { pthread_cond_wait(&c, m); }
- int timedwait(pthread_mutex_t* m, int sec)
- {
+ int timedwait(pthread_mutex_t* m, int sec) {
struct timeval now = {0};
struct timespec timeout = {0};
gettimeofday(&now, NULL);
int retcode = pthread_cond_timedwait(&c, m, &timeout);
return retcode;
}
- void signal(){ pthread_cond_signal(&c); }
- void broadcast(){ pthread_cond_broadcast(&c); }
+ void signal() { pthread_cond_signal(&c); }
+ void broadcast() { pthread_cond_broadcast(&c); }
private:
pthread_cond_t c;
};
-#endif //__MUTEX_H__
+#endif /* __MUTEX_H__ */
int MsgSerializeMms(const MMS_DATA_S *pMsgData, char **pValue);
int MsgDeserializeMmsData(char* value, int value_len, MMS_DATA_S **ppMmsData);
-#endif //MSG_MMS_SERIALIZE_H
+#endif /* MSG_MMS_SERIALIZE_H */
void getColumnToString(int RowIndex, int Length, char *pString);
msg_error_t getRowId(const char *pTableName, unsigned int *pRowId);
void getMmapMutex(const char *shm_file_name);
- void shm_mutex_timedlock (int sec);
+ void shm_mutex_timedlock(int sec);
void shm_mutex_unlock();
private:
MsgDbHandler *getDbHandle();
void removeDbHandle();
-#endif // MSG_SQLITE_WRAPPER_H
+#endif /* MSG_SQLITE_WRAPPER_H */
==================================================================================================*/
#include <map>
-//#include "SmsPluginTypes.h"
-
/*==================================================================================================
DEFINES
} MSG_LOCKING_SHIFT_S;
-// ETSI GSM 03.38 GSM 7 bit Default Alphabet Table -> UCS2
+/* ETSI GSM 03.38 GSM 7 bit Default Alphabet Table -> UCS2 */
static const WCHAR g_GSM7BitToUCS2[] =
{
/* @ */
};
-//GSM 7 bit Default Alphabet Extension Table -> UCS2
+/* GSM 7 bit Default Alphabet Extension Table -> UCS2 */
static const WCHAR g_GSM7BitExtToUCS2[] =
{
- // 0x0020 -> (SP) for invalid code
+ /* 0x0020 -> (SP) for invalid code */
/* Page Break */
0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x000C, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
/* ^ */
};
-//Turkish National Language Single Shift Table -> UCS2
+/* Turkish National Language Single Shift Table -> UCS2 */
static const WCHAR g_TurkishSingleToUCS2[] =
{
- // 0x0020 -> (SP) for invalid code
+ /* 0x0020 -> (SP) for invalid code */
/* Page Break */
0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x000C, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
/* ^ */
};
-// Turkish National Language Locking Shift Table -> UCS2
+/* Turkish National Language Locking Shift Table -> UCS2 */
static const WCHAR g_TurkishLockingToUCS2[] =
{
/* @ */
};
-// Spanish National Language Single Shift Table -> UCS2
+/* Spanish National Language Single Shift Table -> UCS2 */
static const WCHAR g_SpanishSingleToUCS2[] =
{
- // 0x0020 -> (SP) for invalid code
+ /* 0x0020 -> (SP) for invalid code */
/* Page Break */
0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x00E7, 0x000C, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
/* ^ */
};
-// Portuguese National Language Single Shift Table -> UCS2
+/* Portuguese National Language Single Shift Table -> UCS2 */
static const WCHAR g_PortuSingleToUCS2[] =
{
- // 0x0020 -> (SP) for invalid code
+ /* 0x0020 -> (SP) for invalid code */
/* Page Break */
0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x00EA, 0x0020, 0x0020, 0x0020, 0x00E7, 0x000C, 0x00D4, 0x00F4, 0x0020, 0x00C1, 0x00E1,
/* ^ */
};
-// Portuguese National Language Locking Shift Table -> UCS2
+/* Portuguese National Language Locking Shift Table -> UCS2 */
static const WCHAR g_PortuLockingToUCS2[] =
{
/* @ */
std::map<unsigned short, unsigned char> ucs2toPortuList;
std::map<unsigned short, unsigned char> replaceCharList;
-
};
-#endif //MSG_TEXT_CONVERT_H
-
+#endif /* MSG_TEXT_CONVERT_H */
/*==================================================================================================
FUNCTION PROTOTYPES
==================================================================================================*/
-//File Util
bool MakeThumbnail(char *srcPath, char *dstPath);
/** file operation wrapper - for avoding runtime error */
FILE* MsgOpenFile(const char* filepath, const char* opt);
bool MsgCreateFileName(char *pFileName);
bool MsgOpenAndReadFile(const char *pFileName, char **ppData, int *pDataSize);
bool MsgReadFileForDecode(FILE* pFile, char* pBuf, int length, int* nSize);
-bool MsgWriteDataFromEncodeBuffer(FILE* pFile, char* pInBuffer, int *pPtr, int maxLen, int* pOffset );
+bool MsgWriteDataFromEncodeBuffer(FILE* pFile, char* pInBuffer, int *pPtr, int maxLen, int* pOffset);
bool MsgWriteIpcFile(const char *pFileName, const char *pData, int DataSize);
void MsgDeleteFile(const char *pFileName);
bool MsgGetFileSize(const char *pFilePath, int* nSize);
int MsgGetFileSize(const char *pFileName);
FILE* MsgOpenMMSFile(char *pFileName);
bool MsgOpenCreateAndOverwriteFile(char *pFullPath, char *pBuff, int TotalLength);
-char* MsgOpenAndReadMmsFile(const char* szFilePath, int offset, int size, int* npSize );
-bool MsgWriteSmilFile(const char *pFilePath,char *pData, int DataSize);
+char* MsgOpenAndReadMmsFile(const char* szFilePath, int offset, int size, int* npSize);
+bool MsgWriteSmilFile(const char *pFilePath, char *pData, int DataSize);
int MsgReadSmilFile(const char *pFileName, char **ppData);
void MsgDeleteSmilFile(const char *pFilePath);
int MsgRmRf(char *pDirPath);
bool MsgAccessFile(const char *filepath, int mode);
bool MsgChmod(const char *filepath, int mode);
bool MsgChown(const char *filepath, int uid, int gid);
-bool MsgCreateFile(const char *pFilePath,char *pData, int DataSize);
+bool MsgCreateFile(const char *pFilePath, char *pData, int DataSize);
char *MsgGetDirName(char *file_path);
char *MsgGetFileName(char *file_path);
int MsgCheckFilepathSmack(const char *app_smack_label, char *file_path);
bool MsgScanFile(char *filePath);
void MsgGetMimeType(char *filePath, char *mimeType, int size);
-#endif // MSG_UTIL_FILE_H
+#endif /* MSG_UTIL_FILE_H */
bool MsgCheckFeatureSupport(const char *feature_name);
-// Encoders
+/* Encoders */
int MsgEncodeCountInfo(MSG_COUNT_INFO_S *pCountInfo, char **ppDest);
int MsgEncodeCountByMsgType(int MsgCount, char **ppDest);
int MsgEncodeThreadInfo(MSG_THREAD_VIEW_S *pThreadInfo, char **ppDest);
-// Decoders
+/* Decoders */
void MsgDecodeMsgId(char *pSrc, msg_message_id_t *pMsgId);
void MsgDecodeCountInfo(char *pSrc, MSG_COUNT_INFO_S *pCountInfo);
void MsgDecodeThreadInfo(char *pSrc, MSG_THREAD_VIEW_S *pThreadInfo);
-// Event Encoder
+/* Event Encoder */
int MsgMakeEvent(const void *pData, int DataSize, MSG_EVENT_TYPE_T MsgEvent, msg_error_t MsgError, void **ppEvent);
-// Utin functions
+/* Util functions */
int msg_verify_number(const char *raw, char *trimmed);
int msg_verify_email(const char *raw);
void MsgDbusInit();
void MsgDbusDeinit();
-#endif // MSG_UTIL_FUNCTION_H
+#endif /* MSG_UTIL_FUNCTION_H */
/*==================================================================================================
FUNCTION PROTOTYPES
==================================================================================================*/
-// Common Function
-
+/* Common Function */
unsigned int MsgStoAddMessageTable(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsgInfo);
msg_error_t MsgStoSetReadStatus(MsgDbHandler *pDbHandle, msg_message_id_t MsgId, bool bRead);
msg_error_t MsgStoGetOldestMessage(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsgInfo, msg_message_id_t *pMsgId);
msg_error_t MsgStoCheckMsgCntFull(MsgDbHandler *pDbHandle, const MSG_MESSAGE_TYPE_S* pMsgType, msg_folder_id_t FolderId);
-msg_error_t MsgStoCountMsgByLimitCategory(MsgDbHandler *pDbHandle, const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount, msg_folder_id_t folderId );
+msg_error_t MsgStoCountMsgByLimitCategory(MsgDbHandler *pDbHandle, const MSG_MESSAGE_TYPE_S *pMsgType, int *pMsgCount, msg_folder_id_t folderId);
msg_error_t MsgStocheckMemoryStatus();
int MsgStoCheckMsgCntLimit(const MSG_MESSAGE_TYPE_S* pMsgType, msg_folder_id_t FolderId);
msg_error_t MsgStoAddAddress(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsg, msg_thread_id_t *pConvId);
-//contacts-service is not used for gear
+/* contacts-service is not used for gear */
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
msg_error_t MsgStoGetAddressByMsgId(MsgDbHandler *pDbHandle, msg_message_id_t msgId, int contactNameOrder, int *nAddressCnt, MSG_ADDRESS_INFO_S **pAddress);
msg_error_t MsgStoGetAddressByMsgId(MsgDbHandler *pDbHandle, msg_message_id_t msgId, int contactNameOrder, msg_struct_list_s *pAddress);
msg_error_t MsgStoGetAddressByConvId(MsgDbHandler *pDbHandle, msg_thread_id_t convId, int contactNameOrder, msg_struct_list_s *pAddrlist);
-#else // MSG_CONTACTS_SERVICE_NOT_SUPPORTED
-//contactNameOrder is never used
+#else /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
+/* contactNameOrder is never used */
msg_error_t MsgStoGetAddressByMsgId(MsgDbHandler *pDbHandle, msg_message_id_t msgId, int *nAddressCnt, MSG_ADDRESS_INFO_S **pAddress);
msg_error_t MsgStoGetAddressByMsgId(MsgDbHandler *pDbHandle, msg_message_id_t msgId, msg_struct_list_s *pAddress);
msg_error_t MsgStoGetAddressByConvId(MsgDbHandler *pDbHandle, msg_thread_id_t convId, msg_struct_list_s *pAddrlist);
-#endif //MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
void MsgStoUpdateAddress(MsgDbHandler *pDbHandle, const MSG_MESSAGE_INFO_S *pMsg, msg_thread_id_t convId);
msg_error_t MsgStoAddConversation(MsgDbHandler *pDbHandle, msg_thread_id_t *pConvId);
bool MsgStoCheckReadReportIsSent(MsgDbHandler *pDbHandle, msg_message_id_t MsgId);
msg_error_t MsgStoUpdateNetworkStatus(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S *pMsgInfo, msg_network_status_t status);
-// Lists
+/* Lists */
msg_error_t MsgStoGetThreadViewList(const MSG_SORT_RULE_S *pSortRule, msg_struct_list_s *pThreadViewList);
msg_error_t MsgStoGetConversationViewItem(msg_message_id_t msgId, MSG_CONVERSATION_VIEW_S *pConv);
msg_error_t MsgStoGetConversationViewList(msg_thread_id_t ThreadId, msg_struct_list_s *pConvViewList);
msg_error_t MsgStoClearUniquenessTable();
#endif
-#endif // MSG_UTIL_STORAGE_H
+#endif /* MSG_UTIL_STORAGE_H */
msg_error_t MsgVMessageDecodeSMS(const char *vmsg_stream, MSG_MESSAGE_INFO_S *pMsg);
bool _convert_vdata_str_to_tm(const char* szText, struct tm * tm);
-#endif //MSG_VMESSAGE_H
+#endif /* MSG_VMESSAGE_H */
MSG_FILTER_S *filter_data = (MSG_FILTER_S *)filter;
switch (field) {
- case MSG_FILTER_ACTIVE_BOOL :
+ case MSG_FILTER_ACTIVE_BOOL:
*value = filter_data->bActive;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_FILTER_S *filter_data = (MSG_FILTER_S *)filter;
switch (field) {
- case MSG_FILTER_ID_INT :
+ case MSG_FILTER_ID_INT:
*value = filter_data->filterId;
break;
- case MSG_FILTER_TYPE_INT :
+ case MSG_FILTER_TYPE_INT:
*value = filter_data->filterType;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_FILTER_S *filter_data = (MSG_FILTER_S *)filter;
switch (field) {
- case MSG_FILTER_VALUE_STR :
+ case MSG_FILTER_VALUE_STR:
strncpy(value, filter_data->filterValue, size);
break;
- default :
+ default:
return MSG_ERR_INVALID_PARAMETER;
}
MSG_FILTER_S *filter_data = (MSG_FILTER_S *)filter;
switch (field) {
- case MSG_FILTER_ACTIVE_BOOL :
+ case MSG_FILTER_ACTIVE_BOOL:
filter_data->bActive = value;
break;
- default :
+ default:
return MSG_ERR_INVALID_PARAMETER;
}
MSG_FILTER_S *filter_data = (MSG_FILTER_S *)filter;
switch (field) {
- case MSG_FILTER_ID_INT :
+ case MSG_FILTER_ID_INT:
filter_data->filterId = value;
break;
- case MSG_FILTER_TYPE_INT :
+ case MSG_FILTER_TYPE_INT:
filter_data->filterType = value;
break;
- default :
+ default:
return MSG_ERR_INVALID_PARAMETER;
}
MSG_FILTER_S *filter_data = (MSG_FILTER_S *)filter;
switch (field) {
- case MSG_FILTER_VALUE_STR :
- {
+ case MSG_FILTER_VALUE_STR: {
int len = (size > MAX_FILTER_VALUE_LEN)?MAX_FILTER_VALUE_LEN:size;
strncpy(filter_data->filterValue, value, len);
break;
}
- default :
+ default:
return MSG_ERR_INVALID_PARAMETER;
}
msg->msgId = 0;
msg->threadId = 0;
msg->folderId = MSG_DRAFT_ID;
- msg->mainType= MSG_SMS_TYPE;
+ msg->mainType = MSG_SMS_TYPE;
msg->subType = MSG_NORMAL_SMS;
msg->classType = MSG_CLASS_NONE;
msg->storageId = MSG_STORAGE_PHONE;
MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
switch (field) {
- case MSG_MESSAGE_ID_INT :
+ case MSG_MESSAGE_ID_INT:
*value = msg_data->msgId;
break;
- case MSG_MESSAGE_THREAD_ID_INT :
+ case MSG_MESSAGE_THREAD_ID_INT:
*value = msg_data->threadId;
break;
- case MSG_MESSAGE_FOLDER_ID_INT :
+ case MSG_MESSAGE_FOLDER_ID_INT:
*value = msg_data->folderId;
break;
- case MSG_MESSAGE_TYPE_INT :
- {
+ case MSG_MESSAGE_TYPE_INT: {
if (msg_data->mainType == MSG_SMS_TYPE) {
switch (msg_data->subType) {
- case MSG_CB_SMS :
+ case MSG_CB_SMS:
*value = MSG_TYPE_SMS_CB;
break;
- case MSG_JAVACB_SMS :
+ case MSG_JAVACB_SMS:
*value = MSG_TYPE_SMS_JAVACB;
break;
- case MSG_WAP_SI_SMS :
- case MSG_WAP_SL_SMS :
+ case MSG_WAP_SI_SMS:
+ case MSG_WAP_SL_SMS:
*value = MSG_TYPE_SMS_WAPPUSH;
break;
- case MSG_MWI_VOICE_SMS :
- case MSG_MWI_FAX_SMS :
- case MSG_MWI_EMAIL_SMS :
- case MSG_MWI_OTHER_SMS :
+ case MSG_MWI_VOICE_SMS:
+ case MSG_MWI_FAX_SMS:
+ case MSG_MWI_EMAIL_SMS:
+ case MSG_MWI_OTHER_SMS:
*value = MSG_TYPE_SMS_MWI;
break;
- case MSG_SYNCML_CP :
+ case MSG_SYNCML_CP:
*value = MSG_TYPE_SMS_SYNCML;
break;
- case MSG_REJECT_SMS :
+ case MSG_REJECT_SMS:
*value = MSG_TYPE_SMS_REJECT;
break;
- case MSG_ETWS_SMS :
+ case MSG_ETWS_SMS:
*value = MSG_TYPE_SMS_ETWS_PRIMARY;
break;
- case MSG_CMAS_PRESIDENTIAL :
+ case MSG_CMAS_PRESIDENTIAL:
*value = MSG_TYPE_SMS_CMAS_PRESIDENTIAL;
break;
- case MSG_CMAS_EXTREME :
+ case MSG_CMAS_EXTREME:
*value = MSG_TYPE_SMS_CMAS_EXTREME;
break;
- case MSG_CMAS_SEVERE :
+ case MSG_CMAS_SEVERE:
*value = MSG_TYPE_SMS_CMAS_SEVERE;
break;
- case MSG_CMAS_AMBER :
+ case MSG_CMAS_AMBER:
*value = MSG_TYPE_SMS_CMAS_AMBER;
break;
- case MSG_CMAS_TEST :
+ case MSG_CMAS_TEST:
*value = MSG_TYPE_SMS_CMAS_TEST;
break;
- case MSG_CMAS_EXERCISE :
+ case MSG_CMAS_EXERCISE:
*value = MSG_TYPE_SMS_CMAS_EXERCISE;
break;
- case MSG_CMAS_OPERATOR_DEFINED :
+ case MSG_CMAS_OPERATOR_DEFINED:
*value = MSG_TYPE_SMS_CMAS_OPERATOR_DEFINED;
break;
- default :
+ default:
*value = MSG_TYPE_SMS;
break;
}
break;
}
- case MSG_MESSAGE_CLASS_TYPE_INT :
+ case MSG_MESSAGE_CLASS_TYPE_INT:
*value = msg_data->classType;
break;
- case MSG_MESSAGE_STORAGE_ID_INT :
+ case MSG_MESSAGE_STORAGE_ID_INT:
*value = msg_data->storageId;
break;
- case MSG_MESSAGE_DISPLAY_TIME_INT :
+ case MSG_MESSAGE_DISPLAY_TIME_INT:
*value = msg_data->displayTime;
break;
- case MSG_MESSAGE_NETWORK_STATUS_INT :
+ case MSG_MESSAGE_NETWORK_STATUS_INT:
*value = msg_data->networkStatus;
break;
- case MSG_MESSAGE_ENCODE_TYPE_INT :
+ case MSG_MESSAGE_ENCODE_TYPE_INT:
*value = msg_data->encodeType;
break;
- case MSG_MESSAGE_PRIORITY_INT :
+ case MSG_MESSAGE_PRIORITY_INT:
*value = msg_data->priority;
break;
- case MSG_MESSAGE_DIRECTION_INT :
+ case MSG_MESSAGE_DIRECTION_INT:
*value = msg_data->direction;
break;
- case MSG_MESSAGE_DEST_PORT_INT :
+ case MSG_MESSAGE_DEST_PORT_INT:
*value = msg_data->dstPort;
break;
- case MSG_MESSAGE_SRC_PORT_INT :
+ case MSG_MESSAGE_SRC_PORT_INT:
*value = msg_data->srcPort;
break;
- case MSG_MESSAGE_ATTACH_COUNT_INT :
+ case MSG_MESSAGE_ATTACH_COUNT_INT:
*value = msg_data->attachCount;
break;
- case MSG_MESSAGE_DATA_SIZE_INT :
+ case MSG_MESSAGE_DATA_SIZE_INT:
*value = msg_data->dataSize;
break;
- case MSG_MESSAGE_SIM_INDEX_INT :
+ case MSG_MESSAGE_SIM_INDEX_INT:
*value = msg_data->simIndex;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
switch (field) {
- case MSG_MESSAGE_READ_BOOL :
+ case MSG_MESSAGE_READ_BOOL:
*value = msg_data->bRead;
break;
- case MSG_MESSAGE_PROTECTED_BOOL :
+ case MSG_MESSAGE_PROTECTED_BOOL:
*value = msg_data->bProtected;
break;
- case MSG_MESSAGE_BACKUP_BOOL :
+ case MSG_MESSAGE_BACKUP_BOOL:
*value = msg_data->bBackup;
break;
- case MSG_MESSAGE_PORT_VALID_BOOL :
+ case MSG_MESSAGE_PORT_VALID_BOOL:
*value = msg_data->bPortValid;
break;
- case MSG_MESSAGE_REPLACE_BOOL :
- {
+ case MSG_MESSAGE_REPLACE_BOOL: {
if (msg_data->subType >= MSG_REPLACE_TYPE1_SMS && msg_data->subType <= MSG_REPLACE_TYPE7_SMS)
*value = true;
else
*value = false;
break;
}
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
switch (field) {
- case MSG_MESSAGE_REPLY_ADDR_STR :
+ case MSG_MESSAGE_REPLY_ADDR_STR:
strncpy(value, msg_data->replyAddress, size);
break;
- case MSG_MESSAGE_SUBJECT_STR :
+ case MSG_MESSAGE_SUBJECT_STR:
strncpy(value, msg_data->subject, size);
break;
- case MSG_MESSAGE_SMS_DATA_STR :
- case MSG_MESSAGE_MMS_TEXT_STR :
- if (msg_data->pData)
- {
+ case MSG_MESSAGE_SMS_DATA_STR:
+ case MSG_MESSAGE_MMS_TEXT_STR:
+ if (msg_data->pData) {
if (msg_data->mainType == MSG_SMS_TYPE) {
int data_len = 0;
((size_t)size >= msg_data->dataSize)? (data_len = msg_data->dataSize) : data_len = size;
}
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
int ret = MSG_SUCCESS;
switch (field) {
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
switch (field) {
- case MSG_MESSAGE_ADDR_LIST_STRUCT :
+ case MSG_MESSAGE_ADDR_LIST_STRUCT:
*value = (void *)msg_data->addr_list;
break;
- case MSG_MESSAGE_ADDR_LIST_HND :
+ case MSG_MESSAGE_ADDR_LIST_HND:
*value = (msg_list_handle_t)msg_data->addressList;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
switch (field) {
- case MSG_MESSAGE_ID_INT :
+ case MSG_MESSAGE_ID_INT:
msg_data->msgId = value;
break;
- case MSG_MESSAGE_THREAD_ID_INT :
+ case MSG_MESSAGE_THREAD_ID_INT:
msg_data->threadId = value;
break;
- case MSG_MESSAGE_FOLDER_ID_INT :
+ case MSG_MESSAGE_FOLDER_ID_INT:
msg_data->folderId = value;
break;
- case MSG_MESSAGE_TYPE_INT :
- {
+ case MSG_MESSAGE_TYPE_INT: {
if (value == MSG_TYPE_SMS) {
msg_data->mainType = MSG_SMS_TYPE;
msg_data->subType = MSG_NORMAL_SMS;
}
break;
}
- case MSG_MESSAGE_CLASS_TYPE_INT :
+ case MSG_MESSAGE_CLASS_TYPE_INT:
msg_data->classType = value;
break;
- case MSG_MESSAGE_STORAGE_ID_INT :
+ case MSG_MESSAGE_STORAGE_ID_INT:
msg_data->storageId = value;
break;
- case MSG_MESSAGE_DISPLAY_TIME_INT :
+ case MSG_MESSAGE_DISPLAY_TIME_INT:
msg_data->displayTime = value;
break;
- case MSG_MESSAGE_NETWORK_STATUS_INT :
+ case MSG_MESSAGE_NETWORK_STATUS_INT:
msg_data->networkStatus = value;
break;
- case MSG_MESSAGE_ENCODE_TYPE_INT :
+ case MSG_MESSAGE_ENCODE_TYPE_INT:
msg_data->encodeType = value;
break;
- case MSG_MESSAGE_PRIORITY_INT :
+ case MSG_MESSAGE_PRIORITY_INT:
msg_data->priority = value;
break;
- case MSG_MESSAGE_DIRECTION_INT :
+ case MSG_MESSAGE_DIRECTION_INT:
msg_data->direction = value;
break;
- case MSG_MESSAGE_DEST_PORT_INT :
+ case MSG_MESSAGE_DEST_PORT_INT:
msg_data->dstPort = value;
break;
- case MSG_MESSAGE_SRC_PORT_INT :
+ case MSG_MESSAGE_SRC_PORT_INT:
msg_data->srcPort = value;
break;
- case MSG_MESSAGE_ATTACH_COUNT_INT :
+ case MSG_MESSAGE_ATTACH_COUNT_INT:
msg_data->attachCount = value;
break;
- case MSG_MESSAGE_DATA_SIZE_INT :
+ case MSG_MESSAGE_DATA_SIZE_INT:
msg_data->dataSize = value;
break;
- case MSG_MESSAGE_SIM_INDEX_INT :
+ case MSG_MESSAGE_SIM_INDEX_INT:
msg_data->simIndex = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
switch (field) {
- case MSG_MESSAGE_READ_BOOL :
+ case MSG_MESSAGE_READ_BOOL:
msg_data->bRead = value;
break;
- case MSG_MESSAGE_PROTECTED_BOOL :
+ case MSG_MESSAGE_PROTECTED_BOOL:
msg_data->bProtected = value;
break;
- case MSG_MESSAGE_BACKUP_BOOL :
+ case MSG_MESSAGE_BACKUP_BOOL:
msg_data->bBackup = value;
break;
- case MSG_MESSAGE_PORT_VALID_BOOL :
+ case MSG_MESSAGE_PORT_VALID_BOOL:
msg_data->bPortValid = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)data;
switch (field) {
- case MSG_MESSAGE_REPLY_ADDR_STR :
+ case MSG_MESSAGE_REPLY_ADDR_STR:
snprintf(msg_data->replyAddress, sizeof(msg_data->replyAddress), "%s", value);
break;
- case MSG_MESSAGE_SUBJECT_STR :
- snprintf(msg_data->subject, sizeof(msg_data->subject), "%s",value);
+ case MSG_MESSAGE_SUBJECT_STR:
+ snprintf(msg_data->subject, sizeof(msg_data->subject), "%s", value);
break;
- case MSG_MESSAGE_SMS_DATA_STR :
- {
+ case MSG_MESSAGE_SMS_DATA_STR: {
if (msg_data->pData)
delete [] static_cast<char*>(msg_data->pData);
((char*) msg_data->pData)[msg_data->dataSize] = '\0';
}
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
int ret = MSG_SUCCESS;
switch (field) {
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
void msg_message_copy_message(MSG_MESSAGE_HIDDEN_S *pSrc, MSG_MESSAGE_HIDDEN_S *pDst)
{
-
pDst->msgId = pSrc->msgId;
pDst->threadId = pSrc->msgId;
pDst->folderId = pSrc->folderId;
msg_struct_s *addr_struct = __msg_message_create_address_struct();
MSG_ADDRESS_INFO_S *addrInfo = (MSG_ADDRESS_INFO_S *)addr_struct->data;
- msg_struct_s *addr_info = (msg_struct_s *)g_list_nth_data(pSrc->addressList,(guint)i);
+ msg_struct_s *addr_info = (msg_struct_s *)g_list_nth_data(pSrc->addressList, (guint)i);
MSG_ADDRESS_INFO_S *address = (MSG_ADDRESS_INFO_S *)addr_info->data;
addrInfo->addressType = address->addressType;
*value = 0;
switch (field) {
- case MSG_CB_MSG_TYPE_INT :
- {
+ case MSG_CB_MSG_TYPE_INT: {
switch (cb_msg->type) {
- case MSG_ETWS_SMS :
+ case MSG_ETWS_SMS:
*value = MSG_TYPE_SMS_ETWS_PRIMARY;
break;
case MSG_CB_SMS:
- *value = ((cb_msg->messageId & 0xFFF8) == 0x1100 ) ? MSG_TYPE_SMS_ETWS_SECONDARY : MSG_TYPE_SMS_CB;
+ *value = ((cb_msg->messageId & 0xFFF8) == 0x1100) ? MSG_TYPE_SMS_ETWS_SECONDARY : MSG_TYPE_SMS_CB;
break;
- case MSG_CMAS_PRESIDENTIAL :
+ case MSG_CMAS_PRESIDENTIAL:
*value = MSG_TYPE_SMS_CMAS_PRESIDENTIAL;
break;
- case MSG_CMAS_EXTREME :
+ case MSG_CMAS_EXTREME:
*value = MSG_TYPE_SMS_CMAS_EXTREME;
break;
- case MSG_CMAS_SEVERE :
+ case MSG_CMAS_SEVERE:
*value = MSG_TYPE_SMS_CMAS_SEVERE;
break;
- case MSG_CMAS_AMBER :
+ case MSG_CMAS_AMBER:
*value = MSG_TYPE_SMS_CMAS_AMBER;
break;
- case MSG_CMAS_TEST :
+ case MSG_CMAS_TEST:
*value = MSG_TYPE_SMS_CMAS_TEST;
break;
- case MSG_CMAS_EXERCISE :
+ case MSG_CMAS_EXERCISE:
*value = MSG_TYPE_SMS_CMAS_EXERCISE;
break;
- case MSG_CMAS_OPERATOR_DEFINED :
+ case MSG_CMAS_OPERATOR_DEFINED:
*value = MSG_TYPE_SMS_CMAS_OPERATOR_DEFINED;
break;
- default :
+ default:
ret = MSG_ERR_UNKNOWN;
}
}
break;
- case MSG_CB_MSG_RECV_TIME_INT :
+ case MSG_CB_MSG_RECV_TIME_INT:
*value = cb_msg->receivedTime;
break;
- case MSG_CB_MSG_SERIAL_NUM_INT :
+ case MSG_CB_MSG_SERIAL_NUM_INT:
*value = cb_msg->serialNum;
break;
- case MSG_CB_MSG_MSG_ID_INT :
+ case MSG_CB_MSG_MSG_ID_INT:
*value = cb_msg->messageId;
break;
- case MSG_CB_MSG_DCS_INT :
+ case MSG_CB_MSG_DCS_INT:
*value = (int)cb_msg->dcs;
break;
- case MSG_CB_MSG_CB_TEXT_LEN_INT :
+ case MSG_CB_MSG_CB_TEXT_LEN_INT:
*value = cb_msg->cbTextLen;
break;
- case MSG_CB_MSG_ETWS_WARNING_TYPE_INT :
+ case MSG_CB_MSG_ETWS_WARNING_TYPE_INT:
*value = cb_msg->etwsWarningType;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_CB_MSG_S *cb_msg = (MSG_CB_MSG_S *)data;
switch (field) {
- case MSG_CB_MSG_CB_TEXT_STR:
- {
+ case MSG_CB_MSG_CB_TEXT_STR: {
int copylen = 0;
copylen = (size > cb_msg->cbTextLen) ? cb_msg->cbTextLen : size - 1;
- memcpy (value, cb_msg->cbText, copylen);
+ memcpy(value, cb_msg->cbText, copylen);
value[copylen] = '\0';
}
break;
- case MSG_CB_MSG_LANGUAGE_TYPE_STR:
- {
+ case MSG_CB_MSG_LANGUAGE_TYPE_STR: {
int copylen = 0;
copylen = ((size_t)size > strlen((const char*)cb_msg->language_type)) ? strlen((const char*)cb_msg->language_type) : size - 1;
- memcpy (value, cb_msg->language_type, copylen);
+ memcpy(value, cb_msg->language_type, copylen);
value[copylen] = '\0';
}
break;
- case MSG_CB_MSG_ETWS_WARNING_SECU_INFO_STR:
- {
+ case MSG_CB_MSG_ETWS_WARNING_SECU_INFO_STR: {
if ((size_t)size < sizeof(cb_msg->etwsWarningSecurityInfo))
ret = MSG_ERR_INVALID_PARAMETER;
else
}
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
msg_struct_s *msg_struct_item = NULL;
switch (field) {
- case MSG_MESSAGE_ADDR_LIST_HND:
- {
+ case MSG_MESSAGE_ADDR_LIST_HND: {
msg_struct_item = __msg_message_create_address_struct();
msg_data->addressList = g_list_append(msg_data->addressList, msg_struct_item);
*item = (msg_struct_t)msg_struct_item;
}
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MESSAGE_HIDDEN_S *msg_data = (MSG_MESSAGE_HIDDEN_S *)msg_struct->data;
switch (field) {
- case MSG_MESSAGE_ADDR_LIST_HND:
- {
+ case MSG_MESSAGE_ADDR_LIST_HND: {
/* Free GList *addressList */
if (msg_data->addressList) {
g_list_free_full(msg_data->addressList, __msg_message_release_address_struct);
}
}
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_CONVERSATION_VIEW_S *msg_data = (MSG_CONVERSATION_VIEW_S *)data;
switch (field) {
- case MSG_CONV_MSG_MULTIPART_HND :
+ case MSG_CONV_MSG_MULTIPART_HND:
*value = (void *)msg_data->multipart_list;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
data = (void *)new MMS_PAGE_S;
bzero(data, sizeof(MMS_PAGE_S));
break;
- case MSG_STRUCT_MMS_MEDIA:
- {
+ case MSG_STRUCT_MMS_MEDIA: {
MMS_MEDIA_HIDDEN_S *media = new MMS_MEDIA_HIDDEN_S;
bzero(media, sizeof(MMS_MEDIA_HIDDEN_S));
msg_struct_s *msg_struct = (msg_struct_s *)data;
switch (msg_struct->type) {
- case MSG_STRUCT_MMS_MEDIA :
+ case MSG_STRUCT_MMS_MEDIA:
__msg_mms_release_media(msg_struct);
break;
- case MSG_STRUCT_MMS_PAGE :
+ case MSG_STRUCT_MMS_PAGE:
__msg_mms_release_page(msg_struct);
break;
- case MSG_STRUCT_MMS_ATTACH :
+ case MSG_STRUCT_MMS_ATTACH:
__msg_mms_release_attach(msg_struct);
break;
- case MSG_STRUCT_MMS_REGION :
+ case MSG_STRUCT_MMS_REGION:
__msg_mms_release_region(msg_struct);
break;
- case MSG_STRUCT_MMS_TRANSITION :
+ case MSG_STRUCT_MMS_TRANSITION:
__msg_mms_release_transition(msg_struct);
break;
- case MSG_STRUCT_MMS_META :
+ case MSG_STRUCT_MMS_META:
__msg_mms_release_meta(msg_struct);
break;
- case MSG_STRUCT_MULTIPART_INFO :
+ case MSG_STRUCT_MULTIPART_INFO:
__msg_mms_release_multipart(msg_struct);
break;
- default :
+ default:
break;
}
}
delete msg_struct;
*msg_struct_data = NULL;
break;
- case MSG_STRUCT_MULTIPART_INFO:
- {
+ case MSG_STRUCT_MULTIPART_INFO: {
if (msg_struct->data) {
delete (MMS_MULTIPART_DATA_S *)(msg_struct->data);
msg_struct->data = NULL;
msg_error_t err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_MMS:
- {
+ case MSG_STRUCT_MMS: {
MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
if (field == MSG_MMS_ROOTLAYOUT_WIDTH_INT) {
*value = mms_data->rootlayout.width.value;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_PAGE:
- {
+ case MSG_STRUCT_MMS_PAGE: {
MMS_PAGE_S *mms_page_data = (MMS_PAGE_S *)msg_struct->data;
if (field == MSG_MMS_PAGE_PAGE_DURATION_INT)
*value = mms_page_data->nDur;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_MEDIA:
- {
+ case MSG_STRUCT_MMS_MEDIA: {
MMS_MEDIA_HIDDEN_S *mms_media_data = (MMS_MEDIA_HIDDEN_S *)msg_struct->data;
if (field == MSG_MMS_MEDIA_TYPE_INT)
*value = mms_media_data->mediatype;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_ATTACH:
- {
+ case MSG_STRUCT_MMS_ATTACH: {
MMS_ATTACH_S *mms_attach_data = (MMS_ATTACH_S *)msg_struct->data;
if (field == MSG_MMS_ATTACH_MIME_TYPE_INT)
*value = mms_attach_data->mediatype;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_REGION:
- {
+ case MSG_STRUCT_MMS_REGION: {
MMS_SMIL_REGION *mms_region_data = (MMS_SMIL_REGION *)msg_struct->data;
if (field == MSG_MMS_REGION_LENGTH_LEFT_INT)
*value = mms_region_data->nLeft.value;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_TRANSITION:
- {
+ case MSG_STRUCT_MMS_TRANSITION: {
MMS_SMIL_TRANSITION *mms_transition_data = (MMS_SMIL_TRANSITION *)msg_struct->data;
if (field == MSG_MMS_TRANSITION_TYPE_INT)
*value = mms_transition_data->nType;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_SMIL_TEXT:
- {
+ case MSG_STRUCT_MMS_SMIL_TEXT: {
MmsSmilText *mms_smil_text_data = (MmsSmilText *)msg_struct->data;
if (field == MSG_MMS_SMIL_TEXT_REPEAT_INT)
*value = mms_smil_text_data->nRepeat;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_SMIL_AVI:
- {
+ case MSG_STRUCT_MMS_SMIL_AVI: {
MmsSmilAVI *mms_smil_avi_data = (MmsSmilAVI *)msg_struct->data;
if (field == MSG_MMS_SMIL_AVI_REPEAT_INT)
*value = mms_smil_avi_data->nRepeat;
err = msg_multipart_get_int_value(msg_struct->data, field, value);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
msg_error_t err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_MMS:
- {
+ case MSG_STRUCT_MMS: {
MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
if (field == MSG_MMS_HEADER_CONTENT_LOCATION_STR) { /* mms header */
strncpy(value, mms_data->header.contentLocation, size);
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_MEDIA:
- {
+ case MSG_STRUCT_MMS_MEDIA: {
MMS_MEDIA_HIDDEN_S *mms_media_data = (MMS_MEDIA_HIDDEN_S *)msg_struct->data;
if (field == MSG_MMS_MEDIA_SRC_STR)
strncpy(value, mms_media_data->szSrc, size);
else if (field == MSG_MMS_MEDIA_CONTENT_ID_STR) {
if (strlen(mms_media_data->szContentID) > 0)
snprintf(value, size, "<%s>", mms_media_data->szContentID);
- }else if (field == MSG_MMS_MEDIA_REGION_ID_STR)
+ } else if (field == MSG_MMS_MEDIA_REGION_ID_STR)
strncpy(value, mms_media_data->regionId, size);
else if (field == MSG_MMS_MEDIA_ALTERNATIVE_STR)
strncpy(value, mms_media_data->szAlt, size);
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_ATTACH:
- {
+ case MSG_STRUCT_MMS_ATTACH: {
MMS_ATTACH_S *mms_attach_data = (MMS_ATTACH_S *)msg_struct->data;
if (field == MSG_MMS_ATTACH_FILENAME_STR)
strncpy(value, mms_attach_data->szFileName, size);
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_REGION:
- {
+ case MSG_STRUCT_MMS_REGION: {
MMS_SMIL_REGION *mms_region_data = (MMS_SMIL_REGION *)msg_struct->data;
if (field == MSG_MMS_REGION_ID_STR)
strncpy(value, mms_region_data->szID, size);
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_TRANSITION:
- {
+ case MSG_STRUCT_MMS_TRANSITION: {
MMS_SMIL_TRANSITION *mms_transition_data = (MMS_SMIL_TRANSITION *)msg_struct->data;
if (field == MSG_MMS_TRANSITION_ID_STR)
strncpy(value, mms_transition_data->szID, size);
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_META:
- {
+ case MSG_STRUCT_MMS_META: {
MMS_SMIL_META *mms_meta_data = (MMS_SMIL_META *)msg_struct->data;
if (field == MSG_MMS_META_ID_STR)
strncpy(value, mms_meta_data->szID, size);
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_SMIL_TEXT:
- {
+ case MSG_STRUCT_MMS_SMIL_TEXT: {
MmsSmilText *mms_smil_text_data = (MmsSmilText *)msg_struct->data;
if (field == MSG_MMS_SMIL_TEXT_TRANSITION_IN_ID_STR)
strncpy(value, mms_smil_text_data->szTransInId, size);
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_SMIL_AVI:
- {
+ case MSG_STRUCT_MMS_SMIL_AVI: {
MmsSmilAVI *mms_smil_avi_data = (MmsSmilAVI *)msg_struct->data;
if (field == MSG_MMS_SMIL_AVI_TRANSITION_IN_ID_STR)
strncpy(value, mms_smil_avi_data->szTransInId, size);
err = msg_multipart_get_str_value(msg_struct->data, field, value, size);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
msg_error_t err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_MMS:
- {
+ case MSG_STRUCT_MMS: {
MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
if (field == MSG_MMS_ROOTLAYOUT_WIDTH_PERCENT_BOOL)
*value = mms_data->rootlayout.width.bUnitPercent;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_REGION:
- {
+ case MSG_STRUCT_MMS_REGION: {
MMS_SMIL_REGION *mms_region_data = (MMS_SMIL_REGION *)msg_struct->data;
if (field == MSG_MMS_REGION_LENGTH_LEFT_PERCENT_BOOL)
*value = mms_region_data->nLeft.bUnitPercent;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_SMIL_TEXT:
- {
+ case MSG_STRUCT_MMS_SMIL_TEXT: {
MmsSmilText *mms_smil_text_data = (MmsSmilText *)msg_struct->data;
if (field == MSG_MMS_SMIL_TEXT_BOLD_BOOL)
*value = mms_smil_text_data->bBold;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
msg_error_t err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_MMS_MEDIA:
- {
+ case MSG_STRUCT_MMS_MEDIA: {
MMS_MEDIA_HIDDEN_S *mms_media_data = (MMS_MEDIA_HIDDEN_S *)msg_struct->data;
if (field == MSG_MMS_MEDIA_SMIL_TEXT_HND)
*value = mms_media_data->pText;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
msg_error_t err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_MMS:
- {
+ case MSG_STRUCT_MMS: {
MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
if (field == MSG_MMS_PAGE_LIST_HND)
*value = (msg_list_handle_t)mms_data->pagelist;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_PAGE:
- {
+ case MSG_STRUCT_MMS_PAGE: {
MMS_PAGE_S *mms_page_data = (MMS_PAGE_S *)msg_struct->data;
if (field == MSG_MMS_PAGE_MEDIA_LIST_HND)
*value = (msg_list_handle_t)mms_page_data->medialist;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
msg_error_t err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_MMS:
- {
+ case MSG_STRUCT_MMS: {
MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
if (field == MSG_MMS_ROOTLAYOUT_WIDTH_INT)
mms_data->rootlayout.width.value = value;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_PAGE:
- {
+ case MSG_STRUCT_MMS_PAGE: {
MMS_PAGE_S *mms_page_data = (MMS_PAGE_S *)msg_struct->data;
if (field == MSG_MMS_PAGE_PAGE_DURATION_INT)
mms_page_data->nDur = value;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_MEDIA:
- {
+ case MSG_STRUCT_MMS_MEDIA: {
MMS_MEDIA_HIDDEN_S *mms_media_data = (MMS_MEDIA_HIDDEN_S *)msg_struct->data;
if (field == MSG_MMS_MEDIA_TYPE_INT)
mms_media_data->mediatype = (MmsSmilMediaType)value;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_ATTACH:
- {
+ case MSG_STRUCT_MMS_ATTACH: {
MMS_ATTACH_S *mms_attach_data = (MMS_ATTACH_S *)msg_struct->data;
if (field == MSG_MMS_ATTACH_MIME_TYPE_INT)
mms_attach_data->mediatype = (MimeType)value;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_REGION:
- {
+ case MSG_STRUCT_MMS_REGION: {
MMS_SMIL_REGION *mms_region_data = (MMS_SMIL_REGION *)msg_struct->data;
if (field == MSG_MMS_REGION_LENGTH_LEFT_INT)
mms_region_data->nLeft.value = value;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_TRANSITION:
- {
+ case MSG_STRUCT_MMS_TRANSITION: {
MMS_SMIL_TRANSITION *mms_transition_data = (MMS_SMIL_TRANSITION *)msg_struct->data;
if (field == MSG_MMS_TRANSITION_TYPE_INT)
mms_transition_data->nType = (MmsSmilTransType)value;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_SMIL_TEXT:
- {
+ case MSG_STRUCT_MMS_SMIL_TEXT: {
MmsSmilText *mms_smil_text_data = (MmsSmilText *)msg_struct->data;
if (field == MSG_MMS_SMIL_TEXT_REPEAT_INT)
mms_smil_text_data->nRepeat = value;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_SMIL_AVI:
- {
+ case MSG_STRUCT_MMS_SMIL_AVI: {
MmsSmilAVI *mms_smil_avi_data = (MmsSmilAVI *)msg_struct->data;
if (field == MSG_MMS_SMIL_AVI_REPEAT_INT)
mms_smil_avi_data->nRepeat = value;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
msg_error_t err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_MMS_MEDIA:
- {
+ case MSG_STRUCT_MMS_MEDIA: {
MMS_MEDIA_HIDDEN_S *mms_media_data = (MMS_MEDIA_HIDDEN_S *)msg_struct->data;
if (field == MSG_MMS_MEDIA_SRC_STR)
strncpy(mms_media_data->szSrc, value, MSG_FILEPATH_LEN_MAX);
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_ATTACH:
- {
+ case MSG_STRUCT_MMS_ATTACH: {
MMS_ATTACH_S *mms_attach_data = (MMS_ATTACH_S *)msg_struct->data;
if (field == MSG_MMS_ATTACH_FILENAME_STR) {
strncpy(mms_attach_data->szFileName, value, MSG_FILENAME_LEN_MAX);
}
}
break;
- case MSG_STRUCT_MMS_REGION:
- {
+ case MSG_STRUCT_MMS_REGION: {
MMS_SMIL_REGION *mms_region_data = (MMS_SMIL_REGION *)msg_struct->data;
if (field == MSG_MMS_REGION_ID_STR)
strncpy(mms_region_data->szID, value, MAX_SMIL_REGION_ID);
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_TRANSITION:
- {
+ case MSG_STRUCT_MMS_TRANSITION: {
MMS_SMIL_TRANSITION *mms_transition_data = (MMS_SMIL_TRANSITION *)msg_struct->data;
if (field == MSG_MMS_TRANSITION_ID_STR)
strncpy(mms_transition_data->szID, value, MAX_SMIL_TRANSITION_ID);
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_META:
- {
+ case MSG_STRUCT_MMS_META: {
MMS_SMIL_META *mms_meta_data = (MMS_SMIL_META *)msg_struct->data;
if (field == MSG_MMS_META_ID_STR)
strncpy(mms_meta_data->szID, value, MAX_SMIL_META_ID);
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_SMIL_TEXT:
- {
+ case MSG_STRUCT_MMS_SMIL_TEXT: {
MmsSmilText *mms_smil_text_data = (MmsSmilText *)msg_struct->data;
if (field == MSG_MMS_SMIL_TEXT_TRANSITION_IN_ID_STR)
strncpy(mms_smil_text_data->szTransInId, value, MAX_SMIL_TRANSIN_ID);
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_SMIL_AVI:
- {
+ case MSG_STRUCT_MMS_SMIL_AVI: {
MmsSmilAVI *mms_smil_avi_data = (MmsSmilAVI *)msg_struct->data;
if (field == MSG_MMS_SMIL_AVI_TRANSITION_IN_ID_STR)
strncpy(mms_smil_avi_data->szTransInId, value, MAX_SMIL_TRANSIN_ID);
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS:
- {
+ case MSG_STRUCT_MMS: {
MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
if (field == MSG_MMS_HEADER_CONTENT_LOCATION_STR) { /* mms header */
strncpy(mms_data->header.contentLocation, value, sizeof(mms_data->header.contentLocation) - 1 );
err = msg_multipart_set_str_value(msg_struct->data, field, value, size);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
msg_error_t err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_MMS:
- {
+ case MSG_STRUCT_MMS: {
MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
if (field == MSG_MMS_ROOTLAYOUT_WIDTH_PERCENT_BOOL)
mms_data->rootlayout.width.bUnitPercent = value;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_REGION:
- {
+ case MSG_STRUCT_MMS_REGION: {
MMS_SMIL_REGION *mms_region_data = (MMS_SMIL_REGION *)msg_struct->data;
if (field == MSG_MMS_REGION_LENGTH_LEFT_PERCENT_BOOL)
mms_region_data->nLeft.bUnitPercent = value;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- case MSG_STRUCT_MMS_SMIL_TEXT:
- {
+ case MSG_STRUCT_MMS_SMIL_TEXT: {
MmsSmilText *mms_smil_text_data = (MmsSmilText *)msg_struct->data;
if (field == MSG_MMS_SMIL_TEXT_BOLD_BOOL)
mms_smil_text_data->bBold = value;
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
msg_error_t err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_MMS_MEDIA:
- {
+ case MSG_STRUCT_MMS_MEDIA: {
MMS_MEDIA_HIDDEN_S *mms_media_data = (MMS_MEDIA_HIDDEN_S *)msg_struct->data;
if (field == MSG_MMS_MEDIA_SMIL_TEXT_HND)
err = MSG_ERR_INVALID_PARAMETER;
}
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
msg_struct_s *msg_struct_item = NULL;
switch (msg_struct->type) {
- case MSG_STRUCT_MMS:
- {
-
+ case MSG_STRUCT_MMS: {
MMS_DATA_HIDDEN_S *mms_data = (MMS_DATA_HIDDEN_S *)msg_struct->data;
if (field == MSG_STRUCT_MMS_PAGE) {
}
}
break;
- case MSG_STRUCT_MMS_PAGE:
- {
-
+ case MSG_STRUCT_MMS_PAGE: {
MMS_PAGE_S *mms_page_data = (MMS_PAGE_S *)msg_struct->data;
if (field == MSG_STRUCT_MMS_MEDIA) {
}
}
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
if (page) {
page->mediaCnt = g_list_length(src_page->medialist);
- for (j = 0; j < page->mediaCnt; j++)
- {
+ for (j = 0; j < page->mediaCnt; j++) {
MMS_MEDIA_S *dst_media = (MMS_MEDIA_S *)calloc(1, sizeof(MMS_MEDIA_S));
msg_struct_s *src_media_s = (msg_struct_s *)g_list_nth_data(src_page->medialist, j);
MMS_PAGE_S *src_page = (MMS_PAGE_S *)g_list_nth_data(pSrc->pagelist, i);
page->mediaCnt = g_list_length(src_page->medialist);
- for (j = 0; j < page->mediaCnt; j++)
- {
+ for (j = 0; j < page->mediaCnt; j++) {
msg_struct_s *dst_media_s = msg_mms_create_struct(MSG_STRUCT_MMS_MEDIA);
MMS_MEDIA_S *src_media = (MMS_MEDIA_S *)g_list_nth_data(src_page->medialist, j);
memcpy(&pDestMms->header, &pSrc->header, sizeof(MMS_HEADER_DATA_S));
memcpy(&pDestMms->smil, &pSrc->smil, sizeof(MMS_MULTIPART_DATA_S));
-
}
strncpy(value, msg_data->szContentLocation, size);
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
case MSG_MMS_MULTIPART_MALWARE_ALLOW_INT:
*value = msg_data->malware_allow;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
case MSG_MMS_MULTIPART_CONTENT_LOCATION_STR:
strncpy(msg_data->szContentLocation, value, MSG_MSG_ID_LEN);
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
pDestMms->smil.type = MIME_APPLICATION_SMIL;
pDestMms->smil.pMultipartData = (char *)calloc(1, pDestMms->smil.nMultipartDataLen+1);
if (pDestMms->smil.pMultipartData)
- memcpy(pDestMms->smil.pMultipartData, pSrc->smil->pMultipartData,pDestMms->smil.nMultipartDataLen);
+ memcpy(pDestMms->smil.pMultipartData, pSrc->smil->pMultipartData, pDestMms->smil.nMultipartDataLen);
}
if (pSrc->multipartlist) {
-
int list_cnt = g_list_length(pSrc->multipartlist);
for (int i = 0; i < list_cnt; i++) {
}
}
}
-
}
void convert_from_hidden_mmsdata(msg_struct_s *pSrc, MMS_DATA_S *pDest)
{
-
MMS_DATA_HIDDEN_S *pSrcMms = (MMS_DATA_HIDDEN_S *)pSrc->data;
MMS_MESSAGE_DATA_S *MmsMessageData = NULL;
int err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_SETTING_SMSC_OPT :
+ case MSG_STRUCT_SETTING_SMSC_OPT:
err = msg_get_smsc_opt_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_SMSC_INFO :
+ case MSG_STRUCT_SETTING_SMSC_INFO:
err = msg_get_smsc_info_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_CB_OPT :
+ case MSG_STRUCT_SETTING_CB_OPT:
err = msg_get_cb_option_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+ case MSG_STRUCT_SETTING_CB_CHANNEL_INFO:
err = msg_get_cb_channel_info_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_SMS_SEND_OPT :
+ case MSG_STRUCT_SETTING_SMS_SEND_OPT:
err = msg_get_sms_send_opt_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_MMS_SEND_OPT :
+ case MSG_STRUCT_SETTING_MMS_SEND_OPT:
err = msg_get_mms_send_opt_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_MMS_RECV_OPT :
+ case MSG_STRUCT_SETTING_MMS_RECV_OPT:
err = msg_get_mms_recv_opt_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
+ case MSG_STRUCT_SETTING_PUSH_MSG_OPT:
err = msg_get_push_msg_opt_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_GENERAL_OPT :
+ case MSG_STRUCT_SETTING_GENERAL_OPT:
err = msg_get_general_opt_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_MSGSIZE_OPT :
+ case MSG_STRUCT_SETTING_MSGSIZE_OPT:
err = msg_get_msgsize_opt_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
+ case MSG_STRUCT_SETTING_VOICE_MSG_OPT:
err = msg_get_voice_msg_opt_int(msg_struct->data, field, value);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
int err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_SETTING_SMSC_INFO :
+ case MSG_STRUCT_SETTING_SMSC_INFO:
err = msg_get_smsc_info_str(msg_struct->data, field, src, size);
break;
- case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+ case MSG_STRUCT_SETTING_CB_CHANNEL_INFO:
err = msg_get_cb_channel_info_str(msg_struct->data, field, src, size);
break;
- case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
+ case MSG_STRUCT_SETTING_VOICE_MSG_OPT:
err = msg_get_voice_msg_opt_str(msg_struct->data, field, src, size);
break;
- case MSG_STRUCT_SETTING_GENERAL_OPT :
+ case MSG_STRUCT_SETTING_GENERAL_OPT:
err = msg_get_general_opt_str(msg_struct->data, field, src, size);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
int err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_SETTING_CB_OPT :
+ case MSG_STRUCT_SETTING_CB_OPT:
err = msg_get_cb_option_bool(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+ case MSG_STRUCT_SETTING_CB_CHANNEL_INFO:
err = msg_get_cb_channel_info_bool(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_SMS_SEND_OPT :
+ case MSG_STRUCT_SETTING_SMS_SEND_OPT:
err = msg_get_sms_send_opt_bool(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_MMS_SEND_OPT :
+ case MSG_STRUCT_SETTING_MMS_SEND_OPT:
err = msg_get_mms_send_opt_bool(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_MMS_RECV_OPT :
+ case MSG_STRUCT_SETTING_MMS_RECV_OPT:
err = msg_get_mms_recv_opt_bool(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
+ case MSG_STRUCT_SETTING_PUSH_MSG_OPT:
err = msg_get_push_msg_opt_bool(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_GENERAL_OPT :
+ case MSG_STRUCT_SETTING_GENERAL_OPT:
err = msg_get_general_opt_bool(msg_struct->data, field, value);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
int err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_SETTING_SMSC_OPT :
+ case MSG_STRUCT_SETTING_SMSC_OPT:
err = msg_get_smsc_opt_list(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_CB_OPT :
+ case MSG_STRUCT_SETTING_CB_OPT:
err = msg_get_cb_option_list(msg_struct->data, field, value);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
int err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_SETTING_SMSC_OPT :
+ case MSG_STRUCT_SETTING_SMSC_OPT:
err = msg_set_smsc_opt_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_SMSC_INFO :
+ case MSG_STRUCT_SETTING_SMSC_INFO:
err = msg_set_smsc_info_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_CB_OPT :
+ case MSG_STRUCT_SETTING_CB_OPT:
err = msg_set_cb_option_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+ case MSG_STRUCT_SETTING_CB_CHANNEL_INFO:
err = msg_set_cb_channel_info_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_SMS_SEND_OPT :
+ case MSG_STRUCT_SETTING_SMS_SEND_OPT:
err = msg_set_sms_send_opt_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_MMS_SEND_OPT :
+ case MSG_STRUCT_SETTING_MMS_SEND_OPT:
err = msg_set_mms_send_opt_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_MMS_RECV_OPT :
+ case MSG_STRUCT_SETTING_MMS_RECV_OPT:
err = msg_set_mms_recv_opt_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
+ case MSG_STRUCT_SETTING_PUSH_MSG_OPT:
err = msg_set_push_msg_opt_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_GENERAL_OPT :
+ case MSG_STRUCT_SETTING_GENERAL_OPT:
err = msg_set_general_opt_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_MSGSIZE_OPT :
+ case MSG_STRUCT_SETTING_MSGSIZE_OPT:
err = msg_set_msgsize_opt_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
+ case MSG_STRUCT_SETTING_VOICE_MSG_OPT:
err = msg_set_voice_msg_opt_int(msg_struct->data, field, value);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
int err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_SETTING_SMSC_INFO :
+ case MSG_STRUCT_SETTING_SMSC_INFO:
err = msg_set_smsc_info_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+ case MSG_STRUCT_SETTING_CB_CHANNEL_INFO:
err = msg_set_cb_channel_info_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
+ case MSG_STRUCT_SETTING_VOICE_MSG_OPT:
err = msg_set_voice_msg_opt_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_SETTING_GENERAL_OPT :
+ case MSG_STRUCT_SETTING_GENERAL_OPT:
err = msg_set_general_opt_str(msg_struct->data, field, value, size);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
int err = MSG_SUCCESS;
switch (msg_struct->type) {
- case MSG_STRUCT_SETTING_CB_OPT :
+ case MSG_STRUCT_SETTING_CB_OPT:
err = msg_set_cb_option_bool(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
+ case MSG_STRUCT_SETTING_CB_CHANNEL_INFO:
err = msg_set_cb_channel_info_bool(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_SMS_SEND_OPT :
+ case MSG_STRUCT_SETTING_SMS_SEND_OPT:
err = msg_set_sms_send_opt_bool(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_MMS_SEND_OPT :
+ case MSG_STRUCT_SETTING_MMS_SEND_OPT:
err = msg_set_mms_send_opt_bool(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_MMS_RECV_OPT :
+ case MSG_STRUCT_SETTING_MMS_RECV_OPT:
err = msg_set_mms_recv_opt_bool(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
+ case MSG_STRUCT_SETTING_PUSH_MSG_OPT:
err = msg_set_push_msg_opt_bool(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SETTING_GENERAL_OPT :
+ case MSG_STRUCT_SETTING_GENERAL_OPT:
err = msg_set_general_opt_bool(msg_struct->data, field, value);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
int ret = MSG_SUCCESS;
switch (field) {
- case MSG_SMSC_LIST_STRUCT :
+ case MSG_SMSC_LIST_STRUCT:
*value = (void *)smsc_opt_data->smsc_list;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_SMSC_LIST_HIDDEN_S *smsc_opt_data = (MSG_SMSC_LIST_HIDDEN_S *)smsc_opt;
switch (field) {
- case MSG_SMSC_SELECTED_ID_INT :
+ case MSG_SMSC_SELECTED_ID_INT:
*value = smsc_opt_data->selected;
break;
- case MSG_SMSC_LIST_SIM_INDEX_INT :
+ case MSG_SMSC_LIST_SIM_INDEX_INT:
*value = smsc_opt_data->simIndex;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_SMSC_LIST_HIDDEN_S *smsc_opt_data = (MSG_SMSC_LIST_HIDDEN_S *)smsc_opt;
switch (field) {
- case MSG_SMSC_SELECTED_ID_INT :
+ case MSG_SMSC_SELECTED_ID_INT:
smsc_opt_data->selected = value;
break;
- case MSG_SMSC_LIST_INDEX_INT :
+ case MSG_SMSC_LIST_INDEX_INT:
smsc_opt_data->index = value;
break;
- case MSG_SMSC_LIST_SIM_INDEX_INT :
+ case MSG_SMSC_LIST_SIM_INDEX_INT:
smsc_opt_data->simIndex = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_SMSC_DATA_S *smsc_data = (MSG_SMSC_DATA_S *)smsc_info;
switch (field) {
- case MSG_SMSC_ADDR_TON_INT :
+ case MSG_SMSC_ADDR_TON_INT:
*value = smsc_data->smscAddr.ton;
break;
- case MSG_SMSC_ADDR_NPI_INT :
+ case MSG_SMSC_ADDR_NPI_INT:
*value = smsc_data->smscAddr.npi;
break;
- case MSG_SMSC_PID_INT :
+ case MSG_SMSC_PID_INT:
*value = smsc_data->pid;
break;
- case MSG_SMSC_VAL_PERIOD_INT :
+ case MSG_SMSC_VAL_PERIOD_INT:
*value = smsc_data->valPeriod;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_SMSC_DATA_S *smsc_data = (MSG_SMSC_DATA_S *)smsc_info;
switch (field) {
- case MSG_SMSC_ADDR_TON_INT :
+ case MSG_SMSC_ADDR_TON_INT:
smsc_data->smscAddr.ton = value;
break;
- case MSG_SMSC_ADDR_NPI_INT :
+ case MSG_SMSC_ADDR_NPI_INT:
smsc_data->smscAddr.npi = value;
break;
- case MSG_SMSC_PID_INT :
+ case MSG_SMSC_PID_INT:
smsc_data->pid = value;
break;
- case MSG_SMSC_VAL_PERIOD_INT :
+ case MSG_SMSC_VAL_PERIOD_INT:
smsc_data->valPeriod = value;
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_SMSC_DATA_S *smsc_data = (MSG_SMSC_DATA_S *)smsc_info;
switch (field) {
- case MSG_SMSC_ADDR_STR :
+ case MSG_SMSC_ADDR_STR:
strncpy(value, smsc_data->smscAddr.address, size);
break;
- case MSG_SMSC_NAME_STR :
+ case MSG_SMSC_NAME_STR:
strncpy(value, smsc_data->name, size);
break;
- default :
+ default:
return MSG_ERR_INVALID_PARAMETER;
}
MSG_SMSC_DATA_S *smsc_data = (MSG_SMSC_DATA_S *)smsc_info;
switch (field) {
- case MSG_SMSC_ADDR_STR :
+ case MSG_SMSC_ADDR_STR:
bzero(smsc_data->smscAddr.address, sizeof(smsc_data->smscAddr.address));
snprintf(smsc_data->smscAddr.address, sizeof(smsc_data->smscAddr.address), "%s", val);
break;
- case MSG_SMSC_NAME_STR :
+ case MSG_SMSC_NAME_STR:
bzero(smsc_data->name, sizeof(smsc_data->name));
snprintf(smsc_data->name, sizeof(smsc_data->name), "%s", val);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_CBMSG_OPT_HIDDEN_S *cb_opt_data = (MSG_CBMSG_OPT_HIDDEN_S *)cb_opt;
switch (field) {
- case MSG_CB_MAX_SIM_COUNT_INT :
+ case MSG_CB_MAX_SIM_COUNT_INT:
*value = cb_opt_data->maxSimCnt;
break;
- case MSG_CB_SIM_INDEX_INT :
+ case MSG_CB_SIM_INDEX_INT:
*value = cb_opt_data->simIndex;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_CBMSG_OPT_HIDDEN_S *cb_opt_data = (MSG_CBMSG_OPT_HIDDEN_S *)cb_opt;
switch (field) {
- case MSG_CB_MAX_SIM_COUNT_INT :
+ case MSG_CB_MAX_SIM_COUNT_INT:
cb_opt_data->maxSimCnt = value;
break;
- case MSG_CB_SIM_INDEX_INT :
+ case MSG_CB_SIM_INDEX_INT:
cb_opt_data->simIndex = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_CBMSG_OPT_HIDDEN_S *cb_opt_data = (MSG_CBMSG_OPT_HIDDEN_S *)cb_opt;
switch (field) {
- case MSG_CB_RECEIVE_BOOL :
+ case MSG_CB_RECEIVE_BOOL:
*value = cb_opt_data->bReceive;
break;
- case MSG_CB_LANGUAGE_TYPE_ALL_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_ALL_BOOL:
*value = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_ALL];
break;
- case MSG_CB_LANGUAGE_TYPE_ENG_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_ENG_BOOL:
*value = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_ENG];
break;
- case MSG_CB_LANGUAGE_TYPE_GER_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_GER_BOOL:
*value = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_GER];
break;
- case MSG_CB_LANGUAGE_TYPE_FRE_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_FRE_BOOL:
*value = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_FRE];
break;
- case MSG_CB_LANGUAGE_TYPE_ITA_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_ITA_BOOL:
*value = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_ITA];
break;
- case MSG_CB_LANGUAGE_TYPE_NED_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_NED_BOOL:
*value = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_NED];
break;
- case MSG_CB_LANGUAGE_TYPE_SPA_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_SPA_BOOL:
*value = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_SPA];
break;
- case MSG_CB_LANGUAGE_TYPE_POR_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_POR_BOOL:
*value = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_POR];
break;
- case MSG_CB_LANGUAGE_TYPE_SWE_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_SWE_BOOL:
*value = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_SWE];
break;
- case MSG_CB_LANGUAGE_TYPE_TUR_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_TUR_BOOL:
*value = cb_opt_data->bLanguage[MSG_CBLANG_TYPE_TUR];
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_CBMSG_OPT_HIDDEN_S *cb_opt_data = (MSG_CBMSG_OPT_HIDDEN_S *)cb_opt;
switch (field) {
- case MSG_CB_RECEIVE_BOOL :
+ case MSG_CB_RECEIVE_BOOL:
cb_opt_data->bReceive = value;
break;
- case MSG_CB_LANGUAGE_TYPE_ALL_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_ALL_BOOL:
cb_opt_data->bLanguage[MSG_CBLANG_TYPE_ALL] = value;
break;
- case MSG_CB_LANGUAGE_TYPE_ENG_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_ENG_BOOL:
cb_opt_data->bLanguage[MSG_CBLANG_TYPE_ENG] = value;
break;
- case MSG_CB_LANGUAGE_TYPE_GER_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_GER_BOOL:
cb_opt_data->bLanguage[MSG_CBLANG_TYPE_GER] = value;
break;
- case MSG_CB_LANGUAGE_TYPE_FRE_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_FRE_BOOL:
cb_opt_data->bLanguage[MSG_CBLANG_TYPE_FRE] = value;
break;
- case MSG_CB_LANGUAGE_TYPE_ITA_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_ITA_BOOL:
cb_opt_data->bLanguage[MSG_CBLANG_TYPE_ITA] = value;
break;
- case MSG_CB_LANGUAGE_TYPE_NED_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_NED_BOOL:
cb_opt_data->bLanguage[MSG_CBLANG_TYPE_NED] = value;
break;
- case MSG_CB_LANGUAGE_TYPE_SPA_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_SPA_BOOL:
cb_opt_data->bLanguage[MSG_CBLANG_TYPE_SPA] = value;
break;
- case MSG_CB_LANGUAGE_TYPE_POR_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_POR_BOOL:
cb_opt_data->bLanguage[MSG_CBLANG_TYPE_POR] = value;
break;
- case MSG_CB_LANGUAGE_TYPE_SWE_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_SWE_BOOL:
cb_opt_data->bLanguage[MSG_CBLANG_TYPE_SWE] = value;
break;
- case MSG_CB_LANGUAGE_TYPE_TUR_BOOL :
+ case MSG_CB_LANGUAGE_TYPE_TUR_BOOL:
cb_opt_data->bLanguage[MSG_CBLANG_TYPE_TUR] = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
int ret = MSG_SUCCESS;
switch (field) {
- case MSG_CB_CHANNEL_LIST_STRUCT :
+ case MSG_CB_CHANNEL_LIST_STRUCT:
*value = (void *)cb_opt_data->channelData;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_CB_CHANNEL_INFO_S *cb_ch_data = (MSG_CB_CHANNEL_INFO_S *)cb_ch_info;
switch (field) {
- case MSG_CB_CHANNEL_ID_FROM_INT :
+ case MSG_CB_CHANNEL_ID_FROM_INT:
*value = cb_ch_data->from;
break;
- case MSG_CB_CHANNEL_ID_TO_INT :
+ case MSG_CB_CHANNEL_ID_TO_INT:
*value = cb_ch_data->to;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_CB_CHANNEL_INFO_S *cb_ch_data = (MSG_CB_CHANNEL_INFO_S *)cb_ch_info;
switch (field) {
- case MSG_CB_CHANNEL_ID_FROM_INT :
+ case MSG_CB_CHANNEL_ID_FROM_INT:
cb_ch_data->from = value;
break;
- case MSG_CB_CHANNEL_ID_TO_INT :
+ case MSG_CB_CHANNEL_ID_TO_INT:
cb_ch_data->to = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_CB_CHANNEL_INFO_S *cb_ch_data = (MSG_CB_CHANNEL_INFO_S *)cb_ch_info;
switch (field) {
- case MSG_CB_CHANNEL_ACTIVATE_BOOL :
+ case MSG_CB_CHANNEL_ACTIVATE_BOOL:
*value = cb_ch_data->bActivate;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_CB_CHANNEL_INFO_S *cb_ch_data = (MSG_CB_CHANNEL_INFO_S *)cb_ch_info;
switch (field) {
- case MSG_CB_CHANNEL_ACTIVATE_BOOL :
+ case MSG_CB_CHANNEL_ACTIVATE_BOOL:
cb_ch_data->bActivate = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_CB_CHANNEL_INFO_S *cb_ch_data = (MSG_CB_CHANNEL_INFO_S *)cb_ch_info;
switch (field) {
- case MSG_CB_CHANNEL_NAME_STR :
+ case MSG_CB_CHANNEL_NAME_STR:
strncpy(value, cb_ch_data->name, size);
break;
- default :
+ default:
return MSG_ERR_INVALID_PARAMETER;
}
MSG_CB_CHANNEL_INFO_S *cb_ch_data = (MSG_CB_CHANNEL_INFO_S *)cb_ch_info;
switch (field) {
- case MSG_CB_CHANNEL_NAME_STR :
+ case MSG_CB_CHANNEL_NAME_STR:
bzero(cb_ch_data->name, sizeof(cb_ch_data->name));
snprintf(cb_ch_data->name, sizeof(cb_ch_data->name), "%s", val);
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_SMS_SENDOPT_S *send_opt = (MSG_SMS_SENDOPT_S *)sms_send_opt;
switch (field) {
- case MSG_SMS_SENDOPT_ENCODE_TYPE_INT :
+ case MSG_SMS_SENDOPT_ENCODE_TYPE_INT:
*value = send_opt->dcs;
break;
- case MSG_SMS_SENDOPT_NETWORK_MODE_INT :
+ case MSG_SMS_SENDOPT_NETWORK_MODE_INT:
*value = send_opt->netMode;
break;
- case MSG_SMS_SENDOPT_SAVE_STORAGE_INT :
+ case MSG_SMS_SENDOPT_SAVE_STORAGE_INT:
*value = send_opt->saveStorage;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_SMS_SENDOPT_S *send_opt = (MSG_SMS_SENDOPT_S *)sms_send_opt;
switch (field) {
- case MSG_SMS_SENDOPT_ENCODE_TYPE_INT :
+ case MSG_SMS_SENDOPT_ENCODE_TYPE_INT:
send_opt->dcs = value;
break;
- case MSG_SMS_SENDOPT_NETWORK_MODE_INT :
+ case MSG_SMS_SENDOPT_NETWORK_MODE_INT:
send_opt->netMode = value;
break;
- case MSG_SMS_SENDOPT_SAVE_STORAGE_INT :
+ case MSG_SMS_SENDOPT_SAVE_STORAGE_INT:
send_opt->saveStorage = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_SMS_SENDOPT_S *send_opt = (MSG_SMS_SENDOPT_S *)sms_send_opt;
switch (field) {
- case MSG_SMS_SENDOPT_REPLY_PATH_BOOL :
+ case MSG_SMS_SENDOPT_REPLY_PATH_BOOL:
*value = send_opt->bReplyPath;
break;
- case MSG_SMS_SENDOPT_DELIVERY_REPORT_BOOL :
+ case MSG_SMS_SENDOPT_DELIVERY_REPORT_BOOL:
*value = send_opt->bDeliveryReport;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_SMS_SENDOPT_S *send_opt = (MSG_SMS_SENDOPT_S *)sms_send_opt;
switch (field) {
- case MSG_SMS_SENDOPT_REPLY_PATH_BOOL :
+ case MSG_SMS_SENDOPT_REPLY_PATH_BOOL:
send_opt->bReplyPath = value;
break;
- case MSG_SMS_SENDOPT_DELIVERY_REPORT_BOOL :
+ case MSG_SMS_SENDOPT_DELIVERY_REPORT_BOOL:
send_opt->bDeliveryReport = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MMS_SENDOPT_S *send_opt = (MSG_MMS_SENDOPT_S *)mms_send_opt;
switch (field) {
- case MSG_MMS_SENDOPT_CLASS_TYPE_INT :
+ case MSG_MMS_SENDOPT_CLASS_TYPE_INT:
*value = send_opt->msgClass;
break;
- case MSG_MMS_SENDOPT_PRIORITY_TYPE_INT :
+ case MSG_MMS_SENDOPT_PRIORITY_TYPE_INT:
*value = send_opt->priority;
break;
- case MSG_MMS_SENDOPT_EXPIRY_TIME_INT :
+ case MSG_MMS_SENDOPT_EXPIRY_TIME_INT:
*value = send_opt->expiryTime;
break;
- case MSG_MMS_SENDOPT_DELIVERY_TIME_INT :
+ case MSG_MMS_SENDOPT_DELIVERY_TIME_INT:
*value = send_opt->deliveryTime;
break;
- case MSG_MMS_SENDOPT_CUSTOM_DELIVERY_TIME_INT :
+ case MSG_MMS_SENDOPT_CUSTOM_DELIVERY_TIME_INT:
*value = send_opt->customDeliveryTime;
break;
- case MSG_MMS_SENDOPT_REPLY_CHARGING_INT :
+ case MSG_MMS_SENDOPT_REPLY_CHARGING_INT:
*value = send_opt->replyCharging;
break;
- case MSG_MMS_SENDOPT_REPLY_CHARGING_DEADLINE_INT :
+ case MSG_MMS_SENDOPT_REPLY_CHARGING_DEADLINE_INT:
*value = send_opt->replyChargingDeadline;
break;
- case MSG_MMS_SENDOPT_REPLY_CHARGING_SIZE_INT :
+ case MSG_MMS_SENDOPT_REPLY_CHARGING_SIZE_INT:
*value = send_opt->replyChargingSize;
break;
- case MSG_MMS_SENDOPT_CREATION_MODE_INT :
+ case MSG_MMS_SENDOPT_CREATION_MODE_INT:
*value = send_opt->creationMode;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MMS_SENDOPT_S *send_opt = (MSG_MMS_SENDOPT_S *)mms_send_opt;
switch (field) {
- case MSG_MMS_SENDOPT_CLASS_TYPE_INT :
+ case MSG_MMS_SENDOPT_CLASS_TYPE_INT:
send_opt->msgClass = value;
break;
- case MSG_MMS_SENDOPT_PRIORITY_TYPE_INT :
+ case MSG_MMS_SENDOPT_PRIORITY_TYPE_INT:
send_opt->priority = value;
break;
- case MSG_MMS_SENDOPT_EXPIRY_TIME_INT :
+ case MSG_MMS_SENDOPT_EXPIRY_TIME_INT:
send_opt->expiryTime = value;
break;
- case MSG_MMS_SENDOPT_DELIVERY_TIME_INT :
+ case MSG_MMS_SENDOPT_DELIVERY_TIME_INT:
send_opt->deliveryTime = value;
break;
- case MSG_MMS_SENDOPT_CUSTOM_DELIVERY_TIME_INT :
+ case MSG_MMS_SENDOPT_CUSTOM_DELIVERY_TIME_INT:
send_opt->customDeliveryTime = value;
break;
- case MSG_MMS_SENDOPT_REPLY_CHARGING_INT :
+ case MSG_MMS_SENDOPT_REPLY_CHARGING_INT:
send_opt->replyCharging = value;
break;
- case MSG_MMS_SENDOPT_REPLY_CHARGING_DEADLINE_INT :
+ case MSG_MMS_SENDOPT_REPLY_CHARGING_DEADLINE_INT:
send_opt->replyChargingDeadline = value;
break;
- case MSG_MMS_SENDOPT_REPLY_CHARGING_SIZE_INT :
+ case MSG_MMS_SENDOPT_REPLY_CHARGING_SIZE_INT:
send_opt->replyChargingSize = value;
break;
- case MSG_MMS_SENDOPT_CREATION_MODE_INT :
+ case MSG_MMS_SENDOPT_CREATION_MODE_INT:
send_opt->creationMode = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MMS_SENDOPT_S *send_opt = (MSG_MMS_SENDOPT_S *)mms_send_opt;
switch (field) {
- case MSG_MMS_SENDOPT_SENDER_VISIBILITY_BOOL :
+ case MSG_MMS_SENDOPT_SENDER_VISIBILITY_BOOL:
*value = send_opt->bSenderVisibility;
break;
- case MSG_MMS_SENDOPT_DELIVERY_REPORT_BOOL :
+ case MSG_MMS_SENDOPT_DELIVERY_REPORT_BOOL:
*value = send_opt->bDeliveryReport;
break;
- case MSG_MMS_SENDOPT_READ_REPLY_BOOL :
+ case MSG_MMS_SENDOPT_READ_REPLY_BOOL:
*value = send_opt->bReadReply;
break;
- case MSG_MMS_SENDOPT_KEEP_COPY_BOOL :
+ case MSG_MMS_SENDOPT_KEEP_COPY_BOOL:
*value = send_opt->bKeepCopy;
break;
- case MSG_MMS_SENDOPT_BODY_REPLYING_BOOL :
+ case MSG_MMS_SENDOPT_BODY_REPLYING_BOOL:
*value = send_opt->bBodyReplying;
break;
- case MSG_MMS_SENDOPT_HIDE_RECIPIENTS_BOOL :
+ case MSG_MMS_SENDOPT_HIDE_RECIPIENTS_BOOL:
*value = send_opt->bHideRecipients;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MMS_SENDOPT_S *send_opt = (MSG_MMS_SENDOPT_S *)mms_send_opt;
switch (field) {
- case MSG_MMS_SENDOPT_SENDER_VISIBILITY_BOOL :
+ case MSG_MMS_SENDOPT_SENDER_VISIBILITY_BOOL:
send_opt->bSenderVisibility = value;
break;
- case MSG_MMS_SENDOPT_DELIVERY_REPORT_BOOL :
+ case MSG_MMS_SENDOPT_DELIVERY_REPORT_BOOL:
send_opt->bDeliveryReport = value;
break;
- case MSG_MMS_SENDOPT_READ_REPLY_BOOL :
+ case MSG_MMS_SENDOPT_READ_REPLY_BOOL:
send_opt->bReadReply = value;
break;
- case MSG_MMS_SENDOPT_KEEP_COPY_BOOL :
+ case MSG_MMS_SENDOPT_KEEP_COPY_BOOL:
send_opt->bKeepCopy = value;
break;
- case MSG_MMS_SENDOPT_BODY_REPLYING_BOOL :
+ case MSG_MMS_SENDOPT_BODY_REPLYING_BOOL:
send_opt->bBodyReplying = value;
break;
- case MSG_MMS_SENDOPT_HIDE_RECIPIENTS_BOOL :
+ case MSG_MMS_SENDOPT_HIDE_RECIPIENTS_BOOL:
send_opt->bHideRecipients = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MMS_RECVOPT_S *recv_opt = (MSG_MMS_RECVOPT_S *)mms_recv_opt;
switch (field) {
- case MSG_MMS_RECVOPT_HOME_RETRIEVE_TYPE_INT :
+ case MSG_MMS_RECVOPT_HOME_RETRIEVE_TYPE_INT:
*value = recv_opt->homeNetwork;
break;
- case MSG_MMS_RECVOPT_ABROAD_RETRIEVE_TYPE_INT :
+ case MSG_MMS_RECVOPT_ABROAD_RETRIEVE_TYPE_INT:
*value = recv_opt->abroadNetwok;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MMS_RECVOPT_S *recv_opt = (MSG_MMS_RECVOPT_S *)mms_recv_opt;
switch (field) {
- case MSG_MMS_RECVOPT_HOME_RETRIEVE_TYPE_INT :
+ case MSG_MMS_RECVOPT_HOME_RETRIEVE_TYPE_INT:
recv_opt->homeNetwork = value;
break;
- case MSG_MMS_RECVOPT_ABROAD_RETRIEVE_TYPE_INT :
+ case MSG_MMS_RECVOPT_ABROAD_RETRIEVE_TYPE_INT:
recv_opt->abroadNetwok = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MMS_RECVOPT_S *recv_opt = (MSG_MMS_RECVOPT_S *)mms_recv_opt;
switch (field) {
- case MSG_MMS_RECVOPT_READ_REPORT_BOOL :
+ case MSG_MMS_RECVOPT_READ_REPORT_BOOL:
*value = recv_opt->readReceipt;
break;
- case MSG_MMS_RECVOPT_DELIVERY_REPORT_BOOL :
+ case MSG_MMS_RECVOPT_DELIVERY_REPORT_BOOL:
*value = recv_opt->bDeliveryReceipt;
break;
- case MSG_MMS_RECVOPT_REJECT_UNKNOWN_BOOL :
+ case MSG_MMS_RECVOPT_REJECT_UNKNOWN_BOOL:
*value = recv_opt->bRejectUnknown;
break;
- case MSG_MMS_RECVOPT_REJECT_ADVERTISEMENT_BOOL :
+ case MSG_MMS_RECVOPT_REJECT_ADVERTISEMENT_BOOL:
*value = recv_opt->bRejectAdvertisement;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MMS_RECVOPT_S *recv_opt = (MSG_MMS_RECVOPT_S *)mms_recv_opt;
switch (field) {
- case MSG_MMS_RECVOPT_READ_REPORT_BOOL :
+ case MSG_MMS_RECVOPT_READ_REPORT_BOOL:
recv_opt->readReceipt = value;
break;
- case MSG_MMS_RECVOPT_DELIVERY_REPORT_BOOL :
+ case MSG_MMS_RECVOPT_DELIVERY_REPORT_BOOL:
recv_opt->bDeliveryReceipt = value;
break;
- case MSG_MMS_RECVOPT_REJECT_UNKNOWN_BOOL :
+ case MSG_MMS_RECVOPT_REJECT_UNKNOWN_BOOL:
recv_opt->bRejectUnknown = value;
break;
- case MSG_MMS_RECVOPT_REJECT_ADVERTISEMENT_BOOL :
+ case MSG_MMS_RECVOPT_REJECT_ADVERTISEMENT_BOOL:
recv_opt->bRejectAdvertisement = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_PUSHMSG_OPT_S *push_opt = (MSG_PUSHMSG_OPT_S *)push_msg_opt;
switch (field) {
- case MSG_PUSHMSG_SERVICE_TYPE_INT :
+ case MSG_PUSHMSG_SERVICE_TYPE_INT:
*value = push_opt->serviceType;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_PUSHMSG_OPT_S *push_opt = (MSG_PUSHMSG_OPT_S *)push_msg_opt;
switch (field) {
- case MSG_PUSHMSG_SERVICE_TYPE_INT :
+ case MSG_PUSHMSG_SERVICE_TYPE_INT:
push_opt->serviceType = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_PUSHMSG_OPT_S *push_opt = (MSG_PUSHMSG_OPT_S *)push_msg_opt;
switch (field) {
- case MSG_PUSHMSG_RECEIVE_BOOL :
+ case MSG_PUSHMSG_RECEIVE_BOOL:
*value = push_opt->bReceive;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_PUSHMSG_OPT_S *push_opt = (MSG_PUSHMSG_OPT_S *)push_msg_opt;
switch (field) {
- case MSG_PUSHMSG_RECEIVE_BOOL :
+ case MSG_PUSHMSG_RECEIVE_BOOL:
push_opt->bReceive = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_VOICEMAIL_OPT_S *voice_opt = (MSG_VOICEMAIL_OPT_S *)voice_msg_opt;
switch (field) {
- case MSG_VOICEMSG_SIM_INDEX_INT :
+ case MSG_VOICEMSG_SIM_INDEX_INT:
*value = voice_opt->simIndex;
break;
- case MSG_VOICEMSG_VOICE_COUNT_INT :
+ case MSG_VOICEMSG_VOICE_COUNT_INT:
*value = voice_opt->voiceCnt;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_VOICEMAIL_OPT_S *voice_opt = (MSG_VOICEMAIL_OPT_S *)voice_msg_opt;
switch (field) {
- case MSG_VOICEMSG_SIM_INDEX_INT :
+ case MSG_VOICEMSG_SIM_INDEX_INT:
voice_opt->simIndex = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_VOICEMAIL_OPT_S *voice_opt = (MSG_VOICEMAIL_OPT_S *)voice_msg_opt;
switch (field) {
- case MSG_VOICEMSG_ADDRESS_STR :
+ case MSG_VOICEMSG_ADDRESS_STR:
strncpy(value, voice_opt->mailNumber, size);
break;
- case MSG_VOICEMSG_ALPHA_ID_STR :
+ case MSG_VOICEMSG_ALPHA_ID_STR:
strncpy(value, voice_opt->alpahId, size);
break;
- default :
+ default:
return MSG_ERR_INVALID_PARAMETER;
}
MSG_VOICEMAIL_OPT_S *voice_opt = (MSG_VOICEMAIL_OPT_S *)voice_msg_opt;
switch (field) {
- case MSG_VOICEMSG_ADDRESS_STR :
+ case MSG_VOICEMSG_ADDRESS_STR:
bzero(voice_opt->mailNumber, sizeof(voice_opt->mailNumber));
snprintf(voice_opt->mailNumber, sizeof(voice_opt->mailNumber), "%s", val);
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_GENERAL_OPT_S *opt = (MSG_GENERAL_OPT_S *)general_opt;
switch (field) {
- case MSG_GENERAL_ALERT_TONE_INT :
+ case MSG_GENERAL_ALERT_TONE_INT:
*value = opt->alertTone;
break;
- case MSG_GENERAL_SMS_LIMIT_CNT_INT :
+ case MSG_GENERAL_SMS_LIMIT_CNT_INT:
*value = opt->smsLimitCnt;
break;
- case MSG_GENERAL_MMS_LIMIT_CNT_INT :
+ case MSG_GENERAL_MMS_LIMIT_CNT_INT:
*value = opt->mmsLimitCnt;
break;
- case MSG_GENERAL_RINGTONE_TYPE_INT :
+ case MSG_GENERAL_RINGTONE_TYPE_INT:
*value = opt->ringtoneType;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_GENERAL_OPT_S *opt = (MSG_GENERAL_OPT_S *)general_opt;
switch (field) {
- case MSG_GENERAL_ALERT_TONE_INT :
+ case MSG_GENERAL_ALERT_TONE_INT:
opt->alertTone = value;
break;
- case MSG_GENERAL_SMS_LIMIT_CNT_INT :
+ case MSG_GENERAL_SMS_LIMIT_CNT_INT:
opt->smsLimitCnt = value;
break;
- case MSG_GENERAL_MMS_LIMIT_CNT_INT :
+ case MSG_GENERAL_MMS_LIMIT_CNT_INT:
opt->mmsLimitCnt = value;
break;
- case MSG_GENERAL_RINGTONE_TYPE_INT :
+ case MSG_GENERAL_RINGTONE_TYPE_INT:
opt->ringtoneType = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_GENERAL_OPT_S *opt = (MSG_GENERAL_OPT_S *)general_opt;
switch (field) {
- case MSG_GENERAL_KEEP_COPY_BOOL :
+ case MSG_GENERAL_KEEP_COPY_BOOL:
*value = opt->bKeepCopy;
break;
- case MSG_GENERAL_AUTO_ERASE_BOOL :
+ case MSG_GENERAL_AUTO_ERASE_BOOL:
*value = opt->bAutoErase;
break;
- case MSG_GENERAL_BLOCK_UNKNOWN_NUMBER_BOOL :
+ case MSG_GENERAL_BLOCK_UNKNOWN_NUMBER_BOOL:
*value = opt->bBlockUnknownMsg;
break;
- case MSG_GENERAL_MSG_NOTIFICATION_BOOL :
+ case MSG_GENERAL_MSG_NOTIFICATION_BOOL:
*value = opt->bNotification;
break;
- case MSG_GENERAL_MSG_VIBRATION_BOOL :
+ case MSG_GENERAL_MSG_VIBRATION_BOOL:
*value = opt->bVibration;
break;
- case MSG_GENERAL_MSG_PREVIEW_BOOL :
+ case MSG_GENERAL_MSG_PREVIEW_BOOL:
*value = opt->bPreview;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_GENERAL_OPT_S *opt = (MSG_GENERAL_OPT_S *)general_opt;
switch (field) {
- case MSG_GENERAL_KEEP_COPY_BOOL :
+ case MSG_GENERAL_KEEP_COPY_BOOL:
opt->bKeepCopy = value;
break;
- case MSG_GENERAL_AUTO_ERASE_BOOL :
+ case MSG_GENERAL_AUTO_ERASE_BOOL:
opt->bAutoErase = value;
break;
- case MSG_GENERAL_BLOCK_UNKNOWN_NUMBER_BOOL :
+ case MSG_GENERAL_BLOCK_UNKNOWN_NUMBER_BOOL:
opt->bBlockUnknownMsg = value;
break;
- case MSG_GENERAL_MSG_NOTIFICATION_BOOL :
+ case MSG_GENERAL_MSG_NOTIFICATION_BOOL:
opt->bNotification = value;
break;
- case MSG_GENERAL_MSG_VIBRATION_BOOL :
+ case MSG_GENERAL_MSG_VIBRATION_BOOL:
opt->bVibration = value;
break;
- case MSG_GENERAL_MSG_PREVIEW_BOOL :
+ case MSG_GENERAL_MSG_PREVIEW_BOOL:
opt->bPreview = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_GENERAL_OPT_S *opt = (MSG_GENERAL_OPT_S *)general_opt;
switch (field) {
- case MSG_GENERAL_RINGTONE_PATH_STR :
+ case MSG_GENERAL_RINGTONE_PATH_STR:
strncpy(value, opt->ringtonePath, size);
break;
- default :
+ default:
return MSG_ERR_INVALID_PARAMETER;
}
MSG_GENERAL_OPT_S *opt = (MSG_GENERAL_OPT_S *)general_opt;
switch (field) {
- case MSG_GENERAL_RINGTONE_PATH_STR :
+ case MSG_GENERAL_RINGTONE_PATH_STR:
bzero(opt->ringtonePath, sizeof(opt->ringtonePath));
snprintf(opt->ringtonePath, sizeof(opt->ringtonePath), "%s", val);
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MSGSIZE_OPT_S *msg_opt = (MSG_MSGSIZE_OPT_S *)size_opt;
switch (field) {
- case MSG_MESSAGE_SIZE_INT :
+ case MSG_MESSAGE_SIZE_INT:
*value = msg_opt->nMsgSize;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
MSG_MSGSIZE_OPT_S *msg_opt = (MSG_MSGSIZE_OPT_S *)size_opt;
switch (field) {
- case MSG_MESSAGE_SIZE_INT :
+ case MSG_MESSAGE_SIZE_INT:
msg_opt->nMsgSize = value;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
msg_set_mms_struct((msg_struct_t)msg_s, mms_data);
msg_release_struct(&mms_data);
-/*
-* MMS_MESSAGE_DATA_S* mms_data;
-* MMS_PAGE_S* page[2];
-* MMS_MEDIA_S* media[5];
-*
-* mms_data = msg_mms_create_message();
-*
-* msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
-* msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
-* msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
-*
-* ------------> 1st Slide Composing
-* page[0] = msg_mms_add_page(mms_data, 5440);
-*
-* media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
-* media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
-* media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
-* media[2]->sMedia.sText.nColor = 0x000000;
-* media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-* media[2]->sMedia.sText.bBold = true;
-*
-* ------------> 2nd Slide Composing
-* page[1] = msg_mms_add_page(mms_data, 4544);
-*
-* media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
-* media[3]->sMedia.sText.nColor = 0x000000;
-* media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
-* media[3]->sMedia.sText.bItalic = true;
-* media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
-* strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
-*
-* //FIXME msg_mms_set_message_body((msg_message_t)&msgInfo, mms_data);
-*
-* msg_mms_destroy_message(mms_data);
-*/
+#if 0
+ MMS_MESSAGE_DATA_S* mms_data;
+ MMS_PAGE_S* page[2];
+ MMS_MEDIA_S* media[5];
+
+ mms_data = msg_mms_create_message();
+
+ msg_mms_set_rootlayout(mms_data, 100, 100, 0xffffff);
+ msg_mms_add_region(mms_data, "Image", 0, 50, 100, 50, 0xffffff);
+ msg_mms_add_region(mms_data, "Text", 0, 0, 100, 50, 0xffffff);
+
+ /* ------------> 1st Slide Composing */
+ page[0] = msg_mms_add_page(mms_data, 5440);
+
+ media[0] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_IMG, "Image", (char*)"/opt/etc/msg-service/P091120_104633.jpg");
+ media[1] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_AUDIO, NULL, (char*)"/opt/etc/msg-service/audio.amr");
+ media[2] = msg_mms_add_media(page[0], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp0_2.txt");
+ media[2]->sMedia.sText.nColor = 0x000000;
+ media[2]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
+ media[2]->sMedia.sText.bBold = true;
+
+ /* ------------> 2nd Slide Composing */
+ page[1] = msg_mms_add_page(mms_data, 4544);
+
+ media[3] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_TEXT, "Text", (char*)"/opt/etc/msg-service/Temp1_0.txt");
+ media[3]->sMedia.sText.nColor = 0x000000;
+ media[3]->sMedia.sText.nSize = MMS_SMIL_FONT_SIZE_NORMAL;
+ media[3]->sMedia.sText.bItalic = true;
+ media[4] = msg_mms_add_media(page[1], MMS_SMIL_MEDIA_VIDEO, "Text", (char*)"/opt/etc/msg-service/V091120_104905.3gp");
+ strncpy(media[4]->szAlt, "Video Load Fail", MAX_SMIL_ALT_LEN-1);
+
+ /* FIXME msg_mms_set_message_body((msg_message_t)&msgInfo, mms_data); */
+
+ msg_mms_destroy_message(mms_data);
+#endif
}
/*err = msg_add_message(handle, (msg_message_t)&msgInfo, &sendingOpt);*/
if (ret != PRIV_MGR_ERROR_SUCCESS)
return MSG_ERR_PERMISSION_DENIED;
- if (handle == NULL || opq_msg == NULL ) {
+ if (handle == NULL || opq_msg == NULL) {
MSG_FATAL("handle or opq_msg is NULL");
return MSG_ERR_INVALID_PARAMETER;
}
}
return err;
-
}
EXPORT_API int msg_backup_message(msg_handle_t handle, msg_message_backup_type_t type, const char *backup_filepath)
if (ret != PRIV_MGR_ERROR_SUCCESS)
return MSG_ERR_PERMISSION_DENIED;
- if (handle == NULL || msg_thread == NULL ) {
+ if (handle == NULL || msg_thread == NULL) {
MSG_FATAL("handle or msg_thread is NULL");
return MSG_ERR_INVALID_PARAMETER;
}
{
if (mainType == MSG_SMS_TYPE) {
switch (subType) {
- case MSG_CB_SMS :
+ case MSG_CB_SMS:
return MSG_TYPE_SMS_CB;
- case MSG_JAVACB_SMS :
+ case MSG_JAVACB_SMS:
return MSG_TYPE_SMS_JAVACB;
- case MSG_WAP_SI_SMS :
- case MSG_WAP_SL_SMS :
+ case MSG_WAP_SI_SMS:
+ case MSG_WAP_SL_SMS:
return MSG_TYPE_SMS_WAPPUSH;
- case MSG_MWI_VOICE_SMS :
- case MSG_MWI_FAX_SMS :
- case MSG_MWI_EMAIL_SMS :
- case MSG_MWI_OTHER_SMS :
+ case MSG_MWI_VOICE_SMS:
+ case MSG_MWI_FAX_SMS:
+ case MSG_MWI_EMAIL_SMS:
+ case MSG_MWI_OTHER_SMS:
return MSG_TYPE_SMS_MWI;
- case MSG_SYNCML_CP :
+ case MSG_SYNCML_CP:
return MSG_TYPE_SMS_SYNCML;
- case MSG_REJECT_SMS :
+ case MSG_REJECT_SMS:
return MSG_TYPE_SMS_REJECT;
- case MSG_ETWS_SMS :
+ case MSG_ETWS_SMS:
return MSG_TYPE_SMS_ETWS_PRIMARY;
- case MSG_CMAS_PRESIDENTIAL :
+ case MSG_CMAS_PRESIDENTIAL:
return MSG_TYPE_SMS_CMAS_PRESIDENTIAL;
- case MSG_CMAS_EXTREME :
+ case MSG_CMAS_EXTREME:
return MSG_TYPE_SMS_CMAS_EXTREME;
- case MSG_CMAS_SEVERE :
+ case MSG_CMAS_SEVERE:
return MSG_TYPE_SMS_CMAS_SEVERE;
- case MSG_CMAS_AMBER :
+ case MSG_CMAS_AMBER:
return MSG_TYPE_SMS_CMAS_AMBER;
- case MSG_CMAS_TEST :
+ case MSG_CMAS_TEST:
return MSG_TYPE_SMS_CMAS_TEST;
- case MSG_CMAS_EXERCISE :
+ case MSG_CMAS_EXERCISE:
return MSG_TYPE_SMS_CMAS_EXERCISE;
- case MSG_CMAS_OPERATOR_DEFINED :
+ case MSG_CMAS_OPERATOR_DEFINED:
return MSG_TYPE_SMS_CMAS_OPERATOR_DEFINED;
- default :
+ default:
return MSG_TYPE_SMS;
}
} else if (mainType == MSG_MMS_TYPE) {
MSG_THREAD_VIEW_S *pThread = (MSG_THREAD_VIEW_S *)data;
switch (field) {
- case MSG_THREAD_ID_INT :
+ case MSG_THREAD_ID_INT:
*value = pThread->threadId;
break;
- case MSG_THREAD_MSG_TYPE_INT :
+ case MSG_THREAD_MSG_TYPE_INT:
*value = msg_get_msg_type(pThread->mainType, pThread->subType);
break;
- case MSG_THREAD_MSG_TIME_INT :
+ case MSG_THREAD_MSG_TIME_INT:
*value = pThread->threadTime;
break;
- case MSG_THREAD_DIRECTION_INT :
+ case MSG_THREAD_DIRECTION_INT:
*value = pThread->direction;
break;
- case MSG_THREAD_UNREAD_COUNT_INT :
+ case MSG_THREAD_UNREAD_COUNT_INT:
*value = pThread->unreadCnt;
break;
- case MSG_THREAD_SMS_COUNT_INT :
+ case MSG_THREAD_SMS_COUNT_INT:
*value = pThread->smsCnt;
break;
- case MSG_THREAD_MMS_COUNT_INT :
+ case MSG_THREAD_MMS_COUNT_INT:
*value = pThread->mmsCnt;
break;
default:
MSG_CONVERSATION_VIEW_S *pConv = (MSG_CONVERSATION_VIEW_S *)data;
switch (field) {
- case MSG_CONV_MSG_ID_INT :
+ case MSG_CONV_MSG_ID_INT:
*value = pConv->msgId;
break;
- case MSG_CONV_MSG_THREAD_ID_INT :
+ case MSG_CONV_MSG_THREAD_ID_INT:
*value = pConv->threadId;
break;
- case MSG_CONV_MSG_FOLDER_ID_INT :
+ case MSG_CONV_MSG_FOLDER_ID_INT:
*value = pConv->folderId;
break;
- case MSG_CONV_MSG_TYPE_INT :
+ case MSG_CONV_MSG_TYPE_INT:
*value = msg_get_msg_type(pConv->mainType, pConv->subType);
break;
- case MSG_CONV_MSG_STORAGE_ID_INT :
+ case MSG_CONV_MSG_STORAGE_ID_INT:
*value = pConv->storageId;
break;
- case MSG_CONV_MSG_DISPLAY_TIME_INT :
+ case MSG_CONV_MSG_DISPLAY_TIME_INT:
*value = pConv->displayTime;
break;
- case MSG_CONV_MSG_SCHEDULED_TIME_INT :
+ case MSG_CONV_MSG_SCHEDULED_TIME_INT:
*value = pConv->scheduledTime;
break;
- case MSG_CONV_MSG_NETWORK_STATUS_INT :
+ case MSG_CONV_MSG_NETWORK_STATUS_INT:
*value = pConv->networkStatus;
break;
- case MSG_CONV_MSG_DIRECTION_INT :
+ case MSG_CONV_MSG_DIRECTION_INT:
*value = pConv->direction;
break;
- case MSG_CONV_MSG_ATTACH_COUNT_INT :
+ case MSG_CONV_MSG_ATTACH_COUNT_INT:
*value = pConv->attachCount;
break;
- case MSG_CONV_MSG_TEXT_SIZE_INT :
+ case MSG_CONV_MSG_TEXT_SIZE_INT:
*value = pConv->textSize;
break;
- case MSG_CONV_MSG_PAGE_COUNT_INT :
+ case MSG_CONV_MSG_PAGE_COUNT_INT:
*value = pConv->pageCount;
break;
- case MSG_CONV_MSG_TCS_BC_LEVEL_INT :
+ case MSG_CONV_MSG_TCS_BC_LEVEL_INT:
*value = pConv->tcs_bc_level;
break;
- case MSG_CONV_MSG_SIM_INDEX_INT :
+ case MSG_CONV_MSG_SIM_INDEX_INT:
*value = pConv->simIndex;
break;
default:
MSG_THREAD_VIEW_S *pThread = (MSG_THREAD_VIEW_S *)data;
switch (field) {
- case MSG_THREAD_NAME_STR :
+ case MSG_THREAD_NAME_STR:
strncpy(value, pThread->threadName, size);
break;
- case MSG_THREAD_MSG_DATA_STR :
+ case MSG_THREAD_MSG_DATA_STR:
strncpy(value, pThread->threadData, size);
break;
default:
MSG_CONVERSATION_VIEW_S *pConv = (MSG_CONVERSATION_VIEW_S *)data;
switch (field) {
- case MSG_CONV_MSG_SUBJECT_STR :
+ case MSG_CONV_MSG_SUBJECT_STR:
strncpy(value, pConv->subject, size);
break;
- case MSG_CONV_MSG_ATTACH_NAME_STR :
+ case MSG_CONV_MSG_ATTACH_NAME_STR:
strncpy(value, pConv->attachFileName, size);
break;
- case MSG_CONV_MSG_AUDIO_NAME_STR :
+ case MSG_CONV_MSG_AUDIO_NAME_STR:
strncpy(value, pConv->audioFileName, size);
break;
- case MSG_CONV_MSG_IMAGE_THUMB_PATH_STR :
+ case MSG_CONV_MSG_IMAGE_THUMB_PATH_STR:
strncpy(value, pConv->imageThumbPath, size);
break;
- case MSG_CONV_MSG_VIDEO_THUMB_PATH_STR :
+ case MSG_CONV_MSG_VIDEO_THUMB_PATH_STR:
strncpy(value, pConv->videoThumbPath, size);
break;
- case MSG_CONV_MSG_TEXT_STR :
+ case MSG_CONV_MSG_TEXT_STR:
if (pConv->pText)
strncpy(value, pConv->pText, size);
break;
- case MSG_CONV_MSG_1ST_MEDIA_PATH_STR :
+ case MSG_CONV_MSG_1ST_MEDIA_PATH_STR:
strncpy(value, pConv->firstMediaPath, size);
break;
default:
case MSG_THREAD_PROTECTED_BOOL:
*value = pthreadInfo->bProtected;
break;
- case MSG_THREAD_DRAFT_BOOL :
+ case MSG_THREAD_DRAFT_BOOL:
*value = pthreadInfo->bDraft;
break;
- case MSG_THREAD_SEND_FAILED_BOOL :
+ case MSG_THREAD_SEND_FAILED_BOOL:
*value = pthreadInfo->bSendFailed;
break;
- case MSG_THREAD_SENDING_BOOL :
+ case MSG_THREAD_SENDING_BOOL:
*value = pthreadInfo->bSending;
break;
default:
case MSG_LIST_CONDITION_PROTECTED_BOOL:
*value = pCond->bProtected;
break;
- case MSG_LIST_CONDITION_SCHEDULED_BOOL :
+ case MSG_LIST_CONDITION_SCHEDULED_BOOL:
*value = pCond->bScheduled;
break;
- case MSG_LIST_CONDITION_AND_OPERATER_BOOL :
+ case MSG_LIST_CONDITION_AND_OPERATER_BOOL:
*value = pCond->bAnd;
break;
default:
int msg_syncml_info_set_int(void *syncml_info, int field, int value)
{
-
msg_error_t err = MSG_SUCCESS;
if (!syncml_info)
msg_struct_s *pTmp = NULL;
switch (field) {
- case MSG_SYNCML_INFO_MESSAGE_HND:
- {
+ case MSG_SYNCML_INFO_MESSAGE_HND: {
pTmp = (msg_struct_s *)pSync->msg;
MSG_MESSAGE_HIDDEN_S *pSrc = (MSG_MESSAGE_HIDDEN_S *)value->data;
MSG_MESSAGE_HIDDEN_S *pDst = (MSG_MESSAGE_HIDDEN_S *)pTmp->data;
case MSG_MEDIA_MESSAGE_ID_INT:
*value = pMedia->msg_id;
break;
- default :
+ default:
ret = MSG_ERR_INVALID_PARAMETER;
break;
}
msg_struct->data = NULL;
switch (field) {
- case MSG_STRUCT_MESSAGE_INFO :
+ case MSG_STRUCT_MESSAGE_INFO:
msg_message_create_struct(msg_struct);
break;
- case MSG_STRUCT_CONV_INFO:
- {
+ case MSG_STRUCT_CONV_INFO: {
msg_struct->data = (void *)new MSG_CONVERSATION_VIEW_S;
memset(msg_struct->data, 0x00, sizeof(MSG_CONVERSATION_VIEW_S));
break;
}
- case MSG_STRUCT_FILTER:
- {
+ case MSG_STRUCT_FILTER: {
msg_struct->data = (void *)new MSG_FILTER_S;
memset(msg_struct->data, 0x00, sizeof(MSG_FILTER_S));
break;
}
- case MSG_STRUCT_THREAD_INFO:
- {
+ case MSG_STRUCT_THREAD_INFO: {
msg_struct->data = (void *)new MSG_THREAD_VIEW_S;
memset(msg_struct->data, 0x00, sizeof(MSG_THREAD_VIEW_S));
break;
}
- case MSG_STRUCT_SENDOPT:
- {
+ case MSG_STRUCT_SENDOPT: {
MSG_SENDINGOPT_S *pOpt = (MSG_SENDINGOPT_S *)new MSG_SENDINGOPT_S;
memset(pOpt, 0x00, sizeof(MSG_SENDINGOPT_S));
msg_struct->data = pOpt;
memset(pSms->data, 0x00, sizeof(SMS_SENDINGOPT_S));
break;
}
- case MSG_STRUCT_SYNCML_INFO:
- {
- MSG_SYNCML_MESSAGE_S *pSyncML= (MSG_SYNCML_MESSAGE_S *)new MSG_SYNCML_MESSAGE_S;
+ case MSG_STRUCT_SYNCML_INFO: {
+ MSG_SYNCML_MESSAGE_S *pSyncML = (MSG_SYNCML_MESSAGE_S *)new MSG_SYNCML_MESSAGE_S;
memset(pSyncML, 0x00, sizeof(MSG_SYNCML_MESSAGE_S));
msg_struct->data = pSyncML;
break;
}
- case MSG_STRUCT_COUNT_INFO:
- {
+ case MSG_STRUCT_COUNT_INFO: {
msg_struct->data = new MSG_COUNT_INFO_S;
memset(msg_struct->data, 0x00, sizeof(MSG_COUNT_INFO_S));
break;
}
- case MSG_STRUCT_THREAD_COUNT_INFO:
- {
+ case MSG_STRUCT_THREAD_COUNT_INFO: {
msg_struct->data = new MSG_THREAD_COUNT_INFO_S;
memset(msg_struct->data, 0x00, sizeof(MSG_THREAD_COUNT_INFO_S));
break;
}
- case MSG_STRUCT_THREAD_LIST_INDEX:
- {
+ case MSG_STRUCT_THREAD_LIST_INDEX: {
MSG_THREAD_LIST_INDEX_INFO_S * pThread = (MSG_THREAD_LIST_INDEX_INFO_S *)new MSG_THREAD_LIST_INDEX_INFO_S;
memset(pThread, 0x00, sizeof(MSG_THREAD_LIST_INDEX_INFO_S));
break;
}
- case MSG_STRUCT_SORT_RULE:
- {
+ case MSG_STRUCT_SORT_RULE: {
msg_struct->data = new MSG_SORT_RULE_S;
memset(msg_struct->data, 0x00, sizeof(MSG_SORT_RULE_S));
break;
}
- case MSG_STRUCT_FOLDER_INFO:
- {
+ case MSG_STRUCT_FOLDER_INFO: {
msg_struct->data = new MSG_FOLDER_INFO_S;
memset(msg_struct->data, 0x00, sizeof(MSG_FOLDER_INFO_S));
break;
}
- case MSG_STRUCT_MSG_LIST_CONDITION:
- {
+ case MSG_STRUCT_MSG_LIST_CONDITION: {
msg_struct->data = new MSG_LIST_CONDITION_S;
memset(msg_struct->data, 0x00, sizeof(MSG_LIST_CONDITION_S));
break;
}
- case MSG_STRUCT_REPORT_STATUS_INFO:
- {
+ case MSG_STRUCT_REPORT_STATUS_INFO: {
msg_struct->data = new MSG_REPORT_STATUS_INFO_S;
memset(msg_struct->data, 0x00, sizeof(MSG_REPORT_STATUS_INFO_S));
break;
}
- case MSG_STRUCT_SETTING_SMSC_OPT :
- {
+ case MSG_STRUCT_SETTING_SMSC_OPT: {
msg_struct->data = new MSG_SMSC_LIST_HIDDEN_S;
memset(msg_struct->data, 0x00, sizeof(MSG_SMSC_LIST_HIDDEN_S));
}
break;
}
- case MSG_STRUCT_SETTING_SMSC_INFO :
- {
+ case MSG_STRUCT_SETTING_SMSC_INFO: {
msg_struct->data = new MSG_SMSC_DATA_S;
memset(msg_struct->data, 0x00, sizeof(MSG_SMSC_DATA_S));
break;
}
- case MSG_STRUCT_SETTING_CB_OPT :
- {
+ case MSG_STRUCT_SETTING_CB_OPT: {
msg_struct->data = new MSG_CBMSG_OPT_HIDDEN_S;
memset(msg_struct->data, 0x00, sizeof(MSG_CBMSG_OPT_HIDDEN_S));
}
break;
}
- case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
- {
+ case MSG_STRUCT_SETTING_CB_CHANNEL_INFO: {
msg_struct->data = new MSG_CB_CHANNEL_INFO_S;
memset(msg_struct->data, 0x00, sizeof(MSG_CB_CHANNEL_INFO_S));
break;
}
- case MSG_STRUCT_SETTING_SMS_SEND_OPT :
- {
+ case MSG_STRUCT_SETTING_SMS_SEND_OPT: {
msg_struct->data = new MSG_SMS_SENDOPT_S;
memset(msg_struct->data, 0x00, sizeof(MSG_SMS_SENDOPT_S));
break;
}
- case MSG_STRUCT_SETTING_MMS_SEND_OPT :
- {
+ case MSG_STRUCT_SETTING_MMS_SEND_OPT: {
msg_struct->data = new MSG_MMS_SENDOPT_S;
memset(msg_struct->data, 0x00, sizeof(MSG_MMS_SENDOPT_S));
break;
}
- case MSG_STRUCT_SETTING_MMS_RECV_OPT :
- {
+ case MSG_STRUCT_SETTING_MMS_RECV_OPT: {
msg_struct->data = new MSG_MMS_RECVOPT_S;
memset(msg_struct->data, 0x00, sizeof(MSG_MMS_RECVOPT_S));
break;
}
- case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
- {
+ case MSG_STRUCT_SETTING_PUSH_MSG_OPT: {
msg_struct->data = new MSG_PUSHMSG_OPT_S;
memset(msg_struct->data, 0x00, sizeof(MSG_PUSHMSG_OPT_S));
break;
}
- case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
- {
+ case MSG_STRUCT_SETTING_VOICE_MSG_OPT: {
msg_struct->data = new MSG_VOICEMAIL_OPT_S;
memset(msg_struct->data, 0x00, sizeof(MSG_VOICEMAIL_OPT_S));
MSG_VOICEMAIL_OPT_S *pTmp = (MSG_VOICEMAIL_OPT_S *)msg_struct->data;
pTmp->simIndex = MSG_SIM_SLOT_ID_1; /* default sim index */
break;
}
- case MSG_STRUCT_SETTING_GENERAL_OPT :
- {
+ case MSG_STRUCT_SETTING_GENERAL_OPT: {
msg_struct->data = new MSG_GENERAL_OPT_S;
memset(msg_struct->data, 0x00, sizeof(MSG_GENERAL_OPT_S));
break;
}
- case MSG_STRUCT_SETTING_MSGSIZE_OPT :
- {
+ case MSG_STRUCT_SETTING_MSGSIZE_OPT: {
msg_struct->data = new MSG_MSGSIZE_OPT_S;
memset(msg_struct->data, 0x00, sizeof(MSG_MSGSIZE_OPT_S));
break;
}
- case MSG_STRUCT_SMS_SENDOPT:
- {
+ case MSG_STRUCT_SMS_SENDOPT: {
msg_struct->data = new SMS_SENDINGOPT_S;
memset(msg_struct->data, 0x00, sizeof(SMS_SENDINGOPT_S));
break;
}
- case MSG_STRUCT_MMS_SENDOPT:
- {
+ case MSG_STRUCT_MMS_SENDOPT: {
msg_struct->data = new MMS_SENDINGOPT_S;
memset(msg_struct->data, 0x00, sizeof(MMS_SENDINGOPT_S));
break;
}
- case MSG_STRUCT_REQUEST_INFO:
- {
+ case MSG_STRUCT_REQUEST_INFO: {
MSG_REQUEST_S *pRequest = (MSG_REQUEST_S *)new MSG_REQUEST_S;
memset(pRequest, 0x00, sizeof(MSG_REQUEST_S));
msg_struct->data = pRequest;
msg_struct->data = new MSG_PUSH_EVENT_INFO_S;
memset(msg_struct->data, 0x00, sizeof(MSG_PUSH_EVENT_INFO_S));
break;
- default :
+ default:
delete msg_struct;
return NULL;
break;
msg_struct_s *msg_struct = (msg_struct_s *)*msg_struct_handle;
switch (msg_struct->type) {
- case MSG_STRUCT_MESSAGE_INFO :
- {
+ case MSG_STRUCT_MESSAGE_INFO: {
msg_message_release(&msg_struct);
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_FILTER:
- {
+ case MSG_STRUCT_FILTER: {
delete (MSG_FILTER_S*)(msg_struct->data);
msg_struct->data = NULL;
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_CONV_INFO:
- {
+ case MSG_STRUCT_CONV_INFO: {
MSG_CONVERSATION_VIEW_S *pConv = (MSG_CONVERSATION_VIEW_S*)(msg_struct->data);
if (pConv->multipart_list) {
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_THREAD_INFO:
- {
+ case MSG_STRUCT_THREAD_INFO: {
delete (MSG_THREAD_VIEW_S*)(msg_struct->data);
msg_struct->data = NULL;
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_SENDOPT:
- {
+ case MSG_STRUCT_SENDOPT: {
MSG_SENDINGOPT_S *pOpt = (MSG_SENDINGOPT_S*)(msg_struct->data);
delete (MMS_SENDINGOPT_S *)(((msg_struct_s *)pOpt->mmsSendOpt)->data);
((msg_struct_s *)pOpt->mmsSendOpt)->data = NULL;
break;
}
- case MSG_STRUCT_SYNCML_INFO:
- {
+ case MSG_STRUCT_SYNCML_INFO: {
MSG_SYNCML_MESSAGE_S *pSyncML = (MSG_SYNCML_MESSAGE_S*)(msg_struct->data);
msg_struct_s *msg = (msg_struct_s *)pSyncML->msg;
msg_message_release(&msg);
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_COUNT_INFO:
- {
+ case MSG_STRUCT_COUNT_INFO: {
delete (MSG_COUNT_INFO_S*)(msg_struct->data);
msg_struct->data = NULL;
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_THREAD_COUNT_INFO:
- {
+ case MSG_STRUCT_THREAD_COUNT_INFO: {
delete (MSG_THREAD_COUNT_INFO_S*)(msg_struct->data);
msg_struct->data = NULL;
break;
}
- case MSG_STRUCT_THREAD_LIST_INDEX:
- {
+ case MSG_STRUCT_THREAD_LIST_INDEX: {
MSG_THREAD_LIST_INDEX_INFO_S *pThread = (MSG_THREAD_LIST_INDEX_INFO_S*)(msg_struct->data);
delete (MSG_ADDRESS_INFO_S *)(((msg_struct_s *)pThread->msgAddrInfo)->data);
((msg_struct_s *)pThread->msgAddrInfo)->data = NULL;
break;
}
- case MSG_STRUCT_SORT_RULE:
- {
+ case MSG_STRUCT_SORT_RULE: {
delete (MSG_SORT_RULE_S*)(msg_struct->data);
msg_struct->data = NULL;
break;
}
- case MSG_STRUCT_FOLDER_INFO:
- {
+ case MSG_STRUCT_FOLDER_INFO: {
delete (MSG_FOLDER_INFO_S*)(msg_struct->data);
msg_struct->data = NULL;
break;
}
- case MSG_STRUCT_MSG_LIST_CONDITION:
- {
+ case MSG_STRUCT_MSG_LIST_CONDITION: {
MSG_LIST_CONDITION_S *pCond = (MSG_LIST_CONDITION_S*)(msg_struct->data);
MSG_SORT_RULE_S *pSortRule = (MSG_SORT_RULE_S *)(((msg_struct_s *)pCond->sortRule)->data);
break;
}
- case MSG_STRUCT_REPORT_STATUS_INFO:
- {
+ case MSG_STRUCT_REPORT_STATUS_INFO: {
delete (MSG_REPORT_STATUS_INFO_S*)(msg_struct->data);
msg_struct->data = NULL;
break;
}
- case MSG_STRUCT_SMS_SENDOPT:
- {
+ case MSG_STRUCT_SMS_SENDOPT: {
delete (SMS_SENDINGOPT_S*)(msg_struct->data);
msg_struct->data = NULL;
break;
}
- case MSG_STRUCT_MMS_SENDOPT:
- {
+ case MSG_STRUCT_MMS_SENDOPT: {
delete (MMS_SENDINGOPT_S*)(msg_struct->data);
msg_struct->data = NULL;
break;
}
- case MSG_STRUCT_REQUEST_INFO:
- {
+ case MSG_STRUCT_REQUEST_INFO: {
MSG_REQUEST_S *pRequest = (MSG_REQUEST_S*)(msg_struct->data);
MSG_SENDINGOPT_S *pSendingOpt = (MSG_SENDINGOPT_S *)(((msg_struct_s *)pRequest->sendOpt)->data);
case MSG_STRUCT_MMS_META:
case MSG_STRUCT_MMS_SMIL_TEXT:
case MSG_STRUCT_MMS_SMIL_AVI:
- case MSG_STRUCT_MULTIPART_INFO:
- {
+ case MSG_STRUCT_MULTIPART_INFO: {
msg_mms_release_struct(&msg_struct);
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_SETTING_SMSC_OPT :
- {
+ case MSG_STRUCT_SETTING_SMSC_OPT: {
msg_struct_list_s *smsc_list = NULL;
msg_struct_s *smsc_info = NULL;
MSG_SMSC_LIST_HIDDEN_S *pTmp = NULL;
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
- {
+ case MSG_STRUCT_SETTING_CB_CHANNEL_INFO: {
delete (MSG_CB_CHANNEL_INFO_S*)(msg_struct->data);
msg_struct->data = NULL;
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_SETTING_CB_OPT :
- {
+ case MSG_STRUCT_SETTING_CB_OPT: {
msg_struct_list_s *cb_list = NULL;
msg_struct_s *cb_info = NULL;
MSG_CBMSG_OPT_HIDDEN_S *pTmp = NULL;
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_SETTING_SMS_SEND_OPT :
- {
+ case MSG_STRUCT_SETTING_SMS_SEND_OPT: {
delete (MSG_SMS_SENDOPT_S*)(msg_struct->data);
msg_struct->data = NULL;
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_SETTING_MMS_SEND_OPT :
- {
+ case MSG_STRUCT_SETTING_MMS_SEND_OPT: {
delete (MSG_MMS_SENDOPT_S*)(msg_struct->data);
msg_struct->data = NULL;
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_SETTING_MMS_RECV_OPT :
- {
+ case MSG_STRUCT_SETTING_MMS_RECV_OPT: {
delete (MSG_MMS_RECVOPT_S*)(msg_struct->data);
msg_struct->data = NULL;
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
- {
+ case MSG_STRUCT_SETTING_PUSH_MSG_OPT: {
delete (MSG_PUSHMSG_OPT_S*)(msg_struct->data);
msg_struct->data = NULL;
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
- {
+ case MSG_STRUCT_SETTING_VOICE_MSG_OPT: {
delete (MSG_VOICEMAIL_OPT_S*)(msg_struct->data);
msg_struct->data = NULL;
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_SETTING_GENERAL_OPT :
- {
+ case MSG_STRUCT_SETTING_GENERAL_OPT: {
delete (MSG_GENERAL_OPT_S*)(msg_struct->data);
msg_struct->data = NULL;
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_SETTING_MSGSIZE_OPT :
- {
+ case MSG_STRUCT_SETTING_MSGSIZE_OPT: {
delete (MSG_MSGSIZE_OPT_S*)(msg_struct->data);
msg_struct->data = NULL;
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_ADDRESS_INFO :
- {
+ case MSG_STRUCT_ADDRESS_INFO: {
delete (MSG_ADDRESS_INFO_S*)(msg_struct->data);
msg_struct->data = NULL;
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_PUSH_CONFIG_INFO:
- {
+ case MSG_STRUCT_PUSH_CONFIG_INFO: {
delete (MSG_PUSH_EVENT_INFO_S*)(msg_struct->data);
msg_struct->data = NULL;
*msg_struct_handle = NULL;
break;
}
- case MSG_STRUCT_MEDIA_INFO:
- {
+ case MSG_STRUCT_MEDIA_INFO: {
delete (MSG_MEDIA_INFO_S*)(msg_struct->data);
msg_struct->data = NULL;
*msg_struct_handle = NULL;
break;
}
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
return MSG_ERR_NULL_POINTER;
switch (msg_struct->type) {
- case MSG_STRUCT_MESSAGE_INFO :
+ case MSG_STRUCT_MESSAGE_INFO:
err = msg_message_get_int_value(msg_struct->data, field, value);
break;
case MSG_STRUCT_FILTER:
err = msg_get_filter_info_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SYNCML_INFO :
+ case MSG_STRUCT_SYNCML_INFO:
err = msg_syncml_info_get_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_COUNT_INFO :
+ case MSG_STRUCT_COUNT_INFO:
err = msg_count_info_get_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_THREAD_COUNT_INFO :
+ case MSG_STRUCT_THREAD_COUNT_INFO:
err = msg_thread_count_get_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_THREAD_LIST_INDEX :
+ case MSG_STRUCT_THREAD_LIST_INDEX:
err = msg_thread_index_get_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SORT_RULE :
+ case MSG_STRUCT_SORT_RULE:
err = msg_sortrule_get_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_FOLDER_INFO :
+ case MSG_STRUCT_FOLDER_INFO:
err = msg_folder_info_get_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_THREAD_INFO :
+ case MSG_STRUCT_THREAD_INFO:
err = msg_thread_info_get_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_CONV_INFO :
+ case MSG_STRUCT_CONV_INFO:
err = msg_conv_info_get_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_MSG_LIST_CONDITION :
+ case MSG_STRUCT_MSG_LIST_CONDITION:
err = msg_list_condition_get_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_REPORT_STATUS_INFO :
+ case MSG_STRUCT_REPORT_STATUS_INFO:
err = msg_report_status_get_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_ADDRESS_INFO :
+ case MSG_STRUCT_ADDRESS_INFO:
err = msg_address_info_get_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_MMS_SENDOPT :
+ case MSG_STRUCT_MMS_SENDOPT:
err = msg_mms_sendopt_get_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_REJECT_MSG_INFO :
+ case MSG_STRUCT_REJECT_MSG_INFO:
err = msg_reject_message_get_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_REQUEST_INFO :
+ case MSG_STRUCT_REQUEST_INFO:
err = msg_request_get_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SENT_STATUS_INFO :
+ case MSG_STRUCT_SENT_STATUS_INFO:
err = msg_sent_status_get_int((MSG_SENT_STATUS_S *)msg_struct->data, field, value);
break;
- case MSG_STRUCT_CB_MSG :
+ case MSG_STRUCT_CB_MSG:
err = msg_cb_message_get_int_value(msg_struct->data, field, value);
break;
case MSG_STRUCT_MMS:
case MSG_STRUCT_MULTIPART_INFO:
err = msg_mms_get_int_value(msg_struct, field, value);
break;
- case MSG_STRUCT_SETTING_SMSC_OPT :
- case MSG_STRUCT_SETTING_SMSC_INFO :
- case MSG_STRUCT_SETTING_CB_OPT :
- case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
- case MSG_STRUCT_SETTING_SMS_SEND_OPT :
- case MSG_STRUCT_SETTING_MMS_SEND_OPT :
- case MSG_STRUCT_SETTING_MMS_RECV_OPT :
- case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
- case MSG_STRUCT_SETTING_GENERAL_OPT :
- case MSG_STRUCT_SETTING_MSGSIZE_OPT :
- case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
+ case MSG_STRUCT_SETTING_SMSC_OPT:
+ case MSG_STRUCT_SETTING_SMSC_INFO:
+ case MSG_STRUCT_SETTING_CB_OPT:
+ case MSG_STRUCT_SETTING_CB_CHANNEL_INFO:
+ case MSG_STRUCT_SETTING_SMS_SEND_OPT:
+ case MSG_STRUCT_SETTING_MMS_SEND_OPT:
+ case MSG_STRUCT_SETTING_MMS_RECV_OPT:
+ case MSG_STRUCT_SETTING_PUSH_MSG_OPT:
+ case MSG_STRUCT_SETTING_GENERAL_OPT:
+ case MSG_STRUCT_SETTING_MSGSIZE_OPT:
+ case MSG_STRUCT_SETTING_VOICE_MSG_OPT:
err = msg_setting_get_int_value(msg_struct, field, value);
break;
- case MSG_STRUCT_MEDIA_INFO :
+ case MSG_STRUCT_MEDIA_INFO:
err = msg_media_item_get_int(msg_struct->data, field, value);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
return MSG_ERR_NULL_POINTER;
switch (msg_struct->type) {
- case MSG_STRUCT_MESSAGE_INFO :
+ case MSG_STRUCT_MESSAGE_INFO:
err = msg_message_get_str_value(msg_struct->data, field, value, size);
break;
case MSG_STRUCT_FILTER:
err = msg_get_filter_info_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_FOLDER_INFO :
+ case MSG_STRUCT_FOLDER_INFO:
err = msg_folder_info_get_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_THREAD_INFO :
+ case MSG_STRUCT_THREAD_INFO:
err = msg_thread_info_get_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_CONV_INFO :
+ case MSG_STRUCT_CONV_INFO:
err = msg_conv_info_get_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_MSG_LIST_CONDITION :
+ case MSG_STRUCT_MSG_LIST_CONDITION:
err = msg_list_condition_get_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_ADDRESS_INFO :
+ case MSG_STRUCT_ADDRESS_INFO:
err = msg_address_info_get_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_REJECT_MSG_INFO :
+ case MSG_STRUCT_REJECT_MSG_INFO:
err = msg_reject_message_get_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_MEDIA_INFO :
+ case MSG_STRUCT_MEDIA_INFO:
err = msg_media_item_get_str(msg_struct->data, field, value, size);
break;
case MSG_STRUCT_MMS:
case MSG_STRUCT_MULTIPART_INFO:
err = msg_mms_get_str_value(msg_struct, field, value, size);
break;
- case MSG_STRUCT_SETTING_GENERAL_OPT :
- case MSG_STRUCT_SETTING_SMSC_INFO :
- case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
- case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
+ case MSG_STRUCT_SETTING_GENERAL_OPT:
+ case MSG_STRUCT_SETTING_SMSC_INFO:
+ case MSG_STRUCT_SETTING_CB_CHANNEL_INFO:
+ case MSG_STRUCT_SETTING_VOICE_MSG_OPT:
err = msg_setting_get_str_value(msg_struct, field, value, size);
break;
- case MSG_STRUCT_PUSH_CONFIG_INFO :
+ case MSG_STRUCT_PUSH_CONFIG_INFO:
err = msg_push_config_get_str(msg_struct->data, field, value, size);
break;
case MSG_STRUCT_REPORT_STATUS_INFO:
err = msg_report_status_get_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_CB_MSG :
+ case MSG_STRUCT_CB_MSG:
err = msg_cb_message_get_str_value(msg_struct->data, field, value, size);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
return MSG_ERR_NULL_POINTER;
switch (msg_struct->type) {
- case MSG_STRUCT_FILTER :
+ case MSG_STRUCT_FILTER:
err = msg_get_filter_info_bool(msg_struct->data, field, value);
break;
- case MSG_STRUCT_MESSAGE_INFO :
+ case MSG_STRUCT_MESSAGE_INFO:
err = msg_message_get_bool_value(msg_struct->data, field, value);
break;
- case MSG_STRUCT_THREAD_INFO :
+ case MSG_STRUCT_THREAD_INFO:
err = msg_thread_info_get_bool(msg_struct->data, field, value);
break;
case MSG_STRUCT_CONV_INFO:
case MSG_STRUCT_MMS_SMIL_AVI:
err = msg_mms_get_bool_value(msg_struct, field, value);
break;
- case MSG_STRUCT_SETTING_CB_OPT :
- case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
- case MSG_STRUCT_SETTING_SMS_SEND_OPT :
- case MSG_STRUCT_SETTING_MMS_SEND_OPT :
- case MSG_STRUCT_SETTING_MMS_RECV_OPT :
- case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
- case MSG_STRUCT_SETTING_GENERAL_OPT :
+ case MSG_STRUCT_SETTING_CB_OPT:
+ case MSG_STRUCT_SETTING_CB_CHANNEL_INFO:
+ case MSG_STRUCT_SETTING_SMS_SEND_OPT:
+ case MSG_STRUCT_SETTING_MMS_SEND_OPT:
+ case MSG_STRUCT_SETTING_MMS_RECV_OPT:
+ case MSG_STRUCT_SETTING_PUSH_MSG_OPT:
+ case MSG_STRUCT_SETTING_GENERAL_OPT:
err = msg_setting_get_bool_value(msg_struct, field, value);
break;
case MSG_STRUCT_PUSH_CONFIG_INFO:
err = msg_push_config_get_bool(msg_struct->data, field, value);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
return MSG_ERR_NULL_POINTER;
switch (msg_struct->type) {
- case MSG_STRUCT_MESSAGE_INFO :
+ case MSG_STRUCT_MESSAGE_INFO:
err = msg_message_get_struct_hnd(msg_struct->data, field, (void **)value);
break;
case MSG_STRUCT_SENDOPT:
case MSG_STRUCT_REQUEST_INFO:
err = msg_request_get_struct_handle(msg_struct, field, (void **)value);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
return MSG_ERR_NULL_POINTER;
switch (msg_struct->type) {
- case MSG_STRUCT_MESSAGE_INFO :
+ case MSG_STRUCT_MESSAGE_INFO:
err = msg_message_get_list_hnd(msg_struct->data, field, value);
break;
case MSG_STRUCT_CONV_INFO:
case MSG_STRUCT_MMS_PAGE:
err = msg_mms_get_list_handle(msg_struct, field, (msg_list_handle_t *)value);
break;
- case MSG_STRUCT_SETTING_CB_OPT :
- case MSG_STRUCT_SETTING_SMSC_OPT :
+ case MSG_STRUCT_SETTING_CB_OPT:
+ case MSG_STRUCT_SETTING_SMSC_OPT:
err = msg_setting_get_list_handle(msg_struct, field, value);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
return MSG_ERR_NULL_POINTER;
switch (msg_struct->type) {
- case MSG_STRUCT_MESSAGE_INFO :
+ case MSG_STRUCT_MESSAGE_INFO:
err = msg_message_set_int_value(msg_struct->data, field, value);
break;
- case MSG_STRUCT_FILTER :
+ case MSG_STRUCT_FILTER:
err = msg_set_filter_info_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SYNCML_INFO :
+ case MSG_STRUCT_SYNCML_INFO:
err = msg_syncml_info_set_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_COUNT_INFO :
+ case MSG_STRUCT_COUNT_INFO:
err = msg_count_info_set_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_THREAD_COUNT_INFO :
+ case MSG_STRUCT_THREAD_COUNT_INFO:
err = msg_thread_count_set_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_THREAD_LIST_INDEX :
+ case MSG_STRUCT_THREAD_LIST_INDEX:
err = msg_thread_index_set_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_SORT_RULE :
+ case MSG_STRUCT_SORT_RULE:
err = msg_sortrule_set_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_FOLDER_INFO :
+ case MSG_STRUCT_FOLDER_INFO:
err = msg_folder_info_set_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_MSG_LIST_CONDITION :
+ case MSG_STRUCT_MSG_LIST_CONDITION:
err = msg_list_condition_set_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_REPORT_STATUS_INFO :
+ case MSG_STRUCT_REPORT_STATUS_INFO:
err = msg_report_status_set_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_ADDRESS_INFO :
+ case MSG_STRUCT_ADDRESS_INFO:
err = msg_address_info_set_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_MMS_SENDOPT :
+ case MSG_STRUCT_MMS_SENDOPT:
err = msg_mms_sendopt_set_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_REJECT_MSG_INFO :
+ case MSG_STRUCT_REJECT_MSG_INFO:
err = msg_reject_message_set_int(msg_struct->data, field, value);
break;
- case MSG_STRUCT_REQUEST_INFO :
+ case MSG_STRUCT_REQUEST_INFO:
err = msg_request_set_int(msg_struct->data, field, value);
break;
case MSG_STRUCT_MMS:
case MSG_STRUCT_MMS_SMIL_AVI:
err = msg_mms_set_int_value(msg_struct, field, value);
break;
- case MSG_STRUCT_SETTING_SMSC_OPT :
- case MSG_STRUCT_SETTING_SMSC_INFO :
- case MSG_STRUCT_SETTING_CB_OPT :
- case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
- case MSG_STRUCT_SETTING_SMS_SEND_OPT :
- case MSG_STRUCT_SETTING_MMS_SEND_OPT :
- case MSG_STRUCT_SETTING_MMS_RECV_OPT :
- case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
- case MSG_STRUCT_SETTING_GENERAL_OPT :
- case MSG_STRUCT_SETTING_MSGSIZE_OPT :
- case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
+ case MSG_STRUCT_SETTING_SMSC_OPT:
+ case MSG_STRUCT_SETTING_SMSC_INFO:
+ case MSG_STRUCT_SETTING_CB_OPT:
+ case MSG_STRUCT_SETTING_CB_CHANNEL_INFO:
+ case MSG_STRUCT_SETTING_SMS_SEND_OPT:
+ case MSG_STRUCT_SETTING_MMS_SEND_OPT:
+ case MSG_STRUCT_SETTING_MMS_RECV_OPT:
+ case MSG_STRUCT_SETTING_PUSH_MSG_OPT:
+ case MSG_STRUCT_SETTING_GENERAL_OPT:
+ case MSG_STRUCT_SETTING_MSGSIZE_OPT:
+ case MSG_STRUCT_SETTING_VOICE_MSG_OPT:
err = msg_setting_set_int_value(msg_struct, field, value);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
return MSG_ERR_NULL_POINTER;
switch (msg_struct->type) {
- case MSG_STRUCT_MESSAGE_INFO :
+ case MSG_STRUCT_MESSAGE_INFO:
err = msg_message_set_str_value(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_FILTER :
+ case MSG_STRUCT_FILTER:
err = msg_set_filter_info_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_FOLDER_INFO :
+ case MSG_STRUCT_FOLDER_INFO:
err = msg_folder_info_set_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_MSG_LIST_CONDITION :
+ case MSG_STRUCT_MSG_LIST_CONDITION:
err = msg_list_condition_set_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_ADDRESS_INFO :
+ case MSG_STRUCT_ADDRESS_INFO:
err = msg_address_info_set_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_REJECT_MSG_INFO :
+ case MSG_STRUCT_REJECT_MSG_INFO:
err = msg_reject_message_set_str(msg_struct->data, field, value, size);
break;
case MSG_STRUCT_MMS:
case MSG_STRUCT_MULTIPART_INFO:
err = msg_mms_set_str_value(msg_struct, field, value, size);
break;
- case MSG_STRUCT_SETTING_GENERAL_OPT :
- case MSG_STRUCT_SETTING_SMSC_INFO :
- case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
- case MSG_STRUCT_SETTING_VOICE_MSG_OPT :
+ case MSG_STRUCT_SETTING_GENERAL_OPT:
+ case MSG_STRUCT_SETTING_SMSC_INFO:
+ case MSG_STRUCT_SETTING_CB_CHANNEL_INFO:
+ case MSG_STRUCT_SETTING_VOICE_MSG_OPT:
err = msg_setting_set_str_value(msg_struct, field, value, size);
break;
case MSG_STRUCT_PUSH_CONFIG_INFO:
err = msg_push_config_set_str(msg_struct->data, field, value, size);
break;
- case MSG_STRUCT_MEDIA_INFO :
+ case MSG_STRUCT_MEDIA_INFO:
err = msg_media_info_set_str(msg_struct->data, field, value, size);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
return MSG_ERR_NULL_POINTER;
switch (msg_struct->type) {
- case MSG_STRUCT_FILTER :
+ case MSG_STRUCT_FILTER:
err = msg_set_filter_info_bool(msg_struct->data, field, value);
break;
- case MSG_STRUCT_MESSAGE_INFO :
+ case MSG_STRUCT_MESSAGE_INFO:
err = msg_message_set_bool_value(msg_struct->data, field, value);
break;
case MSG_STRUCT_SENDOPT:
case MSG_STRUCT_MMS_SMIL_AVI:
err = msg_mms_set_bool_value(msg_struct, field, value);
break;
- case MSG_STRUCT_SETTING_CB_OPT :
- case MSG_STRUCT_SETTING_CB_CHANNEL_INFO :
- case MSG_STRUCT_SETTING_SMS_SEND_OPT :
- case MSG_STRUCT_SETTING_MMS_SEND_OPT :
- case MSG_STRUCT_SETTING_MMS_RECV_OPT :
- case MSG_STRUCT_SETTING_PUSH_MSG_OPT :
- case MSG_STRUCT_SETTING_GENERAL_OPT :
+ case MSG_STRUCT_SETTING_CB_OPT:
+ case MSG_STRUCT_SETTING_CB_CHANNEL_INFO:
+ case MSG_STRUCT_SETTING_SMS_SEND_OPT:
+ case MSG_STRUCT_SETTING_MMS_SEND_OPT:
+ case MSG_STRUCT_SETTING_MMS_RECV_OPT:
+ case MSG_STRUCT_SETTING_PUSH_MSG_OPT:
+ case MSG_STRUCT_SETTING_GENERAL_OPT:
err = msg_setting_set_bool_value(msg_struct, field, value);
break;
case MSG_STRUCT_PUSH_CONFIG_INFO:
err = msg_push_config_set_bool(msg_struct->data, field, value);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
return MSG_ERR_NULL_POINTER;
switch (msg_struct->type) {
- case MSG_STRUCT_MESSAGE_INFO :
+ case MSG_STRUCT_MESSAGE_INFO:
err = msg_message_set_struct_hnd(msg_struct->data, field, (void *)value);
break;
case MSG_STRUCT_SENDOPT:
case MSG_STRUCT_REQUEST_INFO:
err = msg_request_set_struct_handle(msg_struct, field, (msg_struct_s *)value);
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
return MSG_ERR_NULL_POINTER;
#if 0 /* No operations */
- switch (msg_struct->type)
- {
- default :
+ switch (msg_struct->type) {
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
msg_struct_s *msg_struct = (msg_struct_s *)msg_struct_handle;
switch (msg_struct->type) {
- case MSG_STRUCT_MESSAGE_INFO:
- {
+ case MSG_STRUCT_MESSAGE_INFO: {
err = msg_message_list_append(msg_struct_handle, field, item);
}
break;
case MSG_STRUCT_MMS:
- case MSG_STRUCT_MMS_PAGE:
- {
+ case MSG_STRUCT_MMS_PAGE: {
err = msg_mms_list_append(msg_struct_handle, field, item);
}
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
msg_struct_s *msg_struct = (msg_struct_s *)msg_struct_handle;
switch (msg_struct->type) {
- case MSG_STRUCT_MESSAGE_INFO:
- {
+ case MSG_STRUCT_MESSAGE_INFO: {
err = msg_message_list_clear(msg_struct_handle, field);
}
break;
- default :
+ default:
err = MSG_ERR_INVALID_PARAMETER;
break;
}
*segment_size = 0;
switch (msg_encode_type_to) {
- case MSG_ENCODE_GSM7BIT :
+ case MSG_ENCODE_GSM7BIT:
decodeLen = textCvt->convertUTF8ToGSM7bit(decodeData, bufSize, (const unsigned char*)msg_text, textSize, &langId, &bAbnormal);
break;
- case MSG_ENCODE_UCS2 :
+ case MSG_ENCODE_UCS2:
decodeLen = textCvt->convertUTF8ToUCS2(decodeData, bufSize, (const unsigned char*)msg_text, textSize);
break;
- case MSG_ENCODE_AUTO :
+ case MSG_ENCODE_AUTO:
decodeLen = textCvt->convertUTF8ToAuto(decodeData, bufSize, (const unsigned char*)msg_text, textSize, &encodeType);
break;
- default :
+ default:
return MSG_ERR_INVALID_PARAMETER;
}
return MSG_ERR_INVALID_PARAMETER;
}
- msg_struct_s req = {0,};
+ msg_struct_s req = {0, };
MSG_REQUEST_S msgReq = {0};
req.type = MSG_STRUCT_REQUEST_INFO;
return retVal;
}
- MSG_MESSAGE_HIDDEN_S msg_info = {0,};
- msg_struct_s msg = {0,};
+ MSG_MESSAGE_HIDDEN_S msg_info = {0, };
+ msg_struct_s msg = {0, };
msg.type = MSG_STRUCT_MESSAGE_INFO;
msg.data = &msg_info;
msg_info.simIndex = MSG_SIM_SLOT_ID_1;
/* fill the destination number in msgReq */
- MSG_ADDRESS_INFO_S address = {0,};
+ MSG_ADDRESS_INFO_S address = {0, };
memset(&address, 0x00, sizeof(MSG_ADDRESS_INFO_S));
address.addressType = MSG_ADDRESS_TYPE_PLMN;
address.recipientType = MSG_RECIPIENTS_TYPE_TO;
snprintf(address.addressVal, MAX_ADDRESS_VAL_LEN, "%s", phone_num);
- msg_struct_list_s addr_list = {0,};
+ msg_struct_list_s addr_list = {0, };
addr_list.nCount = 1;
addr_list.msg_struct_info = (msg_struct_t *)calloc(1, sizeof(msg_struct_t));
msg_info.pData = (void*)sms_text;
/* Send option */
- msg_struct_s sendOpt = {0,};
+ msg_struct_s sendOpt = {0, };
MSG_SENDINGOPT_S send_info;
memset(&send_info, 0x00, sizeof(MSG_SENDINGOPT_S));
sendOpt.type = MSG_STRUCT_SENDOPT;
sendOpt.data = (void *)&send_info;
- msg_struct_s smsSendOpt = {0,};
- SMS_SENDINGOPT_INFO_S sms_send_opt = {0,};
+ msg_struct_s smsSendOpt = {0, };
+ SMS_SENDINGOPT_INFO_S sms_send_opt = {0, };
memset(&sms_send_opt, 0x00, sizeof(SMS_SENDINGOPT_INFO_S));
smsSendOpt.type = MSG_STRUCT_SMS_SENDOPT;
if (retVal != MSG_SUCCESS)
return retVal;
- for (char* cur_num = strtok_r(trimmed_num,", ", &temp); cur_num ; cur_num = strtok_r(NULL,", ", &temp)) {
+ for (char* cur_num = strtok_r(trimmed_num, ", ", &temp); cur_num ; cur_num = strtok_r(NULL, ", ", &temp)) {
if (strlen(cur_num) > MAX_PHONE_NUMBER_LEN) {
MSG_SEC_DEBUG("Phone number is too long [%s], and sending is skipped", cur_num);
continue;
if (ret != PRIV_MGR_ERROR_SUCCESS)
return MSG_ERR_PERMISSION_DENIED;
- if (handle == NULL || req == NULL ) {
+ if (handle == NULL || req == NULL) {
MSG_FATAL("handle or req is NULL");
return MSG_ERR_INVALID_PARAMETER;
}
default:
err = MSG_ERR_UNKNOWN;
break;
-
}
return err;
switch (field) {
- case MSG_REQUEST_MESSAGE_HND:
- {
+ case MSG_REQUEST_MESSAGE_HND: {
pTmp = (msg_struct_s *)pRequest->msg;
MSG_MESSAGE_HIDDEN_S *pSrc = (MSG_MESSAGE_HIDDEN_S *)value->data;
MSG_MESSAGE_HIDDEN_S *pDst = (MSG_MESSAGE_HIDDEN_S *)pTmp->data;
msg_message_copy_message(pSrc, pDst);
break;
}
- case MSG_REQUEST_SENDOPT_HND:
- {
+ case MSG_REQUEST_SENDOPT_HND: {
pTmp = (msg_struct_s *)pRequest->sendOpt;
MSG_SENDINGOPT_S *pSrc = (MSG_SENDINGOPT_S *)value->data;
MSG_SENDINGOPT_S *pDst = (MSG_SENDINGOPT_S *)pTmp->data;
void MmsPluginAppBase::getFirstPageTextFilePath(char *textBuf, int textBufSize)
{
-
MMS_PAGE_S *pPage = NULL;
MMS_MEDIA_S *pMedia = NULL;
/* Get the text data from the 1st slide. */
if (pMmsMsgData->pageCnt > 0) {
-
pPage = _MsgMmsGetPage(pMmsMsgData, 0);
if (pPage) {
-
for (int j = 0; j < pPage->mediaCnt; ++j) {
-
pMedia = _MsgMmsGetMedia(pPage, j);
if (pMedia && pMedia->mediatype == MMS_SMIL_MEDIA_TEXT) {
-
MimeType mimeType = MIME_UNKNOWN;
MsgGetMimeTypeFromFileName(MIME_MAINTYPE_UNKNOWN, pMedia->szFilePath, &mimeType, NULL);
}
}
} else {
- /* (P151014-01246)
- * Set filepath of the first text/plain attachment to display preview text on notification */
+ /* Set filepath of the first text/plain attachment to display preview text on notification */
if (pMmsMsgData->attachlist) {
GList *l = pMmsMsgData->attachlist;
while (l) {
/* scan malware in raw file */
if (raw_filepath && strlen(raw_filepath) > 0 && MsgAccessFile(raw_filepath, F_OK) == true) {
- int tcs_ret = 0; // MmsPluginTcsScanFile(raw_filepath, &bc_level);
+ int tcs_ret = 0; /* MmsPluginTcsScanFile(raw_filepath, &bc_level); */
if (tcs_ret == 0) {
if (bc_level > -1) {
MSG_DEBUG("malware exist, level = %d", bc_level);
for (int j = 0; j < pPage->mediaCnt; j++) {
pMedia = _MsgMmsGetMedia(pPage, j);
if (pMedia) { /* IF Vobject type add to Attach in Preview data */
-
MimeType mimeType = MIME_UNKNOWN;
MsgGetMimeTypeFromFileName(MIME_MAINTYPE_UNKNOWN, pMedia->szFilePath, &mimeType, NULL);
if (mimeType == MIME_TEXT_X_VCALENDAR || mimeType == MIME_TEXT_X_VCARD) {
-
MSG_DEBUG("Unsupported File [%s] It will be add to attach list", pMedia->szFilePath);
ref_attach_count++;
attachment_name = pMedia->szFileName;
}
}
-
}
}
}
if (pMmsMsg->pageCnt > 0) {
-
MmsPluginStorage::instance()->insertPreviewInfo(msgId, MSG_MMS_ITEM_TYPE_PAGE, (char *)"pagecount", pMmsMsg->pageCnt);
pPage = _MsgMmsGetPage(pMmsMsg, 0);
if (pPage) {
for (int j = 0; j < pPage->mediaCnt; j++) {
-
pMedia = _MsgMmsGetMedia(pPage, j);
if (pMedia == NULL) {
MmsPluginStorage::instance()->insertPreviewInfo(msgId, MSG_MMS_ITEM_TYPE_AUDIO, pMedia->szFileName);
}
} else {
-
if (j == 0) { /* First Page, First Media */
MmsPluginStorage::instance()->insertPreviewInfo(msgId, MSG_MMS_ITEM_TYPE_1ST_MEDIA, pMedia->szFilePath);
}
MSG_SEC_DEBUG("drm type = %d, %s", pMedia->drmType, pMedia->szFilePath);
if (pMedia->drmType == MSG_DRM_TYPE_NONE) {
-
- snprintf(szFileName, MSG_FILENAME_LEN_MAX+1, "%d.mms",msgId);
+ snprintf(szFileName, MSG_FILENAME_LEN_MAX+1, "%d.mms", msgId);
if ((pszExt = strrchr(pMedia->szFilePath, '.')) != NULL && !strcasecmp(pszExt, ".png")) {
snprintf(thumbPath, MSG_FILEPATH_LEN_MAX, "%s%s.png", MSG_THUMBNAIL_PATH, szFileName);
int attachCnt = _MsgMmsGetAttachCount(pMmsMsg);
if (attachCnt > 0) {
-
MMS_ATTACH_S *pAttach = _MsgMmsGetAttachment(pMmsMsg, 0);
MmsPluginStorage::instance()->insertPreviewInfo(msgId, MSG_MMS_ITEM_TYPE_ATTACH, pAttach->szFileName, attachCnt);
if (attachment_name == NULL) {
attachment_name = pAttach->szFileName;
}
-
} else {
MSG_DEBUG("There is no attachment");
}
if (attachCnt + ref_attach_count > 0 && attachment_name) {
-
MmsPluginStorage::instance()->insertPreviewInfo(msgId, MSG_MMS_ITEM_TYPE_ATTACH, attachment_name, attachCnt + ref_attach_count);
MmsPluginStorage::instance()->updateMmsAttachCount(msgId, attachCnt + ref_attach_count);
}
/* Add by MMSENC v1.2 */
{"Unreachable", 0x07 }
-
},
/* MmsCodeReadStatus */
for (j = 0; j < MMS_MAX_FIELD_VALUE_COUNT; j++) {
if (gMmsField[i][j].szText != NULL) {
- if (strcasecmp( gMmsField[i][j].szText, pValue ) == 0) {
+ if (strcasecmp(gMmsField[i][j].szText, pValue) == 0) {
return j;
}
}
char *char_set = NULL;
char *l_encoded_text = NULL;
- char l_encoding[2] = {0,};
+ char l_encoding[2] = {0, };
if (encoded_word == NULL)
goto __CATCH;
- if ( 6 > strlen(encoded_word)) {
+ if (6 > strlen(encoded_word)) {
goto __CATCH;
}
start_ptr = encoded_word;
- if ( (encoded_word[0] == '=' && encoded_word[1] == '?') /* "=?" */
+ if ((encoded_word[0] == '=' && encoded_word[1] == '?') /* "=?" */
&& ((q1_ptr = strchr(start_ptr + 2, MSG_CH_QUESTION)) != NULL) /* '?' */
&& ((q2_ptr = strchr(q1_ptr + 1, MSG_CH_QUESTION))!= NULL) /* '?' */
- && ((end_ptr = strstr(q2_ptr + 1, MSG_STR_DEC_END))!= NULL)) /* "?=" */
- {
-
+ && ((end_ptr = strstr(q2_ptr + 1, MSG_STR_DEC_END))!= NULL)) { /* "?=" */
/* extract character set */
if ( q1_ptr - (start_ptr + 2) > 0 ) {
-
char_set = (char*)calloc(1, q1_ptr - (start_ptr + 2) + 1);
if (char_set) {
/* extract encode type */
if ((*(q2_ptr - 1) == MSG_CH_BASE64_UPPER) || (*(q2_ptr - 1) == MSG_CH_BASE64_LOWER)
- || (*(q1_ptr + 1) == MSG_CH_BASE64_UPPER) || (*(q1_ptr + 1) == MSG_CH_BASE64_LOWER))
- {
+ || (*(q1_ptr + 1) == MSG_CH_BASE64_UPPER) || (*(q1_ptr + 1) == MSG_CH_BASE64_LOWER)) {
l_encoding[0] = MSG_CH_BASE64_UPPER;
} else if ((*(q2_ptr-1) == MSG_CH_QPRINT_UPPER) || (*(q2_ptr-1) == MSG_CH_QPRINT_LOWER)
- || (*(q1_ptr+1) == MSG_CH_QPRINT_UPPER) || (*(q1_ptr+1) == MSG_CH_QPRINT_LOWER))
- {
+ || (*(q1_ptr+1) == MSG_CH_QPRINT_UPPER) || (*(q1_ptr+1) == MSG_CH_QPRINT_LOWER)) {
/* QPRINT */
l_encoding[0] = MSG_CH_QPRINT_UPPER;
-
} else {
MSG_DEBUG("unknown encoding");
goto __CATCH;
*encoding = g_strdup(l_encoding);
*encoded_text = l_encoded_text;
*encoded_word_size = end_ptr - start_ptr + 2;
-
} else {
MSG_DEBUG("It is not encoded word type");
return -1;
char *encoded_text = NULL;
char *decoded_text = NULL;
- char *return_string= NULL;
+ char *return_string = NULL;
string result_string;
bool b_encoded_word = false;
normal_word_start_ptr = pSrc;
while (normal_word_start_ptr < pSrc + total_len) {
-
encoded_word_start_ptr = strstr(normal_word_start_ptr, MSG_STR_DEC_START);
b_encoded_word = false;
/* Find encoded word */
- while (b_encoded_word == false && encoded_word_start_ptr != NULL ) {
-
+ while (b_encoded_word == false && encoded_word_start_ptr != NULL) {
if (extract_encoded_word_param(encoded_word_start_ptr, &charset, &encoding, &encoded_text, &encoded_word_size) == 0) {
-
if (charset && encoding && encoded_text && encoded_word_size > 0) {
b_encoded_word = true;
MSG_DEBUG("charset [%s], encoding [%s], encoded_text [%s], encoded_word_size [%d]", charset, encoding, encoded_text, encoded_word_size);
}
encoded_word_start_ptr = strstr(encoded_word_start_ptr+1, MSG_STR_DEC_START); /* find next encoded_start_ptr */
-
} /* end of while */
if (b_encoded_word) {
-
/* copy normal text */
if (encoded_word_start_ptr - normal_word_start_ptr > 0) {
result_string.append(normal_word_start_ptr, encoded_word_start_ptr - normal_word_start_ptr);
}
if (strcasecmp(encoding, "B") == 0) {
-
MSG_DEBUG("Base64 encoded text [%s][%d]", encoded_text, strlen(encoded_text));
decoded_text = (char *)MsgDecodeBase64((unsigned char *)encoded_text, strlen(encoded_text), (ULONG *)&decoded_len);
if (decoded_text && decoded_len > 0) {
-
char *result_text = NULL;
int result_text_len = 0;
MSG_FREE(decoded_text);
} else if (strcasecmp(encoding, "Q") == 0) {
-
char *result_text = NULL;
int result_text_len = 0;
decoded_text = (char *)MsgDecodeQuotePrintable((unsigned char *)encoded_text, strlen(encoded_text), (ULONG *)&decoded_len);
if (decoded_text && decoded_len > 0) {
-
MSG_DEBUG("Qprint decoded text [%s][%d], outlen [%d]", decoded_text, strlen(decoded_text), decoded_len);
if (MmsPluginTextConvert("UTF-8", charset, decoded_text, decoded_len, &result_text, &result_text_len) == false) {
break;
}
-
} /* end of while */
if (result_string.length() > 0) {
case MIME_TEXT_X_VTODO:
return "MIME_TEXT_X_VTODO";
-
case MIME_VIDEO_MPEG4:
return "MIME_VIDEO_MPEG4";
case MIME_VIDEO_MP4:
MmsMsgMultiStatus *pMultiStatus = pAttrib->pMultiStatus;
MmsMsgMultiStatus *pCurStatus = NULL;
- while (pMultiStatus != NULL ) {
+ while (pMultiStatus != NULL) {
pCurStatus = pMultiStatus;
pMultiStatus = pMultiStatus->pNext;
MSG_BEGIN();
if (pBody == NULL) {
- MSG_DEBUG("pBody == NULL \n" );
+ MSG_DEBUG("pBody == NULL \n");
MSG_END();
return false;
|| type == MIME_TEXT_VND_WAP_WML
|| type == MIME_TEXT_X_VNOTE
|| type == MIME_APPLICATION_SMIL
- || type == MIME_TEXT_X_IMELODY)
- {
+ || type == MIME_TEXT_X_IMELODY) {
return true;
} else {
return false;
case MIME_TEXT_X_VCALENDAR:
case MIME_TEXT_X_VNOTE: /* vnt */
case MIME_TEXT_X_VTODO:
- case MIME_TEXT_PLAIN: /* vbm - It SHOULD be distinguished from a normal text file. */
- {
+ case MIME_TEXT_PLAIN: { /* vbm - It SHOULD be distinguished from a normal text file. */
char *pszExt = NULL;
if (!pszName)
return MmsPluginComposer::pInstance;
}
-MmsPluginComposer::MmsPluginComposer(){}
-MmsPluginComposer::~MmsPluginComposer(){}
+MmsPluginComposer::MmsPluginComposer() {}
+MmsPluginComposer::~MmsPluginComposer() {}
void MmsPluginComposer::composeSendReq(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S *pSendOptInfo, MMS_DATA_S *pMmsData)
{
-
if (pMsgInfo->msgType.subType == MSG_SENDREQ_MMS) {
-
if (pMmsData->header == NULL) { /* send req from user */
pMmsData->header = MsgMmsCreateHeader();
}
int len = g_list_length(pMmsData->multipartlist);
for (int i = 0; i < len; i++) {
-
MMS_MULTIPART_DATA_S *multipart = (MMS_MULTIPART_DATA_S *)g_list_nth_data(pMmsData->multipartlist, i);
if (multipart) {
/* Calculate allocated buffer size */
for (int i = 0; i < nAddressCnt; ++i) {
-
MSG_SEC_DEBUG("recipientType: %d, address value: %s", pMsgInfo->addressList[i].recipientType, pMsgInfo->addressList[i].addressVal);
if (pMsgInfo->addressList[i].recipientType == MSG_RECIPIENTS_TYPE_UNKNOWN)
pMsgInfo->addressList[i].recipientType = MSG_RECIPIENTS_TYPE_TO;
if (pMsgInfo->addressList[i].recipientType == recipientType) {
-
MMS_ADDRESS_DATA_S * pAddressData = NULL;
if (pMsgInfo->addressList[i].addressType == MSG_ADDRESS_TYPE_PLMN) {
pAddressData = MsgMmsCreateAddress(MSG_ADDRESS_TYPE_PLMN, pMsgInfo->addressList[i].addressVal);
MmsPluginCmAgent *cmAgent = MmsPluginCmAgent::instance();
cmAgent->connection_profile_state_changed_cb(state, user_data);
-
}
static gboolean __connection_create(void *pVoid)
int err = connection_create(&g_connection);
if (CONNECTION_ERROR_NONE == err) {
-
connection_cellular_state_e cellular_state;
connection_type_e net_state;
if (cellular_state == CONNECTION_CELLULAR_STATE_AVAILABLE
|| cellular_state == CONNECTION_CELLULAR_STATE_CONNECTED) {
-
MSG_INFO("Client registration success [%p], cellular_state [%d], net_state [%d]", g_connection, cellular_state, net_state);
err = connection_set_type_changed_cb(g_connection, __connection_type_changed_cb, NULL);
ret = true;
} else {
-
MSG_INFO("Client registration Failed, cellular state [%d], net_state [%d]", cellular_state, net_state);
connection_destroy(g_connection);
g_connection = NULL;
}
-
} else {
MSG_WARN("Client registration failed %d", err);
}
MSG_ERR("connection_get_default_cellular_service_profile Failed!! [%d]", err);
netOpenResult = MSG_CM_ERR_UNKNOWN;
} else {
-
err = connection_profile_set_state_changed_cb(g_profile, __connection_profile_state_changed_cb, g_profile);
if (connection_open_profile(g_connection, g_profile, __connection_profile_opened_cb, NULL) != CONNECTION_ERROR_NONE) {
MSG_ERR("Connection open Failed!!");
netOpenResult = MSG_CM_ERR_UNKNOWN;
}
-
-
}
if (ret_val) {
__ERR_RETURN:
context_invoke(__connection_profile_close, NULL);
- context_invoke( __connection_destroy, NULL);
+ context_invoke(__connection_destroy, NULL);
unlock();
MSG_END();
return isCmOpened;
int err = CONNECTION_ERROR_NONE;
if (result == CONNECTION_ERROR_NONE || result == CONNECTION_ERROR_ALREADY_EXISTS) {
-
err = connection_get_cellular_state(g_connection, &state);
MSG_INFO("connection_get_cellular_state ret [%d], state [%d]", err, state);
err = connection_get_default_cellular_service_profile(g_connection, CONNECTION_CELLULAR_SERVICE_TYPE_MMS, &profile);
if (err != CONNECTION_ERROR_NONE || profile == NULL) {
-
MSG_ERR("Failed connection_get_default_cellular_service_profile. err [%d], profile [%p]", err, profile);
goto __SIGNAL_RETURN;
}
MSG_DEBUG("profile state [%d]", profile_state);
if (profile_state == CONNECTION_PROFILE_STATE_CONNECTED && waitProfileOpen == true) {
-
__connection_profile_print(profile);
MSG_FREE(this->home_url);
} else {
goto __NO_SIGNAL_RETURN; /* Just open success */
}
-
} else {
MSG_ERR("connection open profile Failed!! [%d]", result);
isCmOpened = false;
goto __SIGNAL_RETURN;
-
}
__NO_SIGNAL_RETURN: /* Just Open */
/* Should get profile to get latest profile info*/
err = connection_get_default_cellular_service_profile(g_connection, CONNECTION_CELLULAR_SERVICE_TYPE_MMS, &profile);
if (err != CONNECTION_ERROR_NONE || profile == NULL) {
-
MSG_ERR("Failed connection_get_default_cellular_service_profile. err [%d], profile [%p]", err, profile);
goto __SIGNAL_RETURN;
}
- if (state == CONNECTION_PROFILE_STATE_CONNECTED ) {
+ if (state == CONNECTION_PROFILE_STATE_CONNECTED) {
__connection_profile_print(profile);
MSG_FREE(this->home_url);
goto __SIGNAL_RETURN;
}
-__NO_SIGNAL_RETURN://Default
+__NO_SIGNAL_RETURN: /* Default */
unlock();
return;
mmsHeader.pTo = NULL;
mmsHeader.pCc = NULL;
mmsHeader.pBcc = NULL;
-
}
static void __MmsCleanDecodeBuff(void)
MSG_SEC_INFO("Message-ID =[%s]", mmsHeader.szMsgID);
if (strlen(mmsHeader.szMsgID) > 2)
- __MsgMIMERemoveQuote (mmsHeader.szMsgID);
+ __MsgMIMERemoveQuote(mmsHeader.szMsgID);
break;
mmsHeader.deliveryTime.type = MMS_TIMETYPE_ABSOLUTE;
if (valueLength > 0) {
- if (__MmsDecodeLongInteger(pFile, (UINT32*)&mmsHeader.deliveryTime.time, totalLength) == false) {
+ if (__MmsDecodeLongInteger(pFile, (UINT32*)&mmsHeader.deliveryTime.time, totalLength) == false) {
MSG_DEBUG("invalid MMS_CODE_DELIVERYTIME");
goto __CATCH;
}
MSG_DEBUG("msgStatus GetOneByte fail");
goto __CATCH;
}
- mmsHeader.hideAddress= (MmsSenderVisible)!(MmsGetBinaryType(MmsCodeSenderVisibility, (UINT16)(oneByte &0x7F)));
+ mmsHeader.hideAddress = (MmsSenderVisible)!(MmsGetBinaryType(MmsCodeSenderVisibility, (UINT16)(oneByte &0x7F)));
MSG_SEC_INFO("X-Mms-Sender-Visibility = [%d]", mmsHeader.hideAddress);
break;
break;
default: {
-
/*
* Application-header = Token-text Application-specific-value
* Token-text = Token End-of-string
offset = __MmsGetDecodeOffset();
if (offset >= totalLength)
goto __RETURN;
-
} /* while */
-
__RETURN:
if (mmsHeader.pTo == NULL && pLastTo) {
} else if (strcasecmp(szTypeString, "Application-ID") == 0) {
pMsgType->param.szApplicationID = (char*) calloc(1, textLength + 1);
if (pMsgType->param.szApplicationID) {
- memset(pMsgType->param.szApplicationID, 0, textLength + 1);
+ memset(pMsgType->param.szApplicationID, 0, textLength + 1);
strncpy(pMsgType->param.szApplicationID, szTypeValue, textLength);
- MSG_SEC_DEBUG("Application-ID:%s",pMsgType->param.szApplicationID);
+ MSG_SEC_DEBUG("Application-ID:%s", pMsgType->param.szApplicationID);
}
- } else if (strcasecmp(szTypeString,"Reply-To-Application-ID") == 0) {
- pMsgType->param.szReplyToApplicationID = (char*) calloc(1, textLength + 1);
+ } else if (strcasecmp(szTypeString, "Reply-To-Application-ID") == 0) {
+ pMsgType->param.szReplyToApplicationID = (char*)calloc(1, textLength + 1);
if (pMsgType->param.szReplyToApplicationID) {
memset(pMsgType->param.szReplyToApplicationID, 0, textLength + 1);
strncpy(pMsgType->param.szReplyToApplicationID, szTypeValue, textLength);
- MSG_SEC_DEBUG("ReplyToApplication-ID:%s",pMsgType->param.szReplyToApplicationID);
+ MSG_SEC_DEBUG("ReplyToApplication-ID:%s", pMsgType->param.szReplyToApplicationID);
}
#endif
}
szTypeString = __MmsBinaryDecodeText2(pFile, totalLength, &textLength);
if (szTypeString && (strchr(szTypeString, ';')) != NULL) {
-
MSG_SEC_DEBUG("Constrained-media : Extension-Media : Content Type with delimiter = [%s]", szTypeString);
pszTemp = __MsgGetStringUntilDelimiter(szTypeString, ';');
switch (fieldCode) {
case 0x0E: /* Content-Location */
- case 0x04: /* Content-Location */
- {
+ case 0x04: { /* Content-Location */
pLatinBuff = (char *)calloc(1, MMS_CONTENT_ID_LEN + 1);
if (pLatinBuff == NULL)
goto __CATCH;
}
break;
- case 0x40: /* Content-ID */
- {
+ case 0x40: { /* Content-ID */
char szContentID[MMS_CONTENT_ID_LEN + 1] = {0, };
pLatinBuff = (char *)calloc(1, MMS_CONTENT_ID_LEN + 1);
if (length > 0) {
if (__MmsBinaryDecodeCheckAndDecreaseLength(&headerLen, length) == false)
goto __RETURN;
-
}
if (__MmsBinaryDecodeGetOneByte(pFile, &oneByte, totalLength) == false) {
if (__MmsBinaryDecodeCheckAndDecreaseLength(&headerLen, valueLength) == false)
goto __RETURN;
} else {
-
gCurMmsDecodeBuffPos--;
valueLength++;
valueLength -= textLength;
- if (__MmsBinaryDecodeParameter(pFile, pMsgType, valueLength, totalLength) == false)
- {
+ if (__MmsBinaryDecodeParameter(pFile, pMsgType, valueLength, totalLength) == false) {
MSG_DEBUG("Disposition parameter fail");
goto __CATCH;
}
if (__MmsBinaryDecodeCheckAndDecreaseLength(&headerLen, valueLength) == false)
goto __RETURN;
-
}
break;
case 0x0B: /* Content-Encoding */
-
if (__MmsBinaryDecodeGetOneByte(pFile, &oneByte, totalLength) == false) {
MSG_DEBUG("Disposition value GetOneByte fail");
goto __CATCH;
break;
case 0x0C: /* Content-Language */
-
if (__MmsBinaryDecodeInteger(pFile, (UINT32*)&tmpInt, &tmpIntLen, totalLength) == true) {
if (__MmsBinaryDecodeCheckAndDecreaseLength(&headerLen, tmpIntLen) == false)
goto __RETURN;
if (cTemp)
free(cTemp);
}
-
break;
case 0x0D: /* Content-Length */
-
if (__MmsBinaryDecodeInteger(pFile, (UINT32*)&tmpInt, &tmpIntLen, totalLength) == false) {
MSG_DEBUG("__MmsBinaryDecodeInteger fail...");
goto __CATCH;
break;
case 0x1C: /* Location */
-
pLatinBuff = (char *)calloc(1, MMS_LOCATION_URL_LEN + 1);
if (pLatinBuff == NULL)
goto __CATCH;
break;
case 0x30: /* X-Wap-Content-URI skip this value */
-
MSG_DEBUG("X-Wap-Content-URI header.");
pLatinBuff = (char *)calloc(1, MMS_TEXT_LEN);
if (pLatinBuff == NULL)
break;
- case 0x01: /* Accept-charset */
+ case 0x01: { /* Accept-charset */
/* if (NvGetInt(NV_SI_ADM_GCF_STATE) == 1) */
- {
/* WAP-230-WSP-200010705-a.pdf
8.4.2.8 Accept charset field
The following rules are used to encode accept character set values.
if (length > 0) {
if (__MmsBinaryDecodeCheckAndDecreaseLength(&headerLen, length) == false)
goto __RETURN;
-
}
if (__MmsBinaryDecodeInteger(pFile, (UINT32*)&charset, &charSetLen, totalLength) == false) {
}
default:
-
/* Other Content-xxx headers : Have valueLength */
-
MSG_WARN("unknown Value = 0x%x\n", oneByte);
length = __MmsDecodeValueLength(pFile, &valueLength, totalLength);
pMsgType->encoding = MmsGetTextType(MmsCodeContentTransferEncoding, pValue);
break;
- case MMS_BODYHDR_CONTENTID: /* Content-ID */
- {
+ case MMS_BODYHDR_CONTENTID: { /* Content-ID */
char szContentID[MMS_CONTENT_ID_LEN + 1];
pLatinBuff = (char *)calloc(1, MMS_CONTENT_ID_LEN + 1);
- if (pLatinBuff == NULL)
- {
+ if (pLatinBuff == NULL) {
goto __CATCH;
}
- __MsgMIMERemoveQuote (pValue);
+ __MsgMIMERemoveQuote(pValue);
strncpy(pLatinBuff, pValue, MMS_MSG_ID_LEN);
length = strlen(pLatinBuff);
- if (__MsgLatin2UTF ((unsigned char*)szContentID, MMS_CONTENT_ID_LEN + 1, (unsigned char*)pLatinBuff, length) < 0)
- {
+ if (__MsgLatin2UTF((unsigned char*)szContentID, MMS_CONTENT_ID_LEN + 1, (unsigned char*)pLatinBuff, length) < 0) {
MSG_DEBUG("MsgLatin2UTF fail");
goto __CATCH;
}
strncpy(pLatinBuff, pValue, MMS_MSG_ID_LEN);
length = strlen(pLatinBuff);
- if (__MsgLatin2UTF ((unsigned char*)pMsgType->szContentLocation, MMS_CONTENT_ID_LEN + 1, (unsigned char*)pLatinBuff, length) < 0) {
+ if (__MsgLatin2UTF((unsigned char*)pMsgType->szContentLocation, MMS_CONTENT_ID_LEN + 1, (unsigned char*)pLatinBuff, length) < 0) {
MSG_DEBUG("MsgLatin2UTF fail");
goto __CATCH;
}
if (__MmsBinaryDecodeCheckAndDecreaseLength(&headerLen, textLength) == false)
goto __RETURN;
-
}
} /* while */
nEntries--;
MmsPrintMulitpart(pMultipart, index++);
-
}
pMsgBody->size = totalLength - pMsgBody->offset;
case MIME_MULTIPART_MIXED:
case MIME_MULTIPART_RELATED:
case MIME_MULTIPART_ALTERNATIVE:
-
MSG_DEBUG("Multipart");
if (__MmsBinaryDecodeMultipart(pFile, szFilePath, pMsgType, pMsgBody, totalLength) == false) {
MSG_DEBUG("MmsBinaryDecodeMultipart is fail");
{
int length = gMmsDecodeMaxLen - gCurMmsDecodeBuffPos;
- if (pFile == NULL || pOneByte == NULL)
- {
+ if (pFile == NULL || pOneByte == NULL) {
MSG_DEBUG("invalid file or buffer");
goto __CATCH;
}
if (__MmsBinaryDecodeGetOneByte(pFile, &oneByte, totalLength) == false)
goto __CATCH;
- if (oneByte > 0x7f) {
+ if (oneByte > 0x7f) {
iBuff[count++] = oneByte;
} else {
iBuff[count++] = oneByte;
if (length > 4)
length = 4;
- if (length == 1)
- {
+ if (length == 1) {
if (__MmsBinaryDecodeGetOneByte(pFile, &oneByte, totalLength) == false) {
MSG_DEBUG("_MmsBinaryDecodeGetOneByte fail");
return oneByte;
return false;
}
- if (oneByte < 0x1F) /* long integer : WAP-230-WSP-20010118-p, Proposed Version 18 January 2001 (pp.86) */
- {
+ if (oneByte < 0x1F) { /* long integer : WAP-230-WSP-20010118-p, Proposed Version 18 January 2001 (pp.86) */
pData = (char *)calloc(1, oneByte + 1);
if (pData == NULL) {
MSG_DEBUG("pData calloc fail");
*pInteger = returner.integer;
*pIntLen = oneByte + 1;
- } else if (oneByte >= 0x80) {
+ } else if (oneByte >= 0x80) {
/* short integer : WAP-230-WSP-20010118-p, Proposed Version 18 January 2001 (pp.86) */
*pInteger = oneByte & 0x7f;
*pIntLen = 1;
if (0x00 < oneByte && oneByte < 0x1F) {
/* short-length */
-
*pValueLength = oneByte;
length = 1;
} else if (oneByte == 0x1F) {
MSG_DEBUG(" __MmsBinaryDecodeUintvar fail..");
goto __CATCH;
}
- length ++; /* + length-quote */
+ length++; /* + length-quote */
*pValueLength = uintvar;
} else {
MSG_DEBUG("not a value length type data");
if (0x00 < oneByte && oneByte < 0x1F) {
/* short-length */
-
*pValueLength = oneByte;
length = 1;
} else if (oneByte == 0x1F) {
MSG_DEBUG("__MmsBinaryDecodeUintvar fail..");
goto __CATCH;
}
- length ++; /* + length-quote */
+ length++; /* + length-quote */
*pValueLength = uintvar;
} else {
MSG_DEBUG("there is not length-quote, consider it as short length.");
if (__MmsBinaryDecodeGetBytes(pFile, pData, gMmsDecodeBufLen, totalLength) == false)
goto __CATCH;
- if (szBuff == NULL) {
+ if (szBuff == NULL) {
szBuff = (char *)calloc(1, gMmsDecodeBufLen + 1);
} else {
szTempPtr = (char *)realloc(szBuff, curLen + gMmsDecodeBufLen + 1);
length = strlen(gpCurMmsDecodeBuff) + 1;
} /* while */
- if (length > 0) {
+ if (length > 0) {
pData = (char *)calloc(1, length);
if (pData == NULL) {
goto __CATCH;
strncpy(szBuff, pData, bufLen - 1);
}
- { /* temp brace */
+ nTemp = strlen(szBuff);
- nTemp = strlen(szBuff);
+ const char *pToCharSet = "UTF-8";
- const char *pToCharSet = "UTF-8";
+ UINT16 charset_code = MmsGetBinaryValue(MmsCodeCharSet, charSet);
- UINT16 charset_code = MmsGetBinaryValue(MmsCodeCharSet, charSet);
-
- const char *pFromCharSet = MmsPluginTextConvertGetCharSet(charset_code);
- if (pFromCharSet == NULL || !strcmp(pFromCharSet, pToCharSet)) {
- if (pData) {
- free(pData);
- pData = NULL;
- }
- return true;
+ const char *pFromCharSet = MmsPluginTextConvertGetCharSet(charset_code);
+ if (pFromCharSet == NULL || !strcmp(pFromCharSet, pToCharSet)) {
+ if (pData) {
+ free(pData);
+ pData = NULL;
}
+ return true;
+ }
- char *pDest = NULL;
- int destLen = 0;
+ char *pDest = NULL;
+ int destLen = 0;
- if (MmsPluginTextConvert(pToCharSet, pFromCharSet, szBuff, nTemp, &pDest, &destLen) == false) {
- MSG_DEBUG("MmsPluginTextConvert Fail");
+ if (MmsPluginTextConvert(pToCharSet, pFromCharSet, szBuff, nTemp, &pDest, &destLen) == false) {
+ MSG_DEBUG("MmsPluginTextConvert Fail");
- } else {
- memset(szBuff, 0x00, bufLen);
- snprintf(szBuff, destLen+1, "%s", pDest);
- }
+ } else {
+ memset(szBuff, 0x00, bufLen);
+ snprintf(szBuff, destLen+1, "%s", pDest);
+ }
- if (pDest) {
- free(pDest);
- pDest = NULL;
- }
+ if (pDest) {
+ free(pDest);
+ pDest = NULL;
}
break;
}
char *pTmpBuff = NULL;
- memset (szBuff, 0, bufLen);
+ memset(szBuff, 0, bufLen);
textLength = 0;
pLatinBuff = __MmsBinaryDecodeText2(pFile, totalLength, &textLength);
goto __CATCH;
}
- if (__MsgLatin2UTF ((unsigned char*)pUTF8Buff, utf8BufSize + 1, (unsigned char*)pLatinBuff, length) < 0) {
+ if (__MsgLatin2UTF((unsigned char*)pUTF8Buff, utf8BufSize + 1, (unsigned char*)pLatinBuff, length) < 0) {
MSG_DEBUG("MsgLatin2UTF fail");
goto __CATCH;
}
} else {
pTmpBuff = MsgDecodeText(pLatinBuff);
pUTF8Buff = pTmpBuff;
- free (pLatinBuff);
+ free(pLatinBuff);
pLatinBuff = NULL;
}
}
int nameLength = 0;
nameLength = (length < bufLen) ? (length - strlen(pExt)) : (bufLen - strlen(pExt));
strncpy(szBuff, pUTF8Buff, nameLength);
- g_strlcat(szBuff, pExt,(gsize)bufLen);
-
+ g_strlcat(szBuff, pExt, (gsize)bufLen);
} else {
strncpy(szBuff, pUTF8Buff, bufLen - 1);
}
memcpy(&(pMsg->msgBody), &(mmsHeader.msgBody), sizeof(MsgBody));
{ /* attribute convert mmsHeader -> mmsAttribute */
-
pMsg->mmsAttrib.contentType = (MimeType)mmsHeader.msgType.type;
pMsg->mmsAttrib.date = mmsHeader.date;
nRead = MsgReadFile(pMsg->msgBody.pPresentationBody->body.pText, sizeof(char), pMsg->msgBody.pPresentationBody->size, pFile);
if (nRead == 0)
goto __CATCH;
-
}
MsgCloseFile(pFile);
}
while (pMultipart) {
-
if (__MmsMultipartSaveAsTempFile(&pMultipart->type, pMultipart->pBody,
(char*)MSG_DATA_PATH, pMsg->szFileName, partIndex, bSavePartsAsTempFiles) == false)
goto __CATCH;
MmsPrintMulitpart(pMultipart, partIndex);
pMultipart = pMultipart->pNext;
- partIndex ++;
+ partIndex++;
}
} else { /* single part */
if (pMsg->nPartCount > 0) {
-
if (bSavePartsAsTempFiles) {
if (mkdir(szTempMediaDir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0) {
if (errno == EEXIST) {
strLen = strlen(szName);
- for (i=0; i<strLen; i++) {
+ for (i = 0; i < strLen; i++) {
if (__MsgIsInvalidFileNameChar(szName[i]))
return true;
}
char *pszStrDelimiter = NULL;
int bufLength = 0;
- if (!pszString) {
+ if (!pszString) {
MSG_DEBUG("pszString == NULL");
return NULL;
}
bufLength = pszStrDelimiter - pszString;
- if ((pszBuffer = (char*)calloc (1, bufLength + 1)) == NULL) {
+ if ((pszBuffer = (char*)calloc(1, bufLength + 1)) == NULL) {
MSG_DEBUG("calloc is failed");
return NULL;
}
char *MsgChangeHexString(char *pOrg)
{
char *pNew = NULL;
- char szBuf[10] = {0,};
+ char szBuf[10] = {0, };
char OneChar;
int cLen = 0;
- int cIndex =0;
+ int cIndex = 0;
int index = 0;
if (pOrg == NULL)
}
pCh++;
- for (; pCh<=pTempNextParam ; pCh++) {
+ for (; pCh <= pTempNextParam ; pCh++) {
if (*pCh == MSG_CH_QUOT)
if (*(pCh - 1) != '\\')
count++;
if (pDec) {
switch (MmsGetTextType(MmsCodeParameterCode, pSrc)) {
case MSG_PARAM_BOUNDARY:
-
/* RFC 822: boundary := 0*69<bchars> bcharsnospace */
-
- memset (pType->param.szBoundary, 0, MSG_BOUNDARY_LEN + 1);
+ memset(pType->param.szBoundary, 0, MSG_BOUNDARY_LEN + 1);
strncpy(pType->param.szBoundary, pDec, MSG_BOUNDARY_LEN);
MSG_SEC_INFO("szBoundary = [%s]", pType->param.szBoundary);
break;
break;
case MSG_PARAM_NAME:
-
- memset (pType->param.szName, 0, MSG_LOCALE_FILENAME_LEN_MAX + 1);
+ memset(pType->param.szName, 0, MSG_LOCALE_FILENAME_LEN_MAX + 1);
pUTF8Buff = __MsgConvertLatin2UTF8FileName(pDec);
break;
case MSG_PARAM_FILENAME:
-
- memset (pType->param.szFileName, 0, MSG_FILENAME_LEN_MAX+1);
+ memset(pType->param.szFileName, 0, MSG_FILENAME_LEN_MAX+1);
pUTF8Buff = __MsgConvertLatin2UTF8FileName(pDec);
break;
case MSG_PARAM_TYPE:
-
/* type/subtype of root. Only if content-type is multipart/related */
-
pType->param.type = MimeGetMimeIntFromMimeString(pDec);
MSG_SEC_INFO("type = %d", pType->param.type);
break;
case MSG_PARAM_START:
-
/* Content-id. Only if content-type is multipart/related */
-
- memset (pType->param.szStart, 0, MSG_MSG_ID_LEN + 1);
+ memset(pType->param.szStart, 0, MSG_MSG_ID_LEN + 1);
strncpy(pType->param.szStart, pDec, MSG_MSG_ID_LEN);
MSG_SEC_INFO("szStart = %s", pType->param.szStart);
break;
case MSG_PARAM_START_INFO:
-
/* Only if content-type is multipart/related */
-
- memset (pType->param.szStartInfo, 0, MSG_MSG_ID_LEN + 1);
+ memset(pType->param.szStartInfo, 0, MSG_MSG_ID_LEN + 1);
strncpy(pType->param.szStartInfo, pDec, MSG_MSG_ID_LEN);
MSG_SEC_INFO("szStartInfo = %s", pType->param.szStartInfo);
break;
case MSG_PARAM_REPORT_TYPE:
-
/* only used as parameter of Content-Type: multipart/report; report-type=delivery-status; */
-
if (strcasecmp(pDec, "delivery-status") == 0) {
pType->param.reportType = MSG_PARAM_REPORT_TYPE_DELIVERY_STATUS;
} else {
break;
default:
-
MSG_DEBUG("Unknown paremeter (%s)", pDec);
break;
}
while (true) {
if ((*s == MSG_CH_CR) || (*s == MSG_CH_LF) || (*s == MSG_CH_SP) || (*s == MSG_CH_TAB)) {
++s;
- } else if ((*s != '(') || (__MsgSkipComment(s,(long)NULL)==NULL)) {
+ } else if ((*s != '(') || (__MsgSkipComment(s, (long)NULL) == NULL)) {
return s;
}
}
}
-static char *__MsgSkipComment (char *s,long trim)
+static char *__MsgSkipComment(char *s, long trim)
{
-
char *ret;
char *s1 = s;
char *t = NULL;
do {
switch (*s1) {
case '(':
- if (!__MsgSkipComment (s1,(long)NULL))
+ if (!__MsgSkipComment(s1, (long)NULL))
goto __NULL_RETURN;
t = --s1;
break;
goto __CATCH;
}
- if (__MsgLatin2UTF ((unsigned char*)pUTF8Buff, utf8BufSize + 1, (unsigned char*)pSrc, length) < 0) {
+ if (__MsgLatin2UTF((unsigned char*)pUTF8Buff, utf8BufSize + 1, (unsigned char*)pSrc, length) < 0) {
MSG_DEBUG("MsgLatin2UTF fail");
goto __CATCH;
}
{
char *pNew = NULL;
int cLen = 0;
- int cIndex =0;
+ int cIndex = 0;
int index = 0;
if (pOrg == NULL)
memset(pNew, 0, cLen + 1);
- for (cIndex=0; cIndex<cLen;cIndex++) {
+ for (cIndex=0; cIndex < cLen; cIndex++) {
if (pOrg[cIndex] == '%' && pOrg[cIndex+1] == '2' && pOrg[cIndex+2] == '0') {
pNew[index] = ' ';
index++;
/* Remove additional file information
* ex) Content-type: application/octet-stream; name="060728gibson_210.jpg?size=s"
* if "?size=" exist, insert NULL char. */
- {
- pTemp = strcasestr(pSrc, "?size=");
- if (pTemp != NULL)
- *pTemp = '\0';
- }
+ pTemp = strcasestr(pSrc, "?size=");
+ if (pTemp != NULL)
+ *pTemp = '\0';
}
#if 0
}
/* remove '<' and '>' in ContentID : contentID ex] <0_1.jpg> or <1233445> */
- if (multipartType->szContentID[0]) {
+ if (multipartType->szContentID[0]) {
strLen = strlen(multipartType->szContentID);
if (multipartType->szContentID[0] == '<' && multipartType->szContentID[strLen - 1] == '>') {
strncpy(szTmpContentID, &(multipartType->szContentID[1]), strLen - 2);
pMsgBody->pPresentationBody = pPresentationInfo->pCurPresentation->pBody;
/* remove pCurPresentation from multipart linked list */
- if ((pPresentationInfo->factor == MSG_PRESENTATION_NONE)||(pPresentationInfo->pPrevPart == NULL)) {
+ if ((pPresentationInfo->factor == MSG_PRESENTATION_NONE) || (pPresentationInfo->pPrevPart == NULL)) {
/* first part */
pMsgBody->body.pMultipart = pPresentationInfo->pCurPresentation->pNext;
pMsgType->contentSize -= pPresentationInfo->pCurPresentation->pBody->size;
pMsgBody->size -= pPresentationInfo->pCurPresentation->pBody->size;
if (pPresentationInfo->pCurPresentation) {
-
MmsReleaseMsgDRMInfo(&pPresentationInfo->pCurPresentation->type.drmInfo);
free(pPresentationInfo->pCurPresentation);
pRemovePart = NULL;
}
} else {
-
-
MmsReleaseMsgDRMInfo(&pMsgBody->presentationType.drmInfo);
MmsInitMsgType(&pMsgBody->presentationType);
pSelectedPart->pNext = NULL;
if (pRemoveList) {
-
MmsReleaseMsgDRMInfo(&pRemoveList->type.drmInfo);
MmsReleaseMsgBody(pRemoveList->pBody, pRemoveList->type.type);
memcpy(pPartBody, pSelectedPart->pBody, sizeof(MsgBody));
if (pSelectedPart != NULL) {
-
MmsReleaseMsgDRMInfo(&pSelectedPart->type.drmInfo);
if (pSelectedPart->pBody != NULL) {
while (pSelectedPart) {
if (__MsgIsMultipartMixed(pSelectedPart->type.type)) {
-
if (pSelectedPart->pBody == NULL) {
MSG_DEBUG("pSelectedPart->pBody(1) is NULL");
break;
}
if (pSelectedPart) {
-
MmsReleaseMsgDRMInfo(&pSelectedPart->type.drmInfo);
free(pSelectedPart->pBody);
pTmpMultipart = pRemoveList;
while (pTmpMultipart) {
-
MmsReleaseMsgDRMInfo(&pTmpMultipart->type.drmInfo);
MmsReleaseMsgBody(pTmpMultipart->pBody, pTmpMultipart->type.type);
}
if (pSelectedPart != NULL) {
-
if (pSelectedPart->pBody != NULL)
memcpy(pPartBody, pSelectedPart->pBody, sizeof(MsgBody));
__CATCH:
return false;
-
}
char *MsgResolveContentURI(char *szSrc)
int cIndex = 0;
int cLen = 0;
char ResultChar;
- unsigned char uCh[2] = {0,};
+ unsigned char uCh[2] = {0, };
cLen = strlen(pSrc);
for (cIndex = 0; cIndex < cLen ; cIndex += 2) {
uCh[0] = __MsgConvertCharToInt(pSrc[cIndex]);
uCh[1] = __MsgConvertCharToInt(pSrc[cIndex+1]);
- ch = (int)uCh[0]<<4|uCh[1];
+ ch = (int)uCh[0] << 4 | uCh[1];
}
ResultChar = (char)ch;
static int __MsgConvertCharToInt(char ch)
{
- if (ch>='0' && ch<='9') {
+ if (ch >= '0' && ch <= '9') {
return ch - '0';
- } else if (ch>='a'&& ch <='f') {
+ } else if (ch >= 'a' && ch <= 'f') {
return ch -'a'+10;
- } else if (ch>='A'&& ch <='F') {
+ } else if (ch >= 'A' && ch <= 'F') {
return ch -'A'+10;
} else {
return 0;
}
if (pMsgType1->szContentID[0] != '\0') {
-
length = strlen(pMsgType1->szContentID);
if (pMsgType1->szContentID[0] == '<' && pMsgType1->szContentID[length - 1] == '>') {
char szTempString[MSG_MSG_ID_LEN + 1];
while ((nChar > 0) && (*szSrc != '\0')) {
if (0x01 <= *szSrc && *szSrc <= 0x7F) {
/* check outbuffer's room for this UTF8 character */
-
- outBufSize --;
+ outBufSize--;
if (outBufSize < 0)
goto __RETURN;
strLen = strlen(pszAddr);
- pszAddrCopy = (char*)calloc(1,strLen + 1);
+ pszAddrCopy = (char*)calloc(1, strLen + 1);
if (!pszAddrCopy) {
MSG_DEBUG("pszAddrCopy is NULL, mem alloc failed");
return false;
while ((nChar > 0) && (*szSrc != '\0')) {
if (*szSrc < 0x80) {
- outBufSize --;
+ outBufSize--;
if (outBufSize < 0)
goto __RETURN;
des += 3;
szSrc += 3;
} else {
- outBufSize --;
+ outBufSize--;
if (outBufSize < 0)
goto __RETURN;
{
MSG_BEGIN();
int nRead = 0;
- int length= 0;
+ int length = 0;
if (pFile == NULL) {
MSG_DEBUG("Error");
if (pPartType->type == MIME_APPLICATION_SMIL) {
snprintf(szFileName, MSG_FILENAME_LEN_MAX+1, "%s", "smil.txt");
} else {
-
if (pPartType->param.szName[0] != '\0') {
snprintf(szFileName, MSG_FILENAME_LEN_MAX+1, "%s", pPartType->param.szName);
} else if (pPartType->param.szFileName[0] != '\0') {
MSG_SEC_DEBUG("save flag [%d], filepath [%s], file exist [%d]", bSave, szFullPath, bFileExist);
if (bSave == true && bFileExist == false) {
-
if ((pFile = MsgOpenFile(szFullPath, "wb+")) == NULL) {
MSG_DEBUG("MsgOpenFile failed");
goto __CATCH;
/* IF DRM type Convert to dcf */
if (pPartType->type == MIME_APPLICATION_VND_OMA_DRM_MESSAGE
- || pPartType->type == MIME_APPLICATION_VND_OMA_DRM_CONTENT)
- {
- char destDrmPath[MSG_FILEPATH_LEN_MAX] = {0,};
+ || pPartType->type == MIME_APPLICATION_VND_OMA_DRM_CONTENT) {
+ char destDrmPath[MSG_FILEPATH_LEN_MAX] = {0, };
if (MsgDrmConvertDmtoDcfType(pPartBody->szOrgFilePath, destDrmPath) == true) {
MSG_INFO("Success Convert to Dcf");
/* IF DRM type check dcf exist */
if (pPartType->type == MIME_APPLICATION_VND_OMA_DRM_MESSAGE
- || pPartType->type == MIME_APPLICATION_VND_OMA_DRM_CONTENT)
- {
- char destDrmPath[MSG_FILEPATH_LEN_MAX] = {0,};
+ || pPartType->type == MIME_APPLICATION_VND_OMA_DRM_CONTENT) {
+ char destDrmPath[MSG_FILEPATH_LEN_MAX] = {0, };
MsgGetFileNameWithoutExtension(destDrmPath, pPartBody->szOrgFilePath);
strncat(destDrmPath, ".dcf", 4);
}
if (MmsIsTextType(msgTypeValue)) {
-
if (msgCharsetValue == MSG_CHARSET_US_ASCII) {
pNewData = pTemp;
*npRead = nTemp;
} else if (msgCharsetValue == MSG_CHARSET_UTF8) {
-
- /* skip BOM (Byte Order Mark) bytes .. (Please refer to the http://www.unicode.org/faq/utf_bom.html#BOM) */
+ /* skip BOM(Byte Order Mark) bytes .. (Please refer to the http://www.unicode.org/faq/utf_bom.html#BOM) */
if (nTemp >= 3) {
if (((UINT8)pTemp[0]) == 0xEF && ((UINT8)pTemp[1]) == 0xBB && ((UINT8)pTemp[2]) == 0xBF) {
pTemp += 3;
pNewData = pTemp;
*npRead = nTemp;
} else {
-
UINT16 MIBenum = MmsGetBinaryValue(MmsCodeCharSet, msgCharsetValue);
pFromCodeSet = MmsGetTextByCode(MmsCodeCharSet, MIBenum);
static bool __MsgMakeFileName(int iMsgType, char *szFileName, MsgDrmType drmType, int nUntitleIndex, char *outBuf, int outBufLen)
{
- char szTemp[MSG_FILENAME_LEN_MAX+1]={0,};
- char szTempFileName[MSG_FILENAME_LEN_MAX+1]={0,};
+ char szTemp[MSG_FILENAME_LEN_MAX+1] = {0, };
+ char szTempFileName[MSG_FILENAME_LEN_MAX+1] = {0, };
const char *pExt = NULL;
MSG_SEC_DEBUG("Input : type [0x%x], drmType [%d], filename [%s]", iMsgType, drmType, szFileName);
/* Filename */
int inp_len = strlen(szFileName);
if (inp_len > 0) {
-
pExt = strrchr(szFileName, '.');
if (pExt != NULL && *(pExt + 1) != '\0') {
pExt = "dcf";
if (pExt == NULL) { /* find ext from content type */
-
if (iMsgType == MIME_APPLICATION_OCTET_STREAM || iMsgType == MIME_UNKNOWN) {
MSG_DEBUG("unsupported MsgType [%d]", iMsgType);
goto __CATCH;
return false;
}
-bool MsgGetFileNameWithoutExtension (char *szOutputName, char *szName)
+bool MsgGetFileNameWithoutExtension(char *szOutputName, char *szName)
{
char *pszExt = NULL;
}
-///////////////////////////////////////////////////////////////////////////////
-
MmsPluginDecoder *MmsPluginDecoder::pInstance = NULL;
MmsPluginDecoder *MmsPluginDecoder::instance()
return MmsPluginDecoder::pInstance;
}
-MmsPluginDecoder::MmsPluginDecoder(){}
-MmsPluginDecoder::~MmsPluginDecoder(){}
+MmsPluginDecoder::MmsPluginDecoder() {}
+MmsPluginDecoder::~MmsPluginDecoder() {}
void MmsPluginDecoder::decodeMmsPdu(MmsMsg *pMsg, msg_message_id_t msgID, const char *pduFilePath)
{
memcpy(&(pMsg->msgBody), &(mmsHeader.msgBody), sizeof(MsgBody));
{ /* attribute convert mmsHeader -> mmsAttribute */
-
pMsg->mmsAttrib.contentType = (MimeType)mmsHeader.msgType.type;
pMsg->mmsAttrib.date = mmsHeader.date;
nRead = MsgReadFile(pMsg->msgBody.pPresentationBody->body.pText, sizeof(char), pMsg->msgBody.pPresentationBody->size, pFile);
if (nRead == 0)
goto __CATCH;
-
}
MsgCloseFile(pFile);
}
while (pMultipart) {
-
if (__MmsMultipartSaveAsTempFile(&pMultipart->type, pMultipart->pBody,
(char*)MSG_DATA_PATH, pMsg->szFileName, partIndex, true) == false)
goto __CATCH;
MmsPrintMulitpart(pMultipart, partIndex);
pMultipart = pMultipart->pNext;
- partIndex ++;
+ partIndex++;
}
} else { /* single part */
if (pMsg->nPartCount > 0) {
-
if (mkdir(szTempMediaDir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0) {
if (errno == EEXIST) {
MSG_DEBUG("exist dir : [%s]", szTempMediaDir);
MSG_DEBUG("### Fail ###");
MSG_END();
return;
-
}
/* CID 41989: Removed function decodeMmsPdu which is unused. */
MmsInitHeader();
- //pMsg->msgID = msgID;
+ /* pMsg->msgID = msgID; */
snprintf(szFullPath, sizeof(szFullPath), "%s", pduFilePath);
- //MsgGetFileName(szFullPath, pMsg->szFileName, sizeof(pMsg->szFileName));
+ /* MsgGetFileName(szFullPath, pMsg->szFileName, sizeof(pMsg->szFileName)); */
if (MsgGetFileSize(szFullPath, &nSize) == false) {
MSG_FATAL("Fail MsgGetFileSize");
goto __CATCH;
}
- //set header
+ /* set header */
if (pMmsData->header == NULL) {
pMmsData->header = MsgMmsCreateHeader();
}
snprintf(pMmsData->header->trID, sizeof(pMmsData->header->trID), "%s", mmsHeader.szTrID);
- //CID 41989: Moving assignment of iter_multipart before its de-referencing.
iter_multipart = mmsHeader.msgBody.body.pMultipart;
- //set multipart
- if (pMmsData->header->contentType == MIME_MULTIPART_RELATED || pMmsData->header->contentType == MIME_APPLICATION_VND_WAP_MULTIPART_RELATED) {
+ /*set multipart */
+ if (pMmsData->header->contentType == MIME_MULTIPART_RELATED || pMmsData->header->contentType == MIME_APPLICATION_VND_WAP_MULTIPART_RELATED) {
MMS_MULTIPART_DATA_S *pMultipart = MsgMmsCreateMultipart();
pMultipart->type = MIME_APPLICATION_SMIL;
snprintf(pMultipart->szContentLocation, sizeof(pMultipart->szContentLocation), "%s", mmsHeader.msgBody.presentationType.szContentLocation);
snprintf(pMultipart->szFileName, sizeof(pMultipart->szFileName), "%s", mmsHeader.msgBody.presentationType.param.szName);
- //snprintf(pMultipart->szFilePath, sizeof(pMultipart->szFilePath), MSG_DATA_PATH"%s", mmsHeader.msgBody.presentationType.param.szFileName);
+ /* snprintf(pMultipart->szFilePath, sizeof(pMultipart->szFilePath), MSG_DATA_PATH"%s", mmsHeader.msgBody.presentationType.param.szFileName); */
MsgBody *pBody = iter_multipart->pBody;
pMultipart->pMultipartData = MsgOpenAndReadMmsFile(pBody->szOrgFilePath, pBody->offset, pBody->size, (int*)&pMultipart->nMultipartDataLen);
while (iter_multipart) {
-
MMS_MULTIPART_DATA_S *pMultipart = MsgMmsCreateMultipart();
pMultipart->type = (MimeType)iter_multipart->type.type;
- snprintf(pMultipart->szContentType, sizeof(pMultipart->szContentType), "%s",MimeGetMimeStringFromMimeInt(iter_multipart->type.type));
+ snprintf(pMultipart->szContentType, sizeof(pMultipart->szContentType), "%s", MimeGetMimeStringFromMimeInt(iter_multipart->type.type));
snprintf(pMultipart->szContentID, sizeof(pMultipart->szContentID), "%s", iter_multipart->type.szContentID);
snprintf(pMultipart->szContentLocation, sizeof(pMultipart->szContentLocation), "%s", iter_multipart->type.szContentLocation);
snprintf(pMultipart->szFileName, sizeof(pMultipart->szFileName), "%s", iter_multipart->type.param.szName);
- //snprintf(pMultipart->szFilePath, sizeof(pMultipart->szFilePath), "%s", iter_multipart->pBody->szOrgFilePath);
+ /* snprintf(pMultipart->szFilePath, sizeof(pMultipart->szFilePath), "%s", iter_multipart->pBody->szOrgFilePath); */
MsgBody *pBody = iter_multipart->pBody;
pMultipart->pMultipartData = MsgOpenAndReadMmsFile(pBody->szOrgFilePath, pBody->offset, pBody->size, (int*)&pMultipart->nMultipartDataLen);
return false;
}
- char szMimeType[DRM_MAX_LEN_MIME + 1] = {0,};
- char szContentID[DRM_MAX_LEN_CID + 1] = {0,};
+ char szMimeType[DRM_MAX_LEN_MIME + 1] = {0, };
+ char szContentID[DRM_MAX_LEN_CID + 1] = {0, };
MSG_DRM_TYPE drmType = MSG_DRM_NONE;
int ret = 0;
}
/* make report body .. */
- maxLen = strlen (pszReportMsg) +16 /* date string */ + 8 /* enter chars */ ;
+ maxLen = strlen(pszReportMsg) + 16 /* date string */ + 8 /* enter chars */ ;
if (maxLen > MSG_STDSTR_LONG) {
- snprintf (pText, MSG_STDSTR_LONG, "%s", pszReportMsg);
+ snprintf(pText, MSG_STDSTR_LONG, "%s", pszReportMsg);
} else {
snprintf(pText, MSG_STDSTR_LONG, "%s\r\n\r\n%.4d/%.2d/%.2d %.2d:%.2d\r\n",
pszReportMsg, dateTime.tm_year+1900, dateTime.tm_mon+1, dateTime.tm_mday, dateTime.tm_hour, dateTime.tm_min);
/* To = Encoded-string-value */
- if (__MmsBinaryEncodeAddress(pFile, MMS_CODE_TO, pMsg->mmsAttrib.szTo) == false)
- {
+ if (__MmsBinaryEncodeAddress(pFile, MMS_CODE_TO, pMsg->mmsAttrib.szTo) == false) {
MSG_DEBUG("To __MmsBinaryEncodeAddress fail");
goto __CATCH;
}
if ((pMsg->mmsAttrib.replyCharge.chargeType == MMS_REPLY_REQUESTED) ||
(pMsg->mmsAttrib.replyCharge.chargeType == MMS_REPLY_REQUESTED_TEXT_ONLY)) {
-
/* reply charging */
fieldCode = MmsGetBinaryValue(MmsCodeFieldCode, MMS_CODE_REPLYCHARGING)|0x80;
fieldValue = MmsGetBinaryValue(MmsCodeReadReply, pMsg->mmsAttrib.replyCharge.chargeType)|0x80;
gpMmsEncodeBuf[gCurMmsEncodeBuffPos++] = MmsGetBinaryValue(MmsCodeFieldCode, MMS_CODE_REPLYCHARGINGSIZE) | 0x80;
- if (__MmsBinaryEncodeInteger(pFile, pMsg->mmsAttrib.replyCharge.chargeSize, length) == false) {
+ if (__MmsBinaryEncodeInteger(pFile, pMsg->mmsAttrib.replyCharge.chargeSize, length) == false) {
MSG_DEBUG("replyChargingSize MmsBinaryEncodeInteger error");
goto __CATCH;
}
snprintf(szSubject, MSG_LOCALE_SUBJ_LEN + 8, "%s", MMS_READ_REPORT_STRING_READ);
} else {
- snprintf(szSubject, MSG_LOCALE_SUBJ_LEN + 8, "%s", MMS_READ_REPORT_STRING_DELETED );
+ snprintf(szSubject, MSG_LOCALE_SUBJ_LEN + 8, "%s", MMS_READ_REPORT_STRING_DELETED);
}
}
goto __CATCH;
}
- snprintf(szTo, length + 11,"%s/TYPE=PLMN", pMsg->mmsAttrib.szFrom);
+ snprintf(szTo, length + 11, "%s/TYPE=PLMN", pMsg->mmsAttrib.szFrom);
MSG_DEBUG("To = %s", szTo);
if (__MmsBinaryEncodeAddress(pFile, MMS_CODE_TO, szTo) == false) {
}
if (MmsIsMultipart(pType->type)) {
-
int nEntries = 0;
/* ---------------------------
* Multipart message
contentType = pType->type;
fieldValue = MmsGetBinaryValue(MmsCodeContentType, contentType);
- if (fieldValue == UNDEFINED_BINARY || fieldValue == 0x0049) {
+ if (fieldValue == UNDEFINED_BINARY || fieldValue == 0x0049) {
/* Extension-media type */
szTextType = MmsGetTextValue(MmsCodeContentType, contentType);
if (szTextType != NULL) {
if (pType->param.szName[0]) {
char* pszName = NULL;
- if (MmsIsAsciiString (pType->param.szName)) {
+ if (MmsIsAsciiString(pType->param.szName)) {
MSG_DEBUG("Name is consisted of ascii char-set chars.");
} else {
isAscii = false;
if (pType->param.szName[0]) {
MSG_SEC_DEBUG("Parameter Name : %s", pType->param.szName);
char *pszName = NULL;
- if (MmsIsAsciiString (pType->param.szName)) {
+ if (MmsIsAsciiString(pType->param.szName)) {
MSG_DEBUG("Name is consisted of ascii char-set chars.");
} else {
isAscii = false;
MSG_DEBUG(" szApplicationID MmsBinaryEncodeTextString fail");
goto __CATCH;
}
-
}
/* ReplyToApplicationID: Text-string */
} else {
/* Any-charset */
if (MmsIsTextType(contentType)) {
- if (!MmsIsVitemContent (contentType, pType->param.szName)) {
+ if (!MmsIsVitemContent(contentType, pType->param.szName)) {
gpMmsEncodeBuf[gCurMmsEncodeBuffPos++] = MmsGetBinaryValue(MmsCodeParameterCode, MSG_PARAM_CHARSET) | 0x80;
fieldValue = 0x0000; /* laconic_warning, just to remove warning message */
gpMmsEncodeBuf[gCurMmsEncodeBuffPos++] = (UINT8)fieldValue | 0x80;
goto __CATCH;
}
- if (__MmsBinaryEncodeContentHeader(pFile, (MimeType)contentType, pType, true) == false) {
+ if (__MmsBinaryEncodeContentHeader(pFile, (MimeType)contentType, pType, true) == false) {
MSG_DEBUG("MmsBinaryEncodeContentHeader fail");
goto __CATCH;
}
if (contentType != MIME_APPLICATION_VND_WAP_MULTIPART_RELATED &&
contentType != MIME_MULTIPART_RELATED &&
pType->disposition != INVALID_VALUE) {
-
/*
* Content-disposition-value = Value-length Disposition *(Parameter)
* Disposition = Form-data | Attachment | Inline | Token-text
/* content-id ------------------------------------------------- */
if (pType->szContentID[0]) {
-
MSG_SEC_DEBUG("Content ID : %s", pType->szContentID);
if (bMultipart) { /* Binary Encoding */
if (pType->szContentLocation[0]) {
MSG_SEC_DEBUG("Content Location : %s", pType->szContentLocation);
- if (MmsIsAsciiString (pType->szContentLocation)) {
+ if (MmsIsAsciiString(pType->szContentLocation)) {
MSG_DEBUG("Name is consisted of ascii char-set chars.");
} else {
isAscii = false;
if (contentType != MIME_APPLICATION_VND_WAP_MULTIPART_RELATED &&
contentType != MIME_MULTIPART_RELATED &&
pType->disposition != INVALID_VALUE) {
-
MSG_DEBUG("Content Disposition : %d", pType->disposition);
/*
* Content-disposition-value = Value-length Disposition *(Parameter)
*/
if (bMultipart) { /* Binary Encoding */
-
UINT8 fieldValue = 0xff;
gpMmsEncodeBuf[gCurMmsEncodeBuffPos++] = MmsGetBinaryValue(MmsCodeMsgBodyHeaderCode, MMS_BODYHDR_DISPOSITION) | 0x80;
}
} else if (pBody->body.pText && pBody->size) {
pBody->offset = __MmsGetEncodeOffset();
- if (MsgWriteFile(pBody->body.pText, sizeof(char),(size_t)pBody->size, pFile) != (size_t)pBody->size) {
+ if (MsgWriteFile(pBody->body.pText, sizeof(char), (size_t)pBody->size, pFile) != (size_t)pBody->size) {
MSG_DEBUG("MsgWriteFile failed");
goto __CATCH;
}
/* short-integer */
return 1;
} else {
-
int length = 0;
/*
* Long-integer = Short-length Multi-octet-integer
i++;
}
- for(i=0; i < length; i++)
+ for (i = 0; i < length; i++)
gpMmsEncodeBuf[gCurMmsEncodeBuffPos++] = szReverse[length - i - 1];
return true;
}
textLeng = __MmsBinaryEncodeTextStringLen((UINT8*)source);
- if (textLeng == -1) {
+ if (textLeng == -1) {
MSG_DEBUG(" textLeng MmsBinaryEncodeTextStringLen fail.");
goto __CATCH;
}
goto __CATCH;
}
- if (length != (charLeng + textLeng + valLengthLen))
- {
+ if (length != (charLeng + textLeng + valLengthLen)) {
MSG_DEBUG("invalid length");
goto __CATCH;
}
}
gpMmsEncodeBuf[gCurMmsEncodeBuffPos++] = fieldCode;
- if (__MmsBinaryEncodeTextString(pFile, (UINT8*)szMsgID, length) == false) {
+ if (__MmsBinaryEncodeTextString(pFile, (UINT8*)szMsgID, length) == false) {
MSG_DEBUG("MmsBinaryEncodeTextString fail");
goto __CATCH;
}
pSingleAddr = strchr(szAddr, MSG_CH_SEMICOLON);
if (pSingleAddr) {
-
*pSingleAddr = MSG_CH_NULL;
if (__MmsBinaryEncodeOneAddress(pFile, addrType, szAddr) == false) {
MSG_DEBUG("__MmsBinaryEncodeAddress fail");
}
if ((gMmsEncodeMaxLen - gCurMmsEncodeBuffPos) < (length + timeLen + 2)) { /* + fieldCode + timeType */
-
if (MsgWriteDataFromEncodeBuffer(pFile, gpMmsEncodeBuf, &gCurMmsEncodeBuffPos,
gMmsEncodeMaxLen, &gMmsEncodeCurOffset) == false) {
MSG_DEBUG("MsgWriteDataFromEncodeBuffer fail");
/* time type & value */
if (time.type == MMS_TIMETYPE_RELATIVE) {
gpMmsEncodeBuf[gCurMmsEncodeBuffPos++] = MmsGetBinaryValue(MmsCodeTimeType, MMS_TIMETYPE_RELATIVE) | 0x80;
- if (__MmsBinaryEncodeInteger(pFile, time.time, timeLen) == false) {
+ if (__MmsBinaryEncodeInteger(pFile, time.time, timeLen) == false) {
MSG_DEBUG("MmsBinaryEncodeLongInteger fail");
goto __CATCH;
}
return s;
}
}
-//////////////////////////////////////////////////////////////////////////////
+
static bool __EncodeMmsMessage(MmsMsg *pMmsMsg, const char *raw_filepath)
{
bool encode_ret = false;
goto __CATCH;
}
- switch(pMmsMsg->mmsAttrib.msgType)
- {
+ switch(pMmsMsg->mmsAttrib.msgType) {
case MMS_MSGTYPE_SEND_REQ:
case MMS_MSGTYPE_SEND_CONF:
encode_ret = MmsEncodeSendReq(pFile, pMmsMsg);
return MmsPluginEncoder::pInstance;
}
-MmsPluginEncoder::MmsPluginEncoder(){}
-MmsPluginEncoder::~MmsPluginEncoder(){}
+MmsPluginEncoder::MmsPluginEncoder() {}
+MmsPluginEncoder::~MmsPluginEncoder() {}
void MmsPluginEncoder::encodeMmsPdu(MMS_DATA_S *pMmsData, msg_message_id_t msgID, const char *pduFilePath)
{
__CATCH:
MmsReleaseMmsMsg(pMmsMsg);
MSG_FREE(pMmsMsg);
-
}
void MmsPluginEncoder::encodeMmsPdu(MmsMsg *pMmsMsg, msg_message_id_t msgID, const char *pduFilePath)
MmsPluginEventHandler::~MmsPluginEventHandler()
{
-
}
void MmsPluginEventHandler::handleMmsReceivedData(mmsTranQEntity *pRequest, char *pRetrievedFilePath)
{
- MSG_MESSAGE_INFO_S msgInfo = {0,};
+ MSG_MESSAGE_INFO_S msgInfo = {0, };
msgInfo.sim_idx = pRequest->simId;
switch (pRequest->eMmsPduType) {
#include "MmsPluginUtil.h"
static void __http_print_profile(CURL *curl);
-static int __http_debug_cb (CURL *input_curl, curl_infotype input_info_type, char *input_data , size_t input_size, void *input_void);
+static int __http_debug_cb(CURL *input_curl, curl_infotype input_info_type, char *input_data, size_t input_size, void *input_void);
static void __httpAllocHeaderInfo(curl_slist **responseHeaders, char *szUrl, int ulContentLen);
static bool __httpGetHeaderField(MMS_HTTP_HEADER_FIELD_T httpHeaderItem, char *szHeaderBuffer);
FUNCTION IMPLEMENTATION
==================================================================================================*/
-static int __http_debug_cb (CURL *input_curl, curl_infotype input_info_type, char *input_data , size_t input_size, void *input_void)
+static int __http_debug_cb(CURL *input_curl, curl_infotype input_info_type, char *input_data, size_t input_size, void *input_void)
{
MSG_SEC_INFO("curl_infotype [%d] : %s", input_info_type, input_data);
return 0;
memset(pcheader, 0, HTTP_REQUEST_LEN);
__httpGetHost(szUrl, szBuffer, 1024);
- if (strlen(szBuffer)){
+ if (strlen(szBuffer)) {
snprintf(pcheader, HTTP_REQUEST_LEN, "Host: %s", szBuffer);
MSG_INFO("%s", pcheader);
*responseHeaders = curl_slist_append(*responseHeaders, pcheader);
retval = select(max_fd+1, &fd_r, &fd_w, &fd_excp, &timeout);
- if (retval == -1){ /* select error */
+ if (retval == -1) { /* select error */
MSG_ERR("select error");
ret = -1;
break;
- } else if (retval == 0){ /* timeout */
+ } else if (retval == 0) { /* timeout */
MSG_ERR("time out");
ret = -1;
break;
}
MSG_INFO("curl_multi_perform end : rcm = %d, still_running = %d, cm_open = %d", rcm, still_running, connection_open_flag);
-
} while (still_running && (connection_open_flag == true));
while ((msg = curl_multi_info_read(multi_handle, &msgs_left))) {
if (msg->msg == CURLMSG_DONE) {
-
if (msg->easy_handle == session) {
MSG_INFO("HTTP transfer completed with status %d", msg->data.result);
if (msg->data.result != 0) {
MmsPluginHttpAgent *MmsPluginHttpAgent::pInstance = NULL;
MmsPluginHttpAgent *MmsPluginHttpAgent::instance()
{
- if (!pInstance)
- {
+ if (!pInstance) {
pInstance = new MmsPluginHttpAgent();
}
/* Verify request info */
if (request_info.transaction_type != MMS_HTTP_TRANSACTION_TYPE_GET
- && request_info.transaction_type != MMS_HTTP_TRANSACTION_TYPE_POST)
- {
+ && request_info.transaction_type != MMS_HTTP_TRANSACTION_TYPE_POST) {
MSG_ERR("transaction_type of request_info is Invaild [%d]", request_info.transaction_type);
http_error = MMS_HTTP_ERROR_TRANSACTION_TYPE;
goto __CATCH;
}
if (request_info.transaction_type == MMS_HTTP_TRANSACTION_TYPE_POST) {
-
if (request_info.post_data == NULL || request_info.post_data_len == 0) {
MSG_ERR("post data info is Invaild");
http_error = MMS_HTTP_ERROR_SESSION;
/* close conf file & load response data */
if (respfile) {
-
fclose(respfile);
respfile = NULL;
MmsPluginInternal::MmsPluginInternal()
{
-
}
MmsPluginInternal::~MmsPluginInternal()
{
-
}
MmsPluginInternal *MmsPluginInternal::instance()
MSG_BEGIN();
FILE *pFile = NULL;
- char fileName[MSG_FILENAME_LEN_MAX] = {0,};
+ char fileName[MSG_FILENAME_LEN_MAX] = {0, };
if (pMsgInfo->bTextSms == true) {
- char fullPath[MAX_FULL_PATH_SIZE+1] = {0,};
+ char fullPath[MAX_FULL_PATH_SIZE+1] = {0, };
if (MsgCreateFileName(fileName) == false)
THROW(MsgException::FILE_ERROR, "MsgCreateFileName error");
MSG_DEBUG("pMsgInfo->subject [%s]", pMsgInfo->subject);
-#if 0 // P150826-01612, P150910-05427 : we do not need to add empty subject text any more.
+#if 0 /* we do not need to add empty subject text any more. */
if (strlen(pMsgInfo->subject) < 1)
snprintf(pMsgInfo->subject, MAX_SUBJECT_LEN, "MMS Notification Message.");
#endif
MMS_DATA_S *mms_data = MsgMmsCreate();
if (mms_data == NULL)
return false;
- {
- mms_data->header = MsgMmsCreateHeader();
- if (mms_data->header == NULL) {
- MsgMmsRelease(&mms_data);
- return false;
- }
+ mms_data->header = MsgMmsCreateHeader();
- MMS_HEADER_DATA_S *pHeader = mms_data->header;
+ if (mms_data->header == NULL) {
+ MsgMmsRelease(&mms_data);
+ return false;
+ }
- pHeader->messageType = mmsHeader.type;
+ MMS_HEADER_DATA_S *pHeader = mms_data->header;
- snprintf(pHeader->trID, sizeof(pHeader->trID), "%s", mmsHeader.szTrID);
+ pHeader->messageType = mmsHeader.type;
- pHeader->mmsVersion = mmsHeader.version;
+ snprintf(pHeader->trID, sizeof(pHeader->trID), "%s", mmsHeader.szTrID);
- /* From */
- if (mmsHeader.pFrom) {
- MmsAddrUtilRemovePlmnString(mmsHeader.pFrom->szAddr);
- snprintf(pHeader->szFrom, sizeof(pHeader->szFrom), "%s", mmsHeader.pFrom->szAddr);
- }
+ pHeader->mmsVersion = mmsHeader.version;
- /* Subject */
- snprintf(pHeader->szSubject, sizeof(pHeader->szSubject), "%s", mmsHeader.szSubject);
- /* Delivery Report */
- pHeader->bDeliveryReport = (mmsHeader.deliveryReport != MMS_REPORT_YES);
- /* Message Class */
- pHeader->messageClass = mmsHeader.msgClass;
+ /* From */
+ if (mmsHeader.pFrom) {
+ MmsAddrUtilRemovePlmnString(mmsHeader.pFrom->szAddr);
+ snprintf(pHeader->szFrom, sizeof(pHeader->szFrom), "%s", mmsHeader.pFrom->szAddr);
+ }
- /* Priority */
- pHeader->mmsPriority = mmsHeader.priority;
+ /* Subject */
+ snprintf(pHeader->szSubject, sizeof(pHeader->szSubject), "%s", mmsHeader.szSubject);
+ /* Delivery Report */
+ pHeader->bDeliveryReport = (mmsHeader.deliveryReport != MMS_REPORT_YES);
+ /* Message Class */
+ pHeader->messageClass = mmsHeader.msgClass;
- /* Message Size : pMmsMsg->mmsAttrib.msgSize = mmsHeader.msgSize; */
- /* Expiry */
- pHeader->expiry.type = mmsHeader.expiryTime.type;
- pHeader->expiry.time = mmsHeader.expiryTime.time;
+ /* Priority */
+ pHeader->mmsPriority = mmsHeader.priority;
- time_t curTime = time(NULL);
+ /* Message Size : pMmsMsg->mmsAttrib.msgSize = mmsHeader.msgSize; */
+ /* Expiry */
+ pHeader->expiry.type = mmsHeader.expiryTime.type;
+ pHeader->expiry.time = mmsHeader.expiryTime.time;
- if (pHeader->expiry.type == MMS_TIMETYPE_RELATIVE) {
- pHeader->expiry.type = MMS_TIMETYPE_ABSOLUTE;
- pHeader->expiry.time += curTime;
- }
+ time_t curTime = time(NULL);
- /* Charge */
- /* contentclass */
- /* int contentClass;//text | image-basic| image-rich | video-basic | video-rich | megapixel | content-basic | content-rich */
- strncpy(pHeader->contentLocation, mmsHeader.szContentLocation, MMS_LOCATION_LEN);
+ if (pHeader->expiry.type == MMS_TIMETYPE_RELATIVE) {
+ pHeader->expiry.type = MMS_TIMETYPE_ABSOLUTE;
+ pHeader->expiry.time += curTime;
+ }
- pHeader->messageSize = mmsHeader.msgSize;
+ /* Charge */
+ /* contentclass */
+ /* int contentClass; */ /*text | image-basic| image-rich | video-basic | video-rich | megapixel | content-basic | content-rich */
+ strncpy(pHeader->contentLocation, mmsHeader.szContentLocation, MMS_LOCATION_LEN);
- MSG_DEBUG("Message size = [%d]", pHeader->messageSize);
+ pHeader->messageSize = mmsHeader.msgSize;
- char *pSerializedMms = NULL;
- int serializeDataSize = 0;
+ MSG_DEBUG("Message size = [%d]", pHeader->messageSize);
- char pTempFileName[MSG_FILENAME_LEN_MAX+1] = {0};
- char pTempFilePath[MSG_FILEPATH_LEN_MAX+1] = {0};
+ char *pSerializedMms = NULL;
+ int serializeDataSize = 0;
- serializeDataSize = MsgSerializeMms(mms_data, &pSerializedMms);
+ char pTempFileName[MSG_FILENAME_LEN_MAX+1] = {0};
+ char pTempFilePath[MSG_FILEPATH_LEN_MAX+1] = {0};
- if (pSerializedMms) {
- if (MsgCreateFileName(pTempFileName) == true) {
- pMsgInfo->bTextSms = false;
+ serializeDataSize = MsgSerializeMms(mms_data, &pSerializedMms);
- snprintf(pTempFilePath, sizeof(pTempFilePath), "%s%s", MSG_IPC_DATA_PATH, pTempFileName);
+ if (pSerializedMms) {
+ if (MsgCreateFileName(pTempFileName) == true) {
+ pMsgInfo->bTextSms = false;
- MsgOpenCreateAndOverwriteFile(pTempFilePath, pSerializedMms, serializeDataSize);
+ snprintf(pTempFilePath, sizeof(pTempFilePath), "%s%s", MSG_IPC_DATA_PATH, pTempFileName);
- /* set file name */
- snprintf(pMsgInfo->msgData, sizeof(pMsgInfo->msgData), "%s", pTempFileName);
- }
+ MsgOpenCreateAndOverwriteFile(pTempFilePath, pSerializedMms, serializeDataSize);
- free(pSerializedMms);
+ /* set file name */
+ snprintf(pMsgInfo->msgData, sizeof(pMsgInfo->msgData), "%s", pTempFileName);
}
+
+ free(pSerializedMms);
}
- MsgMmsRelease(&mms_data);
+
+ MsgMmsRelease(&mms_data);
/* Check contents-location is in noti.ind */
if (mmsHeader.szContentLocation[0] == '\0') {
status.msgStatus = mmsHeader.msgStatus;
status.handledTime = mmsHeader.date;
status.bDeliveryReportIsRead = false;
- status.bDeliveyrReportIsLast= true;
+ status.bDeliveyrReportIsLast = true;
MmsAddrUtilRemovePlmnString(mmsHeader.pTo->szAddr);
- MSG_SEC_DEBUG("[INFO] [ADDR: %s, MMSID: %s]",mmsHeader.pTo->szAddr, mmsHeader.szMsgID);
+ MSG_SEC_DEBUG("[INFO] [ADDR: %s, MMSID: %s]", mmsHeader.pTo->szAddr, mmsHeader.szMsgID);
pMsgInfo->msgType.mainType = MSG_MMS_TYPE;
pMsgInfo->msgType.subType = MSG_DELIVERYIND_MMS;
strncpy(pMsgInfo->msgText, responseText, MMS_LOCALE_RESP_TEXT_LEN);
}
- MSG_ADDRESS_INFO_S addressinfo = {0,};
+ MSG_ADDRESS_INFO_S addressinfo = {0, };
char keyName[MAX_VCONFKEY_NAME_LEN];
memset(keyName, 0x00, sizeof(keyName));
MSG_DEBUG("Error value of updateMmsAttrib [%d]", err);
- { /* make MmsData & insert multipart */
+ /* make MmsData & insert multipart */
+ MMSList *multipart_list = NULL;
+ MMS_MULTIPART_DATA_S *pSmilMultipart = NULL;
+
MmsMsg *pMmsMsg = NULL;
MmsPluginStorage::instance()->getMmsMessage(&pMmsMsg);
+ bool bFiltered;
+ MmsPluginAppBase *appBase;
+
MMS_DATA_S *pMmsData = MsgMmsCreate();
if (pMmsData == NULL) {
MSG_SEC_DEBUG("Fail to create mms");
goto __CATCH;
} */
- bool bFiltered = checkFilterMmsBody(pMmsData);
+ bFiltered = checkFilterMmsBody(pMmsData);
if (bFiltered == true) {
pMsgInfo->folderId = MSG_SPAMBOX_ID;
}
- MMS_MULTIPART_DATA_S *pSmilMultipart = pMmsData->smil;
+ pSmilMultipart = pMmsData->smil;
if (pSmilMultipart) {
MmsPluginStorage::instance()->insertMultipart(pMsgInfo->msgId, pSmilMultipart);
}
- MMSList *multipart_list = pMmsData->multipartlist;
+ multipart_list = pMmsData->multipartlist;
for (int i = 0; i < (int)g_list_length(multipart_list); i++) {
MMS_MULTIPART_DATA_S *pMultipart = (MMS_MULTIPART_DATA_S *)g_list_nth_data(multipart_list, i);
MmsPluginStorage::instance()->insertMultipart(pMsgInfo->msgId, pMultipart);
}
- { /* make Preview info for APP */
- MmsPluginAppBase *appBase;
- appBase = new MmsPluginAppBase(pMmsData);
- appBase->makePreviewInfo(pMsgInfo->msgId, false, pRetrievedFilePath);
- appBase->getFirstPageTextFilePath(pMsgInfo->msgText, sizeof(pMsgInfo->msgText));
- delete appBase;
- }
+ /* make Preview info for APP */
+ appBase = new MmsPluginAppBase(pMmsData);
+ appBase->makePreviewInfo(pMsgInfo->msgId, false, pRetrievedFilePath);
+ appBase->getFirstPageTextFilePath(pMsgInfo->msgText, sizeof(pMsgInfo->msgText));
+ delete appBase;
MsgMmsRelease(&pMmsData);
MSG_SEC_DEBUG("Fail to get mms file size [%s]", pRetrievedFilePath);
goto __CATCH;
}
- } /* make MmsData & insert multipart */
-__CATCH:
- {
+__CATCH: {
MmsMsg *pMsg = NULL;
pStorage->getMmsMessage(&pMsg);
MmsInitHeader();
pMsgInfo->dataSize = pRequest->getDataLen;
+ MmsMsg *pMmsMsg = NULL;
+ MmsPluginStorage::instance()->getMmsMessage(&pMmsMsg);
- {
- MmsMsg *pMmsMsg = NULL;
- MmsPluginStorage::instance()->getMmsMessage(&pMmsMsg);
-
- MMS_DATA_S *pMmsData = MsgMmsCreate();
- pMmsData->header = MsgMmsCreateHeader();
+ MMS_DATA_S *pMmsData = MsgMmsCreate();
+ pMmsData->header = MsgMmsCreateHeader();
- if (MmsConvertMmsData(pMmsMsg, pMmsData) != true) {
- MSG_DEBUG("Fail to Compose MMS Message");
- goto __CATCH;
- }
+ if (MmsConvertMmsData(pMmsMsg, pMmsData) != true) {
+ MSG_DEBUG("Fail to Compose MMS Message");
+ goto __CATCH;
+ }
- char *pSerializedData = NULL;
+ char *pSerializedData = NULL;
- MsgSerializeMms(pMmsData, &pSerializedData);
+ MsgSerializeMms(pMmsData, &pSerializedData);
- MsgMmsRelease(&pMmsData);
+ MsgMmsRelease(&pMmsData);
- char fileName[MSG_FILENAME_LEN_MAX] = {0};
- char fileFilePath[MSG_FILEPATH_LEN_MAX] = {0};
+ char fileName[MSG_FILENAME_LEN_MAX] = {0};
+ char fileFilePath[MSG_FILEPATH_LEN_MAX] = {0};
- if (MsgCreateFileName(fileName) == false)
- goto __CATCH;
+ if (MsgCreateFileName(fileName) == false)
+ goto __CATCH;
- snprintf(fileFilePath, sizeof(fileFilePath), "%s%s", MSG_DATA_PATH, fileName);
+ snprintf(fileFilePath, sizeof(fileFilePath), "%s%s", MSG_DATA_PATH, fileName);
- if (!MsgOpenCreateAndOverwriteFile(fileFilePath, (char *)pSerializedData, (int)strlen(pSerializedData))) {
- goto __CATCH;
- }
+ if (!MsgOpenCreateAndOverwriteFile(fileFilePath, (char *)pSerializedData, (int)strlen(pSerializedData))) {
+ goto __CATCH;
+ }
- snprintf(pMsgInfo->msgData, sizeof(pMsgInfo->msgData), "%s", fileFilePath);
+ snprintf(pMsgInfo->msgData, sizeof(pMsgInfo->msgData), "%s", fileFilePath);
- if (MsgGetFileSize(pRetrievedFilePath, (int *)&pMsgInfo->dataSize) == false) {
- MSG_SEC_DEBUG("Fail to get mms file size [%s]", pRetrievedFilePath);
- goto __CATCH;
- }
+ if (MsgGetFileSize(pRetrievedFilePath, (int *)&pMsgInfo->dataSize) == false) {
+ MSG_SEC_DEBUG("Fail to get mms file size [%s]", pRetrievedFilePath);
+ goto __CATCH;
}
-__CATCH:
- {
+__CATCH: {
MmsMsg *pMsg = NULL;
MmsPluginStorage::instance()->getMmsMessage(&pMsg);
MmsInitHeader();
#endif
void MmsPluginInternal::processForwardConf(MSG_MESSAGE_INFO_S *msgInfo, mmsTranQEntity *pRequest)
{
-
}
/* This function Send NotifyRespInd Msg
pFile = MsgOpenMMSFile(pTempFilePath);
if (!pFile) {
- MSG_ERR("MsgOpenMMSFile fail \n" );
+ MSG_ERR("MsgOpenMMSFile fail \n");
return false;
}
if (MmsEncodeAckInd(pFile, szTrID, bReportAllowed) == false) {
- MSG_ERR("MmsEncodeAckInd: MmsEncodeAckInd fail \n" );
+ MSG_ERR("MmsEncodeAckInd: MmsEncodeAckInd fail \n");
MsgCloseFile(pFile);
return false;
}
/* Not Rejected */
MSG_END();
return false;
-
}
pMedia = _MsgMmsGetMedia(pPage, j);
if (pMedia && pMedia->mediatype == MMS_SMIL_MEDIA_TEXT) {
-
MsgGetMimeTypeFromFileName(MIME_MAINTYPE_UNKNOWN, pMedia->szFilePath, &mimeType, NULL);
if (mimeType == MIME_TEXT_X_VCALENDAR || mimeType == MIME_TEXT_X_VCARD || mimeType == MIME_TEXT_X_VTODO || mimeType == MIME_TEXT_X_VNOTE) {
pPluginHandle->pfRestoreMsg = MmsRestoreMsg;
MSG_DEBUG("MMS plugin: create handler OK");
- MSG_DEBUG ("MMS plugin %p", pPluginHandle);
+ MSG_DEBUG("MMS plugin %p", pPluginHandle);
}
return MSG_SUCCESS;
char szTrID[MMS_TR_ID_LEN + 1] = {0x00};
bool bReportAllowed;
- err = MmsPluginStorage::instance()->getTrID(pMsgInfo,szTrID,sizeof(szTrID));
+ err = MmsPluginStorage::instance()->getTrID(pMsgInfo, szTrID, sizeof(szTrID));
if (err != MSG_SUCCESS)
MSG_DEBUG("MmsPlgUpdRejectStatus : Get MMS Transacation id Failed");
MsgCloseFile(pFile);
}
} else {
- MSG_DEBUG(":::%d :%s ",rcvdBodyLen, pRcvBody);
+ MSG_DEBUG(":::%d :%s ", rcvdBodyLen, pRcvBody);
if (filePath) {
snprintf(filePath, MAX_FULL_PATH_SIZE, "%sBODY_%lu.DATA", MSG_DATA_PATH, random() % 1000000000 + 1);
}
/* create temp file */
- if (!MsgOpenCreateAndOverwriteFile(filePath, (char*)pRcvBody,rcvdBodyLen))
+ if (!MsgOpenCreateAndOverwriteFile(filePath, (char*)pRcvBody, rcvdBodyLen))
return MSG_ERR_PLUGIN_STORAGE;
}
/* Calculate allocated buffer size */
for (int i = 0; i < nAddressCnt; ++i) {
-
MSG_SEC_DEBUG("recipientType: %d, address value: %s", pMsgInfo->addressList[i].recipientType, pMsgInfo->addressList[i].addressVal);
if (pMsgInfo->addressList[i].recipientType == MSG_RECIPIENTS_TYPE_UNKNOWN)
memset(pMultipart->type.szContentLocation, 0, MSG_MSG_ID_LEN + 1);
gchar *tmpContentLocation = msg_replace_non_ascii_char(szContentLocation, '_');
- if (tmpContentLocation ) {
+ if (tmpContentLocation) {
MSG_SEC_DEBUG("tmpContentLocation = [%s]", tmpContentLocation);
snprintf(pMultipart->type.szContentLocation, MSG_MSG_ID_LEN + 1, "%s", tmpContentLocation);
g_free(tmpContentLocation);
}
if (MmsIsTextType(mimeType) == true) {
- if (!MmsIsVitemContent (mimeType, pMultipart->type.param.szName)) {
+ if (!MmsIsVitemContent(mimeType, pMultipart->type.param.szName)) {
pMultipart->type.param.charset = MSG_CHARSET_UTF8;
}
pMultipart->type.encoding = MSG_ENCODING_8BIT;
pMmsMsg->szForwardMsgID[0] = '\0';
if (mmsHeader.pFrom) {
- MmsAddrUtilRemovePlmnString(mmsHeader.pFrom->szAddr );
+ MmsAddrUtilRemovePlmnString(mmsHeader.pFrom->szAddr);
strncpy(pMmsMsg->mmsAttrib.szFrom, mmsHeader.pFrom->szAddr, MSG_LOCALE_ADDR_LEN + 9);
}
if (pMmsMsg->pageCnt > 0) {
for (int i = 0; i < pMmsMsg->pageCnt; i++) {
-
pPage = _MsgMmsGetPage(pMmsMsg, i);
if (pPage == NULL)
continue;
for (int j = 0; j < pPage->mediaCnt; j++) {
-
pMedia = _MsgMmsGetMedia(pPage, j);
if (pMedia == NULL)
continue;
bool IsMatchedMedia(MMS_MEDIA_S *media, MMS_MULTIPART_DATA_S *pMultipart)
{
if (strlen(pMultipart->szContentID) > 0) {
-
- char szTempContentID[MSG_MSG_ID_LEN + 1] = {0,};
+ char szTempContentID[MSG_MSG_ID_LEN + 1] = {0, };
MmsRemoveLessGreaterChar(pMultipart->szContentID, szTempContentID, sizeof(szTempContentID));
if (strcmp(media->szContentID, szTempContentID) == 0) {
MsgMultipart *pPart = NULL;
if (MsgIsMultipart(pMsg->msgType.type) == true) {
-
pPart = pMsg->msgBody.body.pMultipart;
while (pPart && index--) {
if (pMsgData->pagelist) {
for (int pageIdx = 0; pageIdx < pMsgData->pageCnt; pageIdx++) {
-
MMS_PAGE_S *page = (MMS_PAGE_S *)g_list_nth_data(pMsgData->pagelist, pageIdx);
if (page && page->medialist) {
-
for (int mediaIdx = 0; mediaIdx < page->mediaCnt; mediaIdx++) {
-
MMS_MEDIA_S *media = (MMS_MEDIA_S *)g_list_nth_data(page->medialist, mediaIdx);
if (media) { /* add media */
__CATCH:
return false;
-
}
bool MmsConvertMsgData(MmsMsg *pMsg, MMS_MESSAGE_DATA_S *pMmsMsg)
int partCnt = pMsg->nPartCount;
if (partCnt <= 0) {
- MSG_DEBUG("partCnt=%d\n", partCnt );
+ MSG_DEBUG("partCnt=%d\n", partCnt);
} else {
-
if (MmsGetMediaPartHeader(0, &partHeader) == false) {
- MSG_DEBUG("Failed to get MediaPart MmsGetMediaPartHeader" );
+ MSG_DEBUG("Failed to get MediaPart MmsGetMediaPartHeader");
goto FREE_CATCH;
}
if (partHeader.contentSize > 0) {
- char szBuf[MSG_FILEPATH_LEN_MAX + 1] = {0,};
+ char szBuf[MSG_FILEPATH_LEN_MAX + 1] = {0, };
MMS_PAGE_S *page = NULL;
MMS_MEDIA_S *media = NULL;
_MsgMmsAddPage(pMmsMsg, page);
}
-
}
} else {
-
int partCnt = pMsg->nPartCount;
for (int i = 0; i < partCnt; ++i) {
-
MsgMultipart *multipart = MmsGetNthMultipart(pMsg, i);
MMS_MULTIPART_DATA_S pMultipart;
snprintf(pMultipart.szContentLocation, sizeof(pMultipart.szContentLocation), "%s", multipart->type.szContentLocation);
snprintf(pMultipart.szFileName, sizeof(pMultipart.szFileName), "%s", multipart->type.param.szName);
snprintf(pMultipart.szFilePath, sizeof(pMultipart.szFilePath), "%s", multipart->pBody->szOrgFilePath);
- snprintf(pMultipart.szContentType, sizeof(pMultipart.szContentType), "%s",MimeGetMimeStringFromMimeInt(multipart->type.type));
+ snprintf(pMultipart.szContentType, sizeof(pMultipart.szContentType), "%s", MimeGetMimeStringFromMimeInt(multipart->type.type));
if (multipart->type.drmInfo.drmType != MSG_DRM_TYPE_NONE) {
pMultipart.drmType = multipart->type.drmInfo.drmType;
}
PRINT_KEY_VAL_STR("mms ver", pMmsMsg->mmsAttrib.version);
-
}
int MmsUpdateMultipartList(MSG_MESSAGE_INFO_S *pMsgInfo)
MmsPluginStorage::instance()->getMmsRawFilePath(pMsgInfo->msgId, szFullPath, sizeof(szFullPath));
MmsPluginDecoder::instance()->decodeMmsPdu(mmsMsg, pMsgInfo->msgId, szFullPath);
- { /* make Preview info for APP */
- MmsPluginAppBase appBase(mmsMsg);
- appBase.makePreviewInfo(pMsgInfo->msgId, true, szFullPath);
- appBase.getFirstPageTextFilePath(pMsgInfo->msgText, sizeof(pMsgInfo->msgText));
- }
+ /* make Preview info for APP */
+ MmsPluginAppBase appBase(mmsMsg);
+ appBase.makePreviewInfo(pMsgInfo->msgId, true, szFullPath);
+ appBase.getFirstPageTextFilePath(pMsgInfo->msgText, sizeof(pMsgInfo->msgText));
+
MmsReleaseMmsMsg(mmsMsg);
MSG_END();
return 0;
MMS_HEADER_DATA_S *pHeaderData = pMmsData->header;
if (pHeaderData) {
-
snprintf(pHeaderData->messageID, sizeof(pHeaderData->messageID), "%s", pMmsMsg->szMsgID);
snprintf(pHeaderData->trID, sizeof(pHeaderData->trID), "%s", pMmsMsg->szTrID);
snprintf(pHeaderData->contentLocation, sizeof(pHeaderData->contentLocation), "%s", pMmsMsg->szContentLocation);
}
if (pMmsMsg->mmsAttrib.contentType == MIME_MULTIPART_RELATED || pMmsMsg->mmsAttrib.contentType == MIME_APPLICATION_VND_WAP_MULTIPART_RELATED) {
-
MMS_MULTIPART_DATA_S *pMultipart = MsgMmsCreateMultipart();
if (pMultipart) {
pMultipart->type = MIME_APPLICATION_SMIL;
int partCnt = pMmsMsg->nPartCount;
for (int i = 0; i < partCnt; ++i) {
-
MsgMultipart *multipart = MmsGetNthMultipart(pMmsMsg, i);
if (multipart) {
-
MMS_MULTIPART_DATA_S *pMultipart = MsgMmsCreateMultipart();
if (pMultipart) {
pMultipart->type = (MimeType)multipart->type.type;
- snprintf(pMultipart->szContentType, sizeof(pMultipart->szContentType), "%s",MimeGetMimeStringFromMimeInt(multipart->type.type));
+ snprintf(pMultipart->szContentType, sizeof(pMultipart->szContentType), "%s", MimeGetMimeStringFromMimeInt(multipart->type.type));
snprintf(pMultipart->szContentID, sizeof(pMultipart->szContentID), "%s", multipart->type.szContentID);
snprintf(pMultipart->szContentLocation, sizeof(pMultipart->szContentLocation), "%s", multipart->type.szContentLocation);
snprintf(pMultipart->szFileName, sizeof(pMultipart->szFileName), "%s", multipart->type.param.szName);
MMS_HEADER_DATA_S *pHeaderData = pMmsData->header;
if (pHeaderData) {
-
if (strlen(pHeaderData->contentLocation) > 0) {
snprintf(pMmsMsg->szContentLocation, sizeof(pMmsMsg->szContentLocation), "%s", pHeaderData->contentLocation);
}
printMmsAttribute(&pMmsMsg->mmsAttrib);
if (pMmsData->multipartlist) {
-
if (pMmsData->smil) {
-
MMS_MULTIPART_DATA_S *smil_multipart = pMmsData->smil;
if (smil_multipart) {
-
pMmsMsg->mmsAttrib.contentType = MIME_APPLICATION_VND_WAP_MULTIPART_RELATED;
pMmsMsg->msgType.type = MIME_APPLICATION_VND_WAP_MULTIPART_RELATED;
int len = g_list_length(pMmsData->multipartlist);
for (int i = 0; i < len; i++) {
-
MMS_MULTIPART_DATA_S *multipart = (MMS_MULTIPART_DATA_S *)g_list_nth_data(pMmsData->multipartlist, i);
if (multipart) {
/* Calculate allocated buffer size */
for (int i = 0; i < nAddressCnt; ++i) {
-
MMS_ADDRESS_DATA_S * pAddressData = (MMS_ADDRESS_DATA_S *)g_list_nth_data(pAddressList, i);
if (pAddressData) {
MSG_SEC_DEBUG("address type : %d, address value: %s", pAddressData->address_type, pAddressData->address_val);
MSG_END();
return szCompose;
-
}
MMSList * MmsConvertAddressToNewStyle(const char *szAddr)
MMS_ADDRESS_DATA_S *pAddressData = NULL;
char *pTempChar = NULL;
- char *pStartPtr= NULL;
- char *pEndPtr= NULL;
+ char *pStartPtr = NULL;
+ char *pEndPtr = NULL;
if (szAddr == NULL)
return NULL;
pStartPtr = pTempChar;
while (pStartPtr && pStartPtr[0]) {
-
int addLen = 0;
- char tempAddress[512] = {0,};
- char tempAddress2[512] = {0,};
+ char tempAddress[512] = {0, };
+ char tempAddress2[512] = {0, };
pEndPtr = strchr(pStartPtr, MSG_CH_SEMICOLON);
snprintf(pDestMultipart->szContentType, sizeof(pDestMultipart->szContentType), "%s", pSrcMedia->szContentType);
pDestMultipart->type = MimeGetMimeIntFromMimeString(pSrcMedia->szContentType);
} else {
-
MimeMainType mainType = MIME_MAINTYPE_UNKNOWN;
MimeType pMimeType = MIME_UNKNOWN;
const char *pszMimeType = NULL;
}
while (g_list_find_custom(r_list, str2, __compare_str) != NULL) {
-
g_free(str2);
if (ext)
}
while (g_list_find_custom(r_list, str2, __compare_str) != NULL) {
-
g_free(str2);
if (ext)
g_free(str2);
}
}
-
} /* end for attach */
g_list_free(r_list);
return eRet;
}
- eRet = _MsgMMSAddDefaultSecondSMILRegion(pMsgData,!bTextReg);
+ eRet = _MsgMMSAddDefaultSecondSMILRegion(pMsgData, !bTextReg);
if (eRet != MSG_SMIL_SUCCESS) {
MSG_DEBUG("_MsgMMSValidateSMILRegion: Invalid Region Information\n");
return eRet;
else
snprintf(pRegion->szID, MAX_SMIL_REGION_ID, "%s", MSG_SMIL_DEFAULT_IMG_REG);
- if (_MsgMmsAddRegion(pMsgData,pRegion) != MSG_SUCCESS) {
+ if (_MsgMmsAddRegion(pMsgData, pRegion) != MSG_SUCCESS) {
MSG_DEBUG("_MsgMMSValidateSMILRegion: Add Region failed\n");
free(pRegion);
else
snprintf(pRegion->szID, MAX_SMIL_REGION_ID, "%s", MSG_SMIL_DEFAULT_IMG_REG);
- if (_MsgMmsAddRegion(pMsgData,pRegion) != MSG_SUCCESS) {
+ if (_MsgMmsAddRegion(pMsgData, pRegion) != MSG_SUCCESS) {
MSG_DEBUG("_MsgMMSValidateSMILRegion: Add Region failed\n");
free(pRegion);
snprintf(pRegion->szID, MAX_SMIL_REGION_ID, "%s", MSG_SMIL_DEFAULT_FULL_REG);
- if (_MsgMmsAddRegion(pMsgData,pRegion) != MSG_SUCCESS) {
+ if (_MsgMmsAddRegion(pMsgData, pRegion) != MSG_SUCCESS) {
MSG_DEBUG("_MsgMMSValidateSMILRegion: Add Region failed\n");
free(pRegion);
if (bResetRegion) {
if (PageRegionCnt > 1) {
if (pMedia->mediatype == MMS_SMIL_MEDIA_AUDIO) {
- memset(pMedia->regionId,0x00, MAX_SMIL_REGION_ID);
+ memset(pMedia->regionId, 0x00, MAX_SMIL_REGION_ID);
continue;
}
MmsPluginStorage::~MmsPluginStorage()
{
-
}
char *pSerializedMms = NULL;
gsize pSerializedMmsSize = 0;
- char working_dir[MSG_FILENAME_LEN_MAX+1] = {0,};
+ char working_dir[MSG_FILENAME_LEN_MAX+1] = {0, };
MMS_DATA_S *pMmsData = NULL;
/* pMsgInfo->msgData is Filepath of json */
MmsPluginStorage::instance()->insertMultipart(pMsgInfo->msgId, pMultipart);
}
- { /* make Preview info for APP */
- MmsPluginAppBase appBase(pMmsData);
- appBase.makePreviewInfo(pMsgInfo->msgId, true, NULL);
- appBase.getFirstPageTextFilePath(pMsgInfo->msgText, sizeof(pMsgInfo->msgText));
- }
+ /* make Preview info for APP */
+ MmsPluginAppBase appBase(pMmsData);
+ appBase.makePreviewInfo(pMsgInfo->msgId, true, NULL);
+ appBase.getFirstPageTextFilePath(pMsgInfo->msgText, sizeof(pMsgInfo->msgText));
MsgMmsRelease(&pMmsData);
MSG_END();
}
/* reject_msg_support */
-msg_error_t MmsPluginStorage::getTrID(MSG_MESSAGE_INFO_S *pMsgInfo,char *pszTrID,int nBufferLen)
+msg_error_t MmsPluginStorage::getTrID(MSG_MESSAGE_INFO_S *pMsgInfo, char *pszTrID, int nBufferLen)
{
MsgDbHandler *dbHandle = getDbHandle();
pPage = _MsgMmsGetPage(pMmsMsg, 0);
if (pPage) {
-
for (int j = 0; j < pPage->mediaCnt; ++j) {
-
pMedia = _MsgMmsGetMedia(pPage, j);
if (pMedia && pMedia->mediatype == MMS_SMIL_MEDIA_TEXT) {
-
MimeType mimeType = MIME_UNKNOWN;
MsgGetMimeTypeFromFileName(MIME_MAINTYPE_UNKNOWN, pMedia->szFilePath, &mimeType, NULL);
char sqlQuery[MAX_QUERY_LEN + 1];
memset(sqlQuery, 0x00, sizeof(sqlQuery));
- //(MSG_ID INTEGER, TYPE INTEGER, INFO TEXT)
+ /* (MSG_ID INTEGER, TYPE INTEGER, INFO TEXT) */
snprintf(sqlQuery, sizeof(sqlQuery),
"INSERT INTO %s "
"(MSG_ID, TYPE, VALUE, COUNT)"
MsgDbHandler *dbHandle = getDbHandle();
char sqlQuery[MAX_QUERY_LEN + 1];
- char filePath[MSG_FILEPATH_LEN_MAX + 1] = {0,};
+ char filePath[MSG_FILEPATH_LEN_MAX + 1] = {0, };
/* remove thumbnail file */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
}
while (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
-
memset(filePath, 0x00, sizeof(filePath));
strncpy(filePath, (char *)dbHandle->columnText(0), MSG_FILEPATH_LEN_MAX);
if (remove(filePath) == -1)
MsgDbHandler *dbHandle = getDbHandle();
char sqlQuery[MAX_QUERY_LEN + 1];
- char filePath[MSG_FILEPATH_LEN_MAX + 1] = {0,};
- char dirPath[MSG_FILEPATH_LEN_MAX + 1]= {0,};
+ char filePath[MSG_FILEPATH_LEN_MAX + 1] = {0, };
+ char dirPath[MSG_FILEPATH_LEN_MAX + 1]= {0, };
/* remove DB Preview */
removePreviewInfo(msgId);
/* CID 41991: pMultipart->szFilePath is an array, hence checking for null is not required */
if (strlen(pMultipart->szFilePath) > 0 && MsgAccessFile(pMultipart->szFilePath, F_OK) == true) {
int bc_level = -1;
- int tcs_ret = 0; // MsgTcsScanFile(pMultipart->szFilePath, &bc_level);
+ int tcs_ret = 0; /* MsgTcsScanFile(pMultipart->szFilePath, &bc_level); */
if (tcs_ret == 0) {
if (bc_level > -1) {
MSG_DEBUG("This content is malware, level = %d", bc_level);
}
if (pMultipart->tcs_bc_level < 0 || pMultipart->malware_allow) {
-
if (g_str_has_prefix(pMultipart->szContentType, "video") || g_str_has_prefix(pMultipart->szContentType, "image")) {
char thumbPath[MSG_FILEPATH_LEN_MAX+1] = {0, };
pMultipart->malware_allow = allow_malware;
if (pMultipart->tcs_bc_level >= 0 || pMultipart->malware_allow) {
-
if (!strcasecmp(pMultipart->szContentType, "video") || !strcasecmp(pMultipart->szContentType, "image")) {
char thumbPath[MSG_FILEPATH_LEN_MAX+1] = {0, };
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS)
return MSG_ERR_DB_EXEC;
-
}
-
MSG_END();
return MSG_SUCCESS;
}
}
while (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
-
filePath = (const char *)dbHandle->columnText(0);
if (filePath) {
if (remove(filePath) == -1)
else
MSG_SEC_DEBUG("Success to delete file [%s]", filePath);
}
-
}
dbHandle->finalizeQuery();
}
while (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
-
filePath = (const char *)dbHandle->columnText(0);
if (filePath) {
if (remove(filePath) == -1)
else
MSG_SEC_DEBUG("Success to delete file [%s]", filePath);
}
-
}
dbHandle->finalizeQuery();
msg_error_t err = dbHandle->getTable(sqlQuery, &rowCnt, &index);
if (err == MSG_SUCCESS) {
-
for (int i = 0; i < rowCnt; i++) {
-
MMS_MULTIPART_DATA_S *multipart = MsgMmsCreateMultipart();
dbHandle->getColumnToString(index++, sizeof(multipart->szContentType), multipart->szContentType);
, raw_filepath, pHeader->mmsVersion, MMS_DATATYPE_NONE, pHeader->date, pHeader->bHideAddress
, pHeader->bDeliveryReport, 0 /*pMmsMsg->mmsAttrib.bReportAllowed*/, 0 /*pMmsMsg->mmsAttrib.readReportAllowedType*/
, pHeader->bReadReport, 0 /*pMmsMsg->mmsAttrib.bRead*/, 0 /*pMmsMsg->mmsAttrib.readReportSendStatus*/, 0 /*pMmsMsg->mmsAttrib.bReadReportSent*/
- , pHeader->mmsPriority, true /*pMmsMsg->mmsAttrib.bLeaveCopy*/,pHeader->messageSize, pHeader->messageClass
+ , pHeader->mmsPriority, true /*pMmsMsg->mmsAttrib.bLeaveCopy*/, pHeader->messageSize, pHeader->messageClass
, pHeader->expiry.time, 0, pHeader->delivery.time, pHeader->mmsStatus);
msg_error_t db_err = dbHandle->execQuery(sqlQuery);
MSG_DEBUG("insert multipart to db");
for (int i = 0; i < (int)g_list_length(multipart_list); i++) {
-
MMS_MULTIPART_DATA_S *pMultipart = (MMS_MULTIPART_DATA_S *)g_list_nth_data(multipart_list, i);
if (pMultipart) {
MMSList *pMultipartList = NULL;
if (this->getMultipartList(msgId, &pMultipartList) == MSG_SUCCESS) {
-
if (pMultipartList) {
-
MMS_MULTIPART_DATA_S *smil_multipart = NULL;
char *content_type = NULL;
}
if (pMsgInfo->msgType.subType == MSG_SENDREQ_MMS || pMsgInfo->msgType.subType == MSG_SENDCONF_MMS) {
- char raw_filepath[MSG_FILENAME_LEN_MAX+1] = {0,};
- char working_dir[MSG_FILENAME_LEN_MAX+1] = {0,};
+ char raw_filepath[MSG_FILENAME_LEN_MAX+1] = {0, };
+ char working_dir[MSG_FILENAME_LEN_MAX+1] = {0, };
/* compose */
MmsPluginComposer::instance()->composeSendReq(pMsgInfo, pSendOptInfo, pMmsData);
goto __CATCH;
}
- { /* make Preview info for APP */
- MmsPluginAppBase appBase(pMmsData);
- appBase.makePreviewInfo(pMsgInfo->msgId, true, raw_filepath);
- appBase.getFirstPageTextFilePath(pMsgInfo->msgText, sizeof(pMsgInfo->msgText));
- }
+ /* make Preview info for APP */
+ MmsPluginAppBase appBase(pMmsData);
+ appBase.makePreviewInfo(pMsgInfo->msgId, true, raw_filepath);
+ appBase.getFirstPageTextFilePath(pMsgInfo->msgText, sizeof(pMsgInfo->msgText));
} else if (pMsgInfo->msgType.subType == MSG_RETRIEVE_MMS
|| pMsgInfo->msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS
|| pMsgInfo->msgType.subType ==MSG_RETRIEVE_MANUALCONF_MMS) {
-
- char raw_filepath[MSG_FILENAME_LEN_MAX+1] = {0,};
- char working_dir[MSG_FILENAME_LEN_MAX+1] = {0,};
+ char raw_filepath[MSG_FILENAME_LEN_MAX+1] = {0, };
+ char working_dir[MSG_FILENAME_LEN_MAX+1] = {0, };
/* compose */
MmsPluginComposer::instance()->composeRetrieveConf(pMsgInfo, pSendOptInfo, pMmsData);
goto __CATCH;
}
- { /* make Preview info for APP */
- MmsPluginAppBase *appBase;
- appBase = new MmsPluginAppBase(pMmsData);
- appBase->makePreviewInfo(pMsgInfo->msgId, true, raw_filepath);
- appBase->getFirstPageTextFilePath(pMsgInfo->msgText, sizeof(pMsgInfo->msgText));
- delete appBase;
- }
+ MmsPluginAppBase *appBase;
+ appBase = new MmsPluginAppBase(pMmsData);
+ appBase->makePreviewInfo(pMsgInfo->msgId, true, raw_filepath);
+ appBase->getFirstPageTextFilePath(pMsgInfo->msgText, sizeof(pMsgInfo->msgText));
+ delete appBase;
} else if (pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
-
if (pMmsData->header == NULL || pMmsData->header->messageType != MMS_MSGTYPE_NOTIFICATION_IND) {
goto __CATCH;
}
MSG_DEBUG("msg sub type = [%d]", pMsgInfo->msgType.subType);
if (pMsgInfo->msgType.subType == MSG_SENDREQ_MMS) {
- char raw_filepath[MSG_FILENAME_LEN_MAX+1] = {0,};
- char working_dir[MSG_FILENAME_LEN_MAX+1] = {0,};
+ char raw_filepath[MSG_FILENAME_LEN_MAX+1] = {0, };
+ char working_dir[MSG_FILENAME_LEN_MAX+1] = {0, };
/* compose */
MmsPluginComposer::instance()->composeSendReq(pMsgInfo, pSendOptInfo, pMmsData);
/* add to db */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
- snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET ASK_DELIVERY_REPORT = %d, KEEP_COPY = %d, ASK_READ_REPLY = %d, EXPIRY_TIME = %d, CUSTOM_DELIVERY_TIME = %d, DELIVERY_TIME= %d, PRIORITY = %d \
+ snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET ASK_DELIVERY_REPORT = %d, KEEP_COPY = %d, ASK_READ_REPLY = %d, EXPIRY_TIME = %d, CUSTOM_DELIVERY_TIME = %d, DELIVERY_TIME = %d, PRIORITY = %d \
WHERE MSG_ID = %d;", MMS_PLUGIN_MESSAGE_TABLE_NAME, pSendOptInfo->bDeliverReq, pSendOptInfo->bKeepCopy, pSendOptInfo->option.mmsSendOptInfo.bReadReq,
pSendOptInfo->option.mmsSendOptInfo.expiryTime.time, pSendOptInfo->option.mmsSendOptInfo.bUseDeliveryCustomTime, pSendOptInfo->option.mmsSendOptInfo.deliveryTime.time,
pSendOptInfo->option.mmsSendOptInfo.priority, pMsgInfo->msgId);
MsgMmsSetMultipartListFilePath(working_dir, pMmsData); /* data -> svc file */
- { /* add multipart list */
- if (pMmsData->smil) {
- pMmsData->smil->type = MIME_APPLICATION_SMIL;
- insertMultipart(pMsgInfo->msgId, pMmsData->smil);
- }
-
- MMSList *multipart_list = pMmsData->multipartlist;
+ /* add multipart list */
+ if (pMmsData->smil) {
+ pMmsData->smil->type = MIME_APPLICATION_SMIL;
+ insertMultipart(pMsgInfo->msgId, pMmsData->smil);
+ }
- if (multipart_list) {
- for (int i = 0; i < (int)g_list_length(multipart_list); i++) {
+ MMSList *multipart_list = pMmsData->multipartlist;
- MMS_MULTIPART_DATA_S *pMultipart = (MMS_MULTIPART_DATA_S *)g_list_nth_data(multipart_list, i);
+ if (multipart_list) {
+ for (int i = 0; i < (int)g_list_length(multipart_list); i++) {
+ MMS_MULTIPART_DATA_S *pMultipart = (MMS_MULTIPART_DATA_S *)g_list_nth_data(multipart_list, i);
- if (pMultipart) {
- insertMultipart(pMsgInfo->msgId, pMultipart);
- }
+ if (pMultipart) {
+ insertMultipart(pMsgInfo->msgId, pMultipart);
}
}
}
goto __CATCH;
}
- { /* make Preview info for APP */
- MmsPluginAppBase *appBase;
- appBase = new MmsPluginAppBase(pMmsData);
- appBase->makePreviewInfo(pMsgInfo->msgId, true, raw_filepath);
- appBase->getFirstPageTextFilePath(pMsgInfo->msgText, sizeof(pMsgInfo->msgText));
- delete appBase;
- }
+ /* make Preview info for APP */
+ MmsPluginAppBase *appBase;
+ appBase = new MmsPluginAppBase(pMmsData);
+ appBase->makePreviewInfo(pMsgInfo->msgId, true, raw_filepath);
+ appBase->getFirstPageTextFilePath(pMsgInfo->msgText, sizeof(pMsgInfo->msgText));
+ delete appBase;
}
MsgMmsRelease(&pMmsData);
err = getMmsData(pMsg->msgId, pMmsData); /* get MmsData Info from DB */
if (err == MSG_SUCCESS) {
-
if (pSendOptInfo) {
pSendOptInfo->bDeliverReq = pHeader->bDeliveryReport;
pSendOptInfo->option.mmsSendOptInfo.bReadReq = pHeader->bReadReport;
MmsPluginStorage::instance()->getMmsRawFilePath(pMsgInfo->msgId, szFullPath, sizeof(szFullPath));
MmsPluginDecoder::instance()->decodeMmsPdu(mmsMsg, pMsgInfo->msgId, szFullPath);
- { /* make Preview info for APP */
- MmsPluginAppBase *appBase;
- appBase = new MmsPluginAppBase(mmsMsg);
- appBase->makePreviewInfo(pMsgInfo->msgId, true, szFullPath);
- appBase->getFirstPageTextFilePath(pMsgInfo->msgText, sizeof(pMsgInfo->msgText));
- delete appBase;
- }
+
+ /* make Preview info for APP */
+ MmsPluginAppBase *appBase;
+ appBase = new MmsPluginAppBase(mmsMsg);
+ appBase->makePreviewInfo(pMsgInfo->msgId, true, szFullPath);
+ appBase->getFirstPageTextFilePath(pMsgInfo->msgText, sizeof(pMsgInfo->msgText));
+ delete appBase;
+
MmsReleaseMmsMsg(mmsMsg);
MSG_END();
}
if (strcasecmp("utf-16", pFromCodeset) == 0) { /* check utf-8 str though utf-16 */
-
MSG_DEBUG("Codeset [%s] check utf-8 type", pFromCodeset);
if (((UINT8)pSrc[0] == 0xFF && (UINT8)pSrc[1] == 0xFE) || ((UINT8)pSrc[0] == 0xFE && (UINT8)pSrc[1] == 0xFF)) {
-
char *pTemp = (char *)calloc(1, srcLen + 1);
if (pTemp == NULL) {
MSG_DEBUG("fail to calloc");
free(pTemp);
pTemp = NULL;
}
-
}
}
- pDest = g_convert (pSrc, srcLen,
+ pDest = g_convert(pSrc, srcLen,
pToCodeSet, pFromCodeset,
&bytes_read, &bytes_written,
&error);
MmsPluginTransport::MmsPluginTransport()
{
-
}
MmsPluginTransport::~MmsPluginTransport()
{
-
}
MSG_MMS_VLD_INFO("%d, MMS Receive Auto Start %s->%s, Success", pReqInfo->msgInfo.msgId, pReqInfo->msgInfo.addressList[0].addressVal, (msisdn == NULL)?"ME":msisdn);
break;
- case MSG_NOTIFYRESPIND_MMS: /* reject */
- {
+ case MSG_NOTIFYRESPIND_MMS: {/* reject */
MSG_DEBUG("######### MANUAL RETRIEVE : SEND NOTIFY RESPONSE IND");
reqItem.msgId = pReqInfo->msgInfo.msgId;
reqItem.eMmsPduType = eMMS_NOTIFYRESP_IND;
void MmsPluginTransport::cancelRequest(msg_request_id_t reqId)
{
-
-
}
MmsPluginUaManager::~MmsPluginUaManager()
{
-
}
MmsPluginUaManager *MmsPluginUaManager::instance()
MutexLocker lock(mx);
if (!running) {
-
running = true;
MsgThread::start();
}
memset(&request_info, 0x00, sizeof(request_info));
if (qEntity->eHttpCmdType == eHTTP_CMD_POST_TRANSACTION) {
-
request_info.transaction_type = MMS_HTTP_TRANSACTION_TYPE_POST;
request_info.url = home_url;
MSG_DEBUG("\n\n =================== MMS Transaction Start ========================");
do {
-
MMS_NET_ERROR_T mms_net_status = submitHandler(&reqEntity);
reqEntity.eMmsTransactionStatus = mms_net_status;
if (mms_net_status != eMMS_SUCCESS) {
}
lock();
mmsTranQ.remove(reqEntity, compare_func_for_removal);
-/* mmsTranQ.pop_front(); */
+ /* mmsTranQ.pop_front(); */
unlock();
- //////// Waiting Conf //////////////////////
+ /* Waiting Conf */
MMS_NET_ERROR_T networkErr;
if ((networkErr = waitingConf(&reqEntity)) == eMMS_HTTP_CONF_SUCCESS) {
bool bReportAllowed;
- char retrievedFilePath[MAX_FULL_PATH_SIZE+1] = {0,};
+ char retrievedFilePath[MAX_FULL_PATH_SIZE+1] = {0, };
/* process Http data */
try {
- if (processReceivedData(reqEntity.msgId, reqEntity.pGetData, reqEntity.getDataLen, retrievedFilePath) == false) {
+ if (processReceivedData(reqEntity.msgId, reqEntity.pGetData, reqEntity.getDataLen, retrievedFilePath) == false) {
MmsPluginEventHandler::instance()->handleMmsError(&reqEntity);
break;
}
MSG_FATAL("%s", e.what());
MmsPluginEventHandler::instance()->handleMmsError(&reqEntity);
break;
-
} catch (exception& e) {
MSG_FATAL("%s", e.what());
MmsPluginEventHandler::instance()->handleMmsError(&reqEntity);
MmsPluginEventHandler::instance()->handleMmsError(&reqEntity);
break;
}
-
} while (reqEntity.isCompleted == false);
MSG_DEBUG("==== MMS Transaction Completed ====\n\n");
free(reqEntity.pGetData);
reqEntity.pGetData = NULL;
}
-
}
/* Request CM Close */
cmAgent->close();
-
}
MSG_END();
/* create temp file */
if (!MsgOpenCreateAndOverwriteFile(retrievedFilePath, (char *)pRcvdBody, rcvdBodyLen)) {
- MSG_ERR( "_MmsUaInitMsgDecoder: creating temporary file failed(msgID=%d)\n", msgId);
+ MSG_ERR("_MmsUaInitMsgDecoder: creating temporary file failed(msgID=%d)\n", msgId);
return false;
}
#if 1
srcptr = src;
while (*srcptr != '\0' && ((dstptr-dst) < dstsize)) {
-
if (*srcptr == '<') state = M_IN;
if (*srcptr == '>') state = M_OUT;
char *spaceCharPtr = strchr(pszText, ' ');
while (spaceCharPtr) {
-
*spaceCharPtr = '_';
spaceCharPtr = strchr(pszText, ' ');
ptr = (const unsigned char*)szSrc;
while (offset < srcLen && *(ptr) != '\0') {
-
b1 = *(ptr);
if ((b1 & 0x80) == 0) { /* 1byte : 0xxx xxxx */
}
} else if ((b1 & 0xF0) == 0xE0) { /* 3byte : 1110 xxxx */
-
offset += 3;
if (offset > srcLen)
}
} else if ((b1 & 0xF8) == 0xF0) { /* 4byte : 1111 xxxx */
-
offset += 4;
if (offset > srcLen)
ptr = (const unsigned char*)szSrc;
while (offset < srcLen && *(ptr) != '\0') {
-
b1 = *(ptr);
if ((b1 & 0x80) == 0) { /* 1byte : 0xxx xxxx */
}
} else if ((b1 & 0xF0) == 0xE0) { /* 3byte : 1110 xxxx */
-
offset += 3;
if (offset > srcLen)
}
} else if ((b1 & 0xF8) == 0xF0) { /* 4byte : 1111 xxxx */
-
offset += 4;
if (offset > srcLen)
char szRetrieveText[MMS_LOCALE_RESP_TEXT_LEN + 1];
MmsMsgMultiStatus *pMultiStatus;
-
} MmsAttrib;
typedef struct _MsgContentParam {
MmsPluginComposer();
~MmsPluginComposer();
-
};
#endif /* MMS_PLUGIN_COMPOSER_H */
char *dns_address_list;
Mutex mx;
CndVar cv;
-
};
#endif /* MMS_PLUGIN_CONNMAN_H */
MmsPluginDecoder();
~MmsPluginDecoder();
-
};
#endif /* MMS_PLUGIN_DECODE_H */
MmsPluginEncoder();
~MmsPluginEncoder();
-
};
#endif /* MMS_PLUGIN_ENCODE_H */
void getMmsPduData(mmsTranQEntity *qEntity);
bool processReceivedData(int msgId, char *pRcvdBody, int rcvdBodyLen, char *retrievedFilePath);
- void lock(){ mx.lock(); }
- void unlock(){ mx.unlock(); }
- void wait(){ cv.wait(mx.pMutex()); }
- void signal(){ cv.signal(); }
+ void lock() { mx.lock(); }
+ void unlock() { mx.unlock(); }
+ void wait() { cv.wait(mx.pMutex()); }
+ void signal() { cv.signal(); }
private:
MmsPluginUaManager();
SmsPluginCallback::SmsPluginCallback()
{
-
-
}
void SmsPluginCallback::deRegisterEvent()
{
-
}
MSG_FATAL("%s", e.what());
return;
}
-
}
if (sentStatus == SMS_NETWORK_SEND_FAIL) {
int svc_type;
tel_get_property_int(handle, TAPI_PROP_NETWORK_SERVICE_TYPE, &svc_type);
- if (svc_type < TAPI_NETWORK_SERVICE_TYPE_2G){
+ if (svc_type < TAPI_NETWORK_SERVICE_TYPE_2G) {
sentStatus = SMS_NETWORK_SEND_PENDING;
}
}
MSG_FATAL("%s", e.what());
return;
}
-
}
if ((TelSmsCause_t)result != TAPI_NETTEXT_SUCCESS) bRet = false;
SmsPluginSetting::instance()->setResultFromEvent(bRet);
-
}
SmsPluginMsgCodec::SmsPluginMsgCodec()
{
-
}
SmsPluginMsgCodec::~SmsPluginMsgCodec()
{
-
}
p_pkg_str[offset++] = SMS_TRANS_PARAM_SERVICE_CATEGORY;
p_pkg_str[offset++] = 0x02;
/* fixed */
- _copy_short_to_char(&p_pkg_str[offset],&(p_msg->svc_ctg));
+ _copy_short_to_char(&p_pkg_str[offset], &(p_msg->svc_ctg));
}
/* 3. Address */
/* 1. Service Category(Mandatory) */
p_pkg_str[offset++] = SMS_TRANS_PARAM_SERVICE_CATEGORY;
p_pkg_str[offset++] = 0x02;
- _copy_short_to_char(&p_pkg_str[offset],&p_msg->svc_ctg);
+ _copy_short_to_char(&p_pkg_str[offset], &p_msg->svc_ctg);
/* 2. Bearer Data(Optional) */
MSG_END();
return offset;
-
}
offset--;
p_pkg_str[len_index] = offset - len_index - 1;
-
}
/* 4. Language Indicator (Optional) */
offset--;
p_pkg_str[len_index] = offset - len_index - 1;
-
}
/* Sprint and Verizon issue */
/* 3. Validity Period */
if (p_del->enhanced_vmn.an_digit_mode) {
p_del->enhanced_vmn.an_number_plan = (sms_number_plan_t)(tmp_str[tmp_off++] & 0x0f);
p_del->enhanced_vmn.an_num_field = tmp_str[tmp_off++];
- for (int i=0; i<p_del->enhanced_vmn.an_num_field; i++) {
+ for (int i = 0; i < p_del->enhanced_vmn.an_num_field; i++) {
switch (tmp_str[tmp_off] & 0xf0) {
case 0x10:
case 0x20:
if (p_del->enhanced_vmn.cli_digit_mode) {
p_del->enhanced_vmn.cli_number_plan = (sms_number_plan_t)(tmp_str[tmp_off++] & 0x0f);
p_del->enhanced_vmn.cli_num_field = tmp_str[tmp_off++];
- for (int i=0; i<p_del->enhanced_vmn.cli_num_field; i++) {
+ for (int i = 0; i < p_del->enhanced_vmn.cli_num_field; i++) {
switch (tmp_str[tmp_off] & 0xf0) {
case 0x10:
case 0x20:
p_del->enhanced_vmn_ack.num_delete_ack = tmp_str[offset] >> 5;
p_del->enhanced_vmn_ack.num_play_ack = (tmp_str[offset] & 0x1c) >> 2;
_shiftNBit_for_decode(tmp_str, tmp_len, 6);
- for (int i=0; i<p_del->enhanced_vmn_ack.num_delete_ack; i++) {
+ for (int i = 0; i < p_del->enhanced_vmn_ack.num_delete_ack; i++) {
p_del->enhanced_vmn_ack.da_vm_msg_id[i] = tmp_str[offset] << 8 | tmp_str[offset+1];
offset += 2;
}
- for (int i=0; i<p_del->enhanced_vmn_ack.num_play_ack; i++) {
+ for (int i = 0; i < p_del->enhanced_vmn_ack.num_play_ack; i++) {
p_del->enhanced_vmn_ack.pa_vm_msg_id[i] = tmp_str[offset] << 8 | tmp_str[offset+1];
offset += 2;
}
_shiftNBit_for_decode(tmp_str, pkg_len, 4);
}
}
-
-
}
SmsPluginEventHandler::~SmsPluginEventHandler()
{
-
}
p_msg_info->dataSize = textCvt->convertSHIFTJISToUTF8((unsigned char*)&p_msg_info->msgText, MAX_MSG_TEXT_LEN, (unsigned char*)&p_deliver->cmas_data.alert_text, p_deliver->cmas_data.data_len);
} else if (p_msg_info->encodeType == MSG_ENCODE_GSM7BIT) {
MSG_DEBUG("Encode Type = GSM7BIT");
- MSG_LANG_INFO_S langinfo = {0,};
+ MSG_LANG_INFO_S langinfo = {0, };
MsgTextConvert *textCvt = MsgTextConvert::instance();
p_msg_info->dataSize = textCvt->convertGSM7bitToUTF8((unsigned char*)&p_msg_info->msgText, MAX_MSG_TEXT_LEN, (unsigned char*)&p_deliver->cmas_data.alert_text, p_deliver->cmas_data.data_len, &langinfo);
} else {
p_msg_info->dataSize = textCvt->convertSHIFTJISToUTF8((unsigned char*)&p_msg_info->msgText, MAX_MSG_TEXT_LEN, (unsigned char*)&p_deliver->user_data.user_data, p_deliver->user_data.data_len);
} else if (p_msg_info->encodeType == MSG_ENCODE_GSM7BIT) {
MSG_DEBUG("Encode Type = GSM7BIT");
- MSG_LANG_INFO_S langinfo = {0,};
+ MSG_LANG_INFO_S langinfo = {0, };
MsgTextConvert *textCvt = MsgTextConvert::instance();
p_msg_info->dataSize = textCvt->convertGSM7bitToUTF8((unsigned char*)&p_msg_info->msgText, MAX_MSG_TEXT_LEN, (unsigned char*)&p_deliver->user_data.user_data, p_deliver->user_data.data_len, &langinfo);
} else {
void SmsPluginEventHandler::convertAckMsgToMsgInfo(sms_telesvc_deliver_ack_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info)
{
-
}
void SmsPluginEventHandler::convertReportMsgToMsgInfo(sms_telesvc_report_s *p_deliver, MSG_MESSAGE_INFO_S *p_msg_info)
{
-
}
if (sentInfo.bLast == true || NetStatus != MSG_NETWORK_SEND_SUCCESS) {
/* Update Msg Status */
if (sentInfo.reqInfo.msgInfo.msgPort.valid == false) {
-
sentInfo.reqInfo.msgInfo.networkStatus = NetStatus;
if (NetStatus == MSG_NETWORK_SEND_SUCCESS) {
void SmsPluginEventHandler::handleMsgIncoming(sms_trans_p2p_msg_s *p_p2p_msg)
{
-
/* Make MSG_MESSAGE_INFO_S */
MSG_MESSAGE_INFO_S msgInfo;
/* Handling of Fail Case ?? */
/* SmsPluginTransport::instance()->sendDeliverReport(MSG_SUCCESS); */
} else { /* SMS Deliver */
-
/* Add message to DB */
if (msgInfo.msgPort.valid == false) {
if (p_p2p_msg->telesvc_id != SMS_TRANS_TELESVC_VMN_95) {
/* Callback to MSG FW */
if (err == MSG_SUCCESS) {
-
#if 1
MSG_CB_MSG_S cbOutMsg = {0, };
bool is_duplicate = false;
/* cbOutMsg.dcs = CbMsgPage.pageHeader.dcs.rawData; */
memset (cbOutMsg.cbText, 0x00, sizeof(cbOutMsg.cbText));
- cbOutMsg.cbTextLen= msgInfo.dataSize;
+ cbOutMsg.cbTextLen = msgInfo.dataSize;
memset(cbOutMsg.language_type, 0x00, sizeof(cbOutMsg.language_type));
/* memcpy(cbOutMsg.language_type, CbMsgPage.pageHeader.dcs.iso639Lang, 3); */
msg.totalSeg = p_p2p_msg->telesvc_msg.data.deliver.user_data.user_data[1];
msg.segNum = p_p2p_msg->telesvc_msg.data.deliver.user_data.user_data[2];
- char tmpUserText[SMS_MAX_USER_DATA_LEN+1] = {0,};
+ char tmpUserText[SMS_MAX_USER_DATA_LEN+1] = {0, };
sms_telesvc_userdata_s tmpUserData;
memset(&tmpUserData, 0x00, sizeof(sms_telesvc_userdata_s));
unique_ptr<char*, void(*)(char**)> dataBuf(&pUserData, unique_ptr_deleter);
unique_ptr<char*, void(*)(char**)> dataBuf1(&pTmpUserData, unique_ptr_deleter);
- MSG_MESSAGE_INFO_S msgInfo = {0,};
+ MSG_MESSAGE_INFO_S msgInfo = {0, };
msgInfo.addressList = NULL;
unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> addressListBuf(&msgInfo.addressList, unique_ptr_deleter);
}
return totalSize;
-
}
syncMLData.pushBodyLen = PushBodyLen;
memcpy(syncMLData.pushBody, pPushBody, PushBodyLen);
- syncMLData.wspHeaderLen= WspHeaderLen;
+ syncMLData.wspHeaderLen = WspHeaderLen;
memcpy(syncMLData.wspHeader, pWspHeader, WspHeaderLen);
/* Callback to MSG FW */
if (svc_ctg >= SMS_TRANS_SVC_CTG_CMAS_PRESIDENTIAL && svc_ctg <= SMS_TRANS_SVC_CTG_CMAS_TEST) {
bool bActivate = false;
short Category = 0;
- MSG_CB_CHANNEL_S cbChannelInfo = {0,};
+ MSG_CB_CHANNEL_S cbChannelInfo = {0, };
msg_error_t err = MSG_SUCCESS;
MsgDbHandler *dbHandle = getDbHandle();
pPluginHandle->pfAddMessage = SmsPlgAddMessage;
MSG_DEBUG("SMS plugin: create handler OK");
- MSG_DEBUG ("SMS plugin %p", pPluginHandle);
+ MSG_DEBUG("SMS plugin %p", pPluginHandle);
}
return MSG_SUCCESS;
/* Add Submit SMS into DB */
if (pReqInfo->msgInfo.msgId == 0) {
if (pReqInfo->msgInfo.msgPort.valid == false) {
-
err = SmsPluginStorage::instance()->checkMessage(&(pReqInfo->msgInfo));
if (err != MSG_SUCCESS) {
msg_error_t SmsPlgSetMemoryStatus(msg_error_t Error)
{
-
int tapiRet = TAPI_API_SUCCESS;
int status = TAPI_NETTEXT_PDA_MEMORY_STATUS_AVAILABLE;
SmsPluginParamCodec::SmsPluginParamCodec()
{
-
-
}
SmsPluginParamCodec::~SmsPluginParamCodec()
{
-
-
}
SmsPluginSetting::~SmsPluginSetting()
{
-
-
}
if (simStatus != MSG_SIM_STATUS_NOT_FOUND) {
MSG_DEBUG("simStatus == [%d]", simStatus);
*/
- MSG_CBMSG_OPT_S cbMsgOpt = {0,};
+ MSG_CBMSG_OPT_S cbMsgOpt = {0, };
if (getCbConfig(&cbMsgOpt) == true) {
err = addCbOpt(&cbMsgOpt);
}
pthread_detach(thd);
-
}
SmsPluginStorage::SmsPluginStorage()
{
-
}
SmsPluginStorage::~SmsPluginStorage()
{
-
}
MSG_END();
return MSG_SUCCESS;
-
}
err = addClass2Message(pMsgInfo);
}
*/
- else if (pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS){
+ else if (pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
err = MSG_SUCCESS;
}
return err;
dbHandle->beginTrans();
if (pMsgInfo->nAddressCnt > 0) {
-
err = MsgStoAddAddress(dbHandle, pMsgInfo, &convId);
if (err != MSG_SUCCESS) {
err = MsgStoCheckMsgCntFull(dbHandle, &(pMsgInfo->msgType), pMsgInfo->folderId);
if (err != MSG_SUCCESS) {
-
if (err == MSG_ERR_MESSAGE_COUNT_FULL) {
bool bAutoErase = false;
if (err == MSG_ERR_DB_NORECORD) {
dbHandle->freeTable();
return MSG_SUCCESS;
- } else if ( err != MSG_SUCCESS) {
+ } else if (err != MSG_SUCCESS) {
dbHandle->freeTable();
return err;
}
- char contentType[MAX_WAPPUSH_CONTENT_TYPE_LEN + 1] = {0,};
- char appId[MAX_WAPPUSH_ID_LEN + 1] = {0,};
+ char contentType[MAX_WAPPUSH_CONTENT_TYPE_LEN + 1] = {0, };
+ char appId[MAX_WAPPUSH_ID_LEN + 1] = {0, };
int appcode = 0, default_appcode = 0;
bool found = false;
char *_content_type = NULL, *_app_id = NULL;
std::list<PUSH_APPLICATION_INFO_S>::iterator it = pushAppInfoList.begin();
int count = 0;
for (; it != pushAppInfoList.end(); it++) {
- if (index == count){
+ if (index == count) {
*appcode = it->appcode;
break;
}
SmsPluginTransport::~SmsPluginTransport()
{
-
}
void SmsPluginTransport::convertMsgInfoToTelesvcMsg(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_trans_msg_s *pTransMsg)
{
switch (pTransMsg->type) {
- case SMS_TRANS_P2P_MSG:
- {
+ case SMS_TRANS_P2P_MSG: {
MSG_DEBUG("Convert MSG_MESSAGE_INFO_S data to SMS_TRANS_MSG_S data.");
sms_trans_p2p_msg_s *pPtpMsg = (sms_trans_p2p_msg_s *)&(pTransMsg->data.p2p_msg);
void SmsPluginTransport::convertMsgInfoToPtp(const MSG_MESSAGE_INFO_S *pMsgInfo, sms_trans_p2p_msg_s *pPtpMsg)
{
-
/* 1. Set Teleservice ID */
pPtpMsg->telesvc_id = SMS_TRANS_TELESVC_CMT_95;
default:
break;
}
-
}
/* 13. Set Service category program data */
/* TODO */
-
}
convertMsgInfoToTelesvcMsg(&pReqInfo->msgInfo, &trans_msg);
/* encode msg data */
- unsigned char tel_sms_data[TAPI_NETTEXT_SMDATA_SIZE_MAX+1] = {0,};
+ unsigned char tel_sms_data[TAPI_NETTEXT_SMDATA_SIZE_MAX+1] = {0, };
tapi_data_pkg.MsgLength = SmsPluginMsgCodec::instance()->encodeMsg(&trans_msg, tel_sms_data);
MsgInsertTicker("Unable to send message. It will be sent when service available.", SMS_MESSAGE_SENDING_PENDING, true, 0);
else
MsgInsertTicker("Sending SMS is failed", SMS_MESSAGE_SENDING_FAIL, true, pReqInfo->msgInfo.msgId);
-
}
_RETURN_FUNC :
MSG_DEBUG("######## tel_set_sms_memory_status() Success !!! #######");
else
MSG_DEBUG("######## tel_set_sms_memory_status() Failed !!! return : [%d] #######", tapiRet);
-
}
} else if (err == MSG_ERR_MESSAGE_COUNT_FULL) {
} else {
cause_code.error_class = SMS_TRANS_ERR_CLASS_TEMPORARY;
response = TAPI_NETTEXT_SIM_FULL;
-
}
memcpy(&(trans_msg.data.ack_msg.cause_code), &(cause_code), sizeof(sms_trans_cause_code_s));
SmsPluginUAManager::~SmsPluginUAManager()
{
-
}
void SmsPluginUAManager::addReqEntity(sms_request_info_s *request)
{
- sms_request_info_s reqTmp = {0,};
+ sms_request_info_s reqTmp = {0, };
memcpy(&reqTmp, request, sizeof(sms_request_info_s));
#include <drm_client.h>
#endif
-static unsigned short wapPushPortList [] = {0x0b84, 0x0b85, 0x23F0, 0x23F1, 0x23F2, 0x23F3, 0xC34F};
+static unsigned short wapPushPortList[] = {0x0b84, 0x0b85, 0x23F0, 0x23F1, 0x23F2, 0x23F3, 0xC34F};
char gWapCodeBufferLeft[WSP_CODE_BUFFER_LEFT_LEN_MAX];
char gWapCodeBufferRight[WSP_CODE_BUFFER_RIGHT_LEN_MAX];
{ (char*)"application/vnd.wap.multipart.byteranges", 0x25 },
{ (char*)"application/vnd.wap.multipart.alternative", 0x26 },
{ (char*)"application/xml", 0x27 },
- { (char*)"text/xml",0x28 },
+ { (char*)"text/xml", 0x28 },
{ (char*)"application/vnd.wap.wbxml", 0x29 },
{ (char*)"application/x-x968-cross-cert", 0x2a },
{ (char*)"application/x-x968-ca-cert", 0x2b },
const SMS_WSP_SECURITY_TYPE_S wspSecurityType[] = {
- {(char*)"NETWPIN",0x00},
- {(char*)"USERPIN",0x01},
- {(char*)"USERNETWPIN",0x02},
- {(char*)"USERPINMAC",0x03}
+ {(char*)"NETWPIN", 0x00},
+ {(char*)"USERPIN", 0x01},
+ {(char*)"USERNETWPIN", 0x02},
+ {(char*)"USERPINMAC", 0x03}
};
SmsPluginWapPushHandler::~SmsPluginWapPushHandler()
{
-
}
MSG_DEBUG("Application Count [%d]", appCount);
for (int i = 0; i < appCount; i++) {
-
header = (unsigned char*)strcasestr(pPushHeader, pushDefaultApplication[i].pContentType);
if (header != NULL) {
/* pass PDU type */
iPDU++;
- pushHeaderLen = wspRetriveUintvarDecode( pPDUTypeData, &iPDU );
+ pushHeaderLen = wspRetriveUintvarDecode(pPDUTypeData, &iPDU);
MSG_DEBUG("PDUTypeDataLen [%d]", PDUTypeDataLen);
MSG_DEBUG("pushHeaderLen [%d]", pushHeaderLen);
MSG_DEBUG("wspBodyLen [%d]", wspBodyLen);
if (wspHeaderLen > 0) {
-
pWspHeader = new char[wspHeaderLen];
if (pWspHeader == NULL) {
wspBodyLen = PDUTypeDataLen - wspHeaderLen;
if (wspBodyLen > 0) {
-
pWspBody = new char[wspBodyLen];
if (pWspBody == NULL) {
case SMS_WAP_APPLICATION_PUSH_PROVISIONING_WBXML:
case SMS_WAP_APPLICATION_PUSH_BROWSER_SETTINGS:
case SMS_WAP_APPLICATION_PUSH_BROWSER_BOOKMARKS:
- case SMS_WAP_APPLICATION_SYNCML_DM_NOTIFICATION:
- {
+ case SMS_WAP_APPLICATION_SYNCML_DM_NOTIFICATION: {
connection_agent = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
if (error) {
MSG_DEBUG("Connecting to system bus failed: %s\n", error->message);
MSG_DEBUG("Connecting to system bus failed: %s\n", error->message);
goto _DBUS_ERROR;
}
- dbus_proxy_service =g_dbus_proxy_new_sync(connection_service, G_DBUS_PROXY_FLAGS_NONE, NULL,
+ dbus_proxy_service = g_dbus_proxy_new_sync(connection_service, G_DBUS_PROXY_FLAGS_NONE, NULL,
"org.tizen.omadmservice", "/org/tizen/omadmservice",
"org.tizen.omadmservice", NULL, &error);
if (error) {
}
break;
case SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION:
- case SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION_WBXML:
- {
+ case SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION_WBXML: {
connection_agent = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
if (error) {
MSG_DEBUG("Connecting to system bus failed: %s\n", error->message);
msg_error_t err = MSG_SUCCESS;
int pushEvt_cnt = 0;
- char app_id[MAX_WAPPUSH_ID_LEN] = {0,};
- char content_type[MAX_WAPPUSH_CONTENT_TYPE_LEN] = {0,};
+ char app_id[MAX_WAPPUSH_ID_LEN] = {0, };
+ char content_type[MAX_WAPPUSH_CONTENT_TYPE_LEN] = {0, };
SmsPluginStorage *storageHandler = SmsPluginStorage::instance();
err = storageHandler->getRegisteredPushEvent(pPushHeader, &pushEvt_cnt, app_id, sizeof(app_id), content_type, sizeof(content_type));
}
for (int i = 0; i < pushEvt_cnt; ++i) {
-
/* check Push message receive setting */
bool bPushRecv = false;
int appcode = 0;
msg_error_t err = MSG_SUCCESS;
if (pPushBody == NULL) {
- MSG_DEBUG("pPushBody is NULL \n" );
+ MSG_DEBUG("pPushBody is NULL \n");
return;
}
getXmlDoc(pPushBody, PushBodyLen, &xmlDoc, isText);
if (xmlDoc == NULL) {
- MSG_DEBUG("xmlDoc is NULL \n" );
+ MSG_DEBUG("xmlDoc is NULL \n");
return;
}
topNode = xmlDocGetRootElement(xmlDoc);
if (topNode == NULL) {
- MSG_DEBUG("Empty Document." );
+ MSG_DEBUG("Empty Document.");
xmlFreeDoc(xmlDoc);
return;
} else {
- MSG_SEC_DEBUG("Not an empty Document and topNode->name = %s \n",topNode->name );
+ MSG_SEC_DEBUG("Not an empty Document and topNode->name = %s \n", topNode->name);
}
indNode = topNode;
while (indNode != NULL) {
if (!xmlStrcmp(indNode->name, (const xmlChar*) "sl")) {
- MSG_SEC_DEBUG("indNode->name = %s\n",indNode->name);
+ MSG_SEC_DEBUG("indNode->name = %s\n", indNode->name);
break;
}
MSG_DEBUG("Enter handleCOMessage");
if (pPushBody == NULL) {
- MSG_DEBUG("pPushBody is NULL \n" );
+ MSG_DEBUG("pPushBody is NULL \n");
return;
}
getXmlDoc(pPushBody, PushBodyLen, &xmlDoc, isText);
if (xmlDoc == NULL) {
- MSG_DEBUG("xmlDoc is NULL \n" );
+ MSG_DEBUG("xmlDoc is NULL \n");
return;
}
topNode = xmlDocGetRootElement(xmlDoc);
if (topNode == NULL) {
- MSG_DEBUG("Warning:Empty Document\n" );
+ MSG_DEBUG("Warning:Empty Document\n");
xmlFreeDoc(xmlDoc);
return;
}
indNode = topNode->xmlChildrenNode;
while (indNode != NULL) {
-
xmlChar* tmpUrl = NULL;
if (!xmlStrcmp(indNode->name, (const xmlChar*) SMS_PUSH_XML_INVAL_OBJ)) {
MSG_SEC_DEBUG("indNode->name = %s\n", indNode->name);
MSG_DEBUG("NO href value from the xmlDoc\n");
}
} else if (!xmlStrcmp(indNode->name, (const xmlChar*) SMS_PUSH_XML_INVAL_SVC)) {
- MSG_SEC_DEBUG("indNode->name = %s\n",indNode->name);
+ MSG_SEC_DEBUG("indNode->name = %s\n", indNode->name);
tmpUrl = xmlGetProp(indNode, (xmlChar*)SMS_PUSH_XML_CO_URI);
if (tmpUrl != NULL) {
pMsgInfo->msgPort.valid = false;
pMsgInfo->msgPort.dstPort = 0;
pMsgInfo->msgPort.srcPort = 0;
-
}
*pXmlDoc = xmlParseMemory((char*)xmldata, AcStrlen((char*)xmldata));
}
-
}
memset(&timeStruct, 0x00, sizeof(struct tm));
/* check pDate */
- if (AcStrlen(pDate)<20)
+ if (AcStrlen(pDate) < 20)
return 0;
MSG_DEBUG("pDate [%s]", pDate);
}
tmpBuf[i] = '\0';
index++;
- timeStruct.tm_year = (atoi( tmpBuf)-1900);
+ timeStruct.tm_year = (atoi(tmpBuf)-1900);
/* Month */
for (i = 0; i < 2; i++) {
}
tmpBuf[i] = '\0';
index++;
- timeStruct.tm_mon = (atoi( tmpBuf) - 1);
+ timeStruct.tm_mon = (atoi(tmpBuf) - 1);
/* Date */
for (i = 0; i < 2; i++) {
}
tmpBuf[i] = '\0';
index++;
- timeStruct.tm_mday = atoi( tmpBuf);
+ timeStruct.tm_mday = atoi(tmpBuf);
/* Hours */
for (i = 0; i < 2; i++) {
}
tmpBuf[i] = '\0';
index++;
- timeStruct.tm_hour = atoi( tmpBuf);
+ timeStruct.tm_hour = atoi(tmpBuf);
/* Minites */
for (i = 0; i < 2; i++) {
}
tmpBuf[i] = '\0';
index++;
- timeStruct.tm_min = atoi( tmpBuf);
+ timeStruct.tm_min = atoi(tmpBuf);
/* Seconds */
for (i = 0; i < 2; i++) {
}
tmpBuf[i] = '\0';
index++;
- timeStruct.tm_sec = atoi( tmpBuf);
+ timeStruct.tm_sec = atoi(tmpBuf);
nTimeInSec = mktime(&timeStruct);
}
/* compare with signal-none. */
- comp = g_strcmp0( "signal-none", pAction );
+ comp = g_strcmp0("signal-none", pAction);
if (comp == 0)
return MSG_PUSH_SI_ACTION_SIGNAL_NONE;
/* compare with signal-low. */
- comp = g_strcmp0( "signal-low", pAction );
+ comp = g_strcmp0("signal-low", pAction);
if (comp == 0)
return MSG_PUSH_SI_ACTION_SIGNAL_LOW;
/* compare with signal-medium. */
- comp = g_strcmp0( "signal-medium", pAction );
+ comp = g_strcmp0("signal-medium", pAction);
if (comp == 0)
return MSG_PUSH_SI_ACTION_SIGNAL_MEDIUM;
/* compare with signal-high. */
- comp = g_strcmp0( "signal-high", pAction );
+ comp = g_strcmp0("signal-high", pAction);
if (comp == 0)
return MSG_PUSH_SI_ACTION_SIGNAL_HIGH;
/* compare with delete. */
- comp = g_strcmp0( "delete", pAction );
+ comp = g_strcmp0("delete", pAction);
if (comp == 0)
return MSG_PUSH_SI_ACTION_DELETE;
/* signal-medium is default action value. */
return MSG_PUSH_SI_ACTION_SIGNAL_MEDIUM;
-
}
int comp = 0;
if (pAction == NULL) {
- MSG_DEBUG( "MSG_DEBUG is NULL. Setting to default action type.\n" );
+ MSG_DEBUG("MSG_DEBUG is NULL. Setting to default action type.\n");
return MSG_PUSH_SL_ACTION_EXECUTE_LOW;
}
/* compare pSrcStr with execute-low. */
- comp = g_strcmp0( "execute-low", pAction );
+ comp = g_strcmp0("execute-low", pAction);
if (comp == 0)
return MSG_PUSH_SL_ACTION_EXECUTE_LOW;
/* compare pSrcStr with execute-high. */
- comp = g_strcmp0( "execute-high", pAction );
+ comp = g_strcmp0("execute-high", pAction);
if (comp == 0)
return MSG_PUSH_SL_ACTION_EXECUTE_HIGH;
/* compare pSrcStr with cache. */
- comp = g_strcmp0( "cache", pAction );
+ comp = g_strcmp0("cache", pAction);
if (comp == 0)
return MSG_PUSH_SL_ACTION_CACHE;
/* default SL action value is execute-low. */
return MSG_PUSH_SL_ACTION_EXECUTE_LOW;
-
}
-unsigned long SmsPluginWapPushHandler::wspRetriveUintvarDecode( unsigned char* sourceData, unsigned long* currentPointer )
+unsigned long SmsPluginWapPushHandler::wspRetriveUintvarDecode(unsigned char* sourceData, unsigned long* currentPointer)
{
unsigned long i = 0;
unsigned long decodedValue;
while (sourceData[*currentPointer +i] >= 0x80) i++;
- decodedValue = wspDecodeUintvar( i+1, sourceData + *currentPointer );
+ decodedValue = wspDecodeUintvar(i+1, sourceData + *currentPointer);
*currentPointer = *currentPointer + i + 1;
- MSG_DEBUG("wspRetriveUintvarDecode: decodedValue=%d .\n",decodedValue );
+ MSG_DEBUG("wspRetriveUintvarDecode: decodedValue=%d .\n", decodedValue);
return decodedValue;
}
-unsigned long SmsPluginWapPushHandler::wspDecodeUintvar(unsigned long length, unsigned char* userVar )
+unsigned long SmsPluginWapPushHandler::wspDecodeUintvar(unsigned long length, unsigned char* userVar)
{
unsigned long i;
unsigned long decodedUintvar = 0;
for (i = 0 ; i < length; i++) {
- decodedUintvar = decodedUintvar + ( wspUintvarDecodeTable[i] * (userVar[length-(i+1)] & 0x7f ));
+ decodedUintvar = decodedUintvar + (wspUintvarDecodeTable[i] * (userVar[length-(i+1)] & 0x7f));
}
return decodedUintvar;
}
-void SmsPluginWapPushHandler::wspDecodeHeader( unsigned char* sEncodedHeader, unsigned long encodedHeaderLen, unsigned long contentsLength, bool fContentType, char** pHeader)
+void SmsPluginWapPushHandler::wspDecodeHeader(unsigned char* sEncodedHeader, unsigned long encodedHeaderLen, unsigned long contentsLength, bool fContentType, char** pHeader)
{
unsigned long iField;
bool continueField = FALSE;
/* outTemper is Decoded Headers.
temper is Single Decoded Header.
*/
- if (NULL == ( outTemper = new char[ WSP_STANDARD_STR_LEN_MAX * 5 ])) {
- MSG_DEBUG("outTemper Memory allocation is failed.\n" );
+ if (NULL == (outTemper = new char[ WSP_STANDARD_STR_LEN_MAX * 5 ])) {
+ MSG_DEBUG("outTemper Memory allocation is failed.\n");
return;
}
memset(outTemper, 0, (WSP_STANDARD_STR_LEN_MAX * 5));
currentLength = WSP_STANDARD_STR_LEN_MAX;
- MSG_DEBUG("wspDecodeHeader: Message header decoding started.\n" );
+ MSG_DEBUG("wspDecodeHeader: Message header decoding started.\n");
int loop;
char szBuf[64];
szBuf[0] = 0x00;
- MSG_DEBUG("wspDecodeHeader: RAW data \n" );
- for (loop = 0 ; loop<(int)encodedHeaderLen; loop++) {
+ MSG_DEBUG("wspDecodeHeader: RAW data \n");
+ for (loop = 0 ; loop < (int)encodedHeaderLen; loop++) {
char szTempBuf[5];
szTempBuf[0] = 0x00;
- snprintf( szTempBuf, sizeof(szTempBuf), "%2X ", sEncodedHeader[loop] );
+ snprintf(szTempBuf, sizeof(szTempBuf), "%2X ", sEncodedHeader[loop]);
- if (AcStrlen( szBuf ) + 7 < 64) {
- strncat( szBuf, szTempBuf, sizeof(szBuf)-AcStrlen(szBuf)-1 );
+ if (AcStrlen(szBuf) + 7 < 64) {
+ strncat(szBuf, szTempBuf, sizeof(szBuf)-AcStrlen(szBuf)-1);
} else {
- strncat( szBuf, "\n", sizeof(szBuf)-AcStrlen(szBuf)-1 );
+ strncat(szBuf, "\n", sizeof(szBuf)-AcStrlen(szBuf)-1);
MSG_DEBUG("[%s]", szBuf);
szBuf[0] = 0x00;
- strncat( szBuf, szTempBuf, sizeof(szBuf)-AcStrlen(szBuf)-1 );
+ strncat(szBuf, szTempBuf, sizeof(szBuf)-AcStrlen(szBuf)-1);
}
}
- strncat( szBuf, "\n", sizeof(szBuf)-AcStrlen(szBuf)-1 );
+ strncat(szBuf, "\n", sizeof(szBuf)-AcStrlen(szBuf)-1);
MSG_DEBUG("[%s]", szBuf);
- MSG_DEBUG("fContentType=%d \n",fContentType );
+ MSG_DEBUG("fContentType=%d \n", fContentType);
/* operation for content-type */
/* makes psuedo- content-type fieldcode */
/* content - type is processed with header. But it's come without field code. So existence of fContentType can decide adding content type header field code whether ContentType + general header is or not. */
if (fContentType) {
encodedHeader = new char[ encodedHeaderLen + 1 ];
if (encodedHeader == NULL) {
- MSG_DEBUG("encodedHeader Memory allocation is failed.\n" );
+ MSG_DEBUG("encodedHeader Memory allocation is failed.\n");
return;
}
encodedHeader[0] = 0x91;
- memcpy( encodedHeader + 1, sEncodedHeader, (size_t)encodedHeaderLen );
+ memcpy(encodedHeader + 1, sEncodedHeader, (size_t)encodedHeaderLen);
} else {
encodedHeader = new char[ encodedHeaderLen ];
if (encodedHeader == NULL) {
- MSG_DEBUG("encodedHeader Memory allocation is failed.\n" );
+ MSG_DEBUG("encodedHeader Memory allocation is failed.\n");
return;
}
- memcpy( encodedHeader, sEncodedHeader, (size_t)encodedHeaderLen );
+ memcpy(encodedHeader, sEncodedHeader, (size_t)encodedHeaderLen);
}
/* Is it reacehd end of header? */
temper = new char[ WSP_STANDARD_STR_LEN_MAX * 5 ];
if (temper == NULL) {
- MSG_DEBUG("temper Memory allocation is failed.\n" );
+ MSG_DEBUG("temper Memory allocation is failed.\n");
return;
}
memset(temper, 0x00, (WSP_STANDARD_STR_LEN_MAX * 5));
/* this section presents header code page shifting procedure
This part can be implemented by future request.
- if (track == 0x 7f )
+ if (track == 0x 7f)
*/
track = encodedHeader[iEncodedHeader];
if (track == 0x00) {
- MSG_DEBUG("WspLDecodeHeader: fieldcode is 0 \n" );
+ MSG_DEBUG("WspLDecodeHeader: fieldcode is 0 \n");
strncpy((char*) temper, (char*)"", (WSP_STANDARD_STR_LEN_MAX * 5)-1);
fieldCode = 0xff;
iEncodedHeader++;
- } else if (( track > 0 ) && ( track < 0x20 )) {
+ } else if ((track > 0) && (track < 0x20)) {
iEncodedHeader++;
- } else if (( track < 0x7f ) && ( track > 0x1f )) { /* In this case, first byte is normal string. So it's considered to unknown header. */
+ } else if ((track < 0x7f) && (track > 0x1f)) { /* In this case, first byte is normal string. So it's considered to unknown header. */
unsigned char* fieldName = (unsigned char*)gWapCodeBufferLeft;
unsigned char* fieldValue = (unsigned char*)gWapCodeBufferRight;
- strncpy( (char*)fieldName, (char*)(encodedHeader + iEncodedHeader ),WSP_CODE_BUFFER_LEFT_LEN_MAX-1);
+ strncpy((char*)fieldName, (char*)(encodedHeader + iEncodedHeader), WSP_CODE_BUFFER_LEFT_LEN_MAX-1);
fieldName[WSP_CODE_BUFFER_LEFT_LEN_MAX-1] = '\0';
- iEncodedHeader = iEncodedHeader + AcStrlen( (char*)fieldName ) + 1;
- strncpy( (char*)fieldValue, (char*)(encodedHeader + iEncodedHeader ), WSP_CODE_BUFFER_RIGHT_LEN_MAX-1);
+ iEncodedHeader = iEncodedHeader + AcStrlen((char*)fieldName) + 1;
+ strncpy((char*)fieldValue, (char*)(encodedHeader + iEncodedHeader), WSP_CODE_BUFFER_RIGHT_LEN_MAX-1);
fieldValue[WSP_CODE_BUFFER_RIGHT_LEN_MAX-1] = '\0';
- iEncodedHeader = iEncodedHeader + AcStrlen( (char*)fieldValue ) + 1;
+ iEncodedHeader = iEncodedHeader + AcStrlen((char*)fieldValue) + 1;
- strncat((char*)temper, (char*)fieldName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- strncat((char*)temper, ": ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- strncat((char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
+ strncat((char*)temper, (char*)fieldName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ strncat((char*)temper, ": ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ strncat((char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
/* this means 'don't process anymore.' */
fieldCode = 0xff;
} else if (track > 0x7f) {
/* In case of first byte is field code, else case is error. */
-
- /*if (( track & 0x7f ) <= wspHeaderFieldCount ) */
- {
-
+ /*if ((track & 0x7f) <= wspHeaderFieldCount) { */
unsigned long fieldValueLen = encodedHeader[iEncodedHeader + 1];
unsigned char fieldValue[1275];
fieldCode = track & 0x7f;
/*
- if (( fieldValueLen == 0 ) || ( fieldValueLen == 0x80 )) {
- dprint( DNET_WAP,DNET_DBG_HIGH, "%X %X %X %X %X %X\n" , fieldCode, encodedHeader[iEncodedHeader + 1], encodedHeader[iEncodedHeader + 2],encodedHeader[iEncodedHeader + 3],encodedHeader[iEncodedHeader + 4], encodedHeader[iEncodedHeader + 5] );
+ if ((fieldValueLen == 0) || (fieldValueLen == 0x80)) {
+ dprint(DNET_WAP,DNET_DBG_HIGH, "%X %X %X %X %X %X\n" , fieldCode, encodedHeader[iEncodedHeader + 1], encodedHeader[iEncodedHeader + 2],encodedHeader[iEncodedHeader + 3],encodedHeader[iEncodedHeader + 4], encodedHeader[iEncodedHeader + 5]);
}
*/
memset(fieldValue, 0, 1275);
- {
- /* add field name */
- /* This continueField flag show whether previous field code and current field code are same or not. If it's same, there are some sequential display effect by omitting field name addition process. The reason why it should be do that can be found in encoding example of spec. */
- if (!continueField) {
- strncat( (char*)temper, (char*)wspHeaderFieldName[fieldCode], (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- strncat( (char*)temper, ": ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- continueField = FALSE;
- }
- /* field value is string */
- /* In this case, it just copy field value. */
- if (( fieldValueLen > LENGTH_QUOTE ) && ( fieldValueLen < 0x80 )) {
+ /* add field name */
+ /* This continueField flag show whether previous field code and current field code are same or not. If it's same, there are some sequential display effect by omitting field name addition process. The reason why it should be do that can be found in encoding example of spec. */
+ if (!continueField) {
+ strncat((char*)temper, (char*)wspHeaderFieldName[fieldCode], (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ strncat((char*)temper, ": ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ continueField = FALSE;
+ }
- /* string field value should be NULL terminated */
- strncat( (char*)temper, (char*)(encodedHeader + iEncodedHeader + 1 ), (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- strncat( (char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
-
- iEncodedHeader = iEncodedHeader + AcStrlen( (char*)encodedHeader + iEncodedHeader + 1 ) + 2;
- fieldCode = 0xff;
- }
- /* first field value is length */
- /* If first byte of field value is length value, allocate field value by the length.
- In field value, data is
- 1D 03 8F 24 24 - Then 8F 24 24 is field value.
- 1D 1F 33.... - Then allocate 33H for FieldValue.
- 1D 8F - Then 8F
- 1D 'Hi man!' Like 00, if string is come, then process without calculating field value.
- 1D 8F 24 24 - In this case, original data is wrong.
- If accept-charset: ISO-10646-ucs-2;Q=0.7 is
- 01 03 03 E8 47
- 01 - field code
- 03 - field value length
- 03 E8 47 - field value
- it's decoded by above value.
- */
- if (fieldValueLen < 0x20) {
-
- if (fieldValueLen == LENGTH_QUOTE) {
-
- /* field length is encoded in UINTVAR */
- unsigned long uintvarLen = 0;
- fieldValueLen = wspRetriveUintvarDecode((unsigned char*) encodedHeader + iEncodedHeader + 2, &uintvarLen );
- memcpy( fieldValue, encodedHeader + iEncodedHeader + 2 + uintvarLen, (size_t)fieldValueLen );
- iEncodedHeader = iEncodedHeader + fieldValueLen + uintvarLen + 2;
+ /* field value is string */
+ /* In this case, it just copy field value. */
+ if ((fieldValueLen > LENGTH_QUOTE) && (fieldValueLen < 0x80)) {
+ /* string field value should be NULL terminated */
+ strncat((char*)temper, (char*)(encodedHeader + iEncodedHeader + 1), (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ strncat((char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ iEncodedHeader = iEncodedHeader + AcStrlen((char*)encodedHeader + iEncodedHeader + 1) + 2;
+ fieldCode = 0xff;
+ }
+ /* first field value is length */
+ /* If first byte of field value is length value, allocate field value by the length.
+ In field value, data is
+ 1D 03 8F 24 24 - Then 8F 24 24 is field value.
+ 1D 1F 33.... - Then allocate 33H for FieldValue.
+ 1D 8F - Then 8F
+ 1D 'Hi man!' Like 00, if string is come, then process without calculating field value.
+ 1D 8F 24 24 - In this case, original data is wrong.
+ If accept-charset: ISO-10646-ucs-2;Q=0.7 is
+ 01 03 03 E8 47
+ 01 - field code
+ 03 - field value length
+ 03 E8 47 - field value
+ it's decoded by above value.
+ */
+ if (fieldValueLen < 0x20) {
+ if (fieldValueLen == LENGTH_QUOTE) {
+ /* field length is encoded in UINTVAR */
+ unsigned long uintvarLen = 0;
+ fieldValueLen = wspRetriveUintvarDecode((unsigned char*) encodedHeader + iEncodedHeader + 2, &uintvarLen);
+ memcpy(fieldValue, encodedHeader + iEncodedHeader + 2 + uintvarLen, (size_t)fieldValueLen);
+ iEncodedHeader = iEncodedHeader + fieldValueLen + uintvarLen + 2;
+
+ } else {
+ if (fieldValueLen == 1) {
+ /* field value is one byte integer over 0x80 */
+ /* make it two byte integer */
+ fieldValue[0] = 0x00;
+ memcpy(fieldValue + 1, encodedHeader + iEncodedHeader + 2, (size_t)fieldValueLen);
+ fieldValueLen = 2;
+ iEncodedHeader = iEncodedHeader + 1 + 2;
} else {
-
- if (fieldValueLen == 1) {
- /* field value is one byte integer over 0x80 */
- /* make it two byte integer */
- fieldValue[0] = 0x00;
- memcpy( fieldValue + 1, encodedHeader + iEncodedHeader + 2, (size_t)fieldValueLen);
- fieldValueLen = 2;
- iEncodedHeader = iEncodedHeader + 1 + 2;
- } else {
- memcpy( fieldValue, encodedHeader + iEncodedHeader + 2, (size_t)fieldValueLen );
- fieldValue[fieldValueLen] = 0;
- iEncodedHeader = iEncodedHeader + fieldValueLen + 2;
- if (( fieldValueLen == 0 ) || ( fieldValueLen == 0x80 )) {
- MSG_DEBUG("%X \n", encodedHeader[iEncodedHeader] );
- }
+ memcpy(fieldValue, encodedHeader + iEncodedHeader + 2, (size_t)fieldValueLen);
+ fieldValue[fieldValueLen] = 0;
+ iEncodedHeader = iEncodedHeader + fieldValueLen + 2;
+ if ((fieldValueLen == 0) || (fieldValueLen == 0x80)) {
+ MSG_DEBUG("%X \n", encodedHeader[iEncodedHeader]);
}
}
}
- /* field value is single encoded */
- if (fieldValueLen > 0x7f) {
- fieldValue[0] = encodedHeader[iEncodedHeader + 1];
- fieldValueLen = 1;
- iEncodedHeader = iEncodedHeader + 2;
- }
- /* processing normal pre-defined field decoding */
+ }
- MSG_DEBUG("WspLDecodeHeader: FieldCode %X\n", fieldCode );
- MSG_DEBUG("WspLDecodeHeader: fieldSize %d\n", fieldValueLen );
+ /* field value is single encoded */
+ if (fieldValueLen > 0x7f) {
+ fieldValue[0] = encodedHeader[iEncodedHeader + 1];
+ fieldValueLen = 1;
+ iEncodedHeader = iEncodedHeader + 2;
+ }
+ /* processing normal pre-defined field decoding */
- if (( fieldCode > wspHeaderFieldCount ) && ( fieldCode != 0xff )) {
- MSG_DEBUG("WspLDecodeHeader: unknown fieldcode %X \n", track );
- strncpy((char*) temper, (char*)"", (WSP_STANDARD_STR_LEN_MAX * 5)-1);
- fieldCode = 0xff;
- }
+ MSG_DEBUG("WspLDecodeHeader: FieldCode %X\n", fieldCode);
+ MSG_DEBUG("WspLDecodeHeader: fieldSize %d\n", fieldValueLen);
+ if ((fieldCode > wspHeaderFieldCount) && (fieldCode != 0xff)) {
+ MSG_DEBUG("WspLDecodeHeader: unknown fieldcode %X \n", track);
+ strncpy((char*) temper, (char*)"", (WSP_STANDARD_STR_LEN_MAX * 5)-1);
+ fieldCode = 0xff;
+ }
- switch (fieldCode) {
- /* accept charset */
- /* It's normal way of field process. */
- case 0x01:
- {
- unsigned long i = 0;
- unsigned long code;
-
- /* Case of length of charset greater than 1 are two thigins.
- 1. code length of charset is greater than 1.
- 2. It include parameter.
- 3. Or both of two
- */
- if (1 != fieldValueLen) {
- code = wspHeaderDecodeInteger( fieldValue );
- /* Calculate iField. */
- if (fieldValue[0] < 0x80 )
- iField = fieldValue[0];
- else
- iField = 1;
-
- while ( wspCharset[i].charsetCode != code )
- i++;
- strncat( (char*)temper, (char*)wspCharset[i].charsetName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- /* If parameter exist */
- if (iField < fieldValueLen) {
- char* param = NULL;
- unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
- wspHeaderDecodeQValue( fieldValueLen - iField, fieldValue + iField, ¶m);
- strncat( (char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- }
- } else {
- code = fieldValue[0] & 0x7f;
- while (( wspCharset[i].charsetCode != code ) && ( wspCharset[i].charsetCode != 0xffff )) i++;
- strncat( (char*)temper, (char*)wspCharset[i].charsetName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
+ switch (fieldCode) {
+ /* accept charset */
+ /* It's normal way of field process. */
+ case 0x01: {
+ unsigned long i = 0;
+ unsigned long code;
+
+ /* Case of length of charset greater than 1 are two thigins.
+ 1. code length of charset is greater than 1.
+ 2. It include parameter.
+ 3. Or both of two
+ */
+ if (1 != fieldValueLen) {
+ code = wspHeaderDecodeInteger(fieldValue);
+ /* Calculate iField. */
+ if (fieldValue[0] < 0x80)
+ iField = fieldValue[0];
+ else
+ iField = 1;
+
+ while (wspCharset[i].charsetCode != code)
+ i++;
+ strncat((char*)temper, (char*)wspCharset[i].charsetName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ /* If parameter exist */
+ if (iField < fieldValueLen) {
+ char* param = NULL;
+ unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
+ wspHeaderDecodeQValue(fieldValueLen - iField, fieldValue + iField, ¶m);
+ strncat((char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
+ } else {
+ code = fieldValue[0] & 0x7f;
+ while ((wspCharset[i].charsetCode != code) && (wspCharset[i].charsetCode != 0xffff)) i++;
+ strncat((char*)temper, (char*)wspCharset[i].charsetName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ }
+ break;
+
+ /* type encoding */
+ /* Like below routine, Same decoding routine process together. */
+ /* Accept-encoding */
+ case 0x02:
+ /* content-encoding */
+ case 0x0b: {
+ int integerValue;
+
+ integerValue = wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen);
+ if (integerValue > 2) {
+ MSG_DEBUG("WspLDecodeHeader: integerValue is over limit(2).\n");
+ break;
}
+ strncat((char*)temper, (char*)wspEncodeMethod[integerValue], (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
break;
-
- /* type encoding */
- /* Like below routine, Same decoding routine process together. */
- /* Accept-encoding */
- case 0x02:
- /* content-encoding */
- case 0x0b:
- {
- int integerValue;
-
- integerValue = wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen );
- if (integerValue > 2) {
- MSG_DEBUG("WspLDecodeHeader: integerValue is over limit(2).\n");
- break;
- }
- strncat( (char*)temper, (char*)wspEncodeMethod[integerValue], (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ /* contents type decoder */
+ /* accept */
+ case 0x00:
+ /* content-type */
+ case 0x11: {
+ unsigned long contentsTypeCode;
+ unsigned long i = 0;
+ /* encoded content type length body */
+ unsigned long tempLen;
+ MSG_DEBUG("fieldValueLen: %d", fieldValueLen);
+
+ /* Like HTTP result state 304, it's for processing without Content type. This part doesn't defined. */
+ if (0 == fieldValueLen) {
+ strncat((char*)temper, (char*)"None" , (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ break;
+ }
+ /* 01 AE --> 00 AE --> AE*/
+ if (fieldValueLen == 2 && fieldValue[0] == 0) {
+ memcpy(fieldValue, encodedHeader + iEncodedHeader -1, (size_t)fieldValueLen-1);
+ MSG_DEBUG("WspLDecodeHeader:For mmO2 problem\r\n");
}
- break;
- /* contents type decoder */
- /* accept */
- case 0x00:
- /* content-type */
- case 0x11:
- {
- unsigned long contentsTypeCode;
- unsigned long i = 0;
- /* encoded content type length body */
- unsigned long tempLen;
- MSG_DEBUG("fieldValueLen: %d", fieldValueLen);
-
- /* Like HTTP result state 304, it's for processing without Content type. This part doesn't defined. */
- if (0 == fieldValueLen) {
- strncat( (char*)temper, (char*)"None" , (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- break;
- }
- /* 01 AE --> 00 AE --> AE*/
- if (fieldValueLen == 2 && fieldValue[0] == 0) {
- memcpy( fieldValue, encodedHeader + iEncodedHeader -1, (size_t)fieldValueLen-1 );
- MSG_DEBUG("WspLDecodeHeader:For mmO2 problem\r\n" );
- }
-
- if ((fieldValue[0] < 0x20 ) || (fieldValue[0] >= 0x80 )) {
- if (fieldValue[0] >= 0x80) {
- tempLen = 1;
- } else if (fieldValueLen == 2 && fieldValue[0] == 0x03 && fieldValue[1] == 0x0A) { /* 06 05 02 03 0A AF 89 */
- fieldValue[3] = fieldValue[2];
- fieldValue[2] = fieldValue[1];
- fieldValue[1] = fieldValue[0];
- fieldValue[0] = 0x02;
- tempLen = 2;
- fieldValueLen = 3;
- MSG_DEBUG("WspLDecodeHeader:For CPE problem\r\n" );
- } else {
- tempLen = fieldValue[0]; /* 06 06 03 02 03 16 AF 88 */
- }
-
- if (tempLen == 1) {
- char* szExtendedContent;
-
- contentsTypeCode = fieldValue[0] & 0x7f;
- while (( wspContentsType[i].contentsTypeCode != contentsTypeCode ) && ( i < wspContentsTypeCount )) i++;
- /* If specified content type doesn't exist */
- if (i < wspContentsTypeCount)
- strncat( (char*)temper, (char*)wspContentsType[i].contentsTypeName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
+ if ((fieldValue[0] < 0x20) || (fieldValue[0] >= 0x80)) {
+ if (fieldValue[0] >= 0x80) {
+ tempLen = 1;
+ } else if (fieldValueLen == 2 && fieldValue[0] == 0x03 && fieldValue[1] == 0x0A) { /* 06 05 02 03 0A AF 89 */
+ fieldValue[3] = fieldValue[2];
+ fieldValue[2] = fieldValue[1];
+ fieldValue[1] = fieldValue[0];
+ fieldValue[0] = 0x02;
+ tempLen = 2;
+ fieldValueLen = 3;
+ MSG_DEBUG("WspLDecodeHeader:For CPE problem\r\n");
+ } else {
+ tempLen = fieldValue[0]; /* 06 06 03 02 03 16 AF 88 */
+ }
- szExtendedContent = wspExtendedDecodeType( (char)contentsTypeCode );
+ if (tempLen == 1) {
+ char* szExtendedContent;
- if (szExtendedContent != NULL) {
- MSG_DEBUG("WspLDecodeHeader: Tele2 server problem \n " );
- strncat( (char*)temper, (char*)szExtendedContent, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- }
- } else {
- contentsTypeCode = wspHeaderDecodeInteger(fieldValue);
+ contentsTypeCode = fieldValue[0] & 0x7f;
+ while ((wspContentsType[i].contentsTypeCode != contentsTypeCode) && (i < wspContentsTypeCount)) i++;
- while ((i < wspUnregisteredContentsTypeCount) && (wspUnregisterContentsType[i].contentsTypeCode != contentsTypeCode))
- i++;
+ /* If specified content type doesn't exist */
+ if (i < wspContentsTypeCount)
+ strncat((char*)temper, (char*)wspContentsType[i].contentsTypeName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- /* If there is a Content-Type assigned, */
- if (i < wspUnregisteredContentsTypeCount)
- strncat ((char*)temper, (char*)wspUnregisterContentsType[i].contentsTypeName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ szExtendedContent = wspExtendedDecodeType((char)contentsTypeCode);
- tempLen +=1;
+ if (szExtendedContent != NULL) {
+ MSG_DEBUG("WspLDecodeHeader: Tele2 server problem \n ");
+ strncat((char*)temper, (char*)szExtendedContent, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
} else {
- tempLen = AcStrlen( (char*)fieldValue ) + 1;
+ contentsTypeCode = wspHeaderDecodeInteger(fieldValue);
- strncat ((char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- MSG_DEBUG("WspLDecodeHeader: Attention, Decoding Check of Content-Type\n ", tempLen);
- }
+ while ((i < wspUnregisteredContentsTypeCount) && (wspUnregisterContentsType[i].contentsTypeCode != contentsTypeCode))
+ i++;
- /* If there is a parameter */
- if (tempLen < fieldValueLen) {
- char* param = NULL;
- unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
- wspHeaderDecodeParameter( fieldValue + tempLen, fieldValueLen - tempLen, ¶m);
- if (param != NULL) {
- strncat( (char*)temper, "; ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- strncat( (char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- }
- }
- }
- break;
+ /* If there is a Content-Type assigned, */
+ if (i < wspUnregisteredContentsTypeCount)
+ strncat((char*)temper, (char*)wspUnregisterContentsType[i].contentsTypeName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- /* language */
- /* content-language */
- case 0x0c:
- /* accept-language */
- case 0x03:
- {
- unsigned long i = 0;
- unsigned long code;
- unsigned long tempLen;
- if ((fieldValue[0] < 0x20 ) || (fieldValue[0] > 0x80 )) {
- if (fieldValue[0] > 0x80 )
- tempLen = 1;
- else
- tempLen = fieldValue[0];
- } else {
- tempLen = AcStrlen( (char*)fieldValue ) + 1;
+ tempLen +=1;
}
+ } else {
+ tempLen = AcStrlen((char*)fieldValue) + 1;
- if (tempLen == 1) {
-
- code = wspHeaderDecodeInteger( fieldValue );
- while ( wspLanguage[i].languageCode != code) {
- i++;
- if (i == wspLanguageCount)
- break;
- }
-
- if (i < wspLanguageCount) {
- strncat( (char*)temper, (char*)wspLanguage[i].languageName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- }
- } else {
- strncat( (char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- }
+ strncat((char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ MSG_DEBUG("WspLDecodeHeader: Attention, Decoding Check of Content-Type\n ", tempLen);
+ }
- if (tempLen < fieldValueLen) {
- char* param = NULL;
- unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
- wspHeaderDecodeQValue( fieldValueLen - tempLen, fieldValue + tempLen, ¶m );
- strncat( (char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
+ /* If there is a parameter */
+ if (tempLen < fieldValueLen) {
+ char* param = NULL;
+ unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
+ wspHeaderDecodeParameter(fieldValue + tempLen, fieldValueLen - tempLen, ¶m);
+ if (param != NULL) {
+ strncat((char*)temper, "; ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ strncat((char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
}
- break;
+ }
+ break;
- /* integer */
- /* Max-forwards */
- case 0x1e:
- /* content-length */
- case 0x0d:
- /* age */
- case 0x05:
- /* Bearer-indication */
- case 0x33:
- /* Push-Flag */
- case 0x34:
- {
-
- unsigned char temp[16];
- /*
- if (( fieldValueLen == 2 ) && ( fieldValue[0] > 0x7f ))
- AcSprintf( (char*)temp, "%u", (unsigned int)fieldValue[1]);
+ /* language */
+ /* content-language */
+ case 0x0c:
+ /* accept-language */
+ case 0x03: {
+ unsigned long i = 0;
+ unsigned long code;
+ unsigned long tempLen;
+ if ((fieldValue[0] < 0x20) || (fieldValue[0] > 0x80)) {
+ if (fieldValue[0] > 0x80)
+ tempLen = 1;
else
- */
- snprintf( (char*)temp, sizeof(temp), "%u", (unsigned int)wspHeaderDecodeIntegerByLength( fieldValue, fieldValueLen ));
- strncat( (char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
+ tempLen = fieldValue[0];
+ } else {
+ tempLen = AcStrlen((char*)fieldValue) + 1;
}
- break;
- /* X-Wap-Application-Id */
- case 0x2f:
- {
- unsigned char temp[64];
- int integerValue;
-
- if (fieldValueLen == 2 && fieldValue[0] == 0) {
- memcpy( fieldValue, encodedHeader + iEncodedHeader -1, (size_t)fieldValueLen-1 );
- MSG_DEBUG("WspLDecodeHeader:For mmO2 problem\r\n" );
- fieldValueLen = 1;
- }
- integerValue = wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen);
-
- int count = sizeof(wspHeaderApplId)/sizeof(SMS_WSP_HEADER_PARAMETER_S);
- for (int i = 0; i < count ; ++i) {
- if ((unsigned int)integerValue == wspHeaderApplId[i].parameterCode) {
- snprintf((char*)temp, 64, "%s", wspHeaderApplId[i].parameterToken);
- strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
+ if (tempLen == 1) {
+ code = wspHeaderDecodeInteger(fieldValue);
+ while (wspLanguage[i].languageCode != code) {
+ i++;
+ if (i == wspLanguageCount)
break;
- }
}
- }
- break;
- /* Accept-Application */
- case 0x32:
- if (0x80 == fieldValue[0]) {
- strncat( (char*)temper, "*", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1 );
- } else {
- unsigned char temp[16];
- /*
- if (( fieldValueLen == 2 ) && ( fieldValue[0] == 1 ))
- AcSprintf( (char*)temp, "%u", (unsigned int)fieldValue[0]);
- else
- */
- snprintf( (char*)temp, sizeof(temp), "%u", (unsigned int)wspHeaderDecodeIntegerByLength( fieldValue, fieldValueLen ));
- strncat( (char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
+ if (i < wspLanguageCount) {
+ strncat((char*)temper, (char*)wspLanguage[i].languageName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ } else {
+ strncat((char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
- break;
-
- /* date */
- /* last-modified */
- case 0x1d:
- /* if-unmodified-since */
- case 0x1b:
- /* if-range */
- case 0x1a:
- /* if-modified-since */
- case 0x17:
- /* expires */
- case 0x14:
- /* date */
- case 0x12:
- {
- char* decodedString = NULL;
- unique_ptr<char*, void(*)(char**)> decodedStringbuf(&decodedString, unique_ptr_deleter);
- wspHeaderDecodeDateValue( fieldValueLen, fieldValue, &decodedString);
- strncat( (char*)temper, (char*)decodedString, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1 );
+ if (tempLen < fieldValueLen) {
+ char* param = NULL;
+ unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
+ wspHeaderDecodeQValue(fieldValueLen - tempLen, fieldValue + tempLen, ¶m);
+ strncat((char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
- break;
+ }
+ break;
- /* connection */
- case 0x09:
- if (fieldValue[0] == 0x80 )
- strncat( (char*)temper, "Close", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1 );
- break;
- /* accept-ranges */
- case 0x04:
- if (fieldValue[0] == 0x80 )
- strncat( (char*)temper, "None", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1 );
- if (fieldValue[0] == 0x81 )
- strncat( (char*)temper, "Bytes", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1 );
- break;
- /* content-md5 */
- case 0x0f:
- {
- unsigned char temp[1275];
- memcpy( temp, fieldValue, (size_t)fieldValueLen );
- temp[fieldValueLen] = 0;
- wspHeaderCopyDecodedString( temp, ¤tLength, &temper );
+ /* integer */
+ /* Max-forwards */
+ case 0x1e:
+ /* content-length */
+ case 0x0d:
+ /* age */
+ case 0x05:
+ /* Bearer-indication */
+ case 0x33:
+ /* Push-Flag */
+ case 0x34: {
+ unsigned char temp[16];
+ /*
+ if ((fieldValueLen == 2) && (fieldValue[0] > 0x7f))
+ AcSprintf((char*)temp, "%u", (unsigned int)fieldValue[1]);
+ else
+ */
+ snprintf((char*)temp, sizeof(temp), "%u", (unsigned int)wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen));
+ strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ break;
+ /* X-Wap-Application-Id */
+ case 0x2f: {
+ unsigned char temp[64];
+ int integerValue;
+
+ if (fieldValueLen == 2 && fieldValue[0] == 0) {
+ memcpy(fieldValue, encodedHeader + iEncodedHeader -1, (size_t)fieldValueLen-1);
+ MSG_DEBUG("WspLDecodeHeader:For mmO2 problem\r\n");
+ fieldValueLen = 1;
}
- break;
- /* Credential */
- /* authorization */
- case 0x07:
- /* proxy - authorization */
- case 0x21:
- if (fieldValue[0] == 0x80) {
- char* addString = NULL;
- unique_ptr<char*, void(*)(char**)> addStringbuf(&addString, unique_ptr_deleter);
- wspHeaderDecodeAuth(fieldValueLen, fieldValue, &addString );
- strncat( (char*)temper, addString, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- } else {
- iField = AcStrlen( (char*)fieldValue) + 1;
- strncat( (char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- if (iField < fieldValueLen) {
- char* param = NULL;
- unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
- wspHeaderDecodeParameter( fieldValue + 1, fieldValueLen - 1, ¶m );
- if (param != NULL) {
- strncat( (char*)temper, ", ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- strncat( (char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- }
+ integerValue = wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen);
+
+ int count = sizeof(wspHeaderApplId)/sizeof(SMS_WSP_HEADER_PARAMETER_S);
+ for (int i = 0; i < count ; ++i) {
+ if ((unsigned int)integerValue == wspHeaderApplId[i].parameterCode) {
+ snprintf((char*)temp, 64, "%s", wspHeaderApplId[i].parameterToken);
+ strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
+ break;
}
}
- break;
+ }
+ break;
+ /* Accept-Application */
+ case 0x32:
+ if (0x80 == fieldValue[0]) {
+ strncat((char*)temper, "*", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
+ } else {
+ unsigned char temp[16];
+ /*
+ if ((fieldValueLen == 2) && (fieldValue[0] == 1))
+ AcSprintf((char*)temp, "%u", (unsigned int)fieldValue[0]);
+ else
+ */
+ snprintf((char*)temp, sizeof(temp), "%u", (unsigned int)wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen));
+ strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
+ }
+ break;
- /* Challenge */
- /* www - auth */
- case 0x2d:
- /* Proxy-authenticate */
- case 0x20:
- if (0 == fieldValueLen )
- break;
- if (fieldValue[0] == 0x80) {
- char* addString = NULL;
- unique_ptr<char*, void(*)(char**)> addStringbuf(&addString, unique_ptr_deleter);
- wspHeaderDecodeChallenge(fieldValueLen, fieldValue, &addString );
- strncat( (char*)temper, addString, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- } else {
- unsigned char authScheme[WSP_STANDARD_STR_LEN_MAX + 1];
- unsigned char realmValue[WSP_STANDARD_STR_LEN_MAX];
- unsigned char addedString[WSP_STANDARD_STR_LEN_MAX];
- strncpy( (char*)authScheme, (char*)fieldValue, WSP_STANDARD_STR_LEN_MAX -1);
- iField = AcStrlen( (char*)authScheme ) + 1;
- strncpy( (char*)realmValue, (char*)(fieldValue + iField ), WSP_STANDARD_STR_LEN_MAX-1);
- iField = iField + AcStrlen( (char*)realmValue ) + 1;
- snprintf( (char*)addedString, sizeof(addedString), "%s %s", authScheme, realmValue );
- wspHeaderCopyDecodedString( addedString, ¤tLength, &temper );
+ /* date */
+ /* last-modified */
+ case 0x1d:
+ /* if-unmodified-since */
+ case 0x1b:
+ /* if-range */
+ case 0x1a:
+ /* if-modified-since */
+ case 0x17:
+ /* expires */
+ case 0x14:
+ /* date */
+ case 0x12: {
+ char* decodedString = NULL;
+ unique_ptr<char*, void(*)(char**)> decodedStringbuf(&decodedString, unique_ptr_deleter);
+ wspHeaderDecodeDateValue(fieldValueLen, fieldValue, &decodedString);
+ strncat((char*)temper, (char*)decodedString, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
+ }
+ break;
- if (iField < fieldValueLen) {
- char* param = NULL;
- unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
- wspHeaderDecodeParameter( fieldValue + iField, fieldValueLen - iField, ¶m );
- if (param != NULL) {
- strncat( (char*)temper, ", ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- wspHeaderCopyDecodedString( (unsigned char*)param, ¤tLength, &temper );
- }
+ /* connection */
+ case 0x09:
+ if (fieldValue[0] == 0x80)
+ strncat((char*)temper, "Close", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
+ break;
+ /* accept-ranges */
+ case 0x04:
+ if (fieldValue[0] == 0x80)
+ strncat((char*)temper, "None", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
+ if (fieldValue[0] == 0x81)
+ strncat((char*)temper, "Bytes", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
+ break;
+ /* content-md5 */
+ case 0x0f: {
+ unsigned char temp[1275];
+ memcpy(temp, fieldValue, (size_t)fieldValueLen);
+ temp[fieldValueLen] = 0;
+ wspHeaderCopyDecodedString(temp, ¤tLength, &temper);
+ }
+ break;
+ /* Credential */
+ /* authorization */
+ case 0x07:
+ /* proxy - authorization */
+ case 0x21:
+ if (fieldValue[0] == 0x80) {
+ char* addString = NULL;
+ unique_ptr<char*, void(*)(char**)> addStringbuf(&addString, unique_ptr_deleter);
+ wspHeaderDecodeAuth(fieldValueLen, fieldValue, &addString);
+ strncat((char*)temper, addString, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ } else {
+ iField = AcStrlen((char*)fieldValue) + 1;
+
+ strncat((char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ if (iField < fieldValueLen) {
+ char* param = NULL;
+ unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
+ wspHeaderDecodeParameter(fieldValue + 1, fieldValueLen - 1, ¶m);
+ if (param != NULL) {
+ strncat((char*)temper, ", ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ strncat((char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
}
+ }
+ break;
+
+ /* Challenge */
+ /* www - auth */
+ case 0x2d:
+ /* Proxy-authenticate */
+ case 0x20:
+ if (0 == fieldValueLen)
break;
+ if (fieldValue[0] == 0x80) {
+ char* addString = NULL;
+ unique_ptr<char*, void(*)(char**)> addStringbuf(&addString, unique_ptr_deleter);
+ wspHeaderDecodeChallenge(fieldValueLen, fieldValue, &addString);
+ strncat((char*)temper, addString, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ } else {
+ unsigned char authScheme[WSP_STANDARD_STR_LEN_MAX + 1];
+ unsigned char realmValue[WSP_STANDARD_STR_LEN_MAX];
+ unsigned char addedString[WSP_STANDARD_STR_LEN_MAX];
+
+ strncpy((char*)authScheme, (char*)fieldValue, WSP_STANDARD_STR_LEN_MAX -1);
+ iField = AcStrlen((char*)authScheme) + 1;
+ strncpy((char*)realmValue, (char*)(fieldValue + iField), WSP_STANDARD_STR_LEN_MAX-1);
+ iField = iField + AcStrlen((char*)realmValue) + 1;
+ snprintf((char*)addedString, sizeof(addedString), "%s %s", authScheme, realmValue);
+ wspHeaderCopyDecodedString(addedString, ¤tLength, &temper);
+
+ if (iField < fieldValueLen) {
+ char* param = NULL;
+ unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
+ wspHeaderDecodeParameter(fieldValue + iField, fieldValueLen - iField, ¶m);
+ if (param != NULL) {
+ strncat((char*)temper, ", ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ wspHeaderCopyDecodedString((unsigned char*)param, ¤tLength, &temper);
+ }
+ }
+ }
+ break;
- /* content -range */
- case 0x10:
- {
- unsigned long first, len, last;
+ /* content -range */
+ case 0x10: {
+ unsigned long first, len, last;
- unsigned char temp[16];
- iField = 0;
+ unsigned char temp[16];
+ iField = 0;
- strncat( (char*)temper," bytes ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
+ strncat((char*)temper, " bytes ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- first = wspRetriveUintvarDecode( fieldValue, &iField );
- len = wspRetriveUintvarDecode( fieldValue, &iField );
- /* Originally range of HTTP include entity length. But WSP omit it. Finally to calculate this, it should be get content length from export. If this field is included without content length, then it can get wrong result. This content length can be get by calculating PDU length. */
- last = first + contentsLength - 1;
+ first = wspRetriveUintvarDecode(fieldValue, &iField);
+ len = wspRetriveUintvarDecode(fieldValue, &iField);
+ /* Originally range of HTTP include entity length. But WSP omit it. Finally to calculate this, it should be get content length from export. If this field is included without content length, then it can get wrong result. This content length can be get by calculating PDU length. */
+ last = first + contentsLength - 1;
- snprintf( (char*)temp, sizeof(temp), "%u-%u/%u", (unsigned int)first, (unsigned int)last, (unsigned int)len );
- strncat( (char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- }
- break;
+ snprintf((char*)temp, sizeof(temp), "%u-%u/%u", (unsigned int)first, (unsigned int)last, (unsigned int)len);
+ strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ break;
- /* cache-control */
- case 0x08:
- {
- char* cacheString = NULL;
- unique_ptr<char*, void(*)(char**)> cacheStringbuf(&cacheString, unique_ptr_deleter);
+ /* cache-control */
+ case 0x08: {
+ char* cacheString = NULL;
+ unique_ptr<char*, void(*)(char**)> cacheStringbuf(&cacheString, unique_ptr_deleter);
- wspHeaderDecodeCacheControl( fieldValue, fieldValueLen, &cacheString );
- strncat( (char*)temper, (char*)cacheString, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- }
- break;
+ wspHeaderDecodeCacheControl(fieldValue, fieldValueLen, &cacheString);
+ strncat((char*)temper, (char*)cacheString, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ break;
- /* pragma */
- case 0x1f:
- if (fieldValue[0] == 0x80) {
- strncat( (char*)temper, (char*)wspCacheControl[0], (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- } else {
- if (1 < fieldValueLen) {
- char* param = NULL;
- unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
- wspHeaderDecodeParameter( fieldValue, fieldValueLen, ¶m );
+ /* pragma */
+ case 0x1f:
+ if (fieldValue[0] == 0x80) {
+ strncat((char*)temper, (char*)wspCacheControl[0], (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ } else {
+ if (1 < fieldValueLen) {
+ char* param = NULL;
+ unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
+ wspHeaderDecodeParameter(fieldValue, fieldValueLen, ¶m);
- if (param != NULL) {
- strncat( (char*)temper, "; ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- strncat( (char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- }
+ if (param != NULL) {
+ strncat((char*)temper, "; ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ strncat((char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
}
- break;
-
- /* public */
- case 0x22:
- /* allow */
- case 0x06:
- {
- unsigned long i = 0;
- while ( wspHeaderDecodeIntegerByLength( fieldValue, fieldValueLen ) != wspMethodType[i].methodCode ) i++;
- strncat( (char*)temper, (char*)wspMethodType[i].methodName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- }
- break;
- /* range */
- case 0x23:
- strncat( (char*)temper, "bytes=", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- if (fieldValue[0] == 0x80) {
- unsigned char temp[16];
- unsigned long first, last;
- iField = 0;
-
- first = wspRetriveUintvarDecode( fieldValue, &iField );
- last = wspRetriveUintvarDecode( fieldValue, &iField );
-
- snprintf( (char*)temp, sizeof(temp), "%u-%u", (unsigned int)first, (unsigned int)last );
- strncat( (char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- }
- if (fieldValue[0] == 0x81) {
- unsigned char temp[16];
- unsigned long suffix;
+ }
+ break;
- suffix = wspRetriveUintvarDecode( fieldValue, &iField );
+ /* public */
+ case 0x22:
+ /* allow */
+ case 0x06: {
+ unsigned long i = 0;
+ while (wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen) != wspMethodType[i].methodCode) i++;
+ strncat((char*)temper, (char*)wspMethodType[i].methodName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ break;
+ /* range */
+ case 0x23:
+ strncat((char*)temper, "bytes=", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ if (fieldValue[0] == 0x80) {
+ unsigned char temp[16];
+ unsigned long first, last;
+ iField = 0;
+
+ first = wspRetriveUintvarDecode(fieldValue, &iField);
+ last = wspRetriveUintvarDecode(fieldValue, &iField);
+
+ snprintf((char*)temp, sizeof(temp), "%u-%u", (unsigned int)first, (unsigned int)last);
+ strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ if (fieldValue[0] == 0x81) {
+ unsigned char temp[16];
+ unsigned long suffix;
- snprintf( (char*)temp, sizeof(temp), "-%u", (unsigned int)suffix );
+ suffix = wspRetriveUintvarDecode(fieldValue, &iField);
- }
- break;
- /* retry-after */
- case 0x25:
- if (fieldValue[0] == 0x80) {
- char* temp = NULL;
- unique_ptr<char*, void(*)(char**)> tempbuf(&temp, unique_ptr_deleter);
-
- wspHeaderDecodeDateValue( fieldValueLen - 1, fieldValue + 1, &temp );
- strncat( (char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- }
+ snprintf((char*)temp, sizeof(temp), "-%u", (unsigned int)suffix);
+ }
+ break;
+ /* retry-after */
+ case 0x25:
+ if (fieldValue[0] == 0x80) {
+ char* temp = NULL;
+ unique_ptr<char*, void(*)(char**)> tempbuf(&temp, unique_ptr_deleter);
+
+ wspHeaderDecodeDateValue(fieldValueLen - 1, fieldValue + 1, &temp);
+ strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
- if (fieldValue[0] == 0x81) {
- unsigned char temp[16];
+ if (fieldValue[0] == 0x81) {
+ unsigned char temp[16];
- snprintf( (char*)temp, sizeof(temp), "%u", (unsigned int)wspHeaderDecodeIntegerByLength( fieldValue,fieldValueLen ));
- strncat( (char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- }
- break;
- /* transfer-encoding */
- case 0x27:
- /* No other cases allowed */
- if (fieldValue[0] == 0x80 )
- strncat( (char*)temper, "chunked", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
+ snprintf((char*)temp, sizeof(temp), "%u", (unsigned int)wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen));
+ strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ break;
+ /* transfer-encoding */
+ case 0x27:
+ /* No other cases allowed */
+ if (fieldValue[0] == 0x80)
+ strncat((char*)temper, "chunked", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- break;
- /* vary */
- case 0x2a:
- {
- int integerValue = wspHeaderDecodeIntegerByLength(fieldValue,fieldValueLen );
- if (integerValue > wspHeaderFieldCount) {
- MSG_DEBUG("WspLDecodeHeader: integerValue is over limit(0x%x).\n",wspHeaderFieldCount);
- break;
- }
- strncat( (char*)temper, (char*)wspHeaderFieldName[integerValue], (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
+ break;
+ /* vary */
+ case 0x2a: {
+ int integerValue = wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen);
+ if (integerValue > wspHeaderFieldCount) {
+ MSG_DEBUG("WspLDecodeHeader: integerValue is over limit(0x%x).\n", wspHeaderFieldCount);
+ break;
}
- break;
- /* warning */
- case 0x2c:
- {
- unsigned char temp[WSP_STANDARD_STR_LEN_MAX];
-
- if (fieldValue[0] < 0x20 )
- iField = fieldValue[0];
- else
- iField = 1;
-
- snprintf( (char*)temp, sizeof(temp), "%u", (unsigned int)wspHeaderDecodeIntegerByLength( fieldValue, iField ));
- strncat( (char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- if (iField < fieldValueLen) {
- unsigned char agent[WSP_STANDARD_STR_LEN_MAX];
- unsigned char text[WSP_STANDARD_STR_LEN_MAX];
- strncpy( (char*)agent, (char*)(fieldValue + iField ),WSP_STANDARD_STR_LEN_MAX-1);
- iField = iField + AcStrlen((char*)agent ) + 1;
- strncpy((char*)text, (char*)(fieldValue + iField ),WSP_STANDARD_STR_LEN_MAX-1);
- snprintf( (char*)temp, sizeof(temp), " %s %s", agent, text );
- wspHeaderCopyDecodedString( temp, ¤tLength, &temper );
- }
+ strncat((char*)temper, (char*)wspHeaderFieldName[integerValue], (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ break;
+ /* warning */
+ case 0x2c: {
+ unsigned char temp[WSP_STANDARD_STR_LEN_MAX];
+
+ if (fieldValue[0] < 0x20)
+ iField = fieldValue[0];
+ else
+ iField = 1;
+
+ snprintf((char*)temp, sizeof(temp), "%u", (unsigned int)wspHeaderDecodeIntegerByLength(fieldValue, iField));
+ strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ if (iField < fieldValueLen) {
+ unsigned char agent[WSP_STANDARD_STR_LEN_MAX];
+ unsigned char text[WSP_STANDARD_STR_LEN_MAX];
+ strncpy((char*)agent, (char*)(fieldValue + iField), WSP_STANDARD_STR_LEN_MAX-1);
+ iField = iField + AcStrlen((char*)agent) + 1;
+ strncpy((char*)text, (char*)(fieldValue + iField), WSP_STANDARD_STR_LEN_MAX-1);
+ snprintf((char*)temp, sizeof(temp), " %s %s", agent, text);
+ wspHeaderCopyDecodedString(temp, ¤tLength, &temper);
}
- break;
- /* content-disposition */
- case 0x2e:
- if (fieldValue[0] == 0x80 )
- strncat( (char*)temper, "form-data", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
-
- if (fieldValue[0] == 0x81 )
- strncat( (char*)temper, "attachment", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
-
- if (1 < fieldValueLen) {
- char* param = NULL;
- unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
- wspHeaderDecodeParameter( fieldValue + 1, fieldValueLen - 1, ¶m );
-
- if (param != NULL) {
- strncat( (char*)temper, "; ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- strncat( (char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
- }
+ }
+ break;
+ /* content-disposition */
+ case 0x2e:
+ if (fieldValue[0] == 0x80)
+ strncat((char*)temper, "form-data", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+
+ if (fieldValue[0] == 0x81)
+ strncat((char*)temper, "attachment", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+
+ if (1 < fieldValueLen) {
+ char* param = NULL;
+ unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
+ wspHeaderDecodeParameter(fieldValue + 1, fieldValueLen - 1, ¶m);
+
+ if (param != NULL) {
+ strncat((char*)temper, "; ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ strncat((char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
- break;
- /* Profile-diff */
- case 0x36:
- temper[AcStrlen((char*)temper) + fieldValueLen] = '\0';
- memcpy( temper, fieldValue, (size_t)fieldValueLen );
- break;
- /* Profile-Warning */
- case 0x37:
- {
- unsigned char temp[WSP_STANDARD_STR_LEN_MAX];
-
- snprintf( (char*)temp, sizeof(temp), "%lX", wspHeaderDecodeInteger(fieldValue ));
- temp[2] = temp[1];
- temp[1] = (unsigned char)0x30;
- temp[3] = '\0';
- if (fieldValueLen > 1) {
- /* copy warn-target - URI */
- strncat( (char*)temp, (char*)(fieldValue + 1), WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)temp)-1 );
- if (fieldValueLen > ( AcStrlen( (char*)(fieldValue + 1)) + 1 )) {
- /* copy warn-date */
- char* decodedString = NULL;
- unique_ptr<char*, void(*)(char**)> decodedStringbuf(&decodedString, unique_ptr_deleter);
- wspHeaderDecodeDateValue( fieldValueLen - ( AcStrlen( (char*)(fieldValue + 1)) + 2 ), fieldValue + AcStrlen( (char*)(fieldValue + 1)) + 1, &decodedString );
- strncat( (char*)temp, (char*)decodedString, WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)temp)-1 );
- }
+ }
+ break;
+ /* Profile-diff */
+ case 0x36:
+ temper[AcStrlen((char*)temper) + fieldValueLen] = '\0';
+ memcpy(temper, fieldValue, (size_t)fieldValueLen);
+ break;
+ /* Profile-Warning */
+ case 0x37: {
+ unsigned char temp[WSP_STANDARD_STR_LEN_MAX];
+
+ snprintf((char*)temp, sizeof(temp), "%lX", wspHeaderDecodeInteger(fieldValue));
+ temp[2] = temp[1];
+ temp[1] = (unsigned char)0x30;
+ temp[3] = '\0';
+ if (fieldValueLen > 1) {
+ /* copy warn-target - URI */
+ strncat((char*)temp, (char*)(fieldValue + 1), WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)temp)-1);
+ if (fieldValueLen > (AcStrlen((char*)(fieldValue + 1)) + 1)) {
+ /* copy warn-date */
+ char* decodedString = NULL;
+ unique_ptr<char*, void(*)(char**)> decodedStringbuf(&decodedString, unique_ptr_deleter);
+ wspHeaderDecodeDateValue(fieldValueLen - (AcStrlen((char*)(fieldValue + 1)) + 2), fieldValue + AcStrlen((char*)(fieldValue + 1)) + 1, &decodedString);
+ strncat((char*)temp, (char*)decodedString, WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)temp)-1);
}
- strncat( (char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
}
- break;
-
- default:
- break;
+ strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
+ break;
+
+ default:
+ break;
}
- }
+ /*}*/
}
/* It deosn't finished decoding yet. */
- if (( iEncodedHeader < encodedHeaderLen ) && ( fieldCode != 0xff )) {
+ if ((iEncodedHeader < encodedHeaderLen) && (fieldCode != 0xff)) {
/* In here, iEncodedHeader already point next field code to be decoded. */
/* If this code is same, then set continueField else add CRLF. */
- if (fieldCode == (encodedHeader[iEncodedHeader] & 0x7f )) {
- strncat( (char*)temper, ", ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
+ if (fieldCode == (encodedHeader[iEncodedHeader] & 0x7f)) {
+ strncat((char*)temper, ", ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
continueField = TRUE;
} else {
- strncat( (char*)temper, "\r\n", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
+ strncat((char*)temper, "\r\n", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
continueField = FALSE;
}
} else {
- strncat( (char*)temper, "\r\n", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1 );
+ strncat((char*)temper, "\r\n", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
/* add single header to total headers */
- strncat( (char*)outTemper, (char*)temper, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)outTemper)-1 );
- MSG_DEBUG("WspLDecodeHeader: Single Header : %s\r\n", temper );
-
+ strncat((char*)outTemper, (char*)temper, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)outTemper)-1);
+ MSG_DEBUG("WspLDecodeHeader: Single Header : %s\r\n", temper);
}
- MSG_DEBUG("WspLDecodeHeader: Header decoding ended.\n" );
+ MSG_DEBUG("WspLDecodeHeader: Header decoding ended.\n");
*pHeader = outTemper;
return;
-
}
-unsigned long SmsPluginWapPushHandler::wspHeaderDecodeInteger( unsigned char* data )
+unsigned long SmsPluginWapPushHandler::wspHeaderDecodeInteger(unsigned char* data)
{
/* we only can handle max 32bit integer */
unsigned long i;
if (data[0] < 0x80) {
unsigned long IntLen = 0;
- IntLen = (data[0]>0x04) ? 0x04:data[0];
+ IntLen = (data[0] > 0x04) ? 0x04:data[0];
MSG_DEBUG("WspLHeaderDecodeInteger: input %d , length %d\n", data[0], IntLen);
- for (i=0; i<IntLen; i++)
- returner.seg[IntLen-( i+1)] = data[i+1];
+ for (i = 0; i < IntLen; i++)
+ returner.seg[IntLen-(i+1)] = data[i+1];
return returner.integer;
}
}
-void SmsPluginWapPushHandler::wspHeaderDecodeQValue( unsigned long length, unsigned char* data, char** pDecodedString)
+void SmsPluginWapPushHandler::wspHeaderDecodeQValue(unsigned long length, unsigned char* data, char** pDecodedString)
{
unsigned short qBase = 0;
float qValue;
return;
}
- memcpy( &qBase, data, (size_t)length );
+ memcpy(&qBase, data, (size_t)length);
qValue = (float)qBase;
if (qValue > 100) {
qValue = qValue - 100;
qValue = qValue / 1000;
- sprintf( (char*)*pDecodedString, "; q=%.3f", qValue );
+ sprintf((char*)*pDecodedString, "; q=%.3f", qValue);
} else {
/* qValue variable is divided by 100. And it's multiplied by 100.
It's to resolve problem of changed 0.01 of qValue. */
qValue = qValue - 1;
qValue = qValue / 100;
qValueTemp = (unsigned long)(qValue * 100);
- if (0 == (qValueTemp % 10 ))
- sprintf( (char*)*pDecodedString, "; q=%.1f", qValue );
+ if (0 == (qValueTemp % 10))
+ sprintf((char*)*pDecodedString, "; q=%.1f", qValue);
else
- sprintf( (char*)*pDecodedString, "; q=%.2f", qValue );
+ sprintf((char*)*pDecodedString, "; q=%.2f", qValue);
}
return;
}
-unsigned long SmsPluginWapPushHandler::wspHeaderDecodeIntegerByLength(unsigned char* data, unsigned long length )
+unsigned long SmsPluginWapPushHandler::wspHeaderDecodeIntegerByLength(unsigned char* data, unsigned long length)
{
unsigned long i;
returner.integer = 0;
- if (length == 1 )
+ if (length == 1)
return data[0] & 0x7f;
returner.integer = 0;
for (i = 0 ; i < length; i++) {
- returner.integer = returner.integer + ( data[i] * (0x1 << ( ( length - ( i + 1)) * 8 )));
- MSG_DEBUG("WspLHeaderDecodeIntegerByLength: %d \n", returner.integer );
+ returner.integer = returner.integer + (data[i] * (0x1 << ((length - (i + 1)) * 8)));
+ MSG_DEBUG("WspLHeaderDecodeIntegerByLength: %d \n", returner.integer);
}
return returner.integer;
}
-char* SmsPluginWapPushHandler::wspExtendedDecodeType(char contentType )
+char* SmsPluginWapPushHandler::wspExtendedDecodeType(char contentType)
{
int i = 0;
- while ( wspExtendedContentsType[i].contentsTypeCode != contentType) {
+ while (wspExtendedContentsType[i].contentsTypeCode != contentType) {
if (wspExtendedContentsType[i].contentsTypeCode == 0xff)
return NULL;
i++;
}
-void SmsPluginWapPushHandler::wspHeaderDecodeParameter( unsigned char* data, unsigned long length, char** pParam)
+void SmsPluginWapPushHandler::wspHeaderDecodeParameter(unsigned char* data, unsigned long length, char** pParam)
{
char* param = *pParam;
param = new char[WSP_STANDARD_STR_LEN_MAX];
if (param == NULL) {
- MSG_DEBUG("WspLHeaderDecodeParameter:MemAlloc failed\n" );
+ MSG_DEBUG("WspLHeaderDecodeParameter:MemAlloc failed\n");
return;
}
- strncpy( (char*)param, (char*)data, WSP_STANDARD_STR_LEN_MAX - 1);
+ strncpy((char*)param, (char*)data, WSP_STANDARD_STR_LEN_MAX - 1);
- if (NO_VALUE == data[AcStrlen( (char*)param ) + 1]) {
+ if (NO_VALUE == data[AcStrlen((char*)param) + 1]) {
*pParam = param;
return;
}
- strncat( (char*)param, "=", WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)param)-1 );
- strncat( (char*)param, (char*)(data + AcStrlen( (char*)param )), WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)param)-1);
+ strncat((char*)param, "=", WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)param)-1);
+ strncat((char*)param, (char*)(data + AcStrlen((char*)param)), WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)param)-1);
*pParam = param;
switch (data[0] & 0x7f) {
case 0x00:
- wspHeaderDecodeQValue( length - 1, data + 1, ¶m);
+ wspHeaderDecodeQValue(length - 1, data + 1, ¶m);
break;
case 0x01:
- wspHeaderDecodeCharset( length - 1 , data + 1, ¶m);
+ wspHeaderDecodeCharset(length - 1 , data + 1, ¶m);
break;
case 0x02:
- wspHeaderDecodeVersion( length - 1, data + 1, ¶m);
+ wspHeaderDecodeVersion(length - 1, data + 1, ¶m);
break;
/* integer */
case 0x03:
- /* param = (unsigned char *)malloc( (size_t)WSP_STANDARD_STR_LEN_MAX ); */
+ /* param = (unsigned char *)malloc((size_t)WSP_STANDARD_STR_LEN_MAX); */
param = new char[WSP_STANDARD_STR_LEN_MAX];
if (param == NULL) {
MSG_DEBUG("WspLHeaderDecodeParameter: 0x03 MemAlloc failed\n");
return;
} else {
- sprintf( (char*)param, "Type=%i", (int)wspHeaderDecodeInteger( data + 1 ));
+ sprintf((char*)param, "Type=%i", (int)wspHeaderDecodeInteger(data + 1));
}
break;
case 0x08:
MSG_DEBUG("WspLHeaderDecodeParameter:0x08 MemAlloc failed\n");
return;
} else {
- sprintf( (char*)param, "Padding=%i", (int)wspHeaderDecodeInteger( data + 1 ));
+ sprintf((char*)param, "Padding=%i", (int)wspHeaderDecodeInteger(data + 1));
}
break;
case 0x05:
MSG_DEBUG("WspLHeaderDecodeParameter:0x05 MemAlloc failed\n");
return;
} else {
- strncpy( (char*)param, "Name=", WSP_STANDARD_STR_LEN_MAX-1);
- memcpy( param + 5, data + 1, length - 1 );
+ strncpy((char*)param, "Name=", WSP_STANDARD_STR_LEN_MAX-1);
+ memcpy(param + 5, data + 1, length - 1);
param[5 + length - 1] = '\0';
}
break;
MSG_DEBUG("WspLHeaderDecodeParameter:0x06 MemAlloc failed\n");
return;
} else {
- strncpy( (char*)param, "Filename=", WSP_STANDARD_STR_LEN_MAX-1);
- memcpy( param + 9, (char*)(data + 1), (size_t)(length - 1) );
+ strncpy((char*)param, "Filename=", WSP_STANDARD_STR_LEN_MAX-1);
+ memcpy(param + 9, (char*)(data + 1), (size_t)(length - 1));
param[9 + length - 1] = '\0';
}
break;
} else {
strncpy((char*)param, "SEC=", WSP_STANDARD_STR_LEN_MAX-1);
SecurityTypeCode = data[1] & 0x7f;
- while (( i < wspSecurityTypeCount ) && ( wspSecurityType[i].SecurityTypeCode != SecurityTypeCode ))
+ while ((i < wspSecurityTypeCount) && (wspSecurityType[i].SecurityTypeCode != SecurityTypeCode))
i++;
if (i < wspSecurityTypeCount) {
- strncat( (char*)param, (char*)wspSecurityType[i].SecurityTypeName, WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)param)-1);
+ strncat((char*)param, (char*)wspSecurityType[i].SecurityTypeName, WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)param)-1);
}
if (0x12 == (data[2] & 0x7f)) {
- strncat( (char*)param, "; MAC=", WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)param)-1 );
- memcpy(param+AcStrlen( (char*)param),(char*)(data+3),(size_t)length-3 );
+ strncat((char*)param, "; MAC=", WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)param)-1);
+ memcpy(param+AcStrlen((char*)param), (char*)(data+3), (size_t)length-3);
}
}
break;
}
-void SmsPluginWapPushHandler::wspHeaderDecodeCharset( unsigned long length, unsigned char* data, char**pDecodedString)
+void SmsPluginWapPushHandler::wspHeaderDecodeCharset(unsigned long length, unsigned char* data, char**pDecodedString)
{
-
*pDecodedString = new char[WSP_STANDARD_STR_LEN_MAX];
if (*pDecodedString == NULL) {
return;
}
- strncpy( (char*)*pDecodedString, "charset=", WSP_STANDARD_STR_LEN_MAX-1);
+ strncpy((char*)*pDecodedString, "charset=", WSP_STANDARD_STR_LEN_MAX-1);
if (data[0] > 0x80) {
- unsigned long code = wspHeaderDecodeInteger(data );
+ unsigned long code = wspHeaderDecodeInteger(data);
unsigned long i = 0;
while (wspCharset[i].charsetCode != code) {
if (wspCharset[i].charsetCode == 0xffff) {
}
i++;
}
- strncat( (char*)*pDecodedString, (char*)wspCharset[i].charsetName, WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)*pDecodedString)-1 );
+ strncat((char*)*pDecodedString, (char*)wspCharset[i].charsetName, WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)*pDecodedString)-1);
} else {
unsigned long lastLen = AcStrlen((char*)*pDecodedString);
- memcpy( (char*)(*pDecodedString + lastLen), data, (size_t)length );
+ memcpy((char*)(*pDecodedString + lastLen), data, (size_t)length);
*pDecodedString[length + lastLen] = '\0';
}
}
-void SmsPluginWapPushHandler::wspHeaderDecodeVersion( unsigned long length, unsigned char* data, char** pDecodedString )
+void SmsPluginWapPushHandler::wspHeaderDecodeVersion(unsigned long length, unsigned char* data, char** pDecodedString)
{
*pDecodedString = new char[WSP_STANDARD_STR_LEN_MAX];
if (length > 1) {
/* untyped version */
- memcpy( *pDecodedString, data, (size_t)length );
+ memcpy(*pDecodedString, data, (size_t)length);
} else {
/* typed version */
- unsigned char majorVer = ((data[0] & 0x7f ) >> 4 );
+ unsigned char majorVer = ((data[0] & 0x7f) >> 4);
unsigned char minorVer = data[0] & 0x0f;
- sprintf( (char*)*pDecodedString, "level=%u.%u", majorVer, minorVer );
+ sprintf((char*)*pDecodedString, "level=%u.%u", majorVer, minorVer);
}
return;
}
-void SmsPluginWapPushHandler::wspHeaderDecodeDateValue( unsigned long length, unsigned char* data, char** pDecodedString )
+void SmsPluginWapPushHandler::wspHeaderDecodeDateValue(unsigned long length, unsigned char* data, char** pDecodedString)
{
time_t lTime;
struct tm* pTMData;
- MSG_DEBUG("WspLHeaderDecodeDateValue: \n" );
+ MSG_DEBUG("WspLHeaderDecodeDateValue: \n");
*pDecodedString = new char[WSP_STANDARD_STR_LEN_MAX];
if (*pDecodedString == NULL) {
- MSG_DEBUG( "WspLHeaderDecodeDateValue:MemAlloc failed\n");
+ MSG_DEBUG("WspLHeaderDecodeDateValue:MemAlloc failed\n");
return;
}
lTime = wspHeaderDecodeIntegerByLength(data, length);
- pTMData = (struct tm*)gmtime((const time_t* )&lTime);
+ pTMData = (struct tm*)gmtime((const time_t*)&lTime);
if (pTMData == NULL) {
- MSG_DEBUG( "WspLHeaderDecodeDateValue: Date decode fail \n" );
- strncpy( (char*)*pDecodedString, "Decoding Failed", WSP_STANDARD_STR_LEN_MAX-1);
+ MSG_DEBUG("WspLHeaderDecodeDateValue: Date decode fail \n");
+ strncpy((char*)*pDecodedString, "Decoding Failed", WSP_STANDARD_STR_LEN_MAX-1);
return;
}
/* check date value validity */
- {
- if (( pTMData->tm_wday > 6 ) || (pTMData->tm_mon > 11 ) || (pTMData->tm_mday > 31 )) {
- MSG_DEBUG( "WspLHeaderDecodeDateValue: Date decode fail %d, %d, %d \n", pTMData->tm_wday, pTMData->tm_mon, pTMData->tm_mday );
- strncpy( (char*)*pDecodedString, "Decoding Failed", WSP_STANDARD_STR_LEN_MAX-1);
- return;
- }
+ if ((pTMData->tm_wday > 6) || (pTMData->tm_mon > 11) || (pTMData->tm_mday > 31)) {
+ MSG_DEBUG("WspLHeaderDecodeDateValue: Date decode fail %d, %d, %d \n", pTMData->tm_wday, pTMData->tm_mon, pTMData->tm_mday);
+ strncpy((char*)*pDecodedString, "Decoding Failed", WSP_STANDARD_STR_LEN_MAX-1);
+ return;
}
#ifdef MSG_FW_FOR_DEBUG
switch (wspMachineStatus.dateType) {
/* UNIX asciitime function */
case UNIX_DATE_TYPE:
- snprintf( (char*)decodedString, sizeof(decodedString), "%s %s %-2u %u:%u:%u %u GMT", wspWeek[pTMData->tm_wday], wspMonth[pTMData->tm_mon],
- pTMData->tm_mday, pTMData->tm_hour, pTMData->tm_min, pTMData->tm_sec, pTMData->tm_year + 1900 );
+ snprintf((char*)decodedString, sizeof(decodedString), "%s %s %-2u %u:%u:%u %u GMT", wspWeek[pTMData->tm_wday], wspMonth[pTMData->tm_mon],
+ pTMData->tm_mday, pTMData->tm_hour, pTMData->tm_min, pTMData->tm_sec, pTMData->tm_year + 1900);
break;
case RFC1123_DATE_TYPE:
- snprintf( (char*)decodedString, sizeof(decodedString), "%s, %u %s %u %u:%u:%u GMT", wspWeek[pTMData->tm_wday], pTMData->tm_mday,
- wspMonth[pTMData->tm_mon], pTMData->tm_year + 1900, pTMData->tm_hour, pTMData->tm_min, pTMData->tm_sec );
+ snprintf((char*)decodedString, sizeof(decodedString), "%s, %u %s %u %u:%u:%u GMT", wspWeek[pTMData->tm_wday], pTMData->tm_mday,
+ wspMonth[pTMData->tm_mon], pTMData->tm_year + 1900, pTMData->tm_hour, pTMData->tm_min, pTMData->tm_sec);
break;
case RFC850_DATE_TYPE:
/* Have some Y2K Problems */
/* In RFC 850, date is represented like 11-May-99. So Y2K problem always can be occured. So remainer (year divided by 100) is used. */
- snprintf( (char*)decodedString, sizeof(decodedString), "%s, %2u-%s-%2u %u:%u:%u GMT", wspWeekDay[pTMData->tm_wday], pTMData->tm_mday,
- wspMonth[pTMData->tm_mon], pTMData->tm_year % CENTURY, pTMData->tm_hour, pTMData->tm_min, pTMData->tm_sec );
+ snprintf((char*)decodedString, sizeof(decodedString), "%s, %2u-%s-%2u %u:%u:%u GMT", wspWeekDay[pTMData->tm_wday], pTMData->tm_mday,
+ wspMonth[pTMData->tm_mon], pTMData->tm_year % CENTURY, pTMData->tm_hour, pTMData->tm_min, pTMData->tm_sec);
break;
}
#endif
/*UNIX_DATE_TYPE : */
- snprintf( (char*)*pDecodedString, (sizeof(char)*WSP_STANDARD_STR_LEN_MAX), "%s %s %-2u %u:%u:%u %u GMT", wspWeek[pTMData->tm_wday], wspMonth[pTMData->tm_mon],
- pTMData->tm_mday, pTMData->tm_hour, pTMData->tm_min, pTMData->tm_sec, pTMData->tm_year + 1900 );
+ snprintf((char*)*pDecodedString, (sizeof(char)*WSP_STANDARD_STR_LEN_MAX), "%s %s %-2u %u:%u:%u %u GMT", wspWeek[pTMData->tm_wday], wspMonth[pTMData->tm_mon],
+ pTMData->tm_mday, pTMData->tm_hour, pTMData->tm_min, pTMData->tm_sec, pTMData->tm_year + 1900);
return;
-
}
-void SmsPluginWapPushHandler::wspHeaderCopyDecodedString( unsigned char* szDecodedString, unsigned long* currentLen, char** pTemper )
+void SmsPluginWapPushHandler::wspHeaderCopyDecodedString(unsigned char* szDecodedString, unsigned long* currentLen, char** pTemper)
{
- unsigned long elementLen = AcStrlen( (char*)szDecodedString );
+ unsigned long elementLen = AcStrlen((char*)szDecodedString);
char* temper2 = NULL;
/* CR+LF */
*currentLen = *currentLen + elementLen + 2;
- if ( *currentLen > AcStrlen( (char*)* pTemper ) + 2) {
- temper2 = new char[(*currentLen + 1 )];
+ if (*currentLen > AcStrlen((char*)* pTemper) + 2) {
+ temper2 = new char[(*currentLen + 1)];
if (temper2 == NULL) {
- MSG_DEBUG( "WspLHeaderCopyDecodedString:MemAlloc failed\n");
+ MSG_DEBUG("WspLHeaderCopyDecodedString:MemAlloc failed\n");
return;
}
- strncpy( (char*)temper2, (char*)* pTemper, *currentLen);
+ strncpy((char*)temper2, (char*)* pTemper, *currentLen);
delete[] *pTemper;
- strncpy( (char*)temper2, (char*)szDecodedString, *currentLen);
+ strncpy((char*)temper2, (char*)szDecodedString, *currentLen);
}
*pTemper = temper2;
}
-void SmsPluginWapPushHandler::wspHeaderDecodeAuth(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString )
+void SmsPluginWapPushHandler::wspHeaderDecodeAuth(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString)
{
unsigned char userId[WSP_STANDARD_STR_LEN_MAX];
unsigned char passWd[WSP_STANDARD_STR_LEN_MAX];
*pDecodedString = new char[WSP_STANDARD_STR_LEN_MAX * 2];
if (*pDecodedString == NULL) {
- MSG_DEBUG("WspLHeaderDecodeAuth:MemAlloc failed\n" );
+ MSG_DEBUG("WspLHeaderDecodeAuth:MemAlloc failed\n");
return;
}
iField++;
memset(authStr, 0x00, sizeof(authStr));
snprintf(authStr, sizeof(authStr), "%%%ds", sizeof(userId));
- sscanf((char*)(fieldValue + iField), authStr, userId );
- iField = iField + AcStrlen( (char*)userId ) + 1;
+ sscanf((char*)(fieldValue + iField), authStr, userId);
+ iField = iField + AcStrlen((char*)userId) + 1;
memset(authStr, 0x00, sizeof(authStr));
snprintf(authStr, sizeof(authStr), "%%%ds", sizeof(passWd));
- sscanf( (char*)(fieldValue + iField), authStr, passWd );
- iField = iField + AcStrlen( (char*)userId ) + 1;
- snprintf( (char*)*pDecodedString, (sizeof(char)*WSP_STANDARD_STR_LEN_MAX*2), "basic %s/%s", userId, passWd );
+ sscanf((char*)(fieldValue + iField), authStr, passWd);
+ iField = iField + AcStrlen((char*)userId) + 1;
+ snprintf((char*)*pDecodedString, (sizeof(char)*WSP_STANDARD_STR_LEN_MAX*2), "basic %s/%s", userId, passWd);
return;
}
-void SmsPluginWapPushHandler::wspHeaderDecodeChallenge(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString )
+void SmsPluginWapPushHandler::wspHeaderDecodeChallenge(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString)
{
unsigned char userId[WSP_STANDARD_STR_LEN_MAX];
unsigned long iField = 0;
*pDecodedString = new char[WSP_STANDARD_STR_LEN_MAX];
if (*pDecodedString == NULL) {
- MSG_DEBUG( "WspLHeaderDecodeChallenge:MemAlloc failed\n");
+ MSG_DEBUG("WspLHeaderDecodeChallenge:MemAlloc failed\n");
return;
}
iField++;
memset(authStr, 0x00, sizeof(authStr));
snprintf(authStr, sizeof(authStr), "%%%ds", sizeof(userId));
- sscanf( (char*)(fieldValue + iField), authStr, userId );
- iField = iField + AcStrlen( (char*)userId ) + 1;
+ sscanf((char*)(fieldValue + iField), authStr, userId);
+ iField = iField + AcStrlen((char*)userId) + 1;
- snprintf( (char*)*pDecodedString, (sizeof(char)*WSP_STANDARD_STR_LEN_MAX), "basic realm=\"%s\"", userId );
+ snprintf((char*)*pDecodedString, (sizeof(char)*WSP_STANDARD_STR_LEN_MAX), "basic realm=\"%s\"", userId);
return;
}
*pCacheString = new char[WSP_STANDARD_STR_LEN_MAX];
if (*pCacheString == NULL) {
- MSG_DEBUG( "WspLHeaderDecodeCacheControl:MemAlloc failed\n");
+ MSG_DEBUG("WspLHeaderDecodeCacheControl:MemAlloc failed\n");
return;
}
if (fieldValue[0] > 0x8b) {
return; /* It's error detection. can be omitted. */
}
- strncpy( (char*)*pCacheString, (char*)wspCacheControl[fieldValue[0] & 0x7f], WSP_STANDARD_STR_LEN_MAX-1);
+ strncpy((char*)*pCacheString, (char*)wspCacheControl[fieldValue[0] & 0x7f], WSP_STANDARD_STR_LEN_MAX-1);
return;
}
case 0x07:
if (fieldValue[1] > 0x7f) {
/* well known field name */
- strncpy( (char*)paramString, (char*)wspHeaderFieldName[fieldValue[1] & 0x7f],WSP_STANDARD_STR_LEN_MAX-1 );
+ strncpy((char*)paramString, (char*)wspHeaderFieldName[fieldValue[1] & 0x7f], WSP_STANDARD_STR_LEN_MAX-1);
paramString[WSP_STANDARD_STR_LEN_MAX-1] = '\0';
} else {
/* unknown field name */
- strncpy( (char*)paramString, (char*)fieldValue + 1 , WSP_STANDARD_STR_LEN_MAX-1);
+ strncpy((char*)paramString, (char*)fieldValue + 1 , WSP_STANDARD_STR_LEN_MAX-1);
}
break;
/* secound */
case 0x03:
/* min-fresh */
case 0x04:
- snprintf( (char*)paramString, sizeof(paramString), "%u", (unsigned int)wspHeaderDecodeInteger( fieldValue + 1));
+ snprintf((char*)paramString, sizeof(paramString), "%u", (unsigned int)wspHeaderDecodeInteger(fieldValue + 1));
break;
default:
break;
}
- snprintf((char*)*pCacheString, (sizeof(char)*WSP_STANDARD_STR_LEN_MAX), "%s=%s", (char*)wspCacheControl[cacheCode], (char*)paramString );
+ snprintf((char*)*pCacheString, (sizeof(char)*WSP_STANDARD_STR_LEN_MAX), "%s=%s", (char*)wspCacheControl[cacheCode], (char*)paramString);
} else {
/* cache extentions */
/* In case of come directive of doesn't specified string style */
unsigned long stringLen;
char szString[32];
- strncpy( (char*)*pCacheString, (char*)fieldValue, WSP_STANDARD_STR_LEN_MAX-1);
- stringLen = AcStrlen((char*)*pCacheString );
+ strncpy((char*)*pCacheString, (char*)fieldValue, WSP_STANDARD_STR_LEN_MAX-1);
+ stringLen = AcStrlen((char*)*pCacheString);
if (stringLen + 1 < fieldValueLen) {
-
if (fieldValue[stringLen+ 1] > 0x7f) {
- int untyped = (int)wspHeaderDecodeIntegerByLength( fieldValue + stringLen + 1, fieldValueLen - (stringLen + 1 ));
+ int untyped = (int)wspHeaderDecodeIntegerByLength(fieldValue + stringLen + 1, fieldValueLen - (stringLen + 1));
- snprintf( szString, sizeof(szString), "%d", untyped );
- strncat( (char*)*pCacheString, (char*)"=", WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)*pCacheString)-1 );
- strncat( (char*)*pCacheString, (char*)szString, WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)*pCacheString)-1 );
+ snprintf(szString, sizeof(szString), "%d", untyped);
+ strncat((char*)*pCacheString, (char*)"=", WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)*pCacheString)-1);
+ strncat((char*)*pCacheString, (char*)szString, WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)*pCacheString)-1);
} else {
if (fieldValue[fieldValueLen] == 0) {
- strncat( (char*)*pCacheString, (char*)"=", WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)*pCacheString)-1 );
- strncat( (char*)*pCacheString, (char*)fieldValue + stringLen + 1 , WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)*pCacheString)-1);
+ strncat((char*)*pCacheString, (char*)"=", WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)*pCacheString)-1);
+ strncat((char*)*pCacheString, (char*)fieldValue + stringLen + 1 , WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)*pCacheString)-1);
}
}
}
class SmsPluginMsgCodec
{
public:
-
static SmsPluginMsgCodec* instance();
static bool checkInvalidPDU(const unsigned char *p_pkg_str, const int p_pkg_len);
int MakeWapUserData(unsigned short msgId, char **ppTotalData);
bool checkCbOpt(sms_trans_svc_ctg_t svc_ctg);
-
};
#endif /* SMS_CDMA_PLUGIN_EVENT_HANDLER_H */
class SmsPluginParamCodec
{
public:
-
static SmsPluginParamCodec* instance();
static int convertDigitToBcd(char *pDigit, int DigitLen, unsigned char *pBcd);
SMS_STATUS_PERMANENT_INVALID_DESTINATION = 0xCA,
SMS_STATUS_PERMANENT_MESSAGE_EXPIRED = 0xCD,
SMS_STATUS_PERMANENT_UNKNOWN_ERROR = 0xDF,
-
}sms_status_code_t;
#define WSP_CODE_BUFFER_LEFT_LEN_MAX 1024
#define WSP_CODE_BUFFER_RIGHT_LEN_MAX 2048
-#define AcStrlen(x) ((x==NULL)?0:strlen(x))
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+#define AcStrlen(x) ((x == NULL)?0:strlen(x))
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
/*==================================================================================================
msg_push_action_t convertSIActionStrToEnum(char* pAction);
msg_push_action_t convertSLActionStrToEnum(char* pAction);
- unsigned long wspRetriveUintvarDecode( unsigned char* sourceData, unsigned long* currentPointer );
- unsigned long wspDecodeUintvar(unsigned long length, unsigned char* userVar );
- void wspDecodeHeader( unsigned char* sEncodedHeader, unsigned long encodedHeaderLen, unsigned long contentsLength, bool fContentType, char** pHeader);
- unsigned long wspHeaderDecodeInteger( unsigned char* data );
- void wspHeaderDecodeQValue( unsigned long length, unsigned char* data, char** pDecodedString);
- unsigned long wspHeaderDecodeIntegerByLength(unsigned char* data, unsigned long length );
- char* wspExtendedDecodeType(char contentType );
- void wspHeaderDecodeParameter( unsigned char* data, unsigned long length, char** pParam);
- void wspHeaderDecodeCharset( unsigned long length, unsigned char* data, char**pDecodedString);
- void wspHeaderDecodeVersion( unsigned long length, unsigned char* data, char** pDecodedString );
- void wspHeaderDecodeDateValue( unsigned long length, unsigned char* data, char** pDecodedString );
- void wspHeaderCopyDecodedString( unsigned char* szDecodedString, unsigned long* currentLen, char** pTemper );
- void wspHeaderDecodeAuth(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString );
- void wspHeaderDecodeChallenge(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString );
+ unsigned long wspRetriveUintvarDecode(unsigned char* sourceData, unsigned long* currentPointer);
+ unsigned long wspDecodeUintvar(unsigned long length, unsigned char* userVar);
+ void wspDecodeHeader(unsigned char* sEncodedHeader, unsigned long encodedHeaderLen, unsigned long contentsLength, bool fContentType, char** pHeader);
+ unsigned long wspHeaderDecodeInteger(unsigned char* data);
+ void wspHeaderDecodeQValue(unsigned long length, unsigned char* data, char** pDecodedString);
+ unsigned long wspHeaderDecodeIntegerByLength(unsigned char* data, unsigned long length);
+ char* wspExtendedDecodeType(char contentType);
+ void wspHeaderDecodeParameter(unsigned char* data, unsigned long length, char** pParam);
+ void wspHeaderDecodeCharset(unsigned long length, unsigned char* data, char**pDecodedString);
+ void wspHeaderDecodeVersion(unsigned long length, unsigned char* data, char** pDecodedString);
+ void wspHeaderDecodeDateValue(unsigned long length, unsigned char* data, char** pDecodedString);
+ void wspHeaderCopyDecodedString(unsigned char* szDecodedString, unsigned long* currentLen, char** pTemper);
+ void wspHeaderDecodeAuth(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString);
+ void wspHeaderDecodeChallenge(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString);
void wspHeaderDecodeCacheControl(unsigned char* fieldValue, unsigned long fieldValueLen, char** pCacheString);
MSG_FATAL("%s", e.what());
return;
}
-
}
SMS_NETWORK_STATUS_T convertTapiRespToSmsPlugin(int result)
MSG_FATAL("%s", e.what());
return;
}
-
}
void TapiEventSatSmsSentStatus(TapiHandle *handle, int result, void *data, void *user_data)
}
SmsPluginSimMsg::instance()->setSimMsgCntEvent(handle, (MSG_SIM_COUNT_S *)data);
-
}
/* Reading TelSmsDatapackageInfo_t */
if (pSmsTpdu->SmsData.MsgLength > MAX_TPDU_DATA_LEN) {
- MSG_DEBUG ("WARNING: tpdu_len > MAX_SMS_TPDU_SIZE [%d] bytes. setting to 0.", pSmsTpdu->SmsData.MsgLength);
+ MSG_DEBUG("WARNING: tpdu_len > MAX_SMS_TPDU_SIZE [%d] bytes. setting to 0.", pSmsTpdu->SmsData.MsgLength);
SmsPluginSimMsg::instance()->setSimMsgEvent(handle, NULL, false);
/* Call Event Handler */
SmsPluginSimMsg::instance()->setSimMsgEvent(handle, &msgInfo, true);
-
-
}
int sim_id = *((int*)data);
SmsPluginSimMsg::instance()->setDelSimEvent(sim_id, true);
-
}
SmsPluginSimMsg::instance()->setSimEvent(0, bRet);
else
SmsPluginSetting::instance()->setResultFromSim(bRet);
-
}
paramCnt = *((int*)data);
SmsPluginSetting::instance()->setParamCntEvent(paramCnt);
-
}
#if 0
/*Get the DCS value*/
- if (0x00 == (0x08 & smsParam->ParamIndicator))
- {
+ if (0x00 == (0x08 & smsParam->ParamIndicator)) {
smscList.smscData[index].dcs = smsParam->TpDataCodingScheme;
MSG_DEBUG("dcs : %d", smscList.smscData[index].dcs);
- }
- else
- {
+ } else {
smscList.smscData[index].dcs = MSG_ENCODE_GSM7BIT;
MSG_DEBUG("DCS is not present");
}
}
TelSimMailboxList_t *list = (TelSimMailboxList_t *)data;
- SMS_SIM_MAILBOX_LIST_S mbList = {0,};
+ SMS_SIM_MAILBOX_LIST_S mbList = {0, };
if (list->count <= 0) {
MSG_INFO("Mailbox list is empty");
}
TelSimMessageWaitingResp_t *MwiInfo = (TelSimMessageWaitingResp_t *)data;
- SMS_SIM_MWI_INFO_S simMwiInfo = {0,};
+ SMS_SIM_MWI_INFO_S simMwiInfo = {0, };
memcpy(&simMwiInfo, MwiInfo, sizeof(SMS_SIM_MWI_INFO_S));
}
MSG_DEBUG("Setting result = [%d]", err);
- if (svct->table.sst.service[TAPI_SIM_SST_MO_SMS_CTRL_BY_SIM] == 1){
+ if (svct->table.sst.service[TAPI_SIM_SST_MO_SMS_CTRL_BY_SIM] == 1) {
err = MsgSettingSetBool(moCtrlKey, true);
} else {
err = MsgSettingSetBool(moCtrlKey, false);
}
MSG_DEBUG("Setting result = [%d]", err);
- if (svct->table.ust.service[TAPI_SIM_UST_MO_SMS_CTRL] == 1){
+ if (svct->table.ust.service[TAPI_SIM_UST_MO_SMS_CTRL] == 1) {
err = MsgSettingSetBool(moCtrlKey, true);
} else {
err = MsgSettingSetBool(moCtrlKey, false);
SmsPluginCallback::SmsPluginCallback()
{
-
-
}
for (int i = 1; i <= count; ++i) {
pTapiHandle = SmsPluginDSHandler::instance()->getTelHandle(i);
-// int simIndex = SmsPluginDSHandler::instance()->getSimIndex(pTapiHandle);
+/* int simIndex = SmsPluginDSHandler::instance()->getSimIndex(pTapiHandle); */
if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SMS_DEVICE_READY, TapiEventDeviceReady, NULL) != TAPI_API_SUCCESS)
MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SMS_DEVICE_READY);
MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_PROP_NETWORK_SERVICE_TYPE);
if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SIM_REFRESHED, TapiEventSimRefreshed, NULL) != TAPI_API_SUCCESS)
MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SIM_REFRESHED);
-// if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SAT_REFRESH, TapiEventSatSmsRefresh, NULL) != TAPI_API_SUCCESS)
-// MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SAT_REFRESH);
-// if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SAT_MO_SMS_CTRL, TapiEventSatMoSmsCtrl, NULL) != TAPI_API_SUCCESS)
-// MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SAT_MO_SMS_CTRL);
+/* if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SAT_REFRESH, TapiEventSatSmsRefresh, NULL) != TAPI_API_SUCCESS) */
+/* MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SAT_REFRESH); */
+/* if (tel_register_noti_event(pTapiHandle, TAPI_NOTI_SAT_MO_SMS_CTRL, TapiEventSatMoSmsCtrl, NULL) != TAPI_API_SUCCESS) */
+/* MSG_DEBUG("tel_register_noti_event is failed : [%s]", TAPI_NOTI_SAT_MO_SMS_CTRL); */
}
}
void SmsPluginCallback::deRegisterEvent()
{
-
-
}
SmsPluginCbMsgHandler::~SmsPluginCbMsgHandler()
{
-
}
if (err == MSG_SUCCESS) {
MSG_CB_MSG_S cbOutMsg = {0, };
-// cbOutMsg.type = MSG_CB_SMS;
+ /*cbOutMsg.type = MSG_CB_SMS; */
cbOutMsg.type = msgInfo.msgType.subType;
cbOutMsg.receivedTime = cbMsg->recvTime;
- cbOutMsg.serialNum = encodeCbSerialNum (CbMsgPage.pageHeader.serialNum);
+ cbOutMsg.serialNum = encodeCbSerialNum(CbMsgPage.pageHeader.serialNum);
cbOutMsg.messageId = cbMsg->msgId;
cbOutMsg.dcs = CbMsgPage.pageHeader.dcs.rawData;
memset (cbOutMsg.cbText, 0x00, sizeof(cbOutMsg.cbText));
- cbOutMsg.cbTextLen= convertTextToUtf8((unsigned char*)cbOutMsg.cbText, sizeof(cbOutMsg.cbText), cbMsg);
+ cbOutMsg.cbTextLen = convertTextToUtf8((unsigned char*)cbOutMsg.cbText, sizeof(cbOutMsg.cbText), cbMsg);
memset(cbOutMsg.language_type, 0x00, sizeof(cbOutMsg.language_type));
memcpy(cbOutMsg.language_type, CbMsgPage.pageHeader.dcs.iso639Lang, 3);
err = SmsPluginEventHandler::instance()->callbackCBMsgIncoming(&cbOutMsg, &msgInfo);
}
#if 0
- // insert message-id to internal CB message table
+ /* insert message-id to internal CB message table */
SmsPluginStorage *storageHandler = SmsPluginStorage::instance();
err = storageHandler->insertReceivedCBMessage(CbMsgPage);
- if (err != MSG_SUCCESS)
- {
+ if (err != MSG_SUCCESS) {
MSG_DEBUG("insertReceivedCBMessage() Error !! [%d]", err);
}
#endif
MSG_BEGIN();
msg_error_t err = MSG_SUCCESS;
TelSmsEtwsMsgType_t type = pEtwsMsg->EtwsMsgType;
- //MSG_MESSAGE_INFO_S msgInfo = {};
SMS_ETWS_PRIMARY_S etwsPn = {0, };
MSG_CB_MSG_S cbOutMsg = {0, };
return;
}
DecodeEtwsMsg(pEtwsMsg, &etwsPn);
- //convertEtwsMsgToMsginfo(&CbMsgPage, &msgInfo, simIndex);
cbOutMsg.type = MSG_ETWS_SMS;
cbOutMsg.receivedTime = etwsPn.recvTime;
- cbOutMsg.serialNum = encodeCbSerialNum (etwsPn.serialNum);
+ cbOutMsg.serialNum = encodeCbSerialNum(etwsPn.serialNum);
cbOutMsg.messageId = etwsPn.msgId;
cbOutMsg.etwsWarningType = etwsPn.warningType;
memcpy (cbOutMsg.etwsWarningSecurityInfo, etwsPn.warningSecurityInfo, sizeof(cbOutMsg.etwsWarningSecurityInfo));
MSG_DEBUG("codingScheme:[%d]", pCbPage->pageHeader.dcs.codingScheme);
switch (pCbPage->pageHeader.dcs.codingScheme) {
- case SMS_CHARSET_7BIT :
- {
+ case SMS_CHARSET_7BIT: {
MSG_DEBUG("GSM 7 BIT");
dataLen = (dataLen*8) / 7;
}
break;
- case SMS_CHARSET_8BIT :
- case SMS_CHARSET_UCS2 :
- {
+ case SMS_CHARSET_8BIT:
+ case SMS_CHARSET_UCS2: {
MSG_DEBUG("UCS2 or 8BIT");
if (pCbPage->pageHeader.dcs.iso639Lang[0]) {
/* warning security information */
memcpy(pEtwsPn->warningSecurityInfo, &EtwsData[6], sizeof(pEtwsPn->warningSecurityInfo)); /* 50bytes */
for (unsigned int i = 0; i < sizeof(pEtwsPn->warningSecurityInfo); i++) {
- MSG_DEBUG("warning secu info [%02x]", pEtwsPn->warningSecurityInfo[i] );
+ MSG_DEBUG("warning secu info [%02x]", pEtwsPn->warningSecurityInfo[i]);
}
}
int offset = 0;
switch (pCbPage->pageHeader.dcs.codingScheme) {
- case SMS_CHARSET_7BIT :
- {
+ case SMS_CHARSET_7BIT: {
for (int i = 0; i < pCbPage->pageHeader.totalPages; ++i) {
- char cbMessage[MAX_CBMSG_PAGE_SIZE]= {0,};
+ char cbMessage[MAX_CBMSG_PAGE_SIZE] = {0, };
dataLen = cbData[7+(i+1)*82 + i];
memcpy(cbMessage, &cbData[7+(i*82)+ i], dataLen);
}
break;
- case SMS_CHARSET_8BIT :
- case SMS_CHARSET_UCS2 :
- {
+ case SMS_CHARSET_8BIT:
+ case SMS_CHARSET_UCS2: {
#if 0
- char cbMessage[MAX_CBMSG_PAGE_SIZE]= {0,};
+ char cbMessage[MAX_CBMSG_PAGE_SIZE]= {0, };
for (int i = 0; i < pCbPage->pageHeader.totalPages; ++i) {
dataLen = cbData[7+(i+1)*82 + i];
pCbPage->pageLength = dataLen;
}
#else
- char cbMessage[MAX_CBMSG_PAGE_SIZE]= {0,};
+ char cbMessage[MAX_CBMSG_PAGE_SIZE] = {0, };
for (int i = 0; i < pCbPage->pageHeader.totalPages; ++i) {
if (pCbPage->pageHeader.dcs.iso639Lang[0]) {
MSG_DEBUG("Page Length : [%d], Page Data : [%s]", pCbPage->pageLength, pCbPage->pageData);
}
-unsigned short SmsPluginCbMsgHandler::encodeCbSerialNum ( SMS_CBMSG_SERIAL_NUM_S snFields )
+unsigned short SmsPluginCbMsgHandler::encodeCbSerialNum(SMS_CBMSG_SERIAL_NUM_S snFields)
{
unsigned short serialNum = 0;
serialNum = ((snFields.geoScope & 0x03) << 14) | ((snFields.msgCode&0x03FF) << 4) | (snFields.updateNum&0x0F);
- MSG_DEBUG ("serialNum (%x), geo(%x), mc(%x), un(%x)\n", serialNum, snFields.geoScope, snFields.msgCode, snFields.updateNum);
+ MSG_DEBUG("serialNum (%x), geo(%x), mc(%x), un(%x)\n", serialNum, snFields.geoScope, snFields.msgCode, snFields.updateNum);
return serialNum;
}
{
int ret = 0;
- switch (message_id)
- {
- case 4370 :
- case 4383 :
+ switch (message_id) {
+ case 4370:
+ case 4383:
ret = MSG_CMAS_PRESIDENTIAL;
break;
- case 4371 :
- case 4372 :
- case 4384 :
- case 4385 :
+ case 4371:
+ case 4372:
+ case 4384:
+ case 4385:
ret = MSG_CMAS_EXTREME;
break;
- case 4373 :
- case 4374 :
- case 4375 :
- case 4376 :
- case 4377 :
- case 4378 :
- case 4386 :
- case 4387 :
- case 4388 :
- case 4389 :
- case 4390 :
- case 4391 :
+ case 4373:
+ case 4374:
+ case 4375:
+ case 4376:
+ case 4377:
+ case 4378:
+ case 4386:
+ case 4387:
+ case 4388:
+ case 4389:
+ case 4390:
+ case 4391:
ret = MSG_CMAS_SEVERE;
break;
- case 4379 :
- case 4392 :
+ case 4379:
+ case 4392:
ret = MSG_CMAS_AMBER;
break;
- case 4380 :
- case 4393 :
+ case 4380:
+ case 4393:
ret = MSG_CMAS_TEST;
break;
- case 4381 :
- case 4394 :
+ case 4381:
+ case 4394:
ret = MSG_CMAS_EXERCISE;
break;
- case 4382 :
- case 4395 :
+ case 4382:
+ case 4395:
ret = MSG_CMAS_OPERATOR_DEFINED;
break;
- default :
+ default:
break;
}
bool bActivate = false;
int MsgId_from = 0, MsgId_to = 0;
- MSG_CB_CHANNEL_S cbChannelInfo = {0,};
+ MSG_CB_CHANNEL_S cbChannelInfo = {0, };
msg_error_t err = MSG_SUCCESS;
MsgDbHandler *dbHandle = getDbHandle();
SmsPluginStorage *storageHandler = SmsPluginStorage::instance();
err = storageHandler->isReceivedCBMessage(CbPage);
- // check existing message with cb internal table;
- if (err != MSG_ERR_DB_NORECORD)
- {
+
+ /* check existing message with cb internal table; */
+ if (err != MSG_ERR_DB_NORECORD) {
MSG_DEBUG("already received message: [%d]", CbPage.pageHeader.msgId);
return 0;
}
memcpy(pMsgInfo->msgData, EtwsMsg->pageData, pMsgInfo->dataSize);
}
-int SmsPluginCbMsgHandler::convertTextToUtf8 (unsigned char* outBuf, int outBufSize, SMS_CBMSG_S* pCbMsg)
+int SmsPluginCbMsgHandler::convertTextToUtf8(unsigned char* outBuf, int outBufSize, SMS_CBMSG_S* pCbMsg)
{
int convertedTextSize = 0;
- MSG_LANG_INFO_S langInfo = {0,};
+ MSG_LANG_INFO_S langInfo = {0, };
MsgTextConvert *textCvt = MsgTextConvert::instance();
if (!outBuf || !pCbMsg) {
- MSG_DEBUG ("invalid param.\n");
+ MSG_DEBUG("invalid param.\n");
return 0;
}
unsigned char codingGrp = (dcsData & 0xF0) >> 4;
switch (codingGrp) {
- case 0x00 :
- case 0x02 :
- case 0x03 :
- {
+ case 0x00:
+ case 0x02:
+ case 0x03: {
pDcs->codingGroup = SMS_CBMSG_CODGRP_GENERAL_DCS;
pDcs->langType = (SMS_CBMSG_LANG_TYPE_T)dcsData;
}
break;
- case 0x01 :
- {
+ case 0x01: {
if (dcsData == 0x10 || dcsData == 0x11) {
pDcs->codingGroup = SMS_CBMSG_CODGRP_GENERAL_DCS;
pDcs->codingScheme = (dcsData & 0x01) ? SMS_CHARSET_UCS2 : SMS_CHARSET_7BIT;
}
break;
- case 0x04 :
- case 0x05 :
- case 0x06 :
- case 0x07 :
- {
+ case 0x04:
+ case 0x05:
+ case 0x06:
+ case 0x07: {
pDcs->codingGroup = SMS_CBMSG_CODGRP_GENERAL_DCS;
pDcs->bCompressed = (dcsData & 0x20) ? true : false;
}
break;
- case 0x09 :
- {
+ case 0x09: {
pDcs->bUDH = true;
pDcs->classType = (MSG_CLASS_TYPE_T)(dcsData & 0x03);
pDcs->codingScheme = (SMS_CODING_SCHEME_T)((dcsData & 0x0C) >> 2);
}
break;
- case 0x0E :
- {
+ case 0x0E: {
pDcs->codingGroup = SMS_CBMSG_CODGRP_WAP;
}
break;
- case 0x0F :
- {
+ case 0x0F: {
pDcs->codingGroup = SMS_CBMSG_CODGRP_CLASS_CODING;
pDcs->codingScheme = (dcsData & 0x04) ? SMS_CHARSET_8BIT : SMS_CHARSET_7BIT;
pDcs->classType = (MSG_CLASS_TYPE_T)(dcsData & 0x03);
void SmsPluginCbMsgHandler::getDisplayName(unsigned short MsgId, char *pDisplayName, msg_sim_slot_id_t simIndex)
{
- MSG_CB_CHANNEL_S cbChannelInfo = {0,};
+ MSG_CB_CHANNEL_S cbChannelInfo = {0, };
msg_error_t err = MSG_SUCCESS;
MsgDbHandler *dbHandle = getDbHandle();
dataSize = makeConcatUserData(msg.msgRef, msg.simIndex, &pUserData, msg.originAddress.address);
if (dataSize > 0) {
-
convertConcatToMsginfo(&(pTpdu->data.deliver), pUserData, dataSize, &msgInfo);
/* set Sim Message ID */
msgInfo.msgId = msgId;
if (concatList[index].msgRef == msg.msgRef && concatList[index].simIndex == msg.simIndex
&& g_strcmp0(concatList[index].originAddress.address, msg.originAddress.address) == 0) {
memcpy(simIdList, concatList[index].simIdList, sizeof(int) * MAX_SIM_SMS_NUM);
- for (int i = 0; i < 255; ++i)
- {
+ for (int i = 0; i < 255; ++i) {
MSG_DEBUG("sim id [%d]", simIdList[i]);
}
break;
/** Convert Data values */
MsgTextConvert *textCvt = MsgTextConvert::instance();
if (pTpdu->dcs.codingScheme == SMS_CHARSET_7BIT) {
- MSG_LANG_INFO_S langInfo = {0,};
+ MSG_LANG_INFO_S langInfo = {0, };
langInfo.bSingleShift = false;
langInfo.bLockingShift = false;
/** Convert Data values */
MsgTextConvert *textCvt = MsgTextConvert::instance();
if (pTpdu->dcs.codingScheme == SMS_CHARSET_7BIT) {
- MSG_LANG_INFO_S langInfo = {0,};
+ MSG_LANG_INFO_S langInfo = {0, };
langInfo.bSingleShift = false;
langInfo.bLockingShift = false;
SmsPluginEventHandler::~SmsPluginEventHandler()
{
-
}
if (sentInfo.bLast == true || NetStatus != MSG_NETWORK_SEND_SUCCESS) {
/** Update Msg Status */
if (sentInfo.reqInfo.msgInfo.msgPort.valid == false) {
-// SmsPluginStorage::instance()->updateSentMsg(&(sentInfo.reqInfo.msgInfo), NetStatus);
+ /*SmsPluginStorage::instance()->updateSentMsg(&(sentInfo.reqInfo.msgInfo), NetStatus); */
sentInfo.reqInfo.msgInfo.networkStatus = NetStatus;
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
MSG_DEBUG("Add phone log");
MsgAddPhoneLog(&(sentInfo.reqInfo.msgInfo));
-#endif //MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
sentInfo.reqInfo.msgInfo.folderId = MSG_SENTBOX_ID; /* It should be set after adding phone log. */
} else {
sentInfo.reqInfo.msgInfo.bRead = false;
void SmsPluginEventHandler::handleMsgIncoming(TapiHandle *handle, SMS_TPDU_S *pTpdu)
{
-
/** Make MSG_MESSAGE_INFO_S */
MSG_MESSAGE_INFO_S msgInfo;
MSG_MESSAGE_INFO_S stored_msgInfo;
syncMLData.pushBodyLen = PushBodyLen;
memcpy(syncMLData.pushBody, pPushBody, PushBodyLen);
- syncMLData.wspHeaderLen= WspHeaderLen;
+ syncMLData.wspHeaderLen = WspHeaderLen;
memcpy(syncMLData.wspHeader, pWspHeader, WspHeaderLen);
/** Callback to MSG FW */
void SmsPluginEventHandler::convertTpduToMsginfo(SMS_TPDU_S *pTpdu, MSG_MESSAGE_INFO_S *msgInfo)
{
-
switch (pTpdu->tpduType) {
case SMS_TPDU_SUBMIT :
convertSubmitTpduToMsginfo(&pTpdu->data.submit, msgInfo);
memset(msgInfo->subject, 0x00, MAX_SUBJECT_LEN+1);
/** What kind of time has to be saved?? (temporary store time) */
-
-//CID 315780 (#1 of 1): Other violation (DC.SECURE_CODING_CRITICAL)
-//dont_call: Calling localtime(time_t const *) is a DC.SECURE_CODING_CRITICAL defect.
-// time_t curTime;
-// localtime(&curTime);
msgInfo->displayTime = time(NULL);
/** Convert Address values */
/** Convert Data values */
MsgTextConvert *textCvt = MsgTextConvert::instance();
if (pTpdu->dcs.codingScheme == SMS_CHARSET_7BIT) {
- MSG_LANG_INFO_S langInfo = {0,};
+ MSG_LANG_INFO_S langInfo = {0, };
langInfo.bSingleShift = false;
langInfo.bLockingShift = false;
/*** Comment below lines to save local UTC time..... (it could be used later.)
***/
if (pTpdu->timeStamp.format == SMS_TIME_ABSOLUTE) {
-
MSG_DEBUG("year : %d", pTpdu->timeStamp.time.absolute.year);
MSG_DEBUG("month : %d", pTpdu->timeStamp.time.absolute.month);
MSG_DEBUG("day : %d", pTpdu->timeStamp.time.absolute.day);
/** Convert Data values */
MsgTextConvert *textCvt = MsgTextConvert::instance();
if (pTpdu->dcs.codingScheme == SMS_CHARSET_7BIT) {
- MSG_LANG_INFO_S langInfo = {0,};
+ MSG_LANG_INFO_S langInfo = {0, };
langInfo.bSingleShift = false;
langInfo.bLockingShift = false;
- for (int i = 0; i < pTpdu->userData.headerCnt; i++) {
+ for (int i = 0; i < pTpdu->userData.headerCnt; i++) {
if (pTpdu->userData.header[i].udhType == SMS_UDH_SINGLE_SHIFT) {
langInfo.bSingleShift = true;
langInfo.singleLang = pTpdu->userData.header[i].udh.singleShift.langId;
default :
return MSG_NORMAL_SMS;
}
-
}
pPluginHandle->pfGetDefaultNetworkSimId = SmsPlgGetDefaultNetworkSimId;
MSG_DEBUG("SMS plugin: create handler OK");
- MSG_DEBUG ("SMS plugin %p", pPluginHandle);
+ MSG_DEBUG("SMS plugin %p", pPluginHandle);
}
return MSG_SUCCESS;
}
/* Check SIM is present or not */
- char keyName[MAX_VCONFKEY_NAME_LEN] = {0,};
+ char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, pReqInfo->msgInfo.sim_idx);
MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName);
msg_error_t SmsPlgDeleteSimMessage(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId)
{
/* Check SIM is present or not */
- char keyName[MAX_VCONFKEY_NAME_LEN]={0,};
+ char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, sim_idx);
MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName);
msg_error_t SmsPlgSetReadStatus(msg_sim_slot_id_t sim_idx, msg_sim_id_t SimMsgId)
{
/* Check SIM is present or not */
- char keyName[MAX_VCONFKEY_NAME_LEN]={0,};
+ char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, sim_idx);
MSG_SIM_STATUS_T simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName);
msg_error_t SmsPlgAddMessage(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_SENDINGOPT_INFO_S* pSendOptInfo, char* pFileData)
{
-
int *simIdList = (int*)pFileData;
try {
SmsPluginStorage::instance()->addSmsSendOption(pMsgInfo, pSendOptInfo);
msg_error_t SmsPlgGetDefaultNetworkSimId(int *simId)
{
-
try {
SmsPluginDSHandler::instance()->getDefaultNetworkSimId(simId);
} catch (MsgException& e) {
MSG_END();
return;
-
}
==================================================================================================*/
SmsPluginParamCodec::SmsPluginParamCodec()
{
-
-
}
SmsPluginParamCodec::~SmsPluginParamCodec()
{
-
-
}
**ppParam = 0x00;
switch (pDCS->codingGroup) {
- case SMS_GROUP_GENERAL:
- {
+ case SMS_GROUP_GENERAL: {
if (pDCS->msgClass != SMS_MSG_CLASS_NONE)
**ppParam = 0x10 + pDCS->msgClass;
}
break;
- case SMS_GROUP_CODING_CLASS:
- {
+ case SMS_GROUP_CODING_CLASS: {
**ppParam = 0xF0 + pDCS->msgClass;
}
break;
char* tmpAddress = new char[MAX_ADDRESS_LEN];
int tmplength = 0;
- tmplength = SmsPluginUDCodec::unpack7bitChar(&(pTpdu[offset]), (addrLen*4 )/7, 0, tmpAddress);
+ tmplength = SmsPluginUDCodec::unpack7bitChar(&(pTpdu[offset]), (addrLen*4)/7, 0, tmpAddress);
- MSG_LANG_INFO_S langInfo = {0,};
+ MSG_LANG_INFO_S langInfo = {0, };
langInfo.bSingleShift = false;
langInfo.bLockingShift = false;
SmsPluginSatHandler::~SmsPluginSatHandler()
{
-
}
if (tpduLen <= 0) {
sendResult(handle, SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_SUCCESS);
return;
- } //else if (tpduLen > MAX_TPDU_DATA_LEN) {
- else if (tpduLen > MAX_SAT_TPDU_LEN) { //CID 358478: replacing check against MAX_TPDU_DATA_LEN (255) with check
- // against MAX_SAT_TPDU_LEN (175).
- // as mentioned above "The TPDU Maximum Length at SAT side is 175".
- // Earlier MAX_TPDU_DATA_LEN was increased from 165 to 255 which creates confusion for prevent tool.
- // Prevent tool thinks that it can take value of 255 and cause buffer overflow during memcpy below.
+ } else if (tpduLen > MAX_SAT_TPDU_LEN) {
sendResult(handle, SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_BEYOND_ME_CAPABILITIES);
return;
}
pkgInfo.format = TAPI_NETTEXT_NETTYPE_3GPP;
/* Set SMSC Address */
- SMS_ADDRESS_S smsc = {0,};
+ SMS_ADDRESS_S smsc = {0, };
int simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
if (pSmsData->address.diallingNumberLen > 0) {
TelSatMoSmCtrlIndData_t* pCtrlData = (TelSatMoSmCtrlIndData_t*)pData;
-#if 0 // sangkoo 13.11.28
- if (bSendSmsbySat == true) {// Send SMS By SAT
+#if 0
+ if (bSendSmsbySat == true) {
+ /* Send SMS By SAT */
MSG_DEBUG("Event Noti for sending message by SAT : result = [%d]", pCtrlData->moSmsCtrlResult);
- } else { // Send SMS By APP
+ } else {
+ /* Send SMS By APP */
SmsPluginTransport::instance()->setMoCtrlStatus(pCtrlData);
}
#else
netStatus = MSG_NETWORK_SEND_SUCCESS;
}
- // Call Event Handler
+ /* Call Event Handler */
SmsPluginEventHandler::instance()->handleSentStatus(netStatus);
}
#endif
} else if (smsStatus == SMS_NETWORK_SEND_FAIL) {
MSG_ERR("Sending SMS by SAT is failed");
sendResult(handle, SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_SMS_RP_ERROR);
- } else if (smsStatus == SMS_NETWORK_SEND_FAIL_MANDATORY_INFO_MISSING){
+ } else if (smsStatus == SMS_NETWORK_SEND_FAIL_MANDATORY_INFO_MISSING) {
MSG_ERR("Sending SMS by SAT is failed, but result is 'success'");
- //sendResult(SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_ERROR_REQUIRED_VALUES_ARE_MISSING);
+ /* sendResult(SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_ERROR_REQUIRED_VALUES_ARE_MISSING); */
sendResult(handle, SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_SUCCESS);
- } else if (smsStatus == SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_NOT_ALLOWED){
+ } else if (smsStatus == SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_NOT_ALLOWED) {
MSG_ERR("Sending SMS is failed by MO control");
sendResult(handle, SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM);
- } else if (smsStatus == SMS_NETWORK_SEND_FAIL_NO_ROUTING){
+ } else if (smsStatus == SMS_NETWORK_SEND_FAIL_NO_ROUTING) {
MSG_ERR("Sending SMS is failed by no routing");
sendResult(handle, SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_NETWORK_UNABLE_TO_PROCESS_COMMAND);
- } else { /*Default case*/
+ } else {
+ /*Default case*/
MSG_ERR("Sending SMS by SAT is failed");
sendResult(handle, SMS_SAT_CMD_SEND_SMS, TAPI_SAT_R_SMS_RP_ERROR);
}
-#if 0 //P150109-07114 : no ticker and sound for sending SAT sms failure case.
+#if 0 /* no ticker and sound for sending SAT sms failure case. */
if (smsStatus != SMS_NETWORK_SEND_SUCCESS) {
MsgInsertTicker("Sending SMS is failed", SMS_MESSAGE_SENDING_FAIL, true, 0);
}
#if 0
void SmsPluginSatHandler::finishSimMsgInit(msg_error_t Err)
{
- // SAT Handler is initializing SIM now
- if (bInitSim == true)
- {
- // Init SMSC List and CB ID Info
- try
- {
+ /* SAT Handler is initializing SIM now */
+ if (bInitSim == true) {
+ /* Init SMSC List and CB ID Info */
+ try {
if (bSMSPChanged == true) initSMSCList();
- }
- catch (MsgException& e)
- {
- // Send Result to TAPI
+ } catch (MsgException& e) {
+ /* Send Result to TAPI */
sendResult(SMS_SAT_CMD_REFRESH, TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND);
MSG_FATAL("%s", e.what());
return;
}
- try
- {
+ try {
if (bCBMIChanged == true) initCBConfig();
- }
- catch (MsgException& e)
- {
- // Send Result to TAPI
+ } catch (MsgException& e) {
+ /* Send Result to TAPI */
sendResult(SMS_SAT_CMD_REFRESH, TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND);
MSG_FATAL("%s", e.what());
return;
}
- // Send Result to TAPI
+ /* Send Result to TAPI */
sendResult(SMS_SAT_CMD_REFRESH, TAPI_SAT_R_SUCCESS);
}
}
{
bInitSim = true;
- // Init SIM Message
- if (SmsPluginEventHandler::instance()->callbackInitSimBySat() != MSG_SUCCESS)
- {
+ /* Init SIM Message */
+ if (SmsPluginEventHandler::instance()->callbackInitSimBySat() != MSG_SUCCESS) {
MSG_DEBUG("Init Sim Error");
- // Send Result to TAPI
+ /* Send Result to TAPI */
sendResult(SMS_SAT_CMD_REFRESH, TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND);
}
}
settingData.type = MSG_SMSC_LIST;
- // Get Data From SIM
+ /* Get Data From SIM */
SmsPluginSetting::instance()->getConfigData(&settingData);
MSG_DEBUG("total_count[%d]", settingData.option.smscList.totalCnt);
MSG_DEBUG("selected[%d]", settingData.option.smscList.selected);
- for (int i = 0; i < settingData.option.smscList.totalCnt; i++)
- {
+ for (int i = 0; i < settingData.option.smscList.totalCnt; i++) {
MSG_DEBUG("pid[%d]", settingData.option.smscList.smscData[i].pid);
-// MSG_DEBUG("dcs[%d]", settingData.option.smscList.smscData[i].dcs);
MSG_DEBUG("val_period[%d]", settingData.option.smscList.smscData[i].valPeriod);
MSG_SEC_DEBUG("name[%s]", settingData.option.smscList.smscData[i].name);
MSG_SEC_DEBUG("address[%s]", settingData.option.smscList.smscData[i].smscAddr.address);
}
- if (MsgSettingSetInt(SMSC_SELECTED, settingData.option.smscList.selected) != MSG_SUCCESS)
- {
+ if (MsgSettingSetInt(SMSC_SELECTED, settingData.option.smscList.selected) != MSG_SUCCESS) {
THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", SMSC_SELECTED);
return;
}
- if (MsgSettingSetInt(SMSC_TOTAL_COUNT, settingData.option.smscList.totalCnt) != MSG_SUCCESS)
- {
+ if (MsgSettingSetInt(SMSC_TOTAL_COUNT, settingData.option.smscList.totalCnt) != MSG_SUCCESS) {
THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", SMSC_TOTAL_COUNT);
return;
}
char keyName[MAX_VCONFKEY_NAME_LEN];
msg_error_t err = MSG_SUCCESS;
- for (int i = 0; i < settingData.option.smscList.totalCnt; i++)
- {
+ for (int i = 0; i < settingData.option.smscList.totalCnt; i++) {
memset(keyName, 0x00, sizeof(keyName));
snprintf(keyName, sizeof(keyName), "%s/%d", SMSC_PID, i);
break;
}
- if (err != MSG_SUCCESS)
- {
+ if (err != MSG_SUCCESS) {
THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", keyName);
}
}
-void SmsPluginSatHandler::initCBConfig()
+void SmsPluginSatHandler::initCBConfig()
{
MSG_SETTING_S settingData;
settingData.type = MSG_CBMSG_OPT;
- // Get Data From SIM
+ /* Get Data From SIM */
SmsPluginSetting::instance()->getConfigData(&settingData);
- if (MsgSettingSetBool(CB_RECEIVE, settingData.option.cbMsgOpt.bReceive) != MSG_SUCCESS)
- {
+ if (MsgSettingSetBool(CB_RECEIVE, settingData.option.cbMsgOpt.bReceive) != MSG_SUCCESS) {
THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", CB_RECEIVE);
return;
}
- if (MsgSettingSetInt(CB_MAX_SIM_COUNT, settingData.option.cbMsgOpt.maxSimCnt) != MSG_SUCCESS)
- {
+ if (MsgSettingSetInt(CB_MAX_SIM_COUNT, settingData.option.cbMsgOpt.maxSimCnt) != MSG_SUCCESS) {
THROW(MsgException::SMS_PLG_ERROR, "Error to set config data [%s]", CB_MAX_SIM_COUNT);
return;
}
err = MsgStoAddCBChannelInfo(dbHandle, &(settingData.option.cbMsgOpt.channelData), settingData.option.cbMsgOpt.simIndex);
MSG_DEBUG("MsgStoAddCBChannelInfo : err=[%d]", err);
- if (err != MSG_SUCCESS)
- {
+ if (err != MSG_SUCCESS) {
THROW(MsgException::SMS_PLG_ERROR, "Error to set config data");
}
}
pos++;
-// pTpdu[pos++] = SmsPluginTransport::instance()->getMsgRef();
+ /*pTpdu[pos++] = SmsPluginTransport::instance()->getMsgRef(); */
/* TP-DA */
MSG_DEBUG("user data : [%s]", userData.data);
- // check for user data whether it is 7-bit packed or not.
+ /* check for user data whether it is 7-bit packed or not. */
bool is7bitPacked = false;
int bitValue = 0;
for (int i = 0; i < userData.length; i++) {
- bitValue = userData.data[i] & ( 1 << 7);
+ bitValue = userData.data[i] & (1 << 7);
if (bitValue != 0) {
is7bitPacked = true;
MSG_DEBUG("user data is already 7-bit packed !!");
MSG_INFO("Parameter Count [%d]", paramCnt);
MSG_SMSC_DATA_S tmpSmscData = {};
- MSG_SMSC_LIST_S tmpSmscList = {0,};
+ MSG_SMSC_LIST_S tmpSmscList = {0, };
for (int index = 0; index < paramCnt; index++) {
memset(&tmpSmscData, 0x00, sizeof(MSG_SMSC_DATA_S));
if (simStatus[sim_idx] != MSG_SIM_STATUS_NOT_FOUND) {
MSG_DEBUG("simStatus == [%d]", simStatus[sim_idx]);
- MSG_CBMSG_OPT_S cbMsgOpt = {0,};
+ MSG_CBMSG_OPT_S cbMsgOpt = {0, };
cbMsgOpt.simIndex = sim_idx;
if (getCbConfig(&cbMsgOpt) == true) {
}
} else {
MSG_WARN("######## getCbConfig Fail !!! #######");
-
-#if 0
- // CSC doesn't support CB Info any longer
- if (MsgCscGetCBInfo(&cbMsgOpt) == true) {
- err = addCbOpt(&cbMsgOpt);
-
- if (err == MSG_SUCCESS) {
- MSG_DEBUG("######## Add CB Option From CSC Success !!! #######");
- } else {
- MSG_DEBUG("######## Add CB Option from CSC Fail !!! return : %d #######", err);
- }
- } else {
- MSG_DEBUG("######## MsgCscGetCBInfo Fail !!! #######");
- }
-#endif
}
/*==================== Default Voice mail Setting ====================*/
}
pthread_detach(thd);
-
}
case MSG_SMSC_LIST :
setParamList(&pSetting->option.smscList);
addSMSCList((MSG_SMSC_LIST_S *)(&pSetting->option.smscList));
-// setSmscInfo(&pSetting->option.smscList);
break;
case MSG_CBMSG_OPT :
if (setCbConfig(&pSetting->option.cbMsgOpt) == false) {
switch (pSetting->type) {
case MSG_SMSC_LIST :
-// getParamList(&pSetting->option.smscList);
getSmscListInfo(pSetting->option.smscList.simIndex, &(pSetting->option.smscList));
break;
else
pTmpSmscList.smscData[i].smscAddr.ton = MSG_TON_NATIONAL;
- pTmpSmscList.smscData[i].smscAddr.npi = MSG_NPI_ISDN; // app cannot set this value
+ pTmpSmscList.smscData[i].smscAddr.npi = MSG_NPI_ISDN; /* app cannot set this value */
}
}
}
#if 0
- // Set Setting Data into Vconf
+ /* Set Setting Data into Vconf */
memset(keyName, 0x00, sizeof(keyName));
snprintf(keyName, sizeof(keyName), "%s/%d", CB_RECEIVE, pCbOpt->simIndex);
if (MsgSettingSetBool(keyName, pCbOpt->bReceive) != MSG_SUCCESS) {
MsgSettingGetBool(keyName, &pSetting->option.cbMsgOpt.bLanguage[i]);
}
-
}
memset(&sca, 0x00, sizeof(TelSmsAddressInfo_t));
if (strlen(pSmscData->smscAddr.address) > 0) {
-
if (pSmscData->smscAddr.address[0] == '+')
sca.Ton = TAPI_SIM_TON_INTERNATIONAL;
else
for (int i = 1; i <= simCnt; i++) {
MutexLocker lock(mx);
- //if (i == pCbOpt->simIndex)
- // continue;
memset(keyName, 0x00, sizeof(keyName));
snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, i);
simStatus = (MSG_SIM_STATUS_T)MsgSettingGetInt(keyName);
msg_error_t err = MSG_SUCCESS;
MsgDbHandler *dbHandle = getDbHandle();
- err = MsgStoAddCBChannelInfo(dbHandle, const_cast<MSG_CB_CHANNEL_S*>(&pCbOpt->channelData),i);
+ err = MsgStoAddCBChannelInfo(dbHandle, const_cast<MSG_CB_CHANNEL_S*>(&pCbOpt->channelData), i);
if (err != MSG_SUCCESS) {
MSG_DEBUG("MsgStoAddCBChannelInfo is failed [%d]", err);
return false;
return;
}
- TelSimMailBoxNumber_t mailboxInfo = {0,};
+ TelSimMailBoxNumber_t mailboxInfo = {0, };
bool bExistVoicetype = false;
int i = 0;
return;
if (pTmpSimMailboxList.count == 0) {
- char num[MAX_PHONE_NUMBER_LEN + 1] = {0,};
+ char num[MAX_PHONE_NUMBER_LEN + 1] = {0, };
mailboxInfo.mb_type = TAPI_SIM_MAILBOX_VOICE;
mailboxInfo.rec_index = 1;
}
int ret = TAPI_API_SUCCESS;
- TelSimMessageWaitingReq_t mwReq = {0,};
+ TelSimMessageWaitingReq_t mwReq = {0, };
simMwiInfoMap::iterator iter = simMwiInfo.find(simIndex);
if(iter == simMwiInfo.end()) {
if (bTapiResult == true) {
MSG_DEBUG("Success to get cb config data");
- pair <int, MSG_CBMSG_OPT_S> newCbOpt (simIndex, *pCbOpt);
+ pair <int, MSG_CBMSG_OPT_S> newCbOpt(simIndex, *pCbOpt);
cbOptMap::iterator it = cbOpt.find(simIndex);
if (it == cbOpt.end()) {
MSG_CBMSG_OPT_S pTmpCbOpt;
memset(&pTmpCbOpt, 0x00, sizeof(MSG_CBMSG_OPT_S));
- pair <int, MSG_CBMSG_OPT_S> newCbOpt (simIndex, pTmpCbOpt);
+ pair <int, MSG_CBMSG_OPT_S> newCbOpt(simIndex, pTmpCbOpt);
cbOpt.insert(newCbOpt);
}
if (pTmpMailboxList.list[i].alpha_id[0] != '\0') {
char unpackAlphaId[MAX_SIM_XDN_ALPHA_ID_LEN+8];
int tmpLen = 0;
- MSG_LANG_INFO_S langInfo = {0,};
+ MSG_LANG_INFO_S langInfo = {0, };
memset(unpackAlphaId, 0x00, sizeof(unpackAlphaId));
SMS_SIM_MAILBOX_LIST_S pDummySimMailboxList;
memset(&pDummySimMailboxList, 0x00, sizeof(SMS_SIM_MAILBOX_LIST_S));
- pair <int, SMS_SIM_MAILBOX_LIST_S> newTmpList (simIndex, pDummySimMailboxList);
+ pair <int, SMS_SIM_MAILBOX_LIST_S> newTmpList(simIndex, pDummySimMailboxList);
simMailboxList.insert(newTmpList);
}
{
int ret = 0;
- //mx.lock();
-
bTapiResult = false;
ret = cv.timedwait(mx.pMutex(), MAX_TAPI_SIM_API_TIMEOUT);
- //mx.unlock();
-
if (ret == ETIMEDOUT) {
MSG_DEBUG("WARNING: TAPI callback TIME-OUT");
return false;
int mwiCnt = 0;
char keyName[MAX_VCONFKEY_NAME_LEN];
- pair <int, SMS_SIM_MWI_INFO_S> newList (index, *pMwiInfo);
+ pair <int, SMS_SIM_MWI_INFO_S> newList(index, *pMwiInfo);
simMwiInfoMap::iterator it = simMwiInfo.find(index);
if (it == simMwiInfo.end()) {
if (pTmpsimMwiInfoList.b_cphs == true) {
mwiCnt = pTmpsimMwiInfoList.cphs_mwi.b_voice1;
} else {
- mwiCnt = pTmpsimMwiInfoList.mwi_list.mw_info[0].voice_count; // Normal case
+ mwiCnt = pTmpsimMwiInfoList.mwi_list.mw_info[0].voice_count;
}
/* TODO :: Add operation for voice mail of line 2 */
memset(&pTmpsimMwiInfo, 0x00, sizeof(SMS_SIM_MWI_INFO_S));
- pair <int, SMS_SIM_MWI_INFO_S> newList (index, pTmpsimMwiInfo);
+ pair <int, SMS_SIM_MWI_INFO_S> newList(index, pTmpsimMwiInfo);
simMwiInfoMap::iterator it = simMwiInfo.find(index);
if (it == simMwiInfo.end()) {
MSG_DEBUG("getResultFromSim() is called .");
- //mx.lock(); /* Caller of this function MUST acquire the mutex before calling the TAPI API */
-
ret = cv.timedwait(mx.pMutex(), MAX_TAPI_SIM_API_TIMEOUT);
- //mx.unlock();
-
if (ret == ETIMEDOUT) {
MSG_DEBUG("WARNING: TAPI callback TIME-OUT");
return false;
{
MSG_BEGIN();
- MSG_MESSAGE_INFO_S msgInfo = {0,};
+ MSG_MESSAGE_INFO_S msgInfo = {0, };
msgInfo.addressList = NULL;
unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> addressListBuf(&msgInfo.addressList, unique_ptr_deleter);
msgInfo.sim_idx = simIndex;
#if 0
- if (simMwiInfo.b_cphs == false) { // Normal case
+ if (simMwiInfo.b_cphs == false) {
snprintf(msgInfo.msgText, sizeof(msgInfo.msgText), "%d new voice message", mwiCnt);
} else {
snprintf(msgInfo.msgText, sizeof(msgInfo.msgText), "New voice message");
int simIndex = SmsPluginDSHandler::instance()->getSimIndex(handle);
pthread_t thd;
- char keyName[MAX_VCONFKEY_NAME_LEN] = {0,};
+ char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
tapiRet = tel_get_sim_init_info(handle, &status, &cardChanged);
MSG_INFO("Tapi Ret=[%d], SIM index [%d], SIM status [%d], CardChanged [%d]", tapiRet, simIndex, status, cardChanged);
MsgSettingSetInt(keyName, MSG_SIM_STATUS_CHANGED);
simStatus[simIndex] = MSG_SIM_STATUS_CHANGED;
} else {
- snprintf(keyName, sizeof(keyName),"%s/%d", MSG_SIM_CHANGED, simIndex);
+ snprintf(keyName, sizeof(keyName), "%s/%d", MSG_SIM_CHANGED, simIndex);
MsgSettingSetInt(keyName, MSG_SIM_STATUS_NORMAL);
simStatus[simIndex] = MSG_SIM_STATUS_NORMAL;
}
-// tel_handle_list.push_back(handle);
+
/* Modified to call initSimInfo for SIM separately */
MSG_DEBUG("calling initSimInfo");
if (pthread_create(&thd, NULL, &initSimInfo, handle) < 0) {
MSG_DEBUG("Fail to set MSG_SIM_CHANGED to MSG_SIM_STATUS_NOT_FOUND");
simStatus[simIndex] = MSG_SIM_STATUS_NOT_FOUND;
-
}
MSG_END();
SmsPluginSimMsg::~SmsPluginSimMsg()
{
-
-
}
{
MSG_BEGIN();
- char keyName[MAX_VCONFKEY_NAME_LEN] = {0,};
+ char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
int sim_idx = SmsPluginDSHandler::instance()->getSimIndex(handle);
snprintf(keyName, sizeof(keyName), "%s/%d", SIM_USED_COUNT, sim_idx);
if (pMsgInfo->direction == MSG_DIRECTION_TYPE_MO) {
tpdu.tpduType = SMS_TPDU_SUBMIT;
tpdu.data.submit.dcs.msgClass = SMS_MSG_CLASS_NONE;
- //SmsPluginTransport::instance()->setSmsSendOptions(&(tpdu.data.submit));
+ /*SmsPluginTransport::instance()->setSmsSendOptions(&(tpdu.data.submit));*/
tpdu.data.submit.vpf = SMS_VPF_NOT_PRESENT;
tpdu.data.submit.dcs.codingScheme = SMS_CHARSET_AUTO;
} else {
}
if (submitData.segCount > 1) {
- if (pMsgInfo->direction == MSG_DIRECTION_TYPE_MO){ /* SUBMIT MSG */
+ if (pMsgInfo->direction == MSG_DIRECTION_TYPE_MO) { /* SUBMIT MSG */
tpdu.data.submit.bHeaderInd = true;
} else {
tpdu.data.deliver.bHeaderInd = true;
}
-
}
for (unsigned int segCnt = 0; segCnt < submitData.segCount; segCnt++) {
- if (pMsgInfo->direction == MSG_DIRECTION_TYPE_MO){
+ if (pMsgInfo->direction == MSG_DIRECTION_TYPE_MO) {
memcpy(&(tpdu.data.submit.userData), &(submitData.userData[segCnt]), sizeof(SMS_USERDATA_S));
} else {
memcpy(&(tpdu.data.deliver.userData), &(submitData.userData[segCnt]), sizeof(SMS_USERDATA_S));
msg_error_t SmsPluginSimMsg::saveClass2Message(const MSG_MESSAGE_INFO_S *pMsgInfo)
{
-
msg_error_t err = MSG_SUCCESS;
bool bSimSst = true;
int tapiRet = TAPI_API_SUCCESS;
for (unsigned int segCnt = 0; segCnt < submitData.segCount; segCnt++) {
/* Create TelSmsData_t data */
- TelSmsData_t simSmsData = {0,};
+ TelSmsData_t simSmsData = {0, };
if (submitData.segCount == 1) {
memcpy(&simSmsData.SmsData.Sca, &simMsgDataInfo.sca, sizeof(simSmsData.SmsData.Sca));
pDeliver->dcs.codingGroup = SMS_GROUP_GENERAL;
/* use encoding type of received message instead of message settings */
- //pDeliver->dcs.codingScheme = (SMS_CODING_SCHEME_T)MsgSettingGetInt(SMS_SEND_DCS);
+ /*pDeliver->dcs.codingScheme = (SMS_CODING_SCHEME_T)MsgSettingGetInt(SMS_SEND_DCS);*/
pDeliver->dcs.codingScheme = pMsgInfo->encodeType;
MSG_DEBUG("DCS : %d", pDeliver->dcs.codingScheme);
pDeliver->timeStamp.format = SMS_TIME_ABSOLUTE;
/* encode absolute time */
- struct tm timeinfo = {0,};
+ struct tm timeinfo = {0, };
tzset();
localtime_r(&pMsgInfo->displayTime, &timeinfo);
pDeliver->timeStamp.time.absolute.year = timeinfo.tm_year - 100;
- MSG_DEBUG("pDeliver->timeStamp.time.absolute.year is %d",pDeliver->timeStamp.time.absolute.year);
+ MSG_DEBUG("pDeliver->timeStamp.time.absolute.year is %d", pDeliver->timeStamp.time.absolute.year);
pDeliver->timeStamp.time.absolute.month = timeinfo.tm_mon + 1;
- MSG_DEBUG("pDeliver->timeStamp.time.absolute.month is %d",pDeliver->timeStamp.time.absolute.month);
+ MSG_DEBUG("pDeliver->timeStamp.time.absolute.month is %d", pDeliver->timeStamp.time.absolute.month);
pDeliver->timeStamp.time.absolute.day = timeinfo.tm_mday;
- MSG_DEBUG("pDeliver->timeStamp.time.absolute.day is %d",pDeliver->timeStamp.time.absolute.day);
+ MSG_DEBUG("pDeliver->timeStamp.time.absolute.day is %d", pDeliver->timeStamp.time.absolute.day);
pDeliver->timeStamp.time.absolute.hour = timeinfo.tm_hour;
- MSG_DEBUG("pDeliver->timeStamp.time.absolute.hour is %d",pDeliver->timeStamp.time.absolute.hour);
+ MSG_DEBUG("pDeliver->timeStamp.time.absolute.hour is %d", pDeliver->timeStamp.time.absolute.hour);
pDeliver->timeStamp.time.absolute.minute = timeinfo.tm_min;
- MSG_DEBUG("pDeliver->timeStamp.time.absolute.minute is %d",pDeliver->timeStamp.time.absolute.minute);
+ MSG_DEBUG("pDeliver->timeStamp.time.absolute.minute is %d", pDeliver->timeStamp.time.absolute.minute);
pDeliver->timeStamp.time.absolute.second = timeinfo.tm_sec;
- MSG_DEBUG("pDeliver->timeStamp.time.absolute.second is %d",pDeliver->timeStamp.time.absolute.second);
+ MSG_DEBUG("pDeliver->timeStamp.time.absolute.second is %d", pDeliver->timeStamp.time.absolute.second);
pDeliver->timeStamp.time.absolute.timeZone = 0;
- MSG_DEBUG("pDeliver->timeStamp.time.absolute.timeZone is %d",pDeliver->timeStamp.time.absolute.timeZone);
+ MSG_DEBUG("pDeliver->timeStamp.time.absolute.timeZone is %d", pDeliver->timeStamp.time.absolute.timeZone);
MSG_END();
}
MSG_INFO("Sim Message Count is %d.", pSimMsgCnt->usedCount);
int sim_idx = SmsPluginDSHandler::instance()->getSimIndex(handle);
- char keyName[MAX_VCONFKEY_NAME_LEN]= {0,};
+ char keyName[MAX_VCONFKEY_NAME_LEN] = {0, };
for (int i = 0; i < pSimMsgCnt->usedCount; i++) {
MSG_DEBUG("Sim Message Index is %d.", pSimMsgCnt->indexList[i]);
memcpy(&simMsgInfo, pMsgInfo, sizeof(MSG_MESSAGE_INFO_S));
simMsgInfo.addressList = &simAddrInfo;
- memcpy(&simAddrInfo,pMsgInfo->addressList, sizeof(MSG_ADDRESS_INFO_S));
+ memcpy(&simAddrInfo, pMsgInfo->addressList, sizeof(MSG_ADDRESS_INFO_S));
}
cv.signal();
void SmsPluginSimMsg::setSaveClass2MsgEvent(TapiHandle *handle, int simId, int result, MSG_MESSAGE_INFO_S *pMsgInfo)
{
msg_error_t err = MSG_SUCCESS;
-// int sim_idx = SmsPluginDSHandler::instance()->getSimIndex(handle);
+ /*int sim_idx = SmsPluginDSHandler::instance()->getSimIndex(handle); */
if (result == TAPI_NETTEXT_SENDSMS_SUCCESS && simId >= 0 && pMsgInfo) {
bool isNewSimMsg = true;
SmsPluginStorage::~SmsPluginStorage()
{
-
}
MSG_END();
return MSG_SUCCESS;
-
}
MSG_DEBUG("MsgExecQuery() : [%s]", sqlQuery);
return MSG_ERR_DB_EXEC;
}
- //contacts-service is not used for gear
+
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
if (status == MSG_NETWORK_SEND_SUCCESS) {
MSG_DEBUG("MsgAddPhoneLog() : folderId [%d]", pMsgInfo->folderId);
MsgAddPhoneLog(pMsgInfo);
}
-#endif //MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
MSG_END();
return MSG_SUCCESS;
}
return err;
-
}
(pMsgInfo->msgType.subType == MSG_NORMAL_SMS || pMsgInfo->msgType.subType == MSG_REJECT_SMS)) {
err = addClass2Message(pMsgInfo);
}
- else if (pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS){
+ else if (pMsgInfo->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
err = MSG_SUCCESS;
}
return err;
/** Amend message information for type **/
if (pMsgInfo->msgType.subType == MSG_NORMAL_SMS || pMsgInfo->msgType.subType == MSG_REJECT_SMS) {
-
MSG_DEBUG("Normal SMS");
if (pMsgInfo->msgType.classType == MSG_CLASS_2) {
dbHandle->beginTrans();
if (pMsgInfo->nAddressCnt > 0) {
-
err = MsgStoAddAddress(dbHandle, pMsgInfo, &convId);
if (err != MSG_SUCCESS) {
err = MsgStoCheckMsgCntFull(dbHandle, &(pMsgInfo->msgType), pMsgInfo->folderId);
if (err != MSG_SUCCESS) {
-
if (err == MSG_ERR_MESSAGE_COUNT_FULL) {
bool bAutoErase = false;
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT * FROM %s WHERE GEO_SCOPE = %d AND MSG_CODE = %d AND MESSAGE_ID = %d AND UPDATE_NUM = %d",
MSGFW_RECEIVED_CB_MSG_TABLE_NAME, CbPage.pageHeader.serialNum.geoScope,
- CbPage.pageHeader.serialNum.msgCode,CbPage.pageHeader.msgId, CbPage.pageHeader.serialNum.updateNum);
+ CbPage.pageHeader.serialNum.msgCode, CbPage.pageHeader.msgId, CbPage.pageHeader.serialNum.updateNum);
err = dbHandle->getTable(sqlQuery, &rowCnt, NULL);
MSG_DEBUG("rowCnt: %d", rowCnt);
msg_error_t SmsPluginStorage::insertReceivedCBMessage(SMS_CBMSG_PAGE_S CbPage)
{
-
msg_error_t err = MSG_SUCCESS;
unsigned int rowId = 0;
if (err != MSG_SUCCESS)
return err;
- // Add Folder
+ /* Add Folder */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, %d);",
MSGFW_RECEIVED_CB_MSG_TABLE_NAME, rowId, CbPage.pageHeader.serialNum.geoScope,
- CbPage.pageHeader.serialNum.msgCode,CbPage.pageHeader.msgId, CbPage.pageHeader.serialNum.updateNum);
+ CbPage.pageHeader.serialNum.msgCode, CbPage.pageHeader.msgId, CbPage.pageHeader.serialNum.updateNum);
if (dbHandle->execQuery(sqlQuery) != MSG_SUCCESS)
return MSG_ERR_DB_EXEC;
return MSG_SUCCESS;
-
}
#endif
return err;
}
- char contentType[MAX_WAPPUSH_CONTENT_TYPE_LEN + 1] = {0,};
- char appId[MAX_WAPPUSH_ID_LEN + 1] = {0,};
+ char contentType[MAX_WAPPUSH_CONTENT_TYPE_LEN + 1] = {0, };
+ char appId[MAX_WAPPUSH_ID_LEN + 1] = {0, };
int appcode = 0, default_appcode = 0;
bool found = false;
char *_content_type = NULL, *_app_id = NULL;
dbHandle->getColumnToString(index++, MAX_WAPPUSH_ID_LEN + 1, appId);
appcode = dbHandle->getColumnToInt(index++);
- //MSG_DEBUG("content_type: %s, app_id: %s", content_type, app_id);
+ /* MSG_DEBUG("content_type: %s, app_id: %s", content_type, app_id); */
_content_type = strcasestr(pPushHeader, contentType);
if (_content_type) {
_app_id = strcasestr(pPushHeader, appId);
std::list<PUSH_APPLICATION_INFO_S>::iterator it = pushAppInfoList.begin();
int count = 0;
for (; it != pushAppInfoList.end(); it++) {
- if (index == count){
+ if (index == count) {
*appcode = it->appcode;
break;
}
{
MSG_BEGIN();
MsgDbHandler *dbHandle = getDbHandle();
- char sqlQuery[MAX_QUERY_LEN+1] = {0,};
+ char sqlQuery[MAX_QUERY_LEN+1] = {0, };
msg_thread_id_t convId = 0;
dbHandle->beginTrans();
==================================================================================================*/
SmsPluginTpduCodec::SmsPluginTpduCodec()
{
-
-
}
SmsPluginTpduCodec::~SmsPluginTpduCodec()
{
-
-
}
#if 0
printf("\n\n[encodeSubmit] pTpdu data.\n");
- for (int i = 0; i < offset; i++)
- {
+ for (int i = 0; i < offset; i++) {
printf(" [%02x]", pTpdu[i]);
}
printf("\n\n");
}
#else
- //For alphanumeric address test
+ /* For alphanumeric address test */
offset += SmsPluginParamCodec::decodeAddress(&pTpdu[offset], &(pDeliver->originAddress));
pDeliver->pid = 0x20;
offset++;
offset += SmsPluginParamCodec::decodeDCS((unsigned char*)address, &(pDeliver->dcs));
- // end test
+ /* end test */
#endif
if (pDeliver->pid == 0x20 && pDeliver->originAddress.ton == SMS_TON_ALPHANUMERIC) {
#ifdef LOG_ENABLE
printf("\n\n[decodeStatusReport] pTpdu data - Length [%d]\n", TpduLen);
- for (int i = 0; i < TpduLen; i++)
- {
+ for (int i = 0; i < TpduLen; i++) {
printf(" [%02x]", pTpdu[i]);
}
printf("\n\n");
SmsPluginTransport::~SmsPluginTransport()
{
-
}
{
MSG_BEGIN();
- SMS_TPDU_S tpdu = {0,};
+ SMS_TPDU_S tpdu = {0, };
tpdu.tpduType = SMS_TPDU_SUBMIT;
setSmsReportOption(pReqInfo, &tpdu);
/* Set SMSC Options */
- SMS_ADDRESS_S smsc = {0,};
+ SMS_ADDRESS_S smsc = {0, };
setSmscOptions(pReqInfo->msgInfo.sim_idx, &smsc);
/* Get TAPI handle */
for (int i = 0; i < pReqInfo->msgInfo.nAddressCnt; i++) {
/* Make SMS_SUBMIT_DATA_S from MSG_REQUEST_INFO_S */
- SMS_SUBMIT_DATA_S submitData = {{0},};
+ SMS_SUBMIT_DATA_S submitData = {{0}, };
msgInfoToSubmitData(&(pReqInfo->msgInfo), &submitData, &(tpdu.data.submit.dcs.codingScheme), i);
/* Insert message reference into db */
memcpy(&(sentInfo.reqInfo), pReqInfo, sizeof(SMS_REQUEST_INFO_S));
- if ((segCnt + 1) == submitData.segCount && (i + 1)==pReqInfo->msgInfo.nAddressCnt) {
+ if ((segCnt + 1) == submitData.segCount && (i + 1) == pReqInfo->msgInfo.nAddressCnt) {
sentInfo.bLast = true;
bMoreMsg = FALSE;
} else {
int svc_type;
tel_get_property_int(handle, TAPI_PROP_NETWORK_SERVICE_TYPE, &svc_type);
- if (svc_type < TAPI_NETWORK_SERVICE_TYPE_2G){
+ if (svc_type < TAPI_NETWORK_SERVICE_TYPE_2G) {
MSG_DEBUG("Network service is not available : [%d]", svc_type);
SmsPluginEventHandler::instance()->handleSentStatus(MSG_NETWORK_SEND_PENDING);
MsgInsertTicker("Unable to send message. It will be sent when service available.", SMS_MESSAGE_SENDING_PENDING, false, 0);
MSG_DEBUG("retMoCtrlStatus = [%d]", retMoCtrlStatus);
if (retMoCtrlStatus == TAPI_SAT_CALL_CTRL_R_ALLOWED_WITH_MOD) {
-
if (bRetryByMoCtrl == false) {
bRetryByMoCtrl = true;
}
#ifdef MSG_SMS_REPORT
- if (err == MSG_SUCCESS && tmpInfo.msgInfo.msgPort.valid == false) {
+ if (err == MSG_SUCCESS && tmpInfo.msgInfo.msgPort.valid == false) {
if (pReqInfo->sendOptInfo.bDeliverReq == true) {
MSG_DEBUG("Update Delivery Report Status : [%d] Msg ID : [%d]", err, tmpInfo.msgInfo.msgId);
/* Adding delivery report status info. */
- MsgStoAddDeliveryReportStatus( tmpInfo.msgInfo.msgId, (unsigned char)tmpInfo.msgInfo.referenceId);
+ MsgStoAddDeliveryReportStatus(tmpInfo.msgInfo.msgId, (unsigned char)tmpInfo.msgInfo.referenceId);
}
}
#endif
if (tpdu.data.submit.userData.headerCnt > 0)
tpdu.data.submit.userData.headerCnt--;
-
}
}
#if 0
tapiRet = tel_set_sms_memory_status(handle, TAPI_NETTEXT_PDA_MEMORY_STATUS_FULL, TapiEventMemoryStatus, NULL);
- if (tapiRet == TAPI_API_SUCCESS)
- {
+ if (tapiRet == TAPI_API_SUCCESS) {
MSG_DEBUG("######## tel_set_sms_memory_status() Success !!! #######");
- }
- else
- {
+ } else {
MSG_DEBUG("######## tel_set_sms_memory_status() Failed !!! return : [%d] #######", tapiRet);
}
#endif
/*response = TAPI_NETTEXT_PROTOCOL_ERROR;
For gcf test [34.2.5.3 class2 message] */
response = TAPI_NETTEXT_SIM_FULL;
-
}
MSG_DEBUG("err : [%d], response : [%02x]", err, response);
/*response = TAPI_NETTEXT_PROTOCOL_ERROR;
For gcf test [34.2.5.3 class2 message] */
response = TAPI_NETTEXT_SIM_FULL;
-
}
MSG_DEBUG("err : [%d], response : [%02x]", err, response);
MSG_DEBUG("DCS : %d", pSubmit->dcs.codingScheme);
- MSG_SMSC_LIST_S smscList = {0,};
+ MSG_SMSC_LIST_S smscList = {0, };
SmsPluginSetting::instance()->getSmscListInfo(simIndex, &smscList);
int selectIdx = smscList.selected;
void SmsPluginTransport::setSmscOptions(int simIndex, SMS_ADDRESS_S *pSmsc)
{
/* Set SMSC Options */
- MSG_SMSC_LIST_S smscList = {0,};
+ MSG_SMSC_LIST_S smscList = {0, };
SmsPluginSetting::instance()->getSmscListInfo(simIndex, &smscList);
int selectIdx = smscList.selected;
pDstHeader->udhType = pSrcHeader->udhType;
switch (pDstHeader->udhType) {
- case SMS_UDH_CONCAT_8BIT :
- {
+ case SMS_UDH_CONCAT_8BIT: {
pDstHeader->udh.concat8bit.msgRef = pSrcHeader->udh.concat8bit.msgRef;
pDstHeader->udh.concat8bit.totalSeg = pSrcHeader->udh.concat8bit.totalSeg;
pDstHeader->udh.concat8bit.seqNum = pSrcHeader->udh.concat8bit.seqNum;
}
break;
- case SMS_UDH_CONCAT_16BIT :
- {
+ case SMS_UDH_CONCAT_16BIT: {
pDstHeader->udh.concat16bit.msgRef = pSrcHeader->udh.concat16bit.msgRef;
pDstHeader->udh.concat16bit.totalSeg = pSrcHeader->udh.concat16bit.totalSeg;
pDstHeader->udh.concat16bit.seqNum = pSrcHeader->udh.concat16bit.seqNum;
SmsPluginUAManager::~SmsPluginUAManager()
{
-
}
void SmsPluginUAManager::addReqEntity(SMS_REQUEST_INFO_S *request)
{
- SMS_REQUEST_INFO_S reqTmp = {0,};
+ SMS_REQUEST_INFO_S reqTmp = {0, };
memcpy(&reqTmp, request, sizeof(SMS_REQUEST_INFO_S));
==================================================================================================*/
SmsPluginUDCodec::SmsPluginUDCodec()
{
-
}
SmsPluginUDCodec::~SmsPluginUDCodec()
{
-
}
pHeader->udhType = pTpdu[offset++];
switch (pHeader->udhType) {
- case SMS_UDH_CONCAT_8BIT :
- {
+ case SMS_UDH_CONCAT_8BIT: {
IEDL = pTpdu[offset++];
if (IEDL == 0)
}
break;
- case SMS_UDH_CONCAT_16BIT :
- {
+ case SMS_UDH_CONCAT_16BIT: {
IEDL = pTpdu[offset++];
if (IEDL == 0)
}
break;
- case SMS_UDH_APP_PORT_8BIT :
- {
+ case SMS_UDH_APP_PORT_8BIT: {
IEDL = pTpdu[offset++];
if (IEDL == 0)
}
break;
- case SMS_UDH_APP_PORT_16BIT :
- {
+ case SMS_UDH_APP_PORT_16BIT: {
IEDL = pTpdu[offset++];
if (IEDL == 0)
}
break;
- case SMS_UDH_SPECIAL_SMS :
- {
+ case SMS_UDH_SPECIAL_SMS: {
IEDL = pTpdu[offset++];
if (IEDL != 2)
}
break;
- case SMS_UDH_ALTERNATE_REPLY_ADDRESS :
- {
+ case SMS_UDH_ALTERNATE_REPLY_ADDRESS: {
IEDL = pTpdu[offset++];
if (IEDL == 0)
}
break;
- case SMS_UDH_SINGLE_SHIFT :
- {
+ case SMS_UDH_SINGLE_SHIFT: {
IEDL = pTpdu[offset++];
if (IEDL == 0)
}
break;
- case SMS_UDH_LOCKING_SHIFT :
- {
+ case SMS_UDH_LOCKING_SHIFT: {
IEDL = pTpdu[offset++];
if (IEDL == 0)
}
break;
- default :
- {
+ default: {
MSG_DEBUG("Not Supported Header Type [%02x]", pHeader->udhType);
IEDL = pTpdu[offset++];
#include <drm_client.h>
#endif
-static unsigned short wapPushPortList [] = {0x0b84, 0x0b85, 0x23F0, 0x23F1, 0x23F2, 0x23F3, 0xC34F};
+static unsigned short wapPushPortList[] = {0x0b84, 0x0b85, 0x23F0, 0x23F1, 0x23F2, 0x23F3, 0xC34F};
#if 0
-const SMS_PUSH_APP_INFO_S pushDefaultApplication [] =
+const SMS_PUSH_APP_INFO_S pushDefaultApplication[] =
{
{(char*)"text/vnd.wap.si", (char*)"X-Wap-Application-Id: x-wap-application:wml.ua\r\n", SMS_WAP_APPLICATION_PUSH_SI},
{(char*)"application/vnd.wap.sic", (char*)"X-Wap-Application-Id: x-wap-application:wml.ua\r\n", SMS_WAP_APPLICATION_PUSH_SIC},
{ (char*)"application/vnd.wap.multipart.byteranges", 0x25 },
{ (char*)"application/vnd.wap.multipart.alternative", 0x26 },
{ (char*)"application/xml", 0x27 },
- { (char*)"text/xml",0x28 },
+ { (char*)"text/xml", 0x28 },
{ (char*)"application/vnd.wap.wbxml", 0x29 },
{ (char*)"application/x-x968-cross-cert", 0x2a },
{ (char*)"application/x-x968-ca-cert", 0x2b },
const SMS_WSP_SECURITY_TYPE_S wspSecurityType[] = {
- {(char*)"NETWPIN",0x00},
- {(char*)"USERPIN",0x01},
- {(char*)"USERNETWPIN",0x02},
- {(char*)"USERPINMAC",0x03}
+ {(char*)"NETWPIN", 0x00},
+ {(char*)"USERPIN", 0x01},
+ {(char*)"USERNETWPIN", 0x02},
+ {(char*)"USERPINMAC", 0x03}
};
SmsPluginWapPushHandler::~SmsPluginWapPushHandler()
{
-
}
if (pUserData->header[i].udhType == SMS_UDH_APP_PORT_8BIT) {
/** Have to check something??? */
} else if (pUserData->header[i].udhType == SMS_UDH_APP_PORT_16BIT) {
-
for (int j = 0; j < PortCount; j++) {
if (pUserData->header[i].udh.appPort16bit.destPort == wapPushPortList[j]) {
MSG_DEBUG("Wap Push Msg : [%04x]", wapPushPortList[j]);
MSG_DEBUG("Application Count [%d]", appCount);
for (int i = 0; i < appCount; i++) {
-
header = (unsigned char*)strcasestr(pPushHeader, pushDefaultApplication[i].pContentType);
if (header != NULL) {
MSG_DEBUG("wspBodyLen [%d]", wspBodyLen);
if (wspHeaderLen > 0) {
-
pWspHeader = new char[wspHeaderLen];
if (pWspHeader == NULL) {
wspBodyLen = PDUTypeDataLen - wspHeaderLen;
if (wspBodyLen > 0) {
-
pWspBody = new char[wspBodyLen];
if (pWspBody == NULL) {
case SMS_WAP_APPLICATION_DRM_V2_ROAP_TRIGGER_XML:
case SMS_WAP_APPLICATION_DRM_V2_ROAP_TRIGGER_WBXML:
MSG_DEBUG("Received DRM V2");
- // TODO: DRM V2
+ /* TODO: DRM V2 */
break;
case SMS_WAP_APPLICATION_PUSH_EMAIL:
case SMS_WAP_APPLICATION_PUSH_EMAIL_XML:
case SMS_WAP_APPLICATION_PUSH_EMAIL_WBXML:
MSG_DEBUG("Received Email");
- // TODO: Email
+ /* TODO: Email */
break;
case SMS_WAP_APPLICATION_PUSH_IMPS_CIR:
MSG_DEBUG("Received IMPS CIR");
- // TODO: IMPS CIR
+ /* TODO: IMPS CIR */
break;
case SMS_WAP_APPLICATION_LBS :
MSG_DEBUG("Received LBS related message");
SmsPluginEventHandler::instance()->handleLBSMsgIncoming(pPushHeader, pPushBody, PushBodyLen);
- // TODO: LBS
+ /* TODO: LBS */
break;
case SMS_WAP_APPLICATION_PUSH_SIA :
MSG_DEBUG("Received SIA");
- // TODO: SIA
+ /* TODO: SIA */
break;
default:
case SMS_WAP_APPLICATION_PUSH_PROVISIONING_WBXML:
case SMS_WAP_APPLICATION_PUSH_BROWSER_SETTINGS:
case SMS_WAP_APPLICATION_PUSH_BROWSER_BOOKMARKS:
- case SMS_WAP_APPLICATION_SYNCML_DM_NOTIFICATION:
- {
+ case SMS_WAP_APPLICATION_SYNCML_DM_NOTIFICATION: {
connection_agent = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
if (error) {
MSG_DEBUG("Connecting to system bus failed: %s\n", error->message);
goto _DBUS_ERROR;
}
- dbus_proxy_service =g_dbus_proxy_new_sync(connection_service, G_DBUS_PROXY_FLAGS_NONE, NULL,
+ dbus_proxy_service = g_dbus_proxy_new_sync(connection_service, G_DBUS_PROXY_FLAGS_NONE, NULL,
"org.tizen.omadmservice", "/org/tizen/omadmservice",
"org.tizen.omadmservice", NULL, &error);
if (error) {
}
break;
case SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION:
- case SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION_WBXML:
- {
+ case SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION_WBXML: {
connection_agent = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
if (error) {
MSG_DEBUG("Connecting to system bus failed: %s\n", error->message);
msg_error_t err = MSG_SUCCESS;
int pushEvt_cnt = 0;
- char app_id[MAX_WAPPUSH_ID_LEN] = {0,};
- char content_type[MAX_WAPPUSH_CONTENT_TYPE_LEN] = {0,};
+ char app_id[MAX_WAPPUSH_ID_LEN] = {0, };
+ char content_type[MAX_WAPPUSH_CONTENT_TYPE_LEN] = {0, };
SmsPluginStorage *storageHandler = SmsPluginStorage::instance();
err = storageHandler->getRegisteredPushEvent(pPushHeader, &pushEvt_cnt, app_id, sizeof(app_id), content_type, sizeof(content_type));
xmlFreeDoc(xmlDoc);
return;
} else {
- MSG_SEC_DEBUG("Not an empty Document and topNode->name = %s \n",topNode->name);
+ MSG_SEC_DEBUG("Not an empty Document and topNode->name = %s \n", topNode->name);
}
indNode = topNode;
while (indNode != NULL) {
if (!xmlStrcmp(indNode->name, (const xmlChar*)"sl")) {
- MSG_SEC_DEBUG("indNode->name = %s\n",indNode->name);
+ MSG_SEC_DEBUG("indNode->name = %s\n", indNode->name);
break;
}
while (indNode != NULL) {
-
xmlChar* tmpUrl = NULL;
if (!xmlStrcmp(indNode->name, (const xmlChar*)SMS_PUSH_XML_INVAL_OBJ)) {
MSG_SEC_DEBUG("indNode->name = %s\n", indNode->name);
MSG_DEBUG("NO href value from the xmlDoc\n");
}
} else if (!xmlStrcmp(indNode->name, (const xmlChar*)SMS_PUSH_XML_INVAL_SVC)) {
- MSG_SEC_DEBUG("indNode->name = %s\n",indNode->name);
+ MSG_SEC_DEBUG("indNode->name = %s\n", indNode->name);
tmpUrl = xmlGetProp(indNode, (xmlChar*)SMS_PUSH_XML_CO_URI);
if (tmpUrl != NULL) {
*pXmlDoc = xmlParseMemory((char*)xmldata, AcStrlen((char*)xmldata));
}
-
}
unsigned long SmsPluginWapPushHandler::convertXmlCharToSec(char* pDate)
memset(&timeStruct, 0x00, sizeof(struct tm));
/** check pDate */
- if (AcStrlen(pDate)<20)
+ if (AcStrlen(pDate) < 20)
return 0;
MSG_DEBUG("pDate [%s]", pDate);
/** signal-medium is default action value. */
return MSG_PUSH_SI_ACTION_SIGNAL_MEDIUM;
-
}
msg_push_action_t SmsPluginWapPushHandler::convertSLActionStrToEnum(char* pAction)
/** default SL action value is execute-low. */
return MSG_PUSH_SL_ACTION_EXECUTE_LOW;
-
}
decodedValue = wspDecodeUintvar(i + 1, sourceData + *currentPointer);
*currentPointer = *currentPointer + i + 1;
- MSG_DEBUG("wspRetriveUintvarDecode: decodedValue=%d .\n",decodedValue);
+ MSG_DEBUG("wspRetriveUintvarDecode: decodedValue=%d .\n", decodedValue);
return decodedValue;
}
szBuf[0] = 0x00;
MSG_DEBUG("wspDecodeHeader: RAW data \n");
- for (loop = 0 ; loop<(int)encodedHeaderLen; loop++) {
+ for (loop = 0 ; loop < (int)encodedHeaderLen; loop++) {
char szTempBuf[5];
szTempBuf[0] = 0x00;
snprintf(szTempBuf, sizeof(szTempBuf), "%2X ", sEncodedHeader[loop]);
}
strncat(szBuf, "\n", sizeof(szBuf)-AcStrlen(szBuf)-1);
MSG_DEBUG("[%s]", szBuf);
- MSG_DEBUG("fContentType=%d \n",fContentType);
+ MSG_DEBUG("fContentType=%d \n", fContentType);
/* operation for content-type */
/* makes psuedo- content-type fieldcode */
/* content - type is processed with header. But it's come without field code. So existence of fContentType can decide adding content type header field code whether ContentType + general header is or not. */
unsigned char* fieldName = (unsigned char*)gWapCodeBufferLeft;
unsigned char* fieldValue = (unsigned char*)gWapCodeBufferRight;
- strncpy((char*)fieldName, (char*)(encodedHeader + iEncodedHeader),WSP_CODE_BUFFER_LEFT_LEN_MAX-1);
+ strncpy((char*)fieldName, (char*)(encodedHeader + iEncodedHeader), WSP_CODE_BUFFER_LEFT_LEN_MAX-1);
fieldName[WSP_CODE_BUFFER_LEFT_LEN_MAX-1] = '\0';
iEncodedHeader = iEncodedHeader + AcStrlen((char*)fieldName) + 1;
strncpy((char*)fieldValue, (char*)(encodedHeader + iEncodedHeader), WSP_CODE_BUFFER_RIGHT_LEN_MAX-1);
} else if (track > 0x7f) {
/* In case of first byte is field code, else case is error. */
- /*if ((track & 0x7f) <= wspHeaderFieldCount) */
- {
-
+ /*if ((track & 0x7f) <= wspHeaderFieldCount) { */
unsigned long fieldValueLen = encodedHeader[iEncodedHeader + 1];
unsigned char fieldValue[1275];
fieldCode = track & 0x7f;
/* field value is string */
/* In this case, it just copy field value. */
if ((fieldValueLen > LENGTH_QUOTE) && (fieldValueLen < 0x80)) {
-
/* string field value should be NULL terminated */
strncat((char*)temper, (char*)(encodedHeader + iEncodedHeader + 1), (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
strncat((char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
it's decoded by above value.
*/
if (fieldValueLen < 0x20) {
-
if (fieldValueLen == LENGTH_QUOTE) {
-
/* field length is encoded in UINTVAR */
unsigned long uintvarLen = 0;
fieldValueLen = wspRetriveUintvarDecode((unsigned char*) encodedHeader + iEncodedHeader + 2, &uintvarLen);
iEncodedHeader = iEncodedHeader + fieldValueLen + uintvarLen + 2;
} else {
-
if (fieldValueLen == 1) {
/* field value is one byte integer over 0x80 */
/** make it two byte integer */
switch (fieldCode) {
/* accept charset */
/* It's normal way of field process. */
- case 0x01 :
- {
- unsigned long i = 0;
- unsigned long code;
-
- /* Case of length of charset greater than 1 are two thigins.
- 1. code length of charset is greater than 1.
- 2. It include parameter.
- 3. Or both of two
- */
- if (1 != fieldValueLen) {
- code = wspHeaderDecodeInteger(fieldValue);
- /* Calculate iField. */
- if (fieldValue[0] < 0x80)
- iField = fieldValue[0];
- else
- iField = 1;
-
- while (wspCharset[i].charsetCode != code)
- i++;
- strncat((char*)temper, (char*)wspCharset[i].charsetName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- /* If parameter exist */
- if (iField < fieldValueLen) {
- char* param = NULL;
- unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
- wspHeaderDecodeQValue(fieldValueLen - iField, fieldValue + iField, ¶m);
- strncat((char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- }
- } else {
- code = fieldValue[0] & 0x7f;
+ case 0x01: {
+ unsigned long i = 0;
+ unsigned long code;
+
+ /* Case of length of charset greater than 1 are two thigins.
+ 1. code length of charset is greater than 1.
+ 2. It include parameter.
+ 3. Or both of two
+ */
+ if (1 != fieldValueLen) {
+ code = wspHeaderDecodeInteger(fieldValue);
+ /* Calculate iField. */
+ if (fieldValue[0] < 0x80)
+ iField = fieldValue[0];
+ else
+ iField = 1;
- while ((wspCharset[i].charsetCode != code) && (wspCharset[i].charsetCode != 0xffff )) i++;
- strncat((char*)temper, (char*)wspCharset[i].charsetName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ while (wspCharset[i].charsetCode != code)
+ i++;
+ strncat((char*)temper, (char*)wspCharset[i].charsetName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ /* If parameter exist */
+ if (iField < fieldValueLen) {
+ char* param = NULL;
+ unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
+ wspHeaderDecodeQValue(fieldValueLen - iField, fieldValue + iField, ¶m);
+ strncat((char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
+ } else {
+ code = fieldValue[0] & 0x7f;
+ while ((wspCharset[i].charsetCode != code) && (wspCharset[i].charsetCode != 0xffff )) i++;
+ strncat((char*)temper, (char*)wspCharset[i].charsetName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
- break;
+ }
+ break;
/* type encoding */
/* Like below routine, Same decoding routine process together. */
/* Accept-encoding */
- case 0x02 :
+ case 0x02:
/* content-encoding */
- case 0x0b :
- {
- int integerValue;
+ case 0x0b: {
+ int integerValue;
- integerValue = wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen);
- if (integerValue > 2) {
- MSG_DEBUG("WspLDecodeHeader: integerValue is over limit(2).\n");
- break;
- }
- strncat((char*)temper, (char*)wspEncodeMethod[integerValue], (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ integerValue = wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen);
+ if (integerValue > 2) {
+ MSG_DEBUG("WspLDecodeHeader: integerValue is over limit(2).\n");
+ break;
}
- break;
+ strncat((char*)temper, (char*)wspEncodeMethod[integerValue], (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ break;
/* contents type decoder */
/* accept */
- case 0x00 :
+ case 0x00:
/* content-type */
- case 0x11 :
- {
- unsigned long contentsTypeCode;
- unsigned long i = 0;
- /* encoded content type length body */
- unsigned long tempLen;
- MSG_DEBUG("fieldValueLen: %d", fieldValueLen);
-
- /* Like HTTP result state 304, it's for processing without Content type. This part doesn't defined. */
- if (0 == fieldValueLen) {
- strncat((char*)temper, (char*)"None" , (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- break;
- }
- /* 01 AE --> 00 AE --> AE*/
- if (fieldValueLen == 2 && fieldValue[0] == 0) {
- memcpy(fieldValue, encodedHeader + iEncodedHeader -1, (size_t)fieldValueLen-1);
- MSG_DEBUG("WspLDecodeHeader:For mmO2 problem\r\n");
- }
-
- if ((fieldValue[0] < 0x20) || (fieldValue[0] >= 0x80)) {
- if (fieldValue[0] >= 0x80) {
- tempLen = 1;
- } else if (fieldValueLen == 2 && fieldValue[0] == 0x03 && fieldValue[1] == 0x0A) { /** 06 05 02 03 0A AF 89 */
- fieldValue[3] = fieldValue[2];
- fieldValue[2] = fieldValue[1];
- fieldValue[1] = fieldValue[0];
- fieldValue[0] = 0x02;
- tempLen = 2;
- fieldValueLen = 3;
- MSG_DEBUG("WspLDecodeHeader:For CPE problem\r\n");
- } else {
- tempLen = fieldValue[0]; /** 06 06 03 02 03 16 AF 88 */
- }
-
- if (tempLen == 1) {
-
- char* szExtendedContent;
-
- contentsTypeCode = fieldValue[0] & 0x7f;
- while ((wspContentsType[i].contentsTypeCode != contentsTypeCode) && (i < wspContentsTypeCount)) i++;
+ case 0x11: {
+ unsigned long contentsTypeCode;
+ unsigned long i = 0;
+ /* encoded content type length body */
+ unsigned long tempLen;
+ MSG_DEBUG("fieldValueLen: %d", fieldValueLen);
+
+ /* Like HTTP result state 304, it's for processing without Content type. This part doesn't defined. */
+ if (0 == fieldValueLen) {
+ strncat((char*)temper, (char*)"None" , (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ break;
+ }
+ /* 01 AE --> 00 AE --> AE*/
+ if (fieldValueLen == 2 && fieldValue[0] == 0) {
+ memcpy(fieldValue, encodedHeader + iEncodedHeader -1, (size_t)fieldValueLen-1);
+ MSG_DEBUG("WspLDecodeHeader:For mmO2 problem\r\n");
+ }
- /* If specified content type doesn't exist */
- if (i < wspContentsTypeCount)
- strncat((char*)temper, (char*)wspContentsType[i].contentsTypeName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ if ((fieldValue[0] < 0x20) || (fieldValue[0] >= 0x80)) {
+ if (fieldValue[0] >= 0x80) {
+ tempLen = 1;
+ } else if (fieldValueLen == 2 && fieldValue[0] == 0x03 && fieldValue[1] == 0x0A) { /** 06 05 02 03 0A AF 89 */
+ fieldValue[3] = fieldValue[2];
+ fieldValue[2] = fieldValue[1];
+ fieldValue[1] = fieldValue[0];
+ fieldValue[0] = 0x02;
+ tempLen = 2;
+ fieldValueLen = 3;
+ MSG_DEBUG("WspLDecodeHeader:For CPE problem\r\n");
+ } else {
+ tempLen = fieldValue[0]; /** 06 06 03 02 03 16 AF 88 */
+ }
- szExtendedContent = wspExtendedDecodeType((char)contentsTypeCode);
+ if (tempLen == 1) {
+ char* szExtendedContent;
- if (szExtendedContent != NULL) {
- MSG_DEBUG("WspLDecodeHeader: Tele2 server problem \n ");
- strncat((char*)temper, (char*)szExtendedContent, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- }
- } else {
- contentsTypeCode = wspHeaderDecodeInteger(fieldValue);
+ contentsTypeCode = fieldValue[0] & 0x7f;
+ while ((wspContentsType[i].contentsTypeCode != contentsTypeCode) && (i < wspContentsTypeCount)) i++;
- while ((i < wspUnregisteredContentsTypeCount) && (wspUnregisterContentsType[i].contentsTypeCode != contentsTypeCode)) i++;
+ /* If specified content type doesn't exist */
+ if (i < wspContentsTypeCount)
+ strncat((char*)temper, (char*)wspContentsType[i].contentsTypeName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- /** If there is a Content-Type assigned, */
- if (i < wspUnregisteredContentsTypeCount)
- strncat ((char*)temper, (char*)wspUnregisterContentsType[i].contentsTypeName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ szExtendedContent = wspExtendedDecodeType((char)contentsTypeCode);
- tempLen +=1;
+ if (szExtendedContent != NULL) {
+ MSG_DEBUG("WspLDecodeHeader: Tele2 server problem \n ");
+ strncat((char*)temper, (char*)szExtendedContent, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
} else {
- tempLen = AcStrlen((char*)fieldValue) + 1;
+ contentsTypeCode = wspHeaderDecodeInteger(fieldValue);
+
+ while ((i < wspUnregisteredContentsTypeCount) && (wspUnregisterContentsType[i].contentsTypeCode != contentsTypeCode)) i++;
- strncat ((char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- MSG_DEBUG("WspLDecodeHeader: Attention, Decoding Check of Content-Type\n ", tempLen);
+ /** If there is a Content-Type assigned, */
+ if (i < wspUnregisteredContentsTypeCount)
+ strncat((char*)temper, (char*)wspUnregisterContentsType[i].contentsTypeName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+
+ tempLen +=1;
}
+ } else {
+ tempLen = AcStrlen((char*)fieldValue) + 1;
- /* If there is a parameter */
- if (tempLen < fieldValueLen) {
- char* param = NULL;
- unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
- wspHeaderDecodeParameter(fieldValue + tempLen, fieldValueLen - tempLen, ¶m);
- if (param != NULL) {
- strncat((char*)temper, "; ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- strncat((char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- }
+ strncat((char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ MSG_DEBUG("WspLDecodeHeader: Attention, Decoding Check of Content-Type\n ", tempLen);
+ }
+
+ /* If there is a parameter */
+ if (tempLen < fieldValueLen) {
+ char* param = NULL;
+ unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
+ wspHeaderDecodeParameter(fieldValue + tempLen, fieldValueLen - tempLen, ¶m);
+ if (param != NULL) {
+ strncat((char*)temper, "; ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ strncat((char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
}
- break;
+ }
+ break;
/* language */
/* content-language */
- case 0x0c :
+ case 0x0c:
/* accept-language */
- case 0x03 :
- {
- unsigned long i = 0;
- unsigned long code;
- unsigned long tempLen;
- if ((fieldValue[0] < 0x20) || (fieldValue[0] > 0x80)) {
- if (fieldValue[0] > 0x80)
- tempLen = 1;
- else
- tempLen = fieldValue[0];
- } else {
- tempLen = AcStrlen((char*)fieldValue) + 1;
- }
-
- if (tempLen == 1) {
-
- code = wspHeaderDecodeInteger(fieldValue);
- while (wspLanguage[i].languageCode != code) {
- i++;
- if (i == wspLanguageCount)
- break;
- }
+ case 0x03: {
+ unsigned long i = 0;
+ unsigned long code;
+ unsigned long tempLen;
+ if ((fieldValue[0] < 0x20) || (fieldValue[0] > 0x80)) {
+ if (fieldValue[0] > 0x80)
+ tempLen = 1;
+ else
+ tempLen = fieldValue[0];
+ } else {
+ tempLen = AcStrlen((char*)fieldValue) + 1;
+ }
- if (i < wspLanguageCount) {
- strncat((char*)temper, (char*)wspLanguage[i].languageName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- }
- } else {
- strncat((char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ if (tempLen == 1) {
+ code = wspHeaderDecodeInteger(fieldValue);
+ while (wspLanguage[i].languageCode != code) {
+ i++;
+ if (i == wspLanguageCount)
+ break;
}
- if (tempLen < fieldValueLen) {
- char* param = NULL;
- unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
- wspHeaderDecodeQValue( fieldValueLen - tempLen, fieldValue + tempLen, ¶m);
- strncat((char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ if (i < wspLanguageCount) {
+ strncat((char*)temper, (char*)wspLanguage[i].languageName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
+ } else {
+ strncat((char*)temper, (char*)fieldValue, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
- break;
+
+ if (tempLen < fieldValueLen) {
+ char* param = NULL;
+ unique_ptr<char*, void(*)(char**)> parambuf(¶m, unique_ptr_deleter);
+ wspHeaderDecodeQValue(fieldValueLen - tempLen, fieldValue + tempLen, ¶m);
+ strncat((char*)temper, (char*)param, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ }
+ break;
/* integer */
/* Max-forwards */
- case 0x1e :
+ case 0x1e:
/* content-length */
- case 0x0d :
+ case 0x0d:
/* age */
- case 0x05 :
+ case 0x05:
/* Bearer-indication */
- case 0x33 :
+ case 0x33:
/* Push-Flag */
- case 0x34 :
- {
-
- unsigned char temp[16];
- /*
- if ((fieldValueLen == 2) && (fieldValue[0] > 0x7f))
- AcSprintf((char*)temp, "%u", (unsigned int)fieldValue[1]);
- else
- */
- snprintf((char*)temp, sizeof(temp), "%u", (unsigned int)wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen));
- strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- }
- break;
+ case 0x34: {
+ unsigned char temp[16];
+ /*
+ if ((fieldValueLen == 2) && (fieldValue[0] > 0x7f))
+ AcSprintf((char*)temp, "%u", (unsigned int)fieldValue[1]);
+ else
+ */
+ snprintf((char*)temp, sizeof(temp), "%u", (unsigned int)wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen));
+ strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ break;
/* X-Wap-Application-Id */
- case 0x2f :
- {
- unsigned char temp[64];
- int integerValue;
-
- if (track == 0xaf) { /* WAP short-integer-encoded */
- if (fieldValueLen == 2 && fieldValue[0] == 0) {
- memcpy(fieldValue, encodedHeader + iEncodedHeader -1, (size_t)fieldValueLen);
- }
- integerValue = wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen);
- } else {
- if (fieldValueLen == 2 && fieldValue[0] == 0) {
- memcpy(fieldValue, encodedHeader + iEncodedHeader -1, (size_t)fieldValueLen-1);
- MSG_DEBUG("WspLDecodeHeader:For mmO2 problem\r\n");
- fieldValueLen = 1;
- }
- integerValue = wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen);
+ case 0x2f: {
+ unsigned char temp[64];
+ int integerValue;
+
+ if (track == 0xaf) { /* WAP short-integer-encoded */
+ if (fieldValueLen == 2 && fieldValue[0] == 0) {
+ memcpy(fieldValue, encodedHeader + iEncodedHeader -1, (size_t)fieldValueLen);
}
+ integerValue = wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen);
+ } else {
+ if (fieldValueLen == 2 && fieldValue[0] == 0) {
+ memcpy(fieldValue, encodedHeader + iEncodedHeader -1, (size_t)fieldValueLen-1);
+ MSG_DEBUG("WspLDecodeHeader:For mmO2 problem\r\n");
+ fieldValueLen = 1;
+ }
+ integerValue = wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen);
+ }
- MSG_DEBUG("integerValue = [%02x]", integerValue);
+ MSG_DEBUG("integerValue = [%02x]", integerValue);
- int count = sizeof(wspHeaderApplId)/sizeof(SMS_WSP_HEADER_PARAMETER_S);
- for (int i = 0; i < count ; ++i) {
- if ((unsigned int)integerValue == wspHeaderApplId[i].parameterCode) {
- snprintf((char*)temp, 64, "%s", wspHeaderApplId[i].parameterToken);
- strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
- break;
- }
+ int count = sizeof(wspHeaderApplId)/sizeof(SMS_WSP_HEADER_PARAMETER_S);
+ for (int i = 0; i < count ; ++i) {
+ if ((unsigned int)integerValue == wspHeaderApplId[i].parameterCode) {
+ snprintf((char*)temp, 64, "%s", wspHeaderApplId[i].parameterToken);
+ strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
+ break;
}
}
- break;
+ }
+ break;
/* Accept-Application */
- case 0x32 :
+ case 0x32:
if (0x80 == fieldValue[0]) {
strncat((char*)temper, "*", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
} else {
-
unsigned char temp[16];
/*
if ((fieldValueLen == 2) && (fieldValue[0] == 1))
/* date */
/* last-modified */
- case 0x1d :
+ case 0x1d:
/* if-unmodified-since */
- case 0x1b :
+ case 0x1b:
/* if-range */
- case 0x1a :
+ case 0x1a:
/* if-modified-since */
- case 0x17 :
+ case 0x17:
/* expires */
- case 0x14 :
+ case 0x14:
/* date */
- case 0x12 :
- {
- char* decodedString = NULL;
- unique_ptr<char*, void(*)(char**)> decodedStringbuf(&decodedString, unique_ptr_deleter);
- wspHeaderDecodeDateValue(fieldValueLen, fieldValue, &decodedString);
- strncat((char*)temper, (char*)decodedString, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
- }
- break;
+ case 0x12: {
+ char* decodedString = NULL;
+ unique_ptr<char*, void(*)(char**)> decodedStringbuf(&decodedString, unique_ptr_deleter);
+ wspHeaderDecodeDateValue(fieldValueLen, fieldValue, &decodedString);
+ strncat((char*)temper, (char*)decodedString, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
+ }
+ break;
/* connection */
- case 0x09 :
+ case 0x09:
if (fieldValue[0] == 0x80)
strncat((char*)temper, "Close", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
break;
/* accept-ranges */
- case 0x04 :
+ case 0x04:
if (fieldValue[0] == 0x80)
strncat((char*)temper, "None", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
if (fieldValue[0] == 0x81)
strncat((char*)temper, "Bytes", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen(temper)-1);
break;
/* content-md5 */
- case 0x0f :
- {
- unsigned char temp[1275];
- memcpy(temp, fieldValue, (size_t)fieldValueLen);
- temp[fieldValueLen] = 0;
- wspHeaderCopyDecodedString(temp, ¤tLength, &temper);
- }
- break;
+ case 0x0f: {
+ unsigned char temp[1275];
+ memcpy(temp, fieldValue, (size_t)fieldValueLen);
+ temp[fieldValueLen] = 0;
+ wspHeaderCopyDecodedString(temp, ¤tLength, &temper);
+ }
+ break;
/* Credential */
/* authorization */
- case 0x07 :
+ case 0x07:
/* proxy - authorization */
- case 0x21 :
+ case 0x21:
if (fieldValue[0] == 0x80) {
char* addString = NULL;
unique_ptr<char*, void(*)(char**)> addStringbuf(&addString, unique_ptr_deleter);
/* Challenge */
/* www - auth */
- case 0x2d :
+ case 0x2d:
/* Proxy-authenticate */
- case 0x20 :
+ case 0x20:
if (0 == fieldValueLen)
break;
if (fieldValue[0] == 0x80) {
break;
/* content -range */
- case 0x10 :
- {
- unsigned long first, len, last;
+ case 0x10: {
+ unsigned long first, len, last;
- unsigned char temp[16];
- iField = 0;
+ unsigned char temp[16];
+ iField = 0;
- strncat((char*)temper," bytes ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ strncat((char*)temper, " bytes ", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- first = wspRetriveUintvarDecode(fieldValue, &iField);
- len = wspRetriveUintvarDecode(fieldValue, &iField);
- /* Originally range of HTTP include entity length. But WSP omit it. Finally to calculate this, it should be get content length from export. If this field is included without content length, then it can get wrong result. This content length can be get by calculating PDU length.
- */
- last = first + contentsLength - 1;
+ first = wspRetriveUintvarDecode(fieldValue, &iField);
+ len = wspRetriveUintvarDecode(fieldValue, &iField);
+ /* Originally range of HTTP include entity length. But WSP omit it. Finally to calculate this, it should be get content length from export. If this field is included without content length, then it can get wrong result. This content length can be get by calculating PDU length.
+ */
+ last = first + contentsLength - 1;
- snprintf((char*)temp, sizeof(temp), "%u-%u/%u", (unsigned int)first, (unsigned int)last, (unsigned int)len);
- strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- }
- break;
+ snprintf((char*)temp, sizeof(temp), "%u-%u/%u", (unsigned int)first, (unsigned int)last, (unsigned int)len);
+ strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ break;
/* cache-control */
- case 0x08 :
- {
- char* cacheString = NULL;
- unique_ptr<char*, void(*)(char**)> cacheStringbuf(&cacheString, unique_ptr_deleter);
+ case 0x08: {
+ char* cacheString = NULL;
+ unique_ptr<char*, void(*)(char**)> cacheStringbuf(&cacheString, unique_ptr_deleter);
- wspHeaderDecodeCacheControl(fieldValue, fieldValueLen, &cacheString);
- strncat((char*)temper, (char*)cacheString, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- }
- break;
+ wspHeaderDecodeCacheControl(fieldValue, fieldValueLen, &cacheString);
+ strncat((char*)temper, (char*)cacheString, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ break;
/* pragma */
- case 0x1f :
+ case 0x1f:
if (fieldValue[0] == 0x80) {
strncat((char*)temper, (char*)wspCacheControl[0], (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
} else {
break;
/* public */
- case 0x22 :
+ case 0x22:
/* allow */
- case 0x06 :
- {
- unsigned long i = 0;
- while (wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen) != wspMethodType[i].methodCode) i++;
- strncat((char*)temper, (char*)wspMethodType[i].methodName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- }
- break;
+ case 0x06: {
+ unsigned long i = 0;
+ while (wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen) != wspMethodType[i].methodCode) i++;
+ strncat((char*)temper, (char*)wspMethodType[i].methodName, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ break;
/* range */
- case 0x23 :
+ case 0x23:
strncat((char*)temper, "bytes=", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
if (fieldValue[0] == 0x80) {
unsigned char temp[16];
suffix = wspRetriveUintvarDecode(fieldValue, &iField);
snprintf((char*)temp, sizeof(temp), "-%u", (unsigned int)suffix);
-
}
break;
/* retry-after */
- case 0x25 :
+ case 0x25:
if (fieldValue[0] == 0x80) {
char* temp = NULL;
unique_ptr<char*, void(*)(char**)> tempbuf(&temp, unique_ptr_deleter);
if (fieldValue[0] == 0x81) {
unsigned char temp[16];
- snprintf((char*)temp, 16, "%u", (unsigned int)wspHeaderDecodeIntegerByLength(fieldValue,fieldValueLen));
+ snprintf((char*)temp, 16, "%u", (unsigned int)wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen));
strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
break;
/* transfer-encoding */
- case 0x27 :
+ case 0x27:
/* No other cases allowed */
if (fieldValue[0] == 0x80)
strncat((char*)temper, "chunked", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
break;
/* vary */
- case 0x2a :
- {
- int integerValue = wspHeaderDecodeIntegerByLength(fieldValue,fieldValueLen);
- if (integerValue > wspHeaderFieldCount) {
- MSG_DEBUG("WspLDecodeHeader: integerValue is over limit(0x%x).\n",wspHeaderFieldCount);
- break;
- }
- strncat((char*)temper, (char*)wspHeaderFieldName[integerValue], (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ case 0x2a: {
+ int integerValue = wspHeaderDecodeIntegerByLength(fieldValue, fieldValueLen);
+ if (integerValue > wspHeaderFieldCount) {
+ MSG_DEBUG("WspLDecodeHeader: integerValue is over limit(0x%x).\n", wspHeaderFieldCount);
+ break;
}
- break;
+ strncat((char*)temper, (char*)wspHeaderFieldName[integerValue], (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ break;
/* warning */
- case 0x2c :
- {
- unsigned char temp[WSP_STANDARD_STR_LEN_MAX];
-
- if (fieldValue[0] < 0x20)
- iField = fieldValue[0];
- else
- iField = 1;
-
- snprintf((char*)temp, sizeof(temp), "%u", (unsigned int)wspHeaderDecodeIntegerByLength(fieldValue, iField));
- strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
- if (iField < fieldValueLen) {
- unsigned char agent[WSP_STANDARD_STR_LEN_MAX];
- unsigned char text[WSP_STANDARD_STR_LEN_MAX];
- strncpy((char*)agent, (char*)(fieldValue + iField),WSP_STANDARD_STR_LEN_MAX-1);
- iField = iField + AcStrlen((char*)agent) + 1;
- strncpy((char*)text, (char*)(fieldValue + iField),WSP_STANDARD_STR_LEN_MAX-1);
- snprintf((char*)temp, sizeof(temp), " %s %s", agent, text);
- wspHeaderCopyDecodedString(temp, ¤tLength, &temper);
- }
+ case 0x2c: {
+ unsigned char temp[WSP_STANDARD_STR_LEN_MAX];
+
+ if (fieldValue[0] < 0x20)
+ iField = fieldValue[0];
+ else
+ iField = 1;
+
+ snprintf((char*)temp, sizeof(temp), "%u", (unsigned int)wspHeaderDecodeIntegerByLength(fieldValue, iField));
+ strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ if (iField < fieldValueLen) {
+ unsigned char agent[WSP_STANDARD_STR_LEN_MAX];
+ unsigned char text[WSP_STANDARD_STR_LEN_MAX];
+ strncpy((char*)agent, (char*)(fieldValue + iField), WSP_STANDARD_STR_LEN_MAX-1);
+ iField = iField + AcStrlen((char*)agent) + 1;
+ strncpy((char*)text, (char*)(fieldValue + iField), WSP_STANDARD_STR_LEN_MAX-1);
+ snprintf((char*)temp, sizeof(temp), " %s %s", agent, text);
+ wspHeaderCopyDecodedString(temp, ¤tLength, &temper);
}
- break;
+ }
+ break;
/* content-disposition */
- case 0x2e :
+ case 0x2e:
if (fieldValue[0] == 0x80)
strncat((char*)temper, "form-data", (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
break;
/* Profile-diff */
- case 0x36 :
+ case 0x36:
temper[AcStrlen((char*)temper) + fieldValueLen] = '\0';
memcpy(temper, fieldValue, (size_t)fieldValueLen);
break;
/* Profile-Warning */
- case 0x37 :
- {
- unsigned char temp[WSP_STANDARD_STR_LEN_MAX];
-
- snprintf((char*)temp, sizeof(temp), "%lX", wspHeaderDecodeInteger(fieldValue));
- temp[2] = temp[1];
- temp[1] = (unsigned char)0x30;
- temp[3] = '\0';
- if (fieldValueLen > 1) {
- /* copy warn-target - URI */
- strncat((char*)temp, (char*)(fieldValue + 1), WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)temp)-1);
- if (fieldValueLen > (AcStrlen((char*)(fieldValue + 1)) + 1)) {
- /* copy warn-date */
- char* decodedString = NULL;
- unique_ptr<char*, void(*)(char**)> decodedStringbuf(&decodedString, unique_ptr_deleter);
- wspHeaderDecodeDateValue(fieldValueLen - (AcStrlen((char*)(fieldValue + 1)) + 2), fieldValue + AcStrlen((char*)(fieldValue + 1)) + 1, &decodedString);
- strncat((char*)temp, (char*)decodedString, WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)temp)-1);
- }
+ case 0x37: {
+ unsigned char temp[WSP_STANDARD_STR_LEN_MAX];
+
+ snprintf((char*)temp, sizeof(temp), "%lX", wspHeaderDecodeInteger(fieldValue));
+ temp[2] = temp[1];
+ temp[1] = (unsigned char)0x30;
+ temp[3] = '\0';
+ if (fieldValueLen > 1) {
+ /* copy warn-target - URI */
+ strncat((char*)temp, (char*)(fieldValue + 1), WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)temp)-1);
+ if (fieldValueLen > (AcStrlen((char*)(fieldValue + 1)) + 1)) {
+ /* copy warn-date */
+ char* decodedString = NULL;
+ unique_ptr<char*, void(*)(char**)> decodedStringbuf(&decodedString, unique_ptr_deleter);
+ wspHeaderDecodeDateValue(fieldValueLen - (AcStrlen((char*)(fieldValue + 1)) + 2), fieldValue + AcStrlen((char*)(fieldValue + 1)) + 1, &decodedString);
+ strncat((char*)temp, (char*)decodedString, WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)temp)-1);
}
- strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
}
- break;
+ strncat((char*)temper, (char*)temp, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)temper)-1);
+ }
+ break;
- default :
+ default:
break;
}
-
- }
+ /*}*/
}
/* It deosn't finished decoding yet. */
if ((iEncodedHeader < encodedHeaderLen) && (fieldCode != 0xff)) {
/* add single header to total headers */
strncat((char*)outTemper, (char*)temper, (WSP_STANDARD_STR_LEN_MAX * 5)-AcStrlen((char*)outTemper)-1);
MSG_DEBUG("WspLDecodeHeader: Single Header : %s\r\n", temper);
-
}
*pHeader = outTemper;
return;
-
}
if (data[0] < 0x80) {
unsigned long IntLen = 0;
- IntLen = (data[0]>0x04) ? 0x04:data[0];
+ IntLen = (data[0] > 0x04) ? 0x04:data[0];
MSG_DEBUG("WspLHeaderDecodeInteger: input %d , length %d\n", data[0], IntLen);
- for (i=0; i<IntLen; i++)
+ for (i = 0; i < IntLen; i++)
returner.seg[IntLen-(i+1)] = data[i+1];
return returner.integer;
}
switch (data[0] & 0x7f) {
- case 0x00 :
- wspHeaderDecodeQValue( length - 1, data + 1, ¶m);
+ case 0x00:
+ wspHeaderDecodeQValue(length - 1, data + 1, ¶m);
break;
- case 0x01 :
+ case 0x01:
wspHeaderDecodeCharset(length - 1 , data + 1, ¶m);
break;
- case 0x02 :
+ case 0x02:
wspHeaderDecodeVersion(length - 1, data + 1, ¶m);
break;
/* integer */
- case 0x03 :
+ case 0x03:
/* param = (unsigned char *)malloc((size_t)WSP_STANDARD_STR_LEN_MAX); */
param = new char[WSP_STANDARD_STR_LEN_MAX];
if (param == NULL) {
snprintf((char*)param, sizeof(char)*WSP_STANDARD_STR_LEN_MAX, "Type=%i", (int)wspHeaderDecodeInteger(data + 1));
}
break;
- case 0x08 :
+ case 0x08:
param = new char[WSP_STANDARD_STR_LEN_MAX];
if (param == NULL) {
snprintf((char*)param, sizeof(char)*WSP_STANDARD_STR_LEN_MAX, "Padding=%i", (int)wspHeaderDecodeInteger(data + 1));
}
break;
- case 0x05 :
+ case 0x05:
param = new char[WSP_STANDARD_STR_LEN_MAX];
if (param == NULL) {
param[5 + length - 1] = '\0';
}
break;
- case 0x06 :
+ case 0x06:
param = new char[WSP_STANDARD_STR_LEN_MAX];
if (param == NULL) {
param[9 + length - 1] = '\0';
}
break;
- case 0x07 :
+ case 0x07:
param = NULL;
/* TBI */
break;
/*OMA Provisioning*/
- case 0x11 :
+ case 0x11:
param = new char[WSP_STANDARD_STR_LEN_MAX];
if (param == NULL) {
if (0x12 == (data[2] & 0x7f)) {
strncat((char*)param, "; MAC=", WSP_STANDARD_STR_LEN_MAX-AcStrlen((char*)param)-1);
- memcpy(param+AcStrlen((char*)param),(char*)(data+3),(size_t)length-3);
+ memcpy(param+AcStrlen((char*)param), (char*)(data+3), (size_t)length-3);
}
}
break;
- default :
+ default:
param = NULL;
break;
}
void SmsPluginWapPushHandler::wspHeaderDecodeCharset(unsigned long length, unsigned char* data, char**pDecodedString)
{
-
char* param = NULL;
param = new char[WSP_STANDARD_STR_LEN_MAX];
(struct tm*)gmtime_r((const time_t*)&lTime, &pTMData);
/* check date value validity */
- {
- if ((pTMData.tm_wday > 6) || (pTMData.tm_mon > 11) || (pTMData.tm_mday > 31))
- {
- MSG_DEBUG("WspLHeaderDecodeDateValue: Date decode fail %d, %d, %d \n", pTMData.tm_wday, pTMData.tm_mon, pTMData.tm_mday);
- strncpy((char*)*pDecodedString, "Decoding Failed", WSP_STANDARD_STR_LEN_MAX-1);
- return;
- }
+ if ((pTMData.tm_wday > 6) || (pTMData.tm_mon > 11) || (pTMData.tm_mday > 31)) {
+ MSG_DEBUG("WspLHeaderDecodeDateValue: Date decode fail %d, %d, %d \n", pTMData.tm_wday, pTMData.tm_mon, pTMData.tm_mday);
+ strncpy((char*)*pDecodedString, "Decoding Failed", WSP_STANDARD_STR_LEN_MAX-1);
+ return;
}
#ifdef MSG_FW_FOR_DEBUG
/** Date type selection */
- switch (wspMachineStatus.dateType)
- {
+ switch (wspMachineStatus.dateType) {
/* UNIX asciitime function */
- case UNIX_DATE_TYPE :
+ case UNIX_DATE_TYPE:
snprintf((char*)decodedString, sizeof(decodedString), "%s %s %-2u %u:%u:%u %u GMT", wspWeek[pTMData.tm_wday], wspMonth[pTMData.tm_mon],
pTMData.tm_mday, pTMData.tm_hour, pTMData.tm_min, pTMData.tm_sec, pTMData.tm_year + 1900);
break;
- case RFC1123_DATE_TYPE :
+ case RFC1123_DATE_TYPE:
snprintf((char*)decodedString, sizeof(decodedString), "%s, %u %s %u %u:%u:%u GMT", wspWeek[pTMData.tm_wday], pTMData.tm_mday,
wspMonth[pTMData.tm_mon], pTMData.tm_year + 1900, pTMData.tm_hour, pTMData.tm_min, pTMData.tm_sec);
break;
- case RFC850_DATE_TYPE :
+ case RFC850_DATE_TYPE:
/* Have some Y2K Problems */
/* In RFC 850, date is represented like 11-May-99. So Y2K problem always can be occured. So remainer (year divided by 100) is used. */
snprintf((char*)decodedString, sizeof(decodedString), "%s, %2u-%s-%2u %u:%u:%u GMT", wspWeekDay[pTMData.tm_wday], pTMData.tm_mday,
pTMData.tm_mday, pTMData.tm_hour, pTMData.tm_min, pTMData.tm_sec, pTMData.tm_year + 1900);
return;
-
}
void SmsPluginWapPushHandler::wspHeaderCopyDecodedString(unsigned char* szDecodedString, unsigned long* currentLen, char** pTemper)
case 0x07 :
if (fieldValue[1] > 0x7f) {
/* well known field name */
- strncpy((char*)paramString, (char*)wspHeaderFieldName[fieldValue[1] & 0x7f],WSP_STANDARD_STR_LEN_MAX-1);
+ strncpy((char*)paramString, (char*)wspHeaderFieldName[fieldValue[1] & 0x7f], WSP_STANDARD_STR_LEN_MAX-1);
paramString[WSP_STANDARD_STR_LEN_MAX-1] = '\0';
} else {
/* unknown field name */
default :
break;
-
}
snprintf((char*)*pCacheString, (sizeof(char)*WSP_STANDARD_STR_LEN_MAX), "%s=%s", (char*)wspCacheControl[cacheCode], (char*)paramString);
} else {
stringLen = AcStrlen((char*)*pCacheString);
if (stringLen + 1 < fieldValueLen) {
-
if (fieldValue[stringLen+ 1] > 0x7f) {
int untyped = (int)wspHeaderDecodeIntegerByLength(fieldValue + stringLen + 1, fieldValueLen - (stringLen + 1));
return;
}
-void SmsPluginWapPushHandler::getDisplayName(MSG_SUB_TYPE_T subType,char* displayName)
+void SmsPluginWapPushHandler::getDisplayName(MSG_SUB_TYPE_T subType, char* displayName)
{
if (subType == MSG_WAP_SL_SMS || subType == MSG_WAP_SI_SMS)
snprintf(displayName, MAX_ADDRESS_VAL_LEN + 1, "Push message");
void Decode2gCbMsg(TelSmsCbMsg_t *pCbMsg, SMS_CBMSG_PAGE_S *pCbPage);
void Decode3gCbMsg(TelSmsCbMsg_t *pCbMsg, SMS_CBMSG_PAGE_S *pCbPage);
void DecodeEtwsMsg(TelSmsEtwsMsg_t *pEtwsMsg, SMS_ETWS_PRIMARY_S *pEtwsPn);
- unsigned short encodeCbSerialNum ( SMS_CBMSG_SERIAL_NUM_S snFields );
+ unsigned short encodeCbSerialNum(SMS_CBMSG_SERIAL_NUM_S snFields);
int CMAS_class(unsigned short message_id);
bool checkCbOpt(SMS_CBMSG_PAGE_S *CbPage, bool *pJavaMsg, msg_sim_slot_id_t simIndex);
void MakeCbMsg(SMS_CBMSG_PAGE_S *CbPage, SMS_CBMSG_S *pCbMsg);
void convertCbMsgToMsginfo(SMS_CBMSG_S *pCbMsg, MSG_MESSAGE_INFO_S *pMsgInfo, msg_sim_slot_id_t simIndex);
void convertEtwsMsgToMsginfo(SMS_CBMSG_PAGE_S *EtwsMsg, MSG_MESSAGE_INFO_S *pMsgInfo, msg_sim_slot_id_t simIndex);
- int convertTextToUtf8 (unsigned char* outBuf, int outBufSize, SMS_CBMSG_S* pCbMsg);
+ int convertTextToUtf8(unsigned char* outBuf, int outBufSize, SMS_CBMSG_S* pCbMsg);
void addToPageList(SMS_CBMSG_PAGE_S *CbPage);
void removeFromPageList(SMS_CBMSG_PAGE_S *CbPage);
void getDisplayName(unsigned short MsgId, char *pDisplayName, msg_sim_slot_id_t simIndex);
vector<CB_PAGE_INFO_S> pageList;
-
};
#endif /* SMS_PLUGIN_CBMSG_HANDLER_H */
bool IsConcatMsg(SMS_USERDATA_S *pUserData);
void handleConcatMsg(TapiHandle *handle, SMS_TPDU_S *pTpdu);
void handleSimConcatMsg(TapiHandle *handle, SMS_TPDU_S *pTpdu, int msgId, int bRead, int *simIdList);
-// void handleConcatMsg(SMS_TPDU_S *pTpdu, msg_sim_id_t SimMsgId, bool bRead);
-
-// void handleBrokenMsg();
+/* void handleConcatMsg(SMS_TPDU_S *pTpdu, msg_sim_id_t SimMsgId, bool bRead); */
+/* void handleBrokenMsg(); */
private:
SmsPluginConcatHandler();
void convertConcatToMsginfo(const SMS_DELIVER_S *pTpdu, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo);
void convertConcatToMsginfo(const SMS_SUBMIT_S *pTpdu, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo);
-// void convertSimMsgToMsginfo(const SMS_CONCAT_MSG_S *pConcatMsg, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo);
+/* void convertSimMsgToMsginfo(const SMS_CONCAT_MSG_S *pConcatMsg, const char *pUserData, int DataSize, MSG_MESSAGE_INFO_S *pMsgInfo); */
void removeFromConcatList(unsigned short MsgRef, int simIndex, char *originAddress);
-// void addToSimIdList(unsigned short MsgRef, msg_sim_id_t SimMsgId);
-// void removeFromSimIdList(unsigned short MsgRef);
+/* void addToSimIdList(unsigned short MsgRef, msg_sim_id_t SimMsgId); */
+/* void removeFromSimIdList(unsigned short MsgRef); */
vector<SMS_CONCAT_INFO_S> concatList;
-// vector<SMS_SIM_ID_S> simIdList;
-
+/* vector<SMS_SIM_ID_S> simIdList; */
};
#endif /* SMS_PLUGIN_CONCAT_HANDLER_H */
msg_error_t updateMsgDeliverStatus(MSG_MESSAGE_INFO_S *pMsgInfo, unsigned char msgRef);
msg_error_t updateSentMsg(MSG_MESSAGE_INFO_S *pMsgInfo, msg_network_status_t Status);
-// msg_error_t updateMsgRef(msg_message_id_t MsgId, unsigned char MsgRef);
-// msg_error_t updateStatusReport(unsigned char MsgRef, msg_delivery_report_status_t Status, time_t DeliveryTime);
+/* msg_error_t updateMsgRef(msg_message_id_t MsgId, unsigned char MsgRef); */
+/* msg_error_t updateStatusReport(unsigned char MsgRef, msg_delivery_report_status_t Status, time_t DeliveryTime); */
msg_error_t addSimMessage(MSG_MESSAGE_INFO_S *pSimMsgInfo, int *simIdList);
msg_error_t insertSimMessage(int simId, int msgId);
#define MAX_USER_DATA_LEN 160
#define MAX_GSM_7BIT_DATA_LEN 160
#define MAX_UCS2_DATA_LEN 140
-//#define MAX_TPDU_DATA_LEN 165
-/* CID 321400: Making MAX_TPDU_DATA_LEN same as TAPI_NETTEXT_SMDATA_SIZE_MAX of TelSms.h to prevent any buffer overflow */
+/* #define MAX_TPDU_DATA_LEN 165 */
#define MAX_TPDU_DATA_LEN 255
#define MAX_SMS_SEND_RETRY 4
#define MAX_SMSC_LEN 20
public:
static SmsPluginUAManager* instance();
- //virtual void start();
+ /* virtual void start(); */
void addReqEntity(SMS_REQUEST_INFO_S *request);
#define WSP_CODE_BUFFER_LEFT_LEN_MAX 1024
#define WSP_CODE_BUFFER_RIGHT_LEN_MAX 2048
-#define AcStrlen(x) ((x==NULL)?0:strlen(x))
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+#define AcStrlen(x) ((x == NULL)?0:strlen(x))
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
/*==================================================================================================
msg_push_action_t convertSIActionStrToEnum(char* pAction);
msg_push_action_t convertSLActionStrToEnum(char* pAction);
- unsigned long wspRetriveUintvarDecode( unsigned char* sourceData, unsigned long* currentPointer );
- unsigned long wspDecodeUintvar(unsigned long length, unsigned char* userVar );
- void wspDecodeHeader( unsigned char* sEncodedHeader, unsigned long encodedHeaderLen, unsigned long contentsLength, bool fContentType, char** pHeader);
- unsigned long wspHeaderDecodeInteger( unsigned char* data );
- void wspHeaderDecodeQValue( unsigned long length, unsigned char* data, char** pDecodedString);
- unsigned long wspHeaderDecodeIntegerByLength(unsigned char* data, unsigned long length );
- char* wspExtendedDecodeType(char contentType );
- void wspHeaderDecodeParameter( unsigned char* data, unsigned long length, char** pParam);
- void wspHeaderDecodeCharset( unsigned long length, unsigned char* data, char**pDecodedString);
- void wspHeaderDecodeVersion( unsigned long length, unsigned char* data, char** pDecodedString );
- void wspHeaderDecodeDateValue( unsigned long length, unsigned char* data, char** pDecodedString );
- void wspHeaderCopyDecodedString( unsigned char* szDecodedString, unsigned long* currentLen, char** pTemper );
- void wspHeaderDecodeAuth(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString );
- void wspHeaderDecodeChallenge(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString );
+ unsigned long wspRetriveUintvarDecode(unsigned char* sourceData, unsigned long* currentPointer);
+ unsigned long wspDecodeUintvar(unsigned long length, unsigned char* userVar);
+ void wspDecodeHeader(unsigned char* sEncodedHeader, unsigned long encodedHeaderLen, unsigned long contentsLength, bool fContentType, char** pHeader);
+ unsigned long wspHeaderDecodeInteger(unsigned char* data);
+ void wspHeaderDecodeQValue(unsigned long length, unsigned char* data, char** pDecodedString);
+ unsigned long wspHeaderDecodeIntegerByLength(unsigned char* data, unsigned long length);
+ char* wspExtendedDecodeType(char contentType);
+ void wspHeaderDecodeParameter(unsigned char* data, unsigned long length, char** pParam);
+ void wspHeaderDecodeCharset(unsigned long length, unsigned char* data, char**pDecodedString);
+ void wspHeaderDecodeVersion(unsigned long length, unsigned char* data, char** pDecodedString);
+ void wspHeaderDecodeDateValue(unsigned long length, unsigned char* data, char** pDecodedString);
+ void wspHeaderCopyDecodedString(unsigned char* szDecodedString, unsigned long* currentLen, char** pTemper);
+ void wspHeaderDecodeAuth(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString);
+ void wspHeaderDecodeChallenge(unsigned long fieldValueLen, unsigned char* fieldValue, char** pDecodedString);
void wspHeaderDecodeCacheControl(unsigned char* fieldValue, unsigned long fieldValueLen, char** pCacheString);
-
SMS_ADDRESS_S tmpAddress;
SMS_TIMESTAMP_S tmpTimeStamp;
};
MsgHandle::~MsgHandle()
{
-
}
if (MsgCloseContactSvc() != MSG_SUCCESS) {
MSG_WARN("Fail to close contact service.");
}
-#endif // MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
removeDbHandle(); /* unregister db handler */
MSG_END();
pDest->folderId = pSrc->folderId;
pDest->msgType.mainType = pSrc->mainType;
pDest->msgType.subType = pSrc->subType;
- pDest->msgType.classType= pSrc->classType;
+ pDest->msgType.classType = pSrc->classType;
pDest->storageId = pSrc->storageId;
if (g_list_length(pSrc->addressList) > 0) {
memset(pDest->addressList, 0x00, sizeof(MSG_ADDRESS_INFO_S) * pDest->nAddressCnt);
for (int i = 0; i < pDest->nAddressCnt; i++) {
- addr_info = (msg_struct_s *)g_list_nth_data(pSrc->addressList,(guint)i);
+ addr_info = (msg_struct_s *)g_list_nth_data(pSrc->addressList, (guint)i);
address = (MSG_ADDRESS_INFO_S *)addr_info->data;
pDest->addressList[i].addressType = address->addressType;
strncpy(pDest->addressList[i].displayName, address->displayName, MAX_DISPLAY_NAME_LEN);
}
} else {
-
msg_struct_list_s *addr_info_s = pSrc->addr_list;
if (addr_info_s && (addr_info_s->nCount > 0)) {
MSG_SEC_DEBUG("msgText = %s", pDest->msgText);
} else if (pSrc->mainType == MSG_MMS_TYPE) {
-
pDest->bTextSms = false;
pDest->dataSize = pSrc->dataSize;
/* change file extension in case of java MMS msg */
if (pSrc->subType == MSG_SENDREQ_JAVA_MMS) {
char* pFileNameExt = NULL;
- pFileNameExt = strstr(fileName,"DATA");
+ pFileNameExt = strstr(fileName, "DATA");
if (pFileNameExt)
snprintf(pFileNameExt, strlen("JAVA")+1, "JAVA");
}
if (a == NULL) { \
return MSG_ERR_NULL_POINTER; \
} \
- } while(0)
+ } while (0)
/*==================================================================================================
IMPLEMENTATION OF MsgHandle - Setting Member Functions
}
if (pEvent->result == MSG_SUCCESS) {
- MSG_SMSC_LIST_S smsc_list_tmp = {0,};
+ MSG_SMSC_LIST_S smsc_list_tmp = {0, };
int dataSize = 0;
dataSize = sizeof(MSG_SMSC_LIST_S);
msg_struct_s *pTmp = (msg_struct_s *)msg_struct;
MSG_SMSC_LIST_HIDDEN_S *pTmpList = (MSG_SMSC_LIST_HIDDEN_S *)pTmp->data;
- MSG_SMSC_LIST_S smsc_list_tmp = {0,};
+ MSG_SMSC_LIST_S smsc_list_tmp = {0, };
smsc_list_tmp.totalCnt = pTmpList->smsc_list->nCount;
smsc_list_tmp.selected = pTmpList->selected;
/* Copy Cookie */
memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
- MSG_SETTING_S pSetting = {0,};
+ MSG_SETTING_S pSetting = {0, };
pSetting.type = optionType;
memcpy(&(pSetting.option.smscList), &smsc_list_tmp, sizeof(MSG_SMSC_LIST_S));
if (pEvent->result == MSG_SUCCESS) {
int i = 0;
- MSG_CBMSG_OPT_S cb_opt_tmp = {0,};
+ MSG_CBMSG_OPT_S cb_opt_tmp = {0, };
memcpy(&cb_opt_tmp, pEvent->data, sizeof(MSG_CBMSG_OPT_S));
MSG_CBMSG_OPT_HIDDEN_S *pTmp = (MSG_CBMSG_OPT_HIDDEN_S *)cb_opt->data;
memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
/* Copy Command Data */
- MSG_CBMSG_OPT_S cb_opt_tmp = {0,};
+ MSG_CBMSG_OPT_S cb_opt_tmp = {0, };
MSG_CBMSG_OPT_HIDDEN_S *cb_msg_opt = (MSG_CBMSG_OPT_HIDDEN_S *)cb_opt->data;
cb_opt_tmp.bReceive = cb_msg_opt->bReceive;
memcpy(&(cb_opt_tmp.channelData.channelInfo[i]), pStructTmp->data, sizeof(MSG_CB_CHANNEL_INFO_S));
}
- MSG_SETTING_S pSetting = {0,};
+ MSG_SETTING_S pSetting = {0, };
pSetting.type = optionType;
memcpy(&(pSetting.option.cbMsgOpt), &cb_opt_tmp, sizeof(MSG_CBMSG_OPT_S));
memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
/* Copy Command Data */
- MSG_SETTING_S pSetting = {0,};
+ MSG_SETTING_S pSetting = {0, };
pSetting.type = optionType;
memcpy(&(pSetting.option.smsSendOpt), sms_send_opt->data, sizeof(MSG_SMS_SENDOPT_S));
memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
/* Copy Command Data */
- MSG_SETTING_S pSetting = {0,};
+ MSG_SETTING_S pSetting = {0, };
pSetting.type = optionType;
memcpy(&(pSetting.option.mmsSendOpt), mms_send_opt->data, sizeof(MSG_MMS_SENDOPT_S));
memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
/* Copy Command Data */
- MSG_SETTING_S pSetting = {0,};
+ MSG_SETTING_S pSetting = {0, };
pSetting.type = optionType;
memcpy(&(pSetting.option.mmsRecvOpt), mms_recv_opt->data, sizeof(MSG_MMS_RECVOPT_S));
memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
/* Copy Command Data */
- MSG_SETTING_S pSetting = {0,};
+ MSG_SETTING_S pSetting = {0, };
pSetting.type = optionType;
memcpy(&(pSetting.option.pushMsgOpt), push_opt->data, sizeof(MSG_PUSHMSG_OPT_S));
memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
/* Copy Command Data */
- MSG_SETTING_S pSetting = {0,};
+ MSG_SETTING_S pSetting = {0, };
pSetting.type = optionType;
memcpy(&(pSetting.option.voiceMailOpt), voice_opt->data, sizeof(MSG_VOICEMAIL_OPT_S));
memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
/* Copy Command Data */
- MSG_SETTING_S pSetting = {0,};
+ MSG_SETTING_S pSetting = {0, };
pSetting.type = optionType;
memcpy(&(pSetting.option.generalOpt), general_opt->data, sizeof(MSG_GENERAL_OPT_S));
memcpy(pCmd->cmdCookie, mCookie, MAX_COOKIE_LEN);
/* Copy Command Data */
- MSG_SETTING_S pSetting = {0,};
+ MSG_SETTING_S pSetting = {0, };
pSetting.type = optionType;
memcpy(&(pSetting.option.msgSizeOpt), msg_size_opt->data, sizeof(MSG_MSGSIZE_OPT_S));
==================================================================================================*/
int MsgHandle::addMessage(MSG_MESSAGE_HIDDEN_S *pMsg, const MSG_SENDINGOPT_S *pSendOpt)
{
- MSG_MESSAGE_INFO_S msgInfo = {0,};
- MSG_SENDINGOPT_INFO_S sendOptInfo = {0,};
+ MSG_MESSAGE_INFO_S msgInfo = {0, };
+ MSG_SENDINGOPT_INFO_S sendOptInfo = {0, };
msgInfo.addressList = NULL;
unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> addressListBuf(&msgInfo.addressList, unique_ptr_deleter);
convertMsgStruct(pMsg, &msgInfo);
/* Covert MSG_SENDINGOPT_S to MSG_SENDINGOPT_INFO_S */
- MSG_MESSAGE_TYPE_S msgType = {0,};
+ MSG_MESSAGE_TYPE_S msgType = {0, };
msgType.mainType = pMsg->mainType;
msgType.subType = pMsg->subType;
convertMsgStruct(pMsg, &msgInfo);
if (pSendOpt != NULL) {
- MSG_MESSAGE_TYPE_S msgType = {0,};
+ MSG_MESSAGE_TYPE_S msgType = {0, };
msgType.mainType = pMsg->mainType;
msgType.subType = pMsg->subType;
/* Copy Command Data */
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &(pMsgIdList->nCount), sizeof(int));
- for (int i=0; i<pMsgIdList->nCount; i++) {
+ for (int i = 0; i < pMsgIdList->nCount; i++) {
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN+sizeof(int)+(sizeof(int)*i)), &(pMsgIdList->msgIdList[i]), sizeof(int));
}
convertMsgStruct(&msgInfo, pMsg);
if (pSendOpt != NULL) {
- MSG_MESSAGE_TYPE_S msgType = {0,};
+ MSG_MESSAGE_TYPE_S msgType = {0, };
msgType.mainType = pMsg->mainType;
msgType.subType = pMsg->subType;
}
MsgCloseFile(pFile);
- char path[MSG_FILEPATH_LEN_MAX+1] = {0,};
+ char path[MSG_FILEPATH_LEN_MAX+1] = {0, };
strncpy(path, backup_filepath, MSG_FILEPATH_LEN_MAX);
/* Allocate Memory to Command Data */
return MSG_ERR_UNKNOWN;
}
- char path[MSG_FILEPATH_LEN_MAX+1] = {0,};
+ char path[MSG_FILEPATH_LEN_MAX+1] = {0, };
strncpy(path, backup_filepath, MSG_FILEPATH_LEN_MAX);
/* Allocate Memory to Command Data */
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &addrCnt, sizeof(int));
int addSize = sizeof(MSG_ADDRESS_INFO_S);
for (int i = 0; i < addrCnt; i++) {
- memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+sizeof(addrCnt)+(addSize*i)+MAX_COOKIE_LEN), ((msg_struct_s *)(g_list_nth_data((GList *)msg_address_list,(guint)i)))->data, sizeof(MSG_ADDRESS_INFO_S));
+ memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+sizeof(addrCnt)+(addSize*i)+MAX_COOKIE_LEN), ((msg_struct_s *)(g_list_nth_data((GList *)msg_address_list, (guint)i)))->data, sizeof(MSG_ADDRESS_INFO_S));
}
/* Send Command to Messaging FW */
return pEvent->result;
/* Decode Return Data */
- MSG_MESSAGE_INFO_S msgInfo = {0,};
- MSG_SENDINGOPT_INFO_S sendOptInfo = {0,};
+ MSG_MESSAGE_INFO_S msgInfo = {0, };
+ MSG_SENDINGOPT_INFO_S sendOptInfo = {0, };
msgInfo.addressList = NULL;
unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> addressListBuf(&msgInfo.addressList, unique_ptr_deleter);
#ifdef CHECK_SENT_STATUS_CALLBACK
if (MsgProxyListener::instance()->getSentStatusCbCnt() <= 0)
- THROW(MsgException::SENT_STATUS_ERROR,"Register sent status callback");
+ THROW(MsgException::SENT_STATUS_ERROR, "Register sent status callback");
#endif
MSG_REQUEST_INFO_S reqInfo = {0};
/* In case MMS read report, get address value later. */
if (reqmsg->subType != MSG_READREPLY_MMS) {
if (reqmsg->addr_list && (reqmsg->addr_list->nCount > 0) && (reqmsg->addr_list->nCount <= MAX_TO_ADDRESS_CNT)) {
- MSG_DEBUG("Recipient address count [%d]", reqmsg->addr_list->nCount );
+ MSG_DEBUG("Recipient address count [%d]", reqmsg->addr_list->nCount);
} else if (g_list_length(reqmsg->addressList) > 0) {
MSG_DEBUG("Recipient address count [%d]", g_list_length(reqmsg->addressList) );
} else {
} else {
/* in case of JAVA MMS msg, parse mms transaction id from pMmsData */
reqmsg->networkStatus = MSG_NETWORK_SENDING;
- strncpy(trId, (char*)reqmsg->pMmsData+3,MMS_TR_ID_LEN);
- MSG_SEC_DEBUG("JavaMMS transaction Id:%s ",trId);
+ strncpy(trId, (char*)reqmsg->pMmsData+3, MMS_TR_ID_LEN);
+ MSG_SEC_DEBUG("JavaMMS transaction Id:%s", trId);
}
/* Convert MSG_MESSAGE_S to MSG_MESSAGE_INFO_S */
convertMsgStruct(reqmsg, &(reqInfo.msgInfo));
- MSG_MESSAGE_TYPE_S msgType = {0,};
+ MSG_MESSAGE_TYPE_S msgType = {0, };
msgType.mainType = reqmsg->mainType;
msgType.subType = reqmsg->subType;
/* Get Return Data */
MSG_EVENT_S* pEvent = (MSG_EVENT_S*) pEventData;
- int ret[3] = {0,};
+ int ret[3] = {0, };
memcpy(&ret, (void*)pEvent->data, sizeof(ret));
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &cmdParam, sizeof(cmdParam));
- MSG_DEBUG("reg new msg [%s], fd:%d, appId:%s", MsgDbgCmdStr(pCmd->cmdType), cmdParam.listenerFd, (pAppId)? cmdParam.appId:"NULL" );
+ MSG_DEBUG("reg new msg [%s], fd:%d, appId:%s", MsgDbgCmdStr(pCmd->cmdType), cmdParam.listenerFd, (pAppId)? cmdParam.appId:"NULL");
/* Send Command to Messaging FW */
char* pEventData = NULL;
memcpy((void*)((char*)pCmd+sizeof(MSG_CMD_TYPE_T)+MAX_COOKIE_LEN), &cmdParam, sizeof(cmdParam));
- MSG_DEBUG("reg new msg [%s], fd:%d, appId:%s", MsgDbgCmdStr(pCmd->cmdType), cmdParam.listenerFd, (pAppId)? cmdParam.appId:"NULL" );
+ MSG_DEBUG("reg new msg [%s], fd:%d, appId:%s", MsgDbgCmdStr(pCmd->cmdType), cmdParam.listenerFd, (pAppId)? cmdParam.appId:"NULL");
/* Send Command to Messaging FW */
char* pEventData = NULL;
it->fd = fd;
return true;
}
-
}
}
memcpy(&chInfo, (void*)((char*)pMsgEvent+sizeof(MSG_EVENT_TYPE_T)+sizeof(msg_error_t)), sizeof(chInfo));
- msg_struct_s status = {0,};
+ msg_struct_s status = {0, };
MSG_SENT_STATUS_S statusData = {(msg_request_id_t)chInfo[0], (msg_network_status_t)chInfo[1]};
status.type = MSG_STRUCT_SENT_STATUS_INFO;
MsgNewMessageCBList matchList;
for ( ; it != newMessageCBList.end() ; it++) {
- if ( portKey == it->port) {
+ if (portKey == it->port) {
matchList.push_back(*it);
}
}
for ( ; it != matchList.end(); it++ ) {
MsgHandle* pHandle = it->hAddr;
- MSG_MESSAGE_HIDDEN_S msgHidden = {0,};
+ MSG_MESSAGE_HIDDEN_S msgHidden = {0, };
msgHidden.pData = NULL;
msgHidden.pMmsData = NULL;
MSG_FATAL("%s", e.what());
}
- msg_struct_s msg = {0,};
+ msg_struct_s msg = {0, };
msg.type = MSG_STRUCT_MESSAGE_INFO;
msg.data = &msgHidden;
/* address Memory Free */
if (msgHidden.addr_list!= NULL) {
- for (int i=0; i<MAX_TO_ADDRESS_CNT; i++) {
+ for (int i = 0; i < MAX_TO_ADDRESS_CNT; i++) {
msg_struct_s * addrInfo = (msg_struct_s *)msgHidden.addr_list->msg_struct_info[i];
delete (MSG_ADDRESS_INFO_S *)addrInfo->data;
addrInfo->data = NULL;
delete msgHidden.addr_list;
msgHidden.addr_list = NULL;
}
-
}
} else if (pMsgEvent->eventType == MSG_EVENT_PLG_INCOMING_MMS_CONF) {
MsgDecodeMsgInfo((char *)pMsgEvent->data, &msgInfo);
- MMS_RECV_DATA_S* pMmsRecvData = ( MMS_RECV_DATA_S*)msgInfo.msgData;
+ MMS_RECV_DATA_S* pMmsRecvData = (MMS_RECV_DATA_S*)msgInfo.msgData;
char* appIdKey = (pMmsRecvData->msgAppId.valid)? pMmsRecvData->msgAppId.appId: NULL;
for ( ; it != matchList.end(); it++) {
MsgHandle* pHandle = it->hAddr;
- MSG_MESSAGE_HIDDEN_S msgHidden = {0,};
+ MSG_MESSAGE_HIDDEN_S msgHidden = {0, };
msgHidden.pData = NULL;
msgHidden.pMmsData = NULL;
MSG_FATAL("%s", e.what());
}
- msg_struct_s msg = {0,};
+ msg_struct_s msg = {0, };
msg.type = MSG_STRUCT_MESSAGE_INFO;
msg.data = &msgHidden;
/* Here the retrieved message will be deleted from native storage. */
/* as of now, msg which have appId is considered as JAVA MMS message and it will be sent and handled in JAVA app. */
if (appIdKey) {
- MSG_DEBUG("delete received JAVA MMS message:%s from native storage",tempFileName);
+ MSG_DEBUG("delete received JAVA MMS message:%s from native storage", tempFileName);
pHandle->deleteMessage(msgInfo.msgId);
}
}
for ( ; it != newCBMessageCBList.end(); it++) {
MsgHandle* pHandle = it->hAddr;
- msg_struct_s msg = {0,};
+ msg_struct_s msg = {0, };
msg.type = MSG_STRUCT_CB_MSG;
msg.data = pCbMsg;
{
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
#include <contacts.h>
-#endif //MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
}
/*==================================================================================================
MsgDbHandler ContactDbHandle;
-// phonenumber minimum match digit.
+/* phonenumber minimum match digit. */
#define PHONENUMBER_MIN_MATCH_DIGIT VCONFKEY_CONTACTS_SVC_PHONENUMBER_MIN_MATCH_DIGIT
#define DEFAULT_MIN_MATCH_DIGIT 8
int countryCodeLength(const char *src)
{
int ret = 0;
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 1:
case 7:
break;
case 2:
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 0:
case 7:
break;
}
break;
case 3:
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 0:
case 1:
case 2:
}
break;
case 4:
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 0:
case 1:
case 3:
}
break;
case 5:
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 1:
case 2:
case 3:
}
break;
case 6:
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 0:
case 1:
case 2:
}
break;
case 8:
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 1:
case 2:
case 4:
}
break;
case 9:
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 0:
case 1:
case 2:
void normalizeNumber(const char *orig, char* dest, unsigned int destSize)
{
unsigned int pos = 0;
- for (unsigned int i=0; (orig[i] && i<destSize); i++) {
+ for (unsigned int i = 0; (orig[i] && i < destSize); i++) {
if (isdigit(orig[i]) || (orig[i] == '+')) {
dest[pos++] = orig[i];
}
contacts_query_destroy(query);
contacts_filter_destroy(filter);
contacts_list_destroy(plogs, true);
-
}
contacts_list_destroy(personList, true);
return isblock;
} else if (ret == CONTACTS_ERROR_NONE && count > 0
- && blockModeType == 1) { // For All contacts allow in blocking mode.
+ && blockModeType == 1) { /* For All contacts allow in blocking mode. */
isblock = false;
}
contacts_list_destroy(personList, true);
- switch (blockModeType)
- {
- case 2: // For Favorites allow in blocking mode.
- {
+ switch (blockModeType) {
+ case 2: { /* For Favorites allow in blocking mode. */
if (isFavorites) isblock = false;
break;
}
- case 3: // For Custom allow in blocking mode.
- {
+ case 3: { /* For Custom allow in blocking mode. */
char *allowList = MsgSettingGetString(VCONFKEY_SETAPPL_BLOCKINGMODE_ALLOWED_CONTACT_LIST);
char *temp = NULL;
- char *personIdStr = strtok_r (allowList," ,", &temp);
- while (personIdStr != NULL)
- {
+ char *personIdStr = strtok_r(allowList, " ,", &temp);
+ while (personIdStr != NULL) {
MSG_DEBUG("personIdStr [%s]", personIdStr);
if (personId == atoi(personIdStr)) {
MSG_DEBUG("In allow list.");
isblock = false;
break;
}
- personIdStr = strtok_r (NULL, " ,", &temp);
+ personIdStr = strtok_r(NULL, " ,", &temp);
}
if (allowList) {
break;
}
- default: // Wrong blocking mode type.
+ default: /* Wrong blocking mode type. */
break;
}
return false;
#endif
}
-#endif //MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
int MsgContactGetMinMatchDigit()
{
{
int len = strlen(pSrc);
- for(int i = 0; i < len; ++i){
-
- if(i == 0 && pSrc[i] == '+')
+ for (int i = 0; i < len; ++i) {
+ if (i == 0 && pSrc[i] == '+')
continue;
- if(pSrc[i] < '0' || pSrc[i] >'9'){
+ if (pSrc[i] < '0' || pSrc[i] > '9') {
return false;
}
}
==================================================================================================*/
const char * MsgDbgCmdStr(MSG_CMD_TYPE_T cmdType)
{
- switch ( cmdType )
- {
-// 0
+ switch ( cmdType ) {
+/* 0 */
case MSG_CMD_OPEN_HANDLE:
return "MSG_CMD_OPEN_HANDLE";
case MSG_CMD_CLOSE_HANDLE:
return "MSG_CMD_ADD_MSG";
case MSG_CMD_ADD_SYNCML_MSG:
return "MSG_CMD_ADD_SYNCML_MSG";
-// 5
+/* 5 */
case MSG_CMD_UPDATE_MSG:
return "MSG_CMD_UPDATE_MSG";
case MSG_CMD_UPDATE_READ:
return "MSG_CMD_DELETE_MSG";
case MSG_CMD_DELALL_MSGINFOLDER:
return "MSG_CMD_DELALL_MSGINFOLDER";
-// 10
+/* 10 */
case MSG_CMD_MOVE_MSGTOFOLDER:
return "MSG_CMD_MOVE_MSGTOFOLDER";
case MSG_CMD_MOVE_MSGTOSTORAGE:
return "MSG_CMD_GET_MSG";
case MSG_CMD_ADD_FOLDER:
return "MSG_CMD_ADD_FOLDER";
-// 15
+/* 15 */
case MSG_CMD_UPDATE_FOLDER:
return "MSG_CMD_UPDATE_FOLDER";
case MSG_CMD_DELETE_FOLDER:
return "MSG_CMD_ADD_FILTER";
case MSG_CMD_UPDATE_FILTER:
return "MSG_CMD_UPDATE_FILTER";
-// 20
+/* 20 */
case MSG_CMD_DELETE_FILTER:
return "MSG_CMD_DELETE_FILTER";
case MSG_CMD_GET_FILTERLIST:
return "MSG_CMD_GET_FILTER_OPERATION";
case MSG_CMD_SUBMIT_REQ:
return "MSG_CMD_SUBMIT_REQ";
-// 25
+/* 25 */
case MSG_CMD_REG_SENT_STATUS_CB:
return "MSG_CMD_REG_SENT_STATUS_CB";
case MSG_CMD_REG_STORAGE_CHANGE_CB:
return "MSG_CMD_REG_INCOMING_MMS_CONF_MSG_CB";
case MSG_CMD_REG_INCOMING_SYNCML_MSG_CB:
return "MSG_CMD_REG_INCOMING_SYNCML_MSG_CB";
-// 30
+/* 30 */
case MSG_CMD_REG_INCOMING_LBS_MSG_CB:
return "MSG_CMD_REG_INCOMING_LBS_MSG_CB";
case MSG_CMD_PLG_SENT_STATUS_CNF:
return "MSG_CMD_PLG_INCOMING_MSG_IND";
case MSG_CMD_PLG_INCOMING_MMS_CONF:
return "MSG_CMD_PLG_INCOMING_MMS_CONF";
-// 35
+/* 35 */
case MSG_CMD_PLG_INCOMING_SYNCML_IND:
return "MSG_CMD_PLG_INCOMING_SYNCML_IND";
case MSG_CMD_PLG_INCOMING_LBS_IND:
return "MSG_CMD_GET_THREADVIEWLIST";
case MSG_CMD_DELETE_THREADMESSAGELIST:
return "MSG_CMD_DELETE_THREADMESSAGELIST";
-// 40
+/* 40 */
case MSG_CMD_GET_CONTACT_COUNT:
return "MSG_CMD_GET_CONTACT_COUNT";
case MSG_CMD_GET_QUICKPANEL_DATA:
return "MSG_CMD_RESET_DB";
case MSG_CMD_GET_MEMSIZE:
return "MSG_CMD_GET_MEMSIZE";
-// 45
+/* 45 */
case MSG_CMD_BACKUP_MESSAGE:
return "MSG_CMD_BACKUP_MESSAGE";
case MSG_CMD_RESTORE_MESSAGE:
return "MSG_CMD_REG_SYNCML_MSG_OPERATION_CB";
case MSG_CMD_SYNCML_OPERATION:
return "MSG_CMD_SYNCML_OPERATION";
-// 50
+/* 50 */
case MSG_CMD_GET_REPORT_STATUS:
return "MSG_CMD_GET_REPORT_STATUS";
case MSG_CMD_GET_THREAD_ID_BY_ADDRESS:
return "MSG_CMD_GET_SMSC_OPT";
case MSG_CMD_GET_CB_OPT:
return "MSG_CMD_GET_CB_OPT";
-// 55
+/* 55 */
case MSG_CMD_GET_SMS_SEND_OPT:
return "MSG_CMD_GET_SMS_SEND_OPT";
case MSG_CMD_GET_MMS_SEND_OPT:
return "MSG_CMD_GET_PUSH_MSG_OPT";
case MSG_CMD_GET_VOICE_MSG_OPT:
return "MSG_CMD_GET_VOICE_MSG_OPT";
-// 60
+/* 60 */
case MSG_CMD_GET_GENERAL_MSG_OPT:
return "MSG_CMD_GET_GENERAL_MSG_OPT";
case MSG_CMD_GET_MSG_SIZE_OPT:
return "MSG_CMD_SET_CB_OPT";
case MSG_CMD_SET_SMS_SEND_OPT:
return "MSG_CMD_SET_SMS_SEND_OPT";
-// 65
+/* 65 */
case MSG_CMD_SET_MMS_SEND_OPT:
return "MSG_CMD_SET_MMS_SEND_OPT";
case MSG_CMD_SET_MMS_RECV_OPT:
return "MSG_CMD_SET_VOICE_MSG_OPT";
case MSG_CMD_SET_GENERAL_MSG_OPT:
return "MSG_CMD_SET_GENERAL_MSG_OPT";
-// 70
+/* 70 */
case MSG_CMD_SET_MSG_SIZE_OPT:
return "MSG_CMD_SET_MSG_SIZE_OPT";
case MSG_CMD_REG_INCOMING_PUSH_MSG_CB:
return "MSG_CMD_REG_INCOMING_CB_MSG_CB";
case MSG_CMD_PLG_INCOMING_CB_IND:
return "MSG_CMD_PLG_INCOMING_CB_IND";
-// 75
+/* 75 */
case MSG_CMD_ADD_PUSH_EVENT:
return "MSG_CMD_ADD_PUSH_EVENT";
case MSG_CMD_DELETE_PUSH_EVENT:
return "MSG_CMD_DELETE_MESSAGE_BY_LIST";
case MSG_CMD_SET_FILTER_ACTIVATION:
return "MSG_CMD_SET_FILTER_ACTIVATION";
-//80
+/* 80 */
case MSG_CMD_ADD_SIM_MSG:
return "MSG_CMD_ADD_SIM_MSG";
case MSG_CMD_PLG_RESEND_MESSAGE:
const char * MsgDbgEvtStr(MSG_EVENT_TYPE_T evtType)
{
- switch ( evtType )
- {
-// 0
+ switch ( evtType ) {
+/* 0 */
case MSG_EVENT_OPEN_HANDLE:
return "MSG_EVENT_OPEN_HANDLE";
case MSG_EVENT_CLOSE_HANDLE:
return "MSG_EVENT_ADD_MSG";
case MSG_EVENT_ADD_SYNCML_MSG:
return "MSG_EVENT_ADD_SYNCML_MSG";
-// 5
+/* 5 */
case MSG_EVENT_UPDATE_MSG:
return "MSG_EVENT_UPDATE_MSG";
case MSG_EVENT_UPDATE_READ:
return "MSG_EVENT_DELETE_MSG";
case MSG_EVENT_DELALL_MSGINFOLDER:
return "MSG_EVENT_DELALL_MSGINFOLDER";
-// 10
+/* 10 */
case MSG_EVENT_MOVE_MSGTOFOLDER:
return "MSG_EVENT_MOVE_MSGTOFOLDER";
case MSG_EVENT_MOVE_MSGTOSTORAGE:
return "MSG_EVENT_GET_MSG";
case MSG_EVENT_ADD_FOLDER:
return "MSG_EVENT_ADD_FOLDER";
-// 15
+/* 15 */
case MSG_EVENT_UPDATE_FOLDER:
return "MSG_EVENT_UPDATE_FOLDER";
case MSG_EVENT_DELETE_FOLDER:
return "MSG_EVENT_ADD_FILTER";
case MSG_EVENT_UPDATE_FILTER:
return "MSG_EVENT_UPDATE_FILTER";
-//20
+/* 20 */
case MSG_EVENT_DELETE_FILTER:
return "MSG_EVENT_DELETE_FILTER";
case MSG_EVENT_GET_FILTERLIST:
return "MSG_EVENT_GET_FILTER_OPERATION";
case MSG_EVENT_SUBMIT_REQ:
return "MSG_EVENT_SUBMIT_REQ";
-//25
+/* 25 */
case MSG_EVENT_REG_SENT_STATUS_CB:
return "MSG_EVENT_REG_SENT_STATUS_CB";
case MSG_EVENT_REG_STORAGE_CHANGE_CB:
return "MSG_EVENT_REG_INCOMING_MMS_CONF_MSG_CB";
case MSG_EVENT_REG_INCOMING_SYNCML_MSG_CB:
return "MSG_EVENT_REG_INCOMING_SYNCML_MSG_CB";
-// 30
+/* 30 */
case MSG_EVENT_REG_INCOMING_LBS_MSG_CB:
return "MSG_EVENT_REG_INCOMING_LBS_MSG_CB";
case MSG_EVENT_PLG_SENT_STATUS_CNF:
return "MSG_EVENT_PLG_INCOMING_MSG_IND";
case MSG_EVENT_PLG_INCOMING_MMS_CONF:
return "MSG_EVENT_PLG_INCOMING_MMS_CONF";
-// 35
+/* 35 */
case MSG_EVENT_PLG_INCOMING_SYNCML_MSG_IND:
return "MSG_EVENT_PLG_INCOMING_SYNCML_MSG_IND";
case MSG_EVENT_PLG_INCOMING_LBS_MSG_IND:
return "MSG_EVENT_GET_THREADVIEWLIST";
case MSG_EVENT_DELETE_THREADMESSAGELIST:
return "MSG_EVENT_DELETE_THREADMESSAGELIST";
-// 40
+/* 40 */
case MSG_EVENT_GET_CONTACT_COUNT:
return "MSG_EVENT_GET_CONTACT_COUNT";
case MSG_EVENT_GET_QUICKPANEL_DATA:
return "MSG_EVENT_RESET_DB";
case MSG_EVENT_GET_MEMSIZE:
return "MSG_EVENT_GET_MEMSIZE";
-// 45
+/* 45 */
case MSG_EVENT_BACKUP_MESSAGE:
return "MSG_EVENT_BACKUP_MESSAGE";
case MSG_EVENT_RESTORE_MESSAGE:
return "MSG_EVENT_REG_SYNCML_MSG_OPERATION_CB";
case MSG_EVENT_SYNCML_OPERATION:
return "MSG_EVENT_SYNCML_OPERATION";
-// 50
+/* 50 */
case MSG_EVENT_GET_REPORT_STATUS:
return "MSG_EVENT_GET_REPORT_STATUS";
case MSG_EVENT_GET_THREAD_ID_BY_ADDRESS:
return "MSG_EVENT_GET_SMSC_OPT";
case MSG_EVENT_GET_CB_OPT:
return "MSG_EVENT_GET_CB_OPT";
-// 55
+/* 55 */
case MSG_EVENT_GET_SMS_SEND_OPT:
return "MSG_EVENT_GET_SMS_SEND_OPT";
case MSG_EVENT_GET_MMS_SEND_OPT:
return "MSG_EVENT_GET_PUSH_MSG_OPT";
case MSG_EVENT_GET_VOICE_MSG_OPT:
return "MSG_EVENT_GET_VOICE_MSG_OPT";
-// 60
+/* 60 */
case MSG_EVENT_GET_GENERAL_MSG_OPT:
return "MSG_EVENT_GET_GENERAL_MSG_OPT";
case MSG_EVENT_GET_MSG_SIZE_OPT:
return "MSG_EVENT_SET_CB_OPT";
case MSG_EVENT_SET_SMS_SEND_OPT:
return "MSG_EVENT_SET_SMS_SEND_OPT";
-// 65
+/* 65 */
case MSG_EVENT_SET_MMS_SEND_OPT:
return "MSG_EVENT_SET_MMS_SEND_OPT";
case MSG_EVENT_SET_MMS_RECV_OPT:
return "MSG_EVENT_SET_VOICE_MSG_OPT";
case MSG_EVENT_SET_GENERAL_MSG_OPT:
return "MSG_EVENT_SET_GENERAL_MSG_OPT";
-// 70
+/* 70 */
case MSG_EVENT_SET_MSG_SIZE_OPT:
return "MSG_EVENT_SET_MSG_SIZE_OPT";
case MSG_EVENT_REG_INCOMING_PUSH_MSG_CB:
return "MSG_EVENT_REG_INCOMING_CB_MSG_CB";
case MSG_EVENT_PLG_INCOMING_CB_MSG_IND:
return "MSG_EVENT_PLG_INCOMING_CB_MSG_IND";
-// 75
+/* 75 */
case MSG_EVENT_ADD_PUSH_EVENT:
return "MSG_EVENT_ADD_PUSH_EVENT";
case MSG_EVENT_DELETE_PUSH_EVENT:
return "MSG_EVENT_DELETE_MESSAGE_BY_LIST";
case MSG_EVENT_SET_FILTER_ACTIVATION:
return "MSG_EVENT_SET_FILTER_ACTIVATION";
-// 80
+/* 80 */
case MSG_EVENT_ADD_SIM_MSG:
return "MSG_EVENT_ADD_SIM_MSG";
case MSG_EVENT_PLG_RESEND_MESSAGE:
#include <drm_client_types.h>
#include <drm_client.h>
-#endif //MSG_DRM_SUPPORT
+#endif /* MSG_DRM_SUPPORT */
#define MSG_MAX_DRM_FILE_PATH MSG_FILEPATH_LEN_MAX
drm_request_type_e request_type = DRM_REQUEST_TYPE_UNREGISTER_FILE;
- int eDRMResult = drm_process_request(request_type, szFilename, NULL); // Unregister a DCF file
+ int eDRMResult = drm_process_request(request_type, szFilename, NULL); /* Unregister a DCF file */
if (DRM_RETURN_SUCCESS != eDRMResult) {
MSG_DEBUG("drm_process_request : %d", eDRMResult);
return false;
MSG_SEC_DEBUG("Current File extension is .dm %s", inputFile);
int ret;
- FILE *fp = MsgOpenFile(inputFile, "rb");//Check fp
+ FILE *fp = MsgOpenFile(inputFile, "rb");/* Check fp */
if (fp == NULL) {
MSG_DEBUG("[File Open Fail(Errno=%d)][ErrStr=%s]", errno, strerror(errno));
strncpy(outputFile, inputFile, pathLen - 2);
strncat(outputFile, "dcf", 3);
- readed_size = MsgReadFile(buffer, 1, bufLen, fp);//Check for error
+ readed_size = MsgReadFile(buffer, 1, bufLen, fp);/* Check for error */
MSG_DEBUG("fread read size = %d", readed_size);
if (readed_size == 0) {
MsgCloseFile(fp);
return false;
}
- // Convert DRM_METHOD into MSG_DRM_TYPE
+ /* Convert DRM_METHOD into MSG_DRM_TYPE */
switch (drmInfo.oma_info.method) {
case DRM_METHOD_TYPE_FORWARD_LOCK:
*eDRMType = MSG_DRM_FORWARD_LOCK;
return false;
}
- char strTemp[MSG_MAX_DRM_FILE_PATH + 1] = {0,};
+ char strTemp[MSG_MAX_DRM_FILE_PATH + 1] = {0, };
strncpy(strTemp, szFileName, strlen(szFileName));
drm_content_info_s tdcfContentinfo;
memset(&tdcfContentinfo, 0x00, sizeof(drm_content_info_s));
- int eDRMResult = drm_get_content_info(strTemp, &tdcfContentinfo); // Get attribute of DRM File
+ int eDRMResult = drm_get_content_info(strTemp, &tdcfContentinfo); /* Get attribute of DRM File */
if (DRM_RETURN_SUCCESS == eDRMResult) {
MSG_DEBUG("contentType = %s", tdcfContentinfo.mime_type);
snprintf(szMimeType, nMimeTypeLen, "%s", tdcfContentinfo.mime_type);
return false;
}
- char strTemp[MSG_MAX_DRM_FILE_PATH + 1] = {0,};
+ char strTemp[MSG_MAX_DRM_FILE_PATH + 1] = {0, };
strncpy(strTemp, szFileName, sizeof(strTemp)-1);
msg_error_t MsgSettingSetString(const char *pKey, const char *pSetValue)
{
- if (pKey == NULL || pSetValue == NULL)
- {
+ if (pKey == NULL || pSetValue == NULL) {
MSG_DEBUG("IN Parameter is NULL");
return MSG_ERR_NULL_POINTER;
}
msg_error_t MsgSettingSetInt(const char *pKey, int nSetValue)
{
- if (pKey == NULL)
- {
+ if (pKey == NULL) {
MSG_DEBUG("IN Parameter is NULL");
return MSG_ERR_NULL_POINTER;
}
msg_error_t MsgSettingSetBool(const char *pKey, bool bSetValue)
{
- if (pKey == NULL)
- {
+ if (pKey == NULL) {
MSG_DEBUG("IN Parameter is NULL");
return MSG_ERR_NULL_POINTER;
}
char* MsgSettingGetString(const char *pKey)
{
- if (pKey == NULL)
- {
+ if (pKey == NULL) {
MSG_DEBUG("IN Parameter is NULL");
return NULL;
}
int MsgSettingGetInt(const char *pKey)
{
- if (pKey == NULL)
- {
+ if (pKey == NULL) {
MSG_DEBUG("IN Parameter is NULL");
return -1;
}
int MsgSettingGetBool(const char *pKey, bool *pVal)
{
- if (pKey == NULL)
- {
+ if (pKey == NULL) {
MSG_DEBUG("IN Parameter is NULL");
return -1;
}
MSG_DEBUG("smsCnt = %d, mmsCnt = %d ##", SmsCnt, MmsCnt);
- // Set Msg Count into VConf
- if (MsgSettingSetIndicator(SmsCnt, MmsCnt) != MSG_SUCCESS)
- {
+ /* Set Msg Count into VConf */
+ if (MsgSettingSetIndicator(SmsCnt, MmsCnt) != MSG_SUCCESS) {
MSG_DEBUG("MsgSettingSetIndicator() FAILED");
return MSG_ERR_SET_SETTING;
}
-// if (SmsCnt == 0 && MmsCnt == 0)
-// {
-// MSG_DEBUG("No New Message.");
-// }
-// else
-// {
-// MSG_DEBUG("New Message.");
-//
-// bool bNotification = true;
-//
-// if (MsgSettingGetBool(MSG_SETTING_NOTIFICATION, &bNotification) != MSG_SUCCESS) {
-// MSG_DEBUG("MsgSettingGetBool is failed.");
-// }
-//
-// if (bNotification)
-// MsgChangePmState();
-// }
+#if 0
+ if (SmsCnt == 0 && MmsCnt == 0) {
+ MSG_DEBUG("No New Message.");
+ } else {
+ MSG_DEBUG("New Message.");
+
+ bool bNotification = true;
+
+ if (MsgSettingGetBool(MSG_SETTING_NOTIFICATION, &bNotification) != MSG_SUCCESS) {
+ MSG_DEBUG("MsgSettingGetBool is failed.");
+ }
+
+ if (bNotification)
+ MsgChangePmState();
+ }
+#endif
MSG_END();
msg_error_t MsgSettingSetIndicator(int SmsCnt, int MmsCnt)
{
-
if (MsgSettingSetInt(VCONFKEY_MESSAGE_RECV_SMS_STATE, SmsCnt) != 0)
return MSG_ERR_SET_SETTING;
if (MsgSettingSetInt(VCONFKEY_MESSAGE_RECV_MMS_STATE, MmsCnt) != 0)
sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
if (sockfd < 0) {
- THROW(MsgException::IPC_ERROR,"socket not opened %s",g_strerror(errno));
+ THROW(MsgException::IPC_ERROR, "socket not opened %s", g_strerror(errno));
}
struct sockaddr_un serverSA = {0, };
serverSA.sun_family = AF_UNIX;
memset(serverSA.sun_path, 0x00, sizeof(serverSA.sun_path));
- strncpy(serverSA.sun_path, path, sizeof(serverSA.sun_path)-1); /* // "./socket" */
+ strncpy(serverSA.sun_path, path, sizeof(serverSA.sun_path)-1);
int len = strlen(serverSA.sun_path) + sizeof(serverSA.sun_family);
if (::connect(sockfd, (struct sockaddr *)&serverSA, len) == CUSTOM_SOCKET_ERROR) {
if(errno == EACCES)
- THROW(MsgException::SECURITY_ERROR,"cannot connect server %s", g_strerror(errno));
+ THROW(MsgException::SECURITY_ERROR, "cannot connect server %s", g_strerror(errno));
else
- THROW(MsgException::IPC_ERROR,"cannot connect server %s", g_strerror(errno));
+ THROW(MsgException::IPC_ERROR, "cannot connect server %s", g_strerror(errno));
}
/* add fd for select() */
read(&rfd, &rlen);
if (rfd == NULL) {
- THROW(MsgException::IPC_ERROR,"rfd is NULL %s", g_strerror(errno));
+ THROW(MsgException::IPC_ERROR, "rfd is NULL %s", g_strerror(errno));
}
memcpy(&remotefd, rfd, sizeof(rlen));
maxfd = fd;
}
-int MsgIpcClientSocket::writen (const char *buf, unsigned int len)
+int MsgIpcClientSocket::writen(const char *buf, unsigned int len)
{
unsigned int nleft;
int nwrite;
return len;
}
-int MsgIpcClientSocket::readn( char *buf, unsigned int len )
+int MsgIpcClientSocket::readn(char *buf, unsigned int len )
{
unsigned int nleft;
int nread;
if (nread < 0) {
MSG_FATAL("WARNING read value %d: %s", nread, g_strerror(errno));
return nread;
- } else if( nread == 0 ) {
+ } else if (nread == 0) {
break;
}
return (len-nleft);
}
-bool MsgIpcClientSocket::wait_for_reply ()
+bool MsgIpcClientSocket::wait_for_reply()
{
int err = -1;
fd_set fds;
struct timeval tv;
if (sockfd < 0) {
- MSG_FATAL ("Invalid file description : [%d]", sockfd);
+ MSG_FATAL("Invalid file description : [%d]", sockfd);
return false;
}
tv.tv_sec = 5; /* should be tuned */
tv.tv_usec = 0;
- MSG_DEBUG ("wait for response [%d]", sockfd);
+ MSG_DEBUG("wait for response [%d]", sockfd);
err = select(sockfd + 1, &fds, NULL, NULL, &tv);
if (err == -1) {
MSG_FATAL("select error[%d] fd[%d]", errno, sockfd);
return false;
}
else if (err == 0) {
- MSG_FATAL ("select timeout fd[%d]", sockfd);
+ MSG_FATAL("select timeout fd[%d]", sockfd);
return false;
}
if (fd == maxfd) {
int newmax = 0;
for (it = mapFds.begin() ; it != mapFds.end() ; it++)
- newmax = (it->second > newmax )? it->second : newmax;
+ newmax = (it->second > newmax)? it->second : newmax;
maxfd = newmax;
}
MSG_DEBUG("fd %d removal done", fd);
MSG_END();
}
-int MsgIpcServerSocket::readn( int fd, char *buf, unsigned int len )
+int MsgIpcServerSocket::readn(int fd, char *buf, unsigned int len )
{
size_t nleft;
int nread;
}
void msg_json_gen_set_child(msg_json_gen_object *parent, const char *key, msg_json_gen_object *child) {
- if (parent == NULL || child == NULL)
- {
+ if (parent == NULL || child == NULL) {
return;
}
+
switch(parent->type) {
case MSG_JSON_GEN_OBJECT:
if (key == NULL) {
}
void msg_json_gen_set_value(msg_json_gen_object *parent, const char *key, long long int value) {
- if (parent == NULL)
- {
+ if (parent == NULL) {
return;
}
+
switch(parent->type) {
case MSG_JSON_GEN_OBJECT:
if (key == NULL) {
}
void msg_json_gen_set_value(msg_json_gen_object *parent, const char *key, const char *value) {
- if (parent == NULL)
- {
+ if (parent == NULL) {
return;
}
+
switch(parent->type) {
case MSG_JSON_GEN_OBJECT:
if (key == NULL) {
}
char* msg_json_gen_make_json_msg(msg_json_gen_object *root_obj, unsigned long *len) {
- if (root_obj == NULL)
- {
+ if (root_obj == NULL) {
return NULL;
}
JsonGenerator *generator = json_generator_new();
switch (json_node_get_value_type((JsonNode *) json_obj->value)) {
case G_TYPE_STRING:
- {
- json_obj->type = MSG_JSON_PARSER_STRING;
- json_obj->value = (void *)g_value_get_string(&value);
- }
+ json_obj->type = MSG_JSON_PARSER_STRING;
+ json_obj->value = (void *)g_value_get_string(&value);
break;
case G_TYPE_INT:
- {
- json_obj->type = MSG_JSON_PARSER_INT;
- json_obj->value = NULL;
- json_obj->number_value = g_value_get_int(&value);
- }
+ json_obj->type = MSG_JSON_PARSER_INT;
+ json_obj->value = NULL;
+ json_obj->number_value = g_value_get_int(&value);
break;
case G_TYPE_UINT:
- {
- json_obj->type = MSG_JSON_PARSER_UINT;
- json_obj->value = NULL;
- json_obj->number_value = g_value_get_uint(&value);
- }
+ json_obj->type = MSG_JSON_PARSER_UINT;
+ json_obj->value = NULL;
+ json_obj->number_value = g_value_get_uint(&value);
break;
case G_TYPE_BOOLEAN:
- {
- json_obj->type = MSG_JSON_PARSER_BOOLEAN;
- json_obj->value = NULL;
- json_obj->number_value = g_value_get_boolean(&value);
- }
+ json_obj->type = MSG_JSON_PARSER_BOOLEAN;
+ json_obj->value = NULL;
+ json_obj->number_value = g_value_get_boolean(&value);
break;
case G_TYPE_INT64:
- {
- json_obj->type = MSG_JSON_PARSER_INT;
- json_obj->value = NULL;
- json_obj->number_value = g_value_get_int64(&value);
- }
+ json_obj->type = MSG_JSON_PARSER_INT;
+ json_obj->value = NULL;
+ json_obj->number_value = g_value_get_int64(&value);
break;
case G_TYPE_UINT64:
- {
- json_obj->type = MSG_JSON_PARSER_UINT;
- json_obj->value = NULL;
- json_obj->number_value = g_value_get_uint64(&value);
- }
+ json_obj->type = MSG_JSON_PARSER_UINT;
+ json_obj->value = NULL;
+ json_obj->number_value = g_value_get_uint64(&value);
break;
case G_TYPE_DOUBLE:
- {
- json_obj->type = MSG_JSON_PARSER_REAL;
- json_obj->value = NULL;
- json_obj->float_value = (double)g_value_get_double(&value);
- }
+ json_obj->type = MSG_JSON_PARSER_REAL;
+ json_obj->value = NULL;
+ json_obj->float_value = (double)g_value_get_double(&value);
break;
default:
- {
- MSG_DEBUG(" Entering node default case");
- }
+ MSG_DEBUG(" Entering node default case");
break;
}
switch (json_node_get_value_type((JsonNode *) node)) {
case G_TYPE_STRING:
- {
- json_obj->type = MSG_JSON_PARSER_STRING;
- json_obj->value = (void *)g_value_get_string(&value);
- }
+ json_obj->type = MSG_JSON_PARSER_STRING;
+ json_obj->value = (void *)g_value_get_string(&value);
break;
case G_TYPE_INT:
- {
- json_obj->type = MSG_JSON_PARSER_INT;
- json_obj->value = NULL;
- json_obj->number_value = g_value_get_int(&value);
- }
+ json_obj->type = MSG_JSON_PARSER_INT;
+ json_obj->value = NULL;
+ json_obj->number_value = g_value_get_int(&value);
break;
case G_TYPE_UINT:
- {
- json_obj->type = MSG_JSON_PARSER_UINT;
- json_obj->value = NULL;
- json_obj->number_value = g_value_get_uint(&value);
- }
+ json_obj->type = MSG_JSON_PARSER_UINT;
+ json_obj->value = NULL;
+ json_obj->number_value = g_value_get_uint(&value);
break;
case G_TYPE_BOOLEAN:
- {
- json_obj->type = MSG_JSON_PARSER_BOOLEAN;
- json_obj->value = NULL;
- json_obj->number_value = g_value_get_boolean(&value);
- }
+ json_obj->type = MSG_JSON_PARSER_BOOLEAN;
+ json_obj->value = NULL;
+ json_obj->number_value = g_value_get_boolean(&value);
break;
case G_TYPE_INT64:
- {
- json_obj->type = MSG_JSON_PARSER_INT;
- json_obj->value = NULL;
- json_obj->number_value = g_value_get_int64(&value);
- }
+ json_obj->type = MSG_JSON_PARSER_INT;
+ json_obj->value = NULL;
+ json_obj->number_value = g_value_get_int64(&value);
break;
case G_TYPE_UINT64:
- {
- json_obj->type = MSG_JSON_PARSER_UINT;
- json_obj->value = NULL;
- json_obj->number_value = g_value_get_uint64(&value);
- }
+ json_obj->type = MSG_JSON_PARSER_UINT;
+ json_obj->value = NULL;
+ json_obj->number_value = g_value_get_uint64(&value);
break;
case G_TYPE_DOUBLE:
- {
- json_obj->type = MSG_JSON_PARSER_REAL;
- json_obj->value = NULL;
- json_obj->float_value = (double)g_value_get_double(&value);
- }
+ json_obj->type = MSG_JSON_PARSER_REAL;
+ json_obj->value = NULL;
+ json_obj->float_value = (double)g_value_get_double(&value);
break;
default:
- {
- MSG_DEBUG(" Entering node default case");
- }
+ MSG_DEBUG(" Entering node default case");
break;
}
}
if (jsonParser != NULL) {
-
/** Loads a JSON stream from a buffer and parses it */
gRet = json_parser_load_from_data(jsonParser, value, value_len, &error);
if (gRet != TRUE) {
root = json_parser_get_root(jsonParser);
if (root != NULL) {
-
json_obj->key = root_key;
json_obj->value = root;
parentType = json_node_get_node_type(root);
}
}
} else {
-
}
return ;
jNodeParentType = json_node_get_node_type((JsonNode *) parent->value);
switch (jNodeParentType) {
- case JSON_NODE_OBJECT:
- {
+ case JSON_NODE_OBJECT: {
/** Get the JSON object from JSON Parent Node */
tempObj = json_node_get_object((JsonNode *) parent->value);
child->value = json_object_get_member(tempObj, child->key);
/** Identify the node type of the JSOSNNode */
- jNodeChildType = json_node_get_node_type((JsonNode *) child->value);
+ jNodeChildType = json_node_get_node_type((JsonNode *)child->value);
switch (jNodeChildType) {
case JSON_NODE_OBJECT:
- {
- child->type = MSG_JSON_PARSER_OBJECT;
- }
+ child->type = MSG_JSON_PARSER_OBJECT;
break;
case JSON_NODE_ARRAY:
- {
- child->type = MSG_JSON_PARSER_ARRAY;
- }
+ child->type = MSG_JSON_PARSER_ARRAY;
break;
case JSON_NODE_VALUE:
- {
- lReturn = msg_json_parser_get_value(child);
- }
+ lReturn = msg_json_parser_get_value(child);
break;
case JSON_NODE_NULL:
- {
- }
break;
default:
- {
- lReturn = 0;
- }
+ lReturn = 0;
break;
}
-
}
break;
- case JSON_NODE_ARRAY:
- {
+ case JSON_NODE_ARRAY: {
/** Get the JSON array from the JSON node */
tempArray = json_node_get_array((JsonNode *) parent->value);
switch (jNodeChildType) {
case JSON_NODE_OBJECT:
- {
- child->type = MSG_JSON_PARSER_OBJECT;
- }
+ child->type = MSG_JSON_PARSER_OBJECT;
break;
case JSON_NODE_ARRAY:
- {
- child->type = MSG_JSON_PARSER_ARRAY;
- }
+ child->type = MSG_JSON_PARSER_ARRAY;
break;
case JSON_NODE_VALUE:
- {
- lReturn = msg_json_parser_get_value(child);
- }
+ lReturn = msg_json_parser_get_value(child);
break;
case JSON_NODE_NULL:
- {
- }
break;
default:
- {
- lReturn = 0;
- break;
- }
+ lReturn = 0;
+ break;
}
-
}
break;
case JSON_NODE_VALUE:
- default:
- {
+ default: {
child->key = NULL;
child->value = NULL;
lReturn = 0;
jNodeParentType = json_node_get_node_type((JsonNode *) parent->value);
switch (jNodeParentType) {
- case JSON_NODE_OBJECT:
- {
+ case JSON_NODE_OBJECT: {
/** Get the JSON object from JSON Parent Node */
- tempObj =
- json_node_get_object((JsonNode *) parent->value);
+ tempObj = json_node_get_object((JsonNode *) parent->value);
/** Get the list of keys from the object node */
GList *members = json_object_get_members(tempObj);
/** Get the key by index from the list */
char *member = NULL;
for (unsigned int i = 0; i < g_list_length(members); i++) {
-
member = (char *)g_list_nth_data(members, i);
if (g_strcmp0((char *)name, member) == 0) {
switch (jNodeChildType) {
case JSON_NODE_OBJECT:
- {
- child->type = MSG_JSON_PARSER_OBJECT;
- }
+ child->type = MSG_JSON_PARSER_OBJECT;
break;
case JSON_NODE_ARRAY:
- {
- child->type = MSG_JSON_PARSER_ARRAY;
- }
+ child->type = MSG_JSON_PARSER_ARRAY;
break;
case JSON_NODE_VALUE:
- {
- lReturn = msg_json_parser_get_value(child);
- }
+ lReturn = msg_json_parser_get_value(child);
break;
case JSON_NODE_NULL:
- {
-
- }
break;
default:
- {
- lReturn = -1;
- }
+ lReturn = -1;
break;
}
-
}
break;
case JSON_NODE_ARRAY:
case JSON_NODE_VALUE:
- default:
- {
+ default: {
child->key = NULL;
child->value = NULL;
lReturn = -1;
jNodeParentType = json_node_get_node_type((JsonNode *) object->value);
switch (jNodeParentType) {
- case JSON_NODE_OBJECT:
- {
+ case JSON_NODE_OBJECT: {
MSG_DEBUG(" JSON_NODE_OBJECT ");
tempObj = NULL;
/** Get the JSON object from JSON Parent Node */
count = json_object_get_size(tempObj);
}
break;
- case JSON_NODE_ARRAY:
- {
+ case JSON_NODE_ARRAY: {
MSG_DEBUG(" JSON_NODE_ARRAY ");
tempArray = NULL;
/** Get the JSON array from the JSON node */
break;
case JSON_NODE_VALUE:
default:
- {
-
- }
break;
}
media = (MMS_MEDIA_S *)g_list_nth_data(pPage->medialist, mediaIdx);
return media;
-
}
int _MsgMmsGetTransitionCount(MMS_MESSAGE_DATA_S *pMsgData)
int pageCnt = 0;
char *buf = NULL;
- bufsize += sizeof(int); // Page cnt
+ bufsize += sizeof(int); /* Page cnt */
pageCnt = pMsgData->pageCnt;
if (pMsgData->pagelist) {
-
for (int pageIdx = 0; pageIdx < pageCnt; pageIdx++) {
-
int mediaCnt = 0;
MMS_PAGE_S *page = (MMS_PAGE_S *)g_list_nth_data(pMsgData->pagelist, pageIdx);
mediaCnt = page->mediaCnt;
- bufsize += sizeof(int); // Media cnt
+ bufsize += sizeof(int); /* Media cnt */
if (page->medialist) {
bufsize += sizeof(MMS_MEDIA_S) * mediaCnt;
}
- bufsize += sizeof(int) * 6;//Dur, Begin, End, Min, Max, Repeat
+ bufsize += sizeof(int) * 6; /* Dur, Begin, End, Min, Max, Repeat */
}
}
- bufsize += sizeof(int); // region count;
+ bufsize += sizeof(int); /* region count; */
if (pMsgData->regionlist) {
int elementSize = g_list_length(pMsgData->regionlist);
bufsize += elementSize * (sizeof(MMS_SMIL_REGION));
}
- bufsize += sizeof(int); // attachment count;
+ bufsize += sizeof(int); /* attachment count; */
if (pMsgData->attachlist) {
int elementSize = g_list_length(pMsgData->attachlist);
bufsize += elementSize * sizeof(MMS_ATTACH_S);
}
- bufsize += sizeof(int); // transition count;
+ bufsize += sizeof(int); /* transition count; */
if (pMsgData->transitionlist) {
int elementSize = g_list_length(pMsgData->transitionlist);
bufsize += elementSize * sizeof(MMS_SMIL_TRANSITION);
}
- bufsize += sizeof(int); // meta count;
+ bufsize += sizeof(int); /* meta count; */
if (pMsgData->metalist) {
int elementSize = g_list_length(pMsgData->metalist);
bufsize += elementSize * sizeof(MMS_SMIL_META);
bufsize += sizeof(int) + filePathLen;
- bufsize += sizeof(int); // type
+ bufsize += sizeof(int); /* type */
bufsize += sizeof(MMS_HEADER_DATA_S);
bufsize += sizeof(MMS_MULTIPART_DATA_S);
int serial_index = 0;
memcpy(buf, &pMsgData->backup_type, sizeof(int));
- MSG_DEBUG("[#%2d][%5d] backup type = %d",serial_index++, offset, pMsgData->backup_type);
+ MSG_DEBUG("[#%2d][%5d] backup type = %d", serial_index++, offset, pMsgData->backup_type);
offset += sizeof(int);
- //smilFilePath
+ /* smilFilePath */
memcpy(buf + offset , &filePathLen, sizeof(int));
- // copy file path
- MSG_SEC_DEBUG("[#%2d][%5d] smilFilePath = %s, len = %d",serial_index++, offset, pMsgData->szSmilFilePath, filePathLen);
+ /* copy file path */
+ MSG_SEC_DEBUG("[#%2d][%5d] smilFilePath = %s, len = %d", serial_index++, offset, pMsgData->szSmilFilePath, filePathLen);
offset += sizeof(int);
if (filePathLen > 0) {
offset += filePathLen;
}
- // copy page count
- MSG_DEBUG("[#%2d][%5d] page count = %d",serial_index++, offset, pMsgData->pageCnt);
+ /* copy page count */
+ MSG_DEBUG("[#%2d][%5d] page count = %d", serial_index++, offset, pMsgData->pageCnt);
memcpy(buf + offset, &(pMsgData->pageCnt), sizeof(int));
offset += sizeof(int);
if (pMsgData->pagelist) {
-
for (int pageIdx = 0; pageIdx < pageCnt; pageIdx++) {
MMS_PAGE_S *page = (MMS_PAGE_S *)g_list_nth_data(pMsgData->pagelist, pageIdx);
- MSG_DEBUG("[#%2d][%5d][%d page] media count = %d",serial_index++, offset, pageIdx, page->mediaCnt);
+ MSG_DEBUG("[#%2d][%5d][%d page] media count = %d", serial_index++, offset, pageIdx, page->mediaCnt);
memcpy(buf + offset, &page->mediaCnt, sizeof(int));
offset += sizeof(int);
if (page->medialist) {
- for (int i = 0; i < page->mediaCnt; ++ i) {
+ for (int i = 0; i < page->mediaCnt; ++i) {
MMS_MEDIA_S *media = (MMS_MEDIA_S *)g_list_nth_data(page->medialist, i);
memcpy(buf + offset, media, sizeof(MMS_MEDIA_S));
offset += sizeof(MMS_MEDIA_S);
}
}
- MSG_DEBUG("[#%2d][%5d] region count = %d",serial_index++, offset, pMsgData->regionCnt);
+ MSG_DEBUG("[#%2d][%5d] region count = %d", serial_index++, offset, pMsgData->regionCnt);
memcpy(buf + offset, &pMsgData->regionCnt, sizeof(int));
offset += sizeof(int);
if (pMsgData->regionlist) {
- for (int i = 0; i < pMsgData->regionCnt; ++ i) {
+ for (int i = 0; i < pMsgData->regionCnt; ++i) {
MMS_SMIL_REGION *region = (MMS_SMIL_REGION *)g_list_nth_data(pMsgData->regionlist, i);
memcpy(buf + offset, region, sizeof(MMS_SMIL_REGION));
offset += sizeof(MMS_SMIL_REGION);
}
}
- MSG_DEBUG("[#%2d][%5d] attach count = %d",serial_index++, offset, pMsgData->attachCnt);
+ MSG_DEBUG("[#%2d][%5d] attach count = %d", serial_index++, offset, pMsgData->attachCnt);
memcpy(buf + offset, &pMsgData->attachCnt, sizeof(int));
offset += sizeof(int);
if (pMsgData->attachlist) {
- for (int i = 0; i < pMsgData->attachCnt; ++ i) {
+ for (int i = 0; i < pMsgData->attachCnt; ++i) {
MMS_ATTACH_S *attach = (MMS_ATTACH_S *)g_list_nth_data(pMsgData->attachlist, i);
memcpy(buf + offset, attach, sizeof(MMS_ATTACH_S));
offset += sizeof(MMS_ATTACH_S);
}
}
- MSG_DEBUG("[#%2d][%5d] transition count = %d",serial_index++, offset, pMsgData->transitionCnt);
+ MSG_DEBUG("[#%2d][%5d] transition count = %d", serial_index++, offset, pMsgData->transitionCnt);
memcpy(buf + offset, &pMsgData->transitionCnt, sizeof(int));
offset += sizeof(int);
if (pMsgData->transitionlist) {
- for (int i = 0; i < pMsgData->transitionCnt; ++ i) {
+ for (int i = 0; i < pMsgData->transitionCnt; ++i) {
MMS_SMIL_TRANSITION *transition = (MMS_SMIL_TRANSITION *)g_list_nth_data(pMsgData->transitionlist, i);
memcpy(buf + offset, transition, sizeof(MMS_SMIL_TRANSITION));
offset += sizeof(MMS_SMIL_TRANSITION);
}
}
- MSG_DEBUG("[#%2d][%5d] meta count = %d",serial_index++, offset, pMsgData->metaCnt);
+ MSG_DEBUG("[#%2d][%5d] meta count = %d", serial_index++, offset, pMsgData->metaCnt);
memcpy(buf + offset, &pMsgData->metaCnt, sizeof(int));
offset += sizeof(int);
if (pMsgData->metalist) {
- for (int i = 0; i < pMsgData->metaCnt; ++ i) {
+ for (int i = 0; i < pMsgData->metaCnt; ++i) {
MMS_SMIL_META *meta = (MMS_SMIL_META *)g_list_nth_data(pMsgData->metalist, i);
memcpy(buf + offset, meta, sizeof(MMS_SMIL_META));
}
}
- MSG_DEBUG("[#%2d][%5d] root layout",serial_index++, offset);
+ MSG_DEBUG("[#%2d][%5d] root layout", serial_index++, offset);
memcpy(buf + offset, &pMsgData->rootlayout, sizeof(MMS_SMIL_ROOTLAYOUT));
offset += sizeof(MMS_SMIL_ROOTLAYOUT);
#ifdef FEATURE_JAVA_MMS
- MSG_DEBUG("[#%2d][%5d] java mms",serial_index++, offset);
+ MSG_DEBUG("[#%2d][%5d] java mms", serial_index++, offset);
memcpy(buf + offset, &pMsgData->msgAppId, sizeof(MMS_APPID_INFO_S));
offset += sizeof(MMS_APPID_INFO_S);
#endif
memcpy (buf + offset, &pMsgData->header, sizeof(MMS_HEADER_DATA_S));
- MSG_DEBUG("[#%2d][%5d] mms header",serial_index++, offset);
+ MSG_DEBUG("[#%2d][%5d] mms header", serial_index++, offset);
offset += sizeof(MMS_HEADER_DATA_S);
memcpy (buf + offset, &pMsgData->smil, sizeof(MMS_MULTIPART_DATA_S));
- MSG_DEBUG("[#%2d][%5d] mms smil",serial_index++, offset);
+ MSG_DEBUG("[#%2d][%5d] mms smil", serial_index++, offset);
offset += sizeof(MMS_MULTIPART_DATA_S);
*pSize = offset;
int type;
memcpy(&type, pData, sizeof(int));
- MSG_DEBUG("[#%2d][%5d] backup type = %d",serial_index++, offset, type);
+ MSG_DEBUG("[#%2d][%5d] backup type = %d", serial_index++, offset, type);
offset += sizeof(int);
pMsgData->backup_type = type;
memcpy(&filePathLen, pData + offset, sizeof(int));
- MSG_DEBUG("[#%2d][%5d] smil path len = %d",serial_index, offset, filePathLen);
+ MSG_DEBUG("[#%2d][%5d] smil path len = %d", serial_index, offset, filePathLen);
offset += sizeof(int);
if (filePathLen > MSG_FILEPATH_LEN_MAX) {
if (filePathLen > 0) {
memcpy(pMsgData->szSmilFilePath, pData + offset, filePathLen);
- MSG_DEBUG("[#%2d][%5d] smil path = %s",serial_index, offset, pMsgData->szSmilFilePath);
+ MSG_DEBUG("[#%2d][%5d] smil path = %s", serial_index, offset, pMsgData->szSmilFilePath);
offset += filePathLen;
}
serial_index++;
memcpy(&(pMsgData->pageCnt), pData + offset, sizeof(int));
- MSG_DEBUG("[#%2d][%5d] page count = %d",serial_index++, offset, pMsgData->pageCnt);
+ MSG_DEBUG("[#%2d][%5d] page count = %d", serial_index++, offset, pMsgData->pageCnt);
offset += sizeof(int);
pageCnt = pMsgData->pageCnt;
offset += sizeof(int);
pMsgData->pagelist = g_list_append(pMsgData->pagelist, pPage);
-// if (pPage->medialist) {
-// pMsgData->pagelist = g_list_append(pMsgData->pagelist, pPage);
-// } else {
-// free(pPage);
-// pPage = NULL;
-// }
-
+#if 0
+ if (pPage->medialist) {
+ pMsgData->pagelist = g_list_append(pMsgData->pagelist, pPage);
+ } else {
+ free(pPage);
+ pPage = NULL;
+ }
+#endif
}
pMsgData->pageCnt = g_list_length(pMsgData->pagelist);
- //Processing Region List
+ /* Processing Region List */
memcpy(&pMsgData->regionCnt, pData + offset, sizeof(int));
- MSG_DEBUG("[#%2d][%5d] region count = %d",serial_index++, offset, pMsgData->regionCnt);
+ MSG_DEBUG("[#%2d][%5d] region count = %d", serial_index++, offset, pMsgData->regionCnt);
offset += sizeof(int);
- //MSG_DEBUG(" pBody->regionCnt: %d", pBody->regionCnt);
+ /* MSG_DEBUG(" pBody->regionCnt: %d", pBody->regionCnt); */
for (int i = 0; i < pMsgData->regionCnt; ++i) {
pRegion = (MMS_SMIL_REGION *)calloc(sizeof(MMS_SMIL_REGION), 1);
pMsgData->regionlist = g_list_append(pMsgData->regionlist, pRegion);
}
- //Processing Attachment List
+ /* Processing Attachment List */
memcpy(&pMsgData->attachCnt, pData + offset, sizeof(int));
- MSG_DEBUG("[#%2d][%5d] attach count = %d",serial_index++, offset, pMsgData->attachCnt);
+ MSG_DEBUG("[#%2d][%5d] attach count = %d", serial_index++, offset, pMsgData->attachCnt);
offset += sizeof(int);
for (int i = 0; i < pMsgData->attachCnt; ++i) {
pMsgData->attachCnt = g_list_length(pMsgData->attachlist);
- //Processing Transition List
+ /* Processing Transition List */
memcpy(&pMsgData->transitionCnt, pData + offset, sizeof(int));
- MSG_DEBUG("[#%2d][%5d] transition count = %d",serial_index++, offset, pMsgData->transitionCnt);
+ MSG_DEBUG("[#%2d][%5d] transition count = %d", serial_index++, offset, pMsgData->transitionCnt);
offset += sizeof(int);
for (int i = 0; i < pMsgData->transitionCnt; ++i) {
pMsgData->transitionlist = g_list_append(pMsgData->transitionlist, pTransition);
}
- //Processing Meta List
+ /* Processing Meta List */
memcpy(&pMsgData->metaCnt, pData + offset, sizeof(int));
- MSG_DEBUG("[#%2d][%5d] meta count = %d",serial_index++, offset, pMsgData->metaCnt);
+ MSG_DEBUG("[#%2d][%5d] meta count = %d", serial_index++, offset, pMsgData->metaCnt);
offset += sizeof(int);
for (int i = 0; i < pMsgData->metaCnt; ++i) {
pMsgData->metalist = g_list_append(pMsgData->metalist, pMeta);
}
- MSG_DEBUG("[#%2d][%5d] root layout",serial_index++, offset);
+ MSG_DEBUG("[#%2d][%5d] root layout", serial_index++, offset);
memcpy(&pMsgData->rootlayout, pData + offset, sizeof(MMS_SMIL_ROOTLAYOUT));
offset += sizeof(MMS_SMIL_ROOTLAYOUT);
#ifdef FEATURE_JAVA_MMS
- MSG_DEBUG("[#%2d][%5d] java mms",serial_index++, offset);
+ MSG_DEBUG("[#%2d][%5d] java mms", serial_index++, offset);
memcpy(&pMsgData->msgAppId, pData + offset, sizeof(MMS_APPID_INFO_S));
offset += sizeof(MMS_APPID_INFO_S);
-// MSG_DEBUG("java_app_id valid:%d, appId:%s repleToAppId:%s", pBody->msgAppId.valid, pBody->msgAppId.appId, pBody->msgAppId.replyToAppId);
+/* MSG_DEBUG("java_app_id valid:%d, appId:%s repleToAppId:%s", pBody->msgAppId.valid, pBody->msgAppId.appId, pBody->msgAppId.replyToAppId); */
#endif
memcpy(&pMsgData->header, pData + offset, sizeof(MMS_HEADER_DATA_S));
- MSG_DEBUG("[#%2d][%5d] mms header",serial_index++, offset);
+ MSG_DEBUG("[#%2d][%5d] mms header", serial_index++, offset);
offset += sizeof(MMS_HEADER_DATA_S);
memcpy(&pMsgData->smil, pData + offset, sizeof(MMS_MULTIPART_DATA_S));
- MSG_DEBUG("[#%2d][%5d] mms smil",serial_index++, offset);
+ MSG_DEBUG("[#%2d][%5d] mms smil", serial_index++, offset);
offset += sizeof(MMS_MULTIPART_DATA_S);
MSG_DEBUG("Final offset : %d", offset);
}
if (media->mediatype == MMS_SMIL_MEDIA_INVALID) {
- MSG_DEBUG("%-25s : %s", "Media type","MMS_SMIL_MEDIA_INVALID");
+ MSG_DEBUG("%-25s : %s", "Media type", "MMS_SMIL_MEDIA_INVALID");
} else if (media->mediatype == MMS_SMIL_MEDIA_IMG) {
- MSG_DEBUG("%-25s : %s", "Media type","MMS_SMIL_MEDIA_IMG");
+ MSG_DEBUG("%-25s : %s", "Media type", "MMS_SMIL_MEDIA_IMG");
} else if (media->mediatype == MMS_SMIL_MEDIA_AUDIO) {
- MSG_DEBUG("%-25s : %s", "Media type","MMS_SMIL_MEDIA_AUDIO");
+ MSG_DEBUG("%-25s : %s", "Media type", "MMS_SMIL_MEDIA_AUDIO");
} else if (media->mediatype == MMS_SMIL_MEDIA_VIDEO) {
- MSG_DEBUG("%-25s : %s", "Media type","MMS_SMIL_MEDIA_VIDEO");
+ MSG_DEBUG("%-25s : %s", "Media type", "MMS_SMIL_MEDIA_VIDEO");
} else if (media->mediatype == MMS_SMIL_MEDIA_TEXT) {
- MSG_DEBUG("%-25s : %s", "Media type","MMS_SMIL_MEDIA_TEXT");
+ MSG_DEBUG("%-25s : %s", "Media type", "MMS_SMIL_MEDIA_TEXT");
} else if (media->mediatype == MMS_SMIL_MEDIA_ANIMATE) {
- MSG_DEBUG("%-25s : %s", "Media type","MMS_SMIL_MEDIA_ANIMATE");
+ MSG_DEBUG("%-25s : %s", "Media type", "MMS_SMIL_MEDIA_ANIMATE");
} else if (media->mediatype == MMS_SMIL_MEDIA_IMG_OR_VIDEO) {
- MSG_DEBUG("%-25s : %s", "Media type","MMS_SMIL_MEDIA_REF");
+ MSG_DEBUG("%-25s : %s", "Media type", "MMS_SMIL_MEDIA_REF");
} else {
MSG_DEBUG("%-25s : Unknown [%d]", "Media type", media->mediatype);
}
} else {
MSG_DEBUG("Not Exist Media Data in [%d]th", i);
}
-
}
}
}
} else {
MSG_DEBUG("Not Exist Page Data in [%d]th", i);
}
-
}
}
}
}
}
-
}
MMS_ADDRESS_DATA_S *MsgMmsCreateAddress(int addressType, const char *addressVal)
MMS_HEADER_DATA_S *MsgMmsCreateHeader()
{
- MMS_HEADER_DATA_S *pMmsHeaderData = (MMS_HEADER_DATA_S * )calloc(1, sizeof(MMS_HEADER_DATA_S));
+ MMS_HEADER_DATA_S *pMmsHeaderData = (MMS_HEADER_DATA_S *)calloc(1, sizeof(MMS_HEADER_DATA_S));
if (pMmsHeaderData) {
- pMmsHeaderData->bcc = NULL;// Bcc
- pMmsHeaderData->cc = NULL;// Cc
+ pMmsHeaderData->bcc = NULL; /* Bcc */
+ pMmsHeaderData->cc = NULL; /* Cc */
pMmsHeaderData->contentLocation[0] = '\0';
pMmsHeaderData->szContentType[0] = '\0';
pMmsHeaderData->date = 0;
- pMmsHeaderData->bDeliveryReport = false; // X-Mms-Delivery-Report
+ pMmsHeaderData->bDeliveryReport = false; /* X-Mms-Delivery-Report */
pMmsHeaderData->delivery.type = MMS_TIMETYPE_NONE;
pMmsHeaderData->delivery.time = 0;
pMmsHeaderData->expiry.type = MMS_TIMETYPE_NONE;
pMmsHeaderData->expiry.time = 0;
- pMmsHeaderData->szFrom[0] = '\0';// From
- pMmsHeaderData->messageClass = -1;//Personal | Advertisement | Informational | Auto
+ pMmsHeaderData->szFrom[0] = '\0'; /* From */
+ pMmsHeaderData->messageClass = -1; /* Personal | Advertisement | Informational | Auto */
pMmsHeaderData->messageID[0]= '\0';
- pMmsHeaderData->messageType = -1;//MmsMsgType : ex) sendreq
- pMmsHeaderData->mmsVersion = -1;//1.0 1.3
- pMmsHeaderData->messageSize = 0; // X-Mms-Message-Size
- pMmsHeaderData->mmsPriority = -1;//_MSG_PRIORITY_TYPE_E : Low | Normal | High
- pMmsHeaderData->bReadReport = 0;// X-Mms-Read-Report
- // X-Mms-Report-Allowed
- // X-Mms-Response-Status
- // X-Mms-Response-Text
- pMmsHeaderData->bHideAddress = false;// X-Mms-Sender-Visibility
- pMmsHeaderData->mmsStatus = MSG_DELIVERY_REPORT_NONE;// X-Mms-Status
- pMmsHeaderData->szSubject[0] = '\0';// Subject
- pMmsHeaderData->to = NULL;// To
+ pMmsHeaderData->messageType = -1; /* MmsMsgType : ex) sendreq */
+ pMmsHeaderData->mmsVersion = -1; /* 1.0 1.3 */
+ pMmsHeaderData->messageSize = 0; /* X-Mms-Message-Size */
+ pMmsHeaderData->mmsPriority = -1; /* MSG_PRIORITY_TYPE_E : Low | Normal | High */
+ pMmsHeaderData->bReadReport = 0; /* X-Mms-Read-Report */
+ pMmsHeaderData->bHideAddress = false; /* X-Mms-Sender-Visibility */
+ pMmsHeaderData->mmsStatus = MSG_DELIVERY_REPORT_NONE; /* X-Mms-Status */
+ pMmsHeaderData->szSubject[0] = '\0'; /* Subject */
+ pMmsHeaderData->to = NULL;
pMmsHeaderData->trID[0] = '\0';
- // X-Mms-Retrieve-Status
- // X-Mms-Retrieve-Text
- // X-Mms-Read-Status
- // X-Mms-Reply-Charging
- // X-Mms-Reply-Charging-Deadline
- // X-Mms-Reply-Charging-ID
- // X-Mms-Reply-Charging-Size
- // X-Mms-Previously-Sent-By
- // X-Mms-Previously-Sent-Date
- // X-Mms-Store
- // X-Mms-MM-State
- // X-Mms-MM-Flags
- // X-Mms-Store-Status
- // X-Mms-Store-Status-Text
- // X-Mms-Stored
- // X-Mms-Attributes
- // X-Mms-Totals
- // X-Mms-Mbox-Totals
- // X-Mms-Quotas
- // X-Mms-Mbox-Quotas
- // X-Mms-Message-Count
- // Content
- // X-Mms-Start
- // Additional-headers
- // X-Mms-Distribution-Indicator
- // X-Mms-Element-Descriptor
- // X-Mms-Limit
- // X-Mms-Recommended-Retrieval-Mode
- // X-Mms-Recommended-Retrieval-Mode-Text
- // X-Mms-Status-Text
- // X-Mms-Applic-ID
- // X-Mms-Reply-Applic-ID
- // X-Mms-Aux-Applic-Info
- pMmsHeaderData->contentClass = -1;//text | image-basic| image-rich | video-basic | video-rich | megapixel | content-basic | content-rich
- // X-Mms-DRM-Content
- // X-Mms-Adaptation-Allowed
- // X-Mms-Replace-ID
- // X-Mms-Cancel-ID
- // X-Mms-Cancel-Status
+ pMmsHeaderData->contentClass = -1;/* text | image-basic| image-rich | video-basic | video-rich | megapixel | content-basic | content-rich */
+#if 0
+ X-Mms-Report-Allowed
+ X-Mms-Response-Status
+ X-Mms-Response-Text
+ X-Mms-Retrieve-Status
+ X-Mms-Retrieve-Text
+ X-Mms-Read-Status
+ X-Mms-Reply-Charging
+ X-Mms-Reply-Charging-Deadline
+ X-Mms-Reply-Charging-ID
+ X-Mms-Reply-Charging-Size
+ X-Mms-Previously-Sent-By
+ X-Mms-Previously-Sent-Date
+ X-Mms-Store
+ X-Mms-MM-State
+ X-Mms-MM-Flags
+ X-Mms-Store-Status
+ X-Mms-Store-Status-Text
+ X-Mms-Stored
+ X-Mms-Attributes
+ X-Mms-Totals
+ X-Mms-Mbox-Totals
+ X-Mms-Quotas
+ X-Mms-Mbox-Quotas
+ X-Mms-Message-Count
+ Content
+ X-Mms-Start
+ Additional-headers
+ X-Mms-Distribution-Indicator
+ X-Mms-Element-Descriptor
+ X-Mms-Limit
+ X-Mms-Recommended-Retrieval-Mode
+ X-Mms-Recommended-Retrieval-Mode-Text
+ X-Mms-Status-Text
+ X-Mms-Applic-ID
+ X-Mms-Reply-Applic-ID
+ X-Mms-Aux-Applic-Info
+ X-Mms-DRM-Content
+ X-Mms-Adaptation-Allowed
+ X-Mms-Replace-ID
+ X-Mms-Cancel-ID
+ X-Mms-Cancel-Status
+#endif
}
return pMmsHeaderData;
MMS_ADDRESS_DATA_S * pAddressData = (MMS_ADDRESS_DATA_S *)data;
MsgMmsReleaseAddress(&pAddressData);
-
}
int MsgMmsReleaseAddressList(MMSList **ppAddressList)
static bool IsMatchedMedia(MMS_MEDIA_S *media, MMS_MULTIPART_DATA_S *pMultipart)
{
if (strlen(pMultipart->szContentID) > 0) {
-
- char szTempContentID[MSG_MSG_ID_LEN + 1] = {0,};
+ char szTempContentID[MSG_MSG_ID_LEN + 1] = {0, };
removeLessGreaterMark(pMultipart->szContentID, szTempContentID, sizeof(szTempContentID));
if (strcmp(media->szContentID, szTempContentID) == 0) {
if (pMsgData->pagelist) {
for (int pageIdx = 0; pageIdx < pMsgData->pageCnt; pageIdx++) {
-
MMS_PAGE_S *page = (MMS_PAGE_S *)g_list_nth_data(pMsgData->pagelist, pageIdx);
if (page && page->medialist) {
-
for (int mediaIdx = 0; mediaIdx < page->mediaCnt; mediaIdx++) {
-
MMS_MEDIA_S *media = (MMS_MEDIA_S *)g_list_nth_data(page->medialist, mediaIdx);
- if (media) { // add media
- if (IsMatchedMedia(media, pMultipart) == true) { //matched media
+ if (media) { /* add media */
+ if (IsMatchedMedia(media, pMultipart) == true) { /* matched media */
insert_media = true;
media->drmType = pMultipart->drmType;
snprintf(media->szFilePath, sizeof(media->szFilePath), "%s", pMultipart->szFilePath);
, pageIdx, mediaIdx, media, media->szFilePath, media->szFileName, media->szContentID, media->szContentLocation, media->szContentType);
}
}
- } //end for media list
+ } /* end for media list */
}
- } //end for page list
+ } /* end for page list */
}
return insert_media;
if (pMultipart)
memcpy(pMultipart, &pSrc->smil, sizeof(MMS_MULTIPART_DATA_S));
pDst->smil = pMultipart;
- } else if (pageCnt > 0) { // Multipart related
+ } else if (pageCnt > 0) { /* Multipart related */
MsgSmilGenerateSmilDoc(pSrc, &pRawData);
if (pRawData) {
MMS_MULTIPART_DATA_S *pMultipart = MsgMmsCreateMultipart();
}
}
- //Processing Attachment List
+ /* Processing Attachment List */
int attachCnt = _MsgMmsGetAttachCount(pSrc);
for (int i = 0; i < attachCnt; ++i) {
MMS_MULTIPART_DATA_S *multipart = (MMS_MULTIPART_DATA_S *)g_list_nth_data(pMultipartList, i);
if (multipart) {
-
- if (strcasecmp(multipart->szContentType, smil_content_type) == 0 ) {
+ if (strcasecmp(multipart->szContentType, smil_content_type) == 0) {
*smil_multipart = multipart;
break;
}
return 0;
}
-//get content from filepath and save to pMultipartData
+/* get content from filepath and save to pMultipartData */
int MsgMmsSetMultipartData(MMS_MULTIPART_DATA_S *pMultipart)
{
if (pMultipart->pMultipartData != NULL)
if (g_file_get_contents((gchar*)pMultipart->szFilePath, (gchar**)&pMultipart->pMultipartData, (gsize*)&pMultipart->nMultipartDataLen, NULL) == false)
return -1;
- //Due to Get data for Backup message
- //memset(pMultipart->szFilePath, 0x00, sizeof(pMultipart->szFilePath));
+ /* Due to Get data for Backup message */
+ /* memset(pMultipart->szFilePath, 0x00, sizeof(pMultipart->szFilePath)); */
return 0;
}
MMSList *multipart_list = pMmsData->multipartlist;
if (multipart_list) {
-
if (pMmsData->smil) {
MsgMmsSetMultipartData(pMmsData->smil);
}
for (int i = 0; i < (int)g_list_length(multipart_list); i++) {
-
MMS_MULTIPART_DATA_S *pMultipart = (MMS_MULTIPART_DATA_S *)g_list_nth_data(multipart_list, i);
if (pMultipart) {
- MsgMmsSetMultipartData(pMultipart);//app file -> data
+ MsgMmsSetMultipartData(pMultipart);/* app file -> data */
}
}
}
return 0;
}
-//pMultipartData set to file path
+/* pMultipartData set to file path */
int MsgMmsSetMultipartFilePath(const char *dirPath, MMS_MULTIPART_DATA_S *pMultipart)
{
if (g_file_test(dirPath, G_FILE_TEST_IS_DIR) != true) {
/* remove space character of original file name */
msg_replace_space_char(pMultipart->szFilePath);
- if (!MsgCreateFile (pMultipart->szFilePath, pMultipart->pMultipartData, pMultipart->nMultipartDataLen)) {
+ if (!MsgCreateFile(pMultipart->szFilePath, pMultipart->pMultipartData, pMultipart->nMultipartDataLen)) {
MSG_SEC_DEBUG("Fail to set content to file [%s]", pMultipart->szFilePath);
return -1;
}
{
MSG_BEGIN();
- char working_dir[MSG_FILENAME_LEN_MAX+1] = {0,};
+ char working_dir[MSG_FILENAME_LEN_MAX+1] = {0, };
snprintf(working_dir, sizeof(working_dir), "%s", dirPath);
}
if (multipart_list) {
-
for (int i = 0; i < (int)g_list_length(multipart_list); i++) {
-
MMS_MULTIPART_DATA_S *pMultipart = (MMS_MULTIPART_DATA_S *)g_list_nth_data(multipart_list, i);
if (pMultipart) {
- MsgMmsSetMultipartFilePath(working_dir, pMultipart);//data -> svc file
+ MsgMmsSetMultipartFilePath(working_dir, pMultipart); /* data -> svc file */
}
}
}
MSG_SEC_DEBUG("%-25s : %s", "Multipart content id", multipart->szContentID);
MSG_SEC_DEBUG("%-25s : %s", "Multipart content location", multipart->szContentLocation);
MSG_DEBUG("%-25s : %d", "Multipart drm type", multipart->drmType);
-
}
bool _MsgMmsRemoveEmptyMedia(MMS_PAGE_S *pPage)
int mediaCnt = g_list_length(pPage->medialist);
for (int i = 0; i < mediaCnt; i++) {
-
GList *nth = g_list_nth(pPage->medialist, i);
if (nth == NULL)
nth->data = NULL;
}
-
}
pPage->medialist = g_list_remove_all(pPage->medialist, NULL);
return true;
}
-//remove media object with no filepath
+/* remove media object with no filepath */
bool _MsgMmsRemoveEmptyObject(MMS_MESSAGE_DATA_S *pMmsMsg)
{
MMS_PAGE_S *pPage;
int pageCnt = g_list_length(pMmsMsg->pagelist);
for (int i = 0; i < pageCnt; i++) {
-
GList *nth = g_list_nth(pMmsMsg->pagelist, i);
if (nth == NULL)
_MsgMmsRemoveEmptyMedia(pPage);
-// if (g_list_length(pPage->medialist) == 0) {
-//
-// MSG_DEBUG("Found Empty Page [%d]", i);
-//
-// g_free(pPage);
-//
-// nth->data = NULL;
-// }
+#if 0
+ if (g_list_length(pPage->medialist) == 0) {
+ MSG_DEBUG("Found Empty Page [%d]", i);
+
+ g_free(pPage);
+
+ nth->data = NULL;
+ }
+#endif
}
pMmsMsg->pagelist = g_list_remove_all(pMmsMsg->pagelist, NULL);
MSG_SEC_DEBUG("app_smack_label [%s]", app_smack_label);
- char ipc_filepath[MSG_FILEPATH_LEN_MAX+1] = {0,};
+ char ipc_filepath[MSG_FILEPATH_LEN_MAX+1] = {0, };
snprintf(ipc_filepath, MSG_FILEPATH_LEN_MAX, "%s%s", MSG_IPC_DATA_PATH, ipc_filename);
gchar *serialized_data = NULL;
{"header", MMS_HEADER, TYPE_INT},
{"multipart_list", MMS_MULTIPART_LIST, TYPE_ARRAY},
{"smil", MMS_SMIL_MULTIPART, TYPE_OBJECT},
-//multipart
+/* multipart */
{"mp_type", MULTIPART_TYPE, TYPE_INT},
{"mp_ct", MULTIPART_CONTENT_TYPE, TYPE_STR},
{"mp_name", MULTIPART_NAME, TYPE_STR},
{"mp_cid", MULTIPART_CONTENT_ID, TYPE_STR},
{"mp_cl", MULTIPART_CONTENT_LOCATION, TYPE_STR},
-//header
+/* header */
{"h_cl", HEADER_CONTENT_LOCATION, TYPE_STR},
{"h_ct", HEADER_CONTENT_TYPE, TYPE_STR},
{"h_ct_int", HEADER_CONTENT_TYPE_INT, TYPE_INT},
{"h_tid", HEADER_TRID, TYPE_STR},
{"h_cclass", HEADER_CONTENT_CLASS, TYPE_INT},
{"backup_type", MMS_BACKUP_TYPE, TYPE_INT},
-
};
mms_json_enum_e get_mms_key_type(const char * key)
if (parse_obj == NULL)
return -1;
- while(msg_json_parser_get_next_child(parse_obj, &child, index_child))
- {
+ while (msg_json_parser_get_next_child(parse_obj, &child, index_child)) {
MSG_PRINT_PARSER_OBJECT(index_child, child);
type = get_mms_key_type(child.key);
if (parse_obj == NULL)
return -1;
- while(msg_json_parser_get_next_child(parse_obj, &child, index_child))
- {
+ while (msg_json_parser_get_next_child(parse_obj, &child, index_child)) {
MSG_PRINT_PARSER_OBJECT(index_child, child);
type = get_mms_key_type(child.key);
if (parse_obj == NULL)
return -1;
- while(msg_json_parser_get_next_child(parse_obj, &child, index_child))
- {
+ while (msg_json_parser_get_next_child(parse_obj, &child, index_child)) {
if (child.value != NULL && child.type != MSG_JSON_PARSER_NULL) {
-
MSG_PRINT_PARSER_OBJECT(index_child, child);
- MMS_MULTIPART_DATA_S *pMultipart= MsgMmsCreateMultipart();
+ MMS_MULTIPART_DATA_S *pMultipart = MsgMmsCreateMultipart();
if (pMultipart) {
if (MsgParseMultipartData(&child, pMultipart) == 0) {
if (parse_obj == NULL)
return -1;
- while(msg_json_parser_get_next_child(parse_obj, &child, index_child))
- {
+ while (msg_json_parser_get_next_child(parse_obj, &child, index_child)) {
if (child.key != NULL) {
-
MSG_PRINT_PARSER_OBJECT(index_child, child);
type = get_mms_key_type(child.key);
if (pMsgData->header)
MsgParseHeader(&child, pMsgData->header);
break;
- case MMS_SMIL_MULTIPART:
- {
+ case MMS_SMIL_MULTIPART: {
MMS_MULTIPART_DATA_S *pMultipart = MsgMmsCreateMultipart();
if (pMultipart) {
if (MsgParseMultipartData(&child, pMultipart) == 0) {
MSG_JSON_OBJ_SET_INT(object_main, get_mms_key(MMS_BACKUP_TYPE), pMsgData->backup_type);
- //smil multipart
+ /* smil multipart */
if (pMsgData->smil) {
JsonObject *smil_object = NULL;
}
if (pMsgData->multipartlist) {
- //multipart
+ /* multipart */
array_multipart = json_array_new();
int list_count = g_list_length(pMsgData->multipartlist);
MSG_DEBUG("Page Count is [%d]", list_count);
for (int i = 0; i < list_count; i++) {
-
MMS_MULTIPART_DATA_S *multipart = (MMS_MULTIPART_DATA_S *)g_list_nth_data(pMsgData->multipartlist, i);
if (multipart) {
MSG_JSON_OBJ_SET_ARRAY(object_main, get_mms_key(MMS_MULTIPART_LIST), array_multipart);
}
- //header
+ /* header */
if (pMsgData->header) {
MsgSerializeHeader(pMsgData->header, &object_header);
char *buf = NULL;
int i;
- bufsize += sizeof(int); // back-up type
+ bufsize += sizeof(int); /* back-up type */
int to_cnt = 0;
int cc_cnt = 0;
int bcc_cnt = 0;
- bufsize += sizeof(int); // check header data
+ bufsize += sizeof(int); /* check header data */
if (pMsgData->header) {
isExistHeader = 1;
- bufsize += sizeof(MMS_HEADER_DATA_S); // header
+ bufsize += sizeof(MMS_HEADER_DATA_S); /* header */
to_cnt = g_list_length(pMsgData->header->to);
cc_cnt = g_list_length(pMsgData->header->cc);
for (i = 0; i < to_cnt; i++) {
MMS_ADDRESS_DATA_S *addr_data = (MMS_ADDRESS_DATA_S *)g_list_nth_data(pMsgData->header->to, i);
if (addr_data && addr_data->address_val) {
- bufsize += (sizeof(int) + sizeof(int) + strlen(addr_data->address_val)); // type, length, address
+ bufsize += (sizeof(int) + sizeof(int) + strlen(addr_data->address_val)); /* type, length, address */
}
}
for (i = 0; i < cc_cnt; i++) {
MMS_ADDRESS_DATA_S *addr_data = (MMS_ADDRESS_DATA_S *)g_list_nth_data(pMsgData->header->cc, i);
if (addr_data && addr_data->address_val) {
- bufsize += (sizeof(int) + sizeof(int) + strlen(addr_data->address_val)); // type, length, address
+ bufsize += (sizeof(int) + sizeof(int) + strlen(addr_data->address_val)); /* type, length, address */
}
}
for (i = 0; i < bcc_cnt; i++) {
MMS_ADDRESS_DATA_S *addr_data = (MMS_ADDRESS_DATA_S *)g_list_nth_data(pMsgData->header->bcc, i);
if (addr_data && addr_data->address_val) {
- bufsize += (sizeof(int) + sizeof(int) + strlen(addr_data->address_val)); // type, length, address
+ bufsize += (sizeof(int) + sizeof(int) + strlen(addr_data->address_val)); /* type, length, address */
}
}
}
- bufsize += sizeof(int); // check smil data
+ bufsize += sizeof(int); /* check smil data */
if (pMsgData->smil) {
isExistSmil = 1;
- bufsize += (sizeof(MMS_MULTIPART_DATA_S) + (sizeof(char)*pMsgData->smil->nMultipartDataLen)); // smil data
+ bufsize += (sizeof(MMS_MULTIPART_DATA_S) + (sizeof(char)*pMsgData->smil->nMultipartDataLen)); /* smil data */
}
- bufsize += sizeof(int); // check multipart list data
+ bufsize += sizeof(int); /* check multipart list data */
if (pMsgData->multipartlist) {
isExistMultipart = 1;
multipart_cnt = g_list_length(pMsgData->multipartlist);
- bufsize += sizeof(int); // multipart count
+ bufsize += sizeof(int); /* multipart count */
for (i = 0; i < multipart_cnt; i++) {
MMS_MULTIPART_DATA_S *multipart_data = (MMS_MULTIPART_DATA_S *)g_list_nth_data(pMsgData->multipartlist, i);
int serial_index = 0;
int offset = 0;
- // 1. Backup type
+ /* 1. Backup type */
memcpy(buf, &pMsgData->backup_type, sizeof(int));
MSG_DEBUG("[#%2d][%5d] backup type = %d", serial_index++, offset, pMsgData->backup_type);
offset += sizeof(int);
- // 2. Header Data
+ /* 2. Header Data */
memcpy(buf + offset, &isExistHeader, sizeof(int));
offset += sizeof(int);
memcpy(buf + offset, pMsgData->header, sizeof(MMS_HEADER_DATA_S));
offset += sizeof(MMS_HEADER_DATA_S);
- // address
+ /* address */
memcpy(buf + offset, &to_cnt, sizeof(int));
MSG_DEBUG("[#%2d][%5d] TO Count = %d", serial_index++, offset, to_cnt);
offset += sizeof(int);
}
}
- // address
+ /* address */
memcpy(buf + offset, &cc_cnt, sizeof(int));
MSG_DEBUG("[#%2d][%5d] CC Count = %d", serial_index++, offset, cc_cnt);
offset += sizeof(int);
}
}
- // address
+ /* address */
memcpy(buf + offset, &bcc_cnt, sizeof(int));
MSG_DEBUG("[#%2d][%5d] BCC Count = %d", serial_index++, offset, bcc_cnt);
offset += sizeof(int);
}
}
- // 3. Smil Data
+ /* 3. Smil Data */
memcpy(buf + offset, &isExistSmil, sizeof(int));
offset += sizeof(int);
}
}
- // 4. Multipart list data
+ /* 4. Multipart list data */
memcpy(buf + offset, &isExistMultipart, sizeof(int));
offset += sizeof(int);
return -1;
- // 1. Backup type
+ /* 1. Backup type */
memcpy(&(pMmsData->backup_type), value, sizeof(int));
MSG_DEBUG("[#%2d][%5d] backup type = %d", deserial_index++, offset, pMmsData->backup_type);
offset += sizeof(int);
- // 2. Header Data
+ /* 2. Header Data */
memcpy(&isExistHeader, value + offset, sizeof(int));
offset += sizeof(int);
}
}
- // 3. Smil Data
+ /* 3. Smil Data */
memcpy(&isExistSmil, value + offset, sizeof(int));
offset += sizeof(int);
}
}
- // 4. Multipart list data
+ /* 4. Multipart list data */
memcpy(&isExistMultipart, value + offset, sizeof(int));
offset += sizeof(int);
#define MSG_SMIL_COLOR_SIZE 10
#define MSG_STDSTR_SHORT 0x7F
-typedef int HMsgSmil; //SmilDoc Handle
+typedef int HMsgSmil; /* SmilDoc Handle */
typedef enum _SMIL_ELEMENT_T {
ELEMENT_SMIL,
__thread MMS_SMIL_TRANSITION *gTransition = NULL;
__thread MMS_SMIL_META *gMeta = NULL;
-//For Parse Smil
+/* For Parse Smil */
static int MsgSmilGetColorValue(xmlChar *content);
static int MsgSmilGetTime(char *pValue);
static int MsgSmilAtoIHexa(char *pInput);
static xmlNodePtr MsgSmilGetNodeByElementName(xmlNodePtr pstNode, char *pszName);
-//For Generate Smil
+/* For Generate Smil */
static HMsgSmil MsgSmilCreateEmptySmilDoc(void);
static HMsgSmil MsgSmilCreateSmilDoc(char *pszRawData);
static bool MsgSmilDestroyDoc(HMsgSmil hSmilDoc);
int MsgSmilGetColorValue(xmlChar *content)
{
int color;
- char color_inp[9] = {0,};
+ char color_inp[9] = {0, };
- if (content[0] == '#') { // RGB value
- snprintf(color_inp, sizeof(color_inp),"FF%s", (char *)&content[1]);
+ if (content[0] == '#') { /* RGB value */
+ snprintf(color_inp, sizeof(color_inp), "FF%s", (char *)&content[1]);
color = MsgSmilAtoIHexa(color_inp);
} else if (content[0] == '0' && (content[1] == 'x' || content[1] == 'X')) {
- snprintf(color_inp, sizeof(color_inp),"%s", (char *)&content[2]);
+ snprintf(color_inp, sizeof(color_inp), "%s", (char *)&content[2]);
color = MsgSmilAtoIHexa(color_inp);
} else {
MSG_DEBUG("Invalid Color Value");
MmsSmilFontType MsgSmilGetFontTypeValue(char *pString)
{
-
if (!strcmp(pString, "normal"))
return MMS_SMIL_FONT_TYPE_NORMAL;
else if (!strcmp(pString, "italic"))
MSG_BEGIN();
- // Destroy smil doc if present
+ /* Destroy smil doc if present */
if (NULL != __gpaMsgSmilDoc[nSmilDocNo]) {
-
if (false == MsgSmilDestroyDoc(nSmilDocNo)) {
MSG_DEBUG("MsgSmilDestroyDoc: Failed!");
}
__gpaMsgSmilDoc[nSmilDocNo]->pSmilDoc = xmlParseMemory(pszRawData, strlen(pszRawData));
if (NULL == __gpaMsgSmilDoc[nSmilDocNo]->pSmilDoc) {
-
if (false == MsgSmilDestroyDoc(nSmilDocNo)) {
MSG_DEBUG("MsgSmilDestroyDoc: Failed!");
}
}
if (__gpaMsgSmilDoc[nSmilDocNo]->pstRootNode) {
- //Need to Check
+ /* Need to Check */
}
free(__gpaMsgSmilDoc[nSmilDocNo]);
__gpaMsgSmilDoc[nSmilDocNo] = NULL;
MSG_BEGIN();
if (IsValidSmilDocNo(nSmilDocNo)) {
- //xmlSaveFormatFileEnc("-", __gpaMmsSmilDoc[nSmilDocNo]->pSmilDoc, "UTF-8", 1);
+ /* xmlSaveFormatFileEnc("-", __gpaMmsSmilDoc[nSmilDocNo]->pSmilDoc, "UTF-8", 1); */
xmlDocDumpMemory(__gpaMsgSmilDoc[nSmilDocNo]->pSmilDoc, (xmlChar **)(&pszRawData) , NULL);
if (NULL == pszRawData) {
MSG_DEBUG("Invalid pSmilDoc (now wellformed document)");
return false;
}
-
return ret;
}
}
MSG_SEC_DEBUG("Root Layout Element Name = %s", (char *)pstRootLayout->name);
- if (pstSmilRootLayout->bBgColor == true) { // Replace value later
- if ( ( (pstSmilRootLayout->bgColor & 0xFF000000) >> 24 ) > 0) {//check alpha value
+ if (pstSmilRootLayout->bBgColor == true) { /* Replace value later */
+ if (((pstSmilRootLayout->bgColor & 0xFF000000) >> 24) > 0) { /* check alpha value */
xmlSetProp(pstRootLayout, (const xmlChar *)"backgroundColor", (const xmlChar *)MsgSmilColorValueToString(pstSmilRootLayout->bgColor));
}
}
-
- //width
+ /* width */
if (true == pstSmilRootLayout->width.bUnitPercent) {
snprintf(szBuf, MSG_STDSTR_SHORT, "%d%%", pstSmilRootLayout->width.value);
xmlSetProp(pstRootLayout, (const xmlChar *)"width", (const xmlChar *)szBuf);
}
}
- //Height
+ /* Height */
if (true == pstSmilRootLayout->height.bUnitPercent) {
snprintf(szBuf, MSG_STDSTR_SHORT, "%d%%", pstSmilRootLayout->height.value);
xmlSetProp(pstRootLayout, (const xmlChar *)"height", (const xmlChar *)szBuf);
snprintf(szBuf, MSG_STDSTR_SHORT, "%d", pstSmilRootLayout->height.value);
xmlSetProp(pstRootLayout, (const xmlChar *)"height", (const xmlChar *)szBuf);
} else {
-
xmlSetProp(pstRootLayout, (const xmlChar *)"height", (const xmlChar *)"100%");
}
}
MSG_DEBUG("Invalid SmilDoc(hSmilDoc:%d)", nSmilDocNo);
return false;
}
-
}
bool MsgSmilAddRegion(HMsgSmil hSmilDoc, MMS_SMIL_REGION *pstSmilRegion)
int attrType;
MSG_SEC_DEBUG("AttributeType: (%s, %s) ", pstAttr->name, pstAttr->children->content);
switch (attrType = MsgSmilGetAttrID((char *)pstAttr->name)) {
- case ATTRIBUTE_WIDTH:
- {
-// int bUnitPercent;
-
-// if (strchr((char *)pstAttr->children->content, '%'))
-// bUnitPercent = true;
-// else
-// bUnitPercent = false;
+ case ATTRIBUTE_WIDTH: {
+#if 0
+ int bUnitPercent;
+ if (strchr((char *)pstAttr->children->content, '%'))
+ bUnitPercent = true;
+ else
+ bUnitPercent = false;
+#endif
nRootWidth = atoi((char *)pstAttr->children->content);
}
break;
- case ATTRIBUTE_HEIGHT:
- {
-// int bUnitPercent;
-
-// if (strchr((char *)pstAttr->children->content, '%'))
-// bUnitPercent = true;
-// else
-// bUnitPercent = false;
+ case ATTRIBUTE_HEIGHT: {
+#if 0
+ int bUnitPercent;
+ if (strchr((char *)pstAttr->children->content, '%'))
+ bUnitPercent = true;
+ else
+ bUnitPercent = false;
+#endif
nRootHeight = atoi((char *)pstAttr->children->content);
}
break;
if (pstSmilRegion->bBgColor == true) {
MSG_DEBUG(" [Set Attribute] : BkGrd Color");
- if ( ( (pstSmilRegion->bgColor & 0xFF000000) >> 24 ) > 0) {
+ if (((pstSmilRegion->bgColor & 0xFF000000) >> 24) > 0) {
xmlSetProp(pstRegion, (const xmlChar *)"backgroundColor", (const xmlChar *)MsgSmilColorValueToString(pstSmilRegion->bgColor));
MSG_DEBUG("[Set Attribute] : backgroundColor [%s]", MsgSmilColorValueToString(pstSmilRegion->bgColor));
}
MSG_DEBUG("[Set Attribute] : Width : [%s]", szBuf);
}
} else {
- // Note: nRootWidth should be in terms of value(pixel) not unitpercent(%)
- // Validation should be done before this.
+ /* Note: nRootWidth should be in terms of value(pixel) not unitpercent(%) */
+ /* Validation should be done before this. */
if (pstSmilRegion->width.value >= 0 &&
pstSmilRegion->width.value <= nRootWidth &&
nRootWidth != 0) {
MSG_DEBUG("[Set Attribute] : Height : [%s]", szBuf);
}
} else {
- // Note: nRootHeight should be in terms of value(pixel) not unitpercent(%)
- // Validation should be done before this.
+ /* Note: nRootHeight should be in terms of value(pixel) not unitpercent(%) */
+ /* Validation should be done before this. */
if (pstSmilRegion->height.value >= 0 &&
pstSmilRegion->height.value <= nRootHeight &&
nRootHeight != 0) {
MSG_DEBUG("[Set Attribute] : Left : [%s]", szBuf);
}
} else {
- // Note: nRootWidth should be in terms of value(pixel) not unitpercent(%)
- // Validation should be done before this.
+ /* Note: nRootWidth should be in terms of value(pixel) not unitpercent(%) */
+ /* Validation should be done before this. */
if (pstSmilRegion->nLeft.value >= 0 && nRootWidth != 0) {
int iLeft = (pstSmilRegion->nLeft.value * 100) / nRootWidth;
MSG_DEBUG("[Set Attribute] : Top : [%s]", szBuf);
}
} else {
- // Note: nRootHeight should be in terms of value(pixel) not unitpercent(%)
- // Validation should be done before this.
+ /* Note: nRootHeight should be in terms of value(pixel) not unitpercent(%) */
+ /* Validation should be done before this. */
if (pstSmilRegion->nTop.value >= 0 && nRootHeight != 0) {
int iTop = (pstSmilRegion->nTop.value * 100) / nRootHeight;
}
}
- //Fit Attribute
+ /* Fit Attribute */
if (MMSUI_IMAGE_REGION_FIT_MEET == pstSmilRegion->fit) {
xmlSetProp(pstRegion, (const xmlChar *)"fit", (const xmlChar *)"meet");
MSG_DEBUG("[Set Attribute] : fit : [meet]");
}
MsgSmilInsertNode(pstLayoutList, pstRootLayoutList, pstRegion);
-
} else
MSG_DEBUG("There is no attribute in <region> node");
/* Add attributes */
if (pstSmilMedia) {
-
if (strlen(pstSmilMedia->regionId) > 0) {
xmlSetProp(pstMedia, (const xmlChar *)"region", (const xmlChar *)pstSmilMedia->regionId);
MSG_DEBUG("[Set Attribute] Region Id : [%s]", pstSmilMedia->regionId);
}
#if 0
- char szFilePathWithCid[MSG_MSG_ID_LEN + 5]; // for "cid:"
+ char szFilePathWithCid[MSG_MSG_ID_LEN + 5]; /* for "cid:" */
snprintf (szFilePathWithCid, sizeof(szFilePathWithCid), "cid:%s", pszContentID);
MsgSmilSetAttribute(pstMedia, (char *)"src", szFilePathWithCid);
#endif
if (strlen(pstSmilMedia->szContentLocation) > 0) {
- MsgSmilSetAttribute(pstMedia, (char *)"src", pstSmilMedia->szContentLocation); //using content Location in Smil
+ MsgSmilSetAttribute(pstMedia, (char *)"src", pstSmilMedia->szContentLocation); /* using content Location in Smil */
MSG_DEBUG("[Set Attribute] Src : [%s]", pstSmilMedia->szContentLocation);
}
- if ( ( (pstSmilMedia->sMedia.sText.nColor & 0xFF000000) >> 24 ) > 0) {
+ if (((pstSmilMedia->sMedia.sText.nColor & 0xFF000000) >> 24) > 0) {
pstParam = xmlNewNode(NULL, (xmlChar *)"param");
if (NULL == pstParam) {
MsgSmilInsertFirstChild(pstMedia, pstParam);
}
- if ( ( (pstSmilMedia->sMedia.sText.nBgColor & 0xFF000000) >> 24 ) > 0) {
+ if (((pstSmilMedia->sMedia.sText.nBgColor & 0xFF000000) >> 24) > 0) {
pstParam = xmlNewNode(NULL, (xmlChar *)"param");
if (NULL == pstParam) {
}
if (pstMedia) {
-
if (strlen(pstSmilMedia->regionId) > 0) {
xmlSetProp(pstMedia, (const xmlChar *)"region", (const xmlChar *)pstSmilMedia->regionId);
MSG_DEBUG("[Set Attribute] Region Id : [%s]", pstSmilMedia->regionId);
}
-#if 0 //set src attribute cid
- char szFilePathWithCid[MSG_MSG_ID_LEN + 5]; // for "cid:"
+#if 0 /* set src attribute cid */
+ char szFilePathWithCid[MSG_MSG_ID_LEN + 5]; /* for "cid:" */
snprintf (szFilePathWithCid, sizeof(szFilePathWithCid), "cid:%s", pszContentID);
MsgSmilSetAttribute(pstMedia, (char *)"src", szFilePathWithCid);
#endif
if (strlen(pstSmilMedia->szContentLocation) > 0) {
- MsgSmilSetAttribute(pstMedia, (char *)"src", pstSmilMedia->szContentLocation); //using content Location in Smil
+ MsgSmilSetAttribute(pstMedia, (char *)"src", pstSmilMedia->szContentLocation); /* using content Location in Smil */
MSG_SEC_DEBUG("[Set Attribute] src : [%s]", pstSmilMedia->szContentLocation);
}
if (pstLeftSibling) {
/* Parent Node is Unused */
-
- while (pstLeftSibling->next !=NULL)
+ while (pstLeftSibling->next != NULL)
pstLeftSibling = pstLeftSibling->next;
if (NULL == xmlAddNextSibling(pstLeftSibling, pstCurr)) {
xmlNodePtr MsgSmilGetNodeByElementName(xmlNodePtr pstNode, char *pszName)
{
-
if ((NULL != pstNode) && (NULL != pszName)) {
xmlNodePtr pstTempNode;
xmlNodePtr pstReturnNode;
pstTempNode = pstNode;
for ( ; pstTempNode; pstTempNode = pstTempNode->next) {
-
if (0 == strcasecmp((char *)pstTempNode->name, pszName)) {
MSG_SEC_DEBUG("Find Node : name [%s][%p]", (char *)pstTempNode->name, pstTempNode);
return pstTempNode;
return pstReturnNode;
}
}
-
}
}
return NULL;
xmlNode *cur_node = NULL;
- if (depth == 0) {//init
+ if (depth == 0) { /* init */
memset(gCmd, 0x00, ELEMENT_MAX);
memset(&gRootlayout, 0x00, sizeof(MMS_SMIL_ROOTLAYOUT));
gRegion = NULL;
MSG_SEC_DEBUG("## [%d] node type : [Element], name: [%s] ##", depth, cur_node->name);
if (cur_node->type == XML_ELEMENT_NODE) {
- // Get Smil Element =====================================================
-
+ /* Get Smil Element */
switch (elementType = MsgSmilGetElementID((char *)cur_node->name)) {
case ELEMENT_ROOTLAYOUT:
gCmd[ELEMENT_ROOTLAYOUT] = true;
gCmd[ELEMENT_PAR] = true;
break;
- case ELEMENT_PARAM: // Need to check the original element type
+ case ELEMENT_PARAM: /* Need to check the original element type */
gCmd[ELEMENT_PARAM] = true;
break;
break;
}
- //Get Smil Attribute =====================================================
+ /* Get Smil Attribute */
xmlAttr *pAttr = cur_node->properties;
SMIL_ATTRIBUTE_T paramType = ATTRIBUTE_UNKNOWN;
for ( ; pAttr; pAttr = pAttr->next) {
-
MSG_SEC_DEBUG("## attribute type : name [%s] value [%s] ##", pAttr->name, pAttr->children->content);
switch (attrType = MsgSmilGetAttrID((char *)pAttr->name)) {
- case ATTRIBUTE_ID:
- {
+ case ATTRIBUTE_ID: {
if (gCmd[ELEMENT_REGION] && gRegion) {
strncpy(gRegion->szID, (char *)pAttr->children->content, MAX_SMIL_REGION_ID - 1);
} else if (gCmd[ELEMENT_TRANSITION] && gTransition) {
}
break;
- case ATTRIBUTE_TOP:
- {
+ case ATTRIBUTE_TOP: {
int bUnitPercent;
int value;
}
break;
- case ATTRIBUTE_LEFT:
- {
+ case ATTRIBUTE_LEFT: {
int bUnitPercent;
int value;
break;
- case ATTRIBUTE_WIDTH:
- {
+ case ATTRIBUTE_WIDTH: {
int bUnitPercent;
int value;
}
break;
- case ATTRIBUTE_HEIGHT:
- {
+ case ATTRIBUTE_HEIGHT: {
int bUnitPercent;
int value;
}
break;
- case ATTRIBUTE_SRC:
- {
+ case ATTRIBUTE_SRC: {
if (gMedia) {
- char szContentID[MSG_MSG_ID_LEN + 1] = {0,};
+ char szContentID[MSG_MSG_ID_LEN + 1] = {0, };
int cLen;
snprintf(szContentID, sizeof(szContentID), "%s", (char *)pAttr->children->content);
case ATTRIBUTE_NAME:
if (gCmd[ELEMENT_PARAM]) {
-
if (!strcmp((char *)pAttr->children->content, "foreground-color") || !strcmp((char *)pAttr->children->content, "foregroundcolor"))
paramType = ATTRIBUTE_FGCOLOR;
else if (!strcmp((char *)pAttr->children->content, "background-color") || !strcmp((char *)pAttr->children->content, "backgroundcolor"))
}
}
- if (cur_node->children) {//child first
+ if (cur_node->children) { /* child first */
MsgSmilParseNode(pMmsMsg, cur_node->children, depth + 1);
}
hSmilDoc = MsgSmilCreateEmptySmilDoc();
if (INVALID_HOBJ == hSmilDoc) {
- MSG_DEBUG("Invalid SmilDoc[%d]",hSmilDoc);
+ MSG_DEBUG("Invalid SmilDoc[%d]", hSmilDoc);
return false;
}
- // Add Root Layout to Smil Document
+ /* Add Root Layout to Smil Document */
if (false == MsgSmilAddRootLayout(hSmilDoc, &(pstMsgMmsBody->rootlayout))) {
MSG_DEBUG("MsgSmilAddRootLayout Failed");
MsgSmilDestroyDoc(hSmilDoc);
}
- //Add Region list to Smil Document
+ /* Add Region list to Smil Document */
nRegionCount = pstMsgMmsBody->regionCnt;
- MSG_DEBUG(" Region Count = [%d]",nRegionCount);
+ MSG_DEBUG("Region Count = [%d]", nRegionCount);
for (nIndex = 0; nIndex < nRegionCount; nIndex++) {
-
pstRegion = _MsgMmsGetSmilRegion(pstMsgMmsBody, nIndex);
if (NULL == pstRegion) {
MSG_DEBUG("pstRegion is NULL");
}
}
- // Add page list to Smil Document
+ /* Add page list to Smil Document */
nTotalPageNum = pstMsgMmsBody->pageCnt ;
- MSG_DEBUG(" Page Count = [%d]",nTotalPageNum);
+ MSG_DEBUG("Page Count = [%d]", nTotalPageNum);
for (nIndex = 0; nIndex < nTotalPageNum; nIndex++) {
-
pstPage = _MsgMmsGetPage(pstMsgMmsBody, nIndex);
if (NULL == pstPage) {
MSG_DEBUG("pstPage is NULL");
return false;
}
- // Add page to smil doc
+ /* Add page to smil doc */
if (false == MsgSmilAddPage(hSmilDoc, pstPage)) {
MSG_DEBUG("Adding page to smil doc failed");
MsgSmilDestroyDoc(hSmilDoc);
}
nTotalMediaNum = pstPage->mediaCnt;
- MSG_DEBUG(" Media Count = [%d]",nTotalMediaNum);
+ MSG_DEBUG("Media Count = [%d]", nTotalMediaNum);
for (nMediaIndex = 0; nMediaIndex < nTotalMediaNum; nMediaIndex++) {
-
pstMedia = _MsgMmsGetMedia(pstPage, nMediaIndex);
if (NULL == pstMedia) {
MSG_DEBUG("pMedia is NULL");
/*==================================================================================================
VARIABLES
==================================================================================================*/
-//__thread sqlite3 *handle = NULL;
-//__thread sqlite3_stmt *stmt = NULL;
+#if 0
+__thread sqlite3 *handle = NULL;
+__thread sqlite3_stmt *stmt = NULL;
+#endif
/*==================================================================================================
IMPLEMENTATION OF MsgDbHandler - Member Functions
/* Use only in app side */
msg_error_t MsgDbHandler::connectReadOnly()
{
-
int ret = 0;
if (handle == NULL) {
ret = sqlite3_get_table(handle, pQuery, &result, pRowCnt, pColumnCnt, NULL);
if (ret == SQLITE_OK) {
- if (*pRowCnt == 0) {// when the no record return 'MSG_ERR_DB_NORECORD'
+ if (*pRowCnt == 0) { /* when the no record return 'MSG_ERR_DB_NORECORD' */
MSG_DEBUG("No Query Result");
return MSG_ERR_DB_NORECORD;
}
MSG_BEGIN();
if(!shm_file_name) {
- MSG_FATAL ("NULL INPUT_PARAM");
+ MSG_FATAL("NULL INPUT_PARAM");
return;
}
mmapMx = tmp;
}
-void MsgDbHandler::shm_mutex_timedlock (int sec)
+void MsgDbHandler::shm_mutex_timedlock(int sec)
{
MSG_BEGIN();
if (!mmapMx) {
tmpStr[j++] = '%';
- for(i=0;i<inputSize;i++) {
+ for(i = 0; i < inputSize; i++) {
if (input[i] == '\'' || input[i] == '_' || input[i] == '%' || input[i] == '\\') {
tmpStr[j++] = MSGFW_DB_ESCAPE_CHAR;
}
MSG_DEBUG("New DB handle added.");
MutexLocker locker(mu);
tmp = new MsgDbHandler();
- gDbHandles.insert ( std::pair<pthread_t,MsgDbHandler*>(self,tmp));
+ gDbHandles.insert(std::pair<pthread_t, MsgDbHandler*>(self, tmp));
} else {
tmp = it->second;
MutexLocker locker(mu);
tmp = it->second;
delete tmp;
- gDbHandles.erase (it);
+ gDbHandles.erase(it);
}
}
static int __msg_db_util_busyhandler(void *pData, int count)
{
if(20 - count > 0) {
- struct timespec time = {0,};
+ struct timespec time = {0, };
time.tv_sec = 0;
time.tv_nsec = (count + 1) * 50 * 1000 * 1000;
/* Open DB */
int rc = sqlite3_open_v2(pszFilePath, ppDB, flags, zVfs);
if (SQLITE_OK != rc) {
- MSG_ERR("sqlite3_open_v2 error(%d)",rc);
+ MSG_ERR("sqlite3_open_v2 error(%d)", rc);
return rc;
}
extCharList[0x00C2] = MSG_CHAR_PORTUGUESE;
extCharList[0x00E2] = MSG_CHAR_PORTUGUESE;
- for (unsigned char i = 0; i < 128; i++)
- {
+ for (unsigned char i = 0; i < 128; i++) {
ucs2toGSM7DefList[g_GSM7BitToUCS2[i]] = i;
}
- // GSM 7 bit Extension
- ucs2toGSM7ExtList[0x005B] = 0x3C; // [
- ucs2toGSM7ExtList[0x005D] = 0x3E; // ]
- ucs2toGSM7ExtList[0x007B] = 0x28; // {
- ucs2toGSM7ExtList[0x007D] = 0x29; // }
- ucs2toGSM7ExtList[0x000C] = 0x0A; // Page Break
+ /* GSM 7 bit Extension */
+ ucs2toGSM7ExtList[0x005B] = 0x3C; /* [ */
+ ucs2toGSM7ExtList[0x005D] = 0x3E; /* ] */
+ ucs2toGSM7ExtList[0x007B] = 0x28; /* { */
+ ucs2toGSM7ExtList[0x007D] = 0x29; /* } */
+ ucs2toGSM7ExtList[0x000C] = 0x0A; /* Page Break */
ucs2toGSM7ExtList[0x005C] = 0x2F; /* \ */
- ucs2toGSM7ExtList[0x005E] = 0x14; // ^
- ucs2toGSM7ExtList[0x007C] = 0x40; // |
- ucs2toGSM7ExtList[0x007E] = 0x3D; // ~
- ucs2toGSM7ExtList[0x20AC] = 0x65; // €
-
- // Turkish
- ucs2toTurkishList[0x005B] = 0x3C; // [
- ucs2toTurkishList[0x005D] = 0x3E; // ]
- ucs2toTurkishList[0x007B] = 0x28; // {
- ucs2toTurkishList[0x007D] = 0x29; // }
- ucs2toTurkishList[0x000C] = 0x0A; // Page Break
+ ucs2toGSM7ExtList[0x005E] = 0x14; /* ^ */
+ ucs2toGSM7ExtList[0x007C] = 0x40; /* | */
+ ucs2toGSM7ExtList[0x007E] = 0x3D; /* ~ */
+ ucs2toGSM7ExtList[0x20AC] = 0x65; /* € */
+
+ /* Turkish */
+ ucs2toTurkishList[0x005B] = 0x3C; /* [ */
+ ucs2toTurkishList[0x005D] = 0x3E; /* ] */
+ ucs2toTurkishList[0x007B] = 0x28; /* { */
+ ucs2toTurkishList[0x007D] = 0x29; /* } */
+ ucs2toTurkishList[0x000C] = 0x0A; /* Page Break */
ucs2toTurkishList[0x005C] = 0x2F; /* \ */
- ucs2toTurkishList[0x005E] = 0x14; // ^
- ucs2toTurkishList[0x007C] = 0x40; // |
- ucs2toTurkishList[0x007E] = 0x3D; // ~
- ucs2toTurkishList[0x20AC] = 0x65; // €
- ucs2toTurkishList[0x00E7] = 0x63; // c LATIN SMALL LETTER S WITH CEDILLA
- ucs2toTurkishList[0x011E] = 0x47; // G LATIN CAPITAL LETTER G WITH BREVE
- ucs2toTurkishList[0x011F] = 0x67; // g LATIN SMALL LETTER G WITH BREVE
- ucs2toTurkishList[0x01E6] = 0x47; // G LATIN CAPITAL LETTER G WITH CARON
- ucs2toTurkishList[0x01E7] = 0x67; // g LATIN SMALL LETTER G WITH CARON
- ucs2toTurkishList[0x0130] = 0x49; // I LATIN CAPITAL LETTER I WITH DOT ABOVE
- ucs2toTurkishList[0x0131] = 0x69; // i LATIN SMALL LETTER DOTLESS
- ucs2toTurkishList[0x015E] = 0x53; // S LATIN CAPITAL LETTER S WITH CEDILLA
- ucs2toTurkishList[0x015F] = 0x73; // s LATIN SMALL LETTER S WITH CEDILLA
-
- // Spanish
- ucs2toSpanishList[0x005B] = 0x3C; // [
- ucs2toSpanishList[0x005D] = 0x3E; // ]
- ucs2toSpanishList[0x007B] = 0x28; // {
- ucs2toSpanishList[0x007D] = 0x29; // }
- ucs2toSpanishList[0x000C] = 0x0A; // Page Break
+ ucs2toTurkishList[0x005E] = 0x14; /* ^ */
+ ucs2toTurkishList[0x007C] = 0x40; /* | */
+ ucs2toTurkishList[0x007E] = 0x3D; /* ~ */
+ ucs2toTurkishList[0x20AC] = 0x65; /* € */
+ ucs2toTurkishList[0x00E7] = 0x63; /* c LATIN SMALL LETTER S WITH CEDILLA */
+ ucs2toTurkishList[0x011E] = 0x47; /* G LATIN CAPITAL LETTER G WITH BREVE */
+ ucs2toTurkishList[0x011F] = 0x67; /* g LATIN SMALL LETTER G WITH BREVE */
+ ucs2toTurkishList[0x01E6] = 0x47; /* G LATIN CAPITAL LETTER G WITH CARON */
+ ucs2toTurkishList[0x01E7] = 0x67; /* g LATIN SMALL LETTER G WITH CARON */
+ ucs2toTurkishList[0x0130] = 0x49; /* I LATIN CAPITAL LETTER I WITH DOT ABOVE */
+ ucs2toTurkishList[0x0131] = 0x69; /* i LATIN SMALL LETTER DOTLESS */
+ ucs2toTurkishList[0x015E] = 0x53; /* S LATIN CAPITAL LETTER S WITH CEDILLA */
+ ucs2toTurkishList[0x015F] = 0x73; /* s LATIN SMALL LETTER S WITH CEDILLA */
+
+ /* Spanish */
+ ucs2toSpanishList[0x005B] = 0x3C; /* [ */
+ ucs2toSpanishList[0x005D] = 0x3E; /* ] */
+ ucs2toSpanishList[0x007B] = 0x28; /* { */
+ ucs2toSpanishList[0x007D] = 0x29; /* } */
+ ucs2toSpanishList[0x000C] = 0x0A; /* Page Break */
ucs2toSpanishList[0x005C] = 0x2F; /* \ */
- ucs2toSpanishList[0x005E] = 0x14; // ^
- ucs2toSpanishList[0x007C] = 0x40; // |
- ucs2toSpanishList[0x007E] = 0x3D; // ~
- ucs2toSpanishList[0x20AC] = 0x65; // €
- ucs2toSpanishList[0x00C1] = 0x41; // A LATIN CAPITAL LETTER A WITH ACUTE
- ucs2toSpanishList[0x00E1] = 0x61; // a LATIN SMALL LETTER A WITH ACUTE
- ucs2toSpanishList[0x00CD] = 0x49; // I LATIN CAPITAL LETTER I WITH ACUTE
- ucs2toSpanishList[0x00ED] = 0x69; // i LATIN SMALL LETTER I WITH ACUTE
- ucs2toSpanishList[0x00D3] = 0x4F; // O LATIN CAPITAL LETTER O WITH ACUTE
- ucs2toSpanishList[0x00F3] = 0x6F; // o LATIN SMALL LETTER O WITH ACUTE
- ucs2toSpanishList[0x00DA] = 0x55; // U LATIN CAPITAL LETTER U WITH ACUTE
- ucs2toSpanishList[0x00FA] = 0x75; // u LATIN SMALL LETTER U WITH ACUTE
-
- // Portuguese
- ucs2toPortuList[0x005B] = 0x3C; // [
- ucs2toPortuList[0x005D] = 0x3E; // ]
- ucs2toPortuList[0x007B] = 0x28; // {
- ucs2toPortuList[0x007D] = 0x29; // }
- ucs2toPortuList[0x000C] = 0x0A; // Page Break
+ ucs2toSpanishList[0x005E] = 0x14; /* ^ */
+ ucs2toSpanishList[0x007C] = 0x40; /* | */
+ ucs2toSpanishList[0x007E] = 0x3D; /* ~ */
+ ucs2toSpanishList[0x20AC] = 0x65; /* € */
+ ucs2toSpanishList[0x00C1] = 0x41; /* A LATIN CAPITAL LETTER A WITH ACUTE */
+ ucs2toSpanishList[0x00E1] = 0x61; /* a LATIN SMALL LETTER A WITH ACUTE */
+ ucs2toSpanishList[0x00CD] = 0x49; /* I LATIN CAPITAL LETTER I WITH ACUTE */
+ ucs2toSpanishList[0x00ED] = 0x69; /* i LATIN SMALL LETTER I WITH ACUTE */
+ ucs2toSpanishList[0x00D3] = 0x4F; /* O LATIN CAPITAL LETTER O WITH ACUTE */
+ ucs2toSpanishList[0x00F3] = 0x6F; /* o LATIN SMALL LETTER O WITH ACUTE */
+ ucs2toSpanishList[0x00DA] = 0x55; /* U LATIN CAPITAL LETTER U WITH ACUTE */
+ ucs2toSpanishList[0x00FA] = 0x75; /* u LATIN SMALL LETTER U WITH ACUTE */
+
+ /* Portuguese */
+ ucs2toPortuList[0x005B] = 0x3C; /* [ */
+ ucs2toPortuList[0x005D] = 0x3E; /* ] */
+ ucs2toPortuList[0x007B] = 0x28; /* { */
+ ucs2toPortuList[0x007D] = 0x29; /* } */
+ ucs2toPortuList[0x000C] = 0x0A; /* Page Break */
ucs2toPortuList[0x005C] = 0x2F; /* \ */
- ucs2toPortuList[0x005E] = 0x14; // ^
- ucs2toPortuList[0x007C] = 0x40; // |
- ucs2toPortuList[0x007E] = 0x3D; // ~
- ucs2toPortuList[0x20AC] = 0x65; // €
- ucs2toPortuList[0x00D4] = 0x0B; // O LATIN CAPITAL LETTER O WITH CIRCUMFLEX
- ucs2toPortuList[0x00F4] = 0x0C; // o LATIN SMALL LETTER O WITH CIRCUMFLEX
- ucs2toPortuList[0x00C1] = 0x0E; // A LATIN CAPITAL LETTER A WITH ACUTE
- ucs2toPortuList[0x00E1] = 0x0F; // a LATIN SMALL LETTER A WITH ACUTE
- ucs2toPortuList[0x00CA] = 0x1F; // E LATIN CAPITAL LETTER E WITH CIRCUMFLEX
- ucs2toPortuList[0x00EA] = 0x05; // e LATIN SMALL LETTER E WITH CIRCUMFLEX
- ucs2toPortuList[0x00C0] = 0x41; // A LATIN CAPITAL LETTER A WITH GRAVE
- ucs2toPortuList[0x00E7] = 0x09; // c LATIN SMALL LETTER C WITH CEDILLA
- ucs2toPortuList[0x00CD] = 0x49; // I LATIN CAPITAL LETTER I WITH ACUTE
- ucs2toPortuList[0x00ED] = 0x69; // i LATIN SMALL LETTER I WITH ACUTE
- ucs2toPortuList[0x00D3] = 0x4F; // O LATIN CAPITAL LETTER O WITH ACUTE
- ucs2toPortuList[0x00F3] = 0x6F; // o LATIN SMALL LETTER O WITH ACUTE
- ucs2toPortuList[0x00DA] = 0x55; // U LATIN CAPITAL LETTER U WITH ACUTE
- ucs2toPortuList[0x00FA] = 0x75; // u LATIN SMALL LETTER U WITH ACUTE
- ucs2toPortuList[0x00C3] = 0x61; // A LATIN CAPITAL LETTER A WITH TILDE
- ucs2toPortuList[0x00E3] = 0x7B; // a LATIN SMALL LETTER A WITH TILDE
- ucs2toPortuList[0x00D5] = 0x5C; // O LATIN CAPITAL LETTER O WITH TILDE
- ucs2toPortuList[0x00F5] = 0x7C; // o LATIN SMALL LETTER O WITH TILDE
- ucs2toPortuList[0x00C2] = 0x61; // A LATIN CAPITAL LETTER A WITH CIRCUMFLEX
- ucs2toPortuList[0x00E2] = 0x7F; // a LATIN SMALL LETTER A WITH CIRCUMFLEX
- ucs2toPortuList[0x03A6] = 0x12; // Φ GREEK CAPITAL LETTER PHI
- ucs2toPortuList[0x0393] = 0x13; // Γ GREEK CAPITAL LETTER GAMMA
- ucs2toPortuList[0x03A9] = 0x15; // Ω GREEK CAPITAL LETTER OMEGA
- ucs2toPortuList[0x03A0] = 0x16; // Î GREEK CAPITAL LETTER PI
- ucs2toPortuList[0x03A8] = 0x17; // Ψ GREEK CAPITAL LETTER PSI
- ucs2toPortuList[0x03A3] = 0x18; // Σ GREEK CAPITAL LETTER SIGMA
- ucs2toPortuList[0x0398] = 0x19; // Θ GREEK CAPITAL LETTER THETA
-
-
- // character replacement table
- replaceCharList[0x00E0] = 0x61; // a LATIN SMALL LETTER A WITH GRAVE
- replaceCharList[0x00E1] = 0x61; // a LATIN SMALL LETTER A WITH ACUTE
- replaceCharList[0x00E2] = 0x61; // a LATIN SMALL LETTER A WITH CIRCUMFLEX
- replaceCharList[0x00E3] = 0x61; // a LATIN SMALL LETTER A WITH TILDE
- replaceCharList[0x00E4] = 0x61; // a LATIN SMALL LETTER A WITH DIAERESIS
- replaceCharList[0x00E5] = 0x61; // a LATIN SMALL LETTER A WITH RING ABOVE
- replaceCharList[0x00E6] = 0x61; // a LATIN SMALL LETTER AE
- replaceCharList[0x0101] = 0x61; // a LATIN SMALL LETTER A WITH MACRON
- replaceCharList[0x0103] = 0x61; // a LATIN SMALL LETTER A WITH BREVE
- replaceCharList[0x0105] = 0x61; // a LATIN SMALL LETTER A WITH OGONEK
- replaceCharList[0x01CE] = 0x61; // a LATIN SMALL LETTER A WITH CARON
-
- replaceCharList[0x00C0] = 0x41; // A LATIN CAPITAL LETTER A WITH GRAVE
- replaceCharList[0x00C1] = 0x41; // A LATIN CAPITAL LETTER A WITH ACUTE
- replaceCharList[0x00C2] = 0x41; // A LATIN CAPITAL LETTER A WITH CIRCUMFLEX
- replaceCharList[0x00C3] = 0x41; // A LATIN CAPITAL LETTER A WITH TILDE
- replaceCharList[0x00C4] = 0x41; // A LATIN CAPITAL LETTER A WITH DIAERESIS
- replaceCharList[0x00C5] = 0x41; // A LATIN CAPITAL LETTER A WITH RING ABOVE
- replaceCharList[0x00C6] = 0x41; // A LATIN CAPITAL LETTER AE
- replaceCharList[0x0100] = 0x41; // A LATIN CAPITAL LETTER A WITH MACRON
- replaceCharList[0x0102] = 0x41; // A LATIN CAPITAL LETTER A WITH BREVE
- replaceCharList[0x0104] = 0x41; // A LATIN CAPITAL LETTER A WITH OGONEK
- replaceCharList[0x01CD] = 0x41; // A LATIN CAPITAL LETTER A WITH CARON
-
- replaceCharList[0x00E7] = 0x63; // c LATIN SMALL LETTER C WITH CEDILLA
- replaceCharList[0x0107] = 0x63; // c LATIN SMALL LETTER C WITH ACUTE
- replaceCharList[0x0109] = 0x63; // c LATIN SMALL LETTER C WITH CIRCUMFLEX
- replaceCharList[0x010B] = 0x63; // c LATIN SMALL LETTER C WITH DOT ABOVE
- replaceCharList[0x010D] = 0x63; // c LATIN SMALL LETTER C WITH CARON
-
- replaceCharList[0x00C7] = 0x43; // C LATIN CAPITAL LETTER C WITH CEDILLA
- replaceCharList[0x0106] = 0x43; // C LATIN CAPITAL LETTER C WITH ACUTE
- replaceCharList[0x0108] = 0x43; // C LATIN CAPITAL LETTER C WITH CIRCUMFLEX
- replaceCharList[0x010A] = 0x43; // C LATIN CAPITAL LETTER C WITH DOT ABOVE
- replaceCharList[0x010C] = 0x43; // C LATIN CAPITAL LETTER C WITH CARON
-
- replaceCharList[0x010F] = 0x64; // d LATIN SMALL LETTER D WITH CARON
- replaceCharList[0x0111] = 0x64; // d LATIN SMALL LETTER D WITH STROKE
-
- replaceCharList[0x010E] = 0x44; // D LATIN CAPITAL LETTER D WITH CARON
- replaceCharList[0x0110] = 0x44; // D LATIN CAPITAL LETTER D WITH STROKE
-
- replaceCharList[0x00E8] = 0x65; // e LATIN SMALL LETTER E WITH GRAVE
- replaceCharList[0x00E9] = 0x65; // e LATIN SMALL LETTER E WITH ACUTE
- replaceCharList[0x00EA] = 0x65; // e LATIN SMALL LETTER E WITH CIRCUMFLEX
- replaceCharList[0x00EB] = 0x65; // e LATIN SMALL LETTER E WITH DIAERESIS
- replaceCharList[0x0113] = 0x65; // e LATIN SMALL LETTER E WITH MACRON
- replaceCharList[0x0115] = 0x65; // e LATIN SMALL LETTER E WITH BREVE
- replaceCharList[0x0117] = 0x65; // e LATIN SMALL LETTER E WITH DOT ABOVE
- replaceCharList[0x0119] = 0x65; // e LATIN SMALL LETTER E WITH OGONEK
- replaceCharList[0x011B] = 0x65; // e LATIN SMALL LETTER E WITH CARON
- replaceCharList[0x0259] = 0x65; // e LATIN SMALL LETTER SCHWA
-
- replaceCharList[0x00C8] = 0x45; // E LATIN CAPITAL LETTER E WITH GRAVE
- replaceCharList[0x00C9] = 0x45; // E LATIN CAPITAL LETTER E WITH ACUTE
- replaceCharList[0x00CA] = 0x45; // E LATIN CAPITAL LETTER E WITH CIRCUMFLEX
- replaceCharList[0x00CB] = 0x45; // E LATIN CAPITAL LETTER E WITH DIAERESIS
- replaceCharList[0x0112] = 0x45; // E LATIN CAPITAL LETTER E WITH MACRON
- replaceCharList[0x0114] = 0x45; // E LATIN CAPITAL LETTER E WITH BREVE
- replaceCharList[0x0116] = 0x45; // E LATIN CAPITAL LETTER E WITH DOT ABOVE
- replaceCharList[0x0118] = 0x45; // E LATIN CAPITAL LETTER E WITH OGONEK
- replaceCharList[0x011A] = 0x45; // E LATIN CAPITAL LETTER E WITH CARON
- replaceCharList[0x018F] = 0x45; // E LATIN CAPITAL LETTER SCHWA
-
- replaceCharList[0x011D] = 0x67; // g LATIN SMALL LETTER G WITH CIRCUMFLEX
- replaceCharList[0x011F] = 0x67; // g LATIN SMALL LETTER G WITH BREVE
- replaceCharList[0x0121] = 0x67; // g LATIN SMALL LETTER G WITH DOT ABOVE
- replaceCharList[0x0123] = 0x67; // g LATIN SMALL LETTER G WITH CEDILLA
- replaceCharList[0x01E7] = 0x67; // g LATIN SMALL LETTER G WITH CARON
- replaceCharList[0x01F5] = 0x67; // g LATIN SMALL LETTER G WITH ACUTE
- replaceCharList[0x1E21] = 0x67; // g LATIN SMALL LETTER G WITH MACRON
-
- replaceCharList[0x011C] = 0x47; // G LATIN CAPITAL LETTER G WITH CIRCUMFLEX
- replaceCharList[0x011E] = 0x47; // G LATIN CAPITAL LETTER G WITH BREVE
- replaceCharList[0x0120] = 0x47; // G LATIN CAPITAL LETTER G WITH DOT ABOVE
- replaceCharList[0x0122] = 0x47; // G LATIN CAPITAL LETTER G WITH CEDILLA
- replaceCharList[0x01E6] = 0x47; // G LATIN CAPITAL LETTER G WITH CARON
- replaceCharList[0x01F4] = 0x47; // G LATIN CAPITAL LETTER G WITH ACUTE
- replaceCharList[0x1E20] = 0x47; // G LATIN CAPITAL LETTER G WITH MACRON
-
- replaceCharList[0x00EC] = 0x69; // i LATIN SMALL LETTER I WITH GRAVE
- replaceCharList[0x00ED] = 0x69; // i LATIN SMALL LETTER I WITH ACUTE
- replaceCharList[0x00EE] = 0x69; // i LATIN SMALL LETTER I WITH CIRCUMFLEX
- replaceCharList[0x00EF] = 0x69; // i LATIN SMALL LETTER I WITH DIAERESIS
- replaceCharList[0x0129] = 0x69; // i LATIN SMALL LETTER I WITH TILDE
- replaceCharList[0x012B] = 0x69; // i LATIN SMALL LETTER I WITH MACRON
- replaceCharList[0x012D] = 0x69; // i LATIN SMALL LETTER I WITH BREVE
- replaceCharList[0x012F] = 0x69; // i LATIN SMALL LETTER I WITH OGONEK
- replaceCharList[0x01D0] = 0x69; // i LATIN SMALL LETTER I WITH CARON
- replaceCharList[0x0131] = 0x69; // i LATIN SMALL LETTER DOTLESS I
-
- replaceCharList[0x00CC] = 0x49; // I LATIN CAPITAL LETTER I WITH GRAVE
- replaceCharList[0x00CD] = 0x49; // I LATIN CAPITAL LETTER I WITH ACUTE
- replaceCharList[0x00CE] = 0x49; // I LATIN CAPITAL LETTER I WITH CIRCUMFLEX
- replaceCharList[0x00CF] = 0x49; // I LATIN CAPITAL LETTER I WITH DIAERESIS
- replaceCharList[0x0128] = 0x49; // I LATIN CAPITAL LETTER I WITH TILDE
- replaceCharList[0x012A] = 0x49; // I LATIN CAPITAL LETTER I WITH MACRON
- replaceCharList[0x012C] = 0x49; // I LATIN CAPITAL LETTER I WITH BREVE
- replaceCharList[0x012E] = 0x49; // I LATIN CAPITAL LETTER I WITH OGONEK
- replaceCharList[0x0130] = 0x49; // I LATIN CAPITAL LETTER I WITH DOT ABOVE
-
- replaceCharList[0x0137] = 0x6B; // k LATIN SMALL LETTER K WITH CEDILLA
-
- replaceCharList[0x0136] = 0x4B; // K LATIN CAPITAL LETTER K WITH CEDILLA
-
- replaceCharList[0x013A] = 0x6C; // l LATIN SMALL LETTER L WITH ACUTE
- replaceCharList[0x013C] = 0x6C; // l LATIN SMALL LETTER L WITH CEDILLA
- replaceCharList[0x013E] = 0x6C; // l LATIN SMALL LETTER L WITH CARON
- replaceCharList[0x0140] = 0x6C; // l LATIN SMALL LETTER L WITH MIDDLE DOT
- replaceCharList[0x0142] = 0x6C; // l LATIN SMALL LETTER L WITH STROKE
-
- replaceCharList[0x0139] = 0x4C; // L LATIN CAPITAL LETTER L WITH ACUTE
- replaceCharList[0x013B] = 0x4C; // L LATIN CAPITAL LETTER L WITH CEDILLA
- replaceCharList[0x013D] = 0x4C; // L LATIN CAPITAL LETTER L WITH CARON
- replaceCharList[0x013F] = 0x4C; // L LATIN CAPITAL LETTER L WITH MIDDLE DOT
- replaceCharList[0x0141] = 0x4C; // L LATIN CAPITAL LETTER L WITH STROKE
-
- replaceCharList[0x00F1] = 0x6E; // n LATIN SMALL LETTER N WITH TILDE
- replaceCharList[0x0144] = 0x6E; // n LATIN SMALL LETTER N WITH ACUTE
- replaceCharList[0x0146] = 0x6E; // n LATIN SMALL LETTER N WITH CEDILLA
- replaceCharList[0x0148] = 0x6E; // n LATIN SMALL LETTER N WITH CARON
-
- replaceCharList[0x00D1] = 0x4E; // N LATIN CAPITAL LETTER N WITH TILDE
- replaceCharList[0x0143] = 0x4E; // N LATIN CAPITAL LETTER N WITH ACUTE
- replaceCharList[0x0145] = 0x4E; // N LATIN CAPITAL LETTER N WITH CEDILLA
- replaceCharList[0x0147] = 0x4E; // N LATIN CAPITAL LETTER N WITH CARON
-
- replaceCharList[0x00F2] = 0x6F; // o LATIN SMALL LETTER O WITH GRAVE
- replaceCharList[0x00F3] = 0x6F; // o LATIN SMALL LETTER O WITH ACUTE
- replaceCharList[0x00F4] = 0x6F; // o LATIN SMALL LETTER O WITH CIRCUMFLEX
- replaceCharList[0x00F5] = 0x6F; // o LATIN SMALL LETTER O WITH TILDE
- replaceCharList[0x00F6] = 0x6F; // o LATIN SMALL LETTER O WITH DIAERESIS
- replaceCharList[0x00F8] = 0x6F; // o LATIN SMALL LETTER O WITH STROKE
- replaceCharList[0x014D] = 0x6F; // o LATIN SMALL LETTER O WITH MACRON
- replaceCharList[0x014F] = 0x6F; // o LATIN SMALL LETTER O WITH BREVE
- replaceCharList[0x01D2] = 0x6F; // o LATIN SMALL LETTER O WITH CARON
- replaceCharList[0x01EB] = 0x6F; // o LATIN SMALL LETTER O WITH OGONEK
- replaceCharList[0x0151] = 0x6F; // o LATIN SMALL LETTER O WITH DOUBLE ACUTE
- replaceCharList[0x0153] = 0x6F; // LATIN SMALL LIGATURE OE
-
- replaceCharList[0x00D2] = 0x4F; // O LATIN CAPITAL LETTER O WITH GRAVE
- replaceCharList[0x00D3] = 0x4F; // O LATIN CAPITAL LETTER O WITH ACUTE
- replaceCharList[0x00D4] = 0x4F; // O LATIN CAPITAL LETTER O WITH CIRCUMFLEX
- replaceCharList[0x00D5] = 0x4F; // O LATIN CAPITAL LETTER O WITH TILDE
- replaceCharList[0x00D6] = 0x4F; // O LATIN CAPITAL LETTER O WITH DIAERESIS
- replaceCharList[0x00D8] = 0x4F; // O LATIN CAPITAL LETTER O WITH STROKE
- replaceCharList[0x014C] = 0x4F; // O LATIN CAPITAL LETTER O WITH MACRON
- replaceCharList[0x014E] = 0x4F; // O LATIN CAPITAL LETTER O WITH BREVE
- replaceCharList[0x01D1] = 0x4F; // O LATIN CAPITAL LETTER O WITH CARON
- replaceCharList[0x01EA] = 0x4F; // O LATIN CAPITAL LETTER O WITH OGONEK
- replaceCharList[0x0150] = 0x4F; // O LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
- replaceCharList[0x0152] = 0x4F; // LATIN CAPITAL LIGATURE OE
-
- replaceCharList[0x0155] = 0x72; // r LATIN SMALL LETTER R WITH ACUTE
- replaceCharList[0x0157] = 0x72; // r LATIN SMALL LETTER R WITH CEDILLA
- replaceCharList[0x0159] = 0x72; // r LATIN SMALL LETTER R WITH CARON
-
- replaceCharList[0x0154] = 0x52; // R LATIN CAPITAL LETTER R WITH ACUTE
- replaceCharList[0x0156] = 0x52; // R LATIN CAPITAL LETTER R WITH CEDILLA
- replaceCharList[0x0158] = 0x52; // R LATIN CAPITAL LETTER R WITH CARON
-
- replaceCharList[0x015B] = 0x73; // s LATIN SMALL LETTER S WITH ACUTE
- replaceCharList[0x015D] = 0x73; // s LATIN SMALL LETTER S WITH CIRCUMFLEX
- replaceCharList[0x015F] = 0x73; // s LATIN SMALL LETTER S WITH CEDILLA
- replaceCharList[0x0161] = 0x73; // s LATIN SMALL LETTER S WITH CARON
-
- replaceCharList[0x015A] = 0x53; // S LATIN CAPITAL LETTER S WITH ACUTE
- replaceCharList[0x015C] = 0x53; // S LATIN CAPITAL LETTER S WITH CIRCUMFLEX
- replaceCharList[0x015E] = 0x53; // S LATIN CAPITAL LETTER S WITH CEDILLA
- replaceCharList[0x0160] = 0x53; // S LATIN CAPITAL LETTER S WITH CARON
-
- replaceCharList[0x00FE] = 0x74; // t LATIN CAPITAL LETTER THORN
- replaceCharList[0x0163] = 0x74; // t LATIN SMALL LETTER T WITH CEDILLA
- replaceCharList[0x0165] = 0x74; // t LATIN SMALL LETTER T WITH CARON
- replaceCharList[0x0167] = 0x74; // t LATIN SMALL LETTER T WITH STROKE
- replaceCharList[0x021B] = 0x74; // t LATIN SMALL LETTER T WITH COMMA BELOW
-
- replaceCharList[0x00DE] = 0x54; // T LATIN CAPITAL LETTER THORN
- replaceCharList[0x0162] = 0x54; // T LATIN CAPITAL LETTER T WITH CEDILLA
- replaceCharList[0x0164] = 0x54; // T LATIN CAPITAL LETTER T WITH CARON
- replaceCharList[0x0166] = 0x54; // T LATIN CAPITAL LETTER T WITH STROKE
-
- replaceCharList[0x00F9] = 0x75; // u LATIN SMALL LETTER U WITH GRAVE
- replaceCharList[0x00FA] = 0x75; // u LATIN SMALL LETTER U WITH ACUTE
- replaceCharList[0x00FB] = 0x75; // u LATIN SMALL LETTER U WITH CIRCUMFLEX
- replaceCharList[0x00FC] = 0x75; // u LATIN SMALL LETTER U WITH DIAERESIS
- replaceCharList[0x0169] = 0x75; // u LATIN SMALL LETTER U WITH TILDE
- replaceCharList[0x016B] = 0x75; // u LATIN SMALL LETTER U WITH MACRON
- replaceCharList[0x016D] = 0x75; // u LATIN SMALL LETTER U WITH BREVE
- replaceCharList[0x016F] = 0x75; // u LATIN SMALL LETTER U WITH RING ABOVE
- replaceCharList[0x0171] = 0x75; // u LATIN SMALL LETTER U WITH DOUBLE ACUTE
- replaceCharList[0x0173] = 0x75; // u LATIN SMALL LETTER U WITH OGONEK
- replaceCharList[0x01D4] = 0x75; // u LATIN SMALL LETTER U WITH CARON
-
- replaceCharList[0x00D9] = 0x55; // U LATIN CAPITAL LETTER U WITH GRAVE
- replaceCharList[0x00DA] = 0x55; // U LATIN CAPITAL LETTER U WITH ACUTE
- replaceCharList[0x00DB] = 0x55; // U LATIN CAPITAL LETTER U WITH CIRCUMFLEX
- replaceCharList[0x00DC] = 0x55; // U LATIN CAPITAL LETTER U WITH DIAERESIS
- replaceCharList[0x0168] = 0x55; // U LATIN CAPITAL LETTER U WITH TILDE
- replaceCharList[0x016A] = 0x55; // U LATIN CAPITAL LETTER U WITH MACRON
- replaceCharList[0x016C] = 0x55; // U LATIN CAPITAL LETTER U WITH BREVE
- replaceCharList[0x016E] = 0x55; // U LATIN CAPITAL LETTER U WITH RING ABOVE
- replaceCharList[0x0170] = 0x55; // U LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
- replaceCharList[0x0172] = 0x55; // U LATIN CAPITAL LETTER U WITH OGONEK
- replaceCharList[0x01D3] = 0x55; // U LATIN CAPITAL LETTER U WITH CARON
-
- replaceCharList[0x00FD] = 0x79; // y LATIN SMALL LETTER Y WITH ACUTE
- replaceCharList[0x00FF] = 0x79; // y LATIN SMALL LETTER Y WITH DIAERESIS
- replaceCharList[0x0177] = 0x79; // y LATIN SMALL LETTER Y WITH CIRCUMFLEX
- replaceCharList[0x0233] = 0x79; // y LATIN SMALL LETTER Y WITH MACRON
- replaceCharList[0x1EF3] = 0x79; // y LATIN SMALL LETTER Y WITH GRAVE
- replaceCharList[0x1EF9] = 0x79; // y LATIN SMALL LETTER Y WITH TILDE
-
- replaceCharList[0x00DD] = 0x59; // Y LATIN CAPITAL LETTER Y WITH ACUTE
- replaceCharList[0x0176] = 0x59; // Y LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
- replaceCharList[0x0178] = 0x59; // Y LATIN CAPITAL LETTER Y WITH DIAERESIS
- replaceCharList[0x0232] = 0x59; // Y LATIN CAPITAL LETTER Y WITH MACRON
- replaceCharList[0x1EF2] = 0x59; // Y LATIN CAPITAL LETTER Y WITH GRAVE
- replaceCharList[0x1EF8] = 0x59; // Y LATIN CAPITAL LETTER Y WITH TILDE
-
- replaceCharList[0x017A] = 0x7A; // z LATIN SMALL LETTER Z WITH ACUTE
- replaceCharList[0x017C] = 0x7A; // z LATIN SMALL LETTER Z WITH DOT ABOVE
- replaceCharList[0x017E] = 0x7A; // z LATIN SMALL LETTER Z WITH CARON
-
- replaceCharList[0x0179] = 0x5A; // Z LATIN CAPITAL LETTER Z WITH ACUTE
- replaceCharList[0x017B] = 0x5A; // Z LATIN CAPITAL LETTER Z WITH DOT ABOVE
- replaceCharList[0x017D] = 0x5A; // Z LATIN CAPITAL LETTER Z WITH CARON
+ ucs2toPortuList[0x005E] = 0x14; /* ^ */
+ ucs2toPortuList[0x007C] = 0x40; /* | */
+ ucs2toPortuList[0x007E] = 0x3D; /* ~ */
+ ucs2toPortuList[0x20AC] = 0x65; /* € */
+ ucs2toPortuList[0x00D4] = 0x0B; /* O LATIN CAPITAL LETTER O WITH CIRCUMFLEX */
+ ucs2toPortuList[0x00F4] = 0x0C; /* o LATIN SMALL LETTER O WITH CIRCUMFLEX */
+ ucs2toPortuList[0x00C1] = 0x0E; /* A LATIN CAPITAL LETTER A WITH ACUTE */
+ ucs2toPortuList[0x00E1] = 0x0F; /* a LATIN SMALL LETTER A WITH ACUTE */
+ ucs2toPortuList[0x00CA] = 0x1F; /* E LATIN CAPITAL LETTER E WITH CIRCUMFLEX */
+ ucs2toPortuList[0x00EA] = 0x05; /* e LATIN SMALL LETTER E WITH CIRCUMFLEX */
+ ucs2toPortuList[0x00C0] = 0x41; /* A LATIN CAPITAL LETTER A WITH GRAVE */
+ ucs2toPortuList[0x00E7] = 0x09; /* c LATIN SMALL LETTER C WITH CEDILLA */
+ ucs2toPortuList[0x00CD] = 0x49; /* I LATIN CAPITAL LETTER I WITH ACUTE */
+ ucs2toPortuList[0x00ED] = 0x69; /* i LATIN SMALL LETTER I WITH ACUTE */
+ ucs2toPortuList[0x00D3] = 0x4F; /* O LATIN CAPITAL LETTER O WITH ACUTE */
+ ucs2toPortuList[0x00F3] = 0x6F; /* o LATIN SMALL LETTER O WITH ACUTE */
+ ucs2toPortuList[0x00DA] = 0x55; /* U LATIN CAPITAL LETTER U WITH ACUTE */
+ ucs2toPortuList[0x00FA] = 0x75; /* u LATIN SMALL LETTER U WITH ACUTE */
+ ucs2toPortuList[0x00C3] = 0x61; /* A LATIN CAPITAL LETTER A WITH TILDE */
+ ucs2toPortuList[0x00E3] = 0x7B; /* a LATIN SMALL LETTER A WITH TILDE */
+ ucs2toPortuList[0x00D5] = 0x5C; /* O LATIN CAPITAL LETTER O WITH TILDE */
+ ucs2toPortuList[0x00F5] = 0x7C; /* o LATIN SMALL LETTER O WITH TILDE */
+ ucs2toPortuList[0x00C2] = 0x61; /* A LATIN CAPITAL LETTER A WITH CIRCUMFLEX */
+ ucs2toPortuList[0x00E2] = 0x7F; /* a LATIN SMALL LETTER A WITH CIRCUMFLEX */
+ ucs2toPortuList[0x03A6] = 0x12; /* Φ GREEK CAPITAL LETTER PHI */
+ ucs2toPortuList[0x0393] = 0x13; /* Γ GREEK CAPITAL LETTER GAMMA */
+ ucs2toPortuList[0x03A9] = 0x15; /* Ω GREEK CAPITAL LETTER OMEGA */
+ ucs2toPortuList[0x03A0] = 0x16; /* Î GREEK CAPITAL LETTER PI */
+ ucs2toPortuList[0x03A8] = 0x17; /* Ψ GREEK CAPITAL LETTER PSI */
+ ucs2toPortuList[0x03A3] = 0x18; /* Σ GREEK CAPITAL LETTER SIGMA */
+ ucs2toPortuList[0x0398] = 0x19; /* Θ GREEK CAPITAL LETTER THETA */
+
+
+ /* character replacement table */
+ replaceCharList[0x00E0] = 0x61; /* a LATIN SMALL LETTER A WITH GRAVE */
+ replaceCharList[0x00E1] = 0x61; /* a LATIN SMALL LETTER A WITH ACUTE */
+ replaceCharList[0x00E2] = 0x61; /* a LATIN SMALL LETTER A WITH CIRCUMFLEX */
+ replaceCharList[0x00E3] = 0x61; /* a LATIN SMALL LETTER A WITH TILDE */
+ replaceCharList[0x00E4] = 0x61; /* a LATIN SMALL LETTER A WITH DIAERESIS */
+ replaceCharList[0x00E5] = 0x61; /* a LATIN SMALL LETTER A WITH RING ABOVE */
+ replaceCharList[0x00E6] = 0x61; /* a LATIN SMALL LETTER AE */
+ replaceCharList[0x0101] = 0x61; /* a LATIN SMALL LETTER A WITH MACRON */
+ replaceCharList[0x0103] = 0x61; /* a LATIN SMALL LETTER A WITH BREVE */
+ replaceCharList[0x0105] = 0x61; /* a LATIN SMALL LETTER A WITH OGONEK */
+ replaceCharList[0x01CE] = 0x61; /* a LATIN SMALL LETTER A WITH CARON */
+
+ replaceCharList[0x00C0] = 0x41; /* A LATIN CAPITAL LETTER A WITH GRAVE */
+ replaceCharList[0x00C1] = 0x41; /* A LATIN CAPITAL LETTER A WITH ACUTE */
+ replaceCharList[0x00C2] = 0x41; /* A LATIN CAPITAL LETTER A WITH CIRCUMFLEX */
+ replaceCharList[0x00C3] = 0x41; /* A LATIN CAPITAL LETTER A WITH TILDE */
+ replaceCharList[0x00C4] = 0x41; /* A LATIN CAPITAL LETTER A WITH DIAERESIS */
+ replaceCharList[0x00C5] = 0x41; /* A LATIN CAPITAL LETTER A WITH RING ABOVE */
+ replaceCharList[0x00C6] = 0x41; /* A LATIN CAPITAL LETTER AE */
+ replaceCharList[0x0100] = 0x41; /* A LATIN CAPITAL LETTER A WITH MACRON */
+ replaceCharList[0x0102] = 0x41; /* A LATIN CAPITAL LETTER A WITH BREVE */
+ replaceCharList[0x0104] = 0x41; /* A LATIN CAPITAL LETTER A WITH OGONEK */
+ replaceCharList[0x01CD] = 0x41; /* A LATIN CAPITAL LETTER A WITH CARON */
+
+ replaceCharList[0x00E7] = 0x63; /* c LATIN SMALL LETTER C WITH CEDILLA */
+ replaceCharList[0x0107] = 0x63; /* c LATIN SMALL LETTER C WITH ACUTE */
+ replaceCharList[0x0109] = 0x63; /* c LATIN SMALL LETTER C WITH CIRCUMFLEX */
+ replaceCharList[0x010B] = 0x63; /* c LATIN SMALL LETTER C WITH DOT ABOVE */
+ replaceCharList[0x010D] = 0x63; /* c LATIN SMALL LETTER C WITH CARON */
+
+ replaceCharList[0x00C7] = 0x43; /* C LATIN CAPITAL LETTER C WITH CEDILLA */
+ replaceCharList[0x0106] = 0x43; /* C LATIN CAPITAL LETTER C WITH ACUTE */
+ replaceCharList[0x0108] = 0x43; /* C LATIN CAPITAL LETTER C WITH CIRCUMFLEX */
+ replaceCharList[0x010A] = 0x43; /* C LATIN CAPITAL LETTER C WITH DOT ABOVE */
+ replaceCharList[0x010C] = 0x43; /* C LATIN CAPITAL LETTER C WITH CARON */
+
+ replaceCharList[0x010F] = 0x64; /* d LATIN SMALL LETTER D WITH CARON */
+ replaceCharList[0x0111] = 0x64; /* d LATIN SMALL LETTER D WITH STROKE */
+
+ replaceCharList[0x010E] = 0x44; /* D LATIN CAPITAL LETTER D WITH CARON */
+ replaceCharList[0x0110] = 0x44; /* D LATIN CAPITAL LETTER D WITH STROKE */
+
+ replaceCharList[0x00E8] = 0x65; /* e LATIN SMALL LETTER E WITH GRAVE */
+ replaceCharList[0x00E9] = 0x65; /* e LATIN SMALL LETTER E WITH ACUTE */
+ replaceCharList[0x00EA] = 0x65; /* e LATIN SMALL LETTER E WITH CIRCUMFLEX */
+ replaceCharList[0x00EB] = 0x65; /* e LATIN SMALL LETTER E WITH DIAERESIS */
+ replaceCharList[0x0113] = 0x65; /* e LATIN SMALL LETTER E WITH MACRON */
+ replaceCharList[0x0115] = 0x65; /* e LATIN SMALL LETTER E WITH BREVE */
+ replaceCharList[0x0117] = 0x65; /* e LATIN SMALL LETTER E WITH DOT ABOVE */
+ replaceCharList[0x0119] = 0x65; /* e LATIN SMALL LETTER E WITH OGONEK */
+ replaceCharList[0x011B] = 0x65; /* e LATIN SMALL LETTER E WITH CARON */
+ replaceCharList[0x0259] = 0x65; /* e LATIN SMALL LETTER SCHWA */
+
+ replaceCharList[0x00C8] = 0x45; /* E LATIN CAPITAL LETTER E WITH GRAVE */
+ replaceCharList[0x00C9] = 0x45; /* E LATIN CAPITAL LETTER E WITH ACUTE */
+ replaceCharList[0x00CA] = 0x45; /* E LATIN CAPITAL LETTER E WITH CIRCUMFLEX */
+ replaceCharList[0x00CB] = 0x45; /* E LATIN CAPITAL LETTER E WITH DIAERESIS */
+ replaceCharList[0x0112] = 0x45; /* E LATIN CAPITAL LETTER E WITH MACRON */
+ replaceCharList[0x0114] = 0x45; /* E LATIN CAPITAL LETTER E WITH BREVE */
+ replaceCharList[0x0116] = 0x45; /* E LATIN CAPITAL LETTER E WITH DOT ABOVE */
+ replaceCharList[0x0118] = 0x45; /* E LATIN CAPITAL LETTER E WITH OGONEK */
+ replaceCharList[0x011A] = 0x45; /* E LATIN CAPITAL LETTER E WITH CARON */
+ replaceCharList[0x018F] = 0x45; /* E LATIN CAPITAL LETTER SCHWA */
+
+ replaceCharList[0x011D] = 0x67; /* g LATIN SMALL LETTER G WITH CIRCUMFLEX */
+ replaceCharList[0x011F] = 0x67; /* g LATIN SMALL LETTER G WITH BREVE */
+ replaceCharList[0x0121] = 0x67; /* g LATIN SMALL LETTER G WITH DOT ABOVE */
+ replaceCharList[0x0123] = 0x67; /* g LATIN SMALL LETTER G WITH CEDILLA */
+ replaceCharList[0x01E7] = 0x67; /* g LATIN SMALL LETTER G WITH CARON */
+ replaceCharList[0x01F5] = 0x67; /* g LATIN SMALL LETTER G WITH ACUTE */
+ replaceCharList[0x1E21] = 0x67; /* g LATIN SMALL LETTER G WITH MACRON */
+
+ replaceCharList[0x011C] = 0x47; /* G LATIN CAPITAL LETTER G WITH CIRCUMFLEX */
+ replaceCharList[0x011E] = 0x47; /* G LATIN CAPITAL LETTER G WITH BREVE */
+ replaceCharList[0x0120] = 0x47; /* G LATIN CAPITAL LETTER G WITH DOT ABOVE */
+ replaceCharList[0x0122] = 0x47; /* G LATIN CAPITAL LETTER G WITH CEDILLA */
+ replaceCharList[0x01E6] = 0x47; /* G LATIN CAPITAL LETTER G WITH CARON */
+ replaceCharList[0x01F4] = 0x47; /* G LATIN CAPITAL LETTER G WITH ACUTE */
+ replaceCharList[0x1E20] = 0x47; /* G LATIN CAPITAL LETTER G WITH MACRON */
+
+ replaceCharList[0x00EC] = 0x69; /* i LATIN SMALL LETTER I WITH GRAVE */
+ replaceCharList[0x00ED] = 0x69; /* i LATIN SMALL LETTER I WITH ACUTE */
+ replaceCharList[0x00EE] = 0x69; /* i LATIN SMALL LETTER I WITH CIRCUMFLEX */
+ replaceCharList[0x00EF] = 0x69; /* i LATIN SMALL LETTER I WITH DIAERESIS */
+ replaceCharList[0x0129] = 0x69; /* i LATIN SMALL LETTER I WITH TILDE */
+ replaceCharList[0x012B] = 0x69; /* i LATIN SMALL LETTER I WITH MACRON */
+ replaceCharList[0x012D] = 0x69; /* i LATIN SMALL LETTER I WITH BREVE */
+ replaceCharList[0x012F] = 0x69; /* i LATIN SMALL LETTER I WITH OGONEK */
+ replaceCharList[0x01D0] = 0x69; /* i LATIN SMALL LETTER I WITH CARON */
+ replaceCharList[0x0131] = 0x69; /* i LATIN SMALL LETTER DOTLESS I */
+
+ replaceCharList[0x00CC] = 0x49; /* I LATIN CAPITAL LETTER I WITH GRAVE */
+ replaceCharList[0x00CD] = 0x49; /* I LATIN CAPITAL LETTER I WITH ACUTE */
+ replaceCharList[0x00CE] = 0x49; /* I LATIN CAPITAL LETTER I WITH CIRCUMFLEX */
+ replaceCharList[0x00CF] = 0x49; /* I LATIN CAPITAL LETTER I WITH DIAERESIS */
+ replaceCharList[0x0128] = 0x49; /* I LATIN CAPITAL LETTER I WITH TILDE */
+ replaceCharList[0x012A] = 0x49; /* I LATIN CAPITAL LETTER I WITH MACRON */
+ replaceCharList[0x012C] = 0x49; /* I LATIN CAPITAL LETTER I WITH BREVE */
+ replaceCharList[0x012E] = 0x49; /* I LATIN CAPITAL LETTER I WITH OGONEK */
+ replaceCharList[0x0130] = 0x49; /* I LATIN CAPITAL LETTER I WITH DOT ABOVE */
+
+ replaceCharList[0x0137] = 0x6B; /* k LATIN SMALL LETTER K WITH CEDILLA */
+
+ replaceCharList[0x0136] = 0x4B; /* K LATIN CAPITAL LETTER K WITH CEDILLA */
+
+ replaceCharList[0x013A] = 0x6C; /* l LATIN SMALL LETTER L WITH ACUTE */
+ replaceCharList[0x013C] = 0x6C; /* l LATIN SMALL LETTER L WITH CEDILLA */
+ replaceCharList[0x013E] = 0x6C; /* l LATIN SMALL LETTER L WITH CARON */
+ replaceCharList[0x0140] = 0x6C; /* l LATIN SMALL LETTER L WITH MIDDLE DOT */
+ replaceCharList[0x0142] = 0x6C; /* l LATIN SMALL LETTER L WITH STROKE */
+
+ replaceCharList[0x0139] = 0x4C; /* L LATIN CAPITAL LETTER L WITH ACUTE */
+ replaceCharList[0x013B] = 0x4C; /* L LATIN CAPITAL LETTER L WITH CEDILLA */
+ replaceCharList[0x013D] = 0x4C; /* L LATIN CAPITAL LETTER L WITH CARON */
+ replaceCharList[0x013F] = 0x4C; /* L LATIN CAPITAL LETTER L WITH MIDDLE DOT */
+ replaceCharList[0x0141] = 0x4C; /* L LATIN CAPITAL LETTER L WITH STROKE */
+
+ replaceCharList[0x00F1] = 0x6E; /* n LATIN SMALL LETTER N WITH TILDE */
+ replaceCharList[0x0144] = 0x6E; /* n LATIN SMALL LETTER N WITH ACUTE */
+ replaceCharList[0x0146] = 0x6E; /* n LATIN SMALL LETTER N WITH CEDILLA */
+ replaceCharList[0x0148] = 0x6E; /* n LATIN SMALL LETTER N WITH CARON */
+
+ replaceCharList[0x00D1] = 0x4E; /* N LATIN CAPITAL LETTER N WITH TILDE */
+ replaceCharList[0x0143] = 0x4E; /* N LATIN CAPITAL LETTER N WITH ACUTE */
+ replaceCharList[0x0145] = 0x4E; /* N LATIN CAPITAL LETTER N WITH CEDILLA */
+ replaceCharList[0x0147] = 0x4E; /* N LATIN CAPITAL LETTER N WITH CARON */
+
+ replaceCharList[0x00F2] = 0x6F; /* o LATIN SMALL LETTER O WITH GRAVE */
+ replaceCharList[0x00F3] = 0x6F; /* o LATIN SMALL LETTER O WITH ACUTE */
+ replaceCharList[0x00F4] = 0x6F; /* o LATIN SMALL LETTER O WITH CIRCUMFLEX */
+ replaceCharList[0x00F5] = 0x6F; /* o LATIN SMALL LETTER O WITH TILDE */
+ replaceCharList[0x00F6] = 0x6F; /* o LATIN SMALL LETTER O WITH DIAERESIS */
+ replaceCharList[0x00F8] = 0x6F; /* o LATIN SMALL LETTER O WITH STROKE */
+ replaceCharList[0x014D] = 0x6F; /* o LATIN SMALL LETTER O WITH MACRON */
+ replaceCharList[0x014F] = 0x6F; /* o LATIN SMALL LETTER O WITH BREVE */
+ replaceCharList[0x01D2] = 0x6F; /* o LATIN SMALL LETTER O WITH CARON */
+ replaceCharList[0x01EB] = 0x6F; /* o LATIN SMALL LETTER O WITH OGONEK */
+ replaceCharList[0x0151] = 0x6F; /* o LATIN SMALL LETTER O WITH DOUBLE ACUTE */
+ replaceCharList[0x0153] = 0x6F; /* LATIN SMALL LIGATURE OE */
+
+ replaceCharList[0x00D2] = 0x4F; /* O LATIN CAPITAL LETTER O WITH GRAVE */
+ replaceCharList[0x00D3] = 0x4F; /* O LATIN CAPITAL LETTER O WITH ACUTE */
+ replaceCharList[0x00D4] = 0x4F; /* O LATIN CAPITAL LETTER O WITH CIRCUMFLEX */
+ replaceCharList[0x00D5] = 0x4F; /* O LATIN CAPITAL LETTER O WITH TILDE */
+ replaceCharList[0x00D6] = 0x4F; /* O LATIN CAPITAL LETTER O WITH DIAERESIS */
+ replaceCharList[0x00D8] = 0x4F; /* O LATIN CAPITAL LETTER O WITH STROKE */
+ replaceCharList[0x014C] = 0x4F; /* O LATIN CAPITAL LETTER O WITH MACRON */
+ replaceCharList[0x014E] = 0x4F; /* O LATIN CAPITAL LETTER O WITH BREVE */
+ replaceCharList[0x01D1] = 0x4F; /* O LATIN CAPITAL LETTER O WITH CARON */
+ replaceCharList[0x01EA] = 0x4F; /* O LATIN CAPITAL LETTER O WITH OGONEK */
+ replaceCharList[0x0150] = 0x4F; /* O LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */
+ replaceCharList[0x0152] = 0x4F; /* LATIN CAPITAL LIGATURE OE */
+
+ replaceCharList[0x0155] = 0x72; /* r LATIN SMALL LETTER R WITH ACUTE */
+ replaceCharList[0x0157] = 0x72; /* r LATIN SMALL LETTER R WITH CEDILLA */
+ replaceCharList[0x0159] = 0x72; /* r LATIN SMALL LETTER R WITH CARON */
+
+ replaceCharList[0x0154] = 0x52; /* R LATIN CAPITAL LETTER R WITH ACUTE */
+ replaceCharList[0x0156] = 0x52; /* R LATIN CAPITAL LETTER R WITH CEDILLA */
+ replaceCharList[0x0158] = 0x52; /* R LATIN CAPITAL LETTER R WITH CARON */
+
+ replaceCharList[0x015B] = 0x73; /* s LATIN SMALL LETTER S WITH ACUTE */
+ replaceCharList[0x015D] = 0x73; /* s LATIN SMALL LETTER S WITH CIRCUMFLEX */
+ replaceCharList[0x015F] = 0x73; /* s LATIN SMALL LETTER S WITH CEDILLA */
+ replaceCharList[0x0161] = 0x73; /* s LATIN SMALL LETTER S WITH CARON */
+
+ replaceCharList[0x015A] = 0x53; /* S LATIN CAPITAL LETTER S WITH ACUTE */
+ replaceCharList[0x015C] = 0x53; /* S LATIN CAPITAL LETTER S WITH CIRCUMFLEX */
+ replaceCharList[0x015E] = 0x53; /* S LATIN CAPITAL LETTER S WITH CEDILLA */
+ replaceCharList[0x0160] = 0x53; /* S LATIN CAPITAL LETTER S WITH CARON */
+
+ replaceCharList[0x00FE] = 0x74; /* t LATIN CAPITAL LETTER THORN */
+ replaceCharList[0x0163] = 0x74; /* t LATIN SMALL LETTER T WITH CEDILLA */
+ replaceCharList[0x0165] = 0x74; /* t LATIN SMALL LETTER T WITH CARON */
+ replaceCharList[0x0167] = 0x74; /* t LATIN SMALL LETTER T WITH STROKE */
+ replaceCharList[0x021B] = 0x74; /* t LATIN SMALL LETTER T WITH COMMA BELOW */
+
+ replaceCharList[0x00DE] = 0x54; /* T LATIN CAPITAL LETTER THORN */
+ replaceCharList[0x0162] = 0x54; /* T LATIN CAPITAL LETTER T WITH CEDILLA */
+ replaceCharList[0x0164] = 0x54; /* T LATIN CAPITAL LETTER T WITH CARON */
+ replaceCharList[0x0166] = 0x54; /* T LATIN CAPITAL LETTER T WITH STROKE */
+
+ replaceCharList[0x00F9] = 0x75; /* u LATIN SMALL LETTER U WITH GRAVE */
+ replaceCharList[0x00FA] = 0x75; /* u LATIN SMALL LETTER U WITH ACUTE */
+ replaceCharList[0x00FB] = 0x75; /* u LATIN SMALL LETTER U WITH CIRCUMFLEX */
+ replaceCharList[0x00FC] = 0x75; /* u LATIN SMALL LETTER U WITH DIAERESIS */
+ replaceCharList[0x0169] = 0x75; /* u LATIN SMALL LETTER U WITH TILDE */
+ replaceCharList[0x016B] = 0x75; /* u LATIN SMALL LETTER U WITH MACRON */
+ replaceCharList[0x016D] = 0x75; /* u LATIN SMALL LETTER U WITH BREVE */
+ replaceCharList[0x016F] = 0x75; /* u LATIN SMALL LETTER U WITH RING ABOVE */
+ replaceCharList[0x0171] = 0x75; /* u LATIN SMALL LETTER U WITH DOUBLE ACUTE */
+ replaceCharList[0x0173] = 0x75; /* u LATIN SMALL LETTER U WITH OGONEK */
+ replaceCharList[0x01D4] = 0x75; /* u LATIN SMALL LETTER U WITH CARON */
+
+ replaceCharList[0x00D9] = 0x55; /* U LATIN CAPITAL LETTER U WITH GRAVE */
+ replaceCharList[0x00DA] = 0x55; /* U LATIN CAPITAL LETTER U WITH ACUTE */
+ replaceCharList[0x00DB] = 0x55; /* U LATIN CAPITAL LETTER U WITH CIRCUMFLEX */
+ replaceCharList[0x00DC] = 0x55; /* U LATIN CAPITAL LETTER U WITH DIAERESIS */
+ replaceCharList[0x0168] = 0x55; /* U LATIN CAPITAL LETTER U WITH TILDE */
+ replaceCharList[0x016A] = 0x55; /* U LATIN CAPITAL LETTER U WITH MACRON */
+ replaceCharList[0x016C] = 0x55; /* U LATIN CAPITAL LETTER U WITH BREVE */
+ replaceCharList[0x016E] = 0x55; /* U LATIN CAPITAL LETTER U WITH RING ABOVE */
+ replaceCharList[0x0170] = 0x55; /* U LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */
+ replaceCharList[0x0172] = 0x55; /* U LATIN CAPITAL LETTER U WITH OGONEK */
+ replaceCharList[0x01D3] = 0x55; /* U LATIN CAPITAL LETTER U WITH CARON */
+
+ replaceCharList[0x00FD] = 0x79; /* y LATIN SMALL LETTER Y WITH ACUTE */
+ replaceCharList[0x00FF] = 0x79; /* y LATIN SMALL LETTER Y WITH DIAERESIS */
+ replaceCharList[0x0177] = 0x79; /* y LATIN SMALL LETTER Y WITH CIRCUMFLEX */
+ replaceCharList[0x0233] = 0x79; /* y LATIN SMALL LETTER Y WITH MACRON */
+ replaceCharList[0x1EF3] = 0x79; /* y LATIN SMALL LETTER Y WITH GRAVE */
+ replaceCharList[0x1EF9] = 0x79; /* y LATIN SMALL LETTER Y WITH TILDE */
+
+ replaceCharList[0x00DD] = 0x59; /* Y LATIN CAPITAL LETTER Y WITH ACUTE */
+ replaceCharList[0x0176] = 0x59; /* Y LATIN CAPITAL LETTER Y WITH CIRCUMFLEX */
+ replaceCharList[0x0178] = 0x59; /* Y LATIN CAPITAL LETTER Y WITH DIAERESIS */
+ replaceCharList[0x0232] = 0x59; /* Y LATIN CAPITAL LETTER Y WITH MACRON */
+ replaceCharList[0x1EF2] = 0x59; /* Y LATIN CAPITAL LETTER Y WITH GRAVE */
+ replaceCharList[0x1EF8] = 0x59; /* Y LATIN CAPITAL LETTER Y WITH TILDE */
+
+ replaceCharList[0x017A] = 0x7A; /* z LATIN SMALL LETTER Z WITH ACUTE */
+ replaceCharList[0x017C] = 0x7A; /* z LATIN SMALL LETTER Z WITH DOT ABOVE */
+ replaceCharList[0x017E] = 0x7A; /* z LATIN SMALL LETTER Z WITH CARON */
+
+ replaceCharList[0x0179] = 0x5A; /* Z LATIN CAPITAL LETTER Z WITH ACUTE */
+ replaceCharList[0x017B] = 0x5A; /* Z LATIN CAPITAL LETTER Z WITH DOT ABOVE */
+ replaceCharList[0x017D] = 0x5A; /* Z LATIN CAPITAL LETTER Z WITH CARON */
}
utf8Length = srcTextLen;
}
- int maxUCS2Length = utf8Length; // max # of UCS2 chars, NOT bytes. when all utf8 chars are only one byte, UCS2Length is maxUCS2 Length. otherwise (ex: 2 bytes of UTF8 is one char) UCS2Length must be less than utf8Length
+ int maxUCS2Length = utf8Length; /* max # of UCS2 chars, NOT bytes. when all utf8 chars are only one byte, UCS2Length is maxUCS2 Length. otherwise (ex: 2 bytes of UTF8 is one char) UCS2Length must be less than utf8Length */
WCHAR *pUCS2Text = NULL;
unique_ptr<WCHAR*, void(*)(WCHAR**)> buf(&pUCS2Text, unique_ptr_deleter);
return -1;
}
- // null terminated string
+ /* null terminated string */
if ( srcTextLen == -1 ) {
textLen = strlen((char*)pSrcText);
srcTextLen = textLen;
}
GIConv cd;
- int err=0;
+ int err = 0;
cd = g_iconv_open("UTF16BE", "UTF8");
utf8Length = srcTextLen;
- int maxUCS2Length = utf8Length; // max # of UCS2 chars, NOT bytes. when all utf8 chars are only one byte, UCS2Length is maxUCS2 Length. otherwise (ex: 2 bytes of UTF8 is one char) UCS2Length must be less than utf8Length
+ int maxUCS2Length = utf8Length; /* max # of UCS2 chars, NOT bytes. when all utf8 chars are only one byte, UCS2Length is maxUCS2 Length. otherwise (ex: 2 bytes of UTF8 is one char) UCS2Length must be less than utf8Length */
WCHAR pUCS2Text[maxUCS2Length];
memset(pUCS2Text, 0x00, maxUCS2Length * sizeof(WCHAR));
{
int utf8Length = 0;
int ucs2Length = 0;
- int maxUCS2Length = srcTextLen; // max # of UCS2 chars, NOT bytes. when all gsm7 chars are only one byte(-there is no extenstion), UCS2Length is maxUCS2 Length. otherwise(ex: gsm7 char starts with 0x1b) UCS2Length must be less than gsm7 legnth
+ int maxUCS2Length = srcTextLen; /* max # of UCS2 chars, NOT bytes. when all gsm7 chars are only one byte(-there is no extenstion), UCS2Length is maxUCS2 Length. otherwise(ex: gsm7 char starts with 0x1b) UCS2Length must be less than gsm7 legnth */
WCHAR pUCS2Text[maxUCS2Length];
memset(pUCS2Text, 0x00, maxUCS2Length * sizeof(WCHAR));
GIConv cd;
int err = 0;
- cd = g_iconv_open( "UTF8", "UTF16BE" );
+ cd = g_iconv_open("UTF8", "UTF16BE");
if (cd > 0) {
err = g_iconv(cd, (char**)&pSrcText, (gsize*)&srcTextLen, (char**)&pDestText, (gsize*)&remainedBuffer);
}
GIConv cd;
- int err=0;
+ int err = 0;
- cd = g_iconv_open( "UTF8", "EUCKR" );
+ cd = g_iconv_open("UTF8", "EUCKR");
if (cd > 0) {
err = g_iconv(cd, (char**)&pSrcText, (gsize*)&srcTextLen, (char**)&pDestText, (gsize*)&remainedBuffer);
}
GIConv cd;
- int err=0;
+ int err = 0;
- cd = g_iconv_open( "UTF8", "SHIFT-JIS" );
+ cd = g_iconv_open("UTF8", "SHIFT-JIS");
if (cd > 0) {
err = g_iconv(cd, (char**)&pSrcText, (gsize*)&srcTextLen, (char**)&pDestText, (gsize*)&remainedBuffer);
*/
int MsgTextConvert::convertUCS2ToGSM7bit(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen, OUT MSG_LANGUAGE_ID_T *pLangId, OUT bool *bIncludeAbnormalChar)
{
- // for UNICODE
+ /* for UNICODE */
int outTextLen = 0;
unsigned char lowerByte, upperByte;
unsigned short inText;
- // Get Language Type by checking each character
- for (int index = 0; index < srcTextLen; index++)
- {
+ /* Get Language Type by checking each character */
+ for (int index = 0; index < srcTextLen; index++) {
upperByte = pSrcText[index++];
lowerByte = pSrcText[index];
MSG_DEBUG("charType : [%d]", currType);
- for (int index = 0; index < srcTextLen; index++)
- {
+ for (int index = 0; index < srcTextLen; index++) {
upperByte = pSrcText[index++];
lowerByte = pSrcText[index];
inText = (upperByte << 8) & 0xFF00;
inText = inText | lowerByte;
- // Check Default Char
+ /* Check Default Char */
itChar = ucs2toGSM7DefList.find(inText);
if (itChar != ucs2toGSM7DefList.end()) {
itExt = ucs2toGSM7ExtList.find(inText);
if (itExt != ucs2toGSM7ExtList.end()) {
- // prevent buffer overflow
+ /* prevent buffer overflow */
if (maxLength <= outTextLen + 1) {
MSG_DEBUG("Buffer Full.");
break;
itExt = ucs2toTurkishList.find(inText);
if (itExt != ucs2toTurkishList.end()) {
- // prevent buffer overflow
+ /* prevent buffer overflow */
if (maxLength <= outTextLen + 1) {
MSG_DEBUG("Buffer Full.");
break;
itExt = ucs2toSpanishList.find(inText);
if (itExt != ucs2toSpanishList.end()) {
- // prevent buffer overflow
+ /* prevent buffer overflow */
if (maxLength <= outTextLen + 1) {
MSG_DEBUG("Buffer Full.");
break;
itExt = ucs2toPortuList.find(inText);
if (itExt != ucs2toPortuList.end()) {
- // prevent buffer overflow
+ /* prevent buffer overflow */
if (maxLength <= outTextLen + 1) {
MSG_DEBUG("Buffer Full.");
break;
}
}
- // prevent buffer overflow
+ /* prevent buffer overflow */
if (maxLength <= outTextLen) {
MSG_DEBUG("Buffer full.");
break;
#ifndef FEATURE_SMS_CDMA
int MsgTextConvert::convertUCS2ToGSM7bitAuto(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen, OUT bool *pUnknown)
{
- // for UNICODE
+ /* for UNICODE */
int outTextLen = 0;
unsigned char lowerByte, upperByte;
unsigned short inText;
- for (int index = 0; index < srcTextLen; index++)
- {
+ for (int index = 0; index < srcTextLen; index++) {
upperByte = pSrcText[index++];
lowerByte = pSrcText[index];
inText = (upperByte << 8) & 0xFF00;
inText = inText | lowerByte;
- // Check Default Char
+ /* Check Default Char */
itChar = ucs2toGSM7DefList.find(inText);
if (itChar != ucs2toGSM7DefList.end()) {
itExt = ucs2toGSM7ExtList.find(inText);
if (itExt != ucs2toGSM7ExtList.end()) {
- // prevent buffer overflow
+ /* prevent buffer overflow */
if (maxLength <= outTextLen + 1) {
MSG_DEBUG("Buffer Full.");
break;
}
}
- // prevent buffer overflow
+ /* prevent buffer overflow */
if (maxLength <= outTextLen) {
MSG_DEBUG("Buffer full\n");
break;
#else
int MsgTextConvert::convertUCS2ToASCII(OUT unsigned char *pDestText, IN int maxLength, IN const unsigned char *pSrcText, IN int srcTextLen, OUT bool *pUnknown)
{
- // for UNICODE
+ /* for UNICODE */
int outTextLen = 0;
unsigned char lowerByte, upperByte;
unsigned short inText;
- for (int index = 0; index < srcTextLen; index++)
- {
+ for (int index = 0; index < srcTextLen; index++) {
upperByte = pSrcText[index++];
lowerByte = pSrcText[index];
inText = (upperByte << 8) & 0xFF00;
inText = inText | lowerByte;
- // Check Default Char
+ /* Check Default Char */
if (inText > 0x007f) {
MSG_DEBUG("Abnormal character is included. inText : [%04x]", inText);
*pUnknown = true;
pDestText[outTextLen++] = (unsigned char)inText;
- // prevent buffer overflow
+ /* prevent buffer overflow */
if (maxLength <= outTextLen) {
MSG_DEBUG("Buffer full\n");
break;
}
-
}
#ifdef CONVERT_DUMP
return -1;
}
- for (int i = 0; i<srcTextLen; i++)
- {
+ for (int i = 0; i < srcTextLen; i++) {
if (maxLength == 0) {
break;
}
if (pSrcText[i] >= 0x80) {
- //error
+ /*error */
MSG_ERR(">>>>>>>a_pTextString[i]=%x, The alpha isn't the gsm 7bit code, Never Come here!!!\n", pSrcText[i]);
return -1;
}
- if (pLangInfo->bLockingShift == true) { // National Language Locking Shift
+ if (pLangInfo->bLockingShift == true) { /* National Language Locking Shift */
MSG_DEBUG("Locking Shift [%d]", pLangInfo->lockingLang);
if (pLangInfo->lockingLang == MSG_LANG_ID_TURKISH) {
- // Check Escape
+ /* Check Escape */
if (g_TurkishLockingToUCS2[pSrcText[i]] == 0x001B) {
i++;
- if (pLangInfo->bSingleShift == true) { // National Language Single Shift
+ if (pLangInfo->bSingleShift == true) { /* National Language Single Shift */
MSG_DEBUG("Single Shift [%d]", pLangInfo->singleLang);
if (pLangInfo->singleLang == MSG_LANG_ID_TURKISH) {
lowerByte = g_GSM7BitExtToUCS2[pSrcText[i]] & 0x00FF;
upperByte = (g_GSM7BitExtToUCS2[pSrcText[i]] & 0xFF00) >> 8;
}
- } else { // GSM 7 bit Default Alphabet Extension Table
+ } else { /* GSM 7 bit Default Alphabet Extension Table */
lowerByte = g_GSM7BitExtToUCS2[pSrcText[i]] & 0x00FF;
upperByte = (g_GSM7BitExtToUCS2[pSrcText[i]] & 0xFF00) >> 8;
}
- } else { // TURKISH - National Language Locking Shift
+ } else { /* TURKISH - National Language Locking Shift */
lowerByte = g_TurkishLockingToUCS2[pSrcText[i]] & 0x00FF;
upperByte = (g_TurkishLockingToUCS2[pSrcText[i]] & 0xFF00) >> 8;
}
} else if (pLangInfo->lockingLang == MSG_LANG_ID_PORTUGUESE) {
- // Check Escape
+ /* Check Escape */
if (g_PortuLockingToUCS2[pSrcText[i]] == 0x001B) {
i++;
- if (pLangInfo->bSingleShift == true) { // National Language Single Shift
+ if (pLangInfo->bSingleShift == true) { /* National Language Single Shift */
MSG_DEBUG("Single Shift [%d]", pLangInfo->singleLang);
if (pLangInfo->singleLang == MSG_LANG_ID_TURKISH) {
lowerByte = g_GSM7BitExtToUCS2[pSrcText[i]] & 0x00FF;
upperByte = (g_GSM7BitExtToUCS2[pSrcText[i]] & 0xFF00) >> 8;
}
- } else { // GSM 7 bit Default Alphabet Extension Table
+ } else { /* GSM 7 bit Default Alphabet Extension Table */
lowerByte = g_GSM7BitExtToUCS2[pSrcText[i]] & 0x00FF;
upperByte = (g_GSM7BitExtToUCS2[pSrcText[i]] & 0xFF00) >> 8;
}
- } else { // PORTUGUESE - National Language Locking Shift
+ } else { /* PORTUGUESE - National Language Locking Shift */
lowerByte = g_PortuLockingToUCS2[pSrcText[i]] & 0x00FF;
upperByte = (g_PortuLockingToUCS2[pSrcText[i]] & 0xFF00) >> 8;
}
}
} else {
- // Check Escape
+ /* Check Escape */
if (g_GSM7BitToUCS2[pSrcText[i]] == 0x001B) {
i++;
- if (pLangInfo->bSingleShift == true) { // National Language Single Shift
+ if (pLangInfo->bSingleShift == true) { /* National Language Single Shift */
MSG_DEBUG("Single Shift [%d]", pLangInfo->singleLang);
if (pLangInfo->singleLang == MSG_LANG_ID_TURKISH) {
lowerByte = g_GSM7BitExtToUCS2[pSrcText[i]] & 0x00FF;
upperByte = (g_GSM7BitExtToUCS2[pSrcText[i]] & 0xFF00) >> 8;
}
- } else { // GSM 7 bit Default Alphabet Extension Table
+ } else { /* GSM 7 bit Default Alphabet Extension Table */
lowerByte = g_GSM7BitExtToUCS2[pSrcText[i]] & 0x00FF;
upperByte = (g_GSM7BitExtToUCS2[pSrcText[i]] & 0xFF00) >> 8;
}
MSG_DEBUG(" Dump Text To Hex - Length :%d\n", length);
MSG_DEBUG("=======================================");
- for (int i = 0; i < length; i++ )
- {
+ for (int i = 0; i < length; i++) {
MSG_DEBUG("[%02x]", pText[i]);
}
#include <sys/smack.h>
#include <string.h>
#include <dirent.h>
-#include <unistd.h> //sync()
+#include <unistd.h>
#include <fcntl.h>
#include <libgen.h>
return true;
}
-// File operation wrappers
+/* File operation wrappers */
FILE *MsgOpenFile(const char *filepath, const char *opt)
{
if (!filepath || !opt) {
MSG_DEBUG("[FILE] pFile [%p], offset [%d], origin [%d]", pFile, offset, origin);
try {
- ret = fseek(pFile, offset, origin); // return 0, if success.
+ ret = fseek(pFile, offset, origin); /* return 0, if success. */
} catch (exception &e) {
MSG_FATAL("%s", e.what());
return -1;
return -1L;
}
- long int ret = -1L; // -1L return if error occured.
+ long int ret = -1L; /* -1L return if error occured. */
try {
ret = ftell(pFile);
int ret = -1;
try {
- ret = fflush(pFile); // return 0 if success
+ ret = fflush(pFile); /* return 0 if success */
} catch (exception &e) {
MSG_FATAL("%s", e.what());
}
int ret = -1;
try {
- ret = fdatasync(pFile->_fileno); // return 0 if success
+ ret = fdatasync(pFile->_fileno); /* return 0 if success */
} catch (exception &e) {
MSG_FATAL("%s", e.what());
}
return false;
}
- // Create Random Number
+ /* Create Random Number */
srandom((unsigned int)ts.tv_nsec);
MSG_DEBUG("ts.tv_nsec : %d", ts.tv_nsec);
- // between 1 - 1000000000
+ /* between 1 - 1000000000 */
snprintf(pFileName, MSG_FILENAME_LEN_MAX, "MSG_%lu.DATA", random()%1000000000+1);
} catch (exception& e) {
MSG_FATAL("%s", e.what());
return -1;
}
- //ppData[FileSize] = '\0';
+ /* ppData[FileSize] = '\0'; */
nSize = FileSize;
MsgCloseFile(pFile);
}
-bool MsgWriteSmilFile(const char *pFilePath,char *pData, int DataSize)
+bool MsgWriteSmilFile(const char *pFilePath, char *pData, int DataSize)
{
if(!pFilePath) {
MSG_DEBUG("pFilePath is NULL");
if (remove(fullPath) != 0)
MSG_SEC_ERR("File Delete Error [%s]: %s", fullPath, g_strerror(errno));
} catch (exception &e) {
- MSG_FATAL ("%s", e.what());
+ MSG_FATAL("%s", e.what());
}
-
}
void MsgDeleteSmilFile(const char *pFileName)
{
- if (!pFileName ) {
+ if (!pFileName) {
MSG_FATAL("pFileName NULL");
return;
}
MsgFflush(pFile);
- memset( pInBuffer, 0, maxLen );
+ memset(pInBuffer, 0, maxLen);
*pPtr = 0;
}
if (MsgWriteFile(pBuff, sizeof(char), TotalLength, pFile) != (size_t)TotalLength) {
- MsgCloseFile( pFile );
+ MsgCloseFile(pFile);
return false;
}
- MsgFsync(pFile); //file is written to device immediately, it prevents missing file data from unexpected power off
+ MsgFsync(pFile); /* file is written to device immediately, it prevents missing file data from unexpected power off */
MsgFflush(pFile);
MsgCloseFile(pFile);
}
-char *MsgOpenAndReadMmsFile( const char *szFilePath, int offset, int size, int *npSize )
+char *MsgOpenAndReadMmsFile(const char *szFilePath, int offset, int size, int *npSize)
{
FILE *pFile = NULL;
char *pData = NULL;
*npSize = 0;
- pFile = MsgOpenFile( szFilePath, "rb" );
+ pFile = MsgOpenFile(szFilePath, "rb");
if (pFile == NULL) {
MSG_ERR("Can't open file: %s", g_strerror(errno));
} else {
readSize = size;
}
-// restore Kies backup data size greater than FM_READ_WRITE_BUFFER_MAX
-// if (readSize > FM_READ_WRITE_BUFFER_MAX) {
-// MSG_DEBUG("MsgOpenAndReadMmsFile: File size tried to read too big");
-// goto __CATCH;
-// }
+/* restore Kies backup data size greater than FM_READ_WRITE_BUFFER_MAX */
+#if 0
+ if (readSize > FM_READ_WRITE_BUFFER_MAX) {
+ MSG_DEBUG("MsgOpenAndReadMmsFile: File size tried to read too big");
+ goto __CATCH;
+ }
+#endif
pData = (char *)calloc(1, readSize + 1);
if ( NULL == pData ) {
goto __CATCH;
}
- if (MsgFseek( pFile, offset, SEEK_SET) < 0) {
+ if (MsgFseek(pFile, offset, SEEK_SET) < 0) {
MSG_ERR("FmSeekFile failed : %s", g_strerror(errno) );
goto __CATCH;
}
__CATCH:
if (pData) {
- free( pData );
+ free(pData);
pData = NULL;
}
*npSize = 0;
if (pFile != NULL) {
- MsgCloseFile( pFile );
+ MsgCloseFile(pFile);
pFile = NULL;
}
return NULL;
}
-// it is equivalent to "rm -rf pDirPath"
+/* it is equivalent to "rm -rf pDirPath" */
int MsgRmRf(char *pDirPath)
{
struct dirent *d = NULL;
MsgRmRf(path);
if (rmdir(path) != 0) {
-
if (path != NULL)
free(path);
MsgDrmUnregisterFile(path);
if (remove(path) != 0) {
-
if (path != NULL)
free(path);
}
-// it is equivalent to "du dir_path"
+/* it is equivalent to "du dir_path" */
unsigned int MsgDu(const char *pDirPath)
{
struct dirent *d = NULL;
unsigned int totalFileSize = 0;
for (readdir_r(dir, &entry, &d); d != NULL; readdir_r(dir, &entry, &d)) {
- if( d->d_type == DT_DIR) {
+ if(d->d_type == DT_DIR) {
snprintf(path, size, "%s/%s", pDirPath, d->d_name);
if ((strcmp(".", d->d_name) == 0) || (strcmp("..", d->d_name) == 0))
return false;
}
- MsgFsync(pFile); //file is written to device immediately, it prevents missing file data from unexpected power off
+ MsgFsync(pFile); /*file is written to device immediately, it prevents missing file data from unexpected power off */
MsgFflush(pFile);
MsgCloseFile(pFile);
return true;
return;
}
- // Remove temporal Mms folder (/opt/usr/data/msg-service/msgdata/*.dir)
+ /* Remove temporal Mms folder */
for (readdir_r(dir, &entry, &d); d != NULL; readdir_r(dir, &entry, &d)) {
if (d->d_type == DT_DIR) {
if ((strcmp(".", d->d_name) == 0) || (strcmp("..", d->d_name) == 0))
continue;
if(strstr(d->d_name, ".dir") != NULL) {
- char filePath[MSG_FILEPATH_LEN_MAX] = {0,};
+ char filePath[MSG_FILEPATH_LEN_MAX] = {0, };
snprintf(filePath, MSG_FILEPATH_LEN_MAX, "%s%s", MSG_DATA_PATH, d->d_name);
MsgRmRf(filePath);
closedir(dir);
}
-//mode : R_OK, W_OK, X_OK, or the existence test F_OK.
+/* mode : R_OK, W_OK, X_OK, or the existence test F_OK. */
bool MsgAccessFile(const char *filepath, int mode)
{
int ret;
return true;
}
-bool MsgCreateFile(const char *pFilePath,char *pData, int DataSize)
+bool MsgCreateFile(const char *pFilePath, char *pData, int DataSize)
{
if(!pFilePath) {
MSG_DEBUG("pFilePath is NULL");
}
MsgFflush(pFile);
- MsgFsync( pFile);
+ MsgFsync(pFile);
MsgCloseFile(pFile);
return true;
return result;
}
-// Encoders
+/* Encoders */
int MsgEncodeCountInfo(MSG_COUNT_INFO_S *pCountInfo, char **ppDest)
{
int dataSize = 0;
memcpy(p, &count, sizeof(int));
p = (void*)((char*)p + sizeof(int));
- for (int i = 0; i < count; i++)
- {
+ for (int i = 0; i < count; i++) {
memcpy(p, &(pRecipientList->recipientAddr[i]), sizeof(MSG_ADDRESS_INFO_S));
p = (void*)((char*)p + sizeof(MSG_ADDRESS_INFO_S));
}
msg_struct_s *folder_info = NULL;
- for (int i = 0; i < count; i++)
- {
+ for (int i = 0; i < count; i++) {
folder_info = (msg_struct_s *)pFolderList->msg_struct_info[i];
memcpy(p, folder_info->data, sizeof(MSG_FOLDER_INFO_S));
p = (void*)((char*)p + sizeof(MSG_FOLDER_INFO_S));
msg_struct_s *filter_info = NULL;
- for (int i = 0; i < count; i++)
- {
+ for (int i = 0; i < count; i++) {
filter_info = (msg_struct_s *)pFilterList->msg_struct_info[i];
memcpy(p, filter_info->data, sizeof(MSG_FILTER_S));
p = (void*)((char*)p + sizeof(MSG_FILTER_S));
msg_struct_s *thread_info = NULL;
- for (int i = 0; i < count; i++)
- {
+ for (int i = 0; i < count; i++) {
thread_info = (msg_struct_s *)pThreadViewList->msg_struct_info[i];
memcpy(p, thread_info->data, sizeof(MSG_THREAD_VIEW_S));
p = (void*)((char*)p + sizeof(MSG_THREAD_VIEW_S));
memcpy(p, &count, sizeof(int));
p = (void*)((char*)p + sizeof(int));
- for (int i = 0; i < count; i++)
- {
+ for (int i = 0; i < count; i++) {
memcpy(p, &(pConvViewList->msg_struct_info[i]), sizeof(msg_struct_list_s));
p = (void*)((char*)p + sizeof(msg_struct_list_s));
}
}
-
-// Decoders
+/* Decoders */
void MsgDecodeMsgId(char *pSrc, msg_message_id_t *pMsgId)
{
memcpy(pMsgId, pSrc, sizeof(msg_message_id_t));
pMsgInfo->addressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S) * pMsgInfo->nAddressCnt];
memset(pMsgInfo->addressList, 0x00, sizeof(MSG_ADDRESS_INFO_S) * pMsgInfo->nAddressCnt);
- for (int i=0; i<pMsgInfo->nAddressCnt; i++) {
+ for (int i = 0; i < pMsgInfo->nAddressCnt; i++) {
memcpy(&(pMsgInfo->addressList[i]), pSrc + (sizeof(MSG_ADDRESS_INFO_S)*i), sizeof(MSG_ADDRESS_INFO_S));
}
}
pSrc = pSrc + sizeof(MSG_SENDINGOPT_INFO_S);
-
if(pMsgInfo->nAddressCnt > 0) {
pMsgInfo->addressList = NULL;
pMsgInfo->addressList = (MSG_ADDRESS_INFO_S *)new char[sizeof(MSG_ADDRESS_INFO_S) * pMsgInfo->nAddressCnt];
memset(pMsgInfo->addressList, 0x00, sizeof(MSG_ADDRESS_INFO_S) * pMsgInfo->nAddressCnt);
- for (int i=0; i<pMsgInfo->nAddressCnt; i++) {
+ for (int i = 0; i < pMsgInfo->nAddressCnt; i++) {
memcpy(&(pMsgInfo->addressList[i]), pSrc + (sizeof(MSG_ADDRESS_INFO_S)*i), sizeof(MSG_ADDRESS_INFO_S));
}
}
memcpy(&count, pSrc, sizeof(int));
pSrc = pSrc + sizeof(int);
- pRecipientList->recipientCnt= count;
+ pRecipientList->recipientCnt = count;
pRecipientList->recipientAddr = (MSG_ADDRESS_INFO_S*)new char[sizeof(MSG_ADDRESS_INFO_S)*count];
MSG_ADDRESS_INFO_S* pInfoTmp = pRecipientList->recipientAddr;
- for (int i = 0; i < count; i++)
- {
+ for (int i = 0; i < count; i++) {
memcpy(pInfoTmp, pSrc, sizeof(MSG_ADDRESS_INFO_S));
pSrc = pSrc + sizeof(MSG_ADDRESS_INFO_S);
pInfoTmp++;
memcpy(&count, pSrc, sizeof(int));
pSrc = pSrc + sizeof(int);
- if( count > 0 )
- {
+ if( count > 0 ) {
pFolderList->nCount = count;
pFolderList->msg_struct_info = (msg_struct_t *)calloc(count, sizeof(msg_struct_t));
- if (pFolderList->msg_struct_info == NULL)
- {
+ if (pFolderList->msg_struct_info == NULL) {
pFolderList->nCount = 0;
return;
}
msg_struct_s *pInfoTmp = NULL;
- for (int i = 0; i < count; i++)
- {
+ for (int i = 0; i < count; i++) {
pFolderList->msg_struct_info[i] = (msg_struct_t )new msg_struct_s;
pInfoTmp = (msg_struct_s *)pFolderList->msg_struct_info[i];
pInfoTmp->type = MSG_STRUCT_FOLDER_INFO;
memcpy(pInfoTmp->data, pSrc, sizeof(MSG_FOLDER_INFO_S));
pSrc = pSrc + sizeof(MSG_FOLDER_INFO_S);
}
- }
- else if ( count == 0 )
- {
+ } else if ( count == 0 ) {
pFolderList->nCount = count;
pFolderList->msg_struct_info = NULL;
}
memcpy(&count, pSrc, sizeof(int));
pSrc = pSrc + sizeof(int);
- if( count > 0 )
- {
+ if( count > 0 ) {
pFilterList->nCount = count;
pFilterList->msg_struct_info = (msg_struct_t *)calloc(count, sizeof(MSG_FILTER_S *));
msg_struct_s *pStructTmp = NULL;
- for (int i = 0; i < count; i++)
- {
+ for (int i = 0; i < count; i++) {
pFilterList->msg_struct_info[i] = (msg_struct_t )new msg_struct_s;
pStructTmp = (msg_struct_s *)pFilterList->msg_struct_info[i];
pStructTmp->type = MSG_STRUCT_FILTER;
memcpy(pStructTmp->data, pSrc, sizeof(MSG_FILTER_S));
pSrc = pSrc + sizeof(MSG_FILTER_S);
}
- }
- else if ( count == 0 )
- {
+ } else if ( count == 0 ) {
pFilterList->nCount = count;
pFilterList->msg_struct_info = NULL;
}
-
}
msg_struct_t *report_status = (msg_struct_t *)new char[sizeof(msg_struct_t)*count];
for (int i = 0; i < count; i++) {
-
msg_struct_s *report_status_item = new msg_struct_s;
report_status_item->type = MSG_STRUCT_REPORT_STATUS_INFO;
report_status_item->data = new MSG_REPORT_STATUS_INFO_S;
memcpy(pThreadInfo, pSrc, sizeof(MSG_THREAD_VIEW_S));
}
-// Event Encoder
+/* Event Encoder */
int MsgMakeEvent(const void *pData, int DataSize, MSG_EVENT_TYPE_T MsgEvent, msg_error_t MsgError, void **ppEvent)
{
MSG_EVENT_S* pMsgEvent = NULL;
}
for (int i = 0; raw[i]; i++) {
-
if (raw[i] == '@') {
onlyNum = false;
{
int ret = 1;
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 1:
case 7:
break;
case 2:
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 0:
case 7:
break;
}
break;
case 3:
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 0:
case 1:
case 2:
}
break;
case 4:
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 0:
case 1:
case 3:
}
break;
case 5:
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 1:
case 2:
case 3:
}
break;
case 6:
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 0:
case 1:
case 2:
}
break;
case 8:
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 1:
case 2:
case 4:
}
break;
case 9:
- switch (src[ret++]-'0')
- {
+ switch (src[ret++]-'0') {
case 0:
case 1:
case 2:
int nameOrder = MsgGetContactNameOrder();
- switch (pSortRule->sortType)
- {
+ switch (pSortRule->sortType) {
case MSG_SORT_BY_DISPLAY_FROM :
if (nameOrder == 0)
snprintf(sql, sizeof(sql), "ORDER BY B.FIRST_NAME %s, B.LAST_NAME %s, B.ADDRESS_VAL, A.DISPLAY_TIME DESC;", order, order);
if (pMsgInfo->dataSize > MAX_MSG_TEXT_LEN) {
pMsgInfo->bTextSms = false;
- // Save Message Data into File
+ /* Save Message Data into File */
char fileName[MSG_FILENAME_LEN_MAX+1];
memset(fileName, 0x00, sizeof(fileName));
gchar *res;
gsize result_len = 0;
const gchar *p;
- result_len = g_utf8_strlen (pszText, -1) + 1; //+1 for malloc of non-terminating chracter
+ result_len = g_utf8_strlen(pszText, -1) + 1; /* +1 for malloc of non-terminating chracter */
res = (gchar *)g_malloc (result_len * sizeof (gchar));
int i = 0;
- for (p = pszText, i = 0; *p != '\0'; p = g_utf8_next_char (p), i++) {
- res[i] = isascii(g_utf8_get_char (p)) ? *p : replacementChar;
+ for (p = pszText, i = 0; *p != '\0'; p = g_utf8_next_char(p), i++) {
+ res[i] = isascii(g_utf8_get_char(p)) ? *p : replacementChar;
}
res[i] = '\0';
return res;
/* 151 */
{"video/mpeg4", "mp4", true, MIME_VIDEO_MPEG4, MIME_VIDEO_MP4, MIME_APPLICATION_MEDIAPLAYER, MIME_MAINTYPE_VIDEO, UNDEFINED_BINARY },
{"video/mp4", "mp4", true, MIME_VIDEO_MP4, MIME_VIDEO_MP4, MIME_APPLICATION_MEDIAPLAYER, MIME_MAINTYPE_VIDEO, UNDEFINED_BINARY },
- {"video/h263", ""/*,3gpp,mp4"*/,true, MIME_VIDEO_H263, MIME_VIDEO_H263, MIME_APPLICATION_MEDIAPLAYER, MIME_MAINTYPE_VIDEO, UNDEFINED_BINARY },
+ {"video/h263", ""/*,3gpp,mp4"*/, true, MIME_VIDEO_H263, MIME_VIDEO_H263, MIME_APPLICATION_MEDIAPLAYER, MIME_MAINTYPE_VIDEO, UNDEFINED_BINARY },
{"video/3gpp", "3gp"/*,3gpp"*/, true, MIME_VIDEO_3GPP, MIME_VIDEO_3GPP, MIME_APPLICATION_MEDIAPLAYER, MIME_MAINTYPE_VIDEO, UNDEFINED_BINARY },
{"video/3gp", "3gp"/*,3gpp"*/, true, MIME_VIDEO_3GP, MIME_VIDEO_3GP, MIME_APPLICATION_MEDIAPLAYER, MIME_MAINTYPE_VIDEO, UNDEFINED_BINARY },
{"video/avi", "avi", false, MIME_VIDEO_AVI, MIME_VIDEO_AVI, MIME_APPLICATION_MEDIAPLAYER, MIME_MAINTYPE_VIDEO, UNDEFINED_BINARY },
{"video/x-ms-wmv", "wmv", true, MIME_VIDEO_X_MS_WMV, MIME_VIDEO_X_MS_WMV, MIME_APPLICATION_MEDIAPLAYER, MIME_MAINTYPE_VIDEO, UNDEFINED_BINARY },
{"video/x-ms-asf", "asf", true, MIME_VIDEO_X_MS_ASF, MIME_VIDEO_X_MS_ASF, MIME_APPLICATION_MEDIAPLAYER, MIME_MAINTYPE_VIDEO, UNDEFINED_BINARY },
{"video/x-pv-pvx", "pvx", true, MIME_VIDEO_X_PV_PVX, MIME_VIDEO_X_PV_PVX, MIME_APPLICATION_MEDIAPLAYER, MIME_MAINTYPE_VIDEO, UNDEFINED_BINARY }
-
};
/********** MIME table information ***********/
index = (mime & 0x003f);
/* If 'type' is zero, mimeTableIndex's array value have a minus value */
- // If 'type' is zero, mime type is '*\/*'
+ /* If 'type' is zero, mime type is '\*\/\*' */
if (type == 0)
tableIndex = 0;
else
return MIME_UNKNOWN;
}
- szMIMEType = (char * )malloc(strlen(szMime) + 1);
+ szMIMEType = (char *)malloc(strlen(szMime) + 1);
if (szMIMEType == NULL) {
MSG_DEBUG("szMime is NULL");
#define EXT_TABLE_SIZE (58)
const ExtTableItem extTable[EXT_TABLE_SIZE] = {
-
/* text */
{"txt", MIME_MAINTYPE_TEXT, MIME_TEXT_PLAIN, "text/plain"},
{"html", MIME_MAINTYPE_TEXT, MIME_TEXT_HTML, "text/html"},
{"ro", MIME_MAINTYPE_APPLICATION, MIME_APPLICATION_VND_OMA_DRM_RIGHTS_WBXML, "application/vnd.oma.drm.rights+wbxml"},
{"oro", MIME_MAINTYPE_APPLICATION, MIME_APPLICATION_VND_OMA_DRM_RO_XML, "application/vnd.oma.drm.ro+xml"},
{"odf", MIME_MAINTYPE_APPLICATION, MIME_APPLICATION_VND_OMA_DRM_DCF, "application/vnd.oma.drm.dcf"},
-
};
/* GetMimeType from File Extension */
int extTableMainSize = sizeof(extTable)/sizeof(ExtTableItem);
for (int i = 0; i < extTableMainSize; i++) {
-
if (strcasecmp(extTable[i].szExt, pExt) == 0) {
-
matchedItem = &extTable[i];
if (mainType == extTable[i].mainType) {
metadata_extractor_destroy(metadata);
return false;
-}
\ No newline at end of file
+}
#include "MsgUtilFunction.h"
#include "MsgUtilStorage.h"
-//#include <sys/stat.h>
-//#include <sys/vfs.h>
#include <storage.h>
static int msgCntLimit[MSG_COUNT_LIMIT_MAILBOX_TYPE_MAX][MSG_COUNT_LIMIT_MSG_TYPE_MAX] = {{10, 10, 0, 10, 10}, {5, 10, 0, 0, 0}, {10, 10, 0, 0, 0}, {10, 10, 0, 0, 0}, {0, 0, 10, 0, 0}};
char* pFileData = NULL;
unique_ptr<char*, void(*)(char**)> buf(&pFileData, unique_ptr_deleter);
- // Get File Data
+ /* Get File Data */
if (pMsgInfo->bTextSms == false) {
if (MsgOpenAndReadFile(pMsgInfo->msgData, &pFileData, &fileSize) == false)
return 0;
char *imsi = MsgSettingGetString(keyName);
- // Add Message
+ /* Add Message */
char sqlQuery[MAX_QUERY_LEN+1];
memset(sqlQuery, 0x00, sizeof(sqlQuery));
pDbHandle->bindText(pFileData, 2);
else
pDbHandle->bindText(pMsgInfo->msgText, 2);
-
}
if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE) {
if (pDbHandle->execQuery(sqlQuery) != MSG_SUCCESS)
return MSG_ERR_DB_EXEC;
- // Get MAIN_TYPE, SUB_TYPE, STORAGE_ID
+ /* Get MAIN_TYPE, SUB_TYPE, STORAGE_ID */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.MAIN_TYPE, A.SUB_TYPE, B.CONV_ID \
FROM %s A, %s B WHERE A.MSG_ID = %d AND A.CONV_ID = B.CONV_ID;",
if (freeSpace < SMS_MINIMUM_SPACE && pMsgType->mainType == MSG_SMS_TYPE)
err = MSG_ERR_MESSAGE_COUNT_FULL;
- else if(freeSpace < MMS_MINIMUM_SPACE && pMsgType->mainType == MSG_MMS_TYPE)
+ else if (freeSpace < MMS_MINIMUM_SPACE && pMsgType->mainType == MSG_MMS_TYPE)
err = MSG_ERR_MESSAGE_COUNT_FULL;
}
char sqlQuery[MAX_QUERY_LEN+1];
memset(sqlQuery, 0x00, sizeof(sqlQuery));
- if ((pMsgType->mainType == MSG_SMS_TYPE) && (pMsgType->subType == MSG_WAP_SI_SMS ||pMsgType->subType == MSG_WAP_SL_SMS)) { // PUSH
+ if ((pMsgType->mainType == MSG_SMS_TYPE) && (pMsgType->subType == MSG_WAP_SI_SMS ||pMsgType->subType == MSG_WAP_SL_SMS)) { /* PUSH */
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d, %d) AND FOLDER_ID = %d;",
MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_WAP_SI_SMS, MSG_WAP_SL_SMS, MSG_INBOX_ID);
- } else if ((pMsgType->mainType == MSG_SMS_TYPE) && (pMsgType->subType == MSG_CB_SMS)) { // CB
+ } else if ((pMsgType->mainType == MSG_SMS_TYPE) && (pMsgType->subType == MSG_CB_SMS)) { /* CB */
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d) AND FOLDER_ID = %d;",
MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_CB_SMS, MSG_CBMSGBOX_ID);
- } else if ((pMsgType->mainType == MSG_SMS_TYPE) && (pMsgType->subType == MSG_SYNCML_CP)) { // Provision
+ } else if ((pMsgType->mainType == MSG_SMS_TYPE) && (pMsgType->subType == MSG_SYNCML_CP)) { /* Provision */
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d) AND FOLDER_ID = %d;",
MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_SYNCML_CP, MSG_INBOX_ID);
- } else if ((pMsgType->mainType == MSG_SMS_TYPE)) { // SMS
+ } else if ((pMsgType->mainType == MSG_SMS_TYPE)) { /* SMS */
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE NOT IN (%d, %d, %d, %d) AND FOLDER_ID = %d;",
- MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_WAP_SI_SMS, MSG_WAP_SL_SMS, MSG_CB_SMS, MSG_SYNCML_CP, MSG_INBOX_ID); // etc SMS
+ MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_WAP_SI_SMS, MSG_WAP_SL_SMS, MSG_CB_SMS, MSG_SYNCML_CP, MSG_INBOX_ID); /* etc SMS */
} else if ((pMsgType->mainType == MSG_MMS_TYPE) &&
(pMsgType->subType == MSG_SENDREQ_MMS || pMsgType->subType == MSG_SENDCONF_MMS || pMsgType->subType == MSG_RETRIEVE_AUTOCONF_MMS ||
- pMsgType->subType == MSG_RETRIEVE_MANUALCONF_MMS || pMsgType->subType == MSG_NOTIFICATIONIND_MMS)) { // MMS
+ pMsgType->subType == MSG_RETRIEVE_MANUALCONF_MMS || pMsgType->subType == MSG_NOTIFICATIONIND_MMS)) { /* MMS */
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT COUNT(MSG_ID) FROM %s WHERE MAIN_TYPE = %d AND SUB_TYPE IN (%d, %d, %d, %d, %d) AND FOLDER_ID = %d;",
MSGFW_MESSAGE_TABLE_NAME, pMsgType->mainType, MSG_SENDREQ_MMS, MSG_SENDCONF_MMS, MSG_RETRIEVE_AUTOCONF_MMS, MSG_RETRIEVE_MANUALCONF_MMS, MSG_NOTIFICATIONIND_MMS, folderId);
} else {
int MsgStoCheckMsgCntLimit(const MSG_MESSAGE_TYPE_S* pMsgType, msg_folder_id_t folderId)
{
int msgboxType = -1;
- int msgType= -1;
+ int msgType = -1;
- switch (folderId)
- {
+ switch (folderId) {
case MSG_INBOX_ID :
msgboxType = MSG_COUNT_LIMIT_INBOX_TYPE;
break;
return -1;
}
- switch (pMsgType->subType)
- {
+ switch (pMsgType->subType) {
case MSG_NORMAL_SMS:
case MSG_REPLACE_TYPE1_SMS:
case MSG_REPLACE_TYPE2_SMS:
char sqlQuery[MAX_QUERY_LEN+1];
- // Check if new address or not
+ /* Check if new address or not */
if (MsgExistAddress(pDbHandle, pMsg, pConvId) == true) {
MSG_DEBUG("The address already exists. Conversation ID : [%d]", *pConvId);
MsgStoUpdateAddress(pDbHandle, pMsg, *pConvId);
} else {
-
*pConvId = 0;
if (pMsg->threadId)
}
/* insert address in loop */
- for (int i=0; i<pMsg->nAddressCnt; i++) {
-
+ for (int i = 0; i < pMsg->nAddressCnt; i++) {
unsigned int addrId;
MSG_CONTACT_INFO_S contactInfo;
memset(&contactInfo, 0x00, sizeof(MSG_CONTACT_INFO_S));
- // Get Contact Info
-// if (MsgGetContactInfo(&(pMsg->addressList[i]), &contactInfo) != MSG_SUCCESS) {
-// MSG_DEBUG("MsgGetContactInfo() fail.");
-// }
+ /* Get Contact Info */
+#if 0
+ if (MsgGetContactInfo(&(pMsg->addressList[i]), &contactInfo) != MSG_SUCCESS) {
+ MSG_DEBUG("MsgGetContactInfo() fail.");
+ }
+#endif
err = pDbHandle->getRowId(MSGFW_ADDRESS_TABLE_NAME, &addrId);
if (err != MSG_SUCCESS) {
return err;
}
- // Add Address
+ /* Add Address */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, %d, %d, %d, '%s', %d, %d, ?, ?, ?, ?, ?, '%s', 0);",
MSGFW_ADDRESS_TABLE_NAME, addrId, *pConvId, pMsg->addressList[i].addressType, pMsg->addressList[i].recipientType, pMsg->addressList[i].addressVal,
}
}
- // set conversation display name by conv id
+ /* set conversation display name by conv id */
MsgStoSetConversationDisplayName(pDbHandle, *pConvId);
return err;
memset(pTmp->data, 0x00, sizeof(MSG_ADDRESS_INFO_S));
}
-// rowCnt = (rowCnt > 10)? MAX_TO_ADDRESS_CNT: rowCnt;
+/* rowCnt = (rowCnt > 10)? MAX_TO_ADDRESS_CNT: rowCnt; */
for (int i = 0; i < rowCnt; i++) {
pTmp = (msg_struct_s *)pAddrlist->msg_struct_info[i];
pDbHandle->getColumnToString(index++, MAX_ADDRESS_VAL_LEN, pAddr->addressVal);
strncpy(pAddr->displayName, pAddr->addressVal, MAX_DISPLAY_NAME_LEN);
-
}
pDbHandle->freeTable();
int msg_direction = pDbHandle->columnInt(2);
time_t disp_time = (time_t)pDbHandle->columnInt(3);
int subject_length = pDbHandle->columnInt(4);
- char subject[MAX_SUBJECT_LEN+1] = {0,};
+ char subject[MAX_SUBJECT_LEN+1] = {0, };
snprintf(subject, sizeof(subject), "%s", pDbHandle->columnText(5));
- char msg_text[MAX_MSG_TEXT_LEN+1] = {0,};
+ char msg_text[MAX_MSG_TEXT_LEN+1] = {0, };
snprintf(msg_text, sizeof(msg_text), "%s", pDbHandle->columnText(6));
pDbHandle->finalizeQuery();
}
pDbHandle->bindText(subject, 1);
- pDbHandle->bindText(msg_text,2);
+ pDbHandle->bindText(msg_text, 2);
if (pDbHandle->stepQuery() != MSG_ERR_DB_DONE) {
MSG_DEBUG("stepQuery() Failed");
snprintf(sqlQuery+tmpSize, MAX_QUERY_LEN-tmpSize, " OR ");
} else {
-
tmpSize = strlen(sqlQuery);
snprintf(sqlQuery+tmpSize, MAX_QUERY_LEN-tmpSize,
"ADDRESS_VAL LIKE '%s' ",
tmpSize = strlen(sqlQuery);
snprintf(sqlQuery+tmpSize, MAX_QUERY_LEN-tmpSize, " OR ");
-
}
}
return MSG_ERR_DB_EXEC;
}
}
- // Add Conversation
+ /* Add Conversation */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "INSERT INTO %s VALUES (%d, 0, 0, 0, 0, 0, 0, 0, '', '');",
MSGFW_CONVERSATION_TABLE_NAME, *pConvId);
return err;
}
- //contacts-service is not used for gear
+ /*contacts-service is not used for gear */
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
int order = MsgGetContactNameOrder();
-#else // MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#else /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
int order = 0;
-#endif // MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
msg_struct_s *pAddrInfo = NULL;
MSG_ADDRESS_INFO_S *address = NULL;
- for (int i = 1; i <= rowCnt; i++)
- {
+ for (int i = 1; i <= rowCnt; i++) {
memset(displayName, 0x00, sizeof(displayName));
MsgDbHandler tmpDbHandle;
- msg_struct_list_s addressList = {0,};
+ msg_struct_list_s addressList = {0, };
MsgStoGetAddressByConvId(&tmpDbHandle, (msg_thread_id_t)pDbHandle->getColumnToInt(i), order, &addressList);
- for (int j = 0; j < addressList.nCount; j++)
- {
+ for (int j = 0; j < addressList.nCount; j++) {
if (j >0)
strncat(displayName, ", ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
pDbHandle->finalizeQuery();
- // free address list
+ /* free address list */
for (int j = 0; j < addressList.nCount; j++) {
msg_struct_s *pStruct = (msg_struct_s *)addressList.msg_struct_info[j];
delete (MSG_ADDRESS_INFO_S *)pStruct->data;
char displayName[MAX_DISPLAY_NAME_LEN+1];
char sqlQuery[MAX_QUERY_LEN+1];
- msg_struct_list_s addressList = {0,};
+ msg_struct_list_s addressList = {0, };
- //contacts-service is not used for gear
+ /* contacts-service is not used for gear */
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
int order = MsgGetContactNameOrder();
-#else // MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#else /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
int order = 0;
-#endif // MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
msg_struct_s *pAddrInfo = NULL;
MSG_ADDRESS_INFO_S *address = NULL;
MsgStoGetAddressByConvId(pDbHandle, convId, order, &addressList);
- for (int j = 0; j < addressList.nCount; j++)
- {
+ for (int j = 0; j < addressList.nCount; j++) {
if (j >0)
strncat(displayName, ", ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
if (err == MSG_ERR_DB_NORECORD) {
pDbHandle->freeTable();
return false;
- }
- else if ( err != MSG_SUCCESS) {
+ } else if (err != MSG_SUCCESS) {
pDbHandle->freeTable();
return false;
}
err = pDbHandle->getTable(sqlQuery, &rowCnt, NULL);
- if ( err != MSG_SUCCESS) {
+ if (err != MSG_SUCCESS) {
pDbHandle->freeTable();
return false;
}
"SELECT ADDRESS_ID FROM %s WHERE ADDRESS_VAL LIKE '%%%%%s' AND CONV_ID= %d;",
MSGFW_ADDRESS_TABLE_NAME, newPhoneNum, convId);
} else {
-
snprintf(sqlQuery, sizeof(sqlQuery),
"SELECT ADDRESS_ID FROM %s WHERE ADDRESS_VAL = '%s' AND CONV_ID= %d;",
MSGFW_ADDRESS_TABLE_NAME, pMsg->addressList[index].addressVal, convId);
pDbHandle->freeTable();
return false;
}
- else if ( err != MSG_SUCCESS) {
+ else if (err != MSG_SUCCESS) {
pDbHandle->freeTable();
return false;
}
#ifndef FEATURE_SMS_CDMA
MSG_BEGIN();
- char sqlQuery[MAX_QUERY_LEN] = {0,};
+ char sqlQuery[MAX_QUERY_LEN] = {0, };
pDbHandle->beginTrans();
#else /* TODO: Add multisim for CDMA */
MSG_BEGIN();
- char sqlQuery[MAX_QUERY_LEN] = {0,};
+ char sqlQuery[MAX_QUERY_LEN] = {0, };
pDbHandle->beginTrans();
int rowCnt = 0, index = 0;
- char sqlQuery[MAX_QUERY_LEN] = {0,};
+ char sqlQuery[MAX_QUERY_LEN] = {0, };
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT CHANNEL_ACTIVATION, CHANNEL_FROM, CHANNEL_TO, CHANNEL_NAME FROM %s WHERE SIM_INDEX = %d;", MSGFW_CB_CHANNEL_INFO_TABLE_NAME, simIndex);
int rowCnt = 0, index = 0;
- char sqlQuery[MAX_QUERY_LEN] = {0,};
+ char sqlQuery[MAX_QUERY_LEN] = {0, };
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT CHANNEL_ACTIVATION, CHANNEL_CATEGORY, CHANNEL_LANGUAGE, CHANNEL_NAME FROM %s;", MSGFW_CDMA_CB_CHANNEL_INFO_TABLE_NAME);
if (pConv == NULL)
return MSG_ERR_NULL_POINTER;
- pConv->tcs_bc_level = -1; //init
+ pConv->tcs_bc_level = -1; /* init */
- //(MSG_ID INTEGER, TYPE INTEGER, VALUE TEXT, COUNT INTEGER)
+ /*(MSG_ID INTEGER, TYPE INTEGER, VALUE TEXT, COUNT INTEGER) */
snprintf(sqlQuery, sizeof(sqlQuery),
"SELECT TYPE, VALUE, COUNT "
"FROM %s WHERE MSG_ID=%d;",
if (err == MSG_SUCCESS) {
GList *multipart_list = NULL;
for (int i = 0; i < rowCnt; i++) {
-
msg_struct_s *multipart_struct_s = new msg_struct_s;
multipart_struct_s->type = MSG_STRUCT_MULTIPART_INFO;
multipart_struct_s->data = new MMS_MULTIPART_DATA_S;
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID, CONV_ID, FOLDER_ID, STORAGE_ID, MAIN_TYPE, SUB_TYPE, \
DISPLAY_TIME, DATA_SIZE, NETWORK_STATUS, READ_STATUS, PROTECTED, \
MSG_DIRECTION, SCHEDULED_TIME, SUBJECT, MSG_TEXT, ATTACHMENT_COUNT, SIM_INDEX\
- FROM %s WHERE MSG_ID=%d;",
+ FROM %s WHERE MSG_ID = %d;",
MSGFW_MESSAGE_TABLE_NAME, msgId);
msg_error_t err = dbHandle->getTable(sqlQuery, &rowCnt, &index);
dbHandle->getColumnToString(index++, MAX_SUBJECT_LEN, pConv->subject);
char *tmpText = g_strdup(dbHandle->getColumnToString(index++));
- //It does Not need to Get attach count in MSG_MESSAGE_TABLE. see MsgStoGetConversationPreview
- //pConv->attachCount = dbHandle->getColumnToInt(index++);
+ /*It does Not need to Get attach count in MSG_MESSAGE_TABLE. see MsgStoGetConversationPreview */
+ /*pConv->attachCount = dbHandle->getColumnToInt(index++); */
index++;
pConv->simIndex = dbHandle->getColumnToInt(index++);
pTmp->bRead = dbHandle->getColumnToInt(index++);
pTmp->bProtected = dbHandle->getColumnToInt(index++);
pTmp->direction = dbHandle->getColumnToInt(index++);
- index++; // This field is reserved.
+ index++; /* This field is reserved. */
dbHandle->getColumnToString(index++, MAX_SUBJECT_LEN, pTmp->subject);
tmpText[i] = g_strdup(dbHandle->getColumnToString(index++));
- //It does Not need to Get attach count in MSG_MESSAGE_TABLE. see MsgStoGetConversationPreview
- //pTmp->attachCount = dbHandle->getColumnToInt(index++);
+ /*It does Not need to Get attach count in MSG_MESSAGE_TABLE. see MsgStoGetConversationPreview */
+ /*pTmp->attachCount = dbHandle->getColumnToInt(index++); */
index++;
pTmp->simIndex = dbHandle->getColumnToInt(index++);
}
dbHandle->connectReadOnly();
char *escapeAddressStr = NULL;
- // Clear Out Parameter
+ /* Clear Out Parameter */
pThreadViewList->nCount = 0;
pThreadViewList->msg_struct_info = NULL;
char sqlQuery[MAX_QUERY_LEN+1];
- // Search - Address, Name
+ /* Search - Address, Name */
memset(sqlQuery, 0x00, MAX_QUERY_LEN+1);
snprintf(sqlQuery, MAX_QUERY_LEN, "SELECT A.CONV_ID, A.UNREAD_CNT, A.SMS_CNT, A.MMS_CNT, A.DISPLAY_NAME, "
"A.MAIN_TYPE, A.SUB_TYPE, A.MSG_DIRECTION, A.DISPLAY_TIME, A.MSG_TEXT, "
MsgConvertStrWithEscape(pSearchString, &escapeAddressStr);
MSG_DEBUG("escapeAddressStr [%s]", escapeAddressStr);
dbHandle->bindText(escapeAddressStr, 1);
- //dbHandle->bindText(escapeAddressStr, 2);
- //dbHandle->bindText(escapeAddressStr, 3);
- //dbHandle->bindText(escapeAddressStr, 4);
+ /*dbHandle->bindText(escapeAddressStr, 2); */
+ /*dbHandle->bindText(escapeAddressStr, 3); */
+ /*dbHandle->bindText(escapeAddressStr, 4); */
while (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
memset(&threadView, 0x00, sizeof(threadView));
IdList.insert(threadView.threadId);
searchList.push(threadView);
}
-
}
dbHandle->finalizeQuery();
}
- // Add data to Out Parameter
+ /* Add data to Out Parameter */
pThreadViewList->nCount = searchList.size();
pThreadViewList->msg_struct_info = (msg_struct_t *)calloc(searchList.size(), sizeof(msg_struct_t));
if (pThreadViewList->msg_struct_info == NULL)
MsgDbHandler *dbHandle = getDbHandle();
dbHandle->connectReadOnly();
- // Clear Out Parameter
+ /* Clear Out Parameter */
pRejectMsgList->nCount = 0;
pRejectMsgList->msg_struct_info = NULL;
char sqlQuery[MAX_QUERY_LEN+1];
- // Search Reject Msg
+ /* Search Reject Msg */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
if (pNumber != NULL) {
msg_error_t err = MSG_SUCCESS;
- //contacts-service is not used for gear
+ /* contacts-service is not used for gear */
#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
int order = MsgGetContactNameOrder();
-#else // MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#else /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
int order = 0;
-#endif // MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
err = MsgStoGetAddressByConvId(dbHandle, threadId, order, pAddrList);
MsgDbHandler *dbHandle = getDbHandle();
dbHandle->connectReadOnly();
- // Clear Out Parameter
+ /* Clear Out Parameter */
pMsgList->nCount = 0;
pMsgList->msg_struct_info = NULL;
if (pListCond->pTextVal != NULL && multipartCnt > 0) {
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
- snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "FROM %s C, %s B, %s A WHERE A.CONV_ID > 0 AND A.CONV_ID = B.CONV_ID AND "
- ,MSGFW_MMS_MULTIPART_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
+ snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "FROM %s C, %s B, %s A WHERE A.CONV_ID > 0 AND A.CONV_ID = B.CONV_ID AND ",
+ MSGFW_MMS_MULTIPART_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME);
}
else {
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
- //// folder
+ /* folder */
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
if (pListCond->folderId == MSG_ALLBOX_ID)
strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
- //// thread
+ /* thread */
if (pListCond->threadId > 0) {
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND A.CONV_ID = %d ", pListCond->threadId);
}
- //// msg type
+ /* msg type */
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
switch (pListCond->msgType) {
strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
- //// storage
+ /* storage */
if (pListCond->storageId > MSG_STORAGE_UNKNOWN) {
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND A.STORAGE_ID = %d ", pListCond->storageId);
}
- //// protected
+ /* protected */
if (pListCond->bProtected) {
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND A.PROTECTED = %d ", pListCond->bProtected);
}
- //// scheduled
+ /* scheduled */
if (pListCond->bScheduled) {
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND A.SCHEDULED_TIME > 0 ");
}
- //// sim index
+ /* sim index */
if (pListCond->simIndex > 0) {
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND A.SIM_INDEX = %d ", pListCond->simIndex);
}
- //// time range
+ /* time range */
if (pListCond->fromTime > 0) {
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "AND A.DISPLAY_TIME >= %u ", (unsigned int)pListCond->fromTime);
}
if (pListCond->pAddressVal == NULL) {
- /// Text
+ /* Text */
if (pListCond->pTextVal != NULL) {
-
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
if (multipartCnt > 0) {
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset),
MSGFW_DB_ESCAPE_CHAR, MSGFW_DB_ESCAPE_CHAR);
}
strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
-
}
} else {
- /// Text
+ /* Text */
if (pListCond->pTextVal != NULL) {
-
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
if (multipartCnt > 0) {
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset),
}
strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
- // Address
+ /* Address */
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset),
"(B.ADDRESS_VAL LIKE ? ESCAPE '%c' ", MSGFW_DB_ESCAPE_CHAR);
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), ")) ");
strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
} else {
- // Address
+ /* Address */
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset),
"AND (B.ADDRESS_VAL LIKE ? ESCAPE '%c' ", MSGFW_DB_ESCAPE_CHAR);
msg_struct_s *pSortRule = (msg_struct_s *)pListCond->sortRule;
if (pSortRule->type != MSG_STRUCT_SORT_RULE) {
- /// Order
+ /* Order */
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "ORDER BY A.DISPLAY_TIME ");
strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
- /// Sorting type
+ /* Sorting type */
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "DESC ");
strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
} else {
MSG_SORT_RULE_S *pTmp = (MSG_SORT_RULE_S *)pSortRule->data;
- /// order // TODO: have to finish this
+ /* order : TODO: have to finish this */
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
- switch (pTmp->sortType)
- {
- case MSG_SORT_BY_MSG_TYPE :
+ switch (pTmp->sortType) {
+ case MSG_SORT_BY_MSG_TYPE:
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "ORDER BY A.MAIN_TYPE ");
break;
- case MSG_SORT_BY_READ_STATUS :
+ case MSG_SORT_BY_READ_STATUS:
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "ORDER BY A.READ_STATUS ");
break;
- case MSG_SORT_BY_STORAGE_TYPE :
+ case MSG_SORT_BY_STORAGE_TYPE:
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "ORDER BY A.STORAGE_ID ");
break;
default:
}
strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
- // Sorting type
+ /* Sorting type */
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
if (pTmp->bAscending)
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "ASC ");
strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
}
- // offset & limit
+ /* offset & limit */
memset(sqlQuerySubset, 0x00, sizeof(sqlQuerySubset));
if (pListCond->offset >= 0 && pListCond->limit > 0)
snprintf(sqlQuerySubset, sizeof(sqlQuerySubset), "LIMIT %d OFFSET %d;", pListCond->limit, pListCond->offset);
strncat(sqlQuery, sqlQuerySubset, MAX_QUERY_LEN-strlen(sqlQuery));
- //////// 'til here sqlQuery is complete.
+ /* 'til here sqlQuery is complete. */
queue<MSG_MESSAGE_HIDDEN_S*> searchList;
char *escapeAddressStr = NULL;
if (pListCond->pAddressVal == NULL) {
- /// Text
+ /* Text */
if (pListCond->pTextVal != NULL) {
-
MsgConvertStrWithEscape(pListCond->pTextVal, &escapeTextStr);
MSG_DEBUG("escapeTextStr [%s]", escapeTextStr);
dbHandle->bindText(escapeTextStr, 1);
dbHandle->bindText(escapeTextStr, 2);
if (multipartCnt > 0) dbHandle->bindText(escapeTextStr, 3);
-
}
} else {
- /// Text
+ /* Text */
if (pListCond->pTextVal != NULL) {
-
MsgConvertStrWithEscape(pListCond->pTextVal, &escapeTextStr);
MSG_DEBUG("escapeTestStr [%s]", escapeTextStr);
- // Address
+ /* Address */
MsgConvertStrWithEscape(pListCond->pAddressVal, &escapeAddressStr);
MSG_DEBUG("escapeAddressStr [%s]", escapeAddressStr);
}
} else {
- // Address
+ /* Address */
MsgConvertStrWithEscape(pListCond->pAddressVal, &escapeAddressStr);
MSG_DEBUG("escapeAddressStr [%s]", escapeAddressStr);
dbHandle->bindText(escapeAddressStr, 1);
MSG_MESSAGE_HIDDEN_S *pTmp = NULL;
- int lastMsgId = 0; // for comparing same msg id.
+ int lastMsgId = 0; /* for comparing same msg id. */
while (dbHandle->stepQuery() == MSG_ERR_DB_ROW) {
-
index = 0;
int msgid = dbHandle->columnInt(index++);
pTmp = new MSG_MESSAGE_HIDDEN_S;
- if(pTmp)
- {
+ if(pTmp) {
memset(pTmp, 0x00, sizeof(MSG_MESSAGE_HIDDEN_S));
pTmp->pData = NULL;
pTmp->bBackup = dbHandle->columnInt(index++);
pTmp->priority = dbHandle->columnInt(index++);
pTmp->direction = dbHandle->columnInt(index++);
- index++; // This field is reserved.
+ index++; /* This field is reserved. */
strncpy(pTmp->subject, (char *)dbHandle->columnText(index++), MAX_SUBJECT_LEN);
strncpy(pAddr->displayName, pAddr->addressVal, MAX_DISPLAY_NAME_LEN);
- // For GList *addressList
+ /* For GList *addressList */
msg_struct_s *addr_info_s = new msg_struct_s;
memset(addr_info_s, 0x00, sizeof(msg_struct_s));
addr_info_s->type = MSG_STRUCT_ADDRESS_INFO;
pTmp->addressList = g_list_append(pTmp->addressList, addr_info_s);
if (pTmp->addr_list->nCount >= MAX_TO_ADDRESS_CNT) {
-
delete pAddr;
} else {
int offset = 0;
while (!searchList.empty()) {
-
msg_struct_s *msg = new msg_struct_s;
pMsgList->msg_struct_info[offset++] = (msg_struct_t)msg;
MsgDbHandler *dbHandle = getDbHandle();
- char sqlQuery[MAX_QUERY_LEN+1] = {0,};
+ char sqlQuery[MAX_QUERY_LEN+1] = {0, };
snprintf(sqlQuery, sizeof(sqlQuery), "DELETE FROM %s WHERE MSG_ID = 0", MSGFW_UNIQUENESS_INFO_TABLE_NAME);
err = dbHandle->execQuery(sqlQuery);
enum {
- // vMessage
+ /* vMessage */
VMSG_VALUE_NONE = 0,
BEGIN_VMSG = 1,
- VERSION_VMSG =2,
+ VERSION_VMSG = 2,
BEGIN_VCARD = 3,
VERSION_VCARD = 4,
END_VCARD = 5,
TEL_VCARD_CELL = 14,
DATE_VMSG = 15,
- SUBJECT_VMSG =16 ,
+ SUBJECT_VMSG = 16,
FNAME_UTF8_VCARD = 17,
NAME_UTF8_VCARD = 18,
- // Encodings
+ /* Encodings */
VMSG_ATTR_ENCODING_QP = 19,
VMSG_ATTR_ENCODING_BASE64_V21 = 20,
VMSG_ATTR_ENCODING_BASE64_V30 = 21,
- // Message type indication
+ /* Message type indication */
VMSG_INDICATION_MESSAGE_TYPE = 22,
VMSG_INDICATION_MESSAGE_TYPE_INET = 23,
VMSG_INDICATION_MESSAGE_TYPE_MSG = 24,
- // Read status indication
+ /* Read status indication */
VMSG_INDICATION_READ_STATUS = 25,
VMSG_INDICATION_READ_STATUS_READ = 26,
VMSG_INDICATION_READ_STATUS_UNREAD = 27,
- // Mailbox status indication
+ /* Mailbox status indication */
VMSG_INDICATION_MSG_BOX = 28,
VMSG_INDICATION_MSG_BOX_SENT = 29,
VMSG_INDICATION_MSG_BOX_INBOX = 30,
VMSG_INDICATION_MSG_BOX_DRAFT = 31,
- // Character set
+ /* Character set */
VMSG_ATTR_CHARSET_PROPERTY = 32,
- // Language
+ /* Language */
VMSG_ATTR_LANGUAGE_PROPERTY = 33,
VMSG_DATA_SEPARATOR = 34,
KEY_BODY = 39,
KEY_DATE = 40,
- //DECODER
+ /* DECODER */
VMSG_VCARD_TEL = 41,
VMSG_MSG_BEGIN = 42,
VMSG_MSG_END = 43,
static void __msgsvc_vmsg_initial(void)
{
if (NULL == *content_name) {
-
- // vMessage
+ /* vMessage */
content_name[BEGIN_VMSG] = "BEGIN:VMSG";
content_name[VERSION_VMSG] = "VERSION:1.1";
content_name[BEGIN_VCARD] = "BEGIN:VCARD";
content_name[FNAME_UTF8_VCARD] = "FN;CHARSET=UTF-8:";
content_name[NAME_UTF8_VCARD] = "N;CHARSET=UTF-8:";
- // Encodings
+ /* Encodings */
content_name[VMSG_ATTR_ENCODING_QP] = "ENCODING=QUOTED-PRINTABLE";
content_name[VMSG_ATTR_ENCODING_BASE64_V21] = "ENCODING=BASE64";
content_name[VMSG_ATTR_ENCODING_BASE64_V30] = "ENCODING=b";
- // Message type indication
+ /* Message type indication */
content_name[VMSG_INDICATION_MESSAGE_TYPE] = "X-IRMC-TYPE";
content_name[VMSG_INDICATION_MESSAGE_TYPE_INET] = "INET";
content_name[VMSG_INDICATION_MESSAGE_TYPE_MSG] = "MSG";
- // Read status indication
+ /* Read status indication */
content_name[VMSG_INDICATION_READ_STATUS] = "X-IRMC-STATUS";
content_name[VMSG_INDICATION_READ_STATUS_READ] = "READ";
content_name[VMSG_INDICATION_READ_STATUS_UNREAD] = "UNREAD";
- // Mailbox status indication
+ /* Mailbox status indication */
content_name[VMSG_INDICATION_MSG_BOX] = "X-IRMC-BOX";
content_name[VMSG_INDICATION_MSG_BOX_SENT] = "SENT";
content_name[VMSG_INDICATION_MSG_BOX_INBOX] = "INBOX";
content_name[VMSG_INDICATION_MSG_BOX_DRAFT] = "DRAFT";
- // Character set
+ /* Character set */
content_name[VMSG_ATTR_CHARSET_PROPERTY] = "CHARSET";
- // Language
+ /* Language */
content_name[VMSG_ATTR_LANGUAGE_PROPERTY] = "LANGUAGE";
content_name[VMSG_DATA_SEPARATOR] = ":";
*r = '\\';
r++;
str_len++;
- if (*buf_size<str_len+len+1) {
+ if (*buf_size < str_len+len+1) {
*buf_size = *buf_size * 2;
if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
return -1;
*r = '\\';
r++;
str_len++;
- if (*buf_size<str_len+len+1) {
+ if (*buf_size < str_len+len+1) {
*buf_size = *buf_size * 2;
if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
return -1;
*r = *s;
break;
case 0xA1:
- if (*(s+1) && 0xAC == *(s+1)) { // en/em backslash
+ if (*(s+1) && 0xAC == *(s+1)) { /* en/em backslash */
*r = '\\';
r++;
str_len++;
- if (*buf_size<str_len+len+1) {
+ if (*buf_size < str_len+len+1) {
*buf_size = *buf_size * 2;
if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
return -1;
*r = *s;
r++;
s++;
- if (*buf_size<str_len+len+1) {
+ if (*buf_size < str_len+len+1) {
*buf_size = *buf_size * 2;
if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
return -1;
}
break;
case 0x81:
- if (*(s+1) && 0x5F == *(s+1)) { // en/em backslash
+ if (*(s+1) && 0x5F == *(s+1)) { /* en/em backslash */
*r = '\\';
r++;
str_len++;
- if (*buf_size<str_len+len+1) {
+ if (*buf_size < str_len+len+1) {
*buf_size = *buf_size * 2;
if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
return -1;
*r = *s;
r++;
s++;
- if (*buf_size<str_len+len+1) {
+ if (*buf_size < str_len+len+1) {
*buf_size = *buf_size * 2;
if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
return -1;
#define INSERT_VMSG_OBJ pObject = (VObject*)calloc(1, sizeof(VObject)); \
if ( !pObject )\
{\
- vmsg_free_vtree_memory( pMessage );\
+ vmsg_free_vtree_memory(pMessage);\
return false;\
}\
if (pMessage->pTop == NULL)\
#define INSERT_VBODY_OBJ pObject = (VObject*)calloc(1, sizeof(VObject)); \
if ( !pObject )\
{\
- vmsg_free_vtree_memory( pMessage );\
+ vmsg_free_vtree_memory(pMessage);\
return false;\
}\
if (pBody->pTop == NULL)\
#define INSERT_VCARD_OBJ pObject = (VObject*)calloc(1, sizeof(VObject)); \
if ( !pObject )\
{\
- vmsg_free_vtree_memory( pMessage );\
+ vmsg_free_vtree_memory(pMessage);\
return false;\
}\
if (pCard->pTop == NULL)\
#define INSERT_PARAM param = (VParam*)calloc(1, sizeof(VParam));\
if (!param)\
{\
- vmsg_free_vtree_memory( pMessage );\
+ vmsg_free_vtree_memory(pMessage);\
if (pObject != NULL)\
{\
free(pObject);\
bool _convert_vdata_str_to_tm(const char* szText, struct tm * tm)
{
-
if (szText == NULL) return false;
if (strlen(szText) < 15) return false;
if (szText[8] != 'T') return false;
char szBuff[8]={0};
memset(tm, 0, sizeof(struct tm));
- // year, month, day
+ /* year, month, day */
memcpy(szBuff, &(szText[0]), 4);
szBuff[4] = '\0';
tm->tm_year = atol(szBuff) - 1900;
if ((tm->tm_mday > 31) || (tm->tm_mday < 1))
tm->tm_mday = 31;
- // hour, minute, second
+ /* hour, minute, second */
memcpy(szBuff, &(szText[9]), 2);
szBuff[2] = '\0';
tm->tm_hour = atol(szBuff);
return MSG_ERR_INVALID_PARAMETER;
}
-char* __msgsvc_vmsg_convert_tm_to_vdata_str( struct tm * tm)
+char* __msgsvc_vmsg_convert_tm_to_vdata_str(struct tm * tm)
{
char str[22] = {0, };
char APM[3] = {0, };
char month[15] = {0, };
int mon = 0;
int hour = 0;
- mon = tm->tm_mon +1;
+ mon = tm->tm_mon + 1;
if (tm->tm_hour >= 12)
- strcpy(APM,"PM");
+ strcpy(APM, "PM");
else
- strcpy(APM,"AM");
+ strcpy(APM, "AM");
if (tm->tm_hour > 12)
hour = tm->tm_hour - 12;
else
hour = tm->tm_hour;
- switch(mon)
- {
+ switch(mon) {
case 1:
- strcpy(month,"Jan");
+ strcpy(month, "Jan");
break;
case 2:
- strcpy(month,"Feb");
+ strcpy(month, "Feb");
break;
case 3:
- strcpy(month,"Mar");
+ strcpy(month, "Mar");
break;
case 4:
- strcpy(month,"Apr");
+ strcpy(month, "Apr");
break;
case 5:
- strcpy(month,"May");
+ strcpy(month, "May");
break;
case 6:
- strcpy(month,"Jun");
+ strcpy(month, "Jun");
break;
case 7:
- strcpy(month,"Jul");
+ strcpy(month, "Jul");
break;
case 8:
- strcpy(month,"Aug");
+ strcpy(month, "Aug");
break;
case 9:
- strcpy(month,"Sep");
+ strcpy(month, "Sep");
break;
case 10:
- strcpy(month,"Oct");
+ strcpy(month, "Oct");
break;
case 11:
- strcpy(month,"Nov");
+ strcpy(month, "Nov");
break;
case 12:
- strcpy(month,"Dec");
+ strcpy(month, "Dec");
break;
default:
MSG_DEBUG("invalid month number");
{
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, content_name[VMSG_INDICATION_MSG_BOX]);
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, content_name[VMSG_DATA_SEPARATOR]);
- switch(pMsg->folderId)
- {
+ switch(pMsg->folderId) {
case MSG_INBOX_ID:
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, content_name[VMSG_INDICATION_MSG_BOX_INBOX]);
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, content_name[VMSG_INDICATION_MSG_BOX_DRAFT]);
break;
default:
- // Discard User Defined, outbox or Spam folder's messages.
+ /* Discard User Defined, outbox or Spam folder's messages. */
MSG_DEBUG("Invalid or unhandled msg box");
}
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, MSGSVC_CRLF);
static inline int __msgsvc_vmsg_append_msg_type(MSG_MESSAGE_INFO_S *pMsg, char **buf, int *buf_size, int len)
{
- //TO DO check with msg text contains Only PrintableAscii if true then else handle INET_TYPE
+ /* TO DO check with msg text contains Only PrintableAscii if true then else handle INET_TYPE */
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, content_name[VMSG_INDICATION_MESSAGE_TYPE]);
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, content_name[VMSG_DATA_SEPARATOR]);
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, content_name[VMSG_INDICATION_MESSAGE_TYPE_MSG]);
strcpy(originAddress, pMsg->addressList[0].addressVal);
}
- needCharset = true; //as per android
+ needCharset = true; /* as per android */
if (strlen(originAddress) > 0) {
MSG_CONTACT_INFO_S contactInfo;
static inline int __msgsvc_vmsg_append_recipient_address_vcard(MSG_MESSAGE_INFO_S *pMsg, char **buf, int *buf_size, int len)
{
- //To do
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, content_name[BEGIN_VCARD]);
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, MSGSVC_CRLF);
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, content_name[VERSION_VCARD]);
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, MSGSVC_CRLF);
- needCharset = true; //as per android
+ needCharset = true; /* as per android */
- for(int i = 0; i < pMsg->nAddressCnt; ++i)
- {
+ for (int i = 0; i < pMsg->nAddressCnt; ++i) {
char originAddress[MAX_ADDRESS_VAL_LEN + 1] = {0, };
bool isDisplayName = false;
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, content_name[BEGIN_VBODY]);
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, MSGSVC_CRLF);
- //Date:
+ /* Date: */
tzset();
localtime_r(&(pMsg->displayTime), &display_time);
char *msgDate = __msgsvc_vmsg_convert_tm_to_vdata_str(&display_time);
g_free(msgDate);
}
- //Subject:
+ /* Subject: */
if (pMsg->subject[0] != '\0') {
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, content_name[VMSG_BODY_PROPERTY_SUBJECT]);
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, content_name[VMSG_DATA_SEPARATOR]);
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, MSGSVC_CRLF);
}
- //body:
- if(pMsg->msgType.mainType == MSG_SMS_TYPE)
- {
- if(pMsg->msgType.subType == MSG_NORMAL_SMS)
- {
- if (pMsg->bTextSms == false)
- {
+ /* body: */
+ if(pMsg->msgType.mainType == MSG_SMS_TYPE) {
+ if(pMsg->msgType.subType == MSG_NORMAL_SMS) {
+ if (pMsg->bTextSms == false) {
char* pFileData = NULL;
unique_ptr<char*, void(*)(char**)> buff(&pFileData, unique_ptr_deleter);
msgText = (char *)calloc(1, fileSize);
memcpy(msgText, pFileData, fileSize);
- MSGSVC_VMSG_APPEND_STR_FREE(buf,buf_size, len, msgText);
+ MSGSVC_VMSG_APPEND_STR_FREE(buf, buf_size, len, msgText);
g_free(msgText);
- }
- else
- {
- MSGSVC_VMSG_APPEND_STR(buf,buf_size, len, pMsg->msgText);
+ } else {
+ MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, pMsg->msgText);
}
}
}
static inline int __msgsvc_vmsg_append_msg_envelope(MSG_MESSAGE_INFO_S *pMsg, char **buf, int *buf_size, int len)
{
-
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, content_name[BEGIN_VENV]);
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, MSGSVC_CRLF);
VParam* param = NULL;
VTree * pBody = NULL;
VTree * pCard = NULL;
- VTree * pCurrent= NULL;
+ VTree * pCurrent = NULL;
struct tm display_time;
char* encoded_data = NULL;
VTree* pMessage = NULL;
- //to encode sms
+ /* to encode sms */
if (pMsg->msgType.mainType == MSG_SMS_TYPE && pMsg->msgType.subType == MSG_NORMAL_SMS) {
return MsgVMessageEncodeSMS(pMsg);
}
- //to encode mms
+ /* to encode mms */
if (pMessage == NULL) {
pMessage = (VTree *)malloc(sizeof(VTree));
if (!pMessage) {
pMessage->pTop = NULL;
pMessage->pCur = NULL;
pMessage->pNext = NULL;
-
}
pCurrent = pMessage;
- //Insert VObject (X-MESSAGE-TYPE) to VMessage tree
+ /* Insert VObject (X-MESSAGE-TYPE) to VMessage tree */
INSERT_VMSG_OBJ;
pObject->property = VMSG_TYPE_MSGTYPE;
if (pMsg->msgType.mainType == MSG_MMS_TYPE && (pMsg->msgType.subType == MSG_SENDREQ_MMS || pMsg->msgType.subType == MSG_SENDCONF_MMS))
pObject->pszValue[0] = strdup("MMS SEND");
#if 0
- else if(pMsg->msgType.mainType == MSG_MMS_TYPE && pMsg->msgType.subType == MSG_NOTIFICATIONIND_MMS)
+ else if (pMsg->msgType.mainType == MSG_MMS_TYPE && pMsg->msgType.subType == MSG_NOTIFICATIONIND_MMS)
pObject->pszValue[0] = strdup("MMS NOTIFICATION");
#endif
pObject->valueCount = 1;
- //Insert VObject (X-IRMC-BOX) to VMessate tree
+ /* Insert VObject (X-IRMC-BOX) to VMessate tree */
INSERT_VMSG_OBJ;
pObject->property = VMSG_TYPE_MSGBOX;
- switch(pMsg->folderId)
- {
+ switch(pMsg->folderId) {
case MSG_INBOX_ID:
pObject->pszValue[0] = strdup("INBOX");
break;
pObject->pszValue[0] = strdup("DRAFTBOX");
break;
default:
- // Discard User Defined or Spam folder's messages.
+ /* Discard User Defined or Spam folder's messages. */
goto __CATCH_FAIL__;
}
pObject->valueCount = 1;
- //Insert VObject (X-SS-DT) to VMessage tree
+ /* Insert VObject (X-SS-DT) to VMessage tree */
INSERT_VMSG_OBJ;
pObject->property = VMSG_TYPE_DATE;
pObject->valueCount = 1;
- //Insert Vobject read status to VMessage tree
+ /* Insert Vobject read status to VMessage tree */
INSERT_VMSG_OBJ;
pObject->property = VMSG_TYPE_STATUS;
pObject->valueCount = 1;
- //Insert VBody tree for message body;
+ /* Insert VBody tree for message body; */
pBody = (VTree*)calloc(1, sizeof(VTree));
if ( !pBody )
goto __CATCH_FAIL__;
pCurrent = pBody;
if (strlen(pMsg->subject) > 0) {
- //Insert Subject object
+ /* Insert Subject object */
INSERT_VBODY_OBJ;
pObject->property = VMSG_TYPE_SUBJECT;
pObject->pszValue[0] = strdup(pMsg->subject);
pObject->valueCount = 1;
}
- //Insert VBody object
+ /* Insert VBody object */
INSERT_VBODY_OBJ;
pObject->property = VMSG_TYPE_BODY;
if (pMsg->msgType.mainType == MSG_MMS_TYPE) {
- //Insert VBody for mms raw data;
+ /* Insert VBody for mms raw data; */
char* pFileData = NULL;
unique_ptr<char*, void(*)(char**)> buf(&pFileData, unique_ptr_deleter);
MMS_DATA_S *pMmsData = NULL;
int fileSize = 0;
char* msgText = NULL;
#if 0
- char filePath[MSG_FILEPATH_LEN_MAX] = {0, };
+ char filePath[MSG_FILEPATH_LEN_MAX] = {0, };
if(pMsg->msgType.subType == MSG_NOTIFICATIONIND_MMS)
pFileData = MsgOpenAndReadMmsFile(pMsg->msgData, 0, -1, &fileSize);
-
- else
- {
+ else {
err = MsgStoGetMmsRawFilePath(pDbHandle, pMsg->msgId, filePath);
if (err != MSG_SUCCESS)
if (pMsg->bTextSms == false) {
if (MsgOpenAndReadFile(pMsg->msgData, &pFileData, &fileSize) == false) {
- //CID 16205: Memory leak in case of failure
goto __CATCH_FAIL__;
}
} else {
int serializedDataSize = 0;
if (pMmsData) {
- MsgMmsSetMultipartListData(pMmsData);//app file -> data
+ MsgMmsSetMultipartListData(pMmsData); /* app file -> data */
serializedDataSize = MsgSerializeMms(pMmsData, &pFileData);
}
}
}
- // Insert parameter for base64 encoding
+ /* Insert parameter for base64 encoding */
MSG_DEBUG("before to start INSERT_PARAM");
INSERT_PARAM;
pObject->pParam = param;
param->parameter = VMSG_PARAM_ENCODING;
param->paramValue = VMSG_ENC_PARAM_BASE64;
- // Add VCard tree for recipient address information.
+ /* Add VCard tree for recipient address information. */
for (int i = 0; i < pMsg->nAddressCnt; ++i) {
pCard = (VTree*)calloc(1, sizeof(VTree));
if ( !pCard )
INSERT_VCARD_OBJ;
pObject->property = VCARD_TYPE_TEL;
- pObject->pszValue [0] = strdup(pMsg->addressList[i].addressVal);
+ pObject->pszValue[0] = strdup(pMsg->addressList[i].addressVal);
pObject->valueCount = 1;
}
MSG_DEBUG("before to start vmsg_encode");
return encoded_data;
__CATCH_FAIL__ :
- vmsg_free_vtree_memory( pMessage );
+ vmsg_free_vtree_memory(pMessage);
return NULL;
}
char *MsgVMessageEncodeSMS(MSG_MESSAGE_INFO_S *pMsg)
{
-
MSG_BEGIN();
char *buf = NULL;
if (token && token[0]) {
g_strstrip(token[0]);
strptime(token[0], "%I:%M%p", tm);
- }else {
+ } else {
g_strfreev(token);
return false;
}
*quoted = TRUE;
return TRUE;
}
- }else if (':' == *src) {
+ } else if (':' == *src) {
break;
}
src++;
*r = *n;
s++;
break;
- case 0xA1: // en/em backslash
+ case 0xA1: /* en/em backslash */
if (*(n+1) && 0xAC == *(n+1)) {
*r = *n;
r++;
s+=2;
}
break;
- case 0x81: // en/em backslash
+ case 0x81: /* en/em backslash */
if (*(n+1) && 0x5F == *(n+1)) {
*r = *n;
r++;
}
r++;
s++;
- }
- else {
+ } else {
*r = *s;
r++;
s++;
pMsg->bRead = false;
else
return MSG_ERR_INVALID_PARAMETER;
- MSG_DEBUG("pMsg->bRead = %d",pMsg->bRead);
+
+ MSG_DEBUG("pMsg->bRead = %d", pMsg->bRead);
return MSG_SUCCESS;
}
if (strcmp(temp, content_name[VMSG_INDICATION_MSG_BOX_DRAFT]) == 0) {
pMsg->folderId = MSG_DRAFT_ID;
- pMsg->direction=MSG_DIRECTION_TYPE_MO;
- pMsg->networkStatus=MSG_NETWORK_NOT_SEND;
+ pMsg->direction = MSG_DIRECTION_TYPE_MO;
+ pMsg->networkStatus = MSG_NETWORK_NOT_SEND;
}
else if (strcmp(temp, content_name[VMSG_INDICATION_MSG_BOX_INBOX]) == 0) {
pMsg->folderId = MSG_INBOX_ID;
- pMsg->direction=MSG_DIRECTION_TYPE_MT;
- pMsg->networkStatus=MSG_NETWORK_RECEIVED;
- }
- else if (strcmp(temp, content_name[VMSG_INDICATION_MSG_BOX_SENT]) == 0) {
+ pMsg->direction = MSG_DIRECTION_TYPE_MT;
+ pMsg->networkStatus = MSG_NETWORK_RECEIVED;
+ } else if (strcmp(temp, content_name[VMSG_INDICATION_MSG_BOX_SENT]) == 0) {
pMsg->folderId = MSG_SENTBOX_ID;
- pMsg->direction=MSG_DIRECTION_TYPE_MO;
- pMsg->networkStatus=MSG_NETWORK_SEND_SUCCESS;
- }
- else
+ pMsg->direction = MSG_DIRECTION_TYPE_MO;
+ pMsg->networkStatus = MSG_NETWORK_SEND_SUCCESS;
+ } else
return MSG_ERR_INVALID_PARAMETER;
- MSG_DEBUG("pMsg->folderId = %d",pMsg->folderId);
+
+ MSG_DEBUG("pMsg->folderId = %d", pMsg->folderId);
return MSG_SUCCESS;
}
pMsg->msgType.classType = MSG_CLASS_NONE;
}
else if (strcmp(temp, content_name[VMSG_INDICATION_MESSAGE_TYPE_INET]) == 0) {
- //To do
+ /* To do */
}
else
return MSG_ERR_INVALID_PARAMETER;
- MSG_DEBUG("pMsg->msgType.subType = %d",pMsg->msgType.subType);
+
+ MSG_DEBUG("pMsg->msgType.subType = %d", pMsg->msgType.subType);
return MSG_SUCCESS;
}
static inline msg_error_t __msgsvc_vmsg_get_address(MSG_MESSAGE_INFO_S *pMsg, char *prefix, char *val, int* vCardCnt)
{
char *temp;
- MSG_DEBUG("vCardCnt is : %d",*vCardCnt);
+ MSG_DEBUG("vCardCnt is : %d", *vCardCnt);
if ((pMsg->folderId == MSG_SENTBOX_ID || pMsg->folderId == MSG_DRAFT_ID) && *vCardCnt == 1)
return MSG_SUCCESS;
MSG_ADDRESS_INFO_S * addrInfo = NULL;
pMsg->nAddressCnt++;
- MSG_DEBUG("Address is : %s",temp);
- MSG_DEBUG("Address Cnt : %d",pMsg->nAddressCnt);
+ MSG_DEBUG("Address is : %s", temp);
+ MSG_DEBUG("Address Cnt : %d", pMsg->nAddressCnt);
if (pMsg->addressList == NULL) {
pMsg->addressList[pMsg->nAddressCnt-1].addressType = MSG_ADDRESS_TYPE_PLMN;
pMsg->addressList[pMsg->nAddressCnt-1].recipientType = MSG_RECIPIENTS_TYPE_TO;
strncpy(pMsg->addressList[pMsg->nAddressCnt-1].addressVal, temp, MAX_ADDRESS_VAL_LEN);
- MSG_DEBUG("pMsg->addressList[pMsg->nAddressCnt-1].addressVal = %s",pMsg->addressList[pMsg->nAddressCnt-1].addressVal);
+ MSG_DEBUG("pMsg->addressList[pMsg->nAddressCnt-1].addressVal = %s", pMsg->addressList[pMsg->nAddressCnt-1].addressVal);
return MSG_SUCCESS;
}
if (temp && temp[0] != '\0')
strncpy(pMsg->subject, temp, MAX_SUBJECT_LEN);
- MSG_DEBUG("pMsg->subject = %s",pMsg->subject);
+ MSG_DEBUG("pMsg->subject = %s", pMsg->subject);
return MSG_SUCCESS;
}
type = __msgsvc_vmsg_check_content_type(&cursor);
if (VMSG_VALUE_NONE == type) {
-
if (isDateAvailable == true) {
isDateAvailable = false;
- //body decoding
+ /* body decoding */
MSG_DEBUG("Decoding body :");
bodyStart = __msgsvc_vmsg_pass_unsupported(bodyStart);
- int i =0;
+ int i = 0;
char tempMsgText[MAX_MSG_TEXT_LEN + 1] = {0, };
while (bodyStart) {
if (i >= MAX_MSG_TEXT_LEN)
g_free(prefix);
g_free(val);
return MSG_SUCCESS;
- }else {
+ } else {
new_start = __msgsvc_vmsg_pass_unsupported(cursor);
if (new_start) {
cursor = new_start;
vmsg = __msgsvc_vmsg_check_word(vmsg, "BEGIN:VMSG");
MSG_ERR_RET_VM(NULL == vmsg, MSG_ERR_INVALID_PARAMETER, "Invalid parameter : The vmsg is invalid.");
- //check for mms()
+ /* check for mms() */
MMSsend = vmsg;
MMSretrieve = vmsg;
MMSnoti = vmsg;
MMSnoti = __msgsvc_vmsg_check_word(MMSnoti, "X-MESSAGE-TYPE:MMS NOTIFICATION");
MSG_ERR_RET_VM(NULL != MMSnoti, MSG_ERR_INVALID_MESSAGE, "Invalid parameter : The vmsg format is invalid.");
- //decode sms()
+ /* decode sms() */
__msgsvc_vmsg_initial();
vmsg = __msgsvc_vmsg_check_word(vmsg, "VERSION:1.1");
VObject* pParent;
VObject* pChild;
- char* pszGroupName; //VDATA_GROUPNAME_SUPPORTED
+ char* pszGroupName; /* VDATA_GROUPNAME_SUPPORTED */
};
struct _ValueObj
#endif /* __cplusplus */
-#endif // _VTYPES_H
+#endif /* _VTYPES_H */
extern "C" {
#endif /* __cplusplus */
-//#define ORG_ENABLE_TRACE
+/* #define ORG_ENABLE_TRACE */
#define FEATURE_SHIFT_JIS
#ifdef ORG_ENABLE_TRACE
#define USER_TAG "MSG_FW"
#define VDATA_TRACE(fmt, arg...) \
- do\
- {\
+ do {\
SLOG(LOG_DEBUG, USER_TAG, "\n[calendarui] %s:%d: " fmt "\n", __FUNCTION__, __LINE__, ##arg); \
} while (0)
#define SysRequireEx(expr, retValue) \
if (!(expr)) { \
- fprintf(stderr,"INVALID_PARAM (%d lines in %s)\n", __LINE__,__FILE__); \
+ fprintf(stderr, "INVALID_PARAM (%d lines in %s)\n", __LINE__, __FILE__); \
return retValue; }\
else {;}
#else
#define USER_TAG "MSG_SERVICE"
#define VDATA_TRACE(fmt, arg...) \
- do\
- {\
+ do { \
SLOG(LOG_DEBUG, USER_TAG, "\n[calendarui] %s:%d: " fmt "\n", __FUNCTION__, __LINE__, ##arg); \
} while (0)
#define SysRequireEx(expr, retValue)
#endif
-#define VDATA_TRACE_BEGINE //VDATA_TRACE(">>>>>> start. >>>>>>"); //usleep(1000);
-#define VDATA_TRACE_END //VDATA_TRACE(">>>>>> end. >>>>>>");
+#define VDATA_TRACE_BEGINE /* VDATA_TRACE(">>>>>> start. >>>>>>"); usleep(1000); */
+#define VDATA_TRACE_END /* VDATA_TRACE(">>>>>> end. >>>>>>"); */
/****************************************************************************************************/
/* FUNCTION DECLARATION */
/****************************************************************************************************/
-int _VIsSpace( char );
-int _VRLSpace( char * );
-int _VRTSpace( char * );
-int _VUnescape( char* );
-int _VEscape(char*);
-int _VManySpace2Space( char * );
-int _VB64Decode( char *, char * );
-int _VB64Encode( char *, char *, int );
-int _VUnfolding( char * );
-void _VFolding( char *, char * );
-int _VQPDecode( char * );
-int _VQPEncode( char *, char * );
+int _VIsSpace(char);
+int _VRLSpace(char *);
+int _VRTSpace(char *);
+int _VUnescape(char*);
+int _VEscape(char *);
+int _VManySpace2Space(char *);
+int _VB64Decode(char *, char *);
+int _VB64Encode(char *, char *, int);
+int _VUnfolding(char *);
+void _VFolding(char *, char *);
+int _VQPDecode(char *);
+int _VQPEncode(char *, char *);
-void _VFoldingQP( char *result, char *contentline );
-void _VFoldingNoSpace( char *result, char *contentline );
+void _VFoldingQP(char *result, char *contentline);
+void _VFoldingNoSpace(char *result, char *contentline);
int _VManyCRLF2CRLF(char *pIn);
-int _VUnfoldingNoSpec( char *string, int vType );
+int _VUnfoldingNoSpec(char *string, int vType);
#ifdef __cplusplus
}