Passing pointers from PL/I to C

Pointers to various data objects can be passed from PL/I and accepted by a function written in C.

Because the C #pragma linkage(PLI) specifies that pointers, unlike other parameters, are passed directly, an extra level of indirection is added when passing a pointer value from PL/I to C. If PL/I passes or returns a pointer to a type, C receives a pointer to a pointer to the type.

PL/I parameters that require a locator or descriptor should not be passed directly. This includes parameters that are structures, arrays, or strings. These parameters can be passed indirectly from PL/I by using a pointer to the associated data. For more information about data descriptors, see the IBM Enterprise PL/I for z/OS library.

The non-address bits in all fullword pointers declared in PL/I source code must always be zero. If they are not, results are unpredictable.