Skip navigation.

ATMI C Function Reference

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

 


tpgetmbenc(3c)

Name

tpgetmbenc()—Gets the code-set encoding name from a typed buffer.

Synopsis

#include <atmi.h>
extern int tperrno;
int
tpgetmbenc (char *bufp, char *enc_name, long flags)

Description

This function is used to get the codeset encoding name sent with a typed buffer. This name can be compared to a target codeset if a conversion is required (see tpconvmb(3c)).

The bufp argument is a valid pointer to a typed buffer message.

The enc_name argument will be set to the encoding name, found in bufp, upon successful execution of this function. The returned string will be NULL terminated. The user must take care to allocate a buffer large enough to hold the encoding name plus the NULL terminator (see NL_LANGMAX in <limits.h>). An MBSTRING typed buffer without the encoding name set is invalid.

The flags argument is not currently used and should be set to zero.

Return Values

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

[TPEINVAL]

enc_name or bufp argument is NULL.

[TPEPROTO]

This error occurs if bufp cannot provide an encoding name.

[TPESYSTEM]

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

See Also

tpalloc(3c), tpconvmb(3c), tpsetmbenc(3c)

 

Skip navigation bar  Back to Top Previous Next