tpconvert
-convert 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:
TPCONVCLTID
TPCONVTRANID
TPCONVXID
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.
tpconvert
() returns -1 on failure and sets tperrno
to indicate the error condition.
Under the following conditions, tpconvert
() fails and sets tperrno
to one of the following values.
TPEINVAL
]
strrep
or binrep
is a NULL pointer, or flags
does not indicate exactly one structure type.
TPEOS
]
Uunixerr
.
TPESYSTEM
]
This interface is available only on BEA TUXEDO Release 5.0 or later. This interface is available on workstation platforms.
tpservice
(3), tpresume
(3), tpsuspend
(3), tx_info
(3), TM_MIB
(5)