TipcFtToStr


Name

TipcFtToStr — convert a field type to a string

Synopsis

T_BOOL TipcFtToStr(ft, ft_str_return) 
T_IPC_FT ft; 
T_STR *ft_str_return; 

Arguments

ft — field type to convert

ft_str_return — storage for string

Return Values

TRUE if the field type was successfully converted to a string, FALSE otherwise.

Diagnostics

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

Description

TipcFtToStr converts a field type, such as T_IPC_FT_REAL8, to a lower-case string, such as REAL8.

Caution

If TipcFtToStr returns FALSE, it does not store a value in ft_str_return.

The value stored in ft_str_return points directly into an internal data structure and should not be modified.

See Also

TipcStrToFt

Examples

This example converts all the field types in a message to strings and prints the strings out:

T_PTR print_one_field(msg, trav, arg) 
T_IPC_MSG msg; 
T_IPC_MSG_TRAV trav; 
T_PTR arg; /* really (T_INT4 *) */ 
{ 
  T_STR str; 
  T_IPC_FT type = (T_IPC_FT)*(trav->type_ptr); 
  T_INT4 *counter_ptr = (T_INT4 *)arg; 
 
  (*counter_ptr)++; 
  if (!TipcFtToStr(type, &str)) { 
    return;  /* error */ 
  }  
  TutOut("Field %d has type %s (%d).\n", 
          *counter_ptr, str, type); 
 
  return NULL; /* continue traversal */ 
} /* print_one_field */ 
 
void print_one_message(msg) 
T_IPC_MSG msg; 
{ 
  T_INT4 counter = 0; 
  TipcMsgTraverse(msg, print_one_field, &counter); 
} /* print_one_message */ 

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