TipcBufMsgAppend


Name

TipcBufMsgAppend — append a message to a T_BUF object

Synopsis

T_BOOL TipcBufMsgAppend(buf, msg) 
T_BUF buf; 
T_IPC_MSG msg; 

Arguments

buf — buffer to hold the message

msg — msg to append

Return Values

TRUE if the append was successful, FALSE if not.

Diagnostics

If TipcMsgMsgAppend fails, it returns FALSE. It does not set the global error number.

Description

Appends a normal SmartSockets message to a T_BUF object created by TutBufCreate.

Caution

This function is only needed under unusual circumstances, such as for storing a complete SmartSockets message, rather than the contents of the message, in a database.

See Also

TipcBufMsgNext; see the TIBCO SmartSockets Utilities for information on TutBufCreate and TutBufDestroy.

Examples

This example creates a T_BUF object and a message, then stores the message in the buffer:

T_IPC_MSG msg; 
T_IPC_MT mt; 
T_BUF buf; 
 
buf = TutBufCreate(128); 
if (buf == NULL) { 
  return;  /* error */  
}  
 
mt = TipcMtLookupByNum(T_MT_INFO); 
if (mt == NULL) { 
  return;  /* error */ 
}  
msg = TipcMsgCreate(mt); 
if (msg == NULL) { 
  return;  /* error */ 
} 
TipcMsgAppendStr(msg, "hiya!"); 
TipcBufMsgAppend(buf, msg); 

TIBCO SmartSockets™ Application Programming Interface
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com