TipcConnMsgWriteVa construct a message and send it through a connection (va_list
version)
T_BOOL TipcConnMsgWriteVa(conn
,mt
,var_arg_list
) T_IPC_CONNconn
; T_IPC_MTmt
; va_listvar_arg_list
;
conn
connection to send message through
mt
message type
var_arg_list
argument list
TRUE
if the message was successfully constructed and sent, FALSE
otherwise.
If TipcConnMsgWriteVa fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcConnMsgWriteVa is the non-varargs version of TipcConnMsgWrite (TipcConnMsgWrite actually calls TipcConnMsgWriteVa). TipcConnMsgWriteVa 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 usually calls a helper function that takes a fixed number of arguments, with the last argument usually of type va_list
. TipcConnMsgWriteVa is TipcConnMsgWrite’s helper function.
None
TipcConnMsgWrite, TipcConnMsgWriteVa
This example shows how to write a varargs
function in ANSI C that constructs a message and sends it on a predefined connection:
extern T_IPC_CONN my_conn;
T_BOOL my_conn_msg_write(T_IPC_MT mt,
...)
{
va_list var_arg_list;
T_BOOL status;
va_start(var_arg_list, mt);
status = TipcConnMsgWriteVa(my_conn, mt, var_arg_list);
va_end(var_arg_list);
return status;
} /* my_conn_msg_write */
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |