C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

MB_CUR_MAX Macro
The MB_CUR_MAX macro specifies the maximum number of bytes used in representing a
multibyte character in the current locale (category LC_CTYPE). The MB_CUR_MAX macro is
defined in the header stdlibh as:
#define MB_CUR_MAX 2
Conversion Functions
The five run-time library functions that manage multibyte characters and wide characters are:
DescriptionFunction
Determines the length of a multibyte character.mblen()
Converts a multibyte character to a wide character.mbtowc()
Converts a wide character to a multibyte character.wctomb()
Converts a string of multibyte characters to a string of wide characters.mbstowcs()
Converts a string of wide characters to a string of multibyte characters.wcstombs()
Alignment Issues
TNS C and C++ considers objects of integral types to exist only on word boundaries. Consequently,
it is invalid to use an odd-byte address to access such an object. On TNS systems, if an integral
type extended pointer contains an odd-byte address, the system ignores the last bit of the address
and accesses the object in the even address one byte below. On TNS/R and TNS/E systems, the
results of using an integral type extended pointer containing an odd-byte address are undefined.
The code might continue executing or trap. Therefore, it is important for you to ensure that all
extended pointers contain addresses that are even except for pointers to char. Extended pointers
are those of type long int or those of type int with the 32-bit (wide) data model in effect, in which
case an int is represented by 32 bits.
TNS systems are word-aligned. In this example, the size of str differs depending on whether this
code is executed on a word-aligned or byte aligned machine. On a word aligned machine str
is allocated 6 bytes of storage. On a byte-aligned machine, str is allocated 5 bytes of storage.
On the TNS system, str is allocated 6 bytes of storage.
Struct tag{
char c[3];
int x;
} str;
Implementation-Defined Behavior of TNS C 417