ATMI C Function Reference
tpconvert()
—Converts structures to/from string representations.
#include <atmi.h>
#include <xa.h>
int tpconvert(char *strrep, char *binrep, long flags)
tpconvert()
converts the string representation of interface structures (strrep
) to or from the binary representation (binrep
).
Both the direction of the conversion and the interface structure type are determined from the flags
argument. To convert a structure from binary representation to string representation, the programmer must set the TPTOSTRING
bit in flags
. To convert a structure from string to binary the programmer must clear the bit. The following flags are defined to indicate the particular structure type to be converted; only one may be specified at a time:
For conversions from binary to string representation, strrep
should be at least TPCONVMAXSTR
characters in length.
Note that unequal string versions of TPTRANID
and XID
values may be considered equal
by the system when accessing TM_MIB(5) classes that allow these values as key fields (for example, T_TRANSACTION
or T_ULOG
). Therefore, string values for these data types should not be fabricated or manipulated by application programs. TM_MIB(5) guarantees that only objects matching the global transaction identified by the string are returned when one of these values is used as a key field.
A thread in a multithreaded application may issue a call to tpconvert()
while running in any context state, including TPINVALIDCONTEXT
.
Upon failure, tpconvert()
returns -1 and sets tperrno
to indicate the error condition.
Under the following conditions, tpconvert()
fails and sets tperrno
to one of the following values:
Invalid arguments were specified. strrep
or binrep
is a NULL pointer, or flags
does not indicate exactly one structure type.
An operating system error has occurred. A numeric value representing the system call that failed is available in Uunixerr
.
A BEA Tuxedo system error has occurred. The exact nature of the error is written to userlog(3c)
.
This interface is available only on BEA Tuxedo ATMI release 5.0 or later. This interface is available on workstation platforms.
tpresume(3c)
, tpservice(3c)
, tpsuspend(3c)
, tx_info(3c)
, TM_MIB(5)