aqhome: added AQH_Message_dup()
This commit is contained in:
@@ -51,6 +51,24 @@ AQH_MESSAGE *AQH_Message_new(void)
|
||||
|
||||
|
||||
|
||||
AQH_MESSAGE *AQH_Message_dup(const AQH_MESSAGE *origMsg)
|
||||
{
|
||||
if (origMsg) {
|
||||
AQH_MESSAGE *msg;
|
||||
|
||||
msg=AQH_Message_new();
|
||||
if (origMsg->msgPointer && origMsg->msgSize) {
|
||||
AQH_Message_SetData(msg, origMsg->msgPointer, origMsg->msgSize);
|
||||
msg->usedSize=origMsg->usedSize;
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AQH_Message_IncRef(AQH_MESSAGE *msg)
|
||||
{
|
||||
if (msg && msg->refCount)
|
||||
|
||||
@@ -25,6 +25,7 @@ GWEN_INHERIT_FUNCTION_LIB_DEFS(AQH_MESSAGE, AQHOME_API)
|
||||
|
||||
|
||||
AQHOME_API AQH_MESSAGE *AQH_Message_new(void);
|
||||
AQHOME_API AQH_MESSAGE *AQH_Message_dup(const AQH_MESSAGE *origMsg);
|
||||
AQHOME_API void AQH_Message_IncRef(AQH_MESSAGE *msg);
|
||||
AQHOME_API void AQH_Message_free(AQH_MESSAGE *msg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user