TipcMsgReadVa read fields from a message (va_list
version)
msg
message to read fields from
var_arg_list
argument list
TRUE
if all the fields were successfully read, FALSE
otherwise.
If TipcMsgReadVa fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcMsgReadVa is the non-varargs
version of TipcMsgRead. (TipcMsgRead actually calls TipcMsgReadVa.) TipcMsgReadVa can be used to implement a varargs
function.
In the C language, a varargs
function (one that takes a variable number of arguments) cannot call another varargs
function with the original arguments. A varargs
function can (and usually does) call a helper function that takes a fixed number of arguments, with the last argument usually of type va_list
. TipcMsgReadVa is TipcMsgRead’s helper function.
None
TipcMsgRead, TipcMsgUpdateNamedBinary, TipcMsgNext* (TipcMsgNextBinary through TipcMsgNextXml)
This example shows how to write a varargs
function in ANSI C that reads fields from a message and then destroys the message:
T_BOOL my_msg_read_destroy(T_IPC_MSG msg, ...) { va_list var_arg_list; int read_status; int destroy_status; va_start(var_arg_list, msg); read_status = TipcMsgReadVa(msg, var_arg_list); va_end(var_arg_list); destroy_status = TipcMsgDestroy(msg);/* return FALSE if either status is FALSE */
return read_status && destroy_status; }/* my_msg_read_destroy */
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |