TipcMsgNextStr


Name

TipcMsgNextStr — get a STR field from a message

Synopsis

T_BOOL TipcMsgNextStr(msg, str_return) 
T_IPC_MSG msg; 
T_STR *str_return; 

Arguments

msg — message to get field from

str_return — storage for STR value from field

Return Values

TRUE if the field was successfully retrieved from the message, FALSE otherwise.

Diagnostics

If TipcMsgNextStr fails, it returns FALSE and sets the global SmartSockets error number to one of:

Description

TipcMsgNextStr retrieves the value of the current field of a message, which must be a STR (null-terminated character string) field. If TipcMsgNextStr succeeds, it advances the current field to the next field in the message.

TipcMsgNextStr converts the field into the data format used by this process, if necessary.

Caution

If TipcMsgNextStr returns FALSE, it does not store a value in str_return.

Do not modify the value stored in str_return. It points directly into an internal data structure.

See Also

TipcMsgAppendStr, TipcMsgAppendStrPtr

Examples

This example creates a message, appends a STR field, and reads the field back from the message:

T_IPC_MT mt; 
T_IPC_MSG msg; 
T_STR str_val; 
 
#define USER_MT_STR_TEST 100 
mt = TipcMtCreate("str_test", USER_MT_STR_TEST, "str"); 
if (mt == NULL) { 
  return;  /* error */ 
} 
 
msg = TipcMsgCreate(mt); 
if (msg == NULL) { 
  return;  /* error */ 
} 
 
if (!TipcMsgAppendStr(msg, "Now is the time")) { 
  return;  /* error */ 
}  
if (!TipcMsgSetCurrent(msg, 0)) { 
  return;  /* error */ 
}  
if (!TipcMsgNextStr(msg, &str_val)) { 
  return;  /* error */ 
}  
TutOut("str_val == %s\n", str_val); 

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