TipcFtToStr convert a field type to a string
ft
field type to convert
ft_str_return
storage for string
TRUE
if the field type was successfully converted to a string, FALSE
otherwise.
If TipcFtToStr fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcFtToStr converts a field type, such as T_IPC_FT_REAL8, to a lower-case string, such as REAL8.
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.
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 |