Tuxedo
0

ATMI C Function Reference

 Previous Next Contents View as PDF  

tpconvmb(3c)

Name

tpconvmb()—Converts encoding of characters in an input buffer to a named target encoding.

Synopsis

#include <atmi.h>
extern int tperrno;
int
tpconvmb (char **bufp, int *len, char *target_encoding, long flags)

Description

This function is used to convert an input buffer to a desired codeset encoding.

This fuction is added for user convenience and is not required for normal codeset data conversion that is done automatically.

The bufp argument is a valid pointer to an MBSTRING typed buffer message. This pointer will be reallocated internally if the size of the buffer is insufficient to handle the output data of the converted buffer.

The len argument, on input, contains the number of bytes that need to be converted. Upon successful completion of conversion it will contain the number of bytes used in bufp.

The target_encoding argument is the target codeset encoding name used to convert the typed buffer provided in the bufp message.

The flags argument is not used by the Tuxedo conversion code. It will be passed along to the buffer type switch function for user defined conversion functions.

Return Values

Upon success, tpconvmb() returns 0. This function returns -1 on error and sets tperrno as described below. The function may fail for the following reasons.

[TPEINVAL]

target_encoding, len, or bufp arguments are NULL. len or target_encoding is invalid.

[TPEPROTO]

bufp translates to a Tuxedo buffer that does not have a buffer typeswitch conversion function

[TPESYSTEM]

A Tuxedo system error has occurred. (e.g. bufp does not correspond to a valid Tuxedo buffer).

[TPEOS]

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

See Also

tpalloc(3c), tpgetmbenc(3c), tpsetmbenc(3c)

 

Back to Top Previous Next
Contact e-docsContact BEAwebmasterprivacy