OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
CHECK_STATUS(TRUE, "rpc_server_unregister_if", status, expected);
(void)pthread_mutex_destroy(&mutex);
}
ENDTRY;
}
15.3.5 Writing the Client Code
A programmer who is developing an RPC client that supports character and code set
interoperability needs to add the following steps to the client code in addition to the
basic functions for RPC:
1. Setting the client’s locale
2. Establishing a character and code set compatibility evaluation routine that the NSI
server binding import routines will call to evaluate potential servers for character
and code set compatibility
The next sections explain these steps in detail.
15.3.5.1 Setting the Client’s Locale
The first step in developing an internationalized RPC client is to add a call within the
client code to a platform-specific function that sets the locale environment for the client.
This step establishes
The name of the client’s local code set.
The names of the code sets for which converters exist on the host and, consequently,
into which processes that run on the host can convert if necessary.
The call to the locale-setting function must be the first call made within the client code.
An example of a locale-setting function is the POSIX, XPG3, XPG4 setlocale( ) function,
which is defined in locale.h.
The locale-setting function also establishes the value for two platform-specific macros
that indicate
The maximum number of bytes the local code set uses to encode one character.
The maximum number of bytes that any of the supported code sets on the host will
use to encode one character.
On the POSIX, XPG3, XPG4 platform, these macros are MB_CUR_MAX and
MB_LEN_MAX and are defined in stdlib.h and limits.h, respectively. The buffer-
sizing routines use the MB_CUR_MAX macro when calculating the size of a new buffer
to hold converted character data.
Note that all hosts that are members of an internationalized DCE cell must provide
converters that convert between their supported code sets and the ISO 10646
15 22 Tandem Computers Incorporated 124245