OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
To build an application that uses presented and transmitted types, you must write
routines to perform conversions between the types and to manage storage for the types,
and you must link those routines with your application code. At runtime, the client and
server stubs call these routines before sending and after receiving data of these types.
The following paragraphs specify C prototypes for generic binding and unbinding
routines; in these prototypes, PRES is the name of the presented type and TRANS is the
name of the transmitted type.
The PRES _to_xmit() routine allocates storage for the transmitted type and converts
from the presented type to the transmitted type:
void PRES_to_xmit (PRES *presented, TRANS ** transmitted)
The PRES _from_xmit( ) routine converts from the transmitted type to the presented type
and allocates any storage referenced by pointers in the presented type:
void PRES_from_xmit (TRANS *transmitted, PRES *presented)
The PRES_free_inst( ) routine frees any storage referenced by pointers in the presented
type by PRES_from_xmit():
void PRES_free_inst (PRES *presented)
Suppose that the transmit_as attribute appears either on the type of a parameter or on a
component of a parameter and that the parameter has the out or in,out attribute. Then,
the PRES_free_inst() routine will be called automatically for the data item that has the
transmit_as attribute.
Suppose that the transmit_as attribute appears on the type of a parameter and that the
parameter has only the in attribute. Then, the PRES_free_inst() routine will be called
automatically.
Finally, suppose that the transmit_as attribute appears on a component of a parameter
and that the parameter has only the in attribute. Then, the PRES_free_inst() routine will
not be called automatically for the component; the manager application code must
release any resources that the component uses, possibly by explicitly calling the
PRES_free_inst() routine.
The PRES_free_xmit() routine frees any storage that has been allocated for the
transmitted type by PRES_to_xmit():
void PRES_free_xmit (TRANS *transmitted)
A type with the transmit_as attribute cannot have other type attributes, specifically the
following:
A pipe type.
A pipe element type.
A type with the context_handle attribute.
A type of which any instance has the context_handle attribute.
17 66 Tandem Computers Incorporated 124245