rpc_rgy_get_max_bytes- obtains the maximum number of encoding bytes used by a code set from the code set registry on a host
void rpc_rgy_get_max_bytes( unsigned32 rgy_code_set_value, unsigned16 *rgy_max_bytes, error_status_t *status);
- The registered hexadecimal value that uniquely identifies the code set.
- The registered decimal value that indicates the maximum number of bytes used by the specified code set to encode one character.
- Returns the status code from this routine. This status code indicates whether the routine completed successfully or, if not, why not.
Possible status codes and their meanings include:
Cannot open the code set registry file.
Cannot read the code set registry file.
No local code set name exists in the code set registry.
Value not found in the code set registry.
The rpc_rgy_get_max_bytes() routine reads the code set registry on the local host and returns the decimal value that indicates the maximum number of bytes that the specified code set uses to encode one character. The routine is used for character and code set interoperability, which permits clients and servers to transfer international character data in a heterogeneous character set and code sets environment.
The existing code set conversion buffer sizing routines use the rpc_rgy_get_max_bytes() routine as part of their procedure to determine whether additional storage must be allocated for conversion between local and network code sets. These 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 international character data over the network (the network code set), then call it again to get the rgy_max_bytes value of the local code set, and finally compare the values to determine whether existing buffer space is adequate.
Because the cs_byte_net_size(), cs_byte_local_size(), wchar_t_net_size(), and wchar_t_local_size() buffer sizing routines call the rpc_rgy_get_max_bytes() routine on the caller's client and server applications that call them do not need to call rpc_rgy_get_max_bytes() explicitly. Further character conversion buffer sizing implementations may need to make use of the rpc_rgy_get_max_bytes() routine.
Please note that the html version of this specification may contain formatting aberrations. The definitive version is available as an electronic publication on CD-ROM from The Open Group.