BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   Tuxedo Doc Home   |   Reference   |   Topic List   |   Previous   |   Next   |   Contents

   BEA Tuxedo C Function Reference

tpconvert(3c)

Name

tpconvert() - convert structures to/from string representations

Synopsis

#include <atmi.h>
#include <xa.h>

int tpconvert(char *strrep, char *binrep, long flags)

Description

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

Convert CLIENTID (see atmi.h).

TPCONVTRANID

Convert TPTRANID (see atmi.h).

TPCONVXID

Convert XID (see xa.h).

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.

Return Values

Upon failure, tpconvert() returns -1 and sets tperrno() to indicate the error condition.

Errors

Under the following conditions, tpconvert() fails and sets tperrno() to one of the following values.

[TPEINVAL]

Invalid arguments were specified. strrep or binrep is a NULL pointer, or flags does not indicate exactly one structure type.

[TPEOS]

An operating system error has occurred. A numeric value representing the system call that failed is available in Uunixerr.

[TPESYSTEM]

A BEA Tuxedo system error has occurred. The exact nature of the error is written to userlog(3c).

Portability

This interface is available only on BEA Tuxedo Release 5.0 or later. This interface is available on workstation platforms.

See Also

tpresume(3c), tpservice(3c), tpsuspend(3c), tx_info(3c), TM_MIB(5)