OSF DCE Application Development Guide--Core Components
OSF DCE Application Development Guide—Core Components
needs of your application, you can use these RPC routines (cs_byte_* and wchar_t_*)
instead of providing your own routines.
If you do provide your own routines for buffer sizing and code set conversion, they must
follow a specific signature. See the reference pages for the cs_byte_*(3rpc) and
wchar_t_*(3rpc) routines for a complete description of the required signatures for these
routines.
When international character data is to be unmarshalled, a stub needs to have received a
description of the code set being used before it receives the data. For this reason, the
cs_char attribute cannot be applied to the base type of a pipe or to a type used in
constructing the base type of a pipe.
The cs_char attribute also cannot be applied to a type if there is an array that has this
type as a base type and the array has more than one dimension, or if the attributes
min_is, max_is, first_is, last_is,orstring have been applied to the array. As a result,
all instances of the type to which cs_char has been applied must be scalars or one-
dimensional arrays. Only the length_is and/or size_is attributes can be applied to these
arrays.
The following restrictions apply to the use of variables that appear in array attributes:
• Any parameter that is referenced by a size_is or length_is attribute of an array
parameter whose base type has the cs_char attribute cannot be referenced by any
attribute of an array parameter whose base type does not have the cs_char attribute.
• Any structure field that is referenced by a size_is or length_is attribute of an array
field whose base type has the cs_char attribute cannot be referenced by any attribute
of an array field whose base type does not have the cs_char attribute.
The cs_char attribute cannot interact with the transmit_as or represent_as attributes.
This restriction imposes the following rules:
• The cs_char attribute cannot be applied to a type that has the transmit_as attribute,
nor can it be applied to a type in whose definition a type with the transmit_as
attribute is used.
• The cs_char attribute cannot be applied to a type that has the represent_as
attribute, nor can it be applied to a type in whose definition a type with the
represent_as attribute is used.
• The cs_char attribute cannot be applied to the transmitted type specified in a
transmit_as attribute or to any type used in defining such a transmitted type.
The cs_char attribute cannot be applied to any type that is the type of the referent of a
pointer that has a max_is or size_is attribute applied to it. It also cannot be applied to
the base type of an array parameter that has the unique or ptr attribute applied to it.
An application that uses the cs_char ACF attribute cannot use the IDL encoding
services encode and decode ACF attributes.
Examples Using the cs_char Attribute
Arrays of cs_char can be fixed, varying, conformant, or conformant varying. The
treatment of a scalar cs_char is similar to that of a fixed array of one element. The
following examples show the relationship between IDL declarations and declarations in
the generated header file when the cs_char attribute has been applied. The examples
assume that the ACF contains the type definition:
18 − 22 Tandem Computers Incorporated 124245