TipcMsgGetNumFields


Name

TipcMsgGetNumFields — get the number of fields in a message

Synopsis

T_BOOL TipcMsgGetNumFields(msg, num_fields_return) 
T_IPC_MSG msg; 
T_INT4 *num_fields_return; 

Arguments

msg — message to get number of fields from

num_fields_return — storage for number of fields

Return Values

TRUE if the number of fields was successfully retrieved from the message, FALSE otherwise.

Diagnostics

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

Description

TipcMsgGetNumFields gets the number of fields in a message. While it is possible to calculate the number of fields by using TipcMsgTraverse, TipcMsgGetNumFields is much faster.

Caution

If TipcMsgGetNumFields returns FALSE, it does not store a value in num_fields_return.

See Also

TipcMsgTraverse

Examples

This example prints the number of fields in a message:

void print_num_fields(msg) 
T_IPC_MSG msg; 
{ 
  T_INT4 num_fields; 
 
  if (!TipcMsgGetNumFields(msg, &num_fields)) { 
    return;  /* error */ 
  }  
  TutOut("The message has %d fields.\n", num_fields); 
} /* print_num_fields */ 

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