ATMI C Function Reference
tpgetmbenc()
—Gets the code-set encoding name from a typed buffer.
#include <atmi.h>
extern int tperrno;
int
tpgetmbenc (char *bufp, char *enc_name, long flags)
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.
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.