TipcMsgAppendMsgArray append a field containing an array of MSG fields to a message
T_BOOL TipcMsgAppendMsgArray(msg, msg_array_data, array_size
) T_IPC_MSGmsg
; T_IPC_MSG *msg_array_data
; T_INT4array_size
;
msg
message to append field to
msg_array_data
data for new message field
array_size
number of elements in msg_array_data
TRUE
if the field was successfully appended to the message, FALSE
otherwise.
If TipcMsgAppendMsgArray fails, it returns FALSE
and sets the global SmartSockets error number to one of:
msg
was null or msg_array_data
was nullmsg
was not a valid message or one of the messages in msg_array_data
was not a valid messagearray_size
was negativemsg_array_data
and msg
were the same message (a message cannot be appended to itself)
TipcMsgAppendMsgArray appends a message array (MSG_ARRAY) field containing msg_array_data
to the end of a message’s data. TipcMsgAppendMsgArray makes a copy of the message array data.
None
TipcMsgAppendMsgArrayPtr, TipcMsgNextMsgArray
This example creates a message and appends a MSG_ARRAY field:
T_IPC_MT mt; T_IPC_MSG msg; #define ARRAY_SIZE 3 T_IPC_MSG msg_array_data[ARRAY_SIZE]; #define USER_MT_CONTAINER 3 mt = TipcMtCreate("container", USER_MT_CONTAINER, "msg_array"); if (mt == NULL) {return
; /* error */
} msg = TipcMsgCreate(mt); if (msg == NULL) {return
; /* error */
}/* An RTclient would typically set the destination of */
/* a message at this point by calling TipcMsgSetDest. */
mt = TipcMtLookupByNum(T_MT_TIME); if (mt == NULL) {return
; /* error */
} msg_array_data[0] = TipcMsgCreate(mt); if (msg_array_data[0] == NULL) {return
; /* error */
} mt = TipcMtLookupByNum(T_MT_NUMERIC_DATA); if (mt == NULL) {return
; /* error */
} msg_array_data[1] = TipcMsgCreate(mt); if (msg_array_data[1] == NULL) {return
; /* error */
} mt = TipcMtLookupByNum(T_MT_END_OF_FRAME); if (mt == NULL) {return
; /* error */
} msg_array_data[2] = TipcMsgCreate(mt); if (msg_array_data[2] == NULL) {return
; /* error */
} if (!TipcMsgAppendReal8(msg_array_data[0], TutGetWallTime())) {return
; /* error */
} if (!TipcMsgAppendStrReal8(msg_array_data[1], "speed_limit", 55.0)) {return
; /* error */
} if (!TipcMsgAppendMsgArray(msg, msg_array_data, ARRAY_SIZE)) {return
; /* error */
}/* A process would typically send a message at this point by */
/* calling TipcConnMsgSend or TipcSrvMsgSend. */
/* A process would typically destroy a message at this point by */
/* calling TipcMsgDestroy. */
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |