📄 mfreemms.c
字号:
/*
* Copyright (C) Obigo AB, 2002-2005.
* All rights reserved.
*
* This software is covered by the license agreement between
* the end user and Obigo AB, and may be
* used and copied only in accordance with the terms of the
* said agreement.
*
* Obigo AB assumes no responsibility or
* liability for any errors or inaccuracies in this software,
* or any consequential, incidental or indirect damage arising
* out of the use of the software.
*
*/
#include "cansilib.h"
#include "cmnconf.h"
#include "aapifile.h"
#include "aapicmn.h"
#include "gmem.h"
#include "fldrmgr.h"
#include "mmsconf.h"
#include "mmstypes.h"
#include "mmem.h"
#include "mutils.h"
#include "mfreemms.h"
void freeMmsAddress(MmsAddress *address)
{
M_FREE(address->name.text);
address->name.text = NULL;
if (address->address != NULL)
{
M_FREE(address->address);
address->address = NULL;
}
}
void freeMmsEncodedText(MmsEncodedText *encodedText)
{
if (encodedText != NULL)
{
if (encodedText->text != NULL)
{
M_FREE(encodedText->text);
}
M_FREE(encodedText);
}
}
void freeMmsReadOrigInd(MmsReadOrigInd *mmsOrigInd)
{
if (mmsOrigInd != NULL)
{
freeMmsAddress(&mmsOrigInd->from);
M_FREE(mmsOrigInd->serverMessageId);
M_FREE(mmsOrigInd);
}
}
void freeMmsBodyPart(MmsBodyPart *mmsBodyPart)
{
if (mmsBodyPart != NULL)
{
if(mmsBodyPart->storageType == MMS_BODY_PART_AS_BUFFER &&
mmsBodyPart->data.buffer != NULL)
{
M_FREE(mmsBodyPart->data.buffer);
mmsBodyPart->data.buffer = NULL;
}
M_FREE(mmsBodyPart);
}
}
void freeMmsMessagePart(MmsMessagePart *mmsMessagePart, MmsMsgType msgType)
{
if (mmsMessagePart != NULL)
{
if (msgType == MMS_MSG_HEADER)
{
freeMmsHeader(&mmsMessagePart->header);
}
else if(msgType == MMS_MSG_NOTIFICATION)
{
freeMmsNotification(&mmsMessagePart->notification);
}
else if(msgType == MMS_MSG_INFO)
{
freeMmsMessageInfo(&mmsMessagePart->messageInfo);
}
M_FREE(mmsMessagePart);
}
}
void freeMmsCharStr(char *mmsCharStr)
{
if (mmsCharStr != NULL)
{
M_FREE(mmsCharStr);
}
}
void freeMmsMsgIdList(MmsMsgId *allIds)
{
if (allIds != NULL)
{
M_FREE(allIds);
}
}
void freeMmsTimeSecList(MmsTimeSec *msgDates)
{
if (msgDates != NULL)
{
M_FREE(msgDates);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -