PreviousNext

rpc_rgy_get_max_bytes(3rpc)

Gets the maximum number of bytes that a code set uses to encode one character from the code set registry on a host

Used by client and server applications.

Synopsis

#include <dce/rpc.h>

void rpc_rgy_get_max_bytes(

unsigned32 rgy_code_set_value,

unsigned16 *rgy_max_bytes,

error_status_t *status);

Parameters

Input

rgy_code_set_value
The registered hexadecimal value that uniquely identifies the code set.

Output

rgy_max_bytes
The registered decimal value that indicates the number of bytes this code set uses to encode one character.

status
Returns the status code from this routine. This status code indicates whether the routine completed successfully or, if not, why not.

Description
The rpc_rgy_get_max_bytes( ) routine belongs to a set of DCE RPC routines for use by client and server applications that are transferring international character data in a heterogeneous character set and code sets environment.

The rpc_rgy_get_max_bytes( ) routine reads the code set registry on the local host. It takes the specified registered code set value, uses it as an index into the registry, and returns the decimal value that indicates the number of bytes that the code set uses to encode one character.

The DCE RPC stub support routines for buffer sizing use the rpc_rgy_get_max_bytes( ) routine as part of their procedure to determine whether additional storage needs to be allocated for conversion between local and network code sets. The DCE RPC stub support routines call the rpc_rgy_get_max_bytes( ) routine once to get the rgy_max_bytes value for the code set to be used to transfer the data over the network (the "network" code set) then call the routine again to get the rgy_max_bytes value of their local code set. The stubs then compare the two values to determine whether or not additional buffers are necessary or whether the conversion can be done "in place".

Client and server applications that use the DCE RPC buffer sizing routines byte_net_size( ), byte_local_size( ), wchar_t_net_size( ), and wchar_t_local_size( ) do not need to call this routine explicitly because these DCE RPC stub support routines call it on their behalf. Application programmers who are developing their own stub support routines for buffer sizing can use the rpc_rgy_get_max_bytes( ) routine in their code to get code set max_byte information for their user-written buffer sizing routines.

Permissions Required
No permissions are required.

Return Values
No value is returned.

Errors

The following describes a partial list of errors that might be returned. Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages.

dce_cs_c_cannot_open_file

dce_cs_c_cannot_read_file

dce_cs_c_notfound

dce_cs_c_unknown

rpc_s_ok

Related Information
Commands:
csrc(8dce) in the OSF DCE Command Reference

Functions: dce_cs_loc_to_rgy(3rpc)

dce_cs_rgy_to_loc(3rpc)

rpc_ns_mgmt_read_codesets(3rpc)

rpc_rgy_get_codesets(3rpc)